#how to check the durability of an item in a player's inventory?
1 messages · Page 1 of 1 (latest)
plz help
You want the requirment to pass if the item has a certain durability?
No. So that only whole items can pass
@fair crypt the option is data:, try 0 or the maximum durability of the wooden sword, which is 59
It's not working. Experience is given, but the item is not picked up
Right click requirement and left click command?
Idk what to say about the clear command, sorry
strict: boolean XD
use clean instead of clear
I'm having a problem checking.
minecraft:clear %player_name% stone_sword 1
clear %player_name% stone_sword 1
clean %player_name% stone_sword 1
minecraft:clear %player_name% stone_sword{Damage:59} 1
None of these commands will take an item if it has a durability of less than 59.
you have placeholderAPI ?
@fair crypt
Sure.
and downloaded checkitem ?
you just want to clear spectific item with full durability ?
Exactly. And also before clearing, check if there is an item with full durability in your inventory
click_requirement:
requirements:
type: has item
material: wooden_sword
strict: true
click_commands:
- '[placeholder] %checkitem_remove_mat:wooden_sword,amt:1,strict%'
left_click_requirement:
requirements:
WOODEN_SWORD_in_inventory_check:
type: has item
material: WOODEN_SWORD
strict: true
check_item_durability:
type: string equals ignorecase
input: "%checkitem_mat:WOODEN_SWORD,strict%"
output: "yes"
Thank you!
could you tell me how to give a player an enchanted tool?