From dafdb83c303815eb2b3e4fd41452c1503fc117b9 Mon Sep 17 00:00:00 2001 From: MSpaceDev Date: Sat, 17 Apr 2021 12:07:53 +0200 Subject: [PATCH] Initial commit for armor statues --- README.md | 35 +- .../advancements/armor_statues.json | 18 + data/armor_statues/advancements/crafting.json | 39 ++ data/armor_statues/advancements/enable.json | 31 ++ data/armor_statues/advancements/root.json | 12 + .../functions/3_second.mcfunction | 12 + data/armor_statues/functions/admin.mcfunction | 26 + .../admin/book_from_help_toggle.mcfunction | 11 + .../admin/craft_book_toggle.mcfunction | 11 + .../admin/fixed_item_frame_toggle.mcfunction | 11 + .../functions/admin/marker.mcfunction | 24 + .../functions/admin/unused.mcfunction | 20 + .../admin/uuid_lock_toggle.mcfunction | 11 + .../functions/animate.mcfunction | 8 + .../functions/animate_time.mcfunction | 8 + .../armor_statues/functions/bugfix.mcfunction | 16 + .../functions/craft_book.mcfunction | 8 + .../armor_statues/functions/enable.mcfunction | 39 ++ data/armor_statues/functions/give.mcfunction | 25 + data/armor_statues/functions/help.mcfunction | 14 + .../help/chat_actionbar_toggle.mcfunction | 11 + .../functions/help/credits.mcfunction | 11 + .../functions/help/get_book.mcfunction | 6 + .../functions/help/main.mcfunction | 14 + .../functions/if_trigger.mcfunction | 38 ++ .../functions/item_frames/fixed.mcfunction | 20 + .../item_frames/invisible.mcfunction | 9 + .../item_frames/invisible_old.mcfunction | 14 + .../functions/item_frames/visible.mcfunction | 7 + data/armor_statues/functions/load.mcfunction | 48 ++ .../functions/locking/lock.mcfunction | 18 + .../functions/locking/lock_check.mcfunction | 7 + .../functions/locking/unlock.mcfunction | 18 + .../functions/locking/uuid_check.mcfunction | 15 + .../functions/randomizer/body.mcfunction | 12 + .../randomizer/body_angle.mcfunction | 31 ++ .../functions/randomizer/head.mcfunction | 12 + .../randomizer/head_angle.mcfunction | 31 ++ .../functions/randomizer/left_arm.mcfunction | 8 + .../functions/randomizer/left_leg.mcfunction | 12 + .../randomizer/left_leg_angle.mcfunction | 37 ++ .../functions/randomizer/right_arm.mcfunction | 8 + .../functions/randomizer/right_leg.mcfunction | 12 + .../randomizer/right_leg_angle.mcfunction | 37 ++ ...relative_position_aligned_nudge.mcfunction | 19 + .../relative_position_nudge.mcfunction | 26 + .../functions/repeat/redo.mcfunction | 21 + .../functions/repeat/save.mcfunction | 14 + .../repeat/save_redo_state.mcfunction | 18 + .../functions/repeat/save_state.mcfunction | 18 + .../repeat/save_undo_state.mcfunction | 18 + .../functions/repeat/undo.mcfunction | 21 + .../functions/repeat/undo_redo.mcfunction | 25 + .../functions/repeat_trigger.mcfunction | 15 + .../functions/replace_book.mcfunction | 11 + .../functions/sealing/seal.mcfunction | 11 + .../functions/sealing/unseal.mcfunction | 11 + .../armor_statues/functions/second.mcfunction | 30 + .../functions/shrine/create.mcfunction | 13 + .../functions/shrine/main.mcfunction | 8 + .../functions/shrine/remove.mcfunction | 13 + .../functions/storage_in.mcfunction | 9 + .../functions/storage_out.mcfunction | 22 + .../functions/storage_out_copy.mcfunction | 22 + data/armor_statues/functions/tick.mcfunction | 21 + .../functions/trigger.mcfunction | 107 ++++ .../functions/trigger/adjust.mcfunction | 121 ++++ .../functions/trigger/align.mcfunction | 28 + .../functions/trigger/align_small.mcfunction | 28 + .../functions/trigger/copy.mcfunction | 21 + .../functions/trigger/facing.mcfunction | 20 + .../functions/trigger/flip.mcfunction | 64 +++ .../functions/trigger/last_edit.mcfunction | 9 + .../functions/trigger/lock.mcfunction | 23 + .../functions/trigger/mirror.mcfunction | 48 ++ .../functions/trigger/paste.mcfunction | 16 + .../functions/trigger/pointing.mcfunction | 77 +++ .../trigger/pointing_small.mcfunction | 77 +++ .../functions/trigger/position.mcfunction | 35 ++ .../trigger/position_relative.mcfunction | 37 ++ .../functions/trigger/presets.mcfunction | 32 ++ .../functions/trigger/rack.mcfunction | 54 ++ .../functions/trigger/rack_small.mcfunction | 54 ++ .../functions/trigger/random_pose.mcfunction | 32 ++ .../functions/trigger/rotation.mcfunction | 21 + .../functions/trigger/settings.mcfunction | 28 + .../functions/trigger/slots.mcfunction | 22 + .../functions/uninstall.mcfunction | 14 + data/armor_statues/loot_tables/book.json | 21 + data/armor_statues/loot_tables/book.txt | 526 ++++++++++++++++++ data/armor_statues/loot_tables/book_old.json | 21 + .../loot_tables/random_pose.json | 201 +++++++ data/armor_statues/loot_tables/replace.json | 35 ++ .../loot_tables/replace_save.json | 50 ++ data/armor_statues/predicates/book.json | 29 + data/armor_statues/predicates/bothhands.json | 16 + .../predicates/item_frame_with_book.json | 17 + .../predicates/mainhand_potion.json | 30 + .../predicates/offhand_potion.json | 30 + .../predicates/random_chance_10.json | 4 + .../predicates/random_chance_15.json | 4 + .../predicates/random_chance_20.json | 4 + .../predicates/random_chance_30.json | 4 + .../predicates/random_chance_40.json | 4 + .../predicates/random_chance_50.json | 4 + .../predicates/random_chance_70.json | 4 + .../predicates/random_chance_85.json | 4 + data/armor_statues/predicates/savedpose.json | 13 + .../predicates/savedpose_mainhand.json | 12 + .../predicates/savedpose_offhand.json | 12 + data/armor_statues/tags/items/potions.json | 7 + data/minecraft/tags/functions/load.json | 7 + data/minecraft/tags/functions/tick.json | 5 + pack.info | 12 + pack.mcmeta | 6 + pack.png | Bin 0 -> 11051 bytes 116 files changed, 3229 insertions(+), 2 deletions(-) create mode 100644 data/armor_statues/advancements/armor_statues.json create mode 100644 data/armor_statues/advancements/crafting.json create mode 100644 data/armor_statues/advancements/enable.json create mode 100644 data/armor_statues/advancements/root.json create mode 100644 data/armor_statues/functions/3_second.mcfunction create mode 100644 data/armor_statues/functions/admin.mcfunction create mode 100644 data/armor_statues/functions/admin/book_from_help_toggle.mcfunction create mode 100644 data/armor_statues/functions/admin/craft_book_toggle.mcfunction create mode 100644 data/armor_statues/functions/admin/fixed_item_frame_toggle.mcfunction create mode 100644 data/armor_statues/functions/admin/marker.mcfunction create mode 100644 data/armor_statues/functions/admin/unused.mcfunction create mode 100644 data/armor_statues/functions/admin/uuid_lock_toggle.mcfunction create mode 100644 data/armor_statues/functions/animate.mcfunction create mode 100644 data/armor_statues/functions/animate_time.mcfunction create mode 100644 data/armor_statues/functions/bugfix.mcfunction create mode 100644 data/armor_statues/functions/craft_book.mcfunction create mode 100644 data/armor_statues/functions/enable.mcfunction create mode 100644 data/armor_statues/functions/give.mcfunction create mode 100644 data/armor_statues/functions/help.mcfunction create mode 100644 data/armor_statues/functions/help/chat_actionbar_toggle.mcfunction create mode 100644 data/armor_statues/functions/help/credits.mcfunction create mode 100644 data/armor_statues/functions/help/get_book.mcfunction create mode 100644 data/armor_statues/functions/help/main.mcfunction create mode 100644 data/armor_statues/functions/if_trigger.mcfunction create mode 100644 data/armor_statues/functions/item_frames/fixed.mcfunction create mode 100644 data/armor_statues/functions/item_frames/invisible.mcfunction create mode 100644 data/armor_statues/functions/item_frames/invisible_old.mcfunction create mode 100644 data/armor_statues/functions/item_frames/visible.mcfunction create mode 100644 data/armor_statues/functions/load.mcfunction create mode 100644 data/armor_statues/functions/locking/lock.mcfunction create mode 100644 data/armor_statues/functions/locking/lock_check.mcfunction create mode 100644 data/armor_statues/functions/locking/unlock.mcfunction create mode 100644 data/armor_statues/functions/locking/uuid_check.mcfunction create mode 100644 data/armor_statues/functions/randomizer/body.mcfunction create mode 100644 data/armor_statues/functions/randomizer/body_angle.mcfunction create mode 100644 data/armor_statues/functions/randomizer/head.mcfunction create mode 100644 data/armor_statues/functions/randomizer/head_angle.mcfunction create mode 100644 data/armor_statues/functions/randomizer/left_arm.mcfunction create mode 100644 data/armor_statues/functions/randomizer/left_leg.mcfunction create mode 100644 data/armor_statues/functions/randomizer/left_leg_angle.mcfunction create mode 100644 data/armor_statues/functions/randomizer/right_arm.mcfunction create mode 100644 data/armor_statues/functions/randomizer/right_leg.mcfunction create mode 100644 data/armor_statues/functions/randomizer/right_leg_angle.mcfunction create mode 100644 data/armor_statues/functions/relative_position_aligned_nudge.mcfunction create mode 100644 data/armor_statues/functions/relative_position_nudge.mcfunction create mode 100644 data/armor_statues/functions/repeat/redo.mcfunction create mode 100644 data/armor_statues/functions/repeat/save.mcfunction create mode 100644 data/armor_statues/functions/repeat/save_redo_state.mcfunction create mode 100644 data/armor_statues/functions/repeat/save_state.mcfunction create mode 100644 data/armor_statues/functions/repeat/save_undo_state.mcfunction create mode 100644 data/armor_statues/functions/repeat/undo.mcfunction create mode 100644 data/armor_statues/functions/repeat/undo_redo.mcfunction create mode 100644 data/armor_statues/functions/repeat_trigger.mcfunction create mode 100644 data/armor_statues/functions/replace_book.mcfunction create mode 100644 data/armor_statues/functions/sealing/seal.mcfunction create mode 100644 data/armor_statues/functions/sealing/unseal.mcfunction create mode 100644 data/armor_statues/functions/second.mcfunction create mode 100644 data/armor_statues/functions/shrine/create.mcfunction create mode 100644 data/armor_statues/functions/shrine/main.mcfunction create mode 100644 data/armor_statues/functions/shrine/remove.mcfunction create mode 100644 data/armor_statues/functions/storage_in.mcfunction create mode 100644 data/armor_statues/functions/storage_out.mcfunction create mode 100644 data/armor_statues/functions/storage_out_copy.mcfunction create mode 100644 data/armor_statues/functions/tick.mcfunction create mode 100644 data/armor_statues/functions/trigger.mcfunction create mode 100644 data/armor_statues/functions/trigger/adjust.mcfunction create mode 100644 data/armor_statues/functions/trigger/align.mcfunction create mode 100644 data/armor_statues/functions/trigger/align_small.mcfunction create mode 100644 data/armor_statues/functions/trigger/copy.mcfunction create mode 100644 data/armor_statues/functions/trigger/facing.mcfunction create mode 100644 data/armor_statues/functions/trigger/flip.mcfunction create mode 100644 data/armor_statues/functions/trigger/last_edit.mcfunction create mode 100644 data/armor_statues/functions/trigger/lock.mcfunction create mode 100644 data/armor_statues/functions/trigger/mirror.mcfunction create mode 100644 data/armor_statues/functions/trigger/paste.mcfunction create mode 100644 data/armor_statues/functions/trigger/pointing.mcfunction create mode 100644 data/armor_statues/functions/trigger/pointing_small.mcfunction create mode 100644 data/armor_statues/functions/trigger/position.mcfunction create mode 100644 data/armor_statues/functions/trigger/position_relative.mcfunction create mode 100644 data/armor_statues/functions/trigger/presets.mcfunction create mode 100644 data/armor_statues/functions/trigger/rack.mcfunction create mode 100644 data/armor_statues/functions/trigger/rack_small.mcfunction create mode 100644 data/armor_statues/functions/trigger/random_pose.mcfunction create mode 100644 data/armor_statues/functions/trigger/rotation.mcfunction create mode 100644 data/armor_statues/functions/trigger/settings.mcfunction create mode 100644 data/armor_statues/functions/trigger/slots.mcfunction create mode 100644 data/armor_statues/functions/uninstall.mcfunction create mode 100644 data/armor_statues/loot_tables/book.json create mode 100644 data/armor_statues/loot_tables/book.txt create mode 100644 data/armor_statues/loot_tables/book_old.json create mode 100644 data/armor_statues/loot_tables/random_pose.json create mode 100644 data/armor_statues/loot_tables/replace.json create mode 100644 data/armor_statues/loot_tables/replace_save.json create mode 100644 data/armor_statues/predicates/book.json create mode 100644 data/armor_statues/predicates/bothhands.json create mode 100644 data/armor_statues/predicates/item_frame_with_book.json create mode 100644 data/armor_statues/predicates/mainhand_potion.json create mode 100644 data/armor_statues/predicates/offhand_potion.json create mode 100644 data/armor_statues/predicates/random_chance_10.json create mode 100644 data/armor_statues/predicates/random_chance_15.json create mode 100644 data/armor_statues/predicates/random_chance_20.json create mode 100644 data/armor_statues/predicates/random_chance_30.json create mode 100644 data/armor_statues/predicates/random_chance_40.json create mode 100644 data/armor_statues/predicates/random_chance_50.json create mode 100644 data/armor_statues/predicates/random_chance_70.json create mode 100644 data/armor_statues/predicates/random_chance_85.json create mode 100644 data/armor_statues/predicates/savedpose.json create mode 100644 data/armor_statues/predicates/savedpose_mainhand.json create mode 100644 data/armor_statues/predicates/savedpose_offhand.json create mode 100644 data/armor_statues/tags/items/potions.json create mode 100644 data/minecraft/tags/functions/load.json create mode 100644 data/minecraft/tags/functions/tick.json create mode 100644 pack.info create mode 100644 pack.mcmeta create mode 100644 pack.png diff --git a/README.md b/README.md index d94c9b6..21c0842 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,33 @@ -# armor-statues -A datapack that makes use of a book with clickable links to modify the settings and pose of armor stands +# Armor Statues +A datapack that allows you to modify the settings and pose of armor stands using a book with clickable links. + +### Everything you should know about this pack + +1. This datapack uses a book of clickable links to modify the settings and pose of armour stands. +2. Once the datapack is installed, use "/trigger as_help" to see how to obtain the book. + (By default this is by clicking a link in the help text but this can be changed in the admin settings.) +3. Admin settings are available using "/function as:admin" command and include: + - Creating and removing a particle shrine for obtaining the book. + - Enabling and disabling a crafting method for obtaining the book. + - Enabling and disabling the link in the help text for obtaining the book. + - Removing unused armour stands; ones that are invisible and do not hold or wear any items. +4. The help text will be amended to show the selected method(s) of obtaining the book +5. The help text also includes options to have notification messages in either the action bar or in chat. + +### Release Notes +#### v2.9.0 BETA 3 +- Added Admin Menu features accessed with /function armor_statues:admin +- Added 'Max Undo States': Sets the maximum number of times the armor statues book can Undo actions. Defaults to 10. +- Added 'Item Frame animation time': Sets the amount of time that item frames can be detected and animate armor stands. (16 is recommended) Defaults to 0. +- Saved books now label if they have a saved pose in their Lore. You can name a saved pose by first naming the Armor Stand. + +- Added a new 'states' system to Armor stand books. These can be found on the first page and include Repeat, Undo, and Redo. +1. Repeat - allows you to perform the same action multiple times. +2. Undo/Redo - allows you to revert multiple actions. The number of times that actions can be undone is based on the Max Undo States. This resets every time a different armor stand is edited. + + +- Added Item Frame Animators. +1. Disabled by default. +2. Allows players to place books(with a saved pose) into item frames to animate armor stands. You can animate them by placing redstone dust in the space with the item frame, then powering it. +3. Animates the nearest armor stand within 8 blocks. +4. Animations won't play unless there's a player within 35 blocks of the item frame. diff --git a/data/armor_statues/advancements/armor_statues.json b/data/armor_statues/advancements/armor_statues.json new file mode 100644 index 0000000..8f4a9d3 --- /dev/null +++ b/data/armor_statues/advancements/armor_statues.json @@ -0,0 +1,18 @@ +{ + "display": { + "icon": { + "item": "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/data/armor_statues/advancements/crafting.json b/data/armor_statues/advancements/crafting.json new file mode 100644 index 0000000..dfe2ad4 --- /dev/null +++ b/data/armor_statues/advancements/crafting.json @@ -0,0 +1,39 @@ +{ + "display": { + "icon": { + "item": "minecraft:armor_stand" + }, + "title": { + "text":"craft_book" + }, + "description": { + "text":"" + }, + "frame": "task", + "show_toast": false, + "announce_to_chat": false, + "hidden": false + }, + "parent": "armor_statues:root", + "criteria": { + "craft_book": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "minecraft:written_book", + "nbt": "{title:\"Statues\"}" + } + ] + } + } + }, + "requirements": [ + [ + "craft_book" + ] + ], + "rewards": { + "function": "armor_statues:craft_book" + } +} \ No newline at end of file diff --git a/data/armor_statues/advancements/enable.json b/data/armor_statues/advancements/enable.json new file mode 100644 index 0000000..6d6add8 --- /dev/null +++ b/data/armor_statues/advancements/enable.json @@ -0,0 +1,31 @@ +{ + "display": { + "icon": { + "item": "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/data/armor_statues/advancements/root.json b/data/armor_statues/advancements/root.json new file mode 100644 index 0000000..78142c5 --- /dev/null +++ b/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/data/armor_statues/functions/3_second.mcfunction b/data/armor_statues/functions/3_second.mcfunction new file mode 100644 index 0000000..4969a2a --- /dev/null +++ b/data/armor_statues/functions/3_second.mcfunction @@ -0,0 +1,12 @@ +# +# 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=item_frame,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=item_frame,tag=as_animatable,predicate=!armor_statues:item_frame_with_book] run tag @s remove as_animatable diff --git a/data/armor_statues/functions/admin.mcfunction b/data/armor_statues/functions/admin.mcfunction new file mode 100644 index 0000000..c54d7f6 --- /dev/null +++ b/data/armor_statues/functions/admin.mcfunction @@ -0,0 +1,26 @@ +# +# 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"}}] +tellraw @s [{"text":"Get book from help: ","color":"aqua"},{"storage":"customizable_armor_stands:settings", "nbt":"as_admin.book_help", "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"}}}] +tellraw @s [{"text":"Craftable book: ","color":"aqua"},{"storage":"customizable_armor_stands:settings", "nbt":"as_admin.book_craft", "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"}}}] +tellraw @s [{"text":"UUID locked Armor Stands: ","color":"aqua"},{"storage":"customizable_armor_stands:settings", "nbt":"as_admin.uuid_lock", "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"}}}] +tellraw @s [{"text":"Enable Item Frame Fixing: ","color":"aqua"},{"storage":"customizable_armor_stands:settings", "nbt":"as_admin.fixed_item_frame", "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"}}}] +# +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