1
0
mirror of https://github.com/LZStealth/armor-statues.git synced 2025-06-07 17:16:44 +01:00

1.21.0 update

This commit is contained in:
MukiTanuki 2024-06-07 23:18:29 -06:00
parent 3c4da99742
commit b1f29e0f72
180 changed files with 9300 additions and 1 deletions

View File

@ -0,0 +1,18 @@
{
"display": {
"icon": {
"id": "minecraft:armor_stand"
},
"title": " Armor Statues ",
"frame": "challenge",
"description": ["",{"text":"Adds a unique book that allows you to alter the properties of armor stands in survival. ","color":"gold"},{"text":"Datapack by: ","color":"green"},{"text":"Phssthpok, MSpaceDev, and MukiTanuki\n","color":"aqua"},{"text":"Enter","color":"green"},{"text":" ","color":"gold"},{"text":"/trigger as_help","color":"yellow"},{"text":" for details.\n","color":"gold"},{"text":"Enter","color":"green"},{"text":" ","color":"gold"},{"text":"/function armor_statues:admin","color":"yellow"},{"text":" and use auto-complete to set config options.","color":"gold"}],
"background": "minecraft:textures/block/black_concrete.png",
"show_toast": false,
"announce_to_chat": false
},
"criteria": {
"tick": {
"trigger": "minecraft:tick"
}
}
}

View File

@ -0,0 +1,25 @@
{
"criteria": {
"attack": {
"trigger": "minecraft:player_hurt_entity",
"conditions": {
"player": [{
"condition": "minecraft:reference",
"name": "armor_statues:holding_wand"
}],
"entity": {
"type": "minecraft:interaction",
"nbt": "{Tags: [ \"as_interactable\" ]}"
}
}
}
},
"requirements": [
[
"attack"
]
],
"rewards": {
"function": "armor_statues:interactions/attack"
}
}

View File

@ -0,0 +1,12 @@
{
"criteria": {
"impossible": {
"trigger": "minecraft:impossible"
}
},
"requirements": [
[
"impossible"
]
]
}

View File

@ -0,0 +1,31 @@
{
"display": {
"icon": {
"id": "minecraft:armor_stand"
},
"title": {
"text":"enable_as_trigger"
},
"description": {
"text":""
},
"frame": "task",
"show_toast": false,
"announce_to_chat": false,
"hidden": false
},
"parent": "armor_statues:root",
"criteria": {
"tick": {
"trigger": "minecraft:tick"
}
},
"requirements": [
[
"tick"
]
],
"rewards": {
"function": "armor_statues:enable"
}
}

View File

@ -0,0 +1,12 @@
{
"criteria": {
"impossible": {
"trigger": "minecraft:impossible"
}
},
"requirements": [
[
"impossible"
]
]
}

View File

@ -0,0 +1,25 @@
{
"criteria": {
"interact": {
"trigger": "minecraft:player_interacted_with_entity",
"conditions": {
"player": [{
"condition": "minecraft:reference",
"name": "armor_statues:holding_wand"
}],
"entity": {
"type": "minecraft:interaction",
"nbt": "{Tags: [ \"as_interactable\" ]}"
}
}
}
},
"requirements": [
[
"interact"
]
],
"rewards": {
"function": "armor_statues:interactions/interact"
}
}

View File

@ -0,0 +1,43 @@
#
# Description: Check for players with trigger score set
# Called by: #minecraft:load
# Entity @s: none
#
schedule function armor_statues:3_second 3s
#
# Tags item frames with a book in them
#
execute if score #animate_trigger as_angle matches 1.. as @e[type=#armor_statues:item_frames,tag=!as_animatable,predicate=armor_statues:item_frame_with_book] run tag @s add as_animatable
# Untags
execute if score #animate_trigger as_angle matches 1.. as @e[type=#armor_statues:item_frames,tag=as_animatable,predicate=!armor_statues:item_frame_with_book] run tag @s remove as_animatable
#
# Turns invisible armor stands visible if they don't have any items, customNameVisible, aren't locked, are markers, or invulnerable
#
execute as @e[type=minecraft:armor_stand, tag=as_invisible, nbt={Invisible:1b}, nbt=!{Invulnerable:1b}, nbt=!{Marker:1b}, nbt=!{HandItems:[ {count:1} ]}, nbt=!{ArmorItems:[ {count:1} ]}, nbt=!{CustomNameVisible:1b}, tag=!as_locked] run function armor_statues:set_visible
#
# Unlocks tool rack armor stands if the tripwire hook is broken
#
execute as @e[type=minecraft:armor_stand, tag=as_tool_rack, nbt=!{Small:1b}] at @s unless block ~ ~1 ~ minecraft:tripwire_hook run function armor_statues:remove_tool_rack
execute as @e[type=minecraft:armor_stand, tag=as_tool_rack, nbt={Small:1b}] at @s anchored eyes unless block ^ ^ ^ minecraft:tripwire_hook run function armor_statues:remove_tool_rack
#
# Sets an armor stand to interactable if player is holding a wand
#
execute if score #wands_disabled as_angle matches 0 as @a[predicate=armor_statues:holding_wand] at @s positioned ^ ^ ^3 as @e[type=minecraft:armor_stand,distance=..3,tag=!as_locked,tag=!as_interactable,nbt=!{Marker:1b},nbt=!{Invulnerable:1b},nbt={Small:0b}] at @s run function armor_statues:interactions/setup
execute if score #wands_disabled as_angle matches 0 as @a[predicate=armor_statues:holding_wand] at @s positioned ^ ^ ^3 as @e[type=minecraft:armor_stand,distance=..3,tag=!as_locked,tag=!as_interactable,nbt=!{Marker:1b},nbt=!{Invulnerable:1b},nbt={Small:1b}] at @s run function armor_statues:interactions/setup_small
#
# Resets interactable armor stands
#
execute as @e[type=minecraft:armor_stand,tag=as_interactable] at @s unless entity @p[predicate=armor_statues:holding_wand,distance=..8] run function armor_statues:interactions/reset_armor_stand
#
# Resets stray interactable and block entities
#
execute as @e[type=#armor_statues:interactable,type=!minecraft:armor_stand,tag=as_interactable] at @s unless entity @p[predicate=armor_statues:holding_wand,distance=..10] run kill @s
#
# turns armor stands with names visible
#
execute as @e[type=minecraft:armor_stand,nbt=!{CustomNameVisible:1b}, nbt=!{Marker:1b}, nbt=!{Invulnerable:1b}] if data entity @s CustomName run data merge entity @s {CustomNameVisible:1b}
#
# re-enables triggers
#
scoreboard players enable * pointer_wand
scoreboard players enable * adjustment_wand

View File

@ -0,0 +1,14 @@
#
# Description: adjusts wand type
# Called by: armor_statues:second
# Entity @s: player
#
scoreboard players set #wand_type as_angle 0
# gets current wand type
execute store result score #wand_type as_angle run data get entity @s SelectedItem.components.minecraft:custom_data.type
# cycles and sets wand according to type
execute if score #wand_type as_angle matches 0 run item modify entity @s weapon.mainhand armor_statues:adjustment_wand_1
execute if score #wand_type as_angle matches 1 run item modify entity @s weapon.mainhand armor_statues:adjustment_wand_2
execute if score #wand_type as_angle matches 2 run item modify entity @s weapon.mainhand armor_statues:adjustment_wand_0
# sound
playsound minecraft:block.note_block.hat block @a ~ ~ ~ 0.5 1.5

View File

@ -0,0 +1,27 @@
#
# Description: trigger for crafting adjustment wand
# Called by: armor_statues:second
# Entity @s: player
#
# Checks if wands are disabled
#
execute if score #wands_disabled as_angle matches 1 run function armor_statues:player_message {\
message: '{\
"text":"Wands must be enabled",\
"color":"dark_red"\
}'\
}
execute if score #wands_disabled as_angle matches 1 run scoreboard players set @s adjustment_wand 0
execute if score #wands_disabled as_angle matches 1 run return fail
# Checks if player already has a wand
execute if items entity @s container.* minecraft:warped_fungus_on_a_stick[minecraft:custom_data~{wand:1b}] run title @s actionbar [{"text":"You already have an Adjustment Wand!","color": "red"}]
execute if items entity @s container.* minecraft:warped_fungus_on_a_stick[minecraft:custom_data~{wand:1b}] run scoreboard players set @s adjustment_wand 0
# Checks if player has an item for wand
execute unless items entity @s[scores={adjustment_wand=1..}] container.* minecraft:warped_fungus_on_a_stick run title @s actionbar [{"text":"Must have a ","color":"red"},{"translate":"item.minecraft.warped_fungus_on_a_stick","color":"yellow"},{"color":"red","text":" in Inventory"}]
execute unless items entity @s[scores={adjustment_wand=1..}] container.* minecraft:warped_fungus_on_a_stick run scoreboard players set @s adjustment_wand 0
#
clear @s[scores={adjustment_wand=1..}] minecraft:warped_fungus_on_a_stick 1
loot give @s[scores={adjustment_wand=1..}] loot armor_statues:adjustment_wand
# reset trigger
scoreboard players set @s adjustment_wand 0
scoreboard players enable @s adjustment_wand

View File

@ -0,0 +1,593 @@
#
# Description: Display admin options in chat
# Called by: Player
# Entity @s: Player
#
tellraw @s \
[\
{\
"text": "Customizable Armor Stands - Admin Options",\
"color":"yellow",\
"bold":true\
}\
]
tellraw @s \
[\
{\
"text":"Particle shrine: ",\
"color":"aqua"\
},\
{\
"text":"Create",\
"color":"green",\
"clickEvent": {\
"action":"run_command",\
"value":"/function armor_statues:shrine/create"\
}\
},\
{\
"text":" / ",\
"color":"aqua"\
},\
{\
"text":"Remove",\
"color":"green",\
"clickEvent":{\
"action":"run_command",\
"value":"/function armor_statues:shrine/remove"\
}\
}\
]
execute if score #help_craftable as_angle matches 0 run tellraw @s \
[\
{\
"text":"Get book from help: ",\
"color":"aqua"\
},\
{\
"text": "Disabled",\
"color":"green", \
"clickEvent":{\
"action":"run_command", \
"value":"/function armor_statues:admin/book_from_help_toggle"\
}, \
"hoverEvent":{\
"action":"show_text", \
"contents":{\
"text":"Click to toggle", \
"color":"yellow"\
}\
}\
}\
]
execute if score #help_craftable as_angle matches 1 run tellraw @s \
[\
{\
"text":"Get book from help: ",\
"color":"aqua"\
},\
{\
"text": "Enabled",\
"color":"green", \
"clickEvent":{\
"action":"run_command", \
"value":"/function armor_statues:admin/book_from_help_toggle"\
}, \
"hoverEvent":{\
"action":"show_text", \
"contents":{\
"text":"Click to toggle", \
"color":"yellow"\
}\
}\
}\
]
execute if score #book_uncraftable as_angle matches 0 run tellraw @s \
[\
{\
"text":"Craftable book by naming \"Statues\": ",\
"color":"aqua"\
},\
{\
"text": "Enabled",\
"color":"green", \
"clickEvent":{\
"action":"run_command", \
"value":"/function armor_statues:admin/craft_book_toggle"\
}, \
"hoverEvent":{\
"action":"show_text", \
"contents":{\
"text":"Click to toggle", \
"color":"yellow"\
}\
}\
}\
]
execute if score #book_uncraftable as_angle matches 1 run tellraw @s \
[\
{\
"text":"Craftable book by naming \"Statues\": ",\
"color":"aqua"\
},\
{\
"text": "Disabled",\
"color":"green", \
"clickEvent":{\
"action":"run_command", \
"value":"/function armor_statues:admin/craft_book_toggle"\
}, \
"hoverEvent":{\
"action":"show_text", \
"contents":{\
"text":"Click to toggle", \
"color":"yellow"\
}\
}\
}\
]
#
# pointer_craftable
#
execute if score #pointer_craftable as_angle matches 1 run tellraw @s \
[\
{\
"text":"Pointer Wand by naming \"Statues\": ",\
"color":"aqua"\
},\
{\
"text": "Enabled",\
"color":"green", \
"clickEvent":{\
"action":"run_command", \
"value":"/function armor_statues:admin/pointer_craftable_toggle"\
}, \
"hoverEvent":{\
"action":"show_text", \
"contents":{\
"text":"Click to toggle", \
"color":"yellow"\
}\
}\
}\
]
execute if score #pointer_craftable as_angle matches 0 run tellraw @s \
[\
{\
"text":"Pointer Wand by naming \"Statues\": ",\
"color":"aqua"\
},\
{\
"text": "Disabled",\
"color":"green", \
"clickEvent":{\
"action":"run_command", \
"value":"/function armor_statues:admin/pointer_craftable_toggle"\
}, \
"hoverEvent":{\
"action":"show_text", \
"contents":{\
"text":"Click to toggle", \
"color":"yellow"\
}\
}\
}\
]
#
# adjustment_craftable
#
execute if score #adjustment_craftable as_angle matches 1 run tellraw @s \
[\
{\
"text":"Adjustment Wand by naming \"Statues\": ",\
"color":"aqua"\
},\
{\
"text": "Enabled",\
"color":"green", \
"clickEvent":{\
"action":"run_command", \
"value":"/function armor_statues:admin/adjustment_craftable_toggle"\
}, \
"hoverEvent":{\
"action":"show_text", \
"contents":{\
"text":"Click to toggle", \
"color":"yellow"\
}\
}\
}\
]
execute if score #adjustment_craftable as_angle matches 0 run tellraw @s \
[\
{\
"text":"Adjustment Wand by naming \"Statues\": ",\
"color":"aqua"\
},\
{\
"text": "Disabled",\
"color":"green", \
"clickEvent":{\
"action":"run_command", \
"value":"/function armor_statues:admin/adjustment_craftable_toggle"\
}, \
"hoverEvent":{\
"action":"show_text", \
"contents":{\
"text":"Click to toggle", \
"color":"yellow"\
}\
}\
}\
]
#
# pointer_triggerable
#
execute if score #pointer_triggerable as_angle matches 1 run tellraw @s \
[\
{\
"text":"Pointer Wand using trigger: ",\
"color":"aqua"\
},\
{\
"text": "Enabled",\
"color":"green", \
"clickEvent":{\
"action":"run_command", \
"value":"/function armor_statues:admin/pointer_triggerable_toggle"\
}, \
"hoverEvent":{\
"action":"show_text", \
"contents":{\
"text":"Click to toggle", \
"color":"yellow"\
}\
}\
}\
]
execute if score #pointer_triggerable as_angle matches 0 run tellraw @s \
[\
{\
"text":"Pointer Wand using trigger: ",\
"color":"aqua"\
},\
{\
"text": "Disabled",\
"color":"green", \
"clickEvent":{\
"action":"run_command", \
"value":"/function armor_statues:admin/pointer_triggerable_toggle"\
}, \
"hoverEvent":{\
"action":"show_text", \
"contents":{\
"text":"Click to toggle", \
"color":"yellow"\
}\
}\
}\
]
#
# adjustment_triggerable
#
execute if score #adjustment_triggerable as_angle matches 1 run tellraw @s \
[\
{\
"text":"Adjustment Wand using trigger: ",\
"color":"aqua"\
},\
{\
"text": "Enabled",\
"color":"green", \
"clickEvent":{\
"action":"run_command", \
"value":"/function armor_statues:admin/adjustment_triggerable_toggle"\
}, \
"hoverEvent":{\
"action":"show_text", \
"contents":{\
"text":"Click to toggle", \
"color":"yellow"\
}\
}\
}\
]
execute if score #adjustment_triggerable as_angle matches 0 run tellraw @s \
[\
{\
"text":"Adjustment Wand using trigger: ",\
"color":"aqua"\
},\
{\
"text": "Disabled",\
"color":"green", \
"clickEvent":{\
"action":"run_command", \
"value":"/function armor_statues:admin/adjustment_triggerable_toggle"\
}, \
"hoverEvent":{\
"action":"show_text", \
"contents":{\
"text":"Click to toggle", \
"color":"yellow"\
}\
}\
}\
]
#
# uuid_locking
#
execute if score #uuid_locking as_angle matches 0 run tellraw @s [\
{\
"text":"UUID locked Armor Stands: ",\
"color":"aqua"\
},\
{\
"text": "Disabled",\
"color":"green", \
"clickEvent":{\
"action":"run_command", \
"value":"/function armor_statues:admin/uuid_lock_toggle"\
}, \
"hoverEvent":{\
"action":"show_text", \
"contents":{\
"text":"Makes locked armor stands only unlockable by the player who locked them or creative players.\\n\\nClick to toggle", \
"color":"yellow"\
}\
}\
}\
]
execute if score #uuid_locking as_angle matches 1 run tellraw @s [\
{\
"text":"UUID locked Armor Stands: ",\
"color":"aqua"\
},\
{\
"text": "Enabled",\
"color":"green", \
"clickEvent":{\
"action":"run_command", \
"value":"/function armor_statues:admin/uuid_lock_toggle"\
}, \
"hoverEvent":{\
"action":"show_text", \
"contents":{\
"text":"Makes locked armor stands only unlockable by the player who locked them or creative players.\\n\\nClick to toggle", \
"color":"yellow"\
}\
}\
}\
]
execute if score #fixing_enabled as_angle matches 0 run tellraw @s [\
{\
"text":"Enable Item Frame Fixing: ",\
"color":"aqua"\
},\
{\
"text": "Disabled",\
"color":"green", \
"clickEvent":{\
"action":"run_command", \
"value":"/function armor_statues:admin/fixed_item_frame_toggle"\
}, \
"hoverEvent":{\
"action":"show_text", \
"contents":{\
"text":"Click to toggle", \
"color":"yellow"\
}\
}\
}\
]
execute if score #fixing_enabled as_angle matches 1 run tellraw @s [\
{\
"text":"Enable Item Frame Fixing: ",\
"color":"aqua"\
},\
{\
"text": "Enabled",\
"color":"green", \
"clickEvent":{\
"action":"run_command", \
"value":"/function armor_statues:admin/fixed_item_frame_toggle"\
}, \
"hoverEvent":{\
"action":"show_text", \
"contents":{\
"text":"Click to toggle", \
"color":"yellow"\
}\
}\
}\
]
execute if score #wands_disabled as_angle matches 0 run tellraw @s [\
{\
"text":"Enable pointer and adjustment wands: ",\
"color":"aqua"\
},\
{\
"text": "Enabled",\
"color":"green", \
"clickEvent":{\
"action":"run_command", \
"value":"/function armor_statues:admin/wands_disabled_toggle"\
}, \
"hoverEvent":{\
"action":"show_text", \
"contents":{\
"text":"Click to toggle", \
"color":"yellow"\
}\
}\
}\
]
execute if score #wands_disabled as_angle matches 1 run tellraw @s [\
{\
"text":"Enable pointer and adjustment wands: ",\
"color":"aqua"\
},\
{\
"text": "Disabled",\
"color":"green", \
"clickEvent":{\
"action":"run_command", \
"value":"/function armor_statues:admin/wands_disabled_toggle"\
}, \
"hoverEvent":{\
"action":"show_text", \
"contents":{\
"text":"Click to toggle", \
"color":"yellow"\
}\
}\
}\
]
#
tellraw @s [\
{\
"text":"Delete unused invisible stands",\
"color":"green",\
"hoverEvent":{\
"action":"show_text",\
"contents":[\
{\
"text":"Deletes any invisible armor stands in loaded chunks that are not holding or wearing any items.",\
"color":"yellow"\
}\
]\
},\
"clickEvent":{\
"action":"run_command",\
"value":"/function armor_statues:admin/unused"\
}\
}\
]
tellraw @s [\
{\
"text":"Highlight all stands",\
"color":"green",\
"hoverEvent":{\
"action":"show_text",\
"contents":[\
{\
"text":"Gives all stands within 64 blocks the glowing effect for 15 seconds",\
"color":"yellow"\
}\
]\
},\
"clickEvent":{\
"action":"run_command",\
"value":"/effect give @e[type=armor_stand,distance=..64] minecraft:glowing 15 1 true"\
}\
}\
]
#
tellraw @s [\
{\
"text":"Max Undo States: ",\
"color":"aqua",\
"hoverEvent":{\
"action":"show_text",\
"contents":[\
{\
"text":"Sets the maximum number of undo states savable to the Armor Statues book.\nSet to 0 to disable undo states.",\
"color":"yellow"\
}\
]\
},\
"clickEvent":{\
"action":"suggest_command",\
"value":"/scoreboard players set #undo_states as_angle <time>"\
}\
},\
{\
"score":{\
"name":"#undo_states",\
"objective":"as_angle"\
},\
"color":"green"\
}\
]
#
tellraw @s [\
{\
"text":"Item Frame animation time: ",\
"color":"aqua",\
"hoverEvent":{\
"action":"show_text",\
"contents":[\
{\
"text":"Enables Armor Stand animations by placing a book with a saved pose into an item frame with redstone dust on the block. Requires an Armor Stand to be 8 blocks from the item frame. Sets the number of game ticks between animation time of the item frames.\n(16 is recommended for most mid-sized servers.)\nSet to 0 to disable animations.",\
"color":"yellow"\
}\
]\
},\
"clickEvent":{\
"action":"suggest_command",\
"value":"/scoreboard players set #animate_trigger as_angle <time>"\
}\
},\
{\
"score":{\
"name":"#animate_trigger",\
"objective":"as_angle"\
},\
"color":"green"\
}\
]
#
# Scale
#
execute store result storage armor_statues:admin scale.scale_min float 0.001 run scoreboard players get #scale_min as_angle
execute store result storage armor_statues:admin scale.scale_max float 0.001 run scoreboard players get #scale_max as_angle
tellraw @s [\
{\
"text":"Scale limits- ",\
"color":"aqua",\
"hoverEvent":{\
"action":"show_text",\
"contents":[\
{\
"text":"Sets the min and max values to allow using Scale.\nWARNING: setting these values too low/high may result in some settings not working properly.\n(0.25 is recommended for scale_min.\n3.0 is recommended for scale_max.)\nPhysical game limits are - min: 0.063 and max: 16.",\
"color":"yellow"\
}\
]\
},\
"clickEvent":{\
"action":"suggest_command",\
"value":"/function armor_statues:admin/scale { scale_min: 0.25f, scale_max: 3.0f }"\
}\
},\
{\
"text": "Min: "\
},\
{\
"storage":"armor_statues:admin",\
"nbt":"scale.scale_min",\
"color":"green"\
},\
{\
"text":" Max: "\
},\
{\
"storage":"armor_statues:admin",\
"nbt":"scale.scale_max",\
"color":"green"\
}\
]
#
# REDO this at some point!
#tellraw @s [{"text":"Reduce local server load","color":"green","hoverEvent":{"action":"show_text","contents":[{"text":"Sets the Marker tag on all locked armor stands within 128 blocks. This reduces the load on the server from ticking the entities but makes the stands unaffected by entity updates such as being pushed by pistons. The Marker tag can be reset for individual stands by unlocking them.","color":"yellow"}]},"clickEvent":{"action":"run_command","value":"/function armor_statues:admin/marker"}}]
tellraw @s [\
{\
"text":"--------------------------",\
"color":"yellow",\
"bold":true\
}\
]
#
# The "Reduce local server load" option has the unfortunate side effect of moving the stands' eye line to their base.
# If this puts it inside a block, the items held and worn by the stand turn black.
# Commented out for the time being whilst options are investigated.
#

View File

@ -0,0 +1,30 @@
#
# Description: Enable option to get the adjustment wand by crafting
# Called by: armor_statues:admin via chat link
# Entity @s: player
#
scoreboard players set #as_success as_angle 0
scoreboard players operation #as_success as_angle = #adjustment_craftable as_angle
execute if score #as_success as_angle matches 0 run scoreboard players set #adjustment_craftable as_angle 1
execute if score #as_success as_angle matches 1 run scoreboard players set #adjustment_craftable as_angle 0
#
execute if score #adjustment_craftable as_angle matches 1 run tellraw @s [\
{\
"text":"Getting the adjustment wand via renaming has been ",\
"color":"aqua"\
},\
{\
"text":"Enabled"\
}\
]
execute if score #adjustment_craftable as_angle matches 0 run tellraw @s [\
{\
"text":"Getting the adjustment wand via renaming has been ",\
"color":"aqua"\
},\
{\
"text":"Disabled"\
}\
]
#
function armor_statues:admin

View File

@ -0,0 +1,30 @@
#
# Description: Enable option to get the adjustment wand by crafting
# Called by: armor_statues:admin via chat link
# Entity @s: player
#
scoreboard players set #as_success as_angle 0
scoreboard players operation #as_success as_angle = #adjustment_triggerable as_angle
execute if score #as_success as_angle matches 0 run scoreboard players set #adjustment_triggerable as_angle 1
execute if score #as_success as_angle matches 1 run scoreboard players set #adjustment_triggerable as_angle 0
#
execute if score #adjustment_triggerable as_angle matches 1 run tellraw @s [\
{\
"text":"Getting the adjustment wand via trigger has been ",\
"color":"aqua"\
},\
{\
"text":"Enabled"\
}\
]
execute if score #adjustment_triggerable as_angle matches 0 run tellraw @s [\
{\
"text":"Getting the adjustment wand via trigger has been ",\
"color":"aqua"\
},\
{\
"text":"Disabled"\
}\
]
#
function armor_statues:admin

View File

@ -0,0 +1,30 @@
#
# Description: Disable option to get the book directly from the help menu
# Called by: armor_statues:admin via chat link
# Entity @s: player
#
scoreboard players set #as_success as_angle 0
scoreboard players operation #as_success as_angle = #help_craftable as_angle
execute if score #as_success as_angle matches 0 run scoreboard players set #help_craftable as_angle 1
execute if score #as_success as_angle matches 1 run scoreboard players set #help_craftable as_angle 0
#
execute if score #help_craftable as_angle matches 0 run tellraw @s [\
{\
"text":"Getting the book from the help menu has been ",\
"color":"aqua"\
},\
{\
"text":"Disabled"\
}\
]
execute if score #help_craftable as_angle matches 1 run tellraw @s [\
{\
"text":"Getting the book from the help menu has been ",\
"color":"aqua"\
},\
{\
"text":"Enabled"\
}\
]
#
function armor_statues:admin

View File

@ -0,0 +1,30 @@
#
# Description: Enable option to get the book by crafting
# Called by: armor_statues:admin via chat link
# Entity @s: player
#
scoreboard players set #as_success as_angle 0
scoreboard players operation #as_success as_angle = #book_uncraftable as_angle
execute if score #as_success as_angle matches 0 run scoreboard players set #book_uncraftable as_angle 1
execute if score #as_success as_angle matches 1 run scoreboard players set #book_uncraftable as_angle 0
#
execute if score #book_uncraftable as_angle matches 0 run tellraw @s [\
{\
"text":"Getting the book via crafting has been ",\
"color":"aqua"\
},\
{\
"text":"Enabled"\
}\
]
execute if score #book_uncraftable as_angle matches 1 run tellraw @s [\
{\
"text":"Getting the book via crafting has been ",\
"color":"aqua"\
},\
{\
"text":"Disabled"\
}\
]
#
function armor_statues:admin

View File

@ -0,0 +1,30 @@
#
# Description: Enable option to get allow item frame fixing from the book
# Called by: armor_statues:admin via chat link
# Entity @s: player
#
scoreboard players set #as_success as_angle 0
scoreboard players operation #as_success as_angle = #fixing_enabled as_angle
execute if score #as_success as_angle matches 0 run scoreboard players set #fixing_enabled as_angle 1
execute if score #as_success as_angle matches 1 run scoreboard players set #fixing_enabled as_angle 0
#
execute if score #fixing_enabled as_angle matches 0 run tellraw @s [\
{\
"text":"Fixing item frame option has been ",\
"color":"aqua"\
},\
{\
"text":"Disabled"\
}\
]
execute if score #fixing_enabled as_angle matches 1 run tellraw @s [\
{\
"text":"Fixing item frame option has been ",\
"color":"aqua"\
},\
{\
"text":"Enabled"\
}\
]
#
function armor_statues:admin

View File

@ -0,0 +1,24 @@
#
# This function is currently not used - see armor_statues:admin for details
#
#
# Description: Sets the Marker tag on all locked armor stands within 128 blocks
# Called by: armor_statues:admin via chat clickEvent
# Entity @s: Player
#
# Note: DisabledSlots tag is checked to exclude armor stands in tool racks
#
# Store number of affected stands for reporting
#
execute store result score @s as_pose run execute if entity @e[type=armor_stand,distance=..128,tag=as_locked,nbt=!{Marker:1b},nbt=!{DisabledSlots:4079166}]
#
# Set Marker tag on affected stands
#
execute as @e[type=armor_stand,distance=..128,tag=as_locked,nbt=!{Marker:1b},nbt=!{DisabledSlots:4079166}] run data merge entity @s {Marker:1b}
#
# Report number affected
#
tellraw @p [{"text":"Marker set on ","color":"aqua"},{"score":{"name":"@s","objective":"as_pose"},"color":"aqua"},{"text":" armor stands","color":"aqua"}]
#
scoreboard players reset @s as_pose

View File

@ -0,0 +1,30 @@
#
# Description: Enable option to get the pointer wand by crafting
# Called by: armor_statues:admin via chat link
# Entity @s: player
#
scoreboard players set #as_success as_angle 0
scoreboard players operation #as_success as_angle = #pointer_craftable as_angle
execute if score #as_success as_angle matches 0 run scoreboard players set #pointer_craftable as_angle 1
execute if score #as_success as_angle matches 1 run scoreboard players set #pointer_craftable as_angle 0
#
execute if score #pointer_craftable as_angle matches 1 run tellraw @s [\
{\
"text":"Getting the pointer wand via renaming has been ",\
"color":"aqua"\
},\
{\
"text":"Enabled"\
}\
]
execute if score #pointer_craftable as_angle matches 0 run tellraw @s [\
{\
"text":"Getting the pointer wand via renaming has been ",\
"color":"aqua"\
},\
{\
"text":"Disabled"\
}\
]
#
function armor_statues:admin

View File

@ -0,0 +1,30 @@
#
# Description: Enable option to get the pointer wand by crafting
# Called by: armor_statues:admin via chat link
# Entity @s: player
#
scoreboard players set #as_success as_angle 0
scoreboard players operation #as_success as_angle = #pointer_triggerable as_angle
execute if score #as_success as_angle matches 0 run scoreboard players set #pointer_triggerable as_angle 1
execute if score #as_success as_angle matches 1 run scoreboard players set #pointer_triggerable as_angle 0
#
execute if score #pointer_triggerable as_angle matches 1 run tellraw @s [\
{\
"text":"Getting the pointer wand via renaming has been ",\
"color":"aqua"\
},\
{\
"text":"Enabled"\
}\
]
execute if score #pointer_triggerable as_angle matches 0 run tellraw @s [\
{\
"text":"Getting the pointer wand via renaming has been ",\
"color":"aqua"\
},\
{\
"text":"Disabled"\
}\
]
#
function armor_statues:admin

View File

@ -0,0 +1,48 @@
#
# Description: sets min/max of scale
# Called by: armor_statues:admin via chat link
# Entity @s: player
# Parameters:
# scale_min (float): min scale to cap armor stands
# scale_max (float): man scale to cap armor stands
#
$data merge storage armor_statues:admin {\
scale: {\
scale_min: $(scale_min),\
scale_max: $(scale_max)\
}\
}
execute store result score #scale_min as_angle run data get storage armor_statues:admin scale.scale_min 1000
execute store result score #scale_max as_angle run data get storage armor_statues:admin scale.scale_max 1000
#
# limits scale to physical game caps
#
execute if score #scale_min as_angle matches ..62 run scoreboard players set #scale_min as_angle 63
execute if score #scale_min as_angle matches 1001.. run scoreboard players set #scale_min as_angle 1000
execute if score #scale_max as_angle matches ..999 run scoreboard players set #scale_max as_angle 1000
execute if score #scale_max as_angle matches 16001.. run scoreboard players set #scale_max as_angle 16000
#
# stores into storage
#
execute store result storage armor_statues:admin scale.scale_min float 0.001 run scoreboard players get #scale_min as_angle
execute store result storage armor_statues:admin scale.scale_max float 0.001 run scoreboard players get #scale_max as_angle
tellraw @s [\
{\
"text":"Scale set to - Min: ",\
"color":"aqua"\
},\
{\
"storage":"armor_statues:admin",\
"nbt":"scale.scale_min"\
},\
{\
"text":" Max: ",\
"color":"aqua"\
},\
{\
"storage":"armor_statues:admin",\
"nbt":"scale.scale_max"\
}\
]
#
function armor_statues:admin

View File

@ -0,0 +1,20 @@
#
# Description: Removes all unused armor stands in loaded chunks
# Called by: armor_statues:admin via chat clickEvent
# Entity @s: Player
#
# Note: "Unused" stands are invisible, are not holding or wearing items, and are not part of a tool rack
#
# Store number of affected stands for reporting
#
execute store result score @s as_pose run execute if entity @e[type=armor_stand,nbt={Invisible:1b},nbt=!{HandItems:[{Count:1b}]},nbt=!{ArmorItems:[{Count:1b}]},nbt=!{DisabledSlots:4079166},nbt=!{Invulnerable:1b},nbt=!{Marker:1b}]
#
# Kill affected stands
#
execute as @e[type=armor_stand,nbt={Invisible:1b},nbt=!{HandItems:[{Count:1b}]},nbt=!{ArmorItems:[{Count:1b}]},nbt=!{DisabledSlots:4079166},nbt=!{Invulnerable:1b},nbt=!{Marker:1b}] run kill @s
#
# Report number affected
#
tellraw @p [{"score":{"name":"@s","objective":"as_pose"},"color":"aqua"},{"text":" unused armor stands deleted","color":"aqua"}]
#
scoreboard players reset @s as_pose

View File

@ -0,0 +1,30 @@
#
# Description: Enable option to make locking match player uuids
# Called by: armor_statues:admin via chat link
# Entity @s: player
#
scoreboard players set #as_success as_angle 0
scoreboard players operation #as_success as_angle = #uuid_locking as_angle
execute if score #as_success as_angle matches 0 run scoreboard players set #uuid_locking as_angle 1
execute if score #as_success as_angle matches 1 run scoreboard players set #uuid_locking as_angle 0
#
execute if score #uuid_locking as_angle matches 0 run tellraw @s [\
{\
"text":"UUID locking has been ",\
"color":"aqua"\
},\
{\
"text":"Disabled"\
}\
]
execute if score #uuid_locking as_angle matches 1 run tellraw @s [\
{\
"text":"UUID locking has been ",\
"color":"aqua"\
},\
{\
"text":"Enabled"\
}\
]
#
function armor_statues:admin

View File

@ -0,0 +1,30 @@
#
# Description: Enable option to get the book by crafting
# Called by: armor_statues:admin via chat link
# Entity @s: player
#
scoreboard players set #as_success as_angle 0
scoreboard players operation #as_success as_angle = #wands_disabled as_angle
execute if score #as_success as_angle matches 0 run scoreboard players set #wands_disabled as_angle 1
execute if score #as_success as_angle matches 1 run scoreboard players set #wands_disabled as_angle 0
#
execute if score #wands_disabled as_angle matches 0 run tellraw @s [\
{\
"text":"Pointer and adjustment wands have been ",\
"color":"aqua"\
},\
{\
"text":"Enabled"\
}\
]
execute if score #wands_disabled as_angle matches 1 run tellraw @s [\
{\
"text":"Pointer and adjustment wands have been ",\
"color":"aqua"\
},\
{\
"text":"Disabled"\
}\
]
#
function armor_statues:admin

View File

@ -0,0 +1,8 @@
#
# Description: Animate armor stands based off of item frames
# Called by: armor_statues:tick
# Entity @s: #item frames
#
tag @s add as_powered
data modify entity @e[type=minecraft:armor_stand,distance=..8,tag=!as_locked,sort=nearest,limit=1,nbt=!{Marker:1b},nbt=!{Invulnerable:1b}] {} merge from entity @s Item.components.minecraft:custom_data.SavedPose
data modify entity @e[type=minecraft:armor_stand,distance=..8,tag=!as_locked,sort=nearest,limit=1,nbt=!{Marker:1b},nbt=!{Invulnerable:1b}] Pose set from entity @s Item.components.minecraft:custom_data.SavedPose.Pose

View File

@ -0,0 +1,8 @@
#
# Description: Animate armor stands based off of item frames
# Called by: armor_statues:tick
# Entity @s: None
#
execute as @e[type=#armor_statues:item_frames,tag=as_animatable,tag=!as_powered] at @s if entity @p[distance=..35] if block ~ ~ ~ minecraft:redstone_wire unless block ~ ~ ~ minecraft:redstone_wire[power=0] run function armor_statues:animate
execute as @e[type=#armor_statues:item_frames,tag=as_animatable,tag=as_powered] at @s if block ~ ~ ~ minecraft:redstone_wire[power=0] run tag @s remove as_powered
scoreboard players set #animate_time as_angle 0

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,16 @@
#
# Description: This is a temporary (?) workaround for bug MC-80975
# Called by: armor_statues:trigger
# Entity @s: armor_stand
#
# Pose data is not stored for parts of the armor stand that are in the "default" positions. This causes the execute store entity
# and data get entity commands to fail.
#
# This function checks for the presence of each parts' pose data and updates it with tweaked default values if not present
#
execute unless data entity @s Pose.Head run data merge entity @s {Pose:{Head:[0.0f,0.001f,0.0f]}}
execute unless data entity @s Pose.Body run data merge entity @s {Pose:{Body:[0.0f,0.001f,0.0f]}}
execute unless data entity @s Pose.LeftArm run data merge entity @s {Pose:{LeftArm:[-10.0f,0.001f,-10.0f]}}
execute unless data entity @s Pose.RightArm run data merge entity @s {Pose:{RightArm:[-15.0f,0.001f,10.0f]}}
execute unless data entity @s Pose.LeftLeg run data merge entity @s {Pose:{LeftLeg:[-1.0f,0.001f,-1.0f]}}
execute unless data entity @s Pose.RightLeg run data merge entity @s {Pose:{RightLeg:[1.0f,0.001f,1.0f]}}

View File

@ -0,0 +1,9 @@
#
# Description: Replace titled book with proper command book
# Called by: armor_statues:second
# Entity @s: Player
#
# Replaces the written book from the players inventory
#
execute store result score #as_success as_help run clear @s minecraft:written_book[minecraft:written_book_content~{title:"Statues"}] 1
execute if score #as_success as_help matches 1.. run function armor_statues:give

View File

@ -0,0 +1,39 @@
#
# Description: Enable system for the player and issue control book
# Called by: command block
# Entity @s: player
#
# Trigger values in use are: 1-12 Style settings
# 20-39 Pose presets
# 40-51 Nudge position
# 52-57 Adjust rotation
# 60-95 Pose adjustment
# 101-112 Nudge position
# 120-123 Angle step
# 124-125 Face towards or away
# 131-135 Pose mirror and flip
# 141-142 Pose presets
# 151-155 Auto alignment
# 161-162 Exchange Slots
# 999 Check target
# 1000-1003 Lock and seal
# 1004-1005 Copy and paste
# 1100-1129 Nuge position relative
# 1150 Random pose
# 1160-1171 Pointing
# 1200-1201 Undo/Redo
#
# Set trigger score for player to zero and enable
#
scoreboard players set @s as_trigger 0
scoreboard players enable @s as_trigger
scoreboard players set @s as_help 0
scoreboard players enable @s as_help
scoreboard players set @s if_invisible 0
scoreboard players enable @s if_invisible
scoreboard players set @s as_repeat 0
scoreboard players enable @s as_repeat
#
# Set angle step for rotation and pose adjustment to default 15 degrees
#
scoreboard players set @s as_angle 15

View File

@ -0,0 +1,29 @@
#
# Description: Issue control book
# Called by: command block
# Entity @s: player
#
# Trigger values in use are: 1-12 Style settings
# 20-39 Pose presets
# 40-51 Nudge position
# 52-57 Adjust rotation
# 60-95 Pose adjustment
# 101-112 Nudge position
# 113-118 Nudge position
# 120-123 Angle step
# 124-125 Face towards or away
# 131-135 Pose mirror and flip
# 141-142 Pose presets
# 151-155 Auto alignment
# 161-162 Exchange Slots
# 999 Check target
# 1000-1003 Lock and seal
# 1004-1005 Copy and paste
# 1100-1129 Nudge Position
# 1130-1139 Nudge Position
# 1200-1205 Scale
#
# Give control book
#
loot give @s loot armor_statues:book

View File

@ -0,0 +1,7 @@
#
# Description: gives player pointing wand
# Called by: armor_statues:second
# Entity @s: player
#
clear @s minecraft:warped_fungus_on_a_stick[minecraft:custom_name='"Statues"'] 1
loot give @s loot armor_statues:adjustment_wand

View File

@ -0,0 +1,7 @@
#
# Description: gives player pointing wand
# Called by: armor_statues:second
# Entity @s: player
#
clear @s minecraft:stick[minecraft:custom_name='"Statues"'] 1
loot give @s loot armor_statues:pointer_wand

View File

@ -0,0 +1,14 @@
#
# Description: Display help in chat
# Called by: armor_statues:tick
# Entity @s: player
#
execute if score @s as_help matches 2 if score #help_craftable as_angle matches 1 run function armor_statues:help/get_book
execute if score @s as_help matches 3 run function armor_statues:help/chat_actionbar_toggle
execute if score @s as_help matches 4 run function armor_statues:help/credits
execute if score @s as_help matches 1..3 unless score @s as_help matches 2 run function armor_statues:help/main
#
# Reset trigger score
#
scoreboard players set @s as_help 0
scoreboard players enable @s as_help

View File

@ -0,0 +1,11 @@
#
# Description: Send notifications to chat
# Called by: armor_statues:help
# Entity @s: Player
#
execute store success score #as_success as_help run tag @s add as_chat
execute unless score #as_success as_help matches 1 run tag @s remove as_chat
#
execute if entity @s[tag=as_chat] run tellraw @s [{"text":"Notifications will be directed to chat","color":"aqua"}]
execute if entity @s[tag=!as_chat] run tellraw @s [{"text":"Notifications will be directed to the action bar","color":"aqua"}]

View File

@ -0,0 +1,71 @@
#
# Description: Display credits in chat
# Called by: armor_statues:help
# Entity @s: Player
#
tellraw @s [\
{\
"text":"Customizable Armor Stands - Credits",\
"color":"yellow",\
"bold":true\
}\
]
tellraw @s [\
{\
"text":"Coding and original concept: ",\
"color":"aqua"\
},\
{\
"text":"Phssthpok",\
"color":"#87325d",\
"bold":true,\
"clickEvent":{\
"action":"open_url",\
"value":"https://twitter.com/MCPhssthpok"\
}\
}\
]
tellraw @s [\
"",\
{\
"text":"Additional improvements: ",\
"color":"aqua"\
},\
{\
"text":"MSpaceDev",\
"color":"#e30000",\
"bold":true,\
"clickEvent":{\
"action":"open_url",\
"value":"https://www.youtube.com/c/MinecraftSpace"\
}\
}\
]
tellraw @s [\
{\
"text":"Development and improvements: ",\
"color":"aqua"\
},\
{\
"text":"MukiTanuki",\
"color":"#0072e5",\
"bold":true,\
"clickEvent":{\
"action":"open_url",\
"value":"https://twitter.com/MukiTanuki"\
}\
}\
]
tellraw @s [\
{\
"text":"\nThanks to many other people for help with testing and suggestions -Phssthpok",\
"color":"aqua"\
}\
]
tellraw @s [\
{\
"text":"--------------------------",\
"color":"yellow",\
"bold":true\
}\
]

View File

@ -0,0 +1,6 @@
#
# Description: Get book via chat link
# Called by: armor_statues:help
# Entity @s: Player
#
function armor_statues:give

View File

@ -0,0 +1,206 @@
#
# Description: Display main help options
# Called by: armor_statues:help
# Entity @s: Player
#
tellraw @s [\
{\
"text":"Customizable Armor Stands - Help",\
"color":"yellow",\
"bold":true\
},\
{\
"text":"\nGet the book by:",\
"color":"aqua",\
"bold":false\
}\
]
execute if score #help_craftable as_angle matches 1 run tellraw @s [\
{\
"text":" - Clicking ",\
"color":"aqua"\
},\
{\
"text":"here",\
"color":"green",\
"clickEvent":{\
"action":"run_command",\
"value":"/trigger as_help set 2"\
}\
}\
]
execute if score #as_shrine_x as_help matches ..0 run tellraw @s [\
{\
"text":" - Going to the shrine at ",\
"color":"aqua"\
},\
{\
"score":{\
"name":"#as_shrine_x",\
"objective":"as_help"\
},\
"color":"aqua"\
},\
{\
"text":",",\
"color":"aqua"\
},\
{\
"score":{\
"name":"#as_shrine_z",\
"objective":"as_help"\
},\
"color":"aqua"\
}\
]
execute if score #as_shrine_x as_help matches 1.. run tellraw @s [\
{\
"text":" - Going to the shrine at ",\
"color":"aqua"\
},\
{\
"score":{\
"name":"#as_shrine_x",\
"objective":"as_help"\
},\
"color":"aqua"\
},\
{\
"text":",",\
"color":"aqua"\
},\
{\
"score":{\
"name":"#as_shrine_z",\
"objective":"as_help"\
},\
"color":"aqua"\
}\
]
execute if score #book_uncraftable as_angle matches 0 run tellraw @s [\
{\
"text":" - Crafting a written book titled \"Statues\"",\
"color":"aqua"\
}\
]
tellraw @s [\
{\
"text":" - Crafting a book with an armor stand in a crafting table",\
"color":"aqua"\
}\
]
#
# Pointer wand
#
tellraw @s [\
{\
"text":"Get the Pointer Wand by:",\
"color":"aqua",\
"bold":false\
}\
]
execute if score #pointer_triggerable as_angle matches 1 run tellraw @s [\
{\
"text":" - Use /trigger pointer_wand with a warped fungus on a stick",\
"color":"aqua"\
}\
]
execute if score #pointer_craftable as_angle matches 1 run tellraw @s [\
{\
"text":" - Rename a stick \"Statues\"",\
"color":"aqua"\
}\
]
tellraw @s [\
{\
"text":" - Crafting a stick with an armor stand in a crafting table",\
"color":"aqua"\
}\
]
#
# Adjustment wand
#
tellraw @s [\
{\
"text":"Get the Adjustment Wand by:",\
"color":"aqua",\
"bold":false\
}\
]
execute if score #adjustment_triggerable as_angle matches 1 run tellraw @s [\
{\
"text":" - Use /trigger adjustment_wand with a warped fungus on a stick",\
"color":"aqua"\
}\
]
execute if score #adjustment_craftable as_angle matches 1 run tellraw @s [\
{\
"text":" - Rename a warped fungus on a stick \"Statues\"",\
"color":"aqua"\
}\
]
tellraw @s [\
{\
"text":" - Crafting a warped fungus on a stick with an armor stand in a crafting table",\
"color":"aqua"\
}\
]
execute if entity @s[tag=as_chat] run tellraw @s [\
{\
"text":"Send notifications to: ",\
"color":"aqua"\
},\
{\
"text":"Chat",\
"color":"green",\
"clickEvent":{\
"action":"run_command",\
"value":"/trigger as_help set 3"\
},\
"hoverEvent":{\
"action":"show_text", \
"contents":{\
"text":"Click to toggle between Chat and Actionbar", \
"color":"yellow"\
}\
}\
}\
]
execute if entity @s[tag=!as_chat] run tellraw @s [\
{\
"text":"Send notifications to: ",\
"color":"aqua"\
},\
{\
"text":"Actionbar",\
"color":"green",\
"clickEvent":{\
"action":"run_command",\
"value":"/trigger as_help set 3"\
}, \
"hoverEvent":{\
"action":"show_text", \
"contents":{\
"text":"Click to toggle between Chat and Actionbar", \
"color":"yellow"\
}\
}\
}\
]
tellraw @s [\
{\
"text":"Credits",\
"color":"green",\
"clickEvent":{\
"action":"run_command",\
"value":"/trigger as_help set 4"\
}\
}\
]
tellraw @s [\
{\
"text":"--------------------------",\
"color":"yellow",\
"bold":true\
}\
]

View File

@ -0,0 +1,42 @@
#
# Description: Apply changes to nearest item frame according to the player's if_invisible score
# Called by: armor_statues:second
# Entity @s: player
#
# Tag the player and an item frame 1 block in front of their eyes
#
tag @s add as_selected
execute anchored eyes positioned ^ ^ ^1 as @e[type=#armor_statues:item_frames,distance=..1,tag=!as_locked,sort=nearest,limit=1,nbt=!{Invulnerable:1b},nbt={Item:{count:1}}] unless entity @s[tag=!if_fixed,nbt={Fixed:1b}] run tag @s add as_selected
#
# Copy the trigger score to the selected item frame
#
scoreboard players operation @e[type=#armor_statues:item_frames,tag=as_selected] if_invisible = @s if_invisible
#
# Makes item frame 1 block in front of you invisible if it has an item
#
execute if entity @s[scores={if_invisible=1}] as @e[type=#armor_statues:item_frames,tag=as_selected,nbt=!{Invisible:1b}] run function armor_statues:item_frames/invisible
#
# Item frame fixing
#
# Creative
execute if entity @s[scores={if_invisible=2..3},gamemode=creative] as @e[type=#armor_statues:item_frames,tag=as_selected] run function armor_statues:item_frames/fixed
# Enabled
execute if score #fixing_enabled as_angle matches 1 if entity @s[scores={if_invisible=2..3},gamemode=survival] as @e[type=#armor_statues:item_frames,tag=as_selected] run function armor_statues:item_frames/fixed
# Disabled
execute if score #fixing_enabled as_angle matches 0 if entity @s[scores={if_invisible=2..3},gamemode=survival] as @p[tag=as_selected] run function armor_statues:player_message {\
message: '{\
"text":"Must be enabled from admin menu",\
"color":"dark_red"\
}'\
}
#
# Reset item frame's trigger score and remove selected tag from player and item frame
#
scoreboard players reset @e[type=#armor_statues:item_frames,tag=as_selected] if_invisible
tag @s remove as_selected
tag @e[type=#armor_statues:item_frames,tag=as_selected] remove as_selected
#
# Reset player's trigger score and re-enable
#
scoreboard players set @s if_invisible 0
scoreboard players enable @s if_invisible

View File

@ -0,0 +1,35 @@
#
# Description: Adjust armor stand pose
# Called by: advancement: armor_statues:attack_interaction
# Entity @s: player
#
# tag setup
tag @s add as_selected
tag @e[type=minecraft:interaction, distance=..6, nbt={attack:{}}, tag=as_interactable] add as_selected_interaction
# Stores uuid to select entities
scoreboard players operation #uuid_selector as_uuid1 = @e[type=minecraft:interaction, tag=as_selected_interaction, sort=nearest, limit=1] as_uuid1
scoreboard players operation #uuid_selector as_uuid2 = @e[type=minecraft:interaction, tag=as_selected_interaction, sort=nearest, limit=1] as_uuid2
scoreboard players operation #uuid_selector as_uuid3 = @e[type=minecraft:interaction, tag=as_selected_interaction, sort=nearest, limit=1] as_uuid3
scoreboard players operation #uuid_selector as_uuid4 = @e[type=minecraft:interaction, tag=as_selected_interaction, sort=nearest, limit=1] as_uuid4
# Selects entities from their stored uuid
function armor_statues:select_by_uuid
tag @e[type=armor_stand, tag=as_uuid_selected, sort=nearest, limit=1] add as_selected
tag @e[tag=as_uuid_selected] remove as_uuid_selected
#
# pointing wand interaction
#
execute as @s[predicate=armor_statues:holding_pointer] run function armor_statues:interactions/attack_pointer
#
# adjust wand interaction
#
execute as @s[predicate=armor_statues:holding_adjustment] run function armor_statues:interactions/attack_adjust
# Resets interaction
execute as @e[type=minecraft:interaction, tag=as_selected_interaction] run function armor_statues:interactions/reset_interaction
#execute as @e[type=minecraft:interaction, distance=..6, nbt={attack:{}}] run function armor_statues:interactions/reset_interaction
scoreboard players set @s as_trigger 0
scoreboard players enable @s as_trigger
# resets tags
tag @e[tag=as_selected] remove as_selected
tag @e[type=minecraft:interaction, tag=as_selected_interaction] remove as_selected_interaction
# Resets advancement
advancement revoke @s only armor_statues:attack_interaction

View File

@ -0,0 +1,52 @@
#
# Description: adjusting pose
# Called by: advancement: armor_statues:interactions/interact
# Entity @s: player
#
scoreboard players set #wand_type as_angle 0
# gets current wand type
execute store result score #wand_type as_angle run data get entity @s SelectedItem.components.minecraft:custom_data.type
#
# sets score according to marker
#
# X axis
execute if score #wand_type as_angle matches 0 if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_head_interactable] run scoreboard players set @s as_trigger 60
execute if score #wand_type as_angle matches 0 if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_body_interactable] run scoreboard players set @s as_trigger 66
execute if score #wand_type as_angle matches 0 if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_right_arm_interactable] run scoreboard players set @s as_trigger 72
execute if score #wand_type as_angle matches 0 if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_left_arm_interactable] run scoreboard players set @s as_trigger 78
execute if score #wand_type as_angle matches 0 if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_right_leg_interactable] run scoreboard players set @s as_trigger 84
execute if score #wand_type as_angle matches 0 if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_left_leg_interactable] run scoreboard players set @s as_trigger 90
execute if score #wand_type as_angle matches 0 if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_base_interactable] run scoreboard players set @s as_trigger 1102
# Y axis
execute if score #wand_type as_angle matches 1 if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_head_interactable] run scoreboard players set @s as_trigger 62
execute if score #wand_type as_angle matches 1 if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_body_interactable] run scoreboard players set @s as_trigger 68
execute if score #wand_type as_angle matches 1 if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_right_arm_interactable] run scoreboard players set @s as_trigger 74
execute if score #wand_type as_angle matches 1 if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_left_arm_interactable] run scoreboard players set @s as_trigger 80
execute if score #wand_type as_angle matches 1 if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_right_leg_interactable] run scoreboard players set @s as_trigger 86
execute if score #wand_type as_angle matches 1 if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_left_leg_interactable] run scoreboard players set @s as_trigger 92
execute if score #wand_type as_angle matches 1 if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_base_interactable] run scoreboard players set @s as_trigger 106
# Z axis
execute if score #wand_type as_angle matches 2 if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_head_interactable] run scoreboard players set @s as_trigger 64
execute if score #wand_type as_angle matches 2 if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_body_interactable] run scoreboard players set @s as_trigger 70
execute if score #wand_type as_angle matches 2 if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_right_arm_interactable] run scoreboard players set @s as_trigger 76
execute if score #wand_type as_angle matches 2 if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_left_arm_interactable] run scoreboard players set @s as_trigger 82
execute if score #wand_type as_angle matches 2 if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_right_leg_interactable] run scoreboard players set @s as_trigger 88
execute if score #wand_type as_angle matches 2 if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_left_leg_interactable] run scoreboard players set @s as_trigger 94
execute if score #wand_type as_angle matches 2 if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_base_interactable] run scoreboard players set @s as_trigger 1108
#
scoreboard players operation @e[type=minecraft:armor_stand,tag=as_selected,limit=1,sort=nearest] as_trigger = @s as_trigger
#
# Adjust pose function
#
execute if entity @s[scores={as_trigger=60..95}] as @e[type=armor_stand,tag=as_selected] run function armor_statues:trigger/adjust
# nudge function
execute if entity @s[scores={as_trigger=101..112}] as @e[type=armor_stand,tag=as_selected] run function armor_statues:trigger/position
execute if entity @s[scores={as_trigger=101..112}] 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=101..112}] as @e[type=armor_stand,tag=as_selected,nbt={Small:1b}] at @s run function armor_statues:interactions/readjust_interactions_small
execute if entity @s[scores={as_trigger=1100..1129}] as @e[type=armor_stand,tag=as_selected] at @s run function armor_statues:trigger/position_relative
execute if entity @s[scores={as_trigger=1100..1129}] 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=100..1129}] as @e[type=armor_stand,tag=as_selected,nbt={Small:1b}] at @s run function armor_statues:interactions/readjust_interactions_small
# turn off gravity if adjust Y
execute if entity @s[scores={as_trigger=106..107}] as @e[type=armor_stand,tag=as_selected] run data merge entity @s {NoGravity:1b}
# Plays sound
execute if entity @s[scores={as_trigger=1..}] run playsound minecraft:item.spyglass.use neutral @a ~ ~ ~ 1 1.5

View File

@ -0,0 +1,55 @@
#
# Description: Adjust armor stand pose
# Called by: armor_statues:interactions/attack
# Entity @s: player
#
#
# sets score according to marker
#
# Stand visible
execute if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_head_interactable] if entity @e[type=armor_stand,tag=as_selected, tag=as_selected, sort=nearest, limit=1, nbt={Invisible:0b}] run scoreboard players set @s as_trigger 10
execute if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_head_interactable] if entity @e[type=armor_stand,tag=as_selected, tag=as_selected, sort=nearest, limit=1, nbt={Invisible:1b}] run scoreboard players set @s as_trigger 9
# Base visible
execute if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_base_interactable] if entity @e[type=armor_stand,tag=as_selected, tag=as_selected, sort=nearest, limit=1, nbt={NoBasePlate:0b}] run scoreboard players set @s as_trigger 2
execute if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_base_interactable] if entity @e[type=armor_stand,tag=as_selected, tag=as_selected, sort=nearest, limit=1, nbt={NoBasePlate:1b}] run scoreboard players set @s as_trigger 1
# ShowArms - attack arms
execute if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_right_arm_interactable] if entity @e[type=armor_stand,tag=as_selected, tag=as_selected, sort=nearest, limit=1, nbt={ShowArms:0b}] run scoreboard players set @s as_trigger 3
execute if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_right_arm_interactable] if entity @e[type=armor_stand,tag=as_selected, tag=as_selected, sort=nearest, limit=1, nbt={ShowArms:1b}] run scoreboard players set @s as_trigger 4
execute if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_left_arm_interactable] if entity @e[type=armor_stand,tag=as_selected, tag=as_selected, sort=nearest, limit=1, nbt={ShowArms:0b}] run scoreboard players set @s as_trigger 3
execute if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_left_arm_interactable] if entity @e[type=armor_stand,tag=as_selected, tag=as_selected, sort=nearest, limit=1, nbt={ShowArms:1b}] run scoreboard players set @s as_trigger 4
# Set preset pose- attack body
execute if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_body_interactable] run scoreboard players add @e[type=armor_stand,tag=as_selected, sort=nearest, limit=1] as_current_pose 1
execute if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_body_interactable] if score @e[type=armor_stand,tag=as_selected, sort=nearest, limit=1] as_current_pose matches 21.. run scoreboard players set @e[type=armor_stand,tag=as_selected, sort=nearest, limit=1] as_current_pose 1
# poses
execute if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_body_interactable] if score @e[type=armor_stand,tag=as_selected, sort=nearest, limit=1] as_current_pose matches 1 run scoreboard players set @s as_trigger 20
execute if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_body_interactable] if score @e[type=armor_stand,tag=as_selected, sort=nearest, limit=1] as_current_pose matches 2 run scoreboard players set @s as_trigger 21
execute if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_body_interactable] if score @e[type=armor_stand,tag=as_selected, sort=nearest, limit=1] as_current_pose matches 3 run scoreboard players set @s as_trigger 22
execute if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_body_interactable] if score @e[type=armor_stand,tag=as_selected, sort=nearest, limit=1] as_current_pose matches 4 run scoreboard players set @s as_trigger 23
execute if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_body_interactable] if score @e[type=armor_stand,tag=as_selected, sort=nearest, limit=1] as_current_pose matches 5 run scoreboard players set @s as_trigger 24
execute if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_body_interactable] if score @e[type=armor_stand,tag=as_selected, sort=nearest, limit=1] as_current_pose matches 6 run scoreboard players set @s as_trigger 25
execute if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_body_interactable] if score @e[type=armor_stand,tag=as_selected, sort=nearest, limit=1] as_current_pose matches 7 run scoreboard players set @s as_trigger 26
execute if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_body_interactable] if score @e[type=armor_stand,tag=as_selected, sort=nearest, limit=1] as_current_pose matches 8 run scoreboard players set @s as_trigger 27
execute if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_body_interactable] if score @e[type=armor_stand,tag=as_selected, sort=nearest, limit=1] as_current_pose matches 9 run scoreboard players set @s as_trigger 28
execute if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_body_interactable] if score @e[type=armor_stand,tag=as_selected, sort=nearest, limit=1] as_current_pose matches 10 run scoreboard players set @s as_trigger 29
execute if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_body_interactable] if score @e[type=armor_stand,tag=as_selected, sort=nearest, limit=1] as_current_pose matches 11 run scoreboard players set @s as_trigger 30
execute if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_body_interactable] if score @e[type=armor_stand,tag=as_selected, sort=nearest, limit=1] as_current_pose matches 12 run scoreboard players set @s as_trigger 31
execute if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_body_interactable] if score @e[type=armor_stand,tag=as_selected, sort=nearest, limit=1] as_current_pose matches 13 run scoreboard players set @s as_trigger 32
execute if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_body_interactable] if score @e[type=armor_stand,tag=as_selected, sort=nearest, limit=1] as_current_pose matches 14 run scoreboard players set @s as_trigger 33
execute if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_body_interactable] if score @e[type=armor_stand,tag=as_selected, sort=nearest, limit=1] as_current_pose matches 15 run scoreboard players set @s as_trigger 34
execute if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_body_interactable] if score @e[type=armor_stand,tag=as_selected, sort=nearest, limit=1] as_current_pose matches 16 run scoreboard players set @s as_trigger 35
execute if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_body_interactable] if score @e[type=armor_stand,tag=as_selected, sort=nearest, limit=1] as_current_pose matches 17 run scoreboard players set @s as_trigger 36
execute if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_body_interactable] if score @e[type=armor_stand,tag=as_selected, sort=nearest, limit=1] as_current_pose matches 18 run scoreboard players set @s as_trigger 37
execute if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_body_interactable] if score @e[type=armor_stand,tag=as_selected, sort=nearest, limit=1] as_current_pose matches 19 run scoreboard players set @s as_trigger 38
execute if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_body_interactable] if score @e[type=armor_stand,tag=as_selected, sort=nearest, limit=1] as_current_pose matches 20 run scoreboard players set @s as_trigger 39
#
scoreboard players operation @e[type=minecraft:armor_stand,tag=as_selected,limit=1,sort=nearest] as_trigger = @s as_trigger
# Plays sound
execute if entity @s[scores={as_trigger=1..}] run playsound minecraft:item.spyglass.use neutral @a ~ ~ ~ 1 1.5
#
# Settings function
#
execute if entity @s[scores={as_trigger=1..12}] as @e[type=armor_stand,tag=as_selected, sort=nearest, limit=1] run function armor_statues:trigger/settings
#
# Preset function
#
execute if entity @s[scores={as_trigger=20..39}] as @e[type=armor_stand,tag=as_selected, sort=nearest, limit=1] run function armor_statues:trigger/presets

View File

@ -0,0 +1,16 @@
#
# Description: Sets up base interaction for interactions
# Called by: armor_statues:interactions/setup
# Entity @s: interaction
#
tag @s add as_interactable
tag @s add as_base_interactable
execute store result score @s as_uuid1 run data get entity @e[type=minecraft:armor_stand,sort=nearest,limit=1,tag=as_interactable_temp] UUID[0]
execute store result score @s as_uuid2 run data get entity @e[type=minecraft:armor_stand,sort=nearest,limit=1,tag=as_interactable_temp] UUID[1]
execute store result score @s as_uuid3 run data get entity @e[type=minecraft:armor_stand,sort=nearest,limit=1,tag=as_interactable_temp] UUID[2]
execute store result score @s as_uuid4 run data get entity @e[type=minecraft:armor_stand,sort=nearest,limit=1,tag=as_interactable_temp] UUID[3]
data merge entity @s {width: 0.25f, height: 0.25f, response:1b}
# fixes rotation
teleport @s ~ ~ ~ ~ ~
# nbt for block display
data merge entity @s[type=minecraft:block_display] {block_state: {Name: "minecraft:black_stained_glass"}, transformation: {translation: [-0.125f, 0.0f, -0.125f], scale: [0.25f, 0.25f, 0.25f]}}

View File

@ -0,0 +1,16 @@
#
# Description: Sets up base interaction for interactions
# Called by: armor_statues:interactions/setup
# Entity @s: interaction
#
tag @s add as_interactable
tag @s add as_base_interactable
execute store result score @s as_uuid1 run data get entity @e[type=minecraft:armor_stand,sort=nearest,limit=1,tag=as_interactable_temp] UUID[0]
execute store result score @s as_uuid2 run data get entity @e[type=minecraft:armor_stand,sort=nearest,limit=1,tag=as_interactable_temp] UUID[1]
execute store result score @s as_uuid3 run data get entity @e[type=minecraft:armor_stand,sort=nearest,limit=1,tag=as_interactable_temp] UUID[2]
execute store result score @s as_uuid4 run data get entity @e[type=minecraft:armor_stand,sort=nearest,limit=1,tag=as_interactable_temp] UUID[3]
data merge entity @s {width: 0.125f, height: 0.125f, response:1b}
# fixes rotation
teleport @s ~ ~ ~ ~ ~
# nbt for block display
data merge entity @s[type=minecraft:block_display] {block_state: {Name: "minecraft:black_stained_glass"}, transformation: {translation: [-0.0625f, 0.0f, -0.0625f], scale: [0.125f, 0.125f, 0.125f]}}

View File

@ -0,0 +1,16 @@
#
# Description: Sets up body interaction for interactions
# Called by: armor_statues:interactions/setup
# Entity @s: interaction
#
tag @s add as_interactable
tag @s add as_body_interactable
execute store result score @s as_uuid1 run data get entity @e[type=minecraft:armor_stand,sort=nearest,limit=1,tag=as_interactable_temp] UUID[0]
execute store result score @s as_uuid2 run data get entity @e[type=minecraft:armor_stand,sort=nearest,limit=1,tag=as_interactable_temp] UUID[1]
execute store result score @s as_uuid3 run data get entity @e[type=minecraft:armor_stand,sort=nearest,limit=1,tag=as_interactable_temp] UUID[2]
execute store result score @s as_uuid4 run data get entity @e[type=minecraft:armor_stand,sort=nearest,limit=1,tag=as_interactable_temp] UUID[3]
data merge entity @s {width: 0.25f, height: 0.25f, response:1b}
# fixes rotation
teleport @s ~ ~ ~ ~ ~
# nbt for block display
data merge entity @s[type=minecraft:block_display] {block_state: {Name: "minecraft:white_stained_glass"}, transformation: {translation: [-0.125f, 0.0f, -0.125f], scale: [0.25f, 0.25f, 0.25f]}}

View File

@ -0,0 +1,16 @@
#
# Description: Sets up body interaction for interactions
# Called by: armor_statues:interactions/setup
# Entity @s: interaction
#
tag @s add as_interactable
tag @s add as_body_interactable
execute store result score @s as_uuid1 run data get entity @e[type=minecraft:armor_stand,sort=nearest,limit=1,tag=as_interactable_temp] UUID[0]
execute store result score @s as_uuid2 run data get entity @e[type=minecraft:armor_stand,sort=nearest,limit=1,tag=as_interactable_temp] UUID[1]
execute store result score @s as_uuid3 run data get entity @e[type=minecraft:armor_stand,sort=nearest,limit=1,tag=as_interactable_temp] UUID[2]
execute store result score @s as_uuid4 run data get entity @e[type=minecraft:armor_stand,sort=nearest,limit=1,tag=as_interactable_temp] UUID[3]
data merge entity @s {width: 0.125f, height: 0.125f, response:1b}
# fixes rotation
teleport @s ~ ~ ~ ~ ~
# nbt for block display
data merge entity @s[type=minecraft:block_display] {block_state: {Name: "minecraft:white_stained_glass"}, transformation: {translation: [-0.0625f, 0.0f, -0.0625f], scale: [0.125f, 0.125f, 0.125f]}}

View File

@ -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:generic.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

View File

@ -0,0 +1,25 @@
#
# Description: Sets up display and interaction for interactions
# Called by: armor_statues:interactions/setup
# Entity @s: interaction|block display
# 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
#
#$say type: $(type) block: $(block) x: $(x) y: $(y) translation: $(translation) scale: $(scale)
tag @s add as_interactable
$tag @s add as_$(type)_interactable
execute store result score @s as_uuid1 run data get entity @e[type=minecraft:armor_stand,sort=nearest,limit=1,tag=as_interactable_temp] UUID[0]
execute store result score @s as_uuid2 run data get entity @e[type=minecraft:armor_stand,sort=nearest,limit=1,tag=as_interactable_temp] UUID[1]
execute store result score @s as_uuid3 run data get entity @e[type=minecraft:armor_stand,sort=nearest,limit=1,tag=as_interactable_temp] UUID[2]
execute store result score @s as_uuid4 run data get entity @e[type=minecraft:armor_stand,sort=nearest,limit=1,tag=as_interactable_temp] UUID[3]
$data merge entity @s {width: $(scale)f, height: $(scale)f, response:1b}
# fixes rotation and position
teleport @s ~ ~ ~ ~ ~
$tp ^$(x) ^$(y) ^
# nbt for block display
$data merge entity @s[type=minecraft:block_display] {block_state: {Name: "$(block)"}, transformation: {translation: [$(translation)f, 0.0f, $(translation)f], scale: [$(scale)f, $(scale)f, $(scale)f]}}

View File

@ -0,0 +1,16 @@
#
# Description: Sets up head interaction for interactions
# Called by: armor_statues:interactions/setup
# Entity @s: interaction
#
tag @s add as_interactable
tag @s add as_head_interactable
execute store result score @s as_uuid1 run data get entity @e[type=minecraft:armor_stand,sort=nearest,limit=1,tag=as_interactable_temp] UUID[0]
execute store result score @s as_uuid2 run data get entity @e[type=minecraft:armor_stand,sort=nearest,limit=1,tag=as_interactable_temp] UUID[1]
execute store result score @s as_uuid3 run data get entity @e[type=minecraft:armor_stand,sort=nearest,limit=1,tag=as_interactable_temp] UUID[2]
execute store result score @s as_uuid4 run data get entity @e[type=minecraft:armor_stand,sort=nearest,limit=1,tag=as_interactable_temp] UUID[3]
data merge entity @s {width: 0.38f, height: 0.38f, response:1b}
# fixes rotation
teleport @s ~ ~ ~ ~ ~
# nbt for block display
data merge entity @s[type=minecraft:block_display] {block_state: {Name: "minecraft:blue_stained_glass"}, transformation: {translation: [-0.19f, 0.0f, -0.19f], scale: [0.38f, 0.38f, 0.38f]}}

View File

@ -0,0 +1,16 @@
#
# Description: Sets up head interaction for interactions
# Called by: armor_statues:interactions/setup
# Entity @s: interaction
#
tag @s add as_interactable
tag @s add as_head_interactable
execute store result score @s as_uuid1 run data get entity @e[type=minecraft:armor_stand,sort=nearest,limit=1,tag=as_interactable_temp] UUID[0]
execute store result score @s as_uuid2 run data get entity @e[type=minecraft:armor_stand,sort=nearest,limit=1,tag=as_interactable_temp] UUID[1]
execute store result score @s as_uuid3 run data get entity @e[type=minecraft:armor_stand,sort=nearest,limit=1,tag=as_interactable_temp] UUID[2]
execute store result score @s as_uuid4 run data get entity @e[type=minecraft:armor_stand,sort=nearest,limit=1,tag=as_interactable_temp] UUID[3]
data merge entity @s {width: 0.19f, height: 0.19f, response:1b}
# fixes rotation
teleport @s ~ ~ ~ ~ ~
# nbt for block display
data merge entity @s[type=minecraft:block_display] {block_state: {Name: "minecraft:blue_stained_glass"}, transformation: {translation: [-0.095f, 0.0f, -0.095f], scale: [0.19f, 0.19f, 0.19f]}}

View File

@ -0,0 +1,52 @@
#
# Description: Adjust armor stand pose
# Called by: advancement: armor_statues:use_interaction
# Entity @s: player
#
# tag setup
tag @s add as_selected
tag @e[type=minecraft:interaction, distance=..6, nbt={interaction:{}}, tag=as_interactable] add as_selected_interaction
# Stores uuid to select entities
scoreboard players operation #uuid_selector as_uuid1 = @e[type=minecraft:interaction, tag=as_selected_interaction, sort=nearest, limit=1] as_uuid1
scoreboard players operation #uuid_selector as_uuid2 = @e[type=minecraft:interaction, tag=as_selected_interaction, sort=nearest, limit=1] as_uuid2
scoreboard players operation #uuid_selector as_uuid3 = @e[type=minecraft:interaction, tag=as_selected_interaction, sort=nearest, limit=1] as_uuid3
scoreboard players operation #uuid_selector as_uuid4 = @e[type=minecraft:interaction, tag=as_selected_interaction, sort=nearest, limit=1] as_uuid4
# Selects entities from their stored uuid
function armor_statues:select_by_uuid
tag @e[type=armor_stand, tag=as_uuid_selected, sort=nearest, limit=1] add as_selected
tag @e[tag=as_uuid_selected] remove as_uuid_selected
#
# Checks if used last used on same entity
#
execute store result score #uuid_matcher1 as_uuid1 run data get entity @s SelectedItem.components.minecraft:custom_data.LastUsed[0]
execute store result score #uuid_matcher1 as_uuid2 run data get entity @s SelectedItem.components.minecraft:custom_data.LastUsed[1]
execute store result score #uuid_matcher1 as_uuid3 run data get entity @s SelectedItem.components.minecraft:custom_data.LastUsed[2]
execute store result score #uuid_matcher1 as_uuid4 run data get entity @s SelectedItem.components.minecraft:custom_data.LastUsed[3]
execute store result score #uuid_matcher2 as_uuid1 run data get entity @e[type=minecraft:interaction, tag=as_selected_interaction, sort=nearest, limit=1] UUID[0]
execute store result score #uuid_matcher2 as_uuid2 run data get entity @e[type=minecraft:interaction, tag=as_selected_interaction, sort=nearest, limit=1] UUID[1]
execute store result score #uuid_matcher2 as_uuid3 run data get entity @e[type=minecraft:interaction, tag=as_selected_interaction, sort=nearest, limit=1] UUID[2]
execute store result score #uuid_matcher2 as_uuid4 run data get entity @e[type=minecraft:interaction, tag=as_selected_interaction, sort=nearest, limit=1] UUID[3]
execute if score #uuid_matcher1 as_uuid1 = #uuid_matcher2 as_uuid1 if score #uuid_matcher1 as_uuid2 = #uuid_matcher2 as_uuid2 if score #uuid_matcher1 as_uuid3 = #uuid_matcher2 as_uuid3 if score #uuid_matcher1 as_uuid4 = #uuid_matcher2 as_uuid4 run tag @e[type=minecraft:interaction, tag=as_selected_interaction, sort=nearest, limit=1] add as_last_used
#
# Stores last interaction to wand
#
execute as @e[type=minecraft:interaction, tag=as_selected_interaction, sort=nearest, limit=1] run item modify entity @p[tag=as_selected] weapon.mainhand armor_statues:wand
#
# pointing wand interaction
#
execute as @s[predicate=armor_statues:holding_pointer] run function armor_statues:interactions/interact_pointer
#
# adjustment wand interaction
#
execute as @s[predicate=armor_statues:holding_adjustment] run function armor_statues:interactions/interact_adjust
# Resets interaction
execute as @e[type=minecraft:interaction, tag=as_selected_interaction] run function armor_statues:interactions/reset_interaction
#execute as @e[type=minecraft:interaction, distance=..6, nbt={attack:{}}] run function armor_statues:interactions/reset_interaction
scoreboard players set @e[tag=as_selected] as_trigger 0
scoreboard players enable @s as_trigger
# resets tags
tag @e[tag=as_selected] remove as_selected
tag @e[type=minecraft:interaction, tag=as_last_used] remove as_last_used
tag @e[type=minecraft:interaction, tag=as_selected_interaction] remove as_selected_interaction
# Resets advancement
advancement revoke @s only armor_statues:use_interaction

View File

@ -0,0 +1,52 @@
#
# Description: adjusting pose
# Called by: advancement: armor_statues:interactions/interact
# Entity @s: player
#
scoreboard players set #wand_type as_angle 0
# gets current wand type
execute store result score #wand_type as_angle run data get entity @s SelectedItem.components.minecraft:custom_data.type
#
# sets score according to marker
#
# X axis
execute if score #wand_type as_angle matches 0 if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_head_interactable] run scoreboard players set @s as_trigger 61
execute if score #wand_type as_angle matches 0 if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_body_interactable] run scoreboard players set @s as_trigger 67
execute if score #wand_type as_angle matches 0 if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_right_arm_interactable] run scoreboard players set @s as_trigger 73
execute if score #wand_type as_angle matches 0 if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_left_arm_interactable] run scoreboard players set @s as_trigger 79
execute if score #wand_type as_angle matches 0 if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_right_leg_interactable] run scoreboard players set @s as_trigger 85
execute if score #wand_type as_angle matches 0 if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_left_leg_interactable] run scoreboard players set @s as_trigger 91
execute if score #wand_type as_angle matches 0 if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_base_interactable] run scoreboard players set @s as_trigger 1103
# Y axis
execute if score #wand_type as_angle matches 1 if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_head_interactable] run scoreboard players set @s as_trigger 63
execute if score #wand_type as_angle matches 1 if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_body_interactable] run scoreboard players set @s as_trigger 69
execute if score #wand_type as_angle matches 1 if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_right_arm_interactable] run scoreboard players set @s as_trigger 75
execute if score #wand_type as_angle matches 1 if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_left_arm_interactable] run scoreboard players set @s as_trigger 81
execute if score #wand_type as_angle matches 1 if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_right_leg_interactable] run scoreboard players set @s as_trigger 87
execute if score #wand_type as_angle matches 1 if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_left_leg_interactable] run scoreboard players set @s as_trigger 93
execute if score #wand_type as_angle matches 1 if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_base_interactable] run scoreboard players set @s as_trigger 107
# Z axis
execute if score #wand_type as_angle matches 2 if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_head_interactable] run scoreboard players set @s as_trigger 65
execute if score #wand_type as_angle matches 2 if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_body_interactable] run scoreboard players set @s as_trigger 71
execute if score #wand_type as_angle matches 2 if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_right_arm_interactable] run scoreboard players set @s as_trigger 77
execute if score #wand_type as_angle matches 2 if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_left_arm_interactable] run scoreboard players set @s as_trigger 83
execute if score #wand_type as_angle matches 2 if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_right_leg_interactable] run scoreboard players set @s as_trigger 89
execute if score #wand_type as_angle matches 2 if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_left_leg_interactable] run scoreboard players set @s as_trigger 95
execute if score #wand_type as_angle matches 2 if entity @e[type=minecraft:interaction,tag=as_selected_interaction,tag=as_interactable,tag=as_base_interactable] run scoreboard players set @s as_trigger 1109
#
scoreboard players operation @e[type=minecraft:armor_stand,tag=as_selected,limit=1,sort=nearest] as_trigger = @s as_trigger
#
# Adjust pose function
#
execute if entity @s[scores={as_trigger=60..95}] as @e[type=armor_stand,tag=as_selected] run function armor_statues:trigger/adjust
# nudge function
execute if entity @s[scores={as_trigger=101..112}] as @e[type=armor_stand,tag=as_selected] run function armor_statues:trigger/position
execute if entity @s[scores={as_trigger=101..112}] 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=101..112}] as @e[type=armor_stand,tag=as_selected,nbt={Small:1b}] at @s run function armor_statues:interactions/readjust_interactions_small
execute if entity @s[scores={as_trigger=1100..1129}] as @e[type=armor_stand,tag=as_selected] at @s run function armor_statues:trigger/position_relative
execute if entity @s[scores={as_trigger=1100..1129}] 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=100..1129}] as @e[type=armor_stand,tag=as_selected,nbt={Small:1b}] at @s run function armor_statues:interactions/readjust_interactions_small
# turn off gravity if adjust Y
execute if entity @s[scores={as_trigger=106..107}] as @e[type=armor_stand,tag=as_selected] run data merge entity @s {NoGravity:1b}
# Plays sound
execute if entity @s[scores={as_trigger=1..}] run playsound minecraft:item.spyglass.use neutral @a ~ ~ ~ 1 1.5

View File

@ -0,0 +1,38 @@
#
# 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

View File

@ -0,0 +1,16 @@
#
# Description: Sets up left arm interaction for interactions
# Called by: armor_statues:interactions/setup
# Entity @s: interaction
#
tag @s add as_interactable
tag @s add as_left_arm_interactable
execute store result score @s as_uuid1 run data get entity @e[type=minecraft:armor_stand,sort=nearest,limit=1,tag=as_interactable_temp] UUID[0]
execute store result score @s as_uuid2 run data get entity @e[type=minecraft:armor_stand,sort=nearest,limit=1,tag=as_interactable_temp] UUID[1]
execute store result score @s as_uuid3 run data get entity @e[type=minecraft:armor_stand,sort=nearest,limit=1,tag=as_interactable_temp] UUID[2]
execute store result score @s as_uuid4 run data get entity @e[type=minecraft:armor_stand,sort=nearest,limit=1,tag=as_interactable_temp] UUID[3]
data merge entity @s {width: 0.25f, height: 0.25f, response:1b}
# fixes rotation
teleport @s ~ ~ ~ ~ ~
# nbt for block display
data merge entity @s[type=minecraft:block_display] {block_state: {Name: "minecraft:lime_stained_glass"}, transformation: {translation: [-0.125f, 0.0f, -0.125f], scale: [0.25f, 0.25f, 0.25f]}}

View File

@ -0,0 +1,16 @@
#
# Description: Sets up left arm interaction for interactions
# Called by: armor_statues:interactions/setup
# Entity @s: interaction
#
tag @s add as_interactable
tag @s add as_left_arm_interactable
execute store result score @s as_uuid1 run data get entity @e[type=minecraft:armor_stand,sort=nearest,limit=1,tag=as_interactable_temp] UUID[0]
execute store result score @s as_uuid2 run data get entity @e[type=minecraft:armor_stand,sort=nearest,limit=1,tag=as_interactable_temp] UUID[1]
execute store result score @s as_uuid3 run data get entity @e[type=minecraft:armor_stand,sort=nearest,limit=1,tag=as_interactable_temp] UUID[2]
execute store result score @s as_uuid4 run data get entity @e[type=minecraft:armor_stand,sort=nearest,limit=1,tag=as_interactable_temp] UUID[3]
data merge entity @s {width: 0.125f, height: 0.125f, response:1b}
# fixes rotation
teleport @s ~ ~ ~ ~ ~
# nbt for block display
data merge entity @s[type=minecraft:block_display] {block_state: {Name: "minecraft:lime_stained_glass"}, transformation: {translation: [-0.0625f, 0.0f, -0.0625f], scale: [0.125f, 0.125f, 0.125f]}}

View File

@ -0,0 +1,16 @@
#
# Description: Sets up left leg interaction for interactions
# Called by: armor_statues:interactions/setup
# Entity @s: interaction
#
tag @s add as_interactable
tag @s add as_left_leg_interactable
execute store result score @s as_uuid1 run data get entity @e[type=minecraft:armor_stand,sort=nearest,limit=1,tag=as_interactable_temp] UUID[0]
execute store result score @s as_uuid2 run data get entity @e[type=minecraft:armor_stand,sort=nearest,limit=1,tag=as_interactable_temp] UUID[1]
execute store result score @s as_uuid3 run data get entity @e[type=minecraft:armor_stand,sort=nearest,limit=1,tag=as_interactable_temp] UUID[2]
execute store result score @s as_uuid4 run data get entity @e[type=minecraft:armor_stand,sort=nearest,limit=1,tag=as_interactable_temp] UUID[3]
data merge entity @s {width: 0.25f, height: 0.25f, response:1b}
# fixes rotation
teleport @s ~ ~ ~ ~ ~
# nbt for block display
data merge entity @s[type=minecraft:block_display] {block_state: {Name: "minecraft:yellow_stained_glass"}, transformation: {translation: [-0.125f, 0.0f, -0.125f], scale: [0.25f, 0.25f, 0.25f]}}

View File

@ -0,0 +1,16 @@
#
# Description: Sets up left leg interaction for interactions
# Called by: armor_statues:interactions/setup
# Entity @s: interaction
#
tag @s add as_interactable
tag @s add as_left_leg_interactable
execute store result score @s as_uuid1 run data get entity @e[type=minecraft:armor_stand,sort=nearest,limit=1,tag=as_interactable_temp] UUID[0]
execute store result score @s as_uuid2 run data get entity @e[type=minecraft:armor_stand,sort=nearest,limit=1,tag=as_interactable_temp] UUID[1]
execute store result score @s as_uuid3 run data get entity @e[type=minecraft:armor_stand,sort=nearest,limit=1,tag=as_interactable_temp] UUID[2]
execute store result score @s as_uuid4 run data get entity @e[type=minecraft:armor_stand,sort=nearest,limit=1,tag=as_interactable_temp] UUID[3]
data merge entity @s {width: 0.125f, height: 0.125f, response:1b}
# fixes rotation
teleport @s ~ ~ ~ ~ ~
# nbt for block display
data merge entity @s[type=minecraft:block_display] {block_state: {Name: "minecraft:yellow_stained_glass"}, transformation: {translation: [-0.0625f, 0.0f, -0.0625f], scale: [0.125f, 0.125f, 0.125f]}}

View File

@ -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:generic.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]

View File

@ -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:generic.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

View File

@ -0,0 +1,18 @@
#
# Description: Resets armor stand for interactions
# Called by: armor_statues:3_second
# Entity @s: armor_stand
#
# 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
kill @e[type=minecraft:interaction,tag=as_uuid_selected]
kill @e[type=minecraft:block_display,tag=as_uuid_selected]
tag @e[tag=as_uuid_selected] remove as_uuid_selected
# Resets armor stand
tag @s remove as_interactable
data merge entity @s {Marker: 0b}

View File

@ -0,0 +1,7 @@
#
# Description: Adjust armor stand pose
# Called by: advancement: armor_statues:use_interaction
# Entity @s: player
#
data remove entity @s interaction
data remove entity @s attack

View File

@ -0,0 +1,16 @@
#
# Description: Sets up right arm interaction for interactions
# Called by: armor_statues:interactions/setup
# Entity @s: interaction
#
tag @s add as_interactable
tag @s add as_right_arm_interactable
execute store result score @s as_uuid1 run data get entity @e[type=minecraft:armor_stand,sort=nearest,limit=1,tag=as_interactable_temp] UUID[0]
execute store result score @s as_uuid2 run data get entity @e[type=minecraft:armor_stand,sort=nearest,limit=1,tag=as_interactable_temp] UUID[1]
execute store result score @s as_uuid3 run data get entity @e[type=minecraft:armor_stand,sort=nearest,limit=1,tag=as_interactable_temp] UUID[2]
execute store result score @s as_uuid4 run data get entity @e[type=minecraft:armor_stand,sort=nearest,limit=1,tag=as_interactable_temp] UUID[3]
data merge entity @s {width: 0.25f, height: 0.25f, response:1b}
# fixes rotation
teleport @s ~ ~ ~ ~ ~
# nbt for block display
data merge entity @s[type=minecraft:block_display] {block_state: {Name: "minecraft:red_stained_glass"}, transformation: {translation: [-0.125f, 0.0f, -0.125f], scale: [0.25f, 0.25f, 0.25f]}}

View File

@ -0,0 +1,16 @@
#
# Description: Sets up right arm interaction for interactions
# Called by: armor_statues:interactions/setup
# Entity @s: interaction
#
tag @s add as_interactable
tag @s add as_right_arm_interactable
execute store result score @s as_uuid1 run data get entity @e[type=minecraft:armor_stand,sort=nearest,limit=1,tag=as_interactable_temp] UUID[0]
execute store result score @s as_uuid2 run data get entity @e[type=minecraft:armor_stand,sort=nearest,limit=1,tag=as_interactable_temp] UUID[1]
execute store result score @s as_uuid3 run data get entity @e[type=minecraft:armor_stand,sort=nearest,limit=1,tag=as_interactable_temp] UUID[2]
execute store result score @s as_uuid4 run data get entity @e[type=minecraft:armor_stand,sort=nearest,limit=1,tag=as_interactable_temp] UUID[3]
data merge entity @s {width: 0.125f, height: 0.125f, response:1b}
# fixes rotation
teleport @s ~ ~ ~ ~ ~
# nbt for block display
data merge entity @s[type=minecraft:block_display] {block_state: {Name: "minecraft:red_stained_glass"}, transformation: {translation: [-0.0625f, 0.0f, -0.0625f], scale: [0.125f, 0.125f, 0.125f]}}

View File

@ -0,0 +1,16 @@
#
# Description: Sets up right leg interaction for interactions
# Called by: armor_statues:interactions/setup
# Entity @s: interaction
#
tag @s add as_interactable
tag @s add as_right_leg_interactable
execute store result score @s as_uuid1 run data get entity @e[type=minecraft:armor_stand,sort=nearest,limit=1,tag=as_interactable_temp] UUID[0]
execute store result score @s as_uuid2 run data get entity @e[type=minecraft:armor_stand,sort=nearest,limit=1,tag=as_interactable_temp] UUID[1]
execute store result score @s as_uuid3 run data get entity @e[type=minecraft:armor_stand,sort=nearest,limit=1,tag=as_interactable_temp] UUID[2]
execute store result score @s as_uuid4 run data get entity @e[type=minecraft:armor_stand,sort=nearest,limit=1,tag=as_interactable_temp] UUID[3]
data merge entity @s {width: 0.25f, height: 0.25f, response:1b}
# fixes rotation
teleport @s ~ ~ ~ ~ ~
# nbt for block display
data merge entity @s[type=minecraft:block_display] {block_state: {Name: "minecraft:light_blue_stained_glass"}, transformation: {translation: [-0.125f, 0.0f, -0.125f], scale: [0.25f, 0.25f, 0.25f]}}

View File

@ -0,0 +1,16 @@
#
# Description: Sets up right leg interaction for interactions
# Called by: armor_statues:interactions/setup
# Entity @s: interaction
#
tag @s add as_interactable
tag @s add as_right_leg_interactable
execute store result score @s as_uuid1 run data get entity @e[type=minecraft:armor_stand,sort=nearest,limit=1,tag=as_interactable_temp] UUID[0]
execute store result score @s as_uuid2 run data get entity @e[type=minecraft:armor_stand,sort=nearest,limit=1,tag=as_interactable_temp] UUID[1]
execute store result score @s as_uuid3 run data get entity @e[type=minecraft:armor_stand,sort=nearest,limit=1,tag=as_interactable_temp] UUID[2]
execute store result score @s as_uuid4 run data get entity @e[type=minecraft:armor_stand,sort=nearest,limit=1,tag=as_interactable_temp] UUID[3]
data merge entity @s {width: 0.125f, height: 0.125f, response:1b}
# fixes rotation
teleport @s ~ ~ ~ ~ ~
# nbt for block display
data merge entity @s[type=minecraft:block_display] {block_state: {Name: "minecraft:light_blue_stained_glass"}, transformation: {translation: [-0.0625f, 0.0f, -0.0625f], scale: [0.125f, 0.125f, 0.125f]}}

View File

@ -0,0 +1,161 @@
#
# Description: Sets up armor stand for interactions
# Called by: armor_statues:3_second
# Entity @s: armor_stand
#
tag @s add as_interactable
tag @s add as_interactable_temp
data merge entity @s {Marker:1b}
execute store result score @s as_uuid1 run data get entity @s UUID[0]
execute store result score @s as_uuid2 run data get entity @s UUID[1]
execute store result score @s as_uuid3 run data get entity @s UUID[2]
execute store result score @s as_uuid4 run data get entity @s UUID[3]
# Head
#execute rotated ~ 0 positioned ^ ^1.52 ^ summon minecraft:interaction run function armor_statues:interactions/head_setup
function armor_statues:interactions/display_setup {\
type: "head",\
block: "minecraft:blue_stained_glass",\
x: 0f,\
y: 1.52f,\
translation: -0.19f,\
scale: 0.38f,\
entity: "minecraft:interaction"\
}
#execute rotated ~ 0 positioned ^ ^1.52 ^ summon minecraft:block_display run function armor_statues:interactions/head_setup
function armor_statues:interactions/display_setup {\
type: "head",\
block: "minecraft:blue_stained_glass",\
x: 0f,\
y: 1.52f,\
translation: -0.19f,\
scale: 0.38f,\
entity: "minecraft:block_display"\
}
# Body
#execute rotated ~ 0 positioned ^ ^1.25 ^ summon minecraft:interaction run function armor_statues:interactions/body_setup
function armor_statues:interactions/display_setup {\
type: "body",\
block: "minecraft:white_stained_glass",\
x: 0f,\
y: 1.25f,\
translation: -0.125f,\
scale: 0.25f,\
entity: "minecraft:interaction"\
}
#execute rotated ~ 0 positioned ^ ^1.25 ^ summon minecraft:block_display run function armor_statues:interactions/body_setup
function armor_statues:interactions/display_setup {\
type: "body",\
block: "minecraft:white_stained_glass",\
x: 0f,\
y: 1.25f,\
translation: -0.125f,\
scale: 0.25f,\
entity: "minecraft:block_display"\
}
# Right Arm
#execute rotated ~ 0 positioned ^-0.34375 ^1.28125 ^ summon minecraft:interaction run function armor_statues:interactions/right_arm_setup
function armor_statues:interactions/display_setup {\
type: "right_arm",\
block: "minecraft:red_stained_glass",\
x: -0.34375f,\
y: 1.28125f,\
translation: -0.125f,\
scale: 0.25f,\
entity: "minecraft:interaction"\
}
#execute rotated ~ 0 positioned ^-0.34375 ^1.28125 ^ summon minecraft:block_display run function armor_statues:interactions/right_arm_setup
function armor_statues:interactions/display_setup {\
type: "right_arm",\
block: "minecraft:red_stained_glass",\
x: -0.34375f,\
y: 1.28125f,\
translation: -0.125f,\
scale: 0.25f,\
entity: "minecraft:block_display"\
}
# Left Arm
#execute rotated ~ 0 positioned ^0.34375 ^1.28125 ^ summon minecraft:interaction run function armor_statues:interactions/left_arm_setup
function armor_statues:interactions/display_setup {\
type: "left_arm",\
block: "minecraft:lime_stained_glass",\
x: 0.34375f,\
y: 1.28125f,\
translation: -0.125f,\
scale: 0.25f,\
entity: "minecraft:interaction"\
}
#execute rotated ~ 0 positioned ^0.34375 ^1.28125 ^ summon minecraft:block_display run function armor_statues:interactions/left_arm_setup
function armor_statues:interactions/display_setup {\
type: "left_arm",\
block: "minecraft:lime_stained_glass",\
x: 0.34375f,\
y: 1.28125f,\
translation: -0.125f,\
scale: 0.25f,\
entity: "minecraft:block_display"\
}
# Right Leg
#execute rotated ~ 0 positioned ^-0.125 ^0.65625 ^ summon minecraft:interaction run function armor_statues:interactions/right_leg_setup
function armor_statues:interactions/display_setup {\
type: "right_leg",\
block: "minecraft:light_blue_stained_glass",\
x: -0.125f,\
y: 0.65625f,\
translation: -0.125f,\
scale: 0.25f,\
entity: "minecraft:interaction"\
}
#execute rotated ~ 0 positioned ^-0.125 ^0.65625 ^ summon minecraft:block_display run function armor_statues:interactions/right_leg_setup
function armor_statues:interactions/display_setup {\
type: "right_leg",\
block: "minecraft:light_blue_stained_glass",\
x: -0.125f,\
y: 0.65625f,\
translation: -0.125f,\
scale: 0.25f,\
entity: "minecraft:block_display"\
}
# Left Leg
#execute rotated ~ 0 positioned ^0.125 ^0.65625 ^ summon minecraft:interaction run function armor_statues:interactions/left_leg_setup
function armor_statues:interactions/display_setup {\
type: "left_leg",\
block: "minecraft:yellow_stained_glass",\
x: 0.125f,\
y: 0.65625f,\
translation: -0.125f,\
scale: 0.25f,\
entity: "minecraft:interaction"\
}
#execute rotated ~ 0 positioned ^0.125 ^0.65625 ^ summon minecraft:block_display run function armor_statues:interactions/left_leg_setup
function armor_statues:interactions/display_setup {\
type: "left_leg",\
block: "minecraft:yellow_stained_glass",\
x: 0.125f,\
y: 0.65625f,\
translation: -0.125f,\
scale: 0.25f,\
entity: "minecraft:block_display"\
}
# Base
#execute rotated ~ 0 positioned ^ ^ ^ summon minecraft:interaction run function armor_statues:interactions/base_setup
function armor_statues:interactions/display_setup {\
type: "base",\
block: "minecraft:black_stained_glass",\
x: 0f,\
y: 0f,\
translation: -0.125f,\
scale: 0.25f,\
entity: "minecraft:interaction"\
}
#execute rotated ~ 0 positioned ^ ^ ^ summon minecraft:block_display run function armor_statues:interactions/base_setup
function armor_statues:interactions/display_setup {\
type: "base",\
block: "minecraft:black_stained_glass",\
x: 0f,\
y: 0f,\
translation: -0.125f,\
scale: 0.25f,\
entity: "minecraft:block_display"\
}
# resets temp tag
tag @s remove as_interactable_temp

View File

@ -0,0 +1,161 @@
#
# Description: Sets up armor stand for interactions
# Called by: armor_statues:3_second
# Entity @s: armor_stand
#
tag @s add as_interactable
tag @s add as_interactable_temp
data merge entity @s {Marker:1b}
execute store result score @s as_uuid1 run data get entity @s UUID[0]
execute store result score @s as_uuid2 run data get entity @s UUID[1]
execute store result score @s as_uuid3 run data get entity @s UUID[2]
execute store result score @s as_uuid4 run data get entity @s UUID[3]
# Head
#execute rotated ~ 0 positioned ^ ^0.76 ^ summon minecraft:interaction run function armor_statues:interactions/head_setup_small
function armor_statues:interactions/display_setup {\
type: "head",\
block: "minecraft:blue_stained_glass",\
x: 0f,\
y: 0.76f,\
translation: -0.095f,\
scale: 0.19f,\
entity: "minecraft:interaction"\
}
#execute rotated ~ 0 positioned ^ ^0.76 ^ summon minecraft:block_display run function armor_statues:interactions/head_setup_small
function armor_statues:interactions/display_setup {\
type: "head",\
block: "minecraft:blue_stained_glass",\
x: 0f,\
y: 0.76f,\
translation: -0.095f,\
scale: 0.19f,\
entity: "minecraft:block_display"\
}
# Body
#execute rotated ~ 0 positioned ^ ^0.625 ^ summon minecraft:interaction run function armor_statues:interactions/body_setup_small
function armor_statues:interactions/display_setup {\
type: "body",\
block: "minecraft:white_stained_glass",\
x: 0f,\
y: 0.625f,\
translation: -0.0625f,\
scale: 0.125f,\
entity: "minecraft:interaction"\
}
#execute rotated ~ 0 positioned ^ ^0.625 ^ summon minecraft:block_display run function armor_statues:interactions/body_setup_small
function armor_statues:interactions/display_setup {\
type: "body",\
block: "minecraft:white_stained_glass",\
x: 0f,\
y: 0.625f,\
translation: -0.0625f,\
scale: 0.125f,\
entity: "minecraft:block_display"\
}
# Right Arm
#execute rotated ~ 0 positioned ^-0.171875 ^0.640625 ^ summon minecraft:interaction run function armor_statues:interactions/right_arm_setup_small
function armor_statues:interactions/display_setup {\
type: "right_arm",\
block: "minecraft:red_stained_glass",\
x: -0.171875f,\
y: 0.640625f,\
translation: -0.0625f,\
scale: 0.125f,\
entity: "minecraft:interaction"\
}
#execute rotated ~ 0 positioned ^-0.171875 ^0.640625 ^ summon minecraft:block_display run function armor_statues:interactions/right_arm_setup_small
function armor_statues:interactions/display_setup {\
type: "right_arm",\
block: "minecraft:red_stained_glass",\
x: -0.171875f,\
y: 0.640625f,\
translation: -0.0625f,\
scale: 0.125f,\
entity: "minecraft:block_display"\
}
# Left Arm
#execute rotated ~ 0 positioned ^0.171875 ^0.640625 ^ summon minecraft:interaction run function armor_statues:interactions/left_arm_setup_small
function armor_statues:interactions/display_setup {\
type: "left_arm",\
block: "minecraft:lime_stained_glass",\
x: 0.171875f,\
y: 0.640625f,\
translation: -0.0625f,\
scale: 0.125f,\
entity: "minecraft:interaction"\
}
#execute rotated ~ 0 positioned ^0.171875 ^0.640625 ^ summon minecraft:block_display run function armor_statues:interactions/left_arm_setup_small
function armor_statues:interactions/display_setup {\
type: "left_arm",\
block: "minecraft:lime_stained_glass",\
x: 0.171875f,\
y: 0.640625f,\
translation: -0.0625f,\
scale: 0.125f,\
entity: "minecraft:block_display"\
}
# Right Leg
#execute rotated ~ 0 positioned ^-0.0625 ^0.328125 ^ summon minecraft:interaction run function armor_statues:interactions/right_leg_setup_small
function armor_statues:interactions/display_setup {\
type: "right_leg",\
block: "minecraft:light_blue_stained_glass",\
x: -0.0625f,\
y: 0.328125f,\
translation: -0.0625f,\
scale: 0.125f,\
entity: "minecraft:interaction"\
}
#execute rotated ~ 0 positioned ^-0.0625 ^0.328125 ^ summon minecraft:block_display run function armor_statues:interactions/right_leg_setup_small
function armor_statues:interactions/display_setup {\
type: "right_leg",\
block: "minecraft:light_blue_stained_glass",\
x: -0.0625f,\
y: 0.328125f,\
translation: -0.0625f,\
scale: 0.125f,\
entity: "minecraft:block_display"\
}
# Left Leg
#execute rotated ~ 0 positioned ^0.0625 ^0.328125 ^ summon minecraft:interaction run function armor_statues:interactions/left_leg_setup_small
function armor_statues:interactions/display_setup {\
type: "left_leg",\
block: "minecraft:yellow_stained_glass",\
x: 0.0625f,\
y: 0.328125f,\
translation: -0.0625f,\
scale: 0.125f,\
entity: "minecraft:interaction"\
}
#execute rotated ~ 0 positioned ^0.0625 ^0.328125 ^ summon minecraft:block_display run function armor_statues:interactions/left_leg_setup_small
function armor_statues:interactions/display_setup {\
type: "left_leg",\
block: "minecraft:yellow_stained_glass",\
x: 0.0625f,\
y: 0.328125f,\
translation: -0.0625f,\
scale: 0.125f,\
entity: "minecraft:block_display"\
}
# Base
#execute rotated ~ 0 positioned ^ ^ ^ summon minecraft:interaction run function armor_statues:interactions/base_setup_small
function armor_statues:interactions/display_setup {\
type: "base",\
block: "minecraft:black_stained_glass",\
x: 0f,\
y: 0f,\
translation: -0.0625f,\
scale: 0.125f,\
entity: "minecraft:interaction"\
}
#execute rotated ~ 0 positioned ^ ^ ^ summon minecraft:block_display run function armor_statues:interactions/base_setup_small
function armor_statues:interactions/display_setup {\
type: "base",\
block: "minecraft:black_stained_glass",\
x: 0f,\
y: 0f,\
translation: -0.0625f,\
scale: 0.125f,\
entity: "minecraft:block_display"\
}
# resets temp tag
tag @s remove as_interactable_temp

View File

@ -0,0 +1,9 @@
#
# Description: teleports according to inputs
# Called by: armor_statues:interactions/readjust_interactions|armor_statues:interactions/readjust_interactions_small
# Entity @s: interaction|block display
# Parameters:
# x (float): x coord
# y (float): y coord
#
$tp ^$(x) ^$(y) ^

View File

@ -0,0 +1,28 @@
#
# Description: turns item frame invisible
# Called by: armor_statues:if_trigger
# Entity @s: #item frame
#
# Makes item frame fixed
#
execute unless entity @s[tag=if_fixed] as @p[tag=as_selected,scores={if_invisible=2}] run function armor_statues:player_message {\
message: '{\
"text": "Item frame fixed",\
"color": "dark_green"\
}'\
}
#
execute if entity @p[tag=as_selected,scores={if_invisible=2}] unless entity @s[tag=if_fixed] run data merge entity @s {Fixed:1b}
execute if entity @p[tag=as_selected,scores={if_invisible=2}] unless entity @s[tag=if_fixed] run tag @s add if_fixed
#
# Unfixes item frame
#
execute if entity @s[tag=if_fixed] as @p[tag=as_selected,scores={if_invisible=3}] run function armor_statues:player_message {\
message: '{\
"text": "Item frame no longer fixed",\
"color": "dark_green"\
}'\
}
#
execute if entity @p[tag=as_selected,scores={if_invisible=3}] if entity @s[tag=if_fixed] run data merge entity @s {Fixed:0b}
execute if entity @p[tag=as_selected,scores={if_invisible=3}] if entity @s[tag=if_fixed] run tag @s remove if_fixed

View File

@ -0,0 +1,9 @@
#
# Description: turns item frame invisible if successful
# Called by: armor_statues:if_trigger
# Entity @s: #item frame
#
# Makes item frame invisible
#
data merge entity @s {Invisible:1b}
tag @s add if_invisible

View File

@ -0,0 +1,14 @@
#
# Description: turns item frame invisible
# Called by: armor_statues:if_trigger
# Entity @s: item frame
#
#
# If no potion in hand, display failure message
#
execute if entity @p[tag=as_selected,predicate=!armor_statues:mainhand_potion,predicate=!armor_statues:offhand_potion] run title @a[tag=as_selected,tag=!as_chat] actionbar [{"text":"Requires invisibility potion in Mainhand or Offhand","color":"dark_red"}]
execute if entity @p[tag=as_selected,predicate=!armor_statues:mainhand_potion,predicate=!armor_statues:offhand_potion] run tellraw @a[tag=as_selected,tag=as_chat] [{"text":"<Stick_God> ","color":"dark_green"},{"text":"Requires invisibility potion in Mainhand or Offhand","color":"dark_red"}]
#
# If player has a potion in hand, successfully trigger
#
execute unless entity @p[tag=as_selected,predicate=!armor_statues:mainhand_potion,predicate=!armor_statues:offhand_potion] run function armor_statues:item_frames/invisible_success

View File

@ -0,0 +1,7 @@
#
# Description: turns empty item frames visible
# Called by: armor_statues:as_second
# Entity @s: invisible item frame
#
execute as @s run data merge entity @s {Invisible:0b}
execute as @s run tag @s remove if_invisible

View File

@ -0,0 +1,98 @@
#
# Description: Create scoreboards
# Called by: #main:init
# Entity @s: None
#
# Create scoreboards
#
scoreboard objectives add as_trigger trigger
scoreboard objectives add as_pose dummy
scoreboard objectives add as_angle dummy
scoreboard objectives add as_help trigger
scoreboard objectives add if_invisible trigger
scoreboard objectives add as_repeat trigger
scoreboard objectives add pointer_wand trigger
scoreboard objectives add adjustment_wand trigger
scoreboard objectives add as_edited_uuid1 dummy
scoreboard objectives add as_edited_uuid2 dummy
scoreboard objectives add as_edited_uuid3 dummy
scoreboard objectives add as_edited_uuid4 dummy
scoreboard objectives add as_lock_uuid1 dummy
scoreboard objectives add as_lock_uuid2 dummy
scoreboard objectives add as_lock_uuid3 dummy
scoreboard objectives add as_lock_uuid4 dummy
scoreboard objectives add as_uuid1 dummy
scoreboard objectives add as_uuid2 dummy
scoreboard objectives add as_uuid3 dummy
scoreboard objectives add as_uuid4 dummy
scoreboard objectives add as_current_pose dummy
scoreboard objectives add as_wand_used minecraft.used:minecraft.warped_fungus_on_a_stick
#
# Resets triggers on reload
#
scoreboard players enable * as_trigger
scoreboard players enable * as_help
scoreboard players enable * if_invisible
scoreboard players enable * as_repeat
scoreboard players enable * pointer_wand
scoreboard players enable * adjustment_wand
#
# Variables
#
scoreboard players set #var15000 as_angle 15000
scoreboard players set #var45000 as_angle 45000
scoreboard players set #var30000 as_angle 30000
scoreboard players set #var60000 as_angle 60000
scoreboard players set #var90000 as_angle 90000
scoreboard players set #var180000 as_angle 180000
scoreboard players set #var360000 as_angle 360000
scoreboard players set #var-1 as_angle -1
#
# Admin settings
#
execute unless score #book_uncraftable as_angle matches 0..1 run scoreboard players set #book_uncraftable as_angle 1
execute unless score #help_craftable as_angle matches 0..1 run scoreboard players set #help_craftable as_angle 0
execute unless score #fixing_enabled as_angle matches 0..1 run scoreboard players set #fixing_enabled as_angle 0
execute unless score #uuid_locking as_angle matches 0..1 run scoreboard players set #uuid_locking as_angle 0
execute unless score #wands_disabled as_angle matches 0..1 run scoreboard players set #wands_disabled as_angle 0
execute unless score #pointer_craftable as_angle matches 0..1 run scoreboard players set #pointer_craftable as_angle 0
execute unless score #adjustment_craftable as_angle matches 0..1 run scoreboard players set #adjustment_craftable as_angle 0
execute unless score #pointer_triggerable as_angle matches 0..1 run scoreboard players set #pointer_triggerable as_angle 0
execute unless score #adjustment_triggerable as_angle matches 0..1 run scoreboard players set #adjustment_triggerable as_angle 0
execute unless score #scale_min as_angle matches 63..1000 run scoreboard players set #scale_min as_angle 250
execute unless score #scale_max as_angle matches 1000..16000 run scoreboard players set #scale_max as_angle 3000
#
# Legacy settings
#
execute if data storage customizable_armor_stands:settings as_admin{book_craft:"Disabled"} run scoreboard players set #book_uncraftable as_angle 1
execute if data storage customizable_armor_stands:settings as_admin{book_craft:"Enabled"} run scoreboard players set #book_uncraftable as_angle 0
execute if data storage customizable_armor_stands:settings as_admin{book_help:"Disabled"} run scoreboard players set #help_craftable as_angle 0
execute if data storage customizable_armor_stands:settings as_admin{book_help:"Enabled"} run scoreboard players set #help_craftable as_angle 1
execute if data storage customizable_armor_stands:settings as_admin{fixed_item_frame:"Enabled"} run scoreboard players set #fixing_enabled as_angle 1
execute if data storage customizable_armor_stands:settings as_admin{fixed_item_frame:"Disabled"} run scoreboard players set #fixing_enabled as_angle 0
execute if data storage customizable_armor_stands:settings as_admin{uuid_lock:"Enabled"} run scoreboard players set #uuid_locking as_angle 1
execute if data storage customizable_armor_stands:settings as_admin{uuid_lock:"Disabled"} run scoreboard players set #uuid_locking as_angle 0
execute if data storage customizable_armor_stands:settings as_admin run data remove storage customizable_armor_stands:settings as_admin
#
# Storage cleanups on reload
#
data remove storage armor_statues:book_storage SavedItem
data remove storage armor_statues:appendage appendage
data remove storage armor_statues:book_data tag
data remove storage armor_statues:slot_storage Slot
data remove storage armor_statues:temp coord
data remove storage armor_statues:temp multiply
data remove storage armor_statues:temp matrix
data remove storage armor_statues:temp display_setup
data remove storage armor_statues:temp tp
data remove storage armor_statues:temp align
data remove storage armor_statues:temp scale
data remove storage armor_statues:uuid_check UUID
#
# Sets storage settings
#
execute unless score #undo_states as_angle matches 0.. run scoreboard players set #undo_states as_angle 10
execute unless score #animate_trigger as_angle matches 0.. run scoreboard players set #animate_trigger as_angle 0
# book nbt storage
data remove storage armor_statues:book_data components
function armor_statues:book_data

View File

@ -0,0 +1,22 @@
#
# Description: Locks armor stand
# Called by: armor_statues:trigger/lock
# Entity @s: armor stand
#
execute as @p[tag=as_selected] run function armor_statues:player_message {\
message: '{\
"text": "Armor stand locked",\
"color": "dark_green"\
}'\
}
effect give @s minecraft:glowing 1
data merge entity @s {DisabledSlots:4144959}
tag @s add as_locked
#
# add Player UUID lock
#
execute store result score @s as_lock_uuid1 run data get entity @p[tag=as_selected] UUID[0]
execute store result score @s as_lock_uuid2 run data get entity @p[tag=as_selected] UUID[1]
execute store result score @s as_lock_uuid3 run data get entity @p[tag=as_selected] UUID[2]
execute store result score @s as_lock_uuid4 run data get entity @p[tag=as_selected] UUID[3]
tag @s add as_uuid_locked

View File

@ -0,0 +1,7 @@
#
# Description: Checks if armor stand has old or new lock
# Called by: armor_statues:trigger/trigger/lock
# Entity @s: Player
#
execute if entity @s[tag=as_locked,tag=as_uuid_locked] run function armor_statues:locking/uuid_check
execute if entity @s[tag=as_locked,tag=!as_uuid_locked] run function armor_statues:locking/unlock

View File

@ -0,0 +1,24 @@
#
# Description: Unlocks locked armor stand
# Called by: armor_statues:trigger/lock
# Entity @s: nearest locked armor stand
#
execute as @p[tag=as_selected] run function armor_statues:player_message {\
message: '{\
"text": "Armor stand unlocked",\
"color": "dark_green"\
}'\
}
execute if entity @p[tag=as_selected] run effect give @s minecraft:glowing 1
data merge entity @s {DisabledSlots:0}
tag @s remove as_locked
# removes tag for tool rack if present
tag @s[tag=as_tool_rack] remove as_tool_rack
#
# add Player UUID lock
#
scoreboard players reset @s as_lock_uuid1
scoreboard players reset @s as_lock_uuid2
scoreboard players reset @s as_lock_uuid3
scoreboard players reset @s as_lock_uuid4
tag @s remove as_uuid_locked

View File

@ -0,0 +1,19 @@
#
# Description: Checks UUID of player against the UUID of the armor stand and player
# Called by: armor_statues:trigger/lock
# Entity @s: nearest locked armor stand
#
execute store result score @p[tag=as_selected] as_lock_uuid1 run data get entity @p[tag=as_selected] UUID[0]
execute store result score @p[tag=as_selected] as_lock_uuid2 run data get entity @p[tag=as_selected] UUID[1]
execute store result score @p[tag=as_selected] as_lock_uuid3 run data get entity @p[tag=as_selected] UUID[2]
execute store result score @p[tag=as_selected] as_lock_uuid4 run data get entity @p[tag=as_selected] UUID[3]
#
scoreboard players set #as_success as_help 0
execute store success score #as_success as_help if score @p[tag=as_selected] as_lock_uuid1 = @s as_lock_uuid1 if score @p[tag=as_selected] as_lock_uuid2 = @s as_lock_uuid2 if score @p[tag=as_selected] as_lock_uuid3 = @s as_lock_uuid3 if score @p[tag=as_selected] as_lock_uuid4 = @s as_lock_uuid4 run function armor_statues:locking/unlock
#
execute if score #as_success as_help matches 0 as @p[tag=as_selected] run function armor_statues:player_message {\
message: '{\
"text": "Can\'t modify armor stands locked by a different player",\
"color": "dark_red"\
}'\
}

View File

@ -0,0 +1,22 @@
#
# Description: multiplies 2 floating point numbers
# Called by: armor_statues:set
# Entity @s: block display
# Parameters:
# var1 (float): var1
# var2 (float): var2
# out (str): data source to output to
#
$data modify storage armor_statues:temp matrix set value \
[ 0f, 0f, 0f, $(var1)f,\
0f, 1f, 0f, 0f,\
0f, 0f, 1f, 0f,\
0f, 0f, 0f, 1f ]
$data modify entity @s transformation set value \
[ 0f, 0f, 0f, 1f,\
0f, 1f, 0f, 0f,\
0f, 0f, 1f, 0f,\
0f, 0f, 0f, $(var2)f ]
data modify storage armor_statues:temp matrix[-1] set from entity @s transformation.translation[0]
data modify entity @s transformation set from storage armor_statues:temp matrix
$data modify $(out) set from entity @s transformation.translation[0]

View File

@ -0,0 +1,17 @@
#
# Description: outputs messages to player via title or tellraw depending on .
# Called by:
# Entity @s: player
# Parameters:
# message (str): Output message for
#
$execute as @s[tag=!as_chat] run title @s actionbar [\
$(message)\
]
$execute as @s[tag=as_chat] run tellraw @s [\
{\
"text":"<Stick_God> ",\
"color":"dark_green"\
},\
$(message)\
]

View File

@ -0,0 +1,27 @@
#
# Description: trigger for crafting pointer wand
# Called by: armor_statues:second
# Entity @s: player
#
# Checks if wands are disabled
#
execute if score #wands_disabled as_angle matches 1 run function armor_statues:player_message {\
message: '{\
"text":"Wands must be enabled",\
"color":"dark_red"\
}'\
}
execute if score #wands_disabled as_angle matches 1 run scoreboard players set @s pointer_wand 0
execute if score #wands_disabled as_angle matches 1 run return fail
# Checks if player already has a wand
execute if items entity @s container.* minecraft:stick[minecraft:custom_data~{wand:1b}] run title @s actionbar [{"text":"You already have a Pointer Wand!","color": "red"}]
execute if items entity @s container.* minecraft:stick[minecraft:custom_data~{wand:1b}] run scoreboard players set @s pointer_wand 0
# Checks if player has an item for wand
execute unless items entity @s[scores={pointer_wand=1..}] container.* minecraft:stick run title @s actionbar [{"text":"Must have a ","color":"red"},{"translate":"item.minecraft.stick","color":"yellow"},{"color":"red","text":" in Inventory"}]
execute unless items entity @s[scores={pointer_wand=1..}] container.* minecraft:stick run scoreboard players set @s pointer_wand 0
#
clear @s[scores={pointer_wand=1..}] minecraft:stick 1
loot give @s[scores={pointer_wand=1..}] loot armor_statues:pointer_wand
# reset trigger
scoreboard players set @s pointer_wand 0
scoreboard players enable @s pointer_wand

View File

@ -0,0 +1,21 @@
#
# Description: Randomizes appendage rotation
# Called by: armor_statues:trigger/random_pose
# Entity @s: temp armor stand
#
# Sets random angle type
scoreboard players set #random_type as_angle 0
execute if predicate armor_statues:random_chance_10 run scoreboard players set #random_type as_angle 1
execute if score #random_type as_angle matches 1 if predicate armor_statues:random_chance_30 run scoreboard players set #random_type as_angle 2
# small angle #random_type=0
execute if score #random_type as_angle matches 0 store result storage armor_statues:pose_storage Pose.Body[0] float 0.001 run random value -15000..15000
execute if score #random_type as_angle matches 0 store result storage armor_statues:pose_storage Pose.Body[1] float 0.001 run random value -15000..15000
execute if score #random_type as_angle matches 0 store result storage armor_statues:pose_storage Pose.Body[2] float 0.001 run random value -15000..15000
# med angle #random_type=1
execute if score #random_type as_angle matches 1 store result storage armor_statues:pose_storage Pose.Body[0] float 0.001 run random value -30000..30000
execute if score #random_type as_angle matches 1 store result storage armor_statues:pose_storage Pose.Body[1] float 0.001 run random value -30000..30000
execute if score #random_type as_angle matches 1 store result storage armor_statues:pose_storage Pose.Body[2] float 0.001 run random value -30000..30000
# extreme angle #random_type=2
execute if score #random_type as_angle matches 2 store result storage armor_statues:pose_storage Pose.Body[0] float 0.001 run random value -180000..180000
execute if score #random_type as_angle matches 2 store result storage armor_statues:pose_storage Pose.Body[1] float 0.001 run random value -180000..180000
execute if score #random_type as_angle matches 2 store result storage armor_statues:pose_storage Pose.Body[2] float 0.001 run random value -180000..180000

View File

@ -0,0 +1,31 @@
#
# Description: adjusts probability
# Called by: UNUSED
# Entity @s: temp armor stand
#
scoreboard players set #x_negative as_angle 0
scoreboard players set #y_negative as_angle 0
scoreboard players set #z_negative as_angle 0
scoreboard players set #random_type as_angle 0
execute if predicate armor_statues:random_chance_10 run scoreboard players set #random_type as_angle 1
execute if score #random_type as_angle matches 1 if predicate armor_statues:random_chance_30 run scoreboard players set #random_type as_angle 2
# negative modulo
execute if score #random_type as_angle matches 0..1 if score #x_angle as_angle matches ..-1 run scoreboard players set #x_negative as_angle 1
execute if score #random_type as_angle matches 0..1 if score #y_angle as_angle matches ..-1 run scoreboard players set #y_negative as_angle 1
execute if score #random_type as_angle matches 0..1 if score #z_angle as_angle matches ..-1 run scoreboard players set #z_negative as_angle 1
execute if score #x_negative as_angle matches 1 run scoreboard players operation #x_angle as_angle *= #var-1 as_angle
execute if score #y_negative as_angle matches 1 run scoreboard players operation #y_angle as_angle *= #var-1 as_angle
execute if score #z_negative as_angle matches 1 run scoreboard players operation #z_angle as_angle *= #var-1 as_angle
# small angle #random_type=0
execute if score #random_type as_angle matches 0 run scoreboard players operation #x_angle as_angle %= #var15000 as_angle
execute if score #random_type as_angle matches 0 run scoreboard players operation #y_angle as_angle %= #var15000 as_angle
execute if score #random_type as_angle matches 0 run scoreboard players operation #z_angle as_angle %= #var15000 as_angle
# med angle #random_type=1
execute if score #random_type as_angle matches 1 run scoreboard players operation #x_angle as_angle %= #var30000 as_angle
execute if score #random_type as_angle matches 1 run scoreboard players operation #y_angle as_angle %= #var30000 as_angle
execute if score #random_type as_angle matches 1 run scoreboard players operation #z_angle as_angle %= #var30000 as_angle
# extreme angle #random_type=2 (no modulo)
# reversed negative
execute if score #x_negative as_angle matches 1 run scoreboard players operation #x_angle as_angle *= #var-1 as_angle
execute if score #y_negative as_angle matches 1 run scoreboard players operation #y_angle as_angle *= #var-1 as_angle
execute if score #z_negative as_angle matches 1 run scoreboard players operation #z_angle as_angle *= #var-1 as_angle

View File

@ -0,0 +1,21 @@
#
# Description: Randomizes appendage rotation
# Called by: armor_statues:trigger/random_pose
# Entity @s: temp armor stand
#
# Sets random angle type
scoreboard players set #random_type as_angle 0
execute if predicate armor_statues:random_chance_20 run scoreboard players set #random_type as_angle 1
execute if score #random_type as_angle matches 1 if predicate armor_statues:random_chance_40 run scoreboard players set #random_type as_angle 2
# small angle #random_type=0
execute if score #random_type as_angle matches 0 store result storage armor_statues:pose_storage Pose.Head[0] float 0.001 run random value -30000..30000
execute if score #random_type as_angle matches 0 store result storage armor_statues:pose_storage Pose.Head[1] float 0.001 run random value -30000..30000
execute if score #random_type as_angle matches 0 store result storage armor_statues:pose_storage Pose.Head[2] float 0.001 run random value -30000..30000
# med angle #random_type=1
execute if score #random_type as_angle matches 1 store result storage armor_statues:pose_storage Pose.Head[0] float 0.001 run random value -60000..60000
execute if score #random_type as_angle matches 1 store result storage armor_statues:pose_storage Pose.Head[1] float 0.001 run random value -60000..60000
execute if score #random_type as_angle matches 1 store result storage armor_statues:pose_storage Pose.Head[2] float 0.001 run random value -60000..60000
# extreme angle #random_type=2
execute if score #random_type as_angle matches 2 store result storage armor_statues:pose_storage Pose.Head[0] float 0.001 run random value -180000..180000
execute if score #random_type as_angle matches 2 store result storage armor_statues:pose_storage Pose.Head[1] float 0.001 run random value -180000..180000
execute if score #random_type as_angle matches 2 store result storage armor_statues:pose_storage Pose.Head[2] float 0.001 run random value -180000..180000

View File

@ -0,0 +1,31 @@
#
# Description: adjusts probability
# Called by: UNUSED
# Entity @s: temp armor stand
#
scoreboard players set #x_negative as_angle 0
scoreboard players set #y_negative as_angle 0
scoreboard players set #z_negative as_angle 0
scoreboard players set #random_type as_angle 0
execute if predicate armor_statues:random_chance_20 run scoreboard players set #random_type as_angle 1
execute if score #random_type as_angle matches 1 if predicate armor_statues:random_chance_40 run scoreboard players set #random_type as_angle 2
# negative modulo
execute if score #random_type as_angle matches 0..1 if score #x_angle as_angle matches ..-1 run scoreboard players set #x_negative as_angle 1
execute if score #random_type as_angle matches 0..1 if score #y_angle as_angle matches ..-1 run scoreboard players set #y_negative as_angle 1
execute if score #random_type as_angle matches 0..1 if score #z_angle as_angle matches ..-1 run scoreboard players set #z_negative as_angle 1
execute if score #x_negative as_angle matches 1 run scoreboard players operation #x_angle as_angle *= #var-1 as_angle
execute if score #y_negative as_angle matches 1 run scoreboard players operation #y_angle as_angle *= #var-1 as_angle
execute if score #z_negative as_angle matches 1 run scoreboard players operation #z_angle as_angle *= #var-1 as_angle
# small angle #random_type=0
execute if score #random_type as_angle matches 0 run scoreboard players operation #x_angle as_angle %= #var30000 as_angle
execute if score #random_type as_angle matches 0 run scoreboard players operation #y_angle as_angle %= #var30000 as_angle
execute if score #random_type as_angle matches 0 run scoreboard players operation #z_angle as_angle %= #var30000 as_angle
# med angle #random_type=1
execute if score #random_type as_angle matches 1 run scoreboard players operation #x_angle as_angle %= #var60000 as_angle
execute if score #random_type as_angle matches 1 run scoreboard players operation #y_angle as_angle %= #var60000 as_angle
execute if score #random_type as_angle matches 1 run scoreboard players operation #z_angle as_angle %= #var60000 as_angle
# extreme angle #random_type=2 (no modulo)
# reversed negative
execute if score #x_negative as_angle matches 1 run scoreboard players operation #x_angle as_angle *= #var-1 as_angle
execute if score #y_negative as_angle matches 1 run scoreboard players operation #y_angle as_angle *= #var-1 as_angle
execute if score #z_negative as_angle matches 1 run scoreboard players operation #z_angle as_angle *= #var-1 as_angle

View File

@ -0,0 +1,8 @@
#
# Description: Randomizes appendage rotation
# Called by: armor_statues:trigger/random_pose
# Entity @s: temp armor stand
#
execute store result storage armor_statues:pose_storage Pose.LeftArm[0] float 0.001 run random value -180000..180000
execute store result storage armor_statues:pose_storage Pose.LeftArm[1] float 0.001 run random value -180000..180000
execute store result storage armor_statues:pose_storage Pose.LeftArm[2] float 0.001 run random value -180000..180000

View File

@ -0,0 +1,45 @@
#
# Description: Randomizes appendage rotation
# Called by: armor_statues:trigger/random_pose
# Entity @s: temp armor stand
#
# Sets angle type
scoreboard players set #random_type as_angle 0
execute if predicate armor_statues:random_chance_30 run scoreboard players set #random_type as_angle 1
execute if score #random_type as_angle matches 1 if predicate armor_statues:random_chance_50 run scoreboard players set #random_type as_angle 2
# small angle #random_type=0
execute if score #random_type as_angle matches 0 store result storage armor_statues:pose_storage Pose.LeftLeg[0] float 0.001 run random value -45000..45000
execute if score #random_type as_angle matches 0 store result storage armor_statues:pose_storage Pose.LeftLeg[1] float 0.001 run random value -45000..45000
execute if score #random_type as_angle matches 0 store result storage armor_statues:pose_storage Pose.LeftLeg[2] float 0.001 run random value -45000..45000
# med angle #random_type=1
execute if score #random_type as_angle matches 1 store result storage armor_statues:pose_storage Pose.LeftLeg[0] float 0.001 run random value -90000..90000
execute if score #random_type as_angle matches 1 store result storage armor_statues:pose_storage Pose.LeftLeg[1] float 0.001 run random value -90000..90000
execute if score #random_type as_angle matches 1 store result storage armor_statues:pose_storage Pose.LeftLeg[2] float 0.001 run random value -90000..90000
# extreme angle #random_type=2
execute if score #random_type as_angle matches 2 store result storage armor_statues:pose_storage Pose.LeftLeg[0] float 0.001 run random value -180000..180000
execute if score #random_type as_angle matches 2 store result storage armor_statues:pose_storage Pose.LeftLeg[1] float 0.001 run random value -180000..180000
execute if score #random_type as_angle matches 2 store result storage armor_statues:pose_storage Pose.LeftLeg[2] float 0.001 run random value -180000..180000
# crossing reduction
scoreboard players set #no_crossing as_angle 0
execute if predicate armor_statues:random_chance_85 run scoreboard players set #no_crossing as_angle 1
# x
# y
execute if score #no_crossing as_angle matches 1 \
store result score #angle as_angle run \
data get storage armor_statues:pose_storage Pose.LeftLeg[1]
execute if score #no_crossing as_angle matches 1 \
if score #angle as_angle matches 10000..170000 run \
scoreboard players operation #angle as_angle -= #var180000 as_angle
execute if score #no_crossing as_angle matches 1 \
store result storage armor_statues:pose_storage Pose.LeftLeg[1] float 0.001 run \
scoreboard players get #angle as_angle
# z
execute if score #no_crossing as_angle matches 1 \
store result score #angle as_angle run \
data get storage armor_statues:pose_storage Pose.LeftLeg[2]
execute if score #no_crossing as_angle matches 1 \
if score #angle as_angle matches 10000..170000 run \
scoreboard players operation #angle as_angle -= #var180000 as_angle
execute if score #no_crossing as_angle matches 1 \
store result storage armor_statues:pose_storage Pose.LeftLeg[2] float 0.001 run \
scoreboard players get #angle as_angle

View File

@ -0,0 +1,37 @@
#
# Description: adjusts probability
# Called by: UNUSED
# Entity @s: temp armor stand
#
scoreboard players set #x_negative as_angle 0
scoreboard players set #y_negative as_angle 0
scoreboard players set #z_negative as_angle 0
scoreboard players set #random_type as_angle 0
execute if predicate armor_statues:random_chance_30 run scoreboard players set #random_type as_angle 1
execute if score #random_type as_angle matches 1 if predicate armor_statues:random_chance_50 run scoreboard players set #random_type as_angle 2
# crossing reduction
scoreboard players set #no_crossing as_angle 0
execute if predicate armor_statues:random_chance_85 run scoreboard players set #no_crossing as_angle 1
#execute if score #no_crossing as_angle matches 1 if score #x_angle as_angle matches 10000..170000 run scoreboard players operation #x_angle as_angle -= #var180000 as_angle
execute if score #no_crossing as_angle matches 1 if score #y_angle as_angle matches 10000..170000 run scoreboard players operation #y_angle as_angle -= #var180000 as_angle
execute if score #no_crossing as_angle matches 1 if score #z_angle as_angle matches 10000..170000 run scoreboard players operation #z_angle as_angle -= #var180000 as_angle
# negative modulo
execute if score #random_type as_angle matches 0..1 if score #x_angle as_angle matches ..-1 run scoreboard players set #x_negative as_angle 1
execute if score #random_type as_angle matches 0..1 if score #y_angle as_angle matches ..-1 run scoreboard players set #y_negative as_angle 1
execute if score #random_type as_angle matches 0..1 if score #z_angle as_angle matches ..-1 run scoreboard players set #z_negative as_angle 1
execute if score #x_negative as_angle matches 1 run scoreboard players operation #x_angle as_angle *= #var-1 as_angle
execute if score #y_negative as_angle matches 1 run scoreboard players operation #y_angle as_angle *= #var-1 as_angle
execute if score #z_negative as_angle matches 1 run scoreboard players operation #z_angle as_angle *= #var-1 as_angle
# small angle #random_type=0
execute if score #random_type as_angle matches 0 run scoreboard players operation #x_angle as_angle %= #var45000 as_angle
execute if score #random_type as_angle matches 0 run scoreboard players operation #y_angle as_angle %= #var45000 as_angle
execute if score #random_type as_angle matches 0 run scoreboard players operation #z_angle as_angle %= #var45000 as_angle
# med angle #random_type=1
execute if score #random_type as_angle matches 1 run scoreboard players operation #x_angle as_angle %= #var90000 as_angle
execute if score #random_type as_angle matches 1 run scoreboard players operation #y_angle as_angle %= #var90000 as_angle
execute if score #random_type as_angle matches 1 run scoreboard players operation #z_angle as_angle %= #var90000 as_angle
# extreme angle #random_type=2 (no modulo)
# reversed negative
execute if score #x_negative as_angle matches 1 run scoreboard players operation #x_angle as_angle *= #var-1 as_angle
execute if score #y_negative as_angle matches 1 run scoreboard players operation #y_angle as_angle *= #var-1 as_angle
execute if score #z_negative as_angle matches 1 run scoreboard players operation #z_angle as_angle *= #var-1 as_angle

View File

@ -0,0 +1,8 @@
#
# Description: Randomizes appendage rotation
# Called by: armor_statues:trigger/random_pose
# Entity @s: temp armor stand
#
execute store result storage armor_statues:pose_storage Pose.RightArm[0] float 0.001 run random value -180000..180000
execute store result storage armor_statues:pose_storage Pose.RightArm[1] float 0.001 run random value -180000..180000
execute store result storage armor_statues:pose_storage Pose.RightArm[2] float 0.001 run random value -180000..180000

View File

@ -0,0 +1,45 @@
#
# Description: Randomizes appendage rotation
# Called by: armor_statues:trigger/random_pose
# Entity @s: temp armor stand
#
# Sets angle type
scoreboard players set #random_type as_angle 0
execute if predicate armor_statues:random_chance_30 run scoreboard players set #random_type as_angle 1
execute if score #random_type as_angle matches 1 if predicate armor_statues:random_chance_50 run scoreboard players set #random_type as_angle 2
# small angle #random_type=0
execute if score #random_type as_angle matches 0 store result storage armor_statues:pose_storage Pose.RightLeg[0] float 0.001 run random value -45000..45000
execute if score #random_type as_angle matches 0 store result storage armor_statues:pose_storage Pose.RightLeg[1] float 0.001 run random value -45000..45000
execute if score #random_type as_angle matches 0 store result storage armor_statues:pose_storage Pose.RightLeg[2] float 0.001 run random value -45000..45000
# med angle #random_type=1
execute if score #random_type as_angle matches 1 store result storage armor_statues:pose_storage Pose.RightLeg[0] float 0.001 run random value -90000..90000
execute if score #random_type as_angle matches 1 store result storage armor_statues:pose_storage Pose.RightLeg[1] float 0.001 run random value -90000..90000
execute if score #random_type as_angle matches 1 store result storage armor_statues:pose_storage Pose.RightLeg[2] float 0.001 run random value -90000..90000
# extreme angle #random_type=2
execute if score #random_type as_angle matches 2 store result storage armor_statues:pose_storage Pose.RightLeg[0] float 0.001 run random value -180000..180000
execute if score #random_type as_angle matches 2 store result storage armor_statues:pose_storage Pose.RightLeg[1] float 0.001 run random value -180000..180000
execute if score #random_type as_angle matches 2 store result storage armor_statues:pose_storage Pose.RightLeg[2] float 0.001 run random value -180000..180000
# crossing reduction
scoreboard players set #no_crossing as_angle 0
execute if predicate armor_statues:random_chance_85 run scoreboard players set #no_crossing as_angle 1
# x
# y
execute if score #no_crossing as_angle matches 1 \
store result score #angle as_angle run \
data get storage armor_statues:pose_storage Pose.RightLeg[1]
execute if score #no_crossing as_angle matches 1 \
if score #angle as_angle matches 10000..170000 run \
scoreboard players operation #angle as_angle -= #var180000 as_angle
execute if score #no_crossing as_angle matches 1 \
store result storage armor_statues:pose_storage Pose.RightLeg[1] float 0.001 run \
scoreboard players get #angle as_angle
# z
execute if score #no_crossing as_angle matches 1 \
store result score #angle as_angle run \
data get storage armor_statues:pose_storage Pose.RightLeg[2]
execute if score #no_crossing as_angle matches 1 \
if score #angle as_angle matches 10000..170000 run \
scoreboard players operation #angle as_angle -= #var180000 as_angle
execute if score #no_crossing as_angle matches 1 \
store result storage armor_statues:pose_storage Pose.RightLeg[2] float 0.001 run \
scoreboard players get #angle as_angle

View File

@ -0,0 +1,37 @@
#
# Description: adjusts probability
# Called by: UNUSED
# Entity @s: temp armor stand
#
scoreboard players set #x_negative as_angle 0
scoreboard players set #y_negative as_angle 0
scoreboard players set #z_negative as_angle 0
scoreboard players set #random_type as_angle 0
execute if predicate armor_statues:random_chance_30 run scoreboard players set #random_type as_angle 1
execute if score #random_type as_angle matches 1 if predicate armor_statues:random_chance_50 run scoreboard players set #random_type as_angle 2
# crossing reduction
scoreboard players set #no_crossing as_angle 0
execute if predicate armor_statues:random_chance_85 run scoreboard players set #no_crossing as_angle 1
#execute if score #no_crossing as_angle matches 1 if score #x_angle as_angle matches -170000..-10000 run scoreboard players operation #x_angle as_angle += #var180000 as_angle
execute if score #no_crossing as_angle matches 1 if score #y_angle as_angle matches -170000..-10000 run scoreboard players operation #y_angle as_angle += #var180000 as_angle
execute if score #no_crossing as_angle matches 1 if score #z_angle as_angle matches -170000..-10000 run scoreboard players operation #z_angle as_angle += #var180000 as_angle
# negative modulo
execute if score #random_type as_angle matches 0..1 if score #x_angle as_angle matches ..-1 run scoreboard players set #x_negative as_angle 1
execute if score #random_type as_angle matches 0..1 if score #y_angle as_angle matches ..-1 run scoreboard players set #y_negative as_angle 1
execute if score #random_type as_angle matches 0..1 if score #z_angle as_angle matches ..-1 run scoreboard players set #z_negative as_angle 1
execute if score #x_negative as_angle matches 1 run scoreboard players operation #x_angle as_angle *= #var-1 as_angle
execute if score #y_negative as_angle matches 1 run scoreboard players operation #y_angle as_angle *= #var-1 as_angle
execute if score #z_negative as_angle matches 1 run scoreboard players operation #z_angle as_angle *= #var-1 as_angle
# small angle #random_type=0
execute if score #random_type as_angle matches 0 run scoreboard players operation #x_angle as_angle %= #var45000 as_angle
execute if score #random_type as_angle matches 0 run scoreboard players operation #y_angle as_angle %= #var45000 as_angle
execute if score #random_type as_angle matches 0 run scoreboard players operation #z_angle as_angle %= #var45000 as_angle
# med angle #random_type=1
execute if score #random_type as_angle matches 1 run scoreboard players operation #x_angle as_angle %= #var90000 as_angle
execute if score #random_type as_angle matches 1 run scoreboard players operation #y_angle as_angle %= #var90000 as_angle
execute if score #random_type as_angle matches 1 run scoreboard players operation #z_angle as_angle %= #var90000 as_angle
# extreme angle #random_type=2 (no modulo)
# reversed negative
execute if score #x_negative as_angle matches 1 run scoreboard players operation #x_angle as_angle *= #var-1 as_angle
execute if score #y_negative as_angle matches 1 run scoreboard players operation #y_angle as_angle *= #var-1 as_angle
execute if score #z_negative as_angle matches 1 run scoreboard players operation #z_angle as_angle *= #var-1 as_angle

View File

@ -0,0 +1,23 @@
#
# Description: Nudge postion of armor stand relative to player and aligned to the world grid
# Called by: armor_statues:trigger/position_relative
# Entity @s: armor stand
#
# X/Left/Right
execute if entity @p[tag=as_selected,scores={as_trigger=1100}] run tp @s ^-0.5 ^ ^
execute if entity @p[tag=as_selected,scores={as_trigger=1101}] run tp @s ^-0.1875 ^ ^
execute if entity @p[tag=as_selected,scores={as_trigger=1102}] run tp @s ^-0.0625 ^ ^
execute if entity @p[tag=as_selected,scores={as_trigger=1130}] run tp @s ^-0.00625 ^ ^
execute if entity @p[tag=as_selected,scores={as_trigger=1131}] run tp @s ^0.00625 ^ ^
execute if entity @p[tag=as_selected,scores={as_trigger=1103}] run tp @s ^0.0625 ^ ^
execute if entity @p[tag=as_selected,scores={as_trigger=1104}] run tp @s ^0.1875 ^ ^
execute if entity @p[tag=as_selected,scores={as_trigger=1105}] run tp @s ^0.5 ^ ^
# Z/Forward/backward
execute if entity @p[tag=as_selected,scores={as_trigger=1106}] run tp @s ^ ^ ^-0.5
execute if entity @p[tag=as_selected,scores={as_trigger=1107}] run tp @s ^ ^ ^-0.1875
execute if entity @p[tag=as_selected,scores={as_trigger=1108}] run tp @s ^ ^ ^-0.0625
execute if entity @p[tag=as_selected,scores={as_trigger=1132}] run tp @s ^ ^ ^-0.00625
execute if entity @p[tag=as_selected,scores={as_trigger=1133}] run tp @s ^ ^ ^0.00625
execute if entity @p[tag=as_selected,scores={as_trigger=1109}] run tp @s ^ ^ ^0.0625
execute if entity @p[tag=as_selected,scores={as_trigger=1110}] run tp @s ^ ^ ^0.1875
execute if entity @p[tag=as_selected,scores={as_trigger=1111}] run tp @s ^ ^ ^0.5

View File

@ -0,0 +1,32 @@
#
# Description: Nudge postion of armor stand relative to player
# Called by: armor_statues:trigger/position_relative
# Entity @s: armor stand
#
# X/Left/Right
execute if entity @p[tag=as_selected,scores={as_trigger=1112}] run tp @s ^-0.5 ^ ^
execute if entity @p[tag=as_selected,scores={as_trigger=1113}] run tp @s ^-0.1875 ^ ^
execute if entity @p[tag=as_selected,scores={as_trigger=1114}] run tp @s ^-0.0625 ^ ^
execute if entity @p[tag=as_selected,scores={as_trigger=1134}] run tp @s ^-0.00625 ^ ^
execute if entity @p[tag=as_selected,scores={as_trigger=1135}] run tp @s ^0.00625 ^ ^
execute if entity @p[tag=as_selected,scores={as_trigger=1115}] run tp @s ^0.0625 ^ ^
execute if entity @p[tag=as_selected,scores={as_trigger=1116}] run tp @s ^0.1875 ^ ^
execute if entity @p[tag=as_selected,scores={as_trigger=1117}] run tp @s ^0.5 ^ ^
# Y/Up/Down
execute if entity @p[tag=as_selected,scores={as_trigger=1118}] run tp @s ^ ^-0.5 ^
execute if entity @p[tag=as_selected,scores={as_trigger=1119}] run tp @s ^ ^-0.1875 ^
execute if entity @p[tag=as_selected,scores={as_trigger=1120}] run tp @s ^ ^-0.0625 ^
execute if entity @p[tag=as_selected,scores={as_trigger=1136}] run tp @s ^ ^-0.00625 ^
execute if entity @p[tag=as_selected,scores={as_trigger=1137}] run tp @s ^ ^0.00625 ^
execute if entity @p[tag=as_selected,scores={as_trigger=1121}] run tp @s ^ ^0.0625 ^
execute if entity @p[tag=as_selected,scores={as_trigger=1122}] run tp @s ^ ^0.1875 ^
execute if entity @p[tag=as_selected,scores={as_trigger=1123}] run tp @s ^ ^0.5 ^
# Z/Forward/backward
execute if entity @p[tag=as_selected,scores={as_trigger=1124}] run tp @s ^ ^ ^-0.5
execute if entity @p[tag=as_selected,scores={as_trigger=1125}] run tp @s ^ ^ ^-0.1875
execute if entity @p[tag=as_selected,scores={as_trigger=1126}] run tp @s ^ ^ ^-0.0625
execute if entity @p[tag=as_selected,scores={as_trigger=1138}] run tp @s ^ ^ ^-0.00625
execute if entity @p[tag=as_selected,scores={as_trigger=1139}] run tp @s ^ ^ ^0.00625
execute if entity @p[tag=as_selected,scores={as_trigger=1127}] run tp @s ^ ^ ^0.0625
execute if entity @p[tag=as_selected,scores={as_trigger=1128}] run tp @s ^ ^ ^0.1875
execute if entity @p[tag=as_selected,scores={as_trigger=1129}] run tp @s ^ ^ ^0.5

View File

@ -0,0 +1,9 @@
#
# Description: Unlocks tool rack if tripwire hook isn't present
# Called by: armor_statues:3_second
# Entity @s: armor stand
#
# unlocks
#
function armor_statues:locking/unlock
function armor_statues:set_visible

View File

@ -0,0 +1,22 @@
#
# Description: Undo last armor stand action
# Called by: as_statue:repeat/undo_redo
# Entity @s: player
#
# Copies current state to undo states
#
function armor_statues:repeat/save_undo_state
#
# Copies last redo state to armor stand
#
data modify entity @e[type=minecraft:armor_stand,sort=nearest,limit=1] {} merge from storage armor_statues:book_storage SavedItem.components.minecraft:custom_data.RedoStates[0]
data modify entity @e[type=minecraft:armor_stand,sort=nearest,limit=1] Pose set from storage armor_statues:book_storage SavedItem.components.minecraft:custom_data.RedoStates[0].Pose
execute as @e[type=minecraft:armor_stand,sort=nearest,limit=1,tag=as_selected] run function armor_statues:set_scale with storage armor_statues:book_storage SavedItem.components.minecraft:custom_data.RedoStates[0]
#
# Deletes redo state
#
data remove storage armor_statues:book_storage SavedItem.components.minecraft:custom_data.RedoStates[0]
#
# Modifies book data
#
execute as @s run function armor_statues:storage_out

View File

@ -0,0 +1,14 @@
#
# Description: Copies last function to book
# Called by: as_statue:trigger
# Entity @s: player
#
execute as @s run function armor_statues:storage_in
#
execute store result storage armor_statues:book_storage SavedItem.components.minecraft:custom_data.Repeat int 1 run scoreboard players get @p[tag=as_selected] as_trigger
#
# Undo states
#
execute unless score @s as_trigger matches 1000..1004 unless score @s as_trigger matches 161..162 unless score @s as_trigger matches 120..123 unless score @s as_trigger matches 155 if entity @e[type=armor_stand,tag=as_selected] if score #undo_states as_angle matches 1.. run function armor_statues:repeat/save_state
#
execute as @s run function armor_statues:storage_out

View File

@ -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:generic.scale get 1000

View File

@ -0,0 +1,30 @@
#
# Description: Copies last state for undoing
# Called by: as_statue:repeat/save
# Entity @s: player
#
# Checks if UUID of armor stand matches that of the book
#
#scoreboard players set #as_success as_angle 0
#execute store success score #as_success as_angle run data modify storage armor_statues:book_storage SavedItem.components.minecraft:custom_data.StatesUUID set from entity @e[type=armor_stand,sort=nearest,limit=1,tag=as_selected] UUID
#execute if score #as_success as_angle matches 1 run data remove storage armor_statues:book_storage SavedItem.components.minecraft:custom_data.UndoStates
#data remove storage armor_statues:book_storage SavedItem.components.minecraft:custom_data.RedoStates
# checks if uuid matches armor stand
scoreboard players set #as_success as_angle 0
data remove storage armor_statues:uuid_check UUID
data modify storage armor_statues:uuid_check UUID set from storage armor_statues:book_storage SavedItem.components.minecraft:custom_data.StatesUUID
execute store result score #as_success as_angle \
as @e[type=armor_stand,sort=nearest,limit=1,tag=as_selected] run \
function armor_statues:uuid_check with storage armor_statues:uuid_check {}
#
execute if score #as_success as_angle matches 0 run data modify storage armor_statues:book_storage SavedItem.components.minecraft:custom_data.UndoStates set value []
execute if score #as_success as_angle matches 0 run data modify storage armor_statues:book_storage SavedItem.components.minecraft:custom_data.StatesUUID set from entity @e[type=armor_stand,sort=nearest,limit=1,tag=as_selected] UUID
data modify storage armor_statues:book_storage SavedItem.components.minecraft:custom_data.RedoStates set value []
#
# Counts undo states and makes sure they're less than the maximum undo states
#
execute store result score #as_temp as_angle run data get storage armor_statues:book_storage SavedItem.components.minecraft:custom_data.UndoStates
execute if score #as_temp as_angle >= #undo_states as_angle run data remove storage armor_statues:book_storage SavedItem.components.minecraft:custom_data.UndoStates[-1]
#
function armor_statues:repeat/save_undo_state

View File

@ -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:generic.scale get 1000

View File

@ -0,0 +1,22 @@
#
# Description: Undo last armor stand action
# Called by: as_statue:repeat/undo_redo
# Entity @s: player
#
# Copies current state to redo states
#
function armor_statues:repeat/save_redo_state
#
# Copies last undo state to armor stand
#
data modify entity @e[type=minecraft:armor_stand,sort=nearest,limit=1,tag=as_selected] {} merge from storage armor_statues:book_storage SavedItem.components.minecraft:custom_data.UndoStates[0]
data modify entity @e[type=minecraft:armor_stand,sort=nearest,limit=1,tag=as_selected] Pose set from storage armor_statues:book_storage SavedItem.components.minecraft:custom_data.UndoStates[0].Pose
execute as @e[type=minecraft:armor_stand,sort=nearest,limit=1,tag=as_selected] run function armor_statues:set_scale with storage armor_statues:book_storage SavedItem.components.minecraft:custom_data.UndoStates[0]
#
# Deletes undo state state
#
data remove storage armor_statues:book_storage SavedItem.components.minecraft:custom_data.UndoStates[0]
#
# Modifies book data
#
execute as @s run function armor_statues:storage_out

View File

@ -0,0 +1,52 @@
#
# Description: Checks if armor stand is undoable/redoable
# Called by: as_statue:trigger
# Entity @s: player
#
execute as @s run function armor_statues:storage_in
#
# Checks if UUID of armor stand matches that of the book
#
# checks if uuid matches armor stand
scoreboard players set #as_success as_angle 0
data remove storage armor_statues:uuid_check UUID
data modify storage armor_statues:uuid_check UUID set from storage armor_statues:book_storage SavedItem.components.minecraft:custom_data.StatesUUID
execute store result score #as_success as_angle \
as @e[type=armor_stand,sort=nearest,limit=1,tag=as_selected] run \
function armor_statues:uuid_check with storage armor_statues:uuid_check {}
#
execute if score #as_success as_angle matches 0 as @s[tag=as_selected] run function armor_statues:player_message {\
message: '{\
"text":"Can\'t undo/redo state on current Armor Stand",\
"color":"dark_red"\
}'\
}
execute if score #as_success as_angle matches 0 run return 0
#
# Undo
#
execute as @s[scores={as_trigger=1200}] \
unless data storage armor_statues:book_storage SavedItem.components.minecraft:custom_data.UndoStates[] run \
function armor_statues:player_message {\
message: '{\
"text":"No states to undo",\
"color":"dark_red"\
}'\
}
execute as @s[scores={as_trigger=1200}] \
if data storage armor_statues:book_storage SavedItem.components.minecraft:custom_data.UndoStates[] run \
function armor_statues:repeat/undo
#
# Redo
#
execute as @s[scores={as_trigger=1201}] \
unless data storage armor_statues:book_storage SavedItem.components.minecraft:custom_data.RedoStates[] run \
function armor_statues:player_message {\
message: '{\
"text":"No states to redo",\
"color":"dark_red"\
}'\
}
execute as @s[scores={as_trigger=1201}] \
if data storage armor_statues:book_storage SavedItem.components.minecraft:custom_data.RedoStates[] run \
function armor_statues:repeat/redo

View File

@ -0,0 +1,15 @@
#
# Description: Applys the last repeated trigger score to players score
# Called by: armor_statues:second
# Entity @s: player
#
execute as @s run function armor_statues:storage_in
#
# Copies score from book to as_trigger
#
execute store result score @s as_trigger run data get storage armor_statues:book_storage SavedItem.components.minecraft:custom_data.Repeat
#
# Reset player's trigger score and re-enable
#
scoreboard players set @s as_repeat 0
scoreboard players enable @s as_repeat

View File

@ -0,0 +1 @@
# null

Some files were not shown because too many files have changed in this diff Show More