#Commands General
1 messages · Page 7 of 1
why does this command not work?
/give @a[tag=red] red_wool 512 0 {"minecraft:can_place_on":{"blocks":["concrete","glass","soul_sand","web","stonebrick","oak_sign","polished_andesite_stairs","stone_slab3"]}}
it gives me this error code:
Component 'minecraft:can_place_on' could not be updated.
Could be any one of the block IDs. Make sure they are valid as of the version you are playing.
I believe concrete was flattened? So you may need to list all sixteen colors of concrete individually.
oak_sign can be "standing" or "wall"
hey @rose tusk is it possible for a function to place a command block with a command in it?
like setup function for the raycast would add the scoreboard objective then set a repeating command block with like /function start_ray
It is, if you use a structure. The command block can be placed with /structure
Otherwise no
Fun fact! This is a valid command.
/setblock ~ ~ ~ end_portal_frame ["end_portal_eye_bit"=FalSe]
I believe JSON booleans (true and false) are not case-sensitive, so yeah
it doesn't use json in block states, but yeah they aren't case-sensitive
The quotes are still a weird choice.
It sorta makes sense to differentiate between string/enum states and boolean ones
It's just not what I'm used to. Blockstates don't use quoted keys on Java.
I just found that out this morning writing a command parser :)
fun fact! i will beat you up if you ever type it like that again /s
@rose tusk is it possible to have 2 "factors" in functions, factors being the location of both the command block and the player, for something like a command block following your curser
A command or function can only be running in one location at a time
damnnnn itrtttt
A function can freely change its location, though. Imagine you run the following function from a command block. In command #1, it refers to the command block; in command #2, it refers to the player, and you can change between the two freely by simply not doing execute at @p
setblock ~ ~ ~ air
execute at @p run setblock ~ ~ ~ stone
But in a single command, there aren't "two pairs" of relative coordinates we can use at once
so would it be possible to make a command block
/clone ~~~ ~~~ ~~1~ move
itself to the players cursor
Yea
i forgot some very important text in that question
No; the relative coordinates ~ ~ ~ are either on the command block or the player's cursor, not both
man mojang should just add variables
They did in Java Edition! But that's not useful in Bedrock haha
This is possible in scripting
Here's a repeating function I made that replicates crackers wither storms tractor beam's sucking mobs ability, would it work?:
gamerule commandblockoutput false
execute as @e[type=ender:tractor_beam] at @s unless entity @e[type=ender:attractor] run summon ender:attractor ^0 ^0 ^10
execute as @e[type=ender:tractor_beam] at @s if entity @e[family=!ender,r=64,type=!player] run tp @s ~0 ~0 ~0 facing @e[family=mob,c=1]
execute as @e[type=ender:attractor] at @s run ride @e[r=1,family=!ender,c=1] start_riding @s
execute as @e[type=ender:attractor] at @s unless block ^0 ^0 ^2 air run ride @e[r=1,family=!ender,c=1] stop_riding @s
execute as @e[type=ender:attractor] at @s unless block ^0 ^0 ^1 air run ride @e[r=1,family=!ender,c=1] stop_riding @s
execute as @e[type=ender:attractor] at @s unless block ^0 ^0 ^0 air run ride @e[r=1,family=!ender,c=1] stop_riding @s
execute as @e[type=ender:attractor] at @s if entity @e[family=!ender,r=1] run tag @s[tag=!is_carrying_entity] add is_carrying_entity
execute as @e[type=ender:attractor] at @s unless entity @e[family=!ender,r=1] run tag @s[tag=is_carrying_entity] remove is_carrying_entity
execute as @e[type=ender:tractor_beam] at @s run tp @e[type=ender:attractor,tag=!is_carrying_entity] ^0 ^0 ^1 facing @s
execute as @e[type=ender:tractor_beam] at @s run tp @e[type=ender:attractor,tag=!is_carrying_entity,r=3] ^0 ^0 ^-100 facing @s
execute as @e[type=ender:tractor_beam] at @s run tp @e[type=ender:attractor,tag=is_carrying_entity] ^0 ^0 ^0.1 facing @s
execute as @e[type=ender:tractor_beam] at @s unless entity @e[family=!ender,r=3] run tp @e[type=ender:attractor,tag=is_carrying_entity,r=3] ^0 ^0 ^-100 facing @s
Difficult to tell, give it test yourself and come back with results
How would you do a 360' rotation arround a centre point with /camera
hey I got it working, but I dont seem to have the ability to move the camera?
send/check ur command
Did u put it in a repeating command or send in chat?
nvm i forgot repeating cmd thanks
You can use the same technique above
If you don't want them to be able to rotate and view the player in 360, just a position behind them like third person cam, then you can use this:
/execute as @p [tag=target] at @s run camera @a [tag=spectate] set minecraft:free ease 0.1 linear pos ^^2^-4 facing @s
If you are okay with using experimental, you can look into the new EXP camera presets they've added in the latest update
Thank u so muchh!!!
❤️
I need help, I tried to do this command but I'm confused
i want to remove drops like redstone dusts when the witches die but it doesn't work
So...
I think u got it wrong
I want to make my first person camera follow a mob
Like the DBC lock on
You need to input the name that displays when you hold redstone
redstone_dust doesn't work too
I don't know what DBC lock on is
Im pretty sure it doesnt say "redstone_dust" when you hold it, its most likely gonna be more like "Redstone Dust"
How do I give a tag to a player if they are in between 10 10 10 and 0 0 0. and how do i remove it when they leave those coordinates
it works, thanks
It makes the aim of the player lock on a entity(target)
The camera
Can you show a video
Because if the answers above isn't it, then tbh idk which one you're referring to 😅
OK what a min
@fallow cliff Like that
Oh
aim bot
Try:
/execute as @a [tag=dbc] at @s anchored eyes run camera @s set minecraft:free ease 0.1 linear pos ~~~ facing @p [rm=0.1]
Nahh
OMG
XD
I'm trying to make a lock on to a Naruto add-on
And to a Dragon Ball one too
oh cool!
Ty
/camera @s clear
Try this:
/execute as @a [tag=naruto] at @s anchored eyes facing entity @p [tag=!naruto] eyes positioned as @s positioned ^^^1 rotated as @s positioned ^^^-1 unless entity @s [r=0.2] at @s run tp @s ~~~ facing @p [tag=!naruto]
Not working
Did you add the tag
And is there another player nearby (who doesn't have the tag)
Wait a min
Too much accuracy can sometimes cause the player movement to get stuck in between due to the the tp command
So you can increase the 0.2 as you like
always active
Ok
Leeme try
It is lagging for some reason
That's why I said this:
#1067870225585938444 message
AFAIK: with commands, there isn't a way to control the rotation of the player without /tp
/camera is a thing, but for your case it won't work. Because even if you appear to be looking at the target, your actual player will be looking/hitting somewhere else
Oh
Now i understood
Around 5k
10k+ is possible but with performance issues
Probably somewhere around the same
How do I specify the amount of item removed
/replaceitem entity @p slot.weapon.offhand 0 air
Like doing this it removes the whole stack i only want to remove 1 out of stack
Is there any other alternative?
/replaceitem sets an item to a slot; it only knows that there is an item there, not how much of it there is. Your options are:
- Hardcoding the amount to set based on how many items are already there (e.g.
/execute as @p run replaceitem entity @s[hasitem={location="slot.weapon.offhand",item=stone,quantity=5}] slot.weapon.offhand stone 4) - Using
/clearwith a maxCount of 1. You have no control over which slots this selects. - Using the scripting API to decrement the item stack count.
Guys, is there a way to do a /clear to remove a specific signed book?
No
is there a way to do a "or = | | " operation with commands?
This is /setblock. You probably want /fill:
/fill ~ ~ ~ ~ ~ ~ stone replace air
Or, perform a block test before running /setblock:
/execute if block ~ ~ ~ air run setblock ~ ~ ~ stone
oh I thought it worked with setblock too for some reason, thanks!
thats most likely because /setblock does have a replace, altho its different than fill, in /setblock it determines how placing works, the options are destroy, keep and replace
destroy, destroys the preexisting as if you mined it in survival
keep only places the block if theres air (similar to /fill replace air)
and replace is the default where the preexisting block just gets ignored
ohhhhhhhhhhhhhhhhh
okay that explains everything. thank you!
how do I figure out how many of a specific type of block is in a given area?
(I'm trying to make the color floor microgame from cubecraft)
Many execute if block commands
9216 repeating command blocks, here I come!
That seems very bad to use repeating ones, they'll all be unsynced, consider using chains
Better to use a custom block (or scripts)
Good point
Yeah prob, but I like to use only command blocks/redstone for my projects
100% vanilla
Previously, you could fill-replace your block of choice with cocoa beans. It would pop and you could count the items which would be the same amount as the number of blocks replaced 👀
That behaviour was removed in an older update but you can test to see if it's working now
It's not very performance friendly
But it's alright if it's triggered only every now and then
I’ll lest it
I only have a 32x32 board so it should be fine, but I’ll keep that in mind for future projects
It works!
Actually I’ll use concrete powder since that gives me more options, but thank you for the idea!
Area doesn't matter too much
It's the number of items that drop
More entities = more lag
Not sure if they're as instant. Maybe if they're falling onto strings
What’s the best way to count the items?
Since I want the amount of items to be translated into a scoreboard value
https://bedrockcommands.github.io/commands/entity-counter.html
(bedrock wiki local host draft page)
that means I'd have to hard-code an unfathomable amount of combinations
since I'm detecting for 8 different colors on a 32x32 board
If you explain what you'd like to achieve, we might be able to suggest a better solution
sorry I thought I did but that was a while ago.. anyhow I'm trying to recreate the "color floor" microgame from the cubecraft minigame "minerware". It's basically an exact copy of a hypixle party games microgame: https://www.youtube.com/watch?v=vztGVozk8FI
Rules: 1. players can color their first block anywhere on the map
2. all subsequent painted blocks must be adjacent to other blocks of the same color
3. You cannot color blocks colored by other players
4. whoever colored the most blocks with their color wins
I figured out the painting part but now I just need to determine the amount of blocks that a player painted to determine a winner
Please Subscribe
mc.hypixel.net (1.8~)
Blog: https://blog.naver.com/newyjsk
Instagram: https://instagram.com/newyjsk
(video not by me)
#reset previous scores
/scoreboard players reset * blocks_painted
#get orange color count
/fill xyz xyz cocoa_bean replace wool ["color"="orange"]
/execute as @e [name="Cocoa Beans"] run scoreboard players add @p [tag=orange] blocks_painted 1
/kill @e [name="Cocoa Beans"]
#get green color count
/fill xyz xyz cocoa_bean replace wool ["color"="green"]
/execute as @e [name="Cocoa Beans"] run scoreboard players add @p [tag=green] blocks_painted 1
/kill @e [name="Cocoa Beans"]
#get highest score
/scoreboard players operation most blocks_painted > * blocks_painted
/execute as @a if score @s blocks_painted = most blocks_painted run tag @s add winner
Oh wow that's a really smart method! can I credit you for helping me?
If you want it to be accurate even if the player with most blocks painted leaves mid-game, you can use fake-player-names instead. Or if you prefer, armor stands. Though I would advice avoiding the use of entities as much as possible
No it's ok, I don't need to be credited for small help like this 😅
it should be fine but I'll do that if it become an issue
alrighty then, have a nice day!
cocoa bean method for the win!
any way to disable the updated animation when it breaks using an add-on? I've been told the old method was seamless and the new animation broke it.
what does the gamerule showecipemessages do?
oh, so it doesn't really do anything if recipe unlocking is off?
Not much no it just stops the notifications
A quick question: what's the difference between tickingarea and tickingarea preload? I need to have a whole region loaded when there's any player on it, and unload when there's no player. Would preload do it? Or is using ticking area and manually removing it the best option?
Ticking areas typically load after the world is launched, unless it is marked with "preload". Ticking areas that are marked as preload are loaded before loading other chunks when launching the world.
You can use /execute if entity @a [volume arguments] run
Check if a player is in the area to add/remove a tickingarea there
Got it, thank you, guys!
Is it possible to detect a goathorn being used by a player?
How would I make a command that clears all potion effects in a 15 block radius
With commands, I don't think so. You can ask in #1067869318383157430
You can detect item usage for certain other items (ex: maps) since it changes it's ID / Data Value which can be detected using the hasitem filter. I don't think goat horn changes it's ID or DV
lingering potion particles or player effects?
Here are the commands for both:
/execute positioned xyz run effect @a [r=15] clear/execute positioned xyz run kill @e [type=area_effect_cloud, r=15]- replace xyz with the center coordinate of the area you want.
I wanted the center coordinate to be the player so wouldn't that just mean ~~~
Or you can remove the /execute positioned xyz run part altogether (if you are executing from chat).
No I'm not executing from chat
/execute at @a run effect @a [r=15] clear/execute at @a run kill @e [type=area_effect_cloud, r=15]
I was wondering what I'm supposed to do here. I'm making a lag clearing command system and I'm pretty sure you can do a bunch of kill commands in one command block. I tried doing /kill @e[type=,type=] and so on. But it gives me an error and says duplicate type arguments. I'm not too sure what it means by this I tried a couple of ways and methods I thought it meant but none worked
By default, selector arguments use the AND logic. So the type argument does not accept duplicates because then you are trying to target entities of multiple types. Ex: an entity that is both a pig and a chicken xD
What you need to do is an OR logic:
/execute as @e unless entity @s [type=!pig, type=!chicken] run kill @s
Hope this helps: https://wiki.bedrock.dev/commands/logic-gates
I've heard command blocks cause a lot of lag, but if the host's device is strong enough, will the commands still cause lag for players on low-end devices
(assuming it's not commands that does stuff like spawning hundreds of entities)
Command blocks really dont make a lot of lag, only if its very unoptimisied and you use lag inducing commands
let's say they make a ton of lag, just for the sake of the question
I think it's about the RAM of your device and your WiFi strength
So commands that are more server side will cause less lag (not just commands but the overall experience)
But client side (particles, animations, rendering) will also depend upon the players WiFi
that is a much more detailed answer than I expected to get, thank you!
/execute as @a[hasitem={item=stick,location=slot.hotbar}] run give @s blaze rod
or if you want it to only transform when held: /execute as @a[hasitem={item=stick,location=slot.weapon.mainhand}] run replaceitem entity @s slot.weapon.mainhand 1 blaze_rod
not sure why you deleted your message that I responded to.
if your embarrassed about not knowing a command, don't be. Most players turn on cheats before they even open their inventory.. ever (only 47% of players have the achievement for it). The fact that you have made it to the level where you can do commands is a very impressive feat and isn't something to be taken lightly.
I haven't seen someone being looked down on for not knowing a command on here, I'm not particularly active but still, the fact that I haven't even seen it once says something.
IS there a command to detect How much Damage the player received
You could give the player armor and check thr durability of the armor when they take damage but as far as I know there is no way to directly check hp
No need to check HP Just the Damage sent to the player
/scoreboard objectives add damage minecraft.custom:minecraft.damage_taken
I Will test this
Error
My goal is to make an entity take damage instead of the player.
bedrock only supports the dummy criteria type
So do u know How can i check the Damage that was sent to player?
Ill search about dummys
It could be something improvised np
with commands best way i know of is the thing potages suggested
It could be either way Commands or no commands I just want something that detects the damage lol
If the zombie gives me 3 damage then it will save that damage "3" and I will use the command /damage @e 3
Well then what you can do is check the armor durability, when it drops you can replace the armor again with full durability and run a chain out of that to check what's the closest entity to you (the one that prob damaged you since most mobs in the game have melee attacks) and then for each mob run a certain damage command with their damage but this has flaws such as when fighting a skeleton and a zombie and also just sucks to make
Over all bedrock edition commands at the moment don't really allow for that in practical ways
You are creative it could work but this is very messy
It is
What about scripting? Animation controllers
Idk If theres something to check Damage that other entity sent to the player
I do think scripting allows for that but I never done script so I wouldn't know
I only ever made addons when holiday creator features was a thing
Oh damn nvm i don't want to learn that lol
Does someone know how to detect that someone with sword hitted an entity?
is there a way to show each players person tags on a titleraw?
not with commands. I think you could with scripts tho
Yes
Repeating command block
Execute as @a[hasitem={item=iron_sword,location=slot.weapon.mainhand,data=1}] at @s run replaceitem entity @s slot.weapon.mainhand 0 iron_sword 1 0
And then you can take a chain command output out of that
you can't tell who's being hit tho
This works with iron swords, you can use different swords
He did only say if the player hit an entity, not if an entity was hit by a player, but there is a system if you want to apply an effect to the entity you could just check the nearest entity to you and in your view but this does have some flaws
I suppose I was looking for a perfect solution, but I'll admit I shouldn't have set my expectations so high
Yeah, this is kind of bedrock edition
If you set to check entities on just the block that you are looking at and not your full view that would be solved tho and detect the exact entity you hit but if you're on pocket edition while using the old controls you might struggle a bit
I can think one one method, but it requires a different titleraw for each combination of tags. Would it be unrealistic to convert the tags into scoreboards?
#1280881210268319865
👍
/traslade español
/translate or /traducir if your discord app is on Spanish
Is it true?
#1283455139142963270
@honest owl Please don't cross-post your threat into the general chat.
has bedrock added a command that changes the biome of a specific area yet?
Nope 😭
there are addons that allow you to do it though
I think bedrock world edit can do it
add-ons can do that?
or u mean external app
I thought I remembered seeing some sort of command for bedrock world edit regarding changing the biome. I didn't look into it though, it seemed confusing
hi there, just curious... there is no gamerule to define a limit on the server map like worldboder right? the only way is by placing barriers or the boder block? (I mean without scripting), something that is native?
I think there is
Its like setworldlimit or something im not the best with gamerules =/
let me check
Unfortunately that doesn't exist
Would be cool
Dang
A simple border system is just using RM
No, you mean show the border block effect
Huh?
You're thinking of java
Nahh i don't know a single command in java
/execute as @e[rm=100] at @s run /tp @s ^^^+1 facing 0 100 0
Here's a simple border system I developed
Do you know an addon that adds java commands to bedrock?
Let me know if there are any issues with that
Not sure of something like that existing
😭😭😭
Why +
Why..
^^^1 is normal, ^^^-1 is normal, ^^^+1 is psychopath
XD
I dom't do it i think its also weird but ehh some commanders do it differently ig
Readability
I don't need the slash either for the tp but it helps to have it there
Hey guys how do I detect the nearest entity?
Use @e with a limit of 1. @e[c=1]
That will return up to one entity; @e already sorts by distance.
Thank you very much, kind sir
@verbal oak yo I was told you might be able to assist in some ability creation?
if ur using commands then yeah probably but im busy atm just dm me ig
would anyone else be able to assist as well?
I wanna get input on my ideas as well as find out a way to execute them
=°
huh
Sure
Does anyone else have this problem? When editing the command it stops working
any of yall know how to make a command that summons an entity if there is less than 30 entities detected?
/execute if score @e[type=yourEntity] entityCount matches ..29 run summon yourEntity```
Not quite. That increments the score of all entities found by that selector.
/scoreboard players set entityCount var 0
/execute as @e[type=yourEntity] run scoreboard players add entityCount var 1
/execute if score entityCount var matches ..29 run summon yourEntity
And you can change the requirements in the second command
Ovane
To Do (Open)
Unresolved
most likely happened when they were messing around with this
it's a new bug
I just use needs redstone and lever instead of AA now
How do you summon a mob, and the mob is looking towards the player?
summon <entityType: EntityType> [spawnPos: x y z] facing <lookAtEntity: target> [spawnEvent: string] [nameTag: string]
Example: /summon armor_stand ^^^10 facing @s
I used this but the mob always appears in a fixed direction
Yeah just teleport them again facing the player after they spawn
is there a way to execute unless entity @e[tag=x OR y]?
Its weird like /execute unless entity @e[tag=x,tag=!y] unless entity @e[tag=y,tag=!x] run
I think that works but ¯_(ツ)_/¯
I think so
actully just realised my problem
Like how you can with [scores={Score1=38,Score2=12}]
my problem is i need the 'if' not the unless
but theres lots of combos
for example
execute if entity @e[tag=x] if entity @e[tag=y], but i need to also have the option execute if [tag=x2] if entity @e[tag=y], and then also [tag=x2] if entity tag=y2] but without having to have a line for every different combo of x, x2, y, y2
so ideally i need execute if entity @e[tag=x or x2] if entity @e[tag=y or y2]
whihc is probably impossible
Theres probably an or value somewhere ¯_(ツ)_/¯
i dont think there is. commands just arent built for that sort of stuff
might have reached the end of the line
Dang
Tbh i don't have this issue as i just make double ti commands executing at those with the tag
yeah man, i could do that but when it gets to like 4 options for each if [tag], and theres 4 different if [tag] statements, then its like 64 lines of code
and ive got 100s of them
gets silly
¯_(ツ)_/¯
i might need to utilise some other way of storing data
like items or something
but then is there even a way to check if a containor has 1 item or another
I found out that I was changing the wrong script so it wasn't working xd
Use De Morgan's laws. x OR x2 == !(!x AND !x2)
execute unless entity @e[tag=!x,tag=!x2] unless entity @e[tag=!y,tag=!y2]
jeez okay, this looks promising
I said something along thw lines of that lol
yeah i heard De morgan somewhere
actaully you basically did say that
ive parted ways atm with that method, but thanks as it defineatly could come in handy later
I didn't catch the memo or the right negates but i was definetely on the right track
And people say "X math subject" has no application outside of school 😁
The what?
like any math subject
Boolean algebra in this case
Oh i love booleans
I hate algebra though lol
Some mobs like bats are a bit glitched so they just spawn facing south like 25% of the time
They're not glitched they just handle displaying their rotation differently, for example arrows show their rotation inverted
They are glitched, if you set the bat to tp forward after spawning if it did glitch it would just tp the bat south
Yes since they still try to follow their projectile path, if you constantly tp them to a rotation, you will see that they actually get that rotation, however visually it would look like it has the inverse of its mechanical rotation
if you use a bow and shoot a arrow you'll see the arrow working and looking as intended, the only bad actors here are basically the commands/user, as arrows with projectile logic most likely work different under the hood with rotation and you were never meant to actually set their rotation yourself. so usually arrows can just function normally since the machine pre calculates what rotation the arrow actually should have and gives it the correct rotation
does @e target things in unloaded chunks?
I tried it before with mixed results. sometimes /kill @e got entities in unloaded chunks and other times not
@e cannot select entities in unloaded chunks.
If it appeared to do that, then that means the chunk was loaded.
why doesn't this command work?
/setblock ~ ~ ~ nether_wart [ "age" = 15 ]
it tells me this:
Invalid value for Block State: 'age'
It might of changed
Do the command in chat but look at the [" before you put age it will show every component
all of them are just numbers from 0-15
Like its showing ["15"]?? Or ["age"=15]?
Hold up lemme check it
Strange, report it on the bug tracker ig ¯_(ツ)_/¯
The components in alot of things are jank so just use another No.
nope ["age"=15]
alright will do
Doesn't nether wart only have 4 stages of growth
how come 15
but why would you type 13 if it only goes 0 to 3
Idk like i said components are janky ¯_(ツ)_/¯
There no need to but you can which is the issue
oh really? i'll just change it to 3 then
Why did you try 15? 💀
i just assumed it'd go up to 15 cuz it was the largest option lol
yep
Very useful
Thank Mr. Sean
will definitely be using this a lot thanks
Hi, I'm making a entity that you can ride and fly with but the command is not working in the function can someone help please
malwrath_flying.function
execute as @a[rxm=-90,rx=-25] run effect @e[type=lycanite:malwrath,r=1] levitation 1 6 true
execute as @a[rxm=-25,rx=-15] run effect @e[type=lycanite:malwrath,r=1] levitation 1 3 true
execute as @a[rxm=-15,rx=-5] run effect @e[type=lycanite:malwrath,r=1] levitation 1 2 true
execute as @a[rxm=-5,rx=20] run effect @e[type=lycanite:malwrath,r=1] levitation 1 1 true
execute as @a[rxm=20,rx=35] run effect @e[type=lycanite:malwrath,r=1] slow_falling 1 1 true
execute as @a[rxm=35,rx=90] run effect @e[type=lycanite:malwrath,r=1] clear
@cedar rose You are not running the command at the player's position. Change execute as to execute at
I am assuming you are otherwise not invoking malwrath_flying from another function or command block
That's so complicated
/execute as @e[type=zombie] at @s run /tp @s ^^-0.1^+0.1 true that's for the entity being able to fly
I'm probably missing context but I want to share my command which is my baby since it was the oldest version of my anti kb command 💔
Yes but it's for the entity to fly up and down from where the player is looking
Btw i did try that as to at but still didn't work
I just used effects to fly up and down based on whats in your hand ¯_(ツ)_/¯
Ture but I don't want it to be that way
Its hard to make something along the lines of flying
Maybe make it so when an entity with the lev effect goes above a limit switch it to slow falling then when the block 2 blocks below the entity isn't air turn the slow falling back to levitation
So a sort of bob flying
Why does this dont work?
execute as @e[type=arrow] at @s run teleport ^ ^ ^0.1
It should teleport the way its looking
Worked fine for me ¯_(ツ)_/¯
Try leaving and rejoining
Ig
Tis alittle janky though it only moves 1 way
Similar to minecarts and the likes
I don't believe they have a "rotation"
Let's say you did +0.1 for x cord, it'll just behave weirdly as well
hm
They do have a rotation. It is just negated, and it is based on which way it moves.
I suspect that it's travelling along either +z or -z after several subsequent teleports
How are you seeing hitboxes like that? Isn’t that a java thing?
I’ve heard about those but I can never find them, do you know of any?
ive gotten one before yet i think its only plauer hitboxes the one i got
Oh
Precisely, this image came from Java Edition. Bedrock exhibits the same behavior though
Aw.
there are addons that add em tho
But I do think there’s a bug rn that’s messing with projectile rotation on bedrock
since the beginning of time bro 💀
there is alot more tick breaking though i think Thats a bug
It's not just arrows, minecarts as well, you can't do anything with em
I was disappointed that I couldn't increase the speed of minecarts using tp
boats, minecarts, arrows, fireworks
fireballs
snowballs
the list goes on ¯_(ツ)_/¯
i think there broken ¯_(ツ)_/¯
yes
yes
lmao
What are the use cases for scriptevent commands?
For triggering scripting actions directly from a given entity or block context. The registered callback in the script can then perform actions on the entity/block who performed the /scriptevent command.
It is simply a bridge between scripts and commands
Bees are curses to this world
I was stung like 3 times by bee's as a kid
Omg its the bee movie script 💀💀💀
Im so angry that i just read it then and saw that within two words 💀
Honey isn't even that good dude, give me artificial syrup with 10k different unhealthy doses of chemicals
I remember the worst bee sting that ever happened to me, i was like 12 or something slowly drofting to sleep and bee comes in goes under my shirt stings me on my belly button and it was like a shock of electricity i got up slapped and it was dead then i ran downstairs trembling with a dead bee in hand 💀💀💀
Bee's are suicide stabbers
They don't care that they'll die, how dare you disturb their useless pollination
I was f'n crying so bad and shaking after that bee
To be fair without pollination trees wouldn't survive meaning no oxygen but bees should evolve to not have stingers
Like they don't even use them against there biggest threat the wasp they use a team and suffocate the wasp not sting the wasp the stingers are only there because of us or cosmetics
All components have extras that don't really function properly, such as water depth going from 0 to 7 but having 9 levels
execute at @e[type=(my mob)] run effect @a[r=10] blindness 20 20 true
Can this work?
Mhm
the "as" is unneded since you're not doing anything with the mob and only care about its position, the command shinki suggested works perfectly fine
Java habits where at can only be used on one entity lol. So you gotta use as @e... then at @s.
Bedrock seems to just not care
Yeah bedrock is more flexible with it, it just handles it the same as you it would with "as @a" it just changes a different command context
This is not a limitation that exists in Java Edition.
It's better form, yes, and that applies to both editions.
I have never heard of as @e...
as just takes any selector or player name. In JE it can even take a UUID.
can orbit camera target entities?
you mean follow_orbit ?
last I tested them they weren't very functional
but there's also this article before that came around:
https://bedrockcommands.github.io/commands/orbital-camera.html
i dont like that method cuz it caps at 60 frames
I think you might be able to get more answers for the add-on side of it in #1067869659757543555
can I stick a period inbetween the numbers in a score in a titleraw?
titleraw @s actionbar {"rawtext": [{"text": "§c"}, {"score":{"name": "@s","objective": "testscoreboard"}}]}
Unless you split second number and first number into scoreboards theb you can put it inbetween
For that you'll want to use floor division and modulo division.
Say you have a number with five digits of precision (12345) and you want to display it with the radix after the first number.
- Copy the numbers to two separate scores.
- Divide the number in the first score by 10000. This will return the integral component, 1.
- Perform modulo division on the second score by 10000. This will return the fractional component, 2345.
- Stitch them together into one text component.
# Setup
scoreboard players set "10000" testscoreboard 10000
# Logic
scoreboard players set number testscoreboard 12345
scoreboard players operation integer testscoreboard = number testscoreboard
scoreboard players operation integer testscoreboard /= "10000" testscoreboard
scoreboard players operation fraction testscoreboard = number testscoreboard
scoreboard players operation fraction testscoreboard %= "10000" testscoreboard
titleraw @s actionbar {"rawtext": [{"text": "§c"}, {"score": {"name": "integer", "objective": "testscoreboard"}}, {"text": "."}, {"score": {"name": "fraction", "objective": "testscoreboard"}}]}
I didn't even know scoreboard had operations
My scoreboard only went up to 20 so I just manually decomposed the numbers into 10s and 1s place
I'm regretting not putting this in a thread though, that's really good info
thank you!
bees dont fly. their wings beat in a way that resonates to levitate
Well acktusally it depends what definition of the word "fly" is being used
there are two definitions
- Move through the air using wings
- Move quickly through the air
If it's the second definition, then it's correct
This is the Oxford dictionary, there are multiple definitions for this word but most of them agree simply put it means moving through the air
Damn, I've got stuck in time I didn't even realize that I was going to help someones message 3 months ago, it's actually possible with /tickingarea command
/tickingarea circle ~~~ 4 nickname true/false I hope your 3 months ago guy, found dis helpful lol
I don't see the correlation. That just loads an area of the world.
Also it's possible to do that?
Wait no I'm stupid that's crossed out
yeah and keeps the command block working when your far or anywhere from the chunk
Oh, you misunderstood the conversation then. I was speaking about the relative coordinates inside of a command, like /setblock.
oh
The question was if it were possible to have two sets of (different) relative coordinates in one command, or one function
So like run particle ~~2~ and run particle 30 38 27??
btw, they apparently reverted the execute at change a while ago
Now we can execute at multiple targets again. So in a way we can execute at multiple positions within the same command
What, I thought that was the norm
They had changed /execute at to only select one target? When was that?
And semantically, that is not quite what is happening—you can run multiple instances of a command at different positions. Each individual command can still only execute at one position.
Kinda. Imagine a command as a mathematical function, with a set of coordinates (a point) as an argument. Let's call it f(P), with P being a point.
The discussion is if we can run a command with two sets of relative coordinates, which would be like a function f with two arguments, capable of being two different points, f(P1, P2).
If we denote one relative coordinate set as ~ ~ ~ and another as (let's pretend) × × ×, we could write a command that takes two relative coordinates. e.g.
/fill ~ ~ ~ × × × stone
Where ~ ~ ~ represents, say, the position of one entity, and × × × the position of another. Two entities could dynamically define the two opposing corners to fill a volume
Java Edition has macros, which lets one substitute data directly into a command's arguments.
/function namespace:id {Pos1: [0, 0, 0], Pos2: [1, 1, 1], block: "minecraft:stone"}
$fill $(Pos1[0]) $(Pos1[1]) $(Pos1[2]) $(Pos2[0]) $(Pos2[1]) $(Pos2[2]) $(block)
And this can trivially be extended to use two entities' respective positions
Man ima just do execute as @e at @s to match my java cmds
how can I use testfor to test if any item is in a slot?
Ew testfor?
Execute is wayy better for that
But ehh
/testfor @a[hasitem={item=(item),location=slot.weapon.mainhand}]
well how would you do it? I need something thatll test for armor stands in a specific location
that is holding any item
/execute at @e[type=armor_stand,hasitem={item=(item),location=slot.weapon.mainhand}] run
ah but i need it to check if there is any item, not specific items
im trying to check if the slot is empty
Ah-
or maybe a command that will check if an item is not in that slot?
like a diamond helmet lets say
I mean you can do unless entity @e[type=armor_stand,hasitem=(item),location=slot.weapon.mainhand}] yet i don't think theres a way to track if theres just any old item in the hand
and this would go after the command im trying to use? like:
/replaceitem entity @e [type=armor_stand slot.armor.head 1 grass_block unless entity @e[type=armor_stand,hasitem=(item),location=slot.weapon.mainhand}]
No no like /execute at @e[type=armor_stand] as @s unless entity @s[hasitem={item=(dirt as an example),location=slot.weapon.mainhand}] run /replaceitem entity @s slot.armor.head 1 grass_block
ah that makes more sense
At that though its still only for one specific item its just if its NOT in the hand instead of IS
So yeah 😅😬
right
would it be a long delay to run that test for every equippable item?
if done in one go like with scripts?
I wouldn't know i don't use functions/scripts alot and ngl im losing my knowledge of commands too 🤣
why am i getting the following error when using this command in an mcfunction (it works fine when run in chat):
the command:
execute unless entity @e [type=minecraft:armor_stand,x=~,y=~,z=~,dx=1,dy=1,dz=1,hasitem={item=diamond_helmet,location=slot.armor.head}] run replaceitem entity @e [type=minecraft:armor_stand,x=~,y=~,z=~,dx=1,dy=1,dz=1] slot.armor.head 1 bridge:grass_block_mini_block
the response:
Error on line 1: command failed to parse with error 'Syntax error: Unexpected "entity": at "te unless >>entity<< @e [type="'
What is your manifest min engine version? Try setting it to the version you are playing in.
thank you!
No problem
can you pass variables into .mcfunctions?
You can set a score and read it in the function? What are you trying to achieve?
I'm trying to replace the item in the head slot of an armor stand with what is in the main hand of the player
is that better on performance than opposed to running the command the in the script?
It would take a separate command for every single item in the game to do that, so using a script would be more performant
yeah, only use commands instead of scripts if you only need it for a few items
no it runs fine. I run a long hasitem command in my detect air pack on my github. I do need to update it to 1.21.40 though.
I really do need to update it to script based though.
even, for lets say, 400 items?
If only [hasitem={item=!air}] existed 💀
yea, my command uses every item in game to detect air, runs just fine
Mmm detect air
🇪🇸
How do i use the /loot command
execute if entity @s[hasitem={item=minecraft:cod}] run replaceitem entity @s slot.weapon.mainhand 0 azc:raw_fish_fillet this command is not workin when i interact with my entity
Can you describe your setup more? When you interact with your entity, does it invoke this command? And is the cod consumed in the interaction?
{
"give_item": true,
"take_item": true
},
{
"on_interact": {
"filters": {
"test": "has_equipment",
"subject": "other",
"domain": "any",
"operator": "equals",
"value": "azc:wooden_fillet_knife"
},
"target": "self",
"event": "fillet"
},
"hurt_item": 1
},``` in interactions i have this and on on the event it was this
```json
"fillet": {
"sequence": [
{
"add": {
"component_groups": [
"respawn"
]
},
"queue_command": {
"target": "self",
"command": [
"function fillet"
]
}
}
]
},```
altho i have test function file and was running perfectly like i did say hello and it was executed but that command is not workin
OK, I suspect your function is being run by your entity. Do you need that to run as the player?
nah as entity cuz entity will have cod and other fish items in thier inv
If you simplify the command to be something like execute if entity @s[hasitem={item=minecraft:cod}] run say hello does it print a message in chat?
nope
Are there any errors showing up in your content logger?
while executing this function? nah
I mean during the world load, but if there's no errors then the command should be parsing the command syntax just fine
nah there is nothing about command or entity
So either the entity has no cod in its inventory, or it doesn't have an inventory. Or its some weird Minecraft bug that would require me to recreate your setup to find
Can you use this command instead?
replaceitem entity @s[hasitem={item=minecraft:cod}] slot.weapon.mainhand 0 azc:raw_fish_fillet
if it doesn't work, my guess is that it's that bug where items on some entities just don't show up.
Try it as a chat command
@lofty heath
didn't work :sad:
As a chat command?
both
no selector found
Wait lol my bad it's supposed to be
replaceitem entity @e[type=entity] slot.weapon.mainhand 0 azc:raw_fish_fillet for entity put in the entity ID
i did that also but still no target selector matched
Does your entity even exist bro 😭
wait, in chat that did work
Okay, send the command
well it did work as replaceitem entity @e[type=azc:cutting_board_entity] slot.weapon.mainhand 0 azc:raw_fish_fillet in chat but that hasitem part is not workin
Ok well how does it not work, can you show me the errors? or something like that?
didnt show any error at all but it now need location in hasitem and its workin :pog:
anyways thanks to both i would not have been able to found solution without ya both
Yeah no problem
Normally I tend to use "slot.weapon.mainhand 1" because I got to have that kind of problems
When I put 0 it just did nothing
That's weird tbh, cause that slot is a lone slot so even if you put any numbers it shouldn't matter unlike chest, inventory and hotbar... Probably moyang have a bug they didn't test
Afaik you should always specify the location don't just put the id, I forgot now tbh I was so focused on scripting I forgot how commands work lmao
-# it's already fixed, mybad
It's not necessary to specify the location as just putting hasitem={item=whateveritem}] searches through every single slot you have
But for some reason you need to specify a location? which I'm assuming it's a bug
Probably some weird custom entity behavior which the devs didn't account for
By default just specifying the item should account for every slot
That's what I'm saying it's probably another bug
https://wiki.bedrock.dev/commands/block-entities.html#app
how did he make the entities fly out when it exploded?
I believe he made custom velocity using scoreboards with subtle randomisation
after that how is velocity applied?
He probably applied the same values as what the vanilla tnt would
I think you can get that info from wikis or game files, not sure
does he use tp?
Yeah
it's weird that it looks incredibly smooth
not necessary since you can apply any range that feels right to you
The animations are applied when the tnt explodes so it feels like it's tilting but it's actually just aligning itself
does this work by using decimals or very low values?
in /tp yes
it's the only way to make custom velocity using commands
There's a structure block method but that's like hardcoding the values and requires NBT editor
Thanks a lot ser
Or... he simply made it with Scripts, idk, I don't speak English.
All of Maxed Out creations are Vanilla Commands
But there was def a recreation of it using scripts 👀
it was by MajestikButter
uh for some reason i cant get World from '@minecraft/server'
can anyone help me
oh
wrong chat
💀
I think this is the one for those who are interested in the script method: https://github.com/MajestikButter/Block-Physics
though it's outdated
can we playanimation animationcontroller?
Laggy as hell god damn
Heyas.. I'm trying to run a dialogue command from a script but it tells me that the player does not have permission. How do I do it?
How do I get a string from an Entity that I can use with a command as an ID?
I need to be able to convert it to hexadecimal first in order to use some lua code I've done before...
if you want the entity to have a identifier, best things would be to either give the entity a special tag and then always access it using the tag, or give it a scoreboard value on a objective and always use that to get it
hmm
still wouldn't help anyway because this is failing with a command privilege error: player.runCommand('dialogue open @e[type="utilblocks:droidalphadesign"] @s "ducky_intro"')
Apparenlty, the player does not have permission to run the dialogue command
How can I execute this command from a script?
I can execute it from the console
oh wait.. quotes
nope still the error [Scripting][error]-ReferenceError: Native function [Entity::runCommand] does not have required privileges. at <anonymous> (events.js:586)
i dont use /dialogue much or use scripting, so cant help you with that
Specify the NPC well, since it is a very common error not to specify it, for example adding C=1 or a name, you can also try to execute it in a function
tried all those 😦
oh wait. a function.. how do I execute a function on a player?
I guess these a script issue now
just put your dialogue command in a function and run your /function command in the script
You could also try using player.runCommandAsync
I thikn I did try that
then use the function
and add c=1 to your npc selector
Ahh! I can use the dialogue change command asynchronously!
Its already trying to display a dialogue... Now I just need to be able to switch that on or off
So what are you using now? A function? or scripts
script still
Okay, make sure it doesn't lock them in the dialogue screen
Add a timer of some sort
I'm hoping that's what you're doing
Btw dialogue is really useful
Wrap it in system.run or system.waitTicks()
system.run(()=>{
player.runCommand();
})
//or...
system.waitTicks(1).then(()=>{
player.runCommand();
})
Happens in BeforeEvents. Use #1067535382285135923 channels to ask for more ScriptAPi things
It can achieve the same results as using an actionform
Basically like a gui
It's not difficult at all to use it actually, check out the wiki
Guys.. I'm trying to build a dialogue manually.. bleh
anyway, I can't get it to change scene with a button
What could be wrong?
oh wait... When the scene is changed, the current one closes and fires that event? Dang
I'm turning off the npc component when I do that
nope, even not doing that, doesnt' work
Can you show the command that's being inputted into the npc?
Oh no! I locked up Minecraft and had to Alt+F4
command inputted??
woohoo its working!
I need the open commands too... json: "scenes": [ { "scene_tag": "emdroid_index", "npc_name": "emAlpha Design", "text": "Hello. \nI am here to help.\nWhat do you need information about?", "on_open_commands": [ "/event entity @s utilblocks:makenpc" ], "on_close_commands": [ "/event entity @s utilblocks:maketrade" ], "buttons": [ { "name": "emFrames", "commands": [ "/dialogue open @s @initiator emdroid_frames" ] }, { "name": "emBoards", "commands": [ "/dialogue open @s @initiator emdroid_boards" ] }, { "name": "emActuators", "commands": [ "/dialogue open @s @initiator emdroid_actuators" ] } ] }
So is it fixed?
yep.. I can now use a stick on my entity to switch it into dialogue mode and back out to trade mode which is what you get if you use no or another item
I'm quite happy with the solution because I don't want to mess with anything outside my addon including system_form
Is there a way to detect a pillager captain?
how do i use the loot command to spawn a loot table from my addon
You are looking for /loot spawn <location: xyz> loot <loot_table: string>
/loot spawn 0 100 0 loot "guh"
Guys, is it possible to /summon an entity using a "rawtext" string for it's name? Because I have a world that needs to be localized in different languages, and there's an entity called "Keeper", which I need to change depending on the language. How should I approach that?
On the same note, I have some signed books in this world that are saved as structures and loaded on some areas for the player to pick. I'm using rawtext strings to localize their content, but I realized that the make of the book needs to be localized too. So this is a 2 part questions:
- Being that I've already created those books, is there a way to change their names? (maybe with tools like MCC Tool Chest or something)
- For future projects, is there a way to localize the signed books' names?
If the add-on is for single player only it would work but if it's multiplayer it won't cause the name is server sided mean anyone can see it unless you use third party apps...
It's for single player only
I've this command:
summon pix:human -3996 67 -2034 ~~ pix:skin_31 "Madre de Johan"
The last part as you know is the name, which in this case is a compound name that, in English, is "Johan's Mother"
I have a function that summons all the entities I need for this world in their locations. But since I don't know how to use rawtext to assign their names when summoning, I'm forced to have 2 versions of the same world: one in English and another one in Spanish
Same for the books (the second question)
About this, I'm looking through all the data showed by MCC Tool Chest, but I can't find the written books' info
A better alternative is using a resource pack although you need to ask in #1067869590400544869 for that.
The entity's Name tag is a plain text string. Your best option is to have a separate entity identifier for each human; then you can set a translation for that entity in the language file.
Alternatively, you could try hardcoding the different languages by abusing how commands read translations. An item entity is selectable by its name, and the name given depends on the language set by the server. So you can spawn in an item entity, then spawn in your NPCs with either their English or Spanish names depending on the name of that item.
Here is a crude example:
loot spawn ~ ~ ~ loot "entities/panda_sneeze"
execute if entity @e[type=item,name=Slimeball] run summon pix:human -3996 67 -2034 ~~ pix:skin_31 "Johan's Mother"
execute if entity @e[type=item,name="Bola de limo"] run summon pix:human -3996 67 -2034 ~~ pix:skin_31 "Madre de Johan"
Downsides are that this is not easily extensible, and it's server-authoritative; if an English player hosts the server, his Spanish friend will see English names.
Maybe someone can help me. Here I am running this Command
execute at @e[c=1,type=jio:cc206kaiv9xa] run tp @e[c=1,type=jio:cc206kaiv9xa] ^^^0.00
If run in Minecraft in chat or in command block it works. But if run through function it doesn't work
Make sure your manifest's min_engine_version is at least [1, 19, 50]
Okay, I will try.
This work. Thanks
In this case is for a single player experience. But really, having two separate worlds will be easier, since I have a lot of NPCs
Care to elaborate a bit? So I have the information to ask exactly what I'm looking for
How do I give myself enchanted items in creative mode with a command?
you can apply enchantment books to the item using an anvil
or hold the item in main hand and run the /enchant command
The safest way, which is still not safe, is to save your enchanted item in a structure and load the structure on the player you want to give the item to.
hi ,Does anyone here know professional level commands? I need someone to help me with a command system with only /function
Bienvenido al nuevo canal de comandos. Si tienes alguna pregunta, crea una nueva publicación en este foro. Usa esta publicación para discutir comandos generales.
hello dude kamusta ka?
100% commands? Can you elaborate @dusty nymph
?
Be more specific, I mean. On what your question is
I need someone with command experience, specifically the /scoreboard command, to help me make a player counter
Average 13 year old be like:
Sadly we need to ban you since you have to be 13 years old to join this app let alone this server... Sorry for inconvenience
Nah, go back to sleep lil kid
what is this 💀
There is a better way for it
With commands? that's good! you can share it with us
Yeah if im Home
This is the standard way of counting entities. Only thing I would improve is not using the wild card in the first command; we do not need to be storing a count value of 0 for not only all entities, but all registered score holders.
That unnecessarily inflates the scoreboard data
The reasoning behind it was to avoid the need for an additional command per target. Though, now I'm not sure if using a wild card is better than say using 3-4 extra commands for 3-4 targets lol. But if it's for just one or two, then it's probably best to set those specific scores to 0
Setting scores is cheap. It's always better to specifically use one command for one score
I see
Although I could be inflating the problem; it depends on how Bedrock handles score holders.
hmm
In Java Edition, * selects not just all score holders in a single objective, but all score holders in all objectives.
Yeah, it's same on Bedrock
I find it kinda annoying 😅
So are you sure +1 command per target is better than using the wild card when we need to track several targets? 👀
Because I can update the page
The overhead of the command can't be worse than the overhead of modifying so many score holders
scoreboard players set @a on1 1
scoreboard players set online on2 0
scoreboard players operation online on2 += @a on1
scoreboard players set @a[tag=alive] on1 1
scoreboard players set alive on2 0
scoreboard players operation alive on2 += @a[tag=alive] on1
its not better but i like it more like this idk
That needs two scoreboard objectives?
yeah thats the problem, this is the reason the other commands are better
I mean if you specify a objective it only selects all score holders in that objective, if you leave out the objectivd then its all objectives for all wildcards
oh, no, I meant regardless
At least that's what I recall xD Maybe it's changed? 👀
I mean as far as i remember it was always like that
oh
This is what I tried:
/scoreboard objectives add test dummy
/scoreboard players add * test 0
It seems to add a score of 0 in test to all tracked score holders, even from other objectives
interesting, seems the wildcard has many more interactions, because when using
/scoreboard players reset * test
it only accesses all score holders of test
Ah, this pattern takes me back.
What score value do your players (@a[scores={joined=1..8}]) have in objective "players"? Because the total sum of their scores is set to "total" in objective "players"
If you meant to count the number of those players, replace line 2 with the following:
execute as @a[scores={joined=1..8}] run scoreboard players add total players 1
In this age, though, you need not copy the fake player "total" to the armor stand. You can test its score directly with /execute (if|unless) score (although to do this, you will need to move the command on line 4 to the beginning of the function)
execute if score total players matches 0 run /scoreboard players set "§fPlayers: §a0/8" skywars 17
it doesn't affect the data of other objectives in any way but simply carries over all tracked score holders to the specified objective from other objectives
real! xD
I didn't understand ;-;
@dusty nymph You use a pattern of copying fake player scores (such as total players) to an armor stand to test it. This is not necessary to do anymore, unless you have a good reason for it (such as comparing against other armor stands); you can simply test the score total players directly
Something like this
I pointed this out because selecting those armor stands with @e can be laggier. The server has to do a lookup on entities with @e.
What I described
Just use ScriptAPI to automate it 👆🤓
You darn whippersnappers have no appreciation for The Olden Ways
a
back in my day we had to use multiple conditional command blocks just to invert a true and false statement 👵 /s
oi oi olden ways were the stepping stones to the new stuff
In the new camera command is it possible to make camera like 6 blocks tall player in Minecraft in first person it functions the same as the first person in normal but only 6 blocks high
Try this:
execute as @a at @s run camera @s set minecraft:free ease 0.1 linear pos ~~6~ facing ^^4^
This one will feel like I'm 6 blocks tall in first person?
I believe so. It may not be perfect but give it a shot
Okay thanks
How do I delay a function in Minecraft bedrock
Is it possible to detect if a player is looking at a other player
By command that is
I think cause there is this command that I know that can check wether an entity is facing another entity with feet or eye
I forgot it though
Can I use the play animation command when the animation is on the behavior side
No.
help
"format_version": "1.10.0",
"animation_controllers": {
"controller.animation.scan": {
"states": {
"default": {
"transitions": [
{
"walking": "(1.0)"
}
],
"on_entry": [
"/execute @e[tag=prototype,type=wolf] ~~~ function scan"
"/execute @e[type=zombie_villager] ~~~ function scan"
"/execute @e[type=husk] ~~~ function scan"
]
},
"walking": {
"transitions": [
{
"default": "(1.0)"
}
],
"on_entry": [
"/execute @e[tag=prototype,type=wolf,tag=wolf] ~~~ function scan"
"/execute @e[type=zombie_villager,tag=zombie] ~~~ function scan"
"/execute @e[type=husk,tag=husk] ~~~ function scan"
]
}
}
}
}
}
is this correct?
always send code in codeblock format:
```
insert code here
```
or send it in a file
you can ask in #1067869318383157430
What's the problem btw?
i dunno,im just make sure that im cooking right
Have you tried to see if it works?
The structure of the controller is fine.
How do I only run the command if I have two identical entities?
execute as @e[type=eidolon:tattered_cloth,r=4] run particle eidolon:summon_sign ~ ~3 ~
Thanks
how do i see that?
Just with practice. You are correctly following the format that an animation controller should follow—the controller name is valid, and each of your states are well formed with valid transitions and syntactically correct commands.
thank you
Been trying to recreate the plugin in hermit craft where it changes the weather to a thunderstorm if they threw a Trident at the clouds
But I'm too sleep deprived to see the problem 😂
~192~ —> ~ 192~ (add space)
unless —> if
Generally, it helps readability to add spaces between every coordinate. It is not required on Bedrock but it can be ambiguous
yeah however in this one i believe 192 is supposed to be a standalone coordinate as positoned only has 2 coordinates given currently and it would also make sense since 192 is the sky which this is supposed to test for
That would follow. Still not a reason to write ~ 192~ over ~ 192 ~ IMHO
agreed, having a space after every coordinate should always exist, except when its "~~~" or "^^^"
Yep, this is the format I follow too
I'm sorry but this one is a trigger not having just that one space, omg xD
When you write a number with the ~, Minecraft takes that as one axis instead of two (the ~ being one, and the number being another)
In your mind you might've considered it like so:
x ~
y 192
z ~
But to Minecraft it's:
x ~192
y ~
z not entered
Thank you eveyone it make my heat beat even just for a secon seeing a community help one and
/replaceitem entity @s slot.armor.body 1 iron_chestplate 1 1 {enchantments:[{id:"minecraft:protection",lvl:1}]}
whats wrong with this 😭
You can't put enchantments on items using /replaceitem or /give that's a java thing only
You need to use /enchant
Or do structure command
I've done this before but it's way more complicated than it needs to be
Nah, just use scripts much faster.
I ain't advertising scripts just stating facts
Im more in to doing things in vanilla 😂
Hmm, it's your opinion... Tho it's kinda complicated to export and import structure to your addon just to have pre enchanted item
I normally do it by hand like literally i pre make everything in a structure block and if i want to Auto equip them i just drop them in a dispenser
🤷 still doesn't change the fact you still need to export a structure then import that structure to addon just to have a pre-enchanted item, I already said this twice.
Huh?
It's just preference tbh Soo if it works then it works lmao
Im not exporting the structure in to a addon
Like i said i literally do everything in vanilla by command blocks
If it's an add-on then it's kinda complicated just for that but if it's for a world only then it's good.
Ya
so the only way to enchant someones armor would be through scripts?
I just wanna make it so when they purchase protection if they have any of the permeant armor it gives them prot
Technically you can equip the armor through a dispsenser.
How to execute a command in a specific coordinate? for example /kill @e ~5~~
/kill @e[x=,y=,z=,r=]
r-Radius
You can get more granular with the dx=,dy=,dz arguments too. If you want to kill entities within a 1x1x1 box positioned five blocks East,
/kill @e[x=~5,y=~,z=~,dx=0,dy=0,dz=0]
Or in short: /kill @e[x=~5,dx=0]
Ty
Hey! How can we /load a structure. From a subfolder??
I am trying
/load structure ts/tree/custom ~ ~ ~
But it wont work. I have to move structure, to the root, structures folder, in order to load it. and then i have to use.
/load structure custom ~ ~ ~
also tried
/load structure mystructure:ts/tree/custom and also nothing
I don't think structures use file paths. They just have an identifier
Assuming your structure file is called custom.mcstructure within the structures folder, you can load it by running:
/structure load mystructure:custom ~~~
if its in folders you need " " for so
/load structure "ts/tree/custom" ~ ~ ~
(btw i just saw this was a few days ago
Tyty 🙏
What the hell is the /load command
do you mean /reload or /structure load?
They're saying /load structure
Not at all intended to be confused with /structure load 🙃
Hello all
Question, how can I make a function run once on the first time a world has been created and loaded by a player and then never again?
Use dummy player!
execute unless score DummyWorld world matches 0 run...
scoreboard players set DummyWorld world 0```
Thank y’all 
Would you have any idea why this isn't working?
I activate the behavior pack, load into a new world, and nothing happens. I made sure cheats are enabled.
I don't even get the 'say test' so the on_initialise function doesn't seem to be running at all
- Is the BP being loaded from the development_behavior_packs folder?
- Are there any other BPs on that world which uses tick.json?
Try deleting the BP folder and BP history file from that particular world and reapplying
The problem seems to be with execute if score Initialised world matches 0 run ...(anything)
It runs fine when actually entering the command but if put in a .mcfunction, the function stops working and won't show up for auto-fill or work at all when /function is used manually
I've tested it extensively 
(making a new world with every new version)
Perhaps this is some kind of bug?
I've tried every single command I'm using, including the scoreboard setup commands, running by themselves in a function and they all work perfectly, but the moment execute if score Initialised world matches 0 run is added to anything it fails
ok I figured it out
After literally hours of messing around with this... it turns out wiki.bedrock.dev seems to be just straight up wrong
If I do everything it says but replace Initialised with @p, it just works.... because the command requests some sort of @ everywhere Initialised is instead, causing the command to fail
That is the dumbest thing I've ever spent literal hours trying to figure out lmao
Oh my
that sounds.. painful 🥲
Hmm I see
Not exactly sure what was going wrong for you. Though, the wiki actually isn't wrong. Initialised is a fake player name. You could replace all of it with a different name, say a synonym, it would still work. Scoreboard allows you to create scoreholders using fake player names, not just players / entities 👀
It could be
Because when it was tested / written for the wiki, it was working. Have you tried enclosing it in quotation marks?
/execute if score "Initialised" world matches 0 run <command>
I may know why. You are expecting to see "New world created" when you join, right?
The reason it works with @p is not due to it taking target selectors only, but rather that it will only initialize when @p finds a target that exists.
With the fake player approach, your initialization function succeeds before the client connects to the world. It works, you just cannot see the "new world created" message. I believe I ran into an issue like this once before.
What is the min_engine_version set in your behavior pack manifest?
By the time the client loads in, the on-screen message would've been gone but it'll still be there if you open chat (at least it was for me back when I used it once). Though, they said it didn't work even with the say test command which is independent from the system so I'm not sure..
@pallid linden I got a bug with RealismCraft having to do with the textures on my horses, and other mobs. Horses are invisible other mobs have white streaks it’s the standalone pack. It apparently is struggling to run with other textures like Natural, Rust, and a couple more.
I’d post about it on their server, not here.
guys how do i make the functions work
Does anyone know how I can make the camera look from above?
stills not working
Try:
execute as <target> at @s anchored eyes positioned ^^1^-2 run camera @s set minecraft:free ease 0.1 linear pos ~~~
might need to adjust ^^1^-2
OK so,i have been, Literally ALL DAMN DAY fixing my addon ,and, guess what,the mcfunctions work,buuuuut,the items don't make the mcfunctions work for some reason
i tried everything but the items just ignore the existence of the function
i looked for the scripts
everything
but nothing
the items just ignore the functions
but i also think it's because i am at 1.21.50
what's in the function
does the function itself work?
have you made a post in #1067869136606220288
If the camera is now placed up, however, the camera does not follow me, it remains static.
Are you running it constantly? I mean is it on a loop?
Trying to add color to this particle, if possible how would one do it?
/particle minecraft:splash_spell_particle ~~~
Respond with @ ing me
Dynamically? Or a specific one, make your own particle by copying the file
If dynamically.. You need to use Scripting, (and your particle should have configured rgb variables for it not all vanilla ones have it)
Im new this this stuff so uh, idk?
I just use cmds on mobile and im trying to make a green gas effect on the ground
You shuld make a resourcepack
Can I toggle on/off keepinventory with a command block?
yes with gamerule
Done.
dats what im sayin
also is there a way to run a server animation with commands?
So I have a setup to run a certain command, but it doesn't work. The commands are correct, but they don't do it the way I want.
That's the set up. The commands are all correct and run separately, but when set up they don't work.
Like why wont it work.
yk you could like show us the commands, the command block types, the outputs or anything right
If you truely did everything correctly then: If this is an old world it could be old block tags try replacing them with new ones. If this is from the version where repeating command blocks are bugged then switch the type, exit, then switch it back to repeating
I got it working
figures
I'm trying to get a command to fill and area with fully grown wheat on bedrock edition. How do I do it?
fill <xyz> <xyz> wheat ["growth"=7]
Ty
/execute at @initiator[scores={HoneycombHunt=0}] run /scoreboard players add @initiator HoneycombHunt 1
?
No need to execute
1- at is a position selector and scoreboard working on normal selector as
2- there is no need to use /execute
3- you already selected the entity using selector so you don't need to use 2nd @initiator instead you can use @s
@tidal turret
idk how to fix
Ok use
/execute as @initiator[scores={HoneycomHunt=0}] run scoreboard players add @s HoneycombHunt 1
Or
/scoreboard players add @initiator[scores={HoneycomHunt=0}] HoneycombHunt 1
https://cmdgenerator.netlify.app
Npc shop Website.
(Made in a week)
Noice
Yes
that's really handy, nice work
I didnt expect it to actually work
adish helped me
this command is correct right?
i tried using the command in chat and its saying it cant place blocks outside of the-oh wait...
i forgot im on a flat world
so sad
how many commands can minecraft run per tick?
if its scripts then it should be like 128 ( if ur running them async or smth, idk ) but if its from cmd blocks then i think theres no limit-
i have tried running thousands of cmds at once to lag a person and it kinda immediately froze his gpu thingy ( his gpu were individually filling in the pixels on his screen PER SECOND )
How can I make a command be executed to players of a certain layer?
Example, if a player is on layer 1 it gives them a potion effect but if they go up to layer 2 it no longer gives them anything or any other layer other than the one
I tried with this one but it gives me this effect wherever I am
/execute as @a positioned ~ 50 ~ run effect @s[y=50] wither 10 5
execute as @a at @s positioned ~ 50 ~ run effect @a[x=~50,y=~,z=~50,dx=-25,y=5,dz=-25] wither 10 5
that should work
it just effects everyone in a 50 by 25 by 50 area thats at y 50 at everyone
i cant really explain how it works tho ( am bad at explaining )
or ig
execute at @a run effect @a[y=50,r=5] wither 10 5
would be more simple
It tells me duplicate arguments
And it gives me the effect anywhere
oh
execute as @a at @s positioned ~ 50 ~ run effect @a[x=~50,y=~,z=~50,dx=-25,dy=5,dz=-25] wither 10 5
execute at @a positioned ~ 50 ~ run effect @a[r=5] wither 10 5
IT WORKED! Thank you very much 🫂
np 
Hello, I have a problem running a function. The second line is working fine and the dialogue works as well when I write it as a /command in game but not as a function.
execute if entity @p[tag=neris_1] run dialogue open @e[name=Nariel] @p nariel_2
execute unless entity @p[tag=neris_1] run msg @p You have yet to speak with Neris.
@tawny chasm Is it not opening the dialogue?
The function is not opening the dialogue no. I tried switching the order of the rows still not working. It works as /command. If the (run msg) didn't run at least I could say it is the function. But that part is working so yeah haha...
The scene_1 button starts the function. Maybe it can't close the first scene to open the second using the function inbetween.
i dont have much experience with custom dialogues but i do have some experience with cmds
if your trying to open a dialogue from a npc, then you wouldnt usually need to put in a custom dialogue ( i dont think the last nariel_2 part is necessary )
if your trying to open a custom dialogue, you wouldnt need to open it from a npc either ( i dont think the @e[name=Nariel] part is necessary )
I am using voice acting combined with text so it more about a smooth transition. I use the same npc for a lot of different dialogues depending on tags. But I got it to work now. I added the run dialogue [tag] on close instead of button. Without [name] it won’t target the same npc again. This specific dialogue is like 12 scenes I think. I like to have everything in one text file to keep track.
dayum lmao
guys,how do i make a item lock in inventory of the player on 1.21.20
Use /give or /replace and at the end of the cmd add this component
{”minecraft:item_lock”:{”mode”:”lock_in_inventory”}}
Ho no this server is dedicated for java 💀
Oh shit
{
"values":["<name of .mcfunction>"]
}
But suddenly it slows down my functions?
Because I want for example it to have an animation and then after 2 seconds it has my function which happens
So are you using tick delay on there?
And on bedrock the /schedule doesn't work 😕
Just use score tick delay
I didn't use that thing so it's different for me to give you an ans on that part
Too bad, thanks anyway
I don't think I understand, it's too complicated for me.
this is one way to do it:
▶️ non-ticking, initiating function:
playanimation @a animation.player.attack.rotations
scoreboard players set NextAction timer 40
🔁 ticking function:
execute if score NextAction timer matches 0.. run scoreboard players remove NextAction timer 1
execute if score NextAction timer matches 0 run say This is the next action happening after 2s (40t)
just an example
20 ticks = ~1 second
40 ticks = ~2 seconds
Does it work for bedrock?
Hello, does anyone know how I can create a 10 second countdown with just mcfunction?
Yes
then u can use :)
Actually I'm making a mode and for the attacks I need that first the animation is played then 2 seconds later the function can be activated
▶️ non-ticking, initiating function:
scoreboard players set Countdown timer 200
🔁 ticking function:
execute if score Countdown timer matches 0.. run scoreboard players remove Countdown timer 1
execute if score Countdown timer matches 200 run say 10
execute if score Countdown timer matches 180 run say 9
execute if score Countdown timer matches 160 run say 8
execute if score Countdown timer matches 140 run say 7
execute if score Countdown timer matches 120 run say 6
execute if score Countdown timer matches 100 run say 5
execute if score Countdown timer matches 80 run say 4
execute if score Countdown timer matches 60 run say 3
execute if score Countdown timer matches 40 run say 2
execute if score Countdown timer matches 20 run say 1
execute if score Countdown timer matches 0 run say 0
Does anyone know how to test for 50% of an area if the blocks are broken? With command blocks that is,
I have a problem it tells me "The test of the if score subcommand failed"
@fallow cliff
In fact I managed to get by...
How to despawn an entity when a nearby specific entity dies?
In my example, I need to despawn an entity that follows an illager captain which dies.
How to give a unique tag to the same mob type every time it spawns and how to get the value of that tag?
try using scoreboards instead
scoreboard objectives add ownerIds dummy
scoreboard objectives add ids dummy
scoreboard players random @e[type=custom:entityAttacher,tag=!id] ownerIds -2147483647 2147483647
execute as @e[type=custom:entityAttacher,tag=!id] run summon custom:attachedEntity ~~~
execute as @e[type=custom:entityAttacher,tag=!id] run summon custom:attachedEntity ~~~
execute as @e[type=custom:entityAttacher,tag=!id] at @s as @e[type=custom:attachedEntity,r=0.5,tag=!attached] run scoreboard players operation @s ids = @e[c=1] ownerIds
tag @e[type=custom:entityAttacher] add id
tag @e[type=custom:attachedEntity] add attached
tag @e[type=custom:attachedEntity,tag=attached] remove hasOwner
execute as @e[type=custom:attachedEntity,tag=attached] at @e[type=custom:entityAttacher] if score @s ids = @e[c=1] ownerIds run tag @s add hasOwner
tp @e[tag=custom:entityAttacher,tag=attached,tag=!hasOwner] -29374829292 -29274728292 -2937478392
when a entityAttacher is spawned, it spawns 2 attachedEntity with it, if the entityAttacher dies, the spawned attachedEntities is despawned by teleporting them to a insanely far away area dats prob unloaded
Thanks!
How can I check if a player has died using command blocks?
How can I make a commandblock detect a player standing on top of diamond blocks and send a tellraw saying that I joined the game?
execute as @a at @s if block ~~-1~ diamond_block run tellraw @a {"rawtext":[{"selector":"@s"},{"text":" has joined the game"}]}
Though I think you might find this one to be a better option:
https://wiki.bedrock.dev/commands/on-player-join.html
so thanks
Does anyone know the ticking area command for command blocks working on the whole world
no such command
You can only create up to 10 tickingareas
Each with a max size of 100 chunks
why would you wanna tick the whole world? that would be unplayable
Tickingareas must be used sparingly