HHGames/data/herohost/functions/tnt/core.mcfunction
HeroChris 231e0d2486 Effects
- Sound effect
- Particle effect
- offHand tnt for visualization
2023-11-01 16:01:25 +01:00

13 lines
1.1 KiB
Mcfunction

# --- HeroGames - Copyright (c) HeroHost team (code provided by HeroChris). ---
# give and remove tnt
item replace entity @a[tag=hc.get_tnt] armor.head with tnt{HideFlags:1,Enchantments:[{id:"minecraft:binding_curse",lvl:1s}],AttributeModifiers:[{Slot:"head",AttributeName:"generic.movement_speed", Name:"generic.movement_speed", Amount:0.02, Operation:0, UUID:[I;1,1,1,1]}],display:{Name:'[{"text":"Hostile boom box","color":"#de3131","italic":false}]',Lore:['{"text":"Stop reading.. get rid of it!"}','{"text":""}','{"text":"+2% Speed","color":"dark_green","italic":false}']}} 1
clear @a[tag=hc.give_tnt] minecraft:tnt
# tnt in offhand
execute as @a[nbt={Inventory:[{Slot:103b,id:"minecraft:tnt"}]}] if entity @s[nbt=!{Inventory:[{Slot:-106b,id:"minecraft:tnt"}]}] run clear @s minecraft:tnt{clear:1b}
execute as @a[nbt={Inventory:[{Slot:103b,id:"minecraft:tnt"}]}] if entity @s[nbt=!{Inventory:[{Slot:-106b,id:"minecraft:tnt"}]}] run item replace entity @s weapon.offhand with minecraft:tnt{clear:1b}
# remove get/give tag
tag @a remove hc.get_tnt
tag @a remove hc.give_tnt