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