From 65cd11e331b9aa8c1e9dd92064184cc336b0ab5a Mon Sep 17 00:00:00 2001 From: MukiTanuki Date: Mon, 11 Dec 2023 01:23:40 -0800 Subject: [PATCH] 1.20.4 update Did a bunch of code cleanup added --- .../functions/3_second.mcfunction | 43 + .../adjustment_wand_trigger.mcfunction | 27 + .../armor_statues/functions/admin.mcfunction | 362 ++ .../admin/book_from_help_toggle.mcfunction | 30 + .../admin/craft_book_toggle.mcfunction | 30 + .../admin/fixed_item_frame_toggle.mcfunction | 30 + .../admin/uuid_lock_toggle.mcfunction | 30 + .../admin/wands_disabled_toggle.mcfunction | 30 + .../functions/craft_book.mcfunction | 8 + .../armor_statues/functions/help.mcfunction | 14 + .../functions/help/credits.mcfunction | 71 + .../functions/help/main.mcfunction | 144 + .../functions/if_trigger.mcfunction | 42 + .../functions/item_frames/fixed.mcfunction | 28 + .../armor_statues/functions/load.mcfunction | 2903 +++++++++++++++++ .../functions/locking/lock.mcfunction | 22 + .../functions/locking/unlock.mcfunction | 24 + .../functions/locking/uuid_check.mcfunction | 19 + .../functions/player_message.mcfunction | 17 + .../functions/pointer_wand_trigger.mcfunction | 27 + .../functions/randomizer/body.mcfunction | 21 + .../functions/randomizer/head.mcfunction | 21 + .../functions/randomizer/left_arm.mcfunction | 8 + .../functions/randomizer/left_leg.mcfunction | 45 + .../functions/randomizer/right_arm.mcfunction | 8 + .../functions/randomizer/right_leg.mcfunction | 45 + .../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/sealing/seal.mcfunction | 15 + .../functions/sealing/unseal.mcfunction | 15 + .../armor_statues/functions/second.mcfunction | 44 + .../functions/storage_in.mcfunction | 9 + .../armor_statues/functions/test.mcfunction | 2 + .../functions/trigger.mcfunction | 122 + .../functions/trigger/copy.mcfunction | 25 + .../functions/trigger/lock.mcfunction | 23 + .../functions/trigger/paste.mcfunction | 20 + .../functions/trigger/pointing.mcfunction | 89 + .../trigger/pointing_small.mcfunction | 89 + .../functions/trigger/rack.mcfunction | 63 + .../functions/trigger/rack_small.mcfunction | 63 + .../functions/trigger/random_pose.mcfunction | 28 + .../functions/trigger/settings.mcfunction | 40 + .../functions/trigger/slots.mcfunction | 22 + .../item_modifiers/storage_out.json | 21 + .../data/armor_statues/loot_tables/book.json | 31 + .../data/armor_statues/loot_tables/book.txt | 529 +++ pack.mcmeta | 13 +- 54 files changed, 5502 insertions(+), 1 deletion(-) create mode 100644 1_20_3/data/armor_statues/functions/3_second.mcfunction create mode 100644 1_20_3/data/armor_statues/functions/adjustment_wand_trigger.mcfunction create mode 100644 1_20_3/data/armor_statues/functions/admin.mcfunction create mode 100644 1_20_3/data/armor_statues/functions/admin/book_from_help_toggle.mcfunction create mode 100644 1_20_3/data/armor_statues/functions/admin/craft_book_toggle.mcfunction create mode 100644 1_20_3/data/armor_statues/functions/admin/fixed_item_frame_toggle.mcfunction create mode 100644 1_20_3/data/armor_statues/functions/admin/uuid_lock_toggle.mcfunction create mode 100644 1_20_3/data/armor_statues/functions/admin/wands_disabled_toggle.mcfunction create mode 100644 1_20_3/data/armor_statues/functions/craft_book.mcfunction create mode 100644 1_20_3/data/armor_statues/functions/help.mcfunction create mode 100644 1_20_3/data/armor_statues/functions/help/credits.mcfunction create mode 100644 1_20_3/data/armor_statues/functions/help/main.mcfunction create mode 100644 1_20_3/data/armor_statues/functions/if_trigger.mcfunction create mode 100644 1_20_3/data/armor_statues/functions/item_frames/fixed.mcfunction create mode 100644 1_20_3/data/armor_statues/functions/load.mcfunction create mode 100644 1_20_3/data/armor_statues/functions/locking/lock.mcfunction create mode 100644 1_20_3/data/armor_statues/functions/locking/unlock.mcfunction create mode 100644 1_20_3/data/armor_statues/functions/locking/uuid_check.mcfunction create mode 100644 1_20_3/data/armor_statues/functions/player_message.mcfunction create mode 100644 1_20_3/data/armor_statues/functions/pointer_wand_trigger.mcfunction create mode 100644 1_20_3/data/armor_statues/functions/randomizer/body.mcfunction create mode 100644 1_20_3/data/armor_statues/functions/randomizer/head.mcfunction create mode 100644 1_20_3/data/armor_statues/functions/randomizer/left_arm.mcfunction create mode 100644 1_20_3/data/armor_statues/functions/randomizer/left_leg.mcfunction create mode 100644 1_20_3/data/armor_statues/functions/randomizer/right_arm.mcfunction create mode 100644 1_20_3/data/armor_statues/functions/randomizer/right_leg.mcfunction create mode 100644 1_20_3/data/armor_statues/functions/repeat/redo.mcfunction create mode 100644 1_20_3/data/armor_statues/functions/repeat/save.mcfunction create mode 100644 1_20_3/data/armor_statues/functions/repeat/save_redo_state.mcfunction create mode 100644 1_20_3/data/armor_statues/functions/repeat/save_state.mcfunction create mode 100644 1_20_3/data/armor_statues/functions/repeat/save_undo_state.mcfunction create mode 100644 1_20_3/data/armor_statues/functions/repeat/undo.mcfunction create mode 100644 1_20_3/data/armor_statues/functions/repeat/undo_redo.mcfunction create mode 100644 1_20_3/data/armor_statues/functions/repeat_trigger.mcfunction create mode 100644 1_20_3/data/armor_statues/functions/sealing/seal.mcfunction create mode 100644 1_20_3/data/armor_statues/functions/sealing/unseal.mcfunction create mode 100644 1_20_3/data/armor_statues/functions/second.mcfunction create mode 100644 1_20_3/data/armor_statues/functions/storage_in.mcfunction create mode 100644 1_20_3/data/armor_statues/functions/test.mcfunction create mode 100644 1_20_3/data/armor_statues/functions/trigger.mcfunction create mode 100644 1_20_3/data/armor_statues/functions/trigger/copy.mcfunction create mode 100644 1_20_3/data/armor_statues/functions/trigger/lock.mcfunction create mode 100644 1_20_3/data/armor_statues/functions/trigger/paste.mcfunction create mode 100644 1_20_3/data/armor_statues/functions/trigger/pointing.mcfunction create mode 100644 1_20_3/data/armor_statues/functions/trigger/pointing_small.mcfunction create mode 100644 1_20_3/data/armor_statues/functions/trigger/rack.mcfunction create mode 100644 1_20_3/data/armor_statues/functions/trigger/rack_small.mcfunction create mode 100644 1_20_3/data/armor_statues/functions/trigger/random_pose.mcfunction create mode 100644 1_20_3/data/armor_statues/functions/trigger/settings.mcfunction create mode 100644 1_20_3/data/armor_statues/functions/trigger/slots.mcfunction create mode 100644 1_20_3/data/armor_statues/item_modifiers/storage_out.json create mode 100644 1_20_3/data/armor_statues/loot_tables/book.json create mode 100644 1_20_3/data/armor_statues/loot_tables/book.txt diff --git a/1_20_3/data/armor_statues/functions/3_second.mcfunction b/1_20_3/data/armor_statues/functions/3_second.mcfunction new file mode 100644 index 0000000..3b6793a --- /dev/null +++ b/1_20_3/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:1b} ]}, nbt=!{ArmorItems:[ {Count:1b} ]}, 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=..4] 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=..8] 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_3/data/armor_statues/functions/adjustment_wand_trigger.mcfunction b/1_20_3/data/armor_statues/functions/adjustment_wand_trigger.mcfunction new file mode 100644 index 0000000..cb5045e --- /dev/null +++ b/1_20_3/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 data entity @s Inventory[{id:"minecraft:warped_fungus_on_a_stick", tag:{wand:1} }] run title @s actionbar [{"text":"You already have an Adjustment Wand!","color": "red"}] +execute if data entity @s Inventory[{id:"minecraft:warped_fungus_on_a_stick", tag:{wand:1} }] run scoreboard players set @s adjustment_wand 0 +# Checks if player has an item for wand +execute unless data entity @s[scores={adjustment_wand=1..}] Inventory[{id:"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 data entity @s[scores={adjustment_wand=1..}] Inventory[{id:"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_3/data/armor_statues/functions/admin.mcfunction b/1_20_3/data/armor_statues/functions/admin.mcfunction new file mode 100644 index 0000000..f3d7163 --- /dev/null +++ b/1_20_3/data/armor_statues/functions/admin.mcfunction @@ -0,0 +1,362 @@ +# +# 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: ",\ + "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: ",\ + "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"\ + }\ + }\ + }\ + ] +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