#Detecting broken tools

1 messages · Page 1 of 1 (latest)

little cloak
#

I figured out how to detect breaks but how do I execute commands at the person that broke the item


scoreboard players reset @a iron_pickaxe_break```

in function "broken_bottle_break" I am trying to get it to run these commands at the player who's item broke position

```playsound minecraft:block.glass.break master @s ~ ~ ~ 1.1 0.6

particle block{block_state:"minecraft:green_stained_glass_pane"} ~ ~1 ~ 0 0 0 0 20 normal```

Can anyone help?
gentle tinselBOT
#

<@&1201956957406109788>

Someone will come and help soon!

💬 While you wait, take this time to provide more context and details.

✅ Once your question has been resolved (or you no longer need it), please click Resolve Question or run /resolve

daring siren
#

Add at @s to your first command, the one that runs that function.

little cloak
#

execute as @a[scores={iron_pickaxe_break=1..}] at @s if items entity @s weapon.mainhand iron_pickaxe[custom_model_data={strings:["bottle_broken"]}] run function esta:broken_bottle_break

gentle tinselBOT
#
Question Closed

Your question, #1378548222204579871 (Detecting broken tools), was resolved!

Original Message

#1378548222204579871 message

Duration open

33m

gentle tinselBOT
# gentle tinsel <@&1201956957406109788>

<@&1166082198152159386> <@&1202694677766348840>

🙇 Helpers Arise!

Please note that you still might not immediately get a response since all helpers are human beings and volunteers (and also might be sleeping right now)

little cloak
#

I accidently clicked resolve

#

1.21.4 by the way

daring siren
#

Should work just fine. Are you sure the function is successfully running?

#

I don't recommend checking the custom_model_data component, you should give the item a custom_data component and check that instead, and use ~ instead of = when you do

little cloak
#

Thanks

gentle tinselBOT
#
Question Closed

Your question, #1378548222204579871 (Detecting broken tools), was resolved!

Original Message

#1378548222204579871 message

Duration open

1h9m

gentle tinselBOT
#
Closed for inactivity

This question has been inactive for some time, so it's going to be closed for inactivity. If you still need it, please disregard this message.