#How do I edit someones scoreboard with querys
1 messages · Page 1 of 1 (latest)
https://wiki.bedrock.dev/animation-controllers/animation-controllers-intro.html#bp-animation-controllers-1
https://bedrock.dev/docs/stable/Molang
v.attack time is greater than 0 when using an item, placing a block, or attacking
I do not recommend attempting this with purely commands but there are afk detection systems, as well as ways to detect jumping and crouching that you can find on youtube
I want it so you constantly lose a scoreboard called stamina by running
And each time you punch or jump you lose stamina too
You cannot detect punching with only commands
Yes
I originally was just trying to do it with animation controllers and functions
That is what I am suggesting that you do



Molang is what you use to change states in an animation controller
Transitions use molang queries and statements
I did execute at @a[variable.attack_time=1] run scoreboard players remove @s stamina 25
variable.attack_time is a variable stored by the player, it can only be accessed via molang. Commands are not molang. Animation controllers are used to bridge the gap
Hm
Set v.attack_time as the condition to the transition and !v.attack_time as the transition back to default
This will allow you to run commands only when the player attacks
So use molang to make custom transistion requirements?
Although it will not be perfect, you may want to use timers instead or aswell
If that is how you would like to phrase it, yes
There are examples on the wiki of how to write transitions
There is a logic error, you are not checking that the player has 25 or more stamina before remove 25
You will need to edit the name and link it to the server-side player file
I can make a constant function that will set any players stamina scoreboard to 0 if it is -9999..-1
What is that
Ive never done anything with player.json
Just write /scoreboard players remove @s[scores={stamina=25..}] stamina 25 you could also just set it back to 0 if it dropped below 0 as long as you write it in the on entry below the remove command. This will allow it to deplete to 0 instead of them staying at 24 or whatever they are on. Alternatively, you can set them to 0 in the previous command if they do not have 25 or more stamina
I recommend consulting the wiki, i am not on my pc right now
@tired oar oh ok
So you think I should add a event to the player entity
Its components
And make the on entry run a event
no, just like the controller to the player
no, you link it. Add the controller identifier into the list of animations and run it through the scripts component
Now theres a java like cooldown
@tired oar
Is this why my anims never worked???
The people in bridge never told me this
Ive been trying to get anims work for about a month now
You have not added blank into the scripts
Look at the site i sent you it has an example of how to run a controller
Also a month?? There is so much documentation for beginner devs
There are also vanilla files that you could've looked at although you would've needed to known that server and client side animation controllers are linked in the same way
?
@tired oar
How is it not a valid value
I edited the anim
To be controller.animation.staminadrain
Update
staminadrian in an alias for the controller and needs to be linked to the controller
You have an empty object instead of the controller's identifier
You also have two empty objects inside of the scripts?
Idk why those are there they just appeared
I will try to delete them
K done
Example please
Like do I put the nscp:
In that empty object
Also Ik what you mean by object now
[Molang][error]-My World | /storage/emulated/0/Android/data/com.mojang.minecraftpe/files/games/com.mojang/minecraftWorlds/LpefZCR1AwA=/behavior_packs/Nitro'sSim/animation_controllers/stamina_drain_anim.json | animation_controllers | controller.animation.blank | states | default | transitions | punching | v.attack_time=>0.2 | Error: complex expressions (contains either '=' or ';') must end with a ';'
[Molang][error]-My World | /storage/emulated/0/Android/data/com.mojang.minecraftpe/files/games/com.mojang/minecraftWorlds/LpefZCR1AwA=/behavior_packs/Nitro'sSim/animation_controllers/stamina_drain_anim.json | animation_controllers | controller.animation.blank | states | jumping | transitions | punching | v.attack_time=>0.2 | Error: complex expressions (contains either '=' or ';') must end with a ';'
[Molang][error]-My World | /storage/emulated/0/Android/data/com.mojang.minecraftpe/files/games/com.mojang/minecraftWorlds/LpefZCR1AwA=/behavior_packs/Nitro'sSim/animation_controllers/stamina_drain_anim.json | animation_controllers | controller.animation.blank | states | punching | transitions | default | v.attack_time=<0.2 | Error: complex expressions (contains either '=' or ';') must end with a ';'
[Commands][warning]-Function repeat_function failed to load correctly with error(s):
[Commands][warning]-Error on line 1: command failed to parse with error 'Syntax error: Unexpected ")": at "mina:§e">>)<<,("score":"'
[Commands][warning]-Error on line 2: command failed to parse with error 'Syntax error: Unexpected "}": at "900..1000}>>}<<] speed 9 "'
[Commands][warning]-Function listed in tick.json with name repeat_function not found.
@tired oar