From d7b2cd84d906c3d15d60b249ef554a5c9b12362c Mon Sep 17 00:00:00 2001 From: MukiTanuki Date: Fri, 3 May 2024 02:36:58 -0600 Subject: [PATCH] 1.20.5 update Updated everything to work with the new component system. The Armor Statues book can be crafted using a book+armor stand in a crafting table. The Pointer Wand can be crafted using a stick+armor stand in a crafting table. The Adjustment Wand can be crafted using a warped fungus on a stick+armor stand in a crafting table. Renaming written books/sticks/fungus on a stick to 'statues' to give the respective items is disabled by default (you can enable these via the admin menu) since you can craft them via the crafting table. - you can re-enable via admin menu. The trigger for getting pointer wand/adjustment wand is disabled by default since you can craft them via the crafting table. - you can re-enable via admin menu. Added 1/10th pixel nudging. Added Scale to the Armor Statues book. Adjusted all other applicable functions to work with scaling. You can adjust the min and max caps for scaling via the admin menu. --- .../advancements/armor_statues.json | 18 + .../advancements/attack_interaction.json | 25 + .../armor_statues/advancements/crafting.json | 12 + .../armor_statues/advancements/enable.json | 31 + .../data/armor_statues/advancements/root.json | 12 + .../advancements/use_interaction.json | 25 + .../functions/3_second.mcfunction | 43 + .../functions/adjustment_wand.mcfunction | 14 + .../adjustment_wand_trigger.mcfunction | 27 + .../armor_statues/functions/admin.mcfunction | 593 +++ .../adjustment_craftable_toggle.mcfunction | 30 + .../adjustment_triggerable_toggle.mcfunction | 30 + .../admin/pointer_craftable_toggle.mcfunction | 30 + .../pointer_triggerable_toggle.mcfunction | 30 + .../functions/admin/scale.mcfunction | 48 + .../functions/animate.mcfunction | 8 + .../functions/animate_time.mcfunction | 8 + .../functions/craft_book.mcfunction | 9 + .../armor_statues/functions/give.mcfunction | 29 + .../functions/give_adjustment_wand.mcfunction | 7 + .../functions/give_pointer_wand.mcfunction | 7 + .../armor_statues/functions/help.mcfunction | 14 + .../functions/help/main.mcfunction | 206 ++ .../functions/if_trigger.mcfunction | 42 + .../interactions/attack_adjust.mcfunction | 52 + .../interactions/display_setup.mcfunction | 61 + .../display_setup_helper.mcfunction | 25 + .../interactions/interact.mcfunction | 52 + .../interactions/interact_adjust.mcfunction | 52 + .../readjust_interactions.mcfunction | 105 + .../readjust_interactions_small.mcfunction | 94 + .../functions/interactions/setup.mcfunction | 161 + .../interactions/setup_small.mcfunction | 161 + .../interactions/tp_helper.mcfunction | 9 + .../armor_statues/functions/load.mcfunction | 3276 +++++++++++++++++ .../functions/multiply_float.mcfunction | 22 + .../functions/pointer_wand_trigger.mcfunction | 27 + ...relative_position_aligned_nudge.mcfunction | 23 + .../relative_position_nudge.mcfunction | 32 + .../functions/remove_tool_rack.mcfunction | 9 + .../functions/repeat/redo.mcfunction | 21 + .../functions/repeat/save.mcfunction | 14 + .../repeat/save_redo_state.mcfunction | 19 + .../functions/repeat/save_state.mcfunction | 30 + .../repeat/save_undo_state.mcfunction | 19 + .../functions/repeat/undo.mcfunction | 21 + .../functions/repeat/undo_redo.mcfunction | 52 + .../functions/repeat_trigger.mcfunction | 15 + .../functions/replace_book.mcfunction | 1 + .../armor_statues/functions/second.mcfunction | 63 + .../functions/set_scale.mcfunction | 8 + .../functions/shrine/main.mcfunction | 8 + .../functions/storage_in.mcfunction | 48 + .../functions/storage_out.mcfunction | 48 + .../functions/summon_temp_marker.mcfunction | 35 + .../summon_temp_marker_helper.mcfunction | 12 + .../armor_statues/functions/tick.mcfunction | 13 + .../functions/trigger.mcfunction | 126 + .../functions/trigger/align.mcfunction | 128 + .../functions/trigger/align_small.mcfunction | 128 + .../functions/trigger/copy.mcfunction | 26 + .../functions/trigger/paste.mcfunction | 21 + .../functions/trigger/pointing.mcfunction | 138 + .../trigger/pointing_small.mcfunction | 138 + .../functions/trigger/position.mcfunction | 41 + .../trigger/position_relative.mcfunction | 47 + .../functions/trigger/rack.mcfunction | 67 + .../functions/trigger/rack_small.mcfunction | 67 + .../functions/trigger/scale.mcfunction | 31 + .../functions/trigger/scale_helper.mcfunction | 8 + .../functions/trigger/tp_helper.mcfunction | 10 + .../item_modifiers/adjustment_wand_0.json | 39 + .../item_modifiers/adjustment_wand_1.json | 39 + .../item_modifiers/adjustment_wand_2.json | 39 + .../item_modifiers/pointer_wand.json | 35 + .../item_modifiers/storage_out.json | 36 + .../armor_statues/item_modifiers/wand.json | 16 + .../loot_tables/adjustment_wand.json | 21 + .../data/armor_statues/loot_tables/book.json | 89 + .../data/armor_statues/loot_tables/book.txt | 529 +++ .../armor_statues/loot_tables/book_old.json | 7 + .../loot_tables/pointer_wand.json | 21 + .../loot_tables/random_pose.json | 6 + .../armor_statues/loot_tables/replace.json | 6 + .../loot_tables/replace_save.json | 6 + .../data/armor_statues/predicates/book.json | 37 + .../armor_statues/predicates/bothhands.json | 24 + .../predicates/holding_adjustment.json | 16 + .../predicates/holding_pointer.json | 16 + .../predicates/holding_wand.json | 18 + .../armor_statues/predicates/is_sneaking.json | 10 + .../predicates/item_frame_with_book.json | 26 + .../predicates/mainhand_potion.json | 34 + .../predicates/offhand_potion.json | 34 + .../armor_statues/predicates/savedpose.json | 13 + .../predicates/savedpose_mainhand.json | 17 + .../predicates/savedpose_offhand.json | 17 + .../recipes/adjustment_wand.json | 29 + 1_20_5/data/armor_statues/recipes/book.json | 40 + .../armor_statues/recipes/pointer_wand.json | 28 + .../tags/entity_types/item_frames.json | 13 + .../tags/entity_types/selectable.json | 17 + pack.mcmeta | 9 +- 103 files changed, 8148 insertions(+), 1 deletion(-) create mode 100644 1_20_5/data/armor_statues/advancements/armor_statues.json create mode 100644 1_20_5/data/armor_statues/advancements/attack_interaction.json create mode 100644 1_20_5/data/armor_statues/advancements/crafting.json create mode 100644 1_20_5/data/armor_statues/advancements/enable.json create mode 100644 1_20_5/data/armor_statues/advancements/root.json create mode 100644 1_20_5/data/armor_statues/advancements/use_interaction.json create mode 100644 1_20_5/data/armor_statues/functions/3_second.mcfunction create mode 100644 1_20_5/data/armor_statues/functions/adjustment_wand.mcfunction create mode 100644 1_20_5/data/armor_statues/functions/adjustment_wand_trigger.mcfunction create mode 100644 1_20_5/data/armor_statues/functions/admin.mcfunction create mode 100644 1_20_5/data/armor_statues/functions/admin/adjustment_craftable_toggle.mcfunction create mode 100644 1_20_5/data/armor_statues/functions/admin/adjustment_triggerable_toggle.mcfunction create mode 100644 1_20_5/data/armor_statues/functions/admin/pointer_craftable_toggle.mcfunction create mode 100644 1_20_5/data/armor_statues/functions/admin/pointer_triggerable_toggle.mcfunction create mode 100644 1_20_5/data/armor_statues/functions/admin/scale.mcfunction create mode 100644 1_20_5/data/armor_statues/functions/animate.mcfunction create mode 100644 1_20_5/data/armor_statues/functions/animate_time.mcfunction create mode 100644 1_20_5/data/armor_statues/functions/craft_book.mcfunction create mode 100644 1_20_5/data/armor_statues/functions/give.mcfunction create mode 100644 1_20_5/data/armor_statues/functions/give_adjustment_wand.mcfunction create mode 100644 1_20_5/data/armor_statues/functions/give_pointer_wand.mcfunction create mode 100644 1_20_5/data/armor_statues/functions/help.mcfunction create mode 100644 1_20_5/data/armor_statues/functions/help/main.mcfunction create mode 100644 1_20_5/data/armor_statues/functions/if_trigger.mcfunction create mode 100644 1_20_5/data/armor_statues/functions/interactions/attack_adjust.mcfunction create mode 100644 1_20_5/data/armor_statues/functions/interactions/display_setup.mcfunction create mode 100644 1_20_5/data/armor_statues/functions/interactions/display_setup_helper.mcfunction create mode 100644 1_20_5/data/armor_statues/functions/interactions/interact.mcfunction create mode 100644 1_20_5/data/armor_statues/functions/interactions/interact_adjust.mcfunction create mode 100644 1_20_5/data/armor_statues/functions/interactions/readjust_interactions.mcfunction create mode 100644 1_20_5/data/armor_statues/functions/interactions/readjust_interactions_small.mcfunction create mode 100644 1_20_5/data/armor_statues/functions/interactions/setup.mcfunction create mode 100644 1_20_5/data/armor_statues/functions/interactions/setup_small.mcfunction create mode 100644 1_20_5/data/armor_statues/functions/interactions/tp_helper.mcfunction create mode 100644 1_20_5/data/armor_statues/functions/load.mcfunction create mode 100644 1_20_5/data/armor_statues/functions/multiply_float.mcfunction create mode 100644 1_20_5/data/armor_statues/functions/pointer_wand_trigger.mcfunction create mode 100644 1_20_5/data/armor_statues/functions/relative_position_aligned_nudge.mcfunction create mode 100644 1_20_5/data/armor_statues/functions/relative_position_nudge.mcfunction create mode 100644 1_20_5/data/armor_statues/functions/remove_tool_rack.mcfunction create mode 100644 1_20_5/data/armor_statues/functions/repeat/redo.mcfunction create mode 100644 1_20_5/data/armor_statues/functions/repeat/save.mcfunction create mode 100644 1_20_5/data/armor_statues/functions/repeat/save_redo_state.mcfunction create mode 100644 1_20_5/data/armor_statues/functions/repeat/save_state.mcfunction create mode 100644 1_20_5/data/armor_statues/functions/repeat/save_undo_state.mcfunction create mode 100644 1_20_5/data/armor_statues/functions/repeat/undo.mcfunction create mode 100644 1_20_5/data/armor_statues/functions/repeat/undo_redo.mcfunction create mode 100644 1_20_5/data/armor_statues/functions/repeat_trigger.mcfunction create mode 100644 1_20_5/data/armor_statues/functions/replace_book.mcfunction create mode 100644 1_20_5/data/armor_statues/functions/second.mcfunction create mode 100644 1_20_5/data/armor_statues/functions/set_scale.mcfunction create mode 100644 1_20_5/data/armor_statues/functions/shrine/main.mcfunction create mode 100644 1_20_5/data/armor_statues/functions/storage_in.mcfunction create mode 100644 1_20_5/data/armor_statues/functions/storage_out.mcfunction create mode 100644 1_20_5/data/armor_statues/functions/summon_temp_marker.mcfunction create mode 100644 1_20_5/data/armor_statues/functions/summon_temp_marker_helper.mcfunction create mode 100644 1_20_5/data/armor_statues/functions/tick.mcfunction create mode 100644 1_20_5/data/armor_statues/functions/trigger.mcfunction create mode 100644 1_20_5/data/armor_statues/functions/trigger/align.mcfunction create mode 100644 1_20_5/data/armor_statues/functions/trigger/align_small.mcfunction create mode 100644 1_20_5/data/armor_statues/functions/trigger/copy.mcfunction create mode 100644 1_20_5/data/armor_statues/functions/trigger/paste.mcfunction create mode 100644 1_20_5/data/armor_statues/functions/trigger/pointing.mcfunction create mode 100644 1_20_5/data/armor_statues/functions/trigger/pointing_small.mcfunction create mode 100644 1_20_5/data/armor_statues/functions/trigger/position.mcfunction create mode 100644 1_20_5/data/armor_statues/functions/trigger/position_relative.mcfunction create mode 100644 1_20_5/data/armor_statues/functions/trigger/rack.mcfunction create mode 100644 1_20_5/data/armor_statues/functions/trigger/rack_small.mcfunction create mode 100644 1_20_5/data/armor_statues/functions/trigger/scale.mcfunction create mode 100644 1_20_5/data/armor_statues/functions/trigger/scale_helper.mcfunction create mode 100644 1_20_5/data/armor_statues/functions/trigger/tp_helper.mcfunction create mode 100644 1_20_5/data/armor_statues/item_modifiers/adjustment_wand_0.json create mode 100644 1_20_5/data/armor_statues/item_modifiers/adjustment_wand_1.json create mode 100644 1_20_5/data/armor_statues/item_modifiers/adjustment_wand_2.json create mode 100644 1_20_5/data/armor_statues/item_modifiers/pointer_wand.json create mode 100644 1_20_5/data/armor_statues/item_modifiers/storage_out.json create mode 100644 1_20_5/data/armor_statues/item_modifiers/wand.json create mode 100644 1_20_5/data/armor_statues/loot_tables/adjustment_wand.json create mode 100644 1_20_5/data/armor_statues/loot_tables/book.json create mode 100644 1_20_5/data/armor_statues/loot_tables/book.txt create mode 100644 1_20_5/data/armor_statues/loot_tables/book_old.json create mode 100644 1_20_5/data/armor_statues/loot_tables/pointer_wand.json create mode 100644 1_20_5/data/armor_statues/loot_tables/random_pose.json create mode 100644 1_20_5/data/armor_statues/loot_tables/replace.json create mode 100644 1_20_5/data/armor_statues/loot_tables/replace_save.json create mode 100644 1_20_5/data/armor_statues/predicates/book.json create mode 100644 1_20_5/data/armor_statues/predicates/bothhands.json create mode 100644 1_20_5/data/armor_statues/predicates/holding_adjustment.json create mode 100644 1_20_5/data/armor_statues/predicates/holding_pointer.json create mode 100644 1_20_5/data/armor_statues/predicates/holding_wand.json create mode 100644 1_20_5/data/armor_statues/predicates/is_sneaking.json create mode 100644 1_20_5/data/armor_statues/predicates/item_frame_with_book.json create mode 100644 1_20_5/data/armor_statues/predicates/mainhand_potion.json create mode 100644 1_20_5/data/armor_statues/predicates/offhand_potion.json create mode 100644 1_20_5/data/armor_statues/predicates/savedpose.json create mode 100644 1_20_5/data/armor_statues/predicates/savedpose_mainhand.json create mode 100644 1_20_5/data/armor_statues/predicates/savedpose_offhand.json create mode 100644 1_20_5/data/armor_statues/recipes/adjustment_wand.json create mode 100644 1_20_5/data/armor_statues/recipes/book.json create mode 100644 1_20_5/data/armor_statues/recipes/pointer_wand.json create mode 100644 1_20_5/data/armor_statues/tags/entity_types/item_frames.json create mode 100644 1_20_5/data/armor_statues/tags/entity_types/selectable.json diff --git a/1_20_5/data/armor_statues/advancements/armor_statues.json b/1_20_5/data/armor_statues/advancements/armor_statues.json new file mode 100644 index 0000000..e67732b --- /dev/null +++ b/1_20_5/data/armor_statues/advancements/armor_statues.json @@ -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" + } + } +} diff --git a/1_20_5/data/armor_statues/advancements/attack_interaction.json b/1_20_5/data/armor_statues/advancements/attack_interaction.json new file mode 100644 index 0000000..043a50e --- /dev/null +++ b/1_20_5/data/armor_statues/advancements/attack_interaction.json @@ -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" + } +} \ No newline at end of file diff --git a/1_20_5/data/armor_statues/advancements/crafting.json b/1_20_5/data/armor_statues/advancements/crafting.json new file mode 100644 index 0000000..78142c5 --- /dev/null +++ b/1_20_5/data/armor_statues/advancements/crafting.json @@ -0,0 +1,12 @@ +{ + "criteria": { + "impossible": { + "trigger": "minecraft:impossible" + } + }, + "requirements": [ + [ + "impossible" + ] + ] +} \ No newline at end of file diff --git a/1_20_5/data/armor_statues/advancements/enable.json b/1_20_5/data/armor_statues/advancements/enable.json new file mode 100644 index 0000000..9d834a0 --- /dev/null +++ b/1_20_5/data/armor_statues/advancements/enable.json @@ -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" + } +} \ No newline at end of file diff --git a/1_20_5/data/armor_statues/advancements/root.json b/1_20_5/data/armor_statues/advancements/root.json new file mode 100644 index 0000000..78142c5 --- /dev/null +++ b/1_20_5/data/armor_statues/advancements/root.json @@ -0,0 +1,12 @@ +{ + "criteria": { + "impossible": { + "trigger": "minecraft:impossible" + } + }, + "requirements": [ + [ + "impossible" + ] + ] +} \ No newline at end of file diff --git a/1_20_5/data/armor_statues/advancements/use_interaction.json b/1_20_5/data/armor_statues/advancements/use_interaction.json new file mode 100644 index 0000000..22253bd --- /dev/null +++ b/1_20_5/data/armor_statues/advancements/use_interaction.json @@ -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" + } +} \ No newline at end of file diff --git a/1_20_5/data/armor_statues/functions/3_second.mcfunction b/1_20_5/data/armor_statues/functions/3_second.mcfunction new file mode 100644 index 0000000..e5389db --- /dev/null +++ b/1_20_5/data/armor_statues/functions/3_second.mcfunction @@ -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 \ No newline at end of file diff --git a/1_20_5/data/armor_statues/functions/adjustment_wand.mcfunction b/1_20_5/data/armor_statues/functions/adjustment_wand.mcfunction new file mode 100644 index 0000000..97659a0 --- /dev/null +++ b/1_20_5/data/armor_statues/functions/adjustment_wand.mcfunction @@ -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 \ No newline at end of file diff --git a/1_20_5/data/armor_statues/functions/adjustment_wand_trigger.mcfunction b/1_20_5/data/armor_statues/functions/adjustment_wand_trigger.mcfunction new file mode 100644 index 0000000..3345ea5 --- /dev/null +++ b/1_20_5/data/armor_statues/functions/adjustment_wand_trigger.mcfunction @@ -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 \ No newline at end of file diff --git a/1_20_5/data/armor_statues/functions/admin.mcfunction b/1_20_5/data/armor_statues/functions/admin.mcfunction new file mode 100644 index 0000000..896f224 --- /dev/null +++ b/1_20_5/data/armor_statues/functions/admin.mcfunction @@ -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