#Is it possible to find out if the player has an item in the inventory ?
1 messages · Page 1 of 1 (latest)
use q.is_item_name_any but with slot.inventory
but "query.is_item_name_any('slot.inventory', 0, 'minecraft:golden_sword')"
This work for slot 0 but dos'nt work for other slot :(
You can do it like this "query.is_item_name_any('slot.inventory', 0, 'minecraft:golden_sword' + query.is_item_name_any('slot.inventory', 1, 'minecraft:golden_sword')
Etc
That's how this works:
https://youtu.be/DcpmYYPeFs0
Official Discord Server: https://dsc.gg/chainsketch
Patreon: https://patreon.com/Chainsketch
MCPEDL: https://mcpedl.com/user/chainsketch/
IGN: Chainsketch
Discord Tag: @Chainsketch# 4364
Instagram Tag: @Chainsketch
Twitter Tag: @Chainsketch_
...
Thanks you pepe
I've other solution
variable.has_sword = 0; t.i = 0; loop(9, {
variable.has_sword = ( q.is_item_name_any('slot.hotbar', t.i, 'minecraft:golden_sword') );
variable.has_sword ? { return variable.has_sword; };
t.i = t.i + 1;
});"