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