#Commands General
1 messages · Page 10 of 1
Although that would be useful to me, what we are looking for is a way to obtain them in survival, without losing the achievements.
For the latter, we are using a plugin that does not disable achievements, and that allows you to use commands, and that is precisely why I would like to know if there is a way to use the Id, instead of the name, to obtain them with commands
@polar shard
Halo
Hi hi who knows how to
When a player join a function
/function assign tag
Will be randomly assign from 1 of the 10 tag
And after getting assign to that tag you will get a [you are (tag)] message
And after getting that specific tag you will get a specific effect that corresponding the that specific tag
Let's say
I got a tag name runner
It give me speed infinite 1
And weakness infinite 1
And if you die the effect will come back

/scoreboard objectives add effect dummy effect

/execute as @a as @s unless score @s effect matches 0.. unless score @s effect matches ..0 run scoreboard players random @s effect 1 10

/effect @a[scores={effect=1}] speed infinite 100 true

/effect @a[scores={effect=1}] weakness infinite 100 true

/effect @a[scores={effect=2}] fire_resistance infinite 100 true

/effect @a[scores={effect=2}] night_vision infinite 100 true
.....,etc.
Depending on the effect or group of effects you want to give randomly, it would be defined by the scoreboard score.
@quiet cedar
Anyone know how I can tp myself or an entity that's in air to the nearest surface block below them?
/spreadplayers
how can i tp some entity 10 blocks behind me?
/execute at @p run tp @e[name=test] ^^^-10
thx, i had already solved it but thanks for helping
Is it possible to check who mined a random block using command blocks? (With random tool)
there is no direct way but you can guess
by stacking multiple checks u can increase probability of being right
- the block being broken
- the player being nearby
- the broken block being within view range of the player
- the tool having taken damage
some checks are straightforward
some require out of the box thinking
but if u have the option to use scripting api, use that instead of commands
Which would be slower and more laggy prone?
- a mcfunction running every tick with say, about 200ish tag @a[hasitem] commands
- a script that does the same thing but for the single item changed in their inventory and per player
Not sure. That's why we benchmark it!
I would assume the script would be more performant, though, as items changing in the inventory is a relatively infrequent event. And you could add a filter to the subscription, which in theory is more optimal.
Any website or smth that checks the syntax of a bedrock command?
fill ~~~ ~~18~ ps:sigillaria_log
fill ~1~~ ~-1~~ ps:sigillaria_log
fill ~~~1 ~~~-1 ps:sigillaria_log
fill ~1~19~ ~1~20~ ps:sigillaria_log
fill ~-1~19~ ~-1~20~ ps:sigillaria_log
fill ~2~21~ ~2~26~ ps:sigillaria_log
fill ~-2~21~ ~-2~26~ ps:sigillaria_log
fill ~-3~22~ ~-1~26~ ps:sigillaria_leaves replace air
fill ~-2~22~-1 fill ~-2~26~1 ps:sigillaria_leaves replace air
fill ~3~22~ ~1~26~ ps:sigillaria_leaves replace air
fill ~2~22~-1 fill ~2~26~1 ps:sigillaria_leaves replace air
fill ~-3~23~-1 ~-1~23~1 ps:sigillaria_leaves replace air
fill ~3~23~-1 ~1~23~1 ps:sigillaria_leaves replace air
fill ~-3~23~-1 ~-1~25~1 ps:sigillaria_leaves replace air
fill ~3~23~-1 ~1~25~1 ps:sigillaria_leaves replace air
fill ~-2~27~ ~-2~27~ ps:sigillaria_leaves
fill ~2~27~ ~2~27~ ps:sigillaria_leaves
_ _
I got this error message and I don't know what it means
Here is the command
titleraw @a[hasitem={item=sorcerer_craft:basic_combat, location=slot.weapon.mainhand},scores={sneak=0}] actionbar {"rawtext":[{"text":"§fBasic Punch§7[Punch]\§fHeavy Punch§7[Use] §b"},{"score":{"name":"*","objective":"cursed"}},{"text":"/"},{"score":{"name":"*","objective":"cursedMax"}}]}
Bad escape sequence in string
the "escape sequence" refers to the usage of \ usually in trying to create new lines
if you put \ by itself, it thinks you're trying to either create a new line, or basically tell it that a character usually not allowed in a string is considered part of its contents, such as " or \
-# (doing \\ lets you use \ in your string)
this is the error you made in your rawtext
looks like you were trying to create a new line and forget the n after the \
Ah thank you
What are the block states for string that has been stepped on?
Hey guys how can I track the players scoreboard with the command tellraw and show the numbers in the scoreboard??
There's an object in tellraw that you can use with * to make it work:
{"score":{"name":"*","objective":"myObjective"}}
The asterisk will reference the score of the player it's being displayed to
Probably "powered_bit"
Commands][warning]-Error on line 1: command failed to parse with error 'Syntax error: Unexpected "@a": at "xecute at >>@a<<[tag=p_cod"'
execute at @a[tag=p_codes,scores={default_one=10}] run scoreboard players set @a default_one 0
how can i fix this
Check the manifest of the behaviour pack first!
If it's old then you want to use old cmd .
The cmd you are using is new . So you can change the manifest version to latest or use old cmd
@quick falcon
someone told me that already and thanks
What's more performance friendly
-
Running constant commands through tick.json
-
Having entities run the command through an environment_sensor
The second option
Damn its making the game lag
I just use main.mcfunction in tick.json
And inside main I conditionally run all other repeating functions only when they are needed
Could you give me an example as to how I could of that?
Is there a new way or is it still with tags and scoreboards?
Let's say I had a function file, and in this function file, it was the main file for scoreboard timers for abilities.
And then I had it that it would execute as @e at @s positioned ^^^ run function ability_timers . So that means if the entity doesn't have the tag, they shouldn't run the function by default. Am I correct?
tags and scoreboards yes
I suppose
I mainly use score holders as a state system
Example:
main.mcfunction
execute if score map_1 wiki:q.is_active matches 1 run function maps/map_1/on
execute if score map_2 wiki:q.is_active matches 1 run function maps/map_2/on
ㅤ
Ait tnx
Tired animation
-# in game built animation
we don't have /attribute yet right? In stable that is
No /attribute
How do I fix this? The entity (magic circle) runs this command:
execute as @s if entity @e[type=mw:templar_snow,tag=unfriendly] run tp @e[type=!mw:lunar_tug_p1,type=!mw:templar_snow,type=!item,r=12,rm=0.5,family=!spell,tag=!unfriendly] ^0.7 ^0.2 ^0.6 facing @e[type=mw:templar_snow] true
It turns invisible for the pulling part.
Instead of slow pull it just teleports the targets right on the boss
It's 3 am and I can't sleep without getting it right 🥀🥀
Ur using relative coordinates ^^^ which run relative to the execution position
Wherever the command is running, everyone is being teleported ^0.7 ^0.2 ^0.6 of there, not of their own position
What do, remove ?
U don’t remove, u need to add
Do u understand the issue?
I don't think I do, but I will get it, and when I do, hoooo boy.
What do I add :P
Do u understand what the “execution position” refers to?
No exactly
The execution position refers to where the command is running
Yes
Ure teleporting each entity by relative coordinates ^^^, but the command isnt running at everyone’s own position — it’s running at the circle, I think? Hard to tell from that command, there is some missing context
U need to get the position of each target respectively, otherwise ure just teleporting everyone relative to the entity ure currently executing at
Yes, custom circle runs the command via the "execute as @s"
Is this a function?
So I instead execute as @e[everyone else but the boss and circle]?
Inside entity json
Gotcha
U need their position; as doesn’t get their position
There is technically multiple ways u can do this
Okie
It depends on how well u mark when an entity is doing this pulling in attack
Technically, I don't mind whoever gets pulled, it only depends if the entity has the tags friendly/unfriendly
If it has a tag or something, u can just execute as and at everyone, and then teleport them towards the nearest entity doing the pulling in attack — however u dictate that
I use facing for the nearest boss and yeah?
If there isn’t any clear indicators of when ur entity is doing an attack, then instead, ull need to continue to execute as the entity performing the attack which u can reference with @s, but then u need to execute at everyone else, which u can then reference with @n
Yeah in that example
Wuh
I'll just doohickey
Thanks and bye
Makes sense
Nevermind is it this one?
/execute as @e[type=!mw:templar_snow] at @s run tp @s ^^0.1^0.6 facing @e[type=mw:templar_snow] true
This is just teleporting the Templar snow ^^0.1^0.6 of itself
Wuh
But it has the "!"
Meaning anything else but her would be teleported
No errors pop up, but it doesn't work either
I think I got it mixed up. Maybe I should just make any entity near 12 radius run the command.
Execute as @e[r=12,type=!mw:templar_snow,family=!spell,tag=!unfriendly] at @s run tp @s ^0.7^0.1^0.6 facing @e[type=mw:templar_snow] true
It works now
Ah yeah ure right i didnt see that — but then yeah, its anyone but the templars
What did you end up going with? Based on the initial question I would have tried this:
execute if entity @e[type=mw:templar_snow,tag=unfriendly] as @e[type=!mw:lunar_tug_p1,type=!mw:templar_snow,type=!item,r=12,rm=0.5,family=!spell,tag=!unfriendly] at @s facing entity @e[type=mw:templar_snow,c=1] feet run teleport @s ^0.7 ^0.2 ^0.6 true
This is the same issue as his original command; u aren’t getting the position of the people ure teleporting, so they don’t pull, they just instantly teleport
U should combine the facing into the teleport portion also, and u can use @n instead of c=1, but those are both kinda minor
Ah, forgot an at @s
Made it really simple
Execute as @e[r=12,type=!mw:templar_snow,family=!spell,tag=!unfriendly] at @s run tp @s ^0.7^0.1^0.6 facing @e[type=mw:templar_snow] true
Yeah that’s just fine
Anything else that doesn't have the tags get teleported
@n, sure. But I wouldn't remove the /execute facing argument because that changes the behavior; /teleport ... facing applies rotation after, /execute facing applies rotation before
Though it may flunk some projectiles like enderpearls if you try throwing it while the teleportation activates
I understand that’s fair, though I’m not so sure it matters in this scenario
I'd say goodnight to ya'll but it is literally 4:35 am and I don't think I'm getting any sleep
I guess the first tick will be a little different if u apply after
Sooo. Goodmorning ya'll.
Yeah alright that’s fair
With how small the distance is here, likely not.
12 radius, it works well now that I got it right
I mean the distance in which you teleport the mob, which is about 0.92 blocks. If you had a much larger offset, like 10 blocks, then it could noticeably alter where the mob ends up relative to its intended path, and it would be based on its initial rotation on that first tick
Is there a command to detect if an entity has effects?
I remember there being one but for some reason I can't find it
nope
but u can use scoreboard based effects instead of direct /effect command
But if u can use scripts, that would prob be better
Example:
/effect @e[scores={effect.slowness=1..}] slowness infinite 0 true
/scoreboard players remove @e[scores={effect.slowness=1..}] slowness 1
/execute as @e unless entity @s[scores={effect.slowness=1..}] run say I don't have slowness :D
/execute as @e[scores={effect.slowness=1..}] run say I have slowness :(
You can use a pack with player json to give them tags whenever they have an effect
Would we ever get [hasitem={tag=}]? Seems like a stretch and I could really use it for performance
Why for performance
Currently using a million hasitem commands to determine players are netherite or diamond or iron etc. Hasitemtag would let me use minecraft:netherite_tier, as there is already that entity filter in JSON, has_equipment_tag, but it doesn't work for normal inventory slots. Only equipment slots
yeah we will never get that in commands
I'm wondering if i could do a combination of them to reduce the commands I run
commands are basically abandoned, so u shouldnt expect things like that to come any time, id be surprised if they did
Use commands to use json for the equipment slots and if match abandon the rest of the inventory scan
if ure already using add ons, then just use scripts
Since most of the time people will be wearing the armor
there is rarely any reason to use commands if ure using add ons
Scripts are approx 50x slower
for this use case
but they have more optimisation potential
it makes more sense in this sorta context
Oh trust me they don't here 🥀🥲
Using @a selectors in commands seems to be magnitude faster than running an @s function for every player
functions are always faster, u should use them if u can
Well, not seems, I tested it. There's maybe a 5x difference, and it only grows the more players you got
Yeah I'm using mcfunctions
im not that good w scripts, but im pretty sure they have inventory update events now
They don't work for equipment slots, unfortunately
I've thought of that too, it would be so much faster in that case
Cause I'm running my Mcfunction every tick
@hard dawn u can use an execute or gate to test within same command
see:
https://wiki.bedrock.dev/commands/logic-gates
/execute unless entity @p[hasitem=[{item=diamond_sword,quantity=0},{item=iron_sword,quantity=0}]] run <command>- Run the command if the player has either a diamond sword or an iron sword.
I would write one command ask an Ai to generate the rest for me based on the given command
If you use such checks often in ur systems, u can use the check to give them a tag
So for future checks just check for that tag to reduce command length and slightly improve performance
would this even be faster? execute is extremely slow
Is it?
It’s not “extremely” slow, but it does introduce a little overhead in comparison
Extremely slow is rly exaggeratory though
I would have to object
No I mean objective it isn’t that slower
It’s a matter of like 0.000002s or smt
Well, when I was optimizing my MC functions I found that:
tag @a [x=500,dx=100000,y=-150,dy=1000,z=-500,dz=1000] add pvp ran at about 50ms delay when running it N times, and execute as @a at @s run tag @s [x=500,dx=100000] add pvp ran with 300ms delay ran about N times
execute if block is even slower 💀
Definitely not 300ms delay that’s crazy
That’s like 6 ticks
I used a benchmarking tool; execute by itself only introduces about 2,000ns of overhead, and then obv there is a little extra depending on what execute subcommand u use, but it isn’t anything to be concerned about at that scale
Ud need about a hundred thousand of them to even be noticeable in that tick
Well since they're both running from scripts we can safely assume both recieve the same negative effects of scripts being slow
So we can still measure the difference between the commands
U shouldn’t be running commands from scripts anyway generally speaking
Of course not lol
In terms of raw commands, it’s nth to be worried ab, again it’s only 2,000ns overhead, but it also depends on what ure doing as to how much sense that actually makes
Also used it to find that the effect clear command is faster than iterating the effects and doing clearEffect() 😭🥀
why did they remove it it worked fine before 🥀
security or smtn
apparently scoreboard players set @a [tag=netherite,scores={armor=!5}] armor 5 is faster than scoreboard players set @a [tag=netherite] armor 5 🥀
yes
So quick question I'm trying to add pictures to actionbars and when I look at other addon creators functions to see how they did all I see is this
You need a texture pack
https://wiki.bedrock.dev/text/custom-emojis
Its easy
^^
I wouldn't say it's that easy
The learning curve is a matter of if you could be bothered to open a pixel art program and put the emojis in the correct items
Grid spots
execute as @e[tag=sapient] at @s if block ~ ~ ~ wooden_door
How could i make this command look for multiple wooden doors around the entity?
just at its feet or in a radius from the entity?
in a radius
then use this:
its because i have a specifc system here, that if the entity has a door on the same coordinate as it, the door will open
homever i wanted to see how i could make it work if the entity was like 2 blocks away from the door
but ill try to use the execute at block variant
alr it worked, thanks
Im tryna chnage the offset of my command to 2 blocks to the left
But it just starts at the players feet
Im sure there's something im doing wrong?
But cant see it
function ronin/ability/ryoku/use/kansen
Already has an offset of ^^1.2^0.5
this command is executing from the players feet, and 1.5 blocks to the right of their view direction; its working as intended
Thats the thing, its supposed to, but it doesn't execute at ^^1.5^
For some reason when I tried to do /xp -127 it didn't work how am I meant to remove xp?
You must subtract entire levels. @polar cliff
Thanks
How do I make a command that says the health and owner of a specific entitiy?
You can use an ID system with this:
https://wiki.bedrock.dev/commands/comparing-scores#get-matching-scores
But there is no easy way to detect and display entity health with commands alone. You'll need to create a post and give more context about your project
So we can better understand areas where it would be fine to make compromises
I see your bio says you make mods so I suppose it would be better for you to look into add-on based solution.
Guys can someone help me
Tag players who have the blade
tag @a[hasitem={item=gw_weapon:azure_blade}] add convert_me
For each tagged player, clear blades and give ONE new blade
execute as @a[tag=convert_me] run clear @s gw_weapon:azure_blade 0 64
execute as @a[tag=convert_me] run give @s gw_weapon:azure_blade 1 0 {"minecraft:keep_on_death":{}}
Remove tag and clean up
tag @a remove convert_me
kill @e[type=item,name="Azure Blade"]
I was trying to bind the sword like soul binding for the player who use it
But I'm getting this
I'm confused
how do you play the first person attack animation with playanimation command
I have tried it multiple times it just does nothing
/playanimation @s animation.player.first_person.attack_rotation_item animation.player.first_person.attack_rotation_item 900
am I doing something wrong
did you try using the animation controller thingy, that let's you change the value of the variables in an animation in game?
-# it's still in the playanimation command it goes like
playanimation @s animation.first_person.attack_rotation_item x 900 "v.attack_time=1;"
idk if it'll work but you can fiddle with it and try it out
frame by frame animation
-# with command blocks
I'm so confused why your command block UI looks like java but you're using touch screen and you're on phone
Loving this animation, how did you get it to dash forward
Tp?
yup :›
-# texture packs
Cleanest use of tp ive ever seen
is each frame hardcoded?
it looks like it
u should consider looking into how to do math based animations with molang so u dont have to define each frame, just the key frames and motion patterns
i did but there's no literal solution to making a pose go to another pose with ease, since life_time can be buggy even with the eases available in math aren't really that useful, they're mostly useful on looped animations using sine or just query life_time
sort of?
they're variables with changed values, that's why i was able to pose them in game, then make a frame by frame animation of it
u should use a custom variable for handling time instead of q.life_time to get around that
u arent rly limited at all with the kind of math based animations u can make
the way u write animations in molang with commands is essentially the same as how theyre written externally, like in the animation json files
they also work by using molang on the bones
u can technically speaking get the same results as for example animations made in blockbench
actions and stuff for example uses procedural animations with molang
if u make an animation in blockbench, it just eases the two frames together, and u can make a rly similar affect with molang expressions; u should give it a try
something like that is sort of not possible with command blocks well abit is possible it's just there would be alot of typing required to achieve something like that, I've already tried that but the closest i got was to animate in loop
#1460255095630336167 message
here is an example of the kind of system i mean
these are all separate keyframes handled in one animation command (per unique entity)
its kinda rough and incomplete, but u get the idea
holy gwakamoly that was insanely incredibly smooth and awesome
-# teach me how to animate from A to B
this system works by just defining the keyframes, and then lerping between them
first, create a custom variable to handle the runtime:
v.time = (v.time ?? 0) + 1
this would work, but keep in mind molang runs per frame, which varies per player, so the above command would desync for players with different framerates; after one second, a player with 30fps would have a time value of 30, while another with 60fps would have a value of 60
the solution is to integrate delta time
v.time = (v.time ?? 0) + q.delta_time
I see.. but the way you we're able to make it decide when to stop and run is the hardest part I've been trying to figure out
now u have a timer, we can try making a simple lerp
define the start and end values, for example:
v.start_ypos = 0;
v.end_ypos = 16;```
we will need a smoothing variable; i like to use `hermite_blend` here cus its rly smooth:
```js
v.time = (v.time ?? 0) + q.delta_time;
v.smooth_time = math.hermite_blend(v.time);
v.start_ypos = 0;
v.end_ypos = 16;
the hermite blend will return a value between 0-1, where 0 is our start keyframe, and 1 is the end keyframe; it is the progression between frames as a float
we will next pass this value into an interpolation function to actually interpolate between our frames:
v.time = (v.time ?? 0) + q.delta_time;
v.smooth_time = math.hermite_blend(v.time);
v.start_ypos = 0;
v.end_ypos = 16;
v.ypos = math.lerp(v.start_pos, v.end_pos, v.smooth_time);
this is a linear lerp, but other lerps can be used, like squared, for example
custom lerp funcs can also be used
I'VE NEVER THOUGHT OF THAT BEFORE
-# you are amazing man, dis is some wizard knowledge
here is a full example of this system in use that my friend made
he uses the segment variable to define each keyframe with equal distance apart:
// v.t = v.t??0.01;
v.t = q.anim_time;
// 0-1s -> segment 0
// 1-2s -> segment 1
// 2s+ -> segment 2
v.segment = math.min(math.floor(v.t), 2);
v.local_t = v.t - v.segment;
v.smooth_t = math.hermite_blend(v.local_t);
v.segment == 0 ? {
v.start_x = 0;
v.start_y = 0;
v.start_z = 0;
v.end_x = 10;
v.end_y = 5;
v.end_z = 0;
v.start_xrot = 0;
v.start_yrot = 0;
v.start_zrot = 0;
v.end_xrot = 90;
v.end_yrot = 45;
v.end_zrot = 0;
};
v.segment == 1 ? {
v.start_x = 10;
v.start_y = 5;
v.start_z = 0;
v.end_x = 5;
v.end_y = 10;
v.end_z = 5;
v.start_xrot = 90;
v.start_yrot = 45;
v.start_zrot = 0;
v.end_xrot = 180;
v.end_yrot = 0;
v.end_zrot = 90;
};
v.segment > 1 ? {
v.start_x = 5;
v.start_y = 10;
v.start_z = 5;
v.end_x = 15;
v.end_y = 0;
v.end_z = 10;
v.start_xrot = 180;
v.start_yrot = 0;
v.start_zrot = 90;
v.end_xrot = 360;
v.end_yrot = 90;
v.end_zrot = 180;
};
v.xpos = math.lerp(v.start_x, v.end_x, v.smooth_t);
v.ypos = math.lerp(v.start_y, v.end_y, v.smooth_t);
v.zpos = math.lerp(v.start_z, v.end_z, v.smooth_t);
v.xrot = math.lerp(v.start_xrot, v.end_xrot, v.smooth_t);
v.yrot = math.lerp(v.start_yrot, v.end_yrot, v.smooth_t);
v.zrot = math.lerp(v.start_zrot, v.end_zrot, v.smooth_t);
// v.t > 3 ? {v.t = 0;};
// v.t = v.t + 0.001;
v.segment == 1 ? { };
is an example of an if statement in molang syntax; if v.segment is equal to 1, then run the code within; its rly syntactically similar to JavaScript if u have any experience
I will try dis out and see what i can achieve with this reference, I hope I don't make alot of mistakes
depending on ur application depends on what method u should use
in this case, my friend is using equidistant keyframes, so this system works well
u can substitute the v.segment value for if statements using v.time to say at what points in the animation should u run what, which is more suitable for keyframes of varying length; u will have to get a little creative with how u procedurally calculate the local_time though
in my video, i use a slightly different system that works for my application
my system has two handlers; a client sided one, and a server sided one
the client sided handler controls all the animation visuals, and looks pretty similar to the above one, but it uses v.animation_state to control what to run when
v.animation_state is based on an adjacent scoreboard value held on the entity, which is determined by my server sided manager which just uses commands to modify the animation state based on environmental factors; this also is what lets me play sounds and do affects alongside my animation
that was a lot of info to take in, sorry for the big wall of text, there just isnt much easier way to explain it all, lmao
i wish u luck
feel free to ping if u have any questions
I don't mind, it's better to explain it alot then only a little few of it
dis should literally be in bedrock wiki
it would be a good system to document, i agree
another thing i should also mention is a small performance consideration
in the example i provided above, it uses a bunch of consecutive if statements, though, most of the time, u will only ever have one of them running at a time
if that is the case, u should use if-else statements instead just so it stops parsing once it finds ur animation and doesnt waste resources continuing to check the rest of the conditions when u already have found the one u want to run
I gaved up TvT it made the hand turn into a propeller instead...
but here's another frame by frame or you could call cmd by cmd block animation
i was trying to make the hand go from 0 to -90 and that's when it happened
-# maybe it only works for certain thing
u likely made a mistake somewhere
the hermite blend does loop, so the animation may have some funky behaviour if the hermite blend value exceeds 1, which is one thing my friend's system counteracts
Literal magic over here
are these using vanilla animations or custom ones with variables you can easily modify in-game?
Molang looks really daunting, but it’s mostly just math based expressions that make numbers do numbery stuff
But I mean yeah math is basically magic so
Math IS magic...
bingo
-# steve what do you think?
that's very good
I also try to do that for my animation requirements
elematronic ahh animation
i am playing this animation
and it flickers in first person a lot (cause it is playing and stopping) any idea how to stop that? or make it not play in first person
{
"format_version": "1.8.0",
"animations": {
"animation.xxxxx.standing": {
"loop": "hold_on_last_frame",
"animation_length": 0.25,
"override_previous_animation": true,
"bones": {
"body": {
"position": ["0.0 - ((v.is_first_person || !q.is_riding) ? 0.0 : this)", "0.0", "0.0 - ((v.is_first_person || !q.is_riding) ? 0.0 : this)"]
},
"leftarm": {
"rotation": [
"0.0 - ((v.is_first_person || !q.is_riding) ? 0.0 : this)",
"0.0 - ((v.is_first_person || !q.is_riding) ? 0.0 : this)",
"((math.cos(query.life_time * 103.2) * 2.865) + 2.865) * -1.0 - ((v.is_first_person || !q.is_riding) ? 0.0 : this)"
]
},
"rightarm": {
"rotation": [
"0.0 - ((v.is_first_person || !q.is_riding) ? 0.0 : this)",
"0.0 - ((v.is_first_person || !q.is_riding) ? 0.0 : this)",
"(math.cos(query.life_time * 103.2) * 2.865) + 2.865 - ((v.is_first_person || !q.is_riding) ? 0.0 : this)"
]
},
"leftleg": {
"rotation": [
"0.0 - ((v.is_first_person || !q.is_riding) ? 0.0 : this)",
"0.0 - ((v.is_first_person || !q.is_riding) ? 0.0 : this)",
"0.0 - ((v.is_first_person || !q.is_riding) ? 0.0 : this)"
]
},
"rightleg": {
"rotation": [
"0.0 - ((v.is_first_person || !q.is_riding) ? 0.0 : this)",
"0.0 - ((v.is_first_person || !q.is_riding) ? 0.0 : this)",
"0.0 - ((v.is_first_person || !q.is_riding) ? 0.0 : this)"
]
}
}
}
}
}
this isn't specifically command related (could be) but you guys are the most knowledgeable about these kinda of animations
in context this is used to disable riding animation
is this inside player.animation.json?
Make sure you place it at the end, after all other animations
if u r using commands to play the animation:
/playanimation @a animation.xxxxx.standing none 0 "0" xxxxx:standing
it is not, i can't edit vanilla files
I'm guessing this is for marketplace
I dunno how to add custom player animations without conflicts with vanilla ones
That's the only way I know
Maybe you can ask Jean or Felix
They might know a different method
yeah
i reduced the interval and the flickering is good enough
thanks tho
hey folks, can the /testforblocks check for signed books in a barrel??
Testforblocks — or better yet: if blocks — is a direct 1:1 check; it checks for an exact replica
All data must be the same to be a match
many thanks, it seems to be on the tempremental side! using a normal item it works everytime, but if i use a book, thats identical it sometimes matches and sometimes doesnt and i have to empty both barrels and repopulate them again 😕
perhaps the book isnt totally identical
consider that maybe the book is signed with a slightly different name (case sensitivity matters!), or by a different author, or with slightly different contents -- etc.
if any factor or data of the book is different, then it wont be considered a perfect match and it wont pass
My book simply has "1" on the first page. It fails to match if I move the book around the slots in the barrel, which is correct behaviour, but if I put I back to slot 1, it still fails, almost like it remembers it was in other slots in the past. It's odd, but I'll persevere
Like I say it starts off working fine, but somewhere along the line it just fails to match and I have to "reset" each barrel. I am doing a setBlock to replace the target barrel once it matches
How can I use scoreboard command to make a random number generator?
I would rather this than keep triggering randomizers within the entity itself, but I may have to do that instead of commands...
Use the command /scoreboard players random <player: target> <objective: string> <min: int> <max: int> @restive portal
Thanks, I'll try this out
anyone know why this animation isn't playing? /playanimation @e[type=axolotl] animation.axolotl.play_dead
this is possibly unrelated to commands, but i have a fully built world for skyblock, but theres still the flatworld beneath, but i want to get rid of it, ive used scripts to delete it but its a mess, is there a way to transfer it to another world or something?
There's a void world generation. If your world are fully addon-related, you could just do that. If you had builds on the map and can't simply switch, you probably want to open an NBT Editor and edit the world's generation manually.
any nbt editors you can recommend? i have builds on the map so i cant really switch
Is there anyway to prevent spreadplayers from spreading my entity into the deep canals of caves?
Like, if it's above the surface and the distance of the spread is more than 14 blocks wide and tall, it would just.. sink underground
I checked, bedrock doesn't have any way to specifically make it so it targets only surface level areas, or current relative height
Unless if my brain doesn't work rn
Oh, I misread your message, there's some workarounds
Please enlighten me
It depends on the behavior of your entity, what are you using /spreadplayers for?
It's supposed to be an evasion. She'd get a random chance to evade normally (1-3 blocks) or full-on disappear and appear further away (10-14 blocks) the problem is, it already far enough, but she also teleports underground if the space below permits it, thus ruining the flow of the fight
Spreadplayers just overcomplicates it then, you can use the player as a reference point and teleport the entity 10-14 blocks in front of the player or whatever direction (using caret notation)
But terrains 😭
You can set multiple directions
Since it's random, it's not a guarantee anyways
If a player is fighting this entity and there's a mountain behind the player, the entity won't teleport naturally (because of the checkforblocks Boolean)
But if you've set multiple directions for it to teleport, in one of them it'll be successful, otherwise, it'll just look like the player got lucky
It would be a decent amount of commands but it's not really a problem as this triggers randomly + I really doubt you care about performance that much considering you're using commands for this kind of behavior
Or it's a single direction and it just continuously spams it for a period of time until eventually there's space
I meant entity getting stuck in terrain if fought in uneven things
Nah, it's just up to 14 spaces anyway
Maybe 8 blocks away, then if none, 14 blocks away
That's uh, an issue with spreadplayers too
Well yeah
Hey guys,do i can use both tags to share one command like this?
replaceitem entity @s[tag=test1] [tag=test2] slot.armor.head 1 armor:tester
nope, i believe doing this might work, though.
replaceitem entity @s[tag=test1,tag=test2] slot.armor.head 1 armor:tester
Can’t tell if ure asking for an AND or an OR gate; either way, both should be there
What's the selector for a player's gamemode? I don't want creative players targetted by effects from this one entity I have 🙏
m
Yeah I just found it, thanks
Any idea how I can make an entity face the nearest enemy/tagged entity with tp?
I tried this but it didn't work:
/execute as @e[type=vex] at @s run tp @s ^^^ facing @e[type=!vex]
The idea was to keep them in place but their heads would keep facing the nearest entity
/execute as @e[type=vex] at @s anchored eyes run tp @s ^^-0.63^0.36 facing @e[c=1,type=!vex,r=200,type=!player,type=!item]
The command above kinda works but the entity I made for it doesn't cuz the animation isn't related to look at target, so I added that variable so hopefully it works now