In this scenario, players can place the crossbow in either their hand or offhand. The script content has been simplified, and in reality, the crossbow is specific. I've tried using - if == : to confirm both scenarios, but the item's durability doesn't match. This is probably because 'after' was used in the event. The crossbow's durability modification must use 'after', otherwise, the crossbow will become capable of infinite firing. after player shoots crossbow: - inventory adjust slot:hand durability: In this scenario, I am trying to modify the durability of a tool in a dispenser. Here, I know is wrong. I attempted to obtain the number of empty slots in the dispenser from the error report, but it shows 9 (there should be one tool in the dispenser), so I am completely lost now. on dispenser dispenses Special_Iron_Pickaxe: - determine cancelled passively - inventory adjust slot: durability: In summary, I want to know how to obtain the slot of a specific item.