Files
minecraft_lzstools/data/lzstools_wrench/function/wrench/offhand.mcfunction
T
2026-08-12 22:54:25 +01:00

23 lines
4.6 KiB
MCFunction

# Reset scores
scoreboard players set @s lzt_wrench_success 0
# Change wrench mode
execute as @s[scores={lzt_wrench_success=0},nbt={equipment:{offhand:{components:{"minecraft:custom_data":{"lzstools":["wrench"]},"minecraft:custom_model_data":{"strings":["lzstools:wrench_default"]}}}}}] store result score @s lzt_wrench_success run item modify entity @s weapon.offhand lzstools_wrench:flip
execute as @s[scores={lzt_wrench_success=0},nbt={equipment:{offhand:{components:{"minecraft:custom_data":{"lzstools":["wrench"]},"minecraft:custom_model_data":{"strings":["lzstools:wrench_flip"]}}}}}] store result score @s lzt_wrench_success run item modify entity @s weapon.offhand lzstools_wrench:face_player
execute as @s[scores={lzt_wrench_success=0},nbt={equipment:{offhand:{components:{"minecraft:custom_data":{"lzstools":["wrench"]},"minecraft:custom_model_data":{"strings":["lzstools:wrench_face_player"]}}}}}] store result score @s lzt_wrench_success run item modify entity @s weapon.offhand lzstools_wrench:face_click
execute as @s[scores={lzt_wrench_success=0},nbt={equipment:{offhand:{components:{"minecraft:custom_data":{"lzstools":["wrench"]},"minecraft:custom_model_data":{"strings":["lzstools:wrench_face_click"]}}}}}] store result score @s lzt_wrench_success run item modify entity @s weapon.offhand lzstools_wrench:terracotta_north
execute as @s[scores={lzt_wrench_success=0},nbt={equipment:{offhand:{components:{"minecraft:custom_data":{"lzstools":["wrench"]},"minecraft:custom_model_data":{"strings":["lzstools:wrench_terracotta_north"]}}}}}] store result score @s lzt_wrench_success run item modify entity @s weapon.offhand lzstools_wrench:terracotta_east
execute as @s[scores={lzt_wrench_success=0},nbt={equipment:{offhand:{components:{"minecraft:custom_data":{"lzstools":["wrench"]},"minecraft:custom_model_data":{"strings":["lzstools:wrench_terracotta_east"]}}}}}] store result score @s lzt_wrench_success run item modify entity @s weapon.offhand lzstools_wrench:terracotta_south
execute as @s[scores={lzt_wrench_success=0},nbt={equipment:{offhand:{components:{"minecraft:custom_data":{"lzstools":["wrench"]},"minecraft:custom_model_data":{"strings":["lzstools:wrench_terracotta_south"]}}}}}] store result score @s lzt_wrench_success run item modify entity @s weapon.offhand lzstools_wrench:terracotta_west
execute as @s[scores={lzt_wrench_success=0},nbt={equipment:{offhand:{components:{"minecraft:custom_data":{"lzstools":["wrench"]},"minecraft:custom_model_data":{"strings":["lzstools:wrench_terracotta_west"]}}}}}] store result score @s lzt_wrench_success run item modify entity @s weapon.offhand lzstools_wrench:default
# Confirm with action bar
title @s[nbt={equipment:{offhand:{components:{"minecraft:custom_data":{"lzstools":["wrench"]},"minecraft:custom_model_data":{"strings":["lzstools:wrench_default"]}}}}}] actionbar [{"text":"Mode: ","color":"red"},{"text":"Default","color":"white"}]
title @s[nbt={equipment:{offhand:{components:{"minecraft:custom_data":{"lzstools":["wrench"]},"minecraft:custom_model_data":{"strings":["lzstools:wrench_flip"]}}}}}] actionbar [{"text":"Mode: ","color":"red"},{"text":"Flip","color":"white"}]
title @s[nbt={equipment:{offhand:{components:{"minecraft:custom_data":{"lzstools":["wrench"]},"minecraft:custom_model_data":{"strings":["lzstools:wrench_face_player"]}}}}}] actionbar [{"text":"Mode: ","color":"red"},{"text":"Face Player","color":"white"}]
title @s[nbt={equipment:{offhand:{components:{"minecraft:custom_data":{"lzstools":["wrench"]},"minecraft:custom_model_data":{"strings":["lzstools:wrench_face_click"]}}}}}] actionbar [{"text":"Mode: ","color":"red"},{"text":"Face Click","color":"white"}]
title @s[nbt={equipment:{offhand:{components:{"minecraft:custom_data":{"lzstools":["wrench"]},"minecraft:custom_model_data":{"strings":["lzstools:wrench_terracotta_north"]}}}}}] actionbar [{"text":"Mode: ","color":"red"},{"text":"Terracotta","color":"white"}]
title @s[nbt={equipment:{offhand:{components:{"minecraft:custom_data":{"lzstools":["wrench"]},"minecraft:custom_model_data":{"strings":["lzstools:wrench_terracotta_east"]}}}}}] actionbar [{"text":"Mode: ","color":"red"},{"text":"Terracotta","color":"white"}]
title @s[nbt={equipment:{offhand:{components:{"minecraft:custom_data":{"lzstools":["wrench"]},"minecraft:custom_model_data":{"strings":["lzstools:wrench_terracotta_south"]}}}}}] actionbar [{"text":"Mode: ","color":"red"},{"text":"Terracotta","color":"white"}]
title @s[nbt={equipment:{offhand:{components:{"minecraft:custom_data":{"lzstools":["wrench"]},"minecraft:custom_model_data":{"strings":["lzstools:wrench_terracotta_west"]}}}}}] actionbar [{"text":"Mode: ","color":"red"},{"text":"Terracotta","color":"white"}]