Coding a Clickable NPC | Packet Reader | (Ep. 2) Spigot 1.17.x

Опубликовано: 10 Март 2026
на канале: CodedRed
11,162
254

Wow, no wonder why y'all wanted to see an updated version of this... 1.17 NMS really ruined the packet reader :( In this video, I went over how I manage to perform clickable packet events with a packet reader. However, there are many other ways to handle a clickable packet event! I will hopefully make videos on the other ways soon but below I listed other techniques.

Other ways to handle custom packet events:

1: Use papermc spigot fork API.
In papermc there is an event called "PlayerUseUnknownEntityEvent" which detects unknown entity events. However, when using this event it will only work for servers running paper!

2: Use ProtocolLib!
ProtocolLib is a great API for packets, check this discussion: https://www.spigotmc.org/threads/righ...

3: Use ArmorStands
Although this method seems simple... it is a pain to handle which armor stand corresponds to which NPC. Also is a "buggy" but simplistic method.


➼ Death/Damage Event code: https://pastebin.com/BF685njZ
➼ RightClickNPCEvent code: https://pastebin.com/TNbT826x

➼ Previous Video:    • Creating a Corpse Entity | (Ep. 1) Spigot ...  
➼ 1.16 R3 Corpse code: https://pastebin.com/KS6wpQDi

➼ Want more videos?
Become a Patreon support to gain access to more videos!

➼ Get more involved:
Patreon:   / codedred  
Discord:   / discord  
Twitter:   / devcodedred  
Twitch:   / coded_red  


0:00 Intro
1:16 Project Overview
2:14 What is a packet reader?
4:23 NPC Setup
7:50 PacketReader 1/2
15:00 CustomClickEvent
16:00 ClickListener
19:30 PacketReader 2/2
21:52 Inject Player
22:30 Plugin Showcase
22:53 Disclaimer
24:11 Outro


----- Links -----

Download IntelliJ: https://www.jetbrains.com/toolbox-app/

Download Spigot: https://getbukkit.org/download/spigot

Build Spigot: https://www.spigotmc.org/wiki/buildto...

Check out my plugins:
https://www.spigotmc.org/resources/au...

[GITHUB CODE]
GitHub repo code is exclusively for Patron Supporters! For only $3 you can view all source code from videos!   / codedred  


Music:
Track: Minute Mix - ChillOutMedia
Music provided by Chill Out Records - No Copyright Music.
Listen: https://www.chilloutmedia.com/download