1
0
mirror of https://github.com/LZStealth/armor-statues.git synced 2025-06-08 05:26:43 +01:00
armor-statues/data/armor_statues/functions/interactions/interact_pointer.mcfunction
MukiTanuki 1b6d7ed463 1.19.4 update
-Changed how custom naming works:  you can no longer set names to be visible/invisible from the book.  Since armor stands retain their names in 1.19.4 you can rename an armor stand item and place it and it will automatically become visible.
-Changed 'pointing' function for head and body:  Both will now 'face' the player.
-Added in has visible fire setting
-Added in Pointer Wand:  You can obtain this by renaming a stick 'Statues' or by using the trigger in the book: /trigger pointer_wand.
    -Face an armor stand to enter edit mode
    -r-click on a joint to first set the appendage to a neutral position, then to point towards the player.
    -r-click on the base to rotate it facing the player
    -l-click on the head to make the armor stand visible/invisible
    -l-click on the arms to make them visible/invisible
    -l-click on the base to make it visible/invisible
    -l-click on the body to cycle through the preset poses
-Added in Adjustment Wand:  You can obtain this by renaming a warped fungus on a stick 'Statues' or by using the trigger in the book: /trigger adjustment_wand.
    -Shift+r-click to change modes between X/Y/Z
    -l or r click on a joint to rotate in the positive or negative rotations
    -l or r click the base to move the stand in the negative or positive direction
2023-04-01 15:08:16 -07:00

38 lines
4.4 KiB
MCFunction

#
# Description: Pointing pose
# Called by: advancement: armor_statues:interactions/interact
# Entity @s: player
#
#
# sets score according to marker
#
# for base
execute if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_base_interactable] run scoreboard players set @s as_trigger 124
# if not last used
execute if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_head_interactable, tag=!as_last_used] run data modify entity @e[type=minecraft:armor_stand,sort=nearest,limit=1,tag=as_selected] Pose merge value {Head:[0.01f, 0.01f, 0.01f]}
execute if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_body_interactable, tag=!as_last_used] run data modify entity @e[type=minecraft:armor_stand,sort=nearest,limit=1,tag=as_selected] Pose merge value {Body:[0.01f, 0.01f, 0.01f]}
execute if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_right_arm_interactable, tag=!as_last_used] run data modify entity @e[type=minecraft:armor_stand,sort=nearest,limit=1,tag=as_selected] Pose merge value {RightArm:[0.01f, 0.01f, 0.01f]}
execute if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_left_arm_interactable, tag=!as_last_used] run data modify entity @e[type=minecraft:armor_stand,sort=nearest,limit=1,tag=as_selected] Pose merge value {LeftArm:[0.01f, 0.01f, 0.01f]}
execute if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_right_leg_interactable, tag=!as_last_used] run data modify entity @e[type=minecraft:armor_stand,sort=nearest,limit=1,tag=as_selected] Pose merge value {RightLeg:[0.01f, 0.01f, 0.01f]}
execute if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_left_leg_interactable, tag=!as_last_used] run data modify entity @e[type=minecraft:armor_stand,sort=nearest,limit=1,tag=as_selected] Pose merge value {LeftLeg:[0.01f, 0.01f, 0.01f]}
# if last used
execute if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_head_interactable, tag=as_last_used] run scoreboard players set @s as_trigger 1160
execute if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_body_interactable, tag=as_last_used] run scoreboard players set @s as_trigger 1161
execute if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_right_arm_interactable, tag=as_last_used] run scoreboard players set @s as_trigger 1162
execute if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_left_arm_interactable, tag=as_last_used] run scoreboard players set @s as_trigger 1163
execute if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_right_leg_interactable, tag=as_last_used] run scoreboard players set @s as_trigger 1170
execute if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_left_leg_interactable, tag=as_last_used] run scoreboard players set @s as_trigger 1171
#
scoreboard players operation @e[type=minecraft:armor_stand,tag=as_selected,limit=1,sort=nearest] as_trigger = @s as_trigger
#
# Pointing function
#
execute if entity @s[scores={as_trigger=1160..1171}] as @e[type=armor_stand,tag=as_selected,nbt={Small:0b}] at @s run function armor_statues:trigger/pointing
execute if entity @s[scores={as_trigger=1160..1171}] as @e[type=armor_stand,tag=as_selected,nbt={Small:1b}] at @s run function armor_statues:trigger/pointing_small
# facing function
execute if entity @s[scores={as_trigger=124..125}] as @e[type=armor_stand,tag=as_selected] at @s run function armor_statues:trigger/facing
execute if entity @s[scores={as_trigger=124..125}] as @e[type=armor_stand,tag=as_selected,nbt={Small:0b}] at @s run function armor_statues:interactions/readjust_interactions
execute if entity @s[scores={as_trigger=124..125}] as @e[type=armor_stand,tag=as_selected,nbt={Small:1b}] at @s run function armor_statues:interactions/readjust_interactions_small
# Plays sound
execute if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable, tag=!as_last_used] run playsound minecraft:item.spyglass.use neutral @a ~ ~ ~ 1 1.5
execute if entity @s[scores={as_trigger=1..}] run playsound minecraft:item.spyglass.use neutral @a ~ ~ ~ 1 1.5