mirror of
https://github.com/LZStealth/armor-statues.git
synced 2025-06-07 17:16:44 +01:00
1.21.2 Update
This commit is contained in:
parent
c2919ab580
commit
0d35d2212e
@ -534,7 +534,7 @@ execute if score #name_enabled as_angle matches 1 run tellraw @s [\
|
||||
# Disable auto visible name
|
||||
execute if score #auto_name_visible as_angle matches 0 run tellraw @s [\
|
||||
{\
|
||||
"text":"Disable auto visible name: ",\
|
||||
"text":"Auto name visibility: ",\
|
||||
"color":"aqua"\
|
||||
},\
|
||||
{\
|
||||
@ -555,7 +555,7 @@ execute if score #auto_name_visible as_angle matches 0 run tellraw @s [\
|
||||
]
|
||||
execute if score #auto_name_visible as_angle matches 1 run tellraw @s [\
|
||||
{\
|
||||
"text":"Disable auto visible name: ",\
|
||||
"text":"Auto name visibility: ",\
|
||||
"color":"aqua"\
|
||||
},\
|
||||
{\
|
||||
|
@ -0,0 +1,61 @@
|
||||
#
|
||||
# Description: Sets up display and interaction for interactions
|
||||
# Called by: armor_statues:interactions/setup
|
||||
# Entity @s: armor_stand
|
||||
# Parameters:
|
||||
# type (str): appendage to assign to
|
||||
# block (str): block for display entity
|
||||
# x (float): x coord
|
||||
# y (float): y coord
|
||||
# translation (float): translation of block display
|
||||
# scale (float): scale of display entity
|
||||
# entity (str): entity type to summon
|
||||
#
|
||||
# summons temp block display for multiplication
|
||||
#
|
||||
summon minecraft:block_display ^ ^ ^ {Tags:["as_temp_block_display"]}
|
||||
execute store result storage armor_statues:temp multiply.var2 float 0.0001 run attribute @s minecraft:scale get 10000
|
||||
$data merge storage armor_statues:temp {\
|
||||
display_setup: {\
|
||||
type: "$(type)",\
|
||||
block: "$(block)"\
|
||||
}\
|
||||
}
|
||||
$data merge storage armor_statues:temp {\
|
||||
multiply: {\
|
||||
var1: $(x),\
|
||||
out: 'storage armor_statues:temp display_setup.x'\
|
||||
}\
|
||||
}
|
||||
execute as @e[type=minecraft:block_display,sort=nearest,limit=1,tag=as_temp_block_display] at @s run function armor_statues:multiply_float with storage armor_statues:temp multiply
|
||||
$data merge storage armor_statues:temp {\
|
||||
multiply: {\
|
||||
var1: $(y),\
|
||||
out: 'storage armor_statues:temp display_setup.y'\
|
||||
}\
|
||||
}
|
||||
execute as @e[type=minecraft:block_display,sort=nearest,limit=1,tag=as_temp_block_display] at @s run function armor_statues:multiply_float with storage armor_statues:temp multiply
|
||||
$data merge storage armor_statues:temp {\
|
||||
multiply: {\
|
||||
var1: $(translation),\
|
||||
out: 'storage armor_statues:temp display_setup.translation'\
|
||||
}\
|
||||
}
|
||||
execute as @e[type=minecraft:block_display,sort=nearest,limit=1,tag=as_temp_block_display] at @s run function armor_statues:multiply_float with storage armor_statues:temp multiply
|
||||
$data merge storage armor_statues:temp {\
|
||||
multiply: {\
|
||||
var1: $(scale),\
|
||||
out: 'storage armor_statues:temp display_setup.scale'\
|
||||
}\
|
||||
}
|
||||
execute as @e[type=minecraft:block_display,sort=nearest,limit=1,tag=as_temp_block_display] at @s run function armor_statues:multiply_float with storage armor_statues:temp multiply
|
||||
#
|
||||
# kill temp block display
|
||||
#
|
||||
kill @e[type=minecraft:block_display,tag=as_temp_block_display]
|
||||
|
||||
#
|
||||
# Summons display
|
||||
#
|
||||
$execute rotated ~ 0 positioned ^ ^ ^ summon $(entity) run function armor_statues:interactions/display_setup_helper with storage armor_statues:temp display_setup
|
||||
|
@ -0,0 +1,105 @@
|
||||
#
|
||||
# Description: teleports interactions to correct positions
|
||||
# Called by: armor_statues:interactions/interact_pointer
|
||||
# Entity @s: armor_stand
|
||||
#
|
||||
# summons temp block display for multiplication
|
||||
#
|
||||
summon minecraft:block_display ^ ^ ^ {Tags:["as_temp_block_display"]}
|
||||
execute store result storage armor_statues:temp multiply.var2 float 0.0001 run attribute @s minecraft:scale get 10000
|
||||
# Stores uuid to select entities
|
||||
scoreboard players operation #uuid_selector as_uuid1 = @s as_uuid1
|
||||
scoreboard players operation #uuid_selector as_uuid2 = @s as_uuid2
|
||||
scoreboard players operation #uuid_selector as_uuid3 = @s as_uuid3
|
||||
scoreboard players operation #uuid_selector as_uuid4 = @s as_uuid4
|
||||
# Selects entities from their stored uuid
|
||||
function armor_statues:select_by_uuid
|
||||
# head
|
||||
data merge storage armor_statues:temp {\
|
||||
tp: {\
|
||||
x: 0f\
|
||||
}\
|
||||
}
|
||||
data merge storage armor_statues:temp {\
|
||||
multiply: {\
|
||||
var1: 1.52f,\
|
||||
out: 'storage armor_statues:temp tp.y'\
|
||||
}\
|
||||
}
|
||||
|
||||
execute as @e[type=minecraft:block_display,sort=nearest,limit=1,tag=as_temp_block_display] at @s run function armor_statues:multiply_float with storage armor_statues:temp multiply
|
||||
execute as @e[type=#armor_statues:selectable,tag=as_uuid_selected,tag=as_head_interactable] rotated ~ 0 run function armor_statues:interactions/tp_helper with storage armor_statues:temp tp
|
||||
# body
|
||||
data merge storage armor_statues:temp {\
|
||||
tp: {\
|
||||
x: 0f\
|
||||
}\
|
||||
}
|
||||
data merge storage armor_statues:temp {\
|
||||
multiply: {\
|
||||
var1: 1.25f,\
|
||||
out: 'storage armor_statues:temp tp.y'\
|
||||
}\
|
||||
}
|
||||
|
||||
execute as @e[type=minecraft:block_display,sort=nearest,limit=1,tag=as_temp_block_display] at @s run function armor_statues:multiply_float with storage armor_statues:temp multiply
|
||||
execute as @e[type=#armor_statues:selectable,tag=as_uuid_selected,tag=as_body_interactable] rotated ~ 0 run function armor_statues:interactions/tp_helper with storage armor_statues:temp tp
|
||||
# right arm
|
||||
data merge storage armor_statues:temp {\
|
||||
multiply: {\
|
||||
var1: -0.34375f,\
|
||||
out: 'storage armor_statues:temp tp.x'\
|
||||
}\
|
||||
}
|
||||
execute as @e[type=minecraft:block_display,sort=nearest,limit=1,tag=as_temp_block_display] at @s run function armor_statues:multiply_float with storage armor_statues:temp multiply
|
||||
data merge storage armor_statues:temp {\
|
||||
multiply: {\
|
||||
var1: 1.28125f,\
|
||||
out: 'storage armor_statues:temp tp.y'\
|
||||
}\
|
||||
}
|
||||
execute as @e[type=minecraft:block_display,sort=nearest,limit=1,tag=as_temp_block_display] at @s run function armor_statues:multiply_float with storage armor_statues:temp multiply
|
||||
execute as @e[type=#armor_statues:selectable,tag=as_uuid_selected,tag=as_right_arm_interactable] rotated ~ 0 run function armor_statues:interactions/tp_helper with storage armor_statues:temp tp
|
||||
# left arm
|
||||
data merge storage armor_statues:temp {\
|
||||
multiply: {\
|
||||
var1: 0.34375f,\
|
||||
out: 'storage armor_statues:temp tp.x'\
|
||||
}\
|
||||
}
|
||||
execute as @e[type=minecraft:block_display,sort=nearest,limit=1,tag=as_temp_block_display] at @s run function armor_statues:multiply_float with storage armor_statues:temp multiply
|
||||
execute as @e[type=#armor_statues:selectable,tag=as_uuid_selected,tag=as_left_arm_interactable] rotated ~ 0 run function armor_statues:interactions/tp_helper with storage armor_statues:temp tp
|
||||
# right leg
|
||||
data merge storage armor_statues:temp {\
|
||||
multiply: {\
|
||||
var1: -0.125f,\
|
||||
out: 'storage armor_statues:temp tp.x'\
|
||||
}\
|
||||
}
|
||||
execute as @e[type=minecraft:block_display,sort=nearest,limit=1,tag=as_temp_block_display] at @s run function armor_statues:multiply_float with storage armor_statues:temp multiply
|
||||
data merge storage armor_statues:temp {\
|
||||
multiply: {\
|
||||
var1: 0.65625f,\
|
||||
out: 'storage armor_statues:temp tp.y'\
|
||||
}\
|
||||
}
|
||||
execute as @e[type=minecraft:block_display,sort=nearest,limit=1,tag=as_temp_block_display] at @s run function armor_statues:multiply_float with storage armor_statues:temp multiply
|
||||
execute as @e[type=#armor_statues:selectable,tag=as_uuid_selected,tag=as_right_leg_interactable] rotated ~ 0 run function armor_statues:interactions/tp_helper with storage armor_statues:temp tp
|
||||
# left leg
|
||||
data merge storage armor_statues:temp {\
|
||||
multiply: {\
|
||||
var1: 0.125f,\
|
||||
out: 'storage armor_statues:temp tp.x'\
|
||||
}\
|
||||
}
|
||||
execute as @e[type=minecraft:block_display,sort=nearest,limit=1,tag=as_temp_block_display] at @s run function armor_statues:multiply_float with storage armor_statues:temp multiply
|
||||
execute as @e[type=#armor_statues:selectable,tag=as_uuid_selected,tag=as_left_leg_interactable] rotated ~ 0 run function armor_statues:interactions/tp_helper with storage armor_statues:temp tp
|
||||
# base
|
||||
execute as @e[type=#armor_statues:selectable,tag=as_uuid_selected,tag=as_base_interactable] rotated ~ 0 run tp ^ ^ ^
|
||||
#
|
||||
tag @e[tag=as_uuid_selected] remove as_uuid_selected
|
||||
|
||||
#
|
||||
# kill temp block display
|
||||
#
|
||||
kill @e[type=minecraft:block_display,tag=as_temp_block_display]
|
@ -0,0 +1,94 @@
|
||||
#
|
||||
# Description: teleports interactions to correct positions
|
||||
# Called by: armor_statues:interactions/interact_pointer
|
||||
# Entity @s: armor_stand
|
||||
#
|
||||
# summons temp block display for multiplication
|
||||
#
|
||||
summon minecraft:block_display ^ ^ ^ {Tags:["as_temp_block_display"]}
|
||||
execute store result storage armor_statues:temp multiply.var2 float 0.0001 run attribute @s minecraft:scale get 10000
|
||||
# Stores uuid to select entities
|
||||
scoreboard players operation #uuid_selector as_uuid1 = @s as_uuid1
|
||||
scoreboard players operation #uuid_selector as_uuid2 = @s as_uuid2
|
||||
scoreboard players operation #uuid_selector as_uuid3 = @s as_uuid3
|
||||
scoreboard players operation #uuid_selector as_uuid4 = @s as_uuid4
|
||||
# Selects entities from their stored uuid
|
||||
function armor_statues:select_by_uuid
|
||||
# head
|
||||
data merge storage armor_statues:temp {\
|
||||
tp: {\
|
||||
x: 0f\
|
||||
}\
|
||||
}
|
||||
data merge storage armor_statues:temp {\
|
||||
multiply: {\
|
||||
var1: 0.76f,\
|
||||
out: 'storage armor_statues:temp tp.y'\
|
||||
}\
|
||||
}
|
||||
|
||||
execute as @e[type=minecraft:block_display,sort=nearest,limit=1,tag=as_temp_block_display] at @s run function armor_statues:multiply_float with storage armor_statues:temp multiply
|
||||
execute as @e[type=#armor_statues:selectable,tag=as_uuid_selected,tag=as_head_interactable] rotated ~ 0 run function armor_statues:interactions/tp_helper with storage armor_statues:temp tp
|
||||
# body
|
||||
data merge storage armor_statues:temp {\
|
||||
multiply: {\
|
||||
var1: 0.625f,\
|
||||
out: 'storage armor_statues:temp tp.y'\
|
||||
}\
|
||||
}
|
||||
|
||||
execute as @e[type=minecraft:block_display,sort=nearest,limit=1,tag=as_temp_block_display] at @s run function armor_statues:multiply_float with storage armor_statues:temp multiply
|
||||
execute as @e[type=#armor_statues:selectable,tag=as_uuid_selected,tag=as_body_interactable] rotated ~ 0 run function armor_statues:interactions/tp_helper with storage armor_statues:temp tp
|
||||
# right arm
|
||||
data merge storage armor_statues:temp {\
|
||||
multiply: {\
|
||||
var1: -0.171875f,\
|
||||
out: 'storage armor_statues:temp tp.x'\
|
||||
}\
|
||||
}
|
||||
execute as @e[type=minecraft:block_display,sort=nearest,limit=1,tag=as_temp_block_display] at @s run function armor_statues:multiply_float with storage armor_statues:temp multiply
|
||||
data merge storage armor_statues:temp {\
|
||||
multiply: {\
|
||||
var1: 0.640625f,\
|
||||
out: 'storage armor_statues:temp tp.y'\
|
||||
}\
|
||||
}
|
||||
execute as @e[type=minecraft:block_display,sort=nearest,limit=1,tag=as_temp_block_display] at @s run function armor_statues:multiply_float with storage armor_statues:temp multiply
|
||||
execute as @e[type=#armor_statues:selectable,tag=as_uuid_selected,tag=as_right_arm_interactable] rotated ~ 0 run function armor_statues:interactions/tp_helper with storage armor_statues:temp tp
|
||||
# left arm
|
||||
data merge storage armor_statues:temp {\
|
||||
multiply: {\
|
||||
var1: 0.171875f,\
|
||||
out: 'storage armor_statues:temp tp.x'\
|
||||
}\
|
||||
}
|
||||
execute as @e[type=minecraft:block_display,sort=nearest,limit=1,tag=as_temp_block_display] at @s run function armor_statues:multiply_float with storage armor_statues:temp multiply
|
||||
execute as @e[type=#armor_statues:selectable,tag=as_uuid_selected,tag=as_left_arm_interactable] rotated ~ 0 run function armor_statues:interactions/tp_helper with storage armor_statues:temp tp
|
||||
# right leg
|
||||
data merge storage armor_statues:temp {\
|
||||
multiply: {\
|
||||
var1: -0.0625f,\
|
||||
out: 'storage armor_statues:temp tp.x'\
|
||||
}\
|
||||
}
|
||||
execute as @e[type=minecraft:block_display,sort=nearest,limit=1,tag=as_temp_block_display] at @s run function armor_statues:multiply_float with storage armor_statues:temp multiply
|
||||
data merge storage armor_statues:temp {\
|
||||
multiply: {\
|
||||
var1: 0.328125f,\
|
||||
out: 'storage armor_statues:temp tp.y'\
|
||||
}\
|
||||
}
|
||||
execute as @e[type=minecraft:block_display,sort=nearest,limit=1,tag=as_temp_block_display] at @s run function armor_statues:multiply_float with storage armor_statues:temp multiply
|
||||
execute as @e[type=#armor_statues:selectable,tag=as_uuid_selected,tag=as_right_leg_interactable] rotated ~ 0 run function armor_statues:interactions/tp_helper with storage armor_statues:temp tp
|
||||
# left leg
|
||||
data merge storage armor_statues:temp {\
|
||||
multiply: {\
|
||||
var1: 0.0625f,\
|
||||
out: 'storage armor_statues:temp tp.x'\
|
||||
}\
|
||||
}
|
||||
execute as @e[type=minecraft:block_display,sort=nearest,limit=1,tag=as_temp_block_display] at @s run function armor_statues:multiply_float with storage armor_statues:temp multiply
|
||||
execute as @e[type=#armor_statues:selectable,tag=as_uuid_selected,tag=as_left_leg_interactable] rotated ~ 0 run function armor_statues:interactions/tp_helper with storage armor_statues:temp tp
|
||||
# base
|
||||
execute as @e[type=#armor_statues:selectable,tag=as_uuid_selected,tag=as_base_interactable] rotated ~ 0 run tp ^ ^ ^
|
||||
tag @e[tag=as_uuid_selected] remove as_uuid_selected
|
@ -0,0 +1,20 @@
|
||||
#
|
||||
# Description: Copies last state for redoing
|
||||
# Called by: as_statue:repeat/undo
|
||||
# Entity @s: player
|
||||
#
|
||||
# Copies data to redo
|
||||
#
|
||||
data modify storage armor_statues:book_storage SavedItem.components.minecraft:custom_data.RedoStates prepend value {HasVisualFire:0b}
|
||||
#
|
||||
data modify storage armor_statues:book_storage SavedItem.components.minecraft:custom_data.RedoStates[0].Pose set from entity @e[type=armor_stand,sort=nearest,limit=1,tag=as_selected] Pose
|
||||
data modify storage armor_statues:book_storage SavedItem.components.minecraft:custom_data.RedoStates[0].NoBasePlate set from entity @e[type=armor_stand,sort=nearest,limit=1,tag=as_selected] NoBasePlate
|
||||
data modify storage armor_statues:book_storage SavedItem.components.minecraft:custom_data.RedoStates[0].ShowArms set from entity @e[type=armor_stand,sort=nearest,limit=1,tag=as_selected] ShowArms
|
||||
data modify storage armor_statues:book_storage SavedItem.components.minecraft:custom_data.RedoStates[0].Small set from entity @e[type=armor_stand,sort=nearest,limit=1,tag=as_selected] Small
|
||||
data modify storage armor_statues:book_storage SavedItem.components.minecraft:custom_data.RedoStates[0].Invisible set from entity @e[type=armor_stand,sort=nearest,limit=1,tag=as_selected] Invisible
|
||||
#data modify storage armor_statues:book_storage SavedItem.components.minecraft:custom_data.RedoStates[0].CustomNameVisible set from entity @e[type=armor_stand,sort=nearest,limit=1,tag=as_selected] CustomNameVisible
|
||||
data modify storage armor_statues:book_storage SavedItem.components.minecraft:custom_data.RedoStates[0].NoGravity set from entity @e[type=armor_stand,sort=nearest,limit=1,tag=as_selected] NoGravity
|
||||
data modify storage armor_statues:book_storage SavedItem.components.minecraft:custom_data.RedoStates[0].Pos set from entity @e[type=armor_stand,sort=nearest,limit=1,tag=as_selected] Pos
|
||||
data modify storage armor_statues:book_storage SavedItem.components.minecraft:custom_data.RedoStates[0].Rotation set from entity @e[type=armor_stand,sort=nearest,limit=1,tag=as_selected] Rotation
|
||||
data modify storage armor_statues:book_storage SavedItem.components.minecraft:custom_data.RedoStates[0].HasVisualFire set from entity @e[type=armor_stand,sort=nearest,limit=1,tag=as_selected] HasVisualFire
|
||||
execute store result storage armor_statues:book_storage SavedItem.components.minecraft:custom_data.RedoStates[0].Scale double 0.001 run attribute @e[type=armor_stand,sort=nearest,limit=1,tag=as_selected] minecraft:scale get 1000
|
@ -0,0 +1,20 @@
|
||||
#
|
||||
# Description: Copies last state for undoing
|
||||
# Called by: as_statue:repeat/save
|
||||
# Entity @s: player
|
||||
#
|
||||
# Saves state for undoing
|
||||
#
|
||||
data modify storage armor_statues:book_storage SavedItem.components.minecraft:custom_data.UndoStates prepend value {HasVisualFire:0b}
|
||||
#
|
||||
data modify storage armor_statues:book_storage SavedItem.components.minecraft:custom_data.UndoStates[0].Pose set from entity @e[type=armor_stand,sort=nearest,limit=1,tag=as_selected] Pose
|
||||
data modify storage armor_statues:book_storage SavedItem.components.minecraft:custom_data.UndoStates[0].NoBasePlate set from entity @e[type=armor_stand,sort=nearest,limit=1,tag=as_selected] NoBasePlate
|
||||
data modify storage armor_statues:book_storage SavedItem.components.minecraft:custom_data.UndoStates[0].ShowArms set from entity @e[type=armor_stand,sort=nearest,limit=1,tag=as_selected] ShowArms
|
||||
data modify storage armor_statues:book_storage SavedItem.components.minecraft:custom_data.UndoStates[0].Small set from entity @e[type=armor_stand,sort=nearest,limit=1,tag=as_selected] Small
|
||||
data modify storage armor_statues:book_storage SavedItem.components.minecraft:custom_data.UndoStates[0].Invisible set from entity @e[type=armor_stand,sort=nearest,limit=1,tag=as_selected] Invisible
|
||||
#data modify storage armor_statues:book_storage SavedItem.components.minecraft:custom_data.UndoStates[0].CustomNameVisible set from entity @e[type=armor_stand,sort=nearest,limit=1,tag=as_selected] CustomNameVisible
|
||||
data modify storage armor_statues:book_storage SavedItem.components.minecraft:custom_data.UndoStates[0].NoGravity set from entity @e[type=armor_stand,sort=nearest,limit=1,tag=as_selected] NoGravity
|
||||
data modify storage armor_statues:book_storage SavedItem.components.minecraft:custom_data.UndoStates[0].Pos set from entity @e[type=armor_stand,sort=nearest,limit=1,tag=as_selected] Pos
|
||||
data modify storage armor_statues:book_storage SavedItem.components.minecraft:custom_data.UndoStates[0].Rotation set from entity @e[type=armor_stand,sort=nearest,limit=1,tag=as_selected] Rotation
|
||||
data modify storage armor_statues:book_storage SavedItem.components.minecraft:custom_data.UndoStates[0].HasVisualFire set from entity @e[type=armor_stand,sort=nearest,limit=1,tag=as_selected] HasVisualFire
|
||||
execute store result storage armor_statues:book_storage SavedItem.components.minecraft:custom_data.UndoStates[0].Scale double 0.001 run attribute @e[type=armor_stand,sort=nearest,limit=1,tag=as_selected] minecraft:scale get 1000
|
8
1_21_2/data/armor_statues/function/set_scale.mcfunction
Normal file
8
1_21_2/data/armor_statues/function/set_scale.mcfunction
Normal file
@ -0,0 +1,8 @@
|
||||
#
|
||||
# Description: sets scale attribute
|
||||
# Called by: as_statue:trigger/paste
|
||||
# Entity @s: armor stand
|
||||
# Parameters:
|
||||
# Scale (double): scale attribute to set
|
||||
#
|
||||
$attribute @s minecraft:scale base set $(Scale)
|
@ -0,0 +1,35 @@
|
||||
#
|
||||
# Description: Summons a temp marker to use as a pointer
|
||||
# Called by: armor_statues:trigger/pointing|armor_statues:trigger/pointing_small
|
||||
# Entity @s: armor stand
|
||||
# Parameters:
|
||||
# x (float): x coord
|
||||
# y (float): y coord
|
||||
#
|
||||
# summons temp block display for multiplication
|
||||
#
|
||||
summon minecraft:block_display ^ ^ ^ {Tags:["as_temp_block_display"]}
|
||||
execute store result storage armor_statues:temp multiply.var2 float 0.0001 run attribute @s minecraft:scale get 10000
|
||||
$data merge storage armor_statues:temp {\
|
||||
multiply: {\
|
||||
var1: $(x),\
|
||||
out: 'storage armor_statues:temp coord.x'\
|
||||
}\
|
||||
}
|
||||
execute as @e[type=minecraft:block_display,sort=nearest,limit=1,tag=as_temp_block_display] at @s run function armor_statues:multiply_float with storage armor_statues:temp multiply
|
||||
$data merge storage armor_statues:temp {\
|
||||
multiply: {\
|
||||
var1: $(y),\
|
||||
out: 'storage armor_statues:temp coord.y'\
|
||||
}\
|
||||
}
|
||||
execute as @e[type=minecraft:block_display,sort=nearest,limit=1,tag=as_temp_block_display] at @s run function armor_statues:multiply_float with storage armor_statues:temp multiply
|
||||
|
||||
#
|
||||
# Summons temp marker
|
||||
#
|
||||
function armor_statues:summon_temp_marker_helper with storage armor_statues:temp coord
|
||||
#
|
||||
# kill temp block display
|
||||
#
|
||||
kill @e[type=minecraft:block_display,tag=as_temp_block_display]
|
128
1_21_2/data/armor_statues/function/trigger/align.mcfunction
Normal file
128
1_21_2/data/armor_statues/function/trigger/align.mcfunction
Normal file
@ -0,0 +1,128 @@
|
||||
#
|
||||
# Description: Align held block or item with supporting surface
|
||||
# Called by: armor_statues:trigger
|
||||
# Entity @s: armor stand
|
||||
#
|
||||
#
|
||||
# summons temp block display for multiplication
|
||||
#
|
||||
summon minecraft:block_display ^ ^ ^ {Tags:["as_temp_block_display"]}
|
||||
execute store result storage armor_statues:temp multiply.var2 float 0.0001 run attribute @s minecraft:scale get 10000
|
||||
#
|
||||
# Align block to surface
|
||||
#
|
||||
execute if entity @s[scores={as_trigger=151}] run data merge storage armor_statues:temp {\
|
||||
multiply: {\
|
||||
var1: 0.5725f,\
|
||||
out: 'storage armor_statues:temp align.x'\
|
||||
}\
|
||||
}
|
||||
execute if entity @s[scores={as_trigger=151}] as @e[type=minecraft:block_display,sort=nearest,limit=1,tag=as_temp_block_display] at @s run function armor_statues:multiply_float with storage armor_statues:temp multiply
|
||||
execute if entity @s[scores={as_trigger=151}] run data merge storage armor_statues:temp {\
|
||||
multiply: {\
|
||||
var1: -0.655f,\
|
||||
out: 'storage armor_statues:temp align.y'\
|
||||
}\
|
||||
}
|
||||
execute if entity @s[scores={as_trigger=151}] as @e[type=minecraft:block_display,sort=nearest,limit=1,tag=as_temp_block_display] at @s run function armor_statues:multiply_float with storage armor_statues:temp multiply
|
||||
execute if entity @s[scores={as_trigger=151}] run data merge storage armor_statues:temp {\
|
||||
multiply: {\
|
||||
var1: 0.352,\
|
||||
out: 'storage armor_statues:temp align.z'\
|
||||
}\
|
||||
}
|
||||
execute if entity @s[scores={as_trigger=151}] as @e[type=minecraft:block_display,sort=nearest,limit=1,tag=as_temp_block_display] at @s run function armor_statues:multiply_float with storage armor_statues:temp multiply
|
||||
|
||||
execute if entity @s[scores={as_trigger=151}] run data merge entity @s {ShowArms:1b,NoGravity:1b,Invisible:1b,Pose:{Head:[0.0f,0.001f,0.0f],Body:[0.0f,0.001f,0.0f],RightArm:[-15.0f,135.0f,0.0f],LeftArm:[0.0f,0.0f,0.0f],RightLeg:[0.0f,0.0f,0.0f],LeftLeg:[0.0f,0.0f,0.0f]}}
|
||||
execute if entity @s[scores={as_trigger=151}] at @s run function armor_statues:trigger/tp_helper with storage armor_statues:temp align
|
||||
#
|
||||
# Align item to surface (upright)
|
||||
#
|
||||
execute if entity @s[scores={as_trigger=152}] run data merge storage armor_statues:temp {\
|
||||
multiply: {\
|
||||
var1: 0.36f,\
|
||||
out: 'storage armor_statues:temp align.x'\
|
||||
}\
|
||||
}
|
||||
execute if entity @s[scores={as_trigger=152}] as @e[type=minecraft:block_display,sort=nearest,limit=1,tag=as_temp_block_display] at @s run function armor_statues:multiply_float with storage armor_statues:temp multiply
|
||||
execute if entity @s[scores={as_trigger=152}] run data merge storage armor_statues:temp {\
|
||||
multiply: {\
|
||||
var1: -1.41f,\
|
||||
out: 'storage armor_statues:temp align.y'\
|
||||
}\
|
||||
}
|
||||
execute if entity @s[scores={as_trigger=152}] as @e[type=minecraft:block_display,sort=nearest,limit=1,tag=as_temp_block_display] at @s run function armor_statues:multiply_float with storage armor_statues:temp multiply
|
||||
execute if entity @s[scores={as_trigger=152}] run data merge storage armor_statues:temp {\
|
||||
multiply: {\
|
||||
var1: -0.5625,\
|
||||
out: 'storage armor_statues:temp align.z'\
|
||||
}\
|
||||
}
|
||||
execute if entity @s[scores={as_trigger=152}] as @e[type=minecraft:block_display,sort=nearest,limit=1,tag=as_temp_block_display] at @s run function armor_statues:multiply_float with storage armor_statues:temp multiply
|
||||
|
||||
execute if entity @s[scores={as_trigger=152}] run data merge entity @s {ShowArms:1b,NoGravity:1b,Invisible:1b,Pose:{Head:[0.0f,0.001f,0.0f],Body:[0.0f,0.001f,0.0f],RightArm:[-90.0f,0.0f,0.0f],LeftArm:[0.0f,0.0f,0.0f],RightLeg:[0.0f,0.0f,0.0f],LeftLeg:[0.0f,0.0f,0.0f]}}
|
||||
execute if entity @s[scores={as_trigger=152}] at @s run function armor_statues:trigger/tp_helper with storage armor_statues:temp align
|
||||
#
|
||||
# Align item to surface (flat)
|
||||
#
|
||||
execute if entity @s[scores={as_trigger=153}] run data merge storage armor_statues:temp {\
|
||||
multiply: {\
|
||||
var1: 0.385f,\
|
||||
out: 'storage armor_statues:temp align.x'\
|
||||
}\
|
||||
}
|
||||
execute if entity @s[scores={as_trigger=153}] as @e[type=minecraft:block_display,sort=nearest,limit=1,tag=as_temp_block_display] at @s run function armor_statues:multiply_float with storage armor_statues:temp multiply
|
||||
execute if entity @s[scores={as_trigger=153}] run data merge storage armor_statues:temp {\
|
||||
multiply: {\
|
||||
var1: -0.78f,\
|
||||
out: 'storage armor_statues:temp align.y'\
|
||||
}\
|
||||
}
|
||||
execute if entity @s[scores={as_trigger=153}] as @e[type=minecraft:block_display,sort=nearest,limit=1,tag=as_temp_block_display] at @s run function armor_statues:multiply_float with storage armor_statues:temp multiply
|
||||
execute if entity @s[scores={as_trigger=153}] run data merge storage armor_statues:temp {\
|
||||
multiply: {\
|
||||
var1: -0.295,\
|
||||
out: 'storage armor_statues:temp align.z'\
|
||||
}\
|
||||
}
|
||||
execute if entity @s[scores={as_trigger=153}] as @e[type=minecraft:block_display,sort=nearest,limit=1,tag=as_temp_block_display] at @s run function armor_statues:multiply_float with storage armor_statues:temp multiply
|
||||
|
||||
execute if entity @s[scores={as_trigger=153}] run data merge entity @s {ShowArms:1b,NoGravity:1b,Invisible:1b,Pose:{Head:[0.0f,0.001f,0.0f],Body:[0.0f,0.001f,0.0f],RightArm:[0.0f,0.001f,0.0f],LeftArm:[0.0f,0.001f,0.0f],RightLeg:[0.0f,0.001f,0.0f],LeftLeg:[0.0f,0.001f,0.0f]}}
|
||||
execute if entity @s[scores={as_trigger=153}] at @s run function armor_statues:trigger/tp_helper with storage armor_statues:temp align
|
||||
#
|
||||
# Align tool to surface (flat)
|
||||
#
|
||||
execute if entity @s[scores={as_trigger=154}] run data merge storage armor_statues:temp {\
|
||||
multiply: {\
|
||||
var1: -0.17f,\
|
||||
out: 'storage armor_statues:temp align.x'\
|
||||
}\
|
||||
}
|
||||
execute if entity @s[scores={as_trigger=154}] as @e[type=minecraft:block_display,sort=nearest,limit=1,tag=as_temp_block_display] at @s run function armor_statues:multiply_float with storage armor_statues:temp multiply
|
||||
execute if entity @s[scores={as_trigger=154}] run data merge storage armor_statues:temp {\
|
||||
multiply: {\
|
||||
var1: -1.285f,\
|
||||
out: 'storage armor_statues:temp align.y'\
|
||||
}\
|
||||
}
|
||||
execute if entity @s[scores={as_trigger=154}] as @e[type=minecraft:block_display,sort=nearest,limit=1,tag=as_temp_block_display] at @s run function armor_statues:multiply_float with storage armor_statues:temp multiply
|
||||
execute if entity @s[scores={as_trigger=154}] run data merge storage armor_statues:temp {\
|
||||
multiply: {\
|
||||
var1: -0.44,\
|
||||
out: 'storage armor_statues:temp align.z'\
|
||||
}\
|
||||
}
|
||||
execute if entity @s[scores={as_trigger=154}] as @e[type=minecraft:block_display,sort=nearest,limit=1,tag=as_temp_block_display] at @s run function armor_statues:multiply_float with storage armor_statues:temp multiply
|
||||
|
||||
execute if entity @s[scores={as_trigger=154}] run data merge entity @s {ShowArms:1b,NoGravity:1b,Invisible:1b,Pose:{Head:[0.0f,0.001f,0.0f],Body:[0.0f,0.001f,0.0f],RightArm:[-10.0f,0.0f,-90.0f],LeftArm:[0.0f,0.0f,0.0f],RightLeg:[0.0f,0.0f,0.0f],LeftLeg:[0.0f,0.0f,0.0f]}}
|
||||
execute if entity @s[scores={as_trigger=154}] at @s run function armor_statues:trigger/tp_helper with storage armor_statues:temp align
|
||||
#
|
||||
# Tag the armor stand as modified and invisible
|
||||
#
|
||||
tag @s add as_invisible
|
||||
tag @s add as_modified
|
||||
|
||||
#
|
||||
# kill temp block display
|
||||
#
|
||||
kill @e[type=minecraft:block_display,tag=as_temp_block_display]
|
@ -0,0 +1,128 @@
|
||||
#
|
||||
# Description: Align held block or item with supporting surface for small armor stands
|
||||
# Called by: armor_statues:trigger
|
||||
# Entity @s: armor stand
|
||||
#
|
||||
# summons temp block display for multiplication
|
||||
#
|
||||
summon minecraft:block_display ^ ^ ^ {Tags:["as_temp_block_display"]}
|
||||
execute store result storage armor_statues:temp multiply.var2 float 0.0001 run attribute @s minecraft:scale get 10000
|
||||
#
|
||||
# Align block to surface
|
||||
#
|
||||
execute if entity @s[scores={as_trigger=151}] run data merge storage armor_statues:temp {\
|
||||
multiply: {\
|
||||
var1: 0.28625f,\
|
||||
out: 'storage armor_statues:temp align.x'\
|
||||
}\
|
||||
}
|
||||
execute if entity @s[scores={as_trigger=151}] as @e[type=minecraft:block_display,sort=nearest,limit=1,tag=as_temp_block_display] at @s run function armor_statues:multiply_float with storage armor_statues:temp multiply
|
||||
execute if entity @s[scores={as_trigger=151}] run data merge storage armor_statues:temp {\
|
||||
multiply: {\
|
||||
var1: -0.3275f,\
|
||||
out: 'storage armor_statues:temp align.y'\
|
||||
}\
|
||||
}
|
||||
execute if entity @s[scores={as_trigger=151}] as @e[type=minecraft:block_display,sort=nearest,limit=1,tag=as_temp_block_display] at @s run function armor_statues:multiply_float with storage armor_statues:temp multiply
|
||||
execute if entity @s[scores={as_trigger=151}] run data merge storage armor_statues:temp {\
|
||||
multiply: {\
|
||||
var1: 0.176,\
|
||||
out: 'storage armor_statues:temp align.z'\
|
||||
}\
|
||||
}
|
||||
execute if entity @s[scores={as_trigger=151}] as @e[type=minecraft:block_display,sort=nearest,limit=1,tag=as_temp_block_display] at @s run function armor_statues:multiply_float with storage armor_statues:temp multiply
|
||||
|
||||
execute if entity @s[scores={as_trigger=151}] run data merge entity @s {ShowArms:1b,NoGravity:1b,Invisible:1b,Pose:{Head:[0.0f,0.001f,0.0f],Body:[0.0f,0.001f,0.0f],RightArm:[-15.0f,135.0f,0.0f],LeftArm:[0.0f,0.0f,0.0f],RightLeg:[0.0f,0.0f,0.0f],LeftLeg:[0.0f,0.0f,0.0f]}}
|
||||
execute if entity @s[scores={as_trigger=151}] at @s run function armor_statues:trigger/tp_helper with storage armor_statues:temp align
|
||||
#
|
||||
# Align item to surface (upright)
|
||||
#
|
||||
execute if entity @s[scores={as_trigger=152}] run data merge storage armor_statues:temp {\
|
||||
multiply: {\
|
||||
var1: 0.18f,\
|
||||
out: 'storage armor_statues:temp align.x'\
|
||||
}\
|
||||
}
|
||||
execute if entity @s[scores={as_trigger=152}] as @e[type=minecraft:block_display,sort=nearest,limit=1,tag=as_temp_block_display] at @s run function armor_statues:multiply_float with storage armor_statues:temp multiply
|
||||
execute if entity @s[scores={as_trigger=152}] run data merge storage armor_statues:temp {\
|
||||
multiply: {\
|
||||
var1: -0.705f,\
|
||||
out: 'storage armor_statues:temp align.y'\
|
||||
}\
|
||||
}
|
||||
execute if entity @s[scores={as_trigger=152}] as @e[type=minecraft:block_display,sort=nearest,limit=1,tag=as_temp_block_display] at @s run function armor_statues:multiply_float with storage armor_statues:temp multiply
|
||||
execute if entity @s[scores={as_trigger=152}] run data merge storage armor_statues:temp {\
|
||||
multiply: {\
|
||||
var1: -0.28125,\
|
||||
out: 'storage armor_statues:temp align.z'\
|
||||
}\
|
||||
}
|
||||
execute if entity @s[scores={as_trigger=152}] as @e[type=minecraft:block_display,sort=nearest,limit=1,tag=as_temp_block_display] at @s run function armor_statues:multiply_float with storage armor_statues:temp multiply
|
||||
|
||||
execute if entity @s[scores={as_trigger=152}] run data merge entity @s {ShowArms:1b,NoGravity:1b,Invisible:1b,Pose:{Head:[0.0f,0.001f,0.0f],Body:[0.0f,0.001f,0.0f],RightArm:[-90.0f,0.0f,0.0f],LeftArm:[0.0f,0.0f,0.0f],RightLeg:[0.0f,0.0f,0.0f],LeftLeg:[0.0f,0.0f,0.0f]}}
|
||||
execute if entity @s[scores={as_trigger=152}] at @s run function armor_statues:trigger/tp_helper with storage armor_statues:temp align
|
||||
#
|
||||
# Align item to surface (flat)
|
||||
#
|
||||
execute if entity @s[scores={as_trigger=153}] run data merge storage armor_statues:temp {\
|
||||
multiply: {\
|
||||
var1: 0.1925f,\
|
||||
out: 'storage armor_statues:temp align.x'\
|
||||
}\
|
||||
}
|
||||
execute if entity @s[scores={as_trigger=153}] as @e[type=minecraft:block_display,sort=nearest,limit=1,tag=as_temp_block_display] at @s run function armor_statues:multiply_float with storage armor_statues:temp multiply
|
||||
execute if entity @s[scores={as_trigger=153}] run data merge storage armor_statues:temp {\
|
||||
multiply: {\
|
||||
var1: -0.39f,\
|
||||
out: 'storage armor_statues:temp align.y'\
|
||||
}\
|
||||
}
|
||||
execute if entity @s[scores={as_trigger=153}] as @e[type=minecraft:block_display,sort=nearest,limit=1,tag=as_temp_block_display] at @s run function armor_statues:multiply_float with storage armor_statues:temp multiply
|
||||
execute if entity @s[scores={as_trigger=153}] run data merge storage armor_statues:temp {\
|
||||
multiply: {\
|
||||
var1: -0.1475,\
|
||||
out: 'storage armor_statues:temp align.z'\
|
||||
}\
|
||||
}
|
||||
execute if entity @s[scores={as_trigger=153}] as @e[type=minecraft:block_display,sort=nearest,limit=1,tag=as_temp_block_display] at @s run function armor_statues:multiply_float with storage armor_statues:temp multiply
|
||||
|
||||
execute if entity @s[scores={as_trigger=153}] run data merge entity @s {ShowArms:1b,NoGravity:1b,Invisible:1b,Pose:{Head:[0.0f,0.001f,0.0f],Body:[0.0f,0.001f,0.0f],RightArm:[0.0f,0.0f,0.0f],LeftArm:[0.0f,0.0f,0.0f],RightLeg:[0.0f,0.0f,0.0f],LeftLeg:[0.0f,0.0f,0.0f]}}
|
||||
execute if entity @s[scores={as_trigger=153}] at @s run function armor_statues:trigger/tp_helper with storage armor_statues:temp align
|
||||
#
|
||||
# Align tool to surface (flat)
|
||||
#
|
||||
execute if entity @s[scores={as_trigger=154}] run data merge storage armor_statues:temp {\
|
||||
multiply: {\
|
||||
var1: -0.085f,\
|
||||
out: 'storage armor_statues:temp align.x'\
|
||||
}\
|
||||
}
|
||||
execute if entity @s[scores={as_trigger=154}] as @e[type=minecraft:block_display,sort=nearest,limit=1,tag=as_temp_block_display] at @s run function armor_statues:multiply_float with storage armor_statues:temp multiply
|
||||
execute if entity @s[scores={as_trigger=154}] run data merge storage armor_statues:temp {\
|
||||
multiply: {\
|
||||
var1: -0.6425f,\
|
||||
out: 'storage armor_statues:temp align.y'\
|
||||
}\
|
||||
}
|
||||
execute if entity @s[scores={as_trigger=154}] as @e[type=minecraft:block_display,sort=nearest,limit=1,tag=as_temp_block_display] at @s run function armor_statues:multiply_float with storage armor_statues:temp multiply
|
||||
execute if entity @s[scores={as_trigger=154}] run data merge storage armor_statues:temp {\
|
||||
multiply: {\
|
||||
var1: -0.22,\
|
||||
out: 'storage armor_statues:temp align.z'\
|
||||
}\
|
||||
}
|
||||
execute if entity @s[scores={as_trigger=154}] as @e[type=minecraft:block_display,sort=nearest,limit=1,tag=as_temp_block_display] at @s run function armor_statues:multiply_float with storage armor_statues:temp multiply
|
||||
|
||||
execute if entity @s[scores={as_trigger=154}] run data merge entity @s {ShowArms:1b,NoGravity:1b,Invisible:1b,Pose:{Head:[0.0f,0.001f,0.0f],Body:[0.0f,0.001f,0.0f],RightArm:[-10.0f,0.0f,-90.0f],LeftArm:[0.0f,0.0f,0.0f],RightLeg:[0.0f,0.0f,0.0f],LeftLeg:[0.0f,0.0f,0.0f]}}
|
||||
execute if entity @s[scores={as_trigger=154}] at @s run function armor_statues:trigger/tp_helper with storage armor_statues:temp align
|
||||
#
|
||||
#
|
||||
# Tag the armor stand as modified and invisible
|
||||
#
|
||||
tag @s add as_invisible
|
||||
tag @s add as_modified
|
||||
|
||||
#
|
||||
# kill temp block display
|
||||
#
|
||||
kill @e[type=minecraft:block_display,tag=as_temp_block_display]
|
29
1_21_2/data/armor_statues/function/trigger/copy.mcfunction
Normal file
29
1_21_2/data/armor_statues/function/trigger/copy.mcfunction
Normal file
@ -0,0 +1,29 @@
|
||||
#
|
||||
# Description: Copies selected armor stand settings and pose to the book
|
||||
# Called by: as_statue:trigger
|
||||
# Entity @s: armor stand
|
||||
#
|
||||
execute as @p[tag=as_selected] run function armor_statues:storage_in
|
||||
#
|
||||
data modify storage armor_statues:book_storage SavedItem.components.minecraft:custom_data.SavedPose set value {Pose: {RightArm: [0f, 0f, 0f], LeftLeg: [0f, 0f, 0f], Head: [0f, 0f, 0f], LeftArm: [0f, 0f, 0f], RightLeg: [0f, 0f, 0f], Body: [0f, 0f, 0f]}, NoBasePlate:0b, ShowArms:0b, Small:0b, Invisible:0b, HasVisualFire:0b}
|
||||
#
|
||||
data modify storage armor_statues:book_storage SavedItem.components.minecraft:custom_data.SavedPose.Pose merge from entity @s Pose
|
||||
data modify storage armor_statues:book_storage SavedItem.components.minecraft:custom_data.SavedPose.NoBasePlate set from entity @s NoBasePlate
|
||||
data modify storage armor_statues:book_storage SavedItem.components.minecraft:custom_data.SavedPose.ShowArms set from entity @s ShowArms
|
||||
data modify storage armor_statues:book_storage SavedItem.components.minecraft:custom_data.SavedPose.Small set from entity @s Small
|
||||
data modify storage armor_statues:book_storage SavedItem.components.minecraft:custom_data.SavedPose.Invisible set from entity @s Invisible
|
||||
data modify storage armor_statues:book_storage SavedItem.components.minecraft:custom_data.SavedPose.HasVisualFire set from entity @s HasVisualFire
|
||||
execute store result storage armor_statues:book_storage SavedItem.components.minecraft:custom_data.SavedPose.Scale double 0.001 run attribute @s minecraft:scale get 1000
|
||||
execute if score #cnv_enabled as_angle matches 1.. run data modify storage armor_statues:book_storage SavedItem.components.minecraft:custom_data.SavedPose.CustomNameVisible set value 0
|
||||
execute if score #cnv_enabled as_angle matches 1.. run data modify storage armor_statues:book_storage SavedItem.components.minecraft:custom_data.SavedPose.CustomNameVisible set from entity @s CustomNameVisible
|
||||
execute if score #name_enabled as_angle matches 1.. run data modify storage armor_statues:book_storage SavedItem.components.minecraft:custom_data.SavedPose.CustomName set from entity @s CustomName
|
||||
#
|
||||
execute as @p[tag=as_selected] run function armor_statues:storage_out
|
||||
#
|
||||
effect give @s minecraft:glowing 1
|
||||
execute as @p[tag=as_selected] run function armor_statues:player_message {\
|
||||
message: '{\
|
||||
"text":"Pose and settings copied to the book",\
|
||||
"color":"dark_green"\
|
||||
}'\
|
||||
}
|
67
1_21_2/data/armor_statues/function/trigger/rack.mcfunction
Normal file
67
1_21_2/data/armor_statues/function/trigger/rack.mcfunction
Normal file
@ -0,0 +1,67 @@
|
||||
#
|
||||
# Description: Align stand with tripwire hook to make a tool rack
|
||||
# Called by: armor_statues:trigger
|
||||
# Entity @s: armor stand
|
||||
#
|
||||
# Turn off gravity for armor stand
|
||||
#
|
||||
data merge entity @s {NoGravity:1b}
|
||||
#
|
||||
# Check for an tripwire hook in the blocks above the stand and, if found, move the stand into position below the hook and tag it
|
||||
#
|
||||
execute at @s align xyz positioned ~0.5 ~ ~0.5 if block ~ ~1 ~ minecraft:tripwire_hook run tp @s ~ ~ ~
|
||||
execute at @s if block ~ ~1 ~ minecraft:tripwire_hook run tag @s add as_rack
|
||||
execute if entity @s[tag=!as_rack] at @s align xyz positioned ~0.5 ~1 ~0.5 if block ~ ~1 ~ minecraft:tripwire_hook run tp @s ~ ~ ~
|
||||
execute if entity @s[tag=!as_rack] at @s if block ~ ~1 ~ minecraft:tripwire_hook run tag @s add as_rack
|
||||
execute if entity @s[tag=!as_rack] at @s align xyz positioned ~0.5 ~2 ~0.5 if block ~ ~1 ~ minecraft:tripwire_hook run tp @s ~ ~ ~
|
||||
execute if entity @s[tag=!as_rack] at @s if block ~ ~1 ~ minecraft:tripwire_hook run tag @s add as_rack
|
||||
#
|
||||
# Change scale
|
||||
#
|
||||
execute at @s if block ~ ~1 ~ minecraft:tripwire_hook run attribute @s minecraft:scale base set 1
|
||||
#
|
||||
# If there is a tripwire hook above the armor stand, rotate the stand to match it's orientation
|
||||
#
|
||||
execute at @s if block ~ ~1 ~ minecraft:tripwire_hook[facing=north] run data merge entity @s {Rotation:[180.0f,0.0f]}
|
||||
execute at @s if block ~ ~1 ~ minecraft:tripwire_hook[facing=east] run data merge entity @s {Rotation:[-90.0f,0.0f]}
|
||||
execute at @s if block ~ ~1 ~ minecraft:tripwire_hook[facing=south] run data merge entity @s {Rotation:[0.0f,0.0f]}
|
||||
execute at @s if block ~ ~1 ~ minecraft:tripwire_hook[facing=west] run data merge entity @s {Rotation:[90.0f,0.0f]}
|
||||
#
|
||||
# If armor stand is not tagged, display failure message
|
||||
#
|
||||
execute if entity @s[tag=!as_rack] as @p[tag=as_selected] run function armor_statues:player_message {\
|
||||
message: '{\
|
||||
"text":"Tripwire hook not found",\
|
||||
"color":"dark_red"\
|
||||
}'\
|
||||
}
|
||||
#
|
||||
# Otherwise, adjust the armor stand pose and settings, disabling all slots but the main hand, and move it into place
|
||||
#
|
||||
execute if entity @s[tag=as_rack,scores={as_trigger=155}] run data merge entity @s {ShowArms:1b,Invisible:1b,Pose:{Head:[0.0f,0.001f,0.0f],Body:[0.0f,0.001f,0.0f],RightArm:[-100.0f,90.0f,180.0f],LeftArm:[0.0f,0.0f,0.0f],RightLeg:[0.0f,0.0f,0.0f],LeftLeg:[0.0f,0.0f,0.0f]},DisabledSlots:4079166}
|
||||
execute if entity @s[tag=as_rack,scores={as_trigger=155}] at @s run tp @s ^-0.17 ^0.24 ^-0.05
|
||||
#
|
||||
# Tag the armor stand as modified
|
||||
#
|
||||
execute if entity @s[tag=as_rack] run tag @s add as_modified
|
||||
#
|
||||
# Also, mark as locked
|
||||
#
|
||||
execute if entity @s[tag=as_rack] run tag @s add as_locked
|
||||
#
|
||||
# add Player UUID lock
|
||||
#
|
||||
execute if entity @s[tag=as_rack] run execute store result score @s as_lock_uuid1 run data get entity @p[tag=as_selected] UUID[0]
|
||||
execute if entity @s[tag=as_rack] run execute store result score @s as_lock_uuid2 run data get entity @p[tag=as_selected] UUID[1]
|
||||
execute if entity @s[tag=as_rack] run execute store result score @s as_lock_uuid3 run data get entity @p[tag=as_selected] UUID[2]
|
||||
execute if entity @s[tag=as_rack] run execute store result score @s as_lock_uuid4 run data get entity @p[tag=as_selected] UUID[3]
|
||||
execute if entity @s[tag=as_rack] run tag @s add as_uuid_locked
|
||||
#
|
||||
# add tool rack tag
|
||||
#
|
||||
execute if entity @s[tag=as_rack] run tag @s add as_tool_rack
|
||||
execute if entity @s[tag=as_rack] run tag @s add as_invisible
|
||||
#
|
||||
# Finally, remove the as_rack tag
|
||||
#
|
||||
execute if entity @s[tag=as_rack] run tag @s remove as_rack
|
@ -0,0 +1,67 @@
|
||||
#
|
||||
# Description: Align stand with tripwire hook to make a tool rack for small armor stands
|
||||
# Called by: armor_statues:trigger
|
||||
# Entity @s: armor stand
|
||||
#
|
||||
# Turn off gravity for armor stand
|
||||
#
|
||||
data merge entity @s {NoGravity:1b}
|
||||
#
|
||||
# Check for an tripwire hook in the blocks above the stand and, if found, move the stand into position below the hook and tag it
|
||||
#
|
||||
execute at @s align xyz positioned ~0.5 ~ ~0.5 if block ~ ~1 ~ minecraft:tripwire_hook run tp @s ~ ~ ~
|
||||
execute at @s if block ~ ~1 ~ minecraft:tripwire_hook run tag @s add as_rack
|
||||
execute if entity @s[tag=!as_rack] at @s align xyz positioned ~0.5 ~1 ~0.5 if block ~ ~1 ~ minecraft:tripwire_hook run tp @s ~ ~ ~
|
||||
execute if entity @s[tag=!as_rack] at @s if block ~ ~1 ~ minecraft:tripwire_hook run tag @s add as_rack
|
||||
execute if entity @s[tag=!as_rack] at @s align xyz positioned ~0.5 ~2 ~0.5 if block ~ ~1 ~ minecraft:tripwire_hook run tp @s ~ ~ ~
|
||||
execute if entity @s[tag=!as_rack] at @s if block ~ ~1 ~ minecraft:tripwire_hook run tag @s add as_rack
|
||||
#
|
||||
# Change scale
|
||||
#
|
||||
execute at @s if block ~ ~1 ~ minecraft:tripwire_hook run attribute @s minecraft:scale base set 1
|
||||
#
|
||||
# If there is a tripwire hook above the armor stand, rotate the stand to match it's orientation
|
||||
#
|
||||
execute at @s if block ~ ~1 ~ minecraft:tripwire_hook[facing=north] run data merge entity @s {Rotation:[180.0f,0.0f]}
|
||||
execute at @s if block ~ ~1 ~ minecraft:tripwire_hook[facing=east] run data merge entity @s {Rotation:[-90.0f,0.0f]}
|
||||
execute at @s if block ~ ~1 ~ minecraft:tripwire_hook[facing=south] run data merge entity @s {Rotation:[0.0f,0.0f]}
|
||||
execute at @s if block ~ ~1 ~ minecraft:tripwire_hook[facing=west] run data merge entity @s {Rotation:[90.0f,0.0f]}
|
||||
#
|
||||
# If armor stand is not tagged, display failure message
|
||||
#
|
||||
execute if entity @s[tag=!as_rack] as @p[tag=as_selected] run function armor_statues:player_message {\
|
||||
message: '{\
|
||||
"text":"Tripwire hook not found",\
|
||||
"color":"dark_red"\
|
||||
}'\
|
||||
}
|
||||
#
|
||||
# Otherwise, adjust the armor stand pose and settings, disabling all slots but the main hand, and move it into place
|
||||
#
|
||||
execute if entity @s[tag=as_rack,scores={as_trigger=155}] run data merge entity @s {ShowArms:1b,Invisible:1b,Pose:{Head:[0.0f,0.001f,0.0f],Body:[0.0f,0.001f,0.0f],RightArm:[-100.0f,90.0f,180.0f],LeftArm:[0.0f,0.0f,0.0f],RightLeg:[0.0f,0.0f,0.0f],LeftLeg:[0.0f,0.0f,0.0f]},DisabledSlots:4079166}
|
||||
execute if entity @s[tag=as_rack,scores={as_trigger=155}] at @s run tp @s ^-0.085 ^0.87 ^-0.05
|
||||
#
|
||||
# Tag the armor stand as modified
|
||||
#
|
||||
execute if entity @s[tag=as_rack] run tag @s add as_modified
|
||||
#
|
||||
# Also, mark as locked
|
||||
#
|
||||
execute if entity @s[tag=as_rack] run tag @s add as_locked
|
||||
#
|
||||
# add Player UUID lock
|
||||
#
|
||||
execute if entity @s[tag=as_rack] run execute store result score @s as_lock_uuid1 run data get entity @p[tag=as_selected] UUID[0]
|
||||
execute if entity @s[tag=as_rack] run execute store result score @s as_lock_uuid2 run data get entity @p[tag=as_selected] UUID[1]
|
||||
execute if entity @s[tag=as_rack] run execute store result score @s as_lock_uuid3 run data get entity @p[tag=as_selected] UUID[2]
|
||||
execute if entity @s[tag=as_rack] run execute store result score @s as_lock_uuid4 run data get entity @p[tag=as_selected] UUID[3]
|
||||
execute if entity @s[tag=as_rack] run tag @s add as_uuid_locked
|
||||
#
|
||||
# add tool rack tag
|
||||
#
|
||||
execute if entity @s[tag=as_rack] run tag @s add as_tool_rack
|
||||
execute if entity @s[tag=as_rack] run tag @s add as_invisible
|
||||
#
|
||||
# Finally, remove the as_rack tag
|
||||
#
|
||||
execute if entity @s[tag=as_rack] run tag @s remove as_rack
|
31
1_21_2/data/armor_statues/function/trigger/scale.mcfunction
Normal file
31
1_21_2/data/armor_statues/function/trigger/scale.mcfunction
Normal file
@ -0,0 +1,31 @@
|
||||
#
|
||||
# Description: Adds scale to armor stand
|
||||
# Called by: armor_statues:trigger
|
||||
# Entity @s: armor stand
|
||||
#
|
||||
# gets armor stand scale
|
||||
#
|
||||
execute store result score #scale as_angle run attribute @s minecraft:scale base get 1000
|
||||
#
|
||||
# adds scale to value
|
||||
#
|
||||
execute if entity @s[scores={as_trigger=1300}] run scoreboard players remove #scale as_angle 500
|
||||
execute if entity @s[scores={as_trigger=1301}] run scoreboard players remove #scale as_angle 100
|
||||
execute if entity @s[scores={as_trigger=1302}] run scoreboard players remove #scale as_angle 10
|
||||
execute if entity @s[scores={as_trigger=1303}] run scoreboard players add #scale as_angle 10
|
||||
execute if entity @s[scores={as_trigger=1304}] run scoreboard players add #scale as_angle 100
|
||||
execute if entity @s[scores={as_trigger=1305}] run scoreboard players add #scale as_angle 500
|
||||
#
|
||||
# make sure scale is within limits
|
||||
#
|
||||
execute if score #scale as_angle < #scale_min as_angle run scoreboard players operation #scale as_angle = #scale_min as_angle
|
||||
execute if score #scale as_angle > #scale_max as_angle run scoreboard players operation #scale as_angle = #scale_max as_angle
|
||||
#
|
||||
# Sets back to scale
|
||||
#
|
||||
execute store result storage armor_statues:temp scale.scale float 0.001 run scoreboard players get #scale as_angle
|
||||
function armor_statues:trigger/scale_helper with storage armor_statues:temp scale
|
||||
#
|
||||
# Tag the armor stand as modified
|
||||
#
|
||||
tag @s add as_modified
|
@ -0,0 +1,8 @@
|
||||
#
|
||||
# Description: Adds scale to armor stand
|
||||
# Called by: armor_statues:scale
|
||||
# Entity @s: armor stand
|
||||
# Parameters:
|
||||
# scale (float): scale to set to armor stand
|
||||
#
|
||||
$attribute @s minecraft:scale base set $(scale)
|
201
1_21_2/data/armor_statues/loot_table/random_pose.json
Normal file
201
1_21_2/data/armor_statues/loot_table/random_pose.json
Normal file
@ -0,0 +1,201 @@
|
||||
{
|
||||
"type": "minecraft:entity",
|
||||
"pools": [
|
||||
{
|
||||
"rolls": 1,
|
||||
"entries": [
|
||||
{
|
||||
"type": "minecraft:item",
|
||||
"name": "minecraft:stone_button",
|
||||
"functions": [
|
||||
{
|
||||
"function": "minecraft:set_attributes",
|
||||
"modifiers": [
|
||||
{
|
||||
"name": "head_x",
|
||||
"attribute": "attack_damage",
|
||||
"amount": {
|
||||
"min": -180,
|
||||
"max": 180
|
||||
},
|
||||
"slot": "mainhand",
|
||||
"operation": "addition"
|
||||
},
|
||||
{
|
||||
"name": "head_y",
|
||||
"attribute": "attack_damage",
|
||||
"amount": {
|
||||
"min": -180,
|
||||
"max": 180
|
||||
},
|
||||
"slot": "mainhand",
|
||||
"operation": "addition"
|
||||
},
|
||||
{
|
||||
"name": "head_z",
|
||||
"attribute": "attack_damage",
|
||||
"amount": {
|
||||
"min": -180,
|
||||
"max": 180
|
||||
},
|
||||
"slot": "mainhand",
|
||||
"operation": "addition"
|
||||
},
|
||||
{
|
||||
"name": "body_x",
|
||||
"attribute": "attack_damage",
|
||||
"amount": {
|
||||
"min": -180,
|
||||
"max": 180
|
||||
},
|
||||
"slot": "mainhand",
|
||||
"operation": "addition"
|
||||
},
|
||||
{
|
||||
"name": "body_y",
|
||||
"attribute": "attack_damage",
|
||||
"amount": {
|
||||
"min": -180,
|
||||
"max": 180
|
||||
},
|
||||
"slot": "mainhand",
|
||||
"operation": "addition"
|
||||
},
|
||||
{
|
||||
"name": "body_z",
|
||||
"attribute": "attack_damage",
|
||||
"amount": {
|
||||
"min": -180,
|
||||
"max": 180
|
||||
},
|
||||
"slot": "mainhand",
|
||||
"operation": "addition"
|
||||
},
|
||||
{
|
||||
"name": "left_arm_x",
|
||||
"attribute": "attack_damage",
|
||||
"amount": {
|
||||
"min": -180,
|
||||
"max": 180
|
||||
},
|
||||
"slot": "mainhand",
|
||||
"operation": "addition"
|
||||
},
|
||||
{
|
||||
"name": "left_arm_y",
|
||||
"attribute": "attack_damage",
|
||||
"amount": {
|
||||
"min": -180,
|
||||
"max": 180
|
||||
},
|
||||
"slot": "mainhand",
|
||||
"operation": "addition"
|
||||
},
|
||||
{
|
||||
"name": "left_arm_z",
|
||||
"attribute": "attack_damage",
|
||||
"amount": {
|
||||
"min": -180,
|
||||
"max": 180
|
||||
},
|
||||
"slot": "mainhand",
|
||||
"operation": "addition"
|
||||
},
|
||||
{
|
||||
"name": "right_arm_x",
|
||||
"attribute": "attack_damage",
|
||||
"amount": {
|
||||
"min": -180,
|
||||
"max": 180
|
||||
},
|
||||
"slot": "mainhand",
|
||||
"operation": "addition"
|
||||
},
|
||||
{
|
||||
"name": "right_arm_y",
|
||||
"attribute": "attack_damage",
|
||||
"amount": {
|
||||
"min": -180,
|
||||
"max": 180
|
||||
},
|
||||
"slot": "mainhand",
|
||||
"operation": "addition"
|
||||
},
|
||||
{
|
||||
"name": "right_arm_z",
|
||||
"attribute": "attack_damage",
|
||||
"amount": {
|
||||
"min": -180,
|
||||
"max": 180
|
||||
},
|
||||
"slot": "mainhand",
|
||||
"operation": "addition"
|
||||
},
|
||||
{
|
||||
"name": "left_leg_x",
|
||||
"attribute": "attack_damage",
|
||||
"amount": {
|
||||
"min": -180,
|
||||
"max": 180
|
||||
},
|
||||
"slot": "mainhand",
|
||||
"operation": "addition"
|
||||
},
|
||||
{
|
||||
"name": "left_leg_y",
|
||||
"attribute": "attack_damage",
|
||||
"amount": {
|
||||
"min": -180,
|
||||
"max": 180
|
||||
},
|
||||
"slot": "mainhand",
|
||||
"operation": "addition"
|
||||
},
|
||||
{
|
||||
"name": "left_leg_z",
|
||||
"attribute": "attack_damage",
|
||||
"amount": {
|
||||
"min": -180,
|
||||
"max": 180
|
||||
},
|
||||
"slot": "mainhand",
|
||||
"operation": "addition"
|
||||
},
|
||||
{
|
||||
"name": "right_leg_x",
|
||||
"attribute": "attack_damage",
|
||||
"amount": {
|
||||
"min": -180,
|
||||
"max": 180
|
||||
},
|
||||
"slot": "mainhand",
|
||||
"operation": "addition"
|
||||
},
|
||||
{
|
||||
"name": "right_leg_y",
|
||||
"attribute": "attack_damage",
|
||||
"amount": {
|
||||
"min": -180,
|
||||
"max": 180
|
||||
},
|
||||
"slot": "mainhand",
|
||||
"operation": "addition"
|
||||
},
|
||||
{
|
||||
"name": "right_leg_z",
|
||||
"attribute": "attack_damage",
|
||||
"amount": {
|
||||
"min": -180,
|
||||
"max": 180
|
||||
},
|
||||
"slot": "mainhand",
|
||||
"operation": "addition"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
25
1_21_2/data/armor_statues/recipe/adjustment_wand.json
Normal file
25
1_21_2/data/armor_statues/recipe/adjustment_wand.json
Normal file
@ -0,0 +1,25 @@
|
||||
{
|
||||
"type": "minecraft:crafting_shapeless",
|
||||
"group": "armor_statues",
|
||||
"ingredients": [
|
||||
"minecraft:armor_stand",
|
||||
"minecraft:warped_fungus_on_a_stick"
|
||||
],
|
||||
"result": {
|
||||
"count": 1,
|
||||
"id": "minecraft:warped_fungus_on_a_stick",
|
||||
"components": {
|
||||
"minecraft:custom_data": {
|
||||
"wand":1,
|
||||
"type":0
|
||||
},
|
||||
"minecraft:enchantment_glint_override": true,
|
||||
"minecraft:max_stack_size": 1,
|
||||
"minecraft:custom_model_data": 10,
|
||||
"minecraft:custom_name": "\"Adjustment Wand: X axis\"",
|
||||
"minecraft:lore": [
|
||||
"[\"\", {\"keybind\":\"key.sneak\"}, {\"text\":\"+\"}, {\"keybind\":\"key.use\"}, {\"text\":\" to set mode\"}]"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
35
1_21_2/data/armor_statues/recipe/book.json
Normal file
35
1_21_2/data/armor_statues/recipe/book.json
Normal file
File diff suppressed because one or more lines are too long
24
1_21_2/data/armor_statues/recipe/pointer_wand.json
Normal file
24
1_21_2/data/armor_statues/recipe/pointer_wand.json
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
"type": "minecraft:crafting_shapeless",
|
||||
"group": "armor_statues",
|
||||
"ingredients": [
|
||||
"minecraft:armor_stand",
|
||||
"minecraft:stick"
|
||||
],
|
||||
"result": {
|
||||
"count": 1,
|
||||
"id": "minecraft:stick",
|
||||
"components": {
|
||||
"minecraft:custom_data": {
|
||||
"wand":1
|
||||
},
|
||||
"minecraft:enchantment_glint_override": true,
|
||||
"minecraft:max_stack_size": 1,
|
||||
"minecraft:custom_model_data": 10,
|
||||
"minecraft:custom_name": "\"Pointer Wand\"",
|
||||
"minecraft:lore": [
|
||||
"[\"\", {\"text\":\"Point at \"}, {\"translate\":\"entity.minecraft.armor_stand\"}, {\"text\":\" to use\"}]"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
@ -3,7 +3,7 @@
|
||||
"pack_format": 18,
|
||||
"supported_formats": {
|
||||
"min_inclusive": 18,
|
||||
"max_inclusive": 48
|
||||
"max_inclusive": 57
|
||||
},
|
||||
"description": [{"text":"Armor Statues","color":"gold"},{"text":"\n","color":"yellow"}]
|
||||
},
|
||||
@ -29,6 +29,13 @@
|
||||
"min_inclusive": 48,
|
||||
"max_inclusive": 9999999
|
||||
}
|
||||
},
|
||||
{
|
||||
"directory": "1_21_2",
|
||||
"formats": {
|
||||
"min_inclusive": 57,
|
||||
"max_inclusive": 9999999
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user