18 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			MCFunction
		
	
	
	
	
	
			
		
		
	
	
			18 lines
		
	
	
		
			1.3 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[minecraft:enchantments={levels:{'minecraft:binding_curse':1},show_in_tooltip:false},minecraft:enchantment_glint_override=false,minecraft:attribute_modifiers={modifiers:[{type:'minecraft:movement_speed',amount:0.01,operation:'add_value',id:'herohost:custom_speed',slot:'head'}],show_in_tooltip:false},max_stack_size=1,minecraft:custom_name='[{"text":"Hostile boom box","color":"#de3131","italic":false}]',minecraft:lore=['[{"text":"Stop reading.. get rid of it!","color":"blue"}]','[""]','[{"text":"- keanu poopie stinky <3"}]']] 1
 | 
						|
clear @a[tag=hc.give_tnt] minecraft:tnt
 | 
						|
 | 
						|
# tnt in offhand
 | 
						|
execute as @a[nbt={Inventory:[{Slot:103b,id:"minecraft:tnt"}]}] unless entity @s[nbt={Inventory:[{Slot:-106b,id:"minecraft:tnt"}]}] run clear @s minecraft:tnt[minecraft:custom_data={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[minecraft:custom_data={clear:1b}]
 | 
						|
 | 
						|
# remove get/give tag
 | 
						|
tag @a remove hc.get_tnt
 | 
						|
tag @a remove hc.give_tnt
 | 
						|
 | 
						|
# game loops
 | 
						|
execute if score $hc.tt_timer +hc.core matches 0.. run function herohost:tnt/run with storage minecraft:hc.tnt
 |