RockinChaos / ItemJoin

Get custom items on join.
https://www.craftationgaming.com/
GNU Lesser General Public License v3.0
140 stars 36 forks source link

Command not being executed on item click #477

Closed Hugo1307 closed 2 years ago

Hugo1307 commented 2 years ago

Hey there!

The commands added to items under the interact field in items.yml are not being executed in the newest build. Those used to work in later versions but in 1.18.2 using this build they don't work anymore. When the player clicks on the item, his inventory is closed but the set commands are not executed.

To Reproduce

  1. Add a command to an item under interact array in items.yml file.
  2. Click on the item with the set command.
  3. The command won't be executed.

Expected behavior The command set for the item should be executed.

Pastebin https://pastebin.pl/view/eaa32ef8 https://pastebin.pl/view/4c51ae03

No errors in console

Plugin and server information:

ItemJoin-5.2.4-SNAPSHOT-b815 Paper-1.18.2-287

RockinChaos commented 2 years ago

You have commands: listed on your item. Item Commands no longer reference this, rather calling the command directly via interact: for example. Removing the commands: identifier fixes the issue.

Link; https://pastebin.pl/view/0ccebf44 Let me know!~

Hugo1307 commented 2 years ago

You're right, the commands is wrong there. However, after removing it, the commands still don't work.

I've restarted the server and cleaned my inventory so it could give me updated items btw. I also just copied and pasted the config you provided.

RockinChaos commented 2 years ago

Hmm thats odd, let me test this and see if I can replicate it.

RockinChaos commented 2 years ago

Ah my stupidity, I think I misunderstood this issue.

Interact is when you hold the item in your hand and left/right click it on the ground or in the air. Is this how you are using the item? I notice they have inventory-modify so they are locked to slots out of the players hotbar, thus you couldn't use interact.

The only "inventory/cursor" type command executions are;

on-equip
un-equip
on-receive
inventory-swap-cursor
inventory
inventory-middle
inventory-creative
inventory-left
inventory-right
inventory-shift-left
inventory-shift-right

Does that make sense? I see you have inventory define for the items as well which is the proper/correct way to use it if you are using the item with the player inventory open/aka not interact thus the interact array will never be executed.

EDIT: Closing due to inactivity, a new official release of ItemJoin has just been approved. You can now download it here; https://www.spigotmc.org/resources/itemjoin.12661/download?version=451699