ItemJoin

ItemJoin

157k Downloads

Disposable-fail-message is not working.

Thermors opened this issue ยท 8 comments

commented

Disposable-fail-message is not working.

The bug
Disposable-fail-message is not displayed in the game chat, despite the fact that the flag "disposable" is set on item.

I wrote disposable conditions and fail message as in example on wiki:
disposable-conditions:

  • '%luckperms_inherits_group_donate_1%:notequal:yes'
  • '%luckperms_inherits_group_donate_2%:notequal:yes'
  • '%luckperms_inherits_group_donate_3%:notequal:yes'
    disposable-fail-message: '&cYou get to keep your item, lucky!'

Expected behavior
Dispayed message in the game chat: '&cYou get to keep your item, lucky!'

  • Resource Version and Build Number: [5.2.5-RELEASE-b850]
  • Server Version [Paper-1.18.2]
commented

Can you send me the exact item in question?
The following seems to work as intended and sends the fail message if any of the conditions are not met.

    itemflags: disposable
    interact:
    - 'say hi'
    disposable-conditions:
    - '%luckperms_inherits_group_donate_1%:notequal:yes'
    - '%luckperms_inherits_group_donate_2%:notequal:yes'
    - '%luckperms_inherits_group_donate_3%:notequal:yes'
    disposable-fail-message: '&cYou get to keep your item, lucky!'

Keep in mind the disposable itemflag only functions if you use it with a command, such as interact or inventory or interact-left, etc.

commented

I'm really sorry. I forgot to mention that disposable-fail-message is not working if I add also interact-right-conditions. They are the same as disposable-conditions. I need to use these both types of conditions. Please, help me with this problem =)
Also I want to note that if I add interact-right-fail-message, this message will be sent three times: one time for each command from the list "interact-right". Please, could you fix it too

itemflags: unbreakable, hide-flags, placement, cancel-equip, stackable, death-keep, self-drops, disposable, item-modifiable, item-repairable, item-craftable
interact-right:
- 'console: eco give %player% 500'
- 'console: eco give %player% 50 altcoin'
- 'console: lp user %player% parent addtemp donate_1 30d deny'
interact-right-conditions:
- '%luckperms_inherits_group_donate_1%:notequal:yes'
- '%luckperms_inherits_group_donate_2%:notequal:yes'
- '%luckperms_inherits_group_donate_3%:notequal:yes'
disposable-conditions:
- '%luckperms_inherits_group_donate_1%:notequal:yes'
- '%luckperms_inherits_group_donate_2%:notequal:yes'
- '%luckperms_inherits_group_donate_3%:notequal:yes'
disposable-fail-message: '&cYou have already used this item'

commented

Confirmed, replicated, and fixed now in the latest snapshot.
The message should now properly only be sent once regardless of the number of commands added.

Link; https://ci.craftationgaming.com/job/ItemJoin/881/
Remember to remove your old ItemJoin.jar file

commented

Okay so I have done some extensive testing on this and I am unable to replicate any issues.

First, the example you provided would cause the disposable conditions to never trigger because they match the interact conditions.

So if interact-right fails then the disposable itemflag is never triggered because the interaction is not continued.

Is it possible you meant to add the interact-right-fail-message?

Essentially having both conditions matching is rather pointless as disposable will never be triggered if interact-right conditions re not met. This however would work great if both interact-right and disposable had different conditions.

commented

Good. I understood the interaction algorithm. It is a pity that this was not on the Wiki. In this case, it would be advisable to leave only interact-right conditions. But in this case, I've got the following problem: interact-right-fail-message is sent three times at once, respectively, for each command in the interact-right list. I also wrote about this in a previous message. If this can be fixed, I will be very glad.

commented

Great!
But now there is still a small problem concernig the following:
interact-right-fail-message is also displayed if I use interact-left button or if I just drop the item on the ground from my inventory or even if I select the item in my hand.
I guess it will be better for me and for other users if such problem is solved too.

commented

Confirmed, replicated, and fixed now in the latest snapshot.
Looks like I forgot to add a check to verify the proper command action was matching the condition.

Link; https://ci.craftationgaming.com/job/ItemJoin/888/
Remember to remove your old ItemJoin.jar file

commented

The v6.0.0 release is now available.

Link; https://www.spigotmc.org/resources/itemjoin.12661/download?version=494934
Remember to remove your old ItemJoin.jar file

If you continue to experience issues feel free to open a new issue and include the /itemjoin dump information.