Hey,
I know, that InteractBlockEvent
fires, when a player tries to open a chest, but is there a way to fire only, if a player tries to open a chest / double chest / enderchest?
Thanks in advance
Check if the block interacted with is a chest.
Is there another way? When I do it like this, I have to check it 3 times (double, normal, ender)?
Greets
no matter what event you’d end up using, you’d have to do some checking - an inventory supporting block could be a furnace or workbench or hopper, etc…
InteractInventoryEvent (.Open ) will trigger when opening one of those chest types as a more specific than every-other-block interaction event.
And with event filtering processes in the work, it will be easier to filter out just those three block types and discard all others from firing the event code…