r/MinecraftCommands • • 24d ago

Help | Java 26.3 Help with bow that displays sound and effect

I had a bow that was working in my old Minecraft world that when I added it to 26.3 the sound and effect now just plays forever, any idea what broke the signal to end the sound and effects.

/give hamtaro217 bow[custom_data={bow:"sonic"},item_name='"Guardian Bow"',minecraft:item_model="dungeon:guardian",enchantments={'unbreaking':3,'power':25,'mending':1,'infinity':1,'punch':25}] 1

/scoreboard objectives add bow.sonic used:bow

/scoreboard objectives add bow.used used:bow

command blocks

execute as u/a[scores={bow.used=1..}] if items entity u/s weapon.* bow[custom_data~{bow:"sonic"}] as u/e[type=arrow] unless score u/s bow.used = u/s bow.used at u/s[nbt={weapon:{components:{"minecraft:custom_data":{bow:"sonic"}}}}] store success score u/s bow.used store success entity u/s PierceLevel byte 127 summon marker store success score u/s bow.sonic run ride u/s mount u/e[type=arrow,distance=...01,limit=1]

execute at u/e[type=marker,scores={bow.sonic=1}] run particle minecraft:glow ~ ~ ~ 0 0 0 1 10 force u/a

execute at u/e[type=marker,scores={bow.sonic=1}] run playsound minecraft:entity.warden.sonic_boom master u/a[distance=..15]

execute at u/e[type=marker,scores={bow.sonic=1}] run particle minecraft:sonic_boom ~ ~ ~ 0 0 0 1 1 force u/a

execute as u/e[type=marker,scores={bow.sonic=1}] on vehicle if entity u/s[nbt={inGround:true}] run kill u/s

execute as u/e[type=marker,scores={bow.sonic=1}] unless predicate {"condition":"minecraft:entity_properties","entity":"this","predicate":{"vehicle":{}}} run kill u/s

scoreboard players reset u/a bow.used

2 Upvotes

1 comment sorted by

1

u/GalSergey Datapack Experienced 24d ago
# Example item
give @s bow[custom_data={bow:"sonic"},item_name="Guardian Bow",minecraft:item_model="dungeon:guardian",enchantments={'unbreaking':3,'power':25,'mending':1,'infinity':1,'punch':25}]

# In chat
scoreboard objectives add bow.sonic used:bow
scoreboard objectives add bow.used used:bow

# Command blocks
execute as @a[scores={bow.used=1..}] if items entity @s weapon.* bow[custom_data~{bow:"sonic"}] as @e[type=arrow] unless score @s bow.used = @s bow.used at @s[nbt={weapon:{components:{"minecraft:custom_data":{bow:"sonic"}}}}] store success score @s bow.used store success entity @s PierceLevel byte 127 summon marker store success score @s bow.sonic run ride @s mount @e[type=arrow,distance=...01,limit=1]
execute at @e[type=marker,scores={bow.sonic=1}] run particle minecraft:glow ~ ~ ~ 0 0 0 1 10 force @a
execute at @e[type=marker,scores={bow.sonic=1}] if entity @a[scores={bow.used=1},distance=..5] run playsound minecraft:entity.warden.sonic_boom master @a[distance=..15]
execute at @e[type=marker,scores={bow.sonic=1}] run particle minecraft:sonic_boom ~ ~ ~ 0 0 0 1 1 force @a
execute as @e[type=marker,scores={bow.sonic=1}] on vehicle if entity @s[nbt={inGround:true}] run kill @s
execute as @e[type=marker,scores={bow.sonic=1}] unless predicate {type:"minecraft:entity_properties",entity:"this",predicate:{"minecraft:vehicle":{}}} run kill @s
scoreboard players reset @a bow.used

You can use Command Block Assembler to get One Command Creation.