[Bug] item_craft events return "AIR" in the %item% variable instead of "FILLED_MAP"
Example :
prevent_map_dupe:
type: item_craft
conditions:
- "%item% == FILLED_MAP"
actions:
default:
- "cancel_event: true"
- "close_inventory: true"
It doesn't work because %item% returns AIR instead of FILLED_MAP while trying to duplicate a map using an empty map and an existing map in the crafting table.
Is the event working for you, for other item craftings?
Yes. I noticed the same bug with tinted leather armor and colored shulker boxes.
What Minecraft version is your server? And what ConditionalEvents version are you using?
Purpur (Fork of Paper) 1.21.8 ConditionalEvents 4.69.1 (latest to date)
Just tested on 1.21.8 (Paper), and everything works correctly. Which block are you using to craft the items? A workbench?
Mmh.. it's really strange, i'll try to record a video with /ce debug but i was just using a normal workbench yeah..
I also use the /craft command from essential but i don't think it is related
Video: https://youtu.be/tRplH2BDT2I
That is indeed strange. What I suggest is to remove all of your plugins and just leave ConditionalEvents to see if the issue is still happening.
I tried with those plugins :
yet I still have the issue
With only ConditionalEvents :
same issue
Then it must be an issue with Purpur, if this were a global issue, I would have a lot of complains about this event not working at all. You must be getting AIR for every item you try to craft right?
No, it only happens with very specific items such as FILLED_MAP or LEATHER_CHESTPLATE when using a colored dye, it returns AIR. Other items work fine with the item_craft event
Have you tried in Paper?
I just tested on paper :
Build 60 1.21.8 (latest stable build to date) but same issue
I was curious so i also tested on Spigot 1.21.8
same issue
Can it be related to some server configuration ? It's really weird
Just tested again on Paper latest 1.21.8 on an empty server, just ConditionalEvents.
prevent_map_dupe:
type: item_craft
conditions:
- "%item% == LEATHER_CHESTPLATE"
actions:
default:
- "cancel_event: true"
- "close_inventory: true"
Craftings including LEATHER_CHESTPLATE work correctly. BUT, the FILLED_MAP is not. This must be a bug with Minecraft or bukkit/spigot, since I'm using the regular CraftItemEvent event provided by the API.