Skip to content

Commit d2f1eab

Browse files
committed
play and stop functions now pause all animations
1 parent 08fe66f commit d2f1eab

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/systems/datapackCompiler/1.20.4/animation.mcb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,10 +156,11 @@ IF (!auto_update_rig_orientation) {
156156
dir animations {
157157
REPEAT (animations) as animation {
158158
dir <%animation.storage_name%> {
159-
# TODO: Maybe add an exclusive argument to the play function that will pause all other animations before playing this one.
160159
function play {
161160
debug assert executed_as_root_entity
162161

162+
function *<%export_namespace%>/animations/pause_all
163+
163164
tag @s add <%TAGS.ANIMATION_PLAYING(export_namespace, animation.storage_name)%>
164165
scoreboard players set @s <%OBJECTIVES.FRAME(animation.storage_name)%> 0
165166
tag @s add <%TAGS.TRANSFORMS_ONLY()%>
@@ -170,7 +171,8 @@ dir animations {
170171
function stop {
171172
debug assert executed_as_root_entity
172173

173-
tag @s remove <%TAGS.ANIMATION_PLAYING(export_namespace, animation.storage_name)%>
174+
function *<%export_namespace%>/animations/pause_all
175+
174176
scoreboard players set @s <%OBJECTIVES.FRAME(animation.storage_name)%> 0
175177
tag @s add <%TAGS.TRANSFORMS_ONLY()%>
176178
execute at @s run function ./zzz/set_frame {frame: 0}

0 commit comments

Comments
 (0)