#A rightclick function that has only 20 uses.
1 messages · Page 1 of 1 (latest)
<@&1201956957406109788>
💬 While you wait, take this time to provide more context and details.
🙇 After a while, hit the Summon Helpers button to ping the helper team. They'll be happy to help you
✅ Once your question has been resolved (or you no longer need it), please click Resolve Question or run /resolve
you could make a scoreboard
scoreboard objectives add uses dummy
detect when the player has the item in his hands to add a custom tag to the player
execute as @a[nbt={SelectedItem:{id:"minecraft:youritem",tag:{tag of the item:1b}}}] run tag @s add usingitem
yes this
then when right click
scoreboard players add @s[type=minecraft:player,tag=usingitem] uses 1
one sec
yees
then
execute as @a[scores={uses=20}] run item replace entity @s weapon.mainhand with air
something like this i think
sorry if this is not the best approach i am not a official helper, i just happened to stumble across your request
this one will need to be put in a tick function
waittt stay here
i think i have an idea
how do i clear 1 item specifically
so like
it works @inner gyro
but
if someone has two swords then?
for the time being
it works!
tysm
you could change the tag of the item each time the scoreborad changes
ask chatgpt 🤣
ehhh its fineeee
@inner gyro do you know how to do /playsound
the sound effect being minecraft item break
playsound <sound> <source> <targets> [<pos>] [<volume>] [<pitch>] [<minVolume>]
ty
it will clear only the item on your hand so it will work in this case
don't forget after to add
when his item get destroyed
execute as @a[scores={uses=20}] run scoreboard players reset @s uses
Your question, #1205063888110882846 (A rightclick function that has only 20 uses.), was resolved!
I have implemented a right click function already but I'm wondering on how to make it so that, after 20 uses of the right click, the item breaks. Please guide.
1h27m
Re-opened the channel. Make sure to close it again once you're done.
Your question, #1205063888110882846 (A rightclick function that has only 20 uses.), was resolved!
I have implemented a right click function already but I'm wondering on how to make it so that, after 20 uses of the right click, the item breaks. Please guide.
1h28m