Project MMO

Project MMO

10M Downloads

INTERACT XP bug [1.19.2]

SomewhatDamaged opened this issue ยท 6 comments

commented

Describe the bug
When configuring a datapack that sets a requirements on an item with INTERACT, ACTIVATE_ITEM xp will still be given even if the item's effect is blocked.

Expected behavior
That xp would not be given if the action was blocked by requirements.

To Reproduce
Steps to reproduce the behavior:

  1. Install ConstructionWands mod.
  2. Get the following datapack ConstructionWand.zip.
  3. Create a singleplayer game and add the datapack to it.
  4. Give yourself an Infinity Wand.
  5. Ensure building skill is at 0.
  6. Right click ground and get xp even though the wand doesn't trigger.

Screenshots
If applicable, add screenshots to help explain your problem.

Versions:

  • Minecraft: 1.19.2
  • Loader: 43.1.33
  • PMMO: 1.19.2-0.5.0 (tested on 0.4.3 too)

Additional context
May be related to this other bug, though that specific one not evident here.
#103

commented

INTERACT is the req for interacting with blocks. USE is the req for activating items. Can you confirm the bug still exists with the correct req type?

commented

After experimenting with them, INTERACT is the correct req to use to block their activation. They are an item that is right clicked onto a block. USE requirements doesn't stop them working.

commented

Oh, well that explains it then. the item is ignored when a block is the target. I will fix this. it seems like even without this use case, this could be used as a exploit.

commented

Oh wait, nevermind me, i did have this logic, but I think I did the cancellation wrong. still will fix, just clarifying.

commented

Through testing, it was discovered that giving items like these wands both the INTERACT and USE requirements solves the problem. Users should be aware that both events can fire and to manage their reqs accordingly as it pertains to the behavior of the item.

commented

Will probably want some documentation added to https://github.com/Caltinor/Project-MMO-2.0/wiki/Items for these odd edge-cases.