#Spigot 1.20.1 - ItemDisplay - Interact Event?

1 messages ยท Page 1 of 1 (latest)

pseudo vapor
#

Hello, is there an Event, when an Player right-clicks an ItemDisplay? ๐Ÿ˜„

smoky marlin
#

ItemDisplay doesn't have any hitbox - player can not right click it.
Best way would be to spawn an interaction entity and use normal interact event

pseudo vapor
#

mhm, the user should hit an ItemDisplay and modify them (Itemstack or something else), is this possible?

smoky marlin
#

Again, that entity has no hitbox, it can not be hit.
But what you described is possible, tho it will require a bit more work.
My approach would be: store UUID of ItemDisplay in Interaction entity with PDC, when player interacts, find the ItemDisplay based on that UUID and do whatever you want.

pseudo vapor
#

mhm, and is there an other way to find the ItemDisplay, something like /neardisplays location or somethin?

smoky marlin
#

Well.. yes, but PDC would be the most precise (and possibly fastest)
world.getNearbyEntities