#variable.attack_time not working on attachables?

1 messages · Page 1 of 1 (latest)

simple pike
#

can someone explain why this molang doesnt work?
context.owning_entity -> variable.attack_time > 0

ive read this documentation on where the documentation says that context.owning_entity -> method can be used to access queries form the holder of the attachable

simple pike
#

i used this on my animation controller in the rp side

simple pike
#

okay so i find a way to do it thanks to king

#

so first step you must need a player.json in the rp side

#

then make the variable attack time public like this

#

"scripts": { "variables": { "variable.attack_time": "public" } }

#

second step create a variable in your attachable

#

"pre_animation": [ "variable.a = context.owning_entity->variable.attack_time;" ]

#

you can name it anything you want then you use that variable in your animations controller now

#

"controller.animation.assasin": { "states": { "default": { "animations": [ "first_person_hold" ], "transitions": [ { "attacking": "variable.a > 0" } ] }, "attacking": { "animations": [ "assasin_basic_fps" ] } } }

lilac sleet
#

My mc version is latest (1.21.93)

simple pike
#

i dont know i gave up on this method since it uses player.json but i think this still works on 1.21.93

lilac sleet
#

I made that item beforehand happy ghast release, and it worked.
but it won't work now:(
mojang broke it?

#

I'm sorry. it worked in another world.