INTERACT XP bug [1.19.2]
SomewhatDamaged opened this issue ยท 6 comments
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:
- Install ConstructionWands mod.
- Get the following datapack ConstructionWand.zip.
- Create a singleplayer game and add the datapack to it.
- Give yourself an
Infinity Wand
. - Ensure
building
skill is at 0. - 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
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?
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.
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.
Oh wait, nevermind me, i did have this logic, but I think I did the cancellation wrong. still will fix, just clarifying.
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.
Will probably want some documentation added to https://github.com/Caltinor/Project-MMO-2.0/wiki/Items for these odd edge-cases.