You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/systems/datapackCompiler/animation.mcb
+5-1Lines changed: 5 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -232,7 +232,9 @@ dir <%export_namespace%> {
232
232
tag @s add <%TAGS.ANIMATION_PLAYING(export_namespace, animation.safe_name)%>
233
233
scoreboard players set @s <%OBJECTIVES.FRAME(animation.safe_name)%> 0
234
234
tag @s add <%TAGS.TRANSFORMS_ONLY()%>
235
+
say pre
235
236
execute at @s run function ./zzz/set_frame {frame: 0}
237
+
say post
236
238
tag @s remove <%TAGS.TRANSFORMS_ONLY()%>
237
239
}
238
240
function stop {
@@ -309,14 +311,14 @@ dir <%export_namespace%> {
309
311
execute if score @s <%OBJECTIVES.TWEEN_DURATION()%> matches 1.. run return 1
310
312
execute if score @s <%OBJECTIVES.TWEEN_DURATION()%> matches 0 on passengers run data modify entity @s interpolation_duration set value <%interpolation_duration%>
311
313
# Animation logic
312
-
execute store result storage aj:temp frame int 1 run scoreboard players get @s <%OBJECTIVES.FRAME(animation.safe_name)%>
313
314
IF (animation.loop_mode === 'loop' && animation.loop_delay === 0) {
314
315
# Makes sure commands in the last frame of the animation is run.
315
316
execute if score @s <%OBJECTIVES.FRAME(animation.safe_name)%> matches -1 run {
316
317
function ./apply_frame {frame: <%animation.duration-1%>}
execute store result storage aj:temp frame int 1 run scoreboard players get @s <%OBJECTIVES.FRAME(animation.safe_name)%>
320
322
function ./apply_frame with storage aj:temp
321
323
IF (animation.loop_mode === 'loop') {
322
324
execute if score @s <%OBJECTIVES.FRAME(animation.safe_name)%> matches <%animation.duration-2 + animation.loop_delay%>.. run return run {
@@ -572,7 +574,9 @@ dir <%export_namespace%> {
572
574
}
573
575
# Attempt to apply the animation frame, if it fails, print an error.
574
576
execute store success score #success <%OBJECTIVES.I()%> run { with storage aj:temp args
577
+
tag @s add <%TAGS.TRANSFORMS_ONLY()%>
575
578
$execute store success score #success <%OBJECTIVES.I()%> run function *<%export_namespace%>/animations/$(animation)/set_frame with storage aj:temp args
579
+
tag @s remove <%TAGS.TRANSFORMS_ONLY()%>
576
580
execute if score #success <%OBJECTIVES.I()%> matches 1 run return 1
0 commit comments