mirror of
https://github.com/LZStealth/armor-statues.git
synced 2025-08-10 08:35:52 +01:00
Initial commit for armor statues
This commit is contained in:
18
data/armor_statues/functions/repeat/save_state.mcfunction
Normal file
18
data/armor_statues/functions/repeat/save_state.mcfunction
Normal file
@@ -0,0 +1,18 @@
|
||||
#
|
||||
# Description: Copies last state for undoing
|
||||
# Called by: as_statue:repeat/save
|
||||
# Entity @s: player
|
||||
#
|
||||
# Checks if UUID of armor stand matches that of the book
|
||||
#
|
||||
scoreboard players set #as_success as_angle 0
|
||||
execute store success score #as_success as_angle run data modify storage customizable_armor_stands:book_storage SavedItem.tag.StatesUUID set from entity @e[type=armor_stand,sort=nearest,limit=1,tag=as_selected] UUID
|
||||
execute if score #as_success as_angle matches 1 run data remove storage customizable_armor_stands:book_storage SavedItem.tag.UndoStates
|
||||
data remove storage customizable_armor_stands:book_storage SavedItem.tag.RedoStates
|
||||
#
|
||||
# Counts undo states and makes sure they're less than the maximum undo states
|
||||
#
|
||||
execute store result score #as_temp as_angle run data get storage customizable_armor_stands:book_storage SavedItem.tag.UndoStates
|
||||
execute if score #as_temp as_angle >= #undo_states as_angle run data remove storage customizable_armor_stands:book_storage SavedItem.tag.UndoStates[-1]
|
||||
#
|
||||
function armor_statues:repeat/save_undo_state
|
Reference in New Issue
Block a user