How creating crafting table result slot event. #2396
-
I'm trying to create an event before giving an item to a player in the crafting table.
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Please don't post minecraft source here. Just reference the method name and describe the part you are interested in. The dropItem() is for when the item doesn't fit in the player's inventory, it drops the item on the ground. The onCrafted() is to allow items to add default nbt for newly crafted items and to update crafting statistics. If you want to detect the player taking an item from the result slot just @Inject at the HEAD of the onTakeItem() method. |
Beta Was this translation helpful? Give feedback.
Please don't post minecraft source here. Just reference the method name and describe the part you are interested in.
The dropItem() is for when the item doesn't fit in the player's inventory, it drops the item on the ground.
The onCrafted() is to allow items to add default nbt for newly crafted items and to update crafting statistics.
The loop is is to update the crafting grid to decrease/remove items used in the craft.
If you want to detect the player taking an item from the result slot just @Inject at the HEAD of the onTakeItem() method.
i.e. the start of that method before all the processing of the craft starts