ConditionalEvents icon indicating copy to clipboard operation
ConditionalEvents copied to clipboard

[Bug] item_craft events return "AIR" in the %item% variable instead of "FILLED_MAP"

Open Limeen opened this issue 2 months ago • 16 comments

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.

Limeen avatar Oct 11 '25 09:10 Limeen

Is the event working for you, for other item craftings?

Ajneb97 avatar Oct 11 '25 13:10 Ajneb97

Yes. I noticed the same bug with tinted leather armor and colored shulker boxes.

Limeen avatar Oct 11 '25 14:10 Limeen

What Minecraft version is your server? And what ConditionalEvents version are you using?

Ajneb97 avatar Oct 11 '25 15:10 Ajneb97

Purpur (Fork of Paper) 1.21.8 ConditionalEvents 4.69.1 (latest to date)

Limeen avatar Oct 11 '25 16:10 Limeen

Just tested on 1.21.8 (Paper), and everything works correctly. Which block are you using to craft the items? A workbench?

Ajneb97 avatar Oct 17 '25 23:10 Ajneb97

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

Limeen avatar Oct 18 '25 11:10 Limeen

Video: https://youtu.be/tRplH2BDT2I

Limeen avatar Oct 27 '25 21:10 Limeen

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.

Ajneb97 avatar Oct 28 '25 10:10 Ajneb97

I tried with those plugins : Image

yet I still have the issue

Limeen avatar Oct 28 '25 11:10 Limeen

With only ConditionalEvents :

Image

same issue

Limeen avatar Oct 28 '25 11:10 Limeen

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?

Ajneb97 avatar Oct 28 '25 16:10 Ajneb97

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

Limeen avatar Oct 28 '25 17:10 Limeen

Have you tried in Paper?

Ajneb97 avatar Oct 29 '25 10:10 Ajneb97

I just tested on paper :

Image

Build 60 1.21.8 (latest stable build to date) but same issue

Limeen avatar Oct 29 '25 10:10 Limeen

I was curious so i also tested on Spigot 1.21.8

Image

same issue

Can it be related to some server configuration ? It's really weird

Limeen avatar Oct 29 '25 11:10 Limeen

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.

Ajneb97 avatar Oct 29 '25 19:10 Ajneb97