#Commands General

1 messages · Page 7 of 1

thick rampart
#

Eww redstone, 2-game tick delay.

topaz venture
fossil sky
#

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.

rose tusk
#

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.

thick rampart
#

oak_sign can be "standing" or "wall"

tribal pewter
#

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

rose tusk
#

It is, if you use a structure. The command block can be placed with /structure

#

Otherwise no

tawdry rover
#

Fun fact! This is a valid command.
/setblock ~ ~ ~ end_portal_frame ["end_portal_eye_bit"=FalSe]

golden hound
tawdry rover
#

it doesn't use json in block states, but yeah they aren't case-sensitive

coarse shore
#

The quotes are still a weird choice.

tawdry rover
#

It sorta makes sense to differentiate between string/enum states and boolean ones

coarse shore
#

It's just not what I'm used to. Blockstates don't use quoted keys on Java.

tawdry rover
#

I just found that out this morning writing a command parser :)

topaz venture
tribal pewter
#

@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

rose tusk
#

A command or function can only be running in one location at a time

tribal pewter
#

damnnnn itrtttt

rose tusk
#

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

tribal pewter
#

so would it be possible to make a command block
/clone ~~~ ~~~ ~~1~ move
itself to the players cursor

rose tusk
#

Yea

tribal pewter
rose tusk
#

No; the relative coordinates ~ ~ ~ are either on the command block or the player's cursor, not both

tribal pewter
#

man mojang should just add variables

rose tusk
#

They did in Java Edition! But that's not useful in Bedrock haha

#

This is possible in scripting

silent tiger
#

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

golden hound
heavy holly
#

How would you do a 360' rotation arround a centre point with /camera

heavy holly
fallow cliff
heavy holly
#

nvm i forgot repeating cmd thanks

opaque kindle
#

How can i make the player camera follow other player?

#

Like a lock on

fallow cliff
# opaque kindle How can i make the player camera follow other player?

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

opaque kindle
#

❤️

limpid crypt
#

I need help, I tried to do this command but I'm confused

opaque kindle
#

I think u got it wrong

#

I want to make my first person camera follow a mob

#

Like the DBC lock on

topaz venture
limpid crypt
fallow cliff
topaz venture
fossil sky
#

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

opaque kindle
#

The camera

fallow cliff
#

Because if the answers above isn't it, then tbh idk which one you're referring to 😅

opaque kindle
#

@fallow cliff Like that

fallow cliff
#

Oh
aim bot

fallow cliff
# opaque kindle

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]
opaque kindle
#

OMG

#

XD

#

I'm trying to make a lock on to a Naruto add-on

#

And to a Dragon Ball one too

fallow cliff
#

oh cool!

opaque kindle
opaque kindle
#

My camera is inside of my head

fallow cliff
#

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]
fallow cliff
fallow cliff
#

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

#

bao_cmd_repeat_unc always active

opaque kindle
#

Leeme try

#

It is lagging for some reason

fallow cliff
#

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

fallow cliff
#

Probably somewhere around the same

bitter dome
#

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?

rose tusk
#

/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 /clear with a maxCount of 1. You have no control over which slots this selects.
  • Using the scripting API to decrement the item stack count.
turbid plaza
#

Guys, is there a way to do a /clear to remove a specific signed book?

mystic apex
#

No

hybrid musk
#

is there a way to do a "or = | | " operation with commands?

south drum
#

did they change how the replace subcommand works or am I tripping

rose tusk
#

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
south drum
#

oh I thought it worked with setblock too for some reason, thanks!

topaz venture
# south drum 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

south drum
south drum
#

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)

gritty musk
#

Many execute if block commands

south drum
#

9216 repeating command blocks, here I come!

topaz venture
fallow cliff
south drum
#

100% vanilla

fallow cliff
#

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 👀

south drum
#

Wait, does that not work anymore?

#

I’lll def use that if it does work

fallow cliff
#

It's not very performance friendly
But it's alright if it's triggered only every now and then

south drum
south drum
#

Actually I’ll use concrete powder since that gives me more options, but thank you for the idea!

fallow cliff
fallow cliff
south drum
#

What’s the best way to count the items?

#

Since I want the amount of items to be translated into a scoreboard value

fallow cliff
south drum
#

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

fallow cliff
south drum
# fallow cliff If you explain what you'd like to achieve, we might be able to suggest a better ...

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

#

(video not by me)

fallow cliff
# south drum sorry I thought I did but that was a while ago.. anyhow I'm trying to recreate t...
#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
south drum
fallow cliff
#

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

fallow cliff
south drum
south drum
jade dirge
#

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.

south drum
#

what does the gamerule showecipemessages do?

turbid stump
#

its the recipe unlock notification for survival

#

thats it

south drum
turbid stump
#

Not much no it just stops the notifications

south drum
#

alright

#

thanks

tardy light
#

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?

thick rampart
#

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.

fallow cliff
#

Check if a player is in the area to add/remove a tickingarea there

tardy light
#

Got it, thank you, guys!

bright stump
#

Is it possible to detect a goathorn being used by a player?

spring edge
#

How would I make a command that clears all potion effects in a 15 block radius

fallow cliff
#

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

fallow cliff
spring edge
#

I wanted the center coordinate to be the player so wouldn't that just mean ~~~

fallow cliff
#

Or you can remove the /execute positioned xyz run part altogether (if you are executing from chat).

spring edge
#

No I'm not executing from chat

fallow cliff
regal flame
#

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

fallow cliff
# regal flame I was wondering what I'm supposed to do here. I'm making a lag clearing command ...

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

south drum
#

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)

topaz venture
south drum
fallow cliff
#

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

south drum
#

that is a much more detailed answer than I expected to get, thank you!

south drum
#

/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

south drum
# south drum `/execute as @a[hasitem={item=stick,location=slot.hotbar}] run give @s 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.

deep zodiac
#

IS there a command to detect How much Damage the player received

upper swift
deep zodiac
#

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.

topaz venture
deep zodiac
#

Ill search about dummys

deep zodiac
topaz venture
deep zodiac
#

If the zombie gives me 3 damage then it will save that damage "3" and I will use the command /damage @e 3

upper swift
#

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

deep zodiac
#

You are creative it could work but this is very messy

upper swift
#

It is

deep zodiac
#

What about scripting? Animation controllers

#

Idk If theres something to check Damage that other entity sent to the player

upper swift
#

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

deep zodiac
#

Oh damn nvm i don't want to learn that lol

sturdy bobcat
#

Does someone know how to detect that someone with sword hitted an entity?

hybrid musk
#

is there a way to show each players person tags on a titleraw?

south drum
upper swift
#

And then you can take a chain command output out of that

south drum
#

you can't tell who's being hit tho

upper swift
#

This works with iron swords, you can use different swords

upper swift
# south drum you can't tell who's being hit tho

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

south drum
upper swift
#

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

south drum
honest owl
#

#1280881210268319865

stoic spruce
#

is there a /damage command

#

and can it be used in an entity event

fallow cliff
stoic spruce
#

👍

lethal juniper
#

/traslade español

south drum
#

I mean

#

that is technically a command

upper swift
#

Yeah

#

He's so much smarter than us

#

We just don't understand his true power

gritty musk
polar shardBOT
#
gegacraft

Is it true?

honest owl
#

#1283455139142963270

rose tusk
#

@honest owl Please don't cross-post your threat into the general chat.

dense herald
#

has bedrock added a command that changes the biome of a specific area yet?

turbid stump
#

Nope 😭

south drum
#

I think bedrock world edit can do it

fallow cliff
south drum
cinder spear
#

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?

turbid stump
#

I think there is

#

Its like setworldlimit or something im not the best with gamerules =/

cinder spear
#

let me check

upper swift
#

Would be cool

turbid stump
#

Dang

upper swift
turbid stump
#

Ohhhh i know what i was thinking of

#

/gamerule showworldborder

upper swift
turbid stump
#

Huh?

upper swift
#

showbordereffect

#

That's the only game rule with the word border in it

turbid stump
#

HUHHH

#

Ain't no way 💀

upper swift
turbid stump
#

Nahh i don't know a single command in java

upper swift
#

Here's a simple border system I developed

turbid stump
#

Do you know an addon that adds java commands to bedrock?

upper swift
#

Let me know if there are any issues with that

upper swift
turbid stump
#

😭😭😭

turbid stump
#

He likes it like that

#

Its weird but yh

upper swift
#

Why..

turbid stump
#

I guess its to say like ~~~ and 1

#

So ~~~1

upper swift
#

^^^1 is normal, ^^^-1 is normal, ^^^+1 is psychopath

turbid stump
#

XD

#

I dom't do it i think its also weird but ehh some commanders do it differently ig

upper swift
#

I don't need the slash either for the tp but it helps to have it there

obsidian falcon
#

Hey guys how do I detect the nearest entity?

rose tusk
#

Use @e with a limit of 1. @e[c=1]

#

That will return up to one entity; @e already sorts by distance.

obsidian falcon
quiet forge
#

@verbal oak yo I was told you might be able to assist in some ability creation?

verbal oak
quiet forge
#

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

turbid stump
#

quiet forge
#

huh

upper swift
quiet forge
#

I'll dm ya

lusty sable
indigo flax
#

any of yall know how to make a command that summons an entity if there is less than 30 entities detected?

lusty sable
#
/execute if score @e[type=yourEntity] entityCount matches ..29 run summon yourEntity```
rose tusk
#

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

graceful canopyBOT
jade dirge
#

most likely happened when they were messing around with this

fallow cliff
#

I just use needs redstone and lever instead of AA now

hoary burrow
#

How do you summon a mob, and the mob is looking towards the player?

fallow cliff
hoary burrow
upper swift
plucky moth
#

is there a way to execute unless entity @e[tag=x OR y]?

turbid stump
#

Its weird like /execute unless entity @e[tag=x,tag=!y] unless entity @e[tag=y,tag=!x] run

#

I think that works but ¯_(ツ)_/¯

plucky moth
#

wait can you stack tags like that?

#

inside a bracket

turbid stump
#

I think so

plucky moth
#

actully just realised my problem

turbid stump
#

Like how you can with [scores={Score1=38,Score2=12}]

plucky moth
#

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

turbid stump
#

Theres probably an or value somewhere ¯_(ツ)_/¯

plucky moth
#

i dont think there is. commands just arent built for that sort of stuff

#

might have reached the end of the line

turbid stump
#

Dang

#

Tbh i don't have this issue as i just make double ti commands executing at those with the tag

plucky moth
#

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

turbid stump
#

¯_(ツ)_/¯

plucky moth
#

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

hoary burrow
# fallow cliff

I found out that I was changing the wrong script so it wasn't working xd

rose tusk
plucky moth
turbid stump
#

I said something along thw lines of that lol

plucky moth
#

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

turbid stump
#

I didn't catch the memo or the right negates but i was definetely on the right track

rose tusk
#

And people say "X math subject" has no application outside of school 😁

turbid stump
#

The what?

plucky moth
#

like any math subject

rose tusk
#

Boolean algebra in this case

turbid stump
#

Oh i love booleans

plucky moth
#

love some boolean algebra

#

eat that for breakfast

turbid stump
#

I hate algebra though lol

upper swift
# fallow cliff

Some mobs like bats are a bit glitched so they just spawn facing south like 25% of the time

topaz venture
#

They're not glitched they just handle displaying their rotation differently, for example arrows show their rotation inverted

upper swift
topaz venture
#

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

topaz venture
#

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

dense herald
#

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

rose tusk
#

@e cannot select entities in unloaded chunks.

#

If it appeared to do that, then that means the chunk was loaded.

fossil sky
#

why doesn't this command work?

/setblock ~ ~ ~ nether_wart [ "age" = 15 ]

it tells me this:

Invalid value for Block State: 'age'

turbid stump
#

It might of changed

#

Do the command in chat but look at the [" before you put age it will show every component

fossil sky
turbid stump
#

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.

fossil sky
fossil sky
fallow cliff
#

how come 15

turbid stump
#

Yeah components are janky

#

Some reason 13 works 💀

#

Yet not 15 ¯_(ツ)_/¯

fallow cliff
#

but why would you type 13 if it only goes 0 to 3

turbid stump
#

Idk like i said components are janky ¯_(ツ)_/¯

#

There no need to but you can which is the issue

fallow cliff
#

ah aight

#

As long as the actual ones work, if shouldn't be much of an issue

fossil sky
turbid stump
#

Why did you try 15? 💀

fossil sky
turbid stump
#

Oh wait it was the highest number displaued

#

Yeah lol

fallow cliff
turbid stump
fallow cliff
#

Thank Mr. Sean

fossil sky
cedar rose
#

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
rose tusk
#

@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

upper swift
#

/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 💔

cedar rose
cedar rose
turbid stump
#

I just used effects to fly up and down based on whats in your hand ¯_(ツ)_/¯

cedar rose
turbid stump
#

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

exotic onyx
turbid stump
#

Its teleporting itself to itself

#

Oh wait the 0.1

#

Hmm

#

Lemme try it rq

exotic onyx
#

It should teleport the way its looking

turbid stump
#

Worked fine for me ¯_(ツ)_/¯

#

Try leaving and rejoining

#

Ig

#

Tis alittle janky though it only moves 1 way

upper swift
#

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

exotic onyx
#

hm

rose tusk
#

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

south drum
turbid stump
#

addons can reveal them maybe thats it ¯_(ツ)_/¯

#

or he's on java ;-;

south drum
#

I’ve heard about those but I can never find them, do you know of any?

turbid stump
#

ive gotten one before yet i think its only plauer hitboxes the one i got

south drum
#

Oh

rose tusk
south drum
#

Aw.

turbid stump
#

there are addons that add em tho

south drum
#

But I do think there’s a bug rn that’s messing with projectile rotation on bedrock

turbid stump
#

since the beginning of time bro 💀

#

there is alot more tick breaking though i think Thats a bug

upper swift
#

I was disappointed that I couldn't increase the speed of minecarts using tp

turbid stump
#

boats, minecarts, arrows, fireworks

#

fireballs

#

snowballs

#

the list goes on ¯_(ツ)_/¯

#

i think there broken ¯_(ツ)_/¯

dense herald
#

can you put emojis or symbols into titleraw?

#

nvm

jade dirge
#

yes

dense herald
#

lmao

ebon kestrel
#

What are the use cases for scriptevent commands?

rose tusk
#

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

upper swift
#

I was stung like 3 times by bee's as a kid

turbid stump
#

Omg its the bee movie script 💀💀💀

#

Im so angry that i just read it then and saw that within two words 💀

upper swift
turbid stump
#

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 💀💀💀

upper swift
#

They don't care that they'll die, how dare you disturb their useless pollination

turbid stump
#

I was f'n crying so bad and shaking after that bee

turbid stump
#

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

turbid stump
#

yeah

#

its so annoying 🤣👺

#

lucky me i don't get that here✨️

upper swift
# fallow cliff how come 15

All components have extras that don't really function properly, such as water depth going from 0 to 7 but having 9 levels

honest owl
#

execute at @e[type=(my mob)] run effect @a[r=10] blindness 20 20 true

turbid stump
#

Mhm

topaz venture
#

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

thick rampart
#

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

topaz venture
rose tusk
#

It's better form, yes, and that applies to both editions.

turbid stump
rose tusk
#

as just takes any selector or player name. In JE it can even take a UUID.

lone abyss
#

can orbit camera target entities?

fallow cliff
lone abyss
#

i dont like that method cuz it caps at 60 frames

fallow cliff
#

I think you might be able to get more answers for the add-on side of it in #1067869659757543555

dense herald
#

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"}}]}

turbid stump
#

{"Text":":"}

#

Or {"text":","}

#

Can't do it in the scoreboard tho

dense herald
#

dang.

#

I wanted a score of 10 to turn into 1.0

turbid stump
#

Unless you split second number and first number into scoreboards theb you can put it inbetween

dense herald
#

I'll see if I can get that working

#

thank you!

rose tusk
#

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"}}]}
turbid stump
#

😱😱😱

#

💀

dense herald
#

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!

storm wraith
upper swift
#

Well acktusally it depends what definition of the word "fly" is being used

#

there are two definitions

  1. Move through the air using wings
  2. 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

silent apex
rose tusk
#

I don't see the correlation. That just loads an area of the world.

upper swift
#

Wait no I'm stupid that's crossed out

silent apex
rose tusk
#

Oh, you misunderstood the conversation then. I was speaking about the relative coordinates inside of a command, like /setblock.

rose tusk
#

The question was if it were possible to have two sets of (different) relative coordinates in one command, or one function

silent apex
#

So in one command, it can run in two different cord?

#

Different coordinates...

turbid stump
#

So like run particle ~~2~ and run particle 30 38 27??

fallow cliff
upper swift
rose tusk
#

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.

rose tusk
# turbid stump So like run particle ~~2~ and run particle 30 38 27??

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

upper swift
#

Man ima just do execute as @e at @s to match my java cmds

zenith current
#

how can I use testfor to test if any item is in a slot?

turbid stump
#

Ew testfor?

#

Execute is wayy better for that

#

But ehh

#

/testfor @a[hasitem={item=(item),location=slot.weapon.mainhand}]

zenith current
#

that is holding any item

turbid stump
#

/execute at @e[type=armor_stand,hasitem={item=(item),location=slot.weapon.mainhand}] run

zenith current
#

ah but i need it to check if there is any item, not specific items

#

im trying to check if the slot is empty

turbid stump
#

Ah-

zenith current
#

like a diamond helmet lets say

turbid stump
#

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

zenith current
turbid stump
#

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

zenith current
#

ah that makes more sense

turbid stump
#

At that though its still only for one specific item its just if its NOT in the hand instead of IS

#

So yeah 😅😬

zenith current
#

right

#

would it be a long delay to run that test for every equippable item?

#

if done in one go like with scripts?

turbid stump
#

I wouldn't know i don't use functions/scripts alot and ngl im losing my knowledge of commands too 🤣

zenith current
#

aha, no worries

#

thank you regardless

zenith current
#

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="'

tawdry rover
zenith current
#

dang

#

what a simple fix

tawdry rover
#

No problem

zenith current
#

can you pass variables into .mcfunctions?

tawdry rover
zenith current
zenith current
shut crater
#

It would take a separate command for every single item in the game to do that, so using a script would be more performant

fallow cliff
#

yeah, only use commands instead of scripts if you only need it for a few items

jade dirge
#

I really do need to update it to script based though.

zenith current
turbid stump
#

If only [hasitem={item=!air}] existed 💀

jade dirge
upper swift
#

Mmm detect air

polar shardBOT
#
moxi28

🇪🇸

gusty shuttle
#

How do i use the /loot command

upper swift
lofty heath
#

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

rose tusk
#

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?

lofty heath
# rose tusk Can you describe your setup more? When you interact with your entity, does it in...
                    {
                        "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

rose tusk
#

OK, I suspect your function is being run by your entity. Do you need that to run as the player?

lofty heath
#

nah as entity cuz entity will have cod and other fish items in thier inv

rose tusk
#

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?

rose tusk
#

Are there any errors showing up in your content logger?

lofty heath
rose tusk
#

I mean during the world load, but if there's no errors then the command should be parsing the command syntax just fine

lofty heath
#

nah there is nothing about command or entity

rose tusk
#

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

lofty heath
#

it does have cod

#

idk if interactWithEntity event is last option

upper swift
# lofty heath it does have cod

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

upper swift
upper swift
lofty heath
#

both

upper swift
#

Or did it say nothing

lofty heath
#

no selector found

upper swift
# lofty heath 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

lofty heath
#

i did that also but still no target selector matched

upper swift
lofty heath
#

wait, in chat that did work

upper swift
lofty heath
upper swift
lofty heath
upper swift
#

Okay

lofty heath
#

anyways thanks to both i would not have been able to found solution without ya both

upper swift
#

Yeah no problem

lusty sable
#

When I put 0 it just did nothing

uncut notch
uncut notch
upper swift
#

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

uncut notch
knotty sluice
fallow cliff
knotty sluice
fallow cliff
#

I think you can get that info from wikis or game files, not sure

knotty sluice
#

does he use tp?

fallow cliff
#

Yeah

knotty sluice
#

it's weird that it looks incredibly smooth

fallow cliff
fallow cliff
knotty sluice
fallow cliff
#

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

knotty sluice
#

Thanks a lot ser

thick rampart
fallow cliff
hollow light
#

uh for some reason i cant get World from '@minecraft/server'

#

can anyone help me

#

oh

#

wrong chat

#

💀

lone abyss
#

can we playanimation animationcontroller?

limpid mauve
#

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...

topaz venture
limpid mauve
#

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)

topaz venture
rough geyser
limpid mauve
#

tried all those 😦

#

oh wait. a function.. how do I execute a function on a player?

#

I guess these a script issue now

rough geyser
rough geyser
limpid mauve
#

I thikn I did try that

rough geyser
#

and add c=1 to your npc selector

limpid mauve
#

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

upper swift
limpid mauve
#

script still

upper swift
#

Add a timer of some sort

#

I'm hoping that's what you're doing

upper swift
thick rampart
upper swift
#

Basically like a gui

#

It's not difficult at all to use it actually, check out the wiki

limpid mauve
#

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

upper swift
limpid mauve
#

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" ] } ] }

upper swift
limpid mauve
#

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

limpid mauve
#

I'm quite happy with the solution because I don't want to mess with anything outside my addon including system_form

bright stump
#

Is there a way to detect a pillager captain?

half sundial
#

how do i use the loot command to spawn a loot table from my addon

rose tusk
#

You are looking for /loot spawn <location: xyz> loot <loot_table: string>

upper swift
turbid plaza
#

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:

  1. 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)
  2. For future projects, is there a way to localize the signed books' names?
uncut notch
turbid plaza
#

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)

turbid plaza
upper swift
rose tusk
#

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.

ionic hound
#

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

rose tusk
#

Make sure your manifest's min_engine_version is at least [1, 19, 50]

ionic hound
#

This work. Thanks

turbid plaza
turbid plaza
limpid mauve
#

How do I give myself enchanted items in creative mode with a command?

fallow cliff
gritty musk
#

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.

dusty nymph
#

hi ,Does anyone here know professional level commands? I need someone to help me with a command system with only /function

polar shardBOT
#
pacogm2345_

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.

polar shardBOT
#
coddy2009

hello dude kamusta ka?

dusty nymph
#

Does anyone know of any 100% commands?

#

commands related to /scoreboard

rose tusk
#

100% commands? Can you elaborate @dusty nymph

dusty nymph
#

?

rose tusk
#

Be more specific, I mean. On what your question is

dusty nymph
#

I need someone with command experience, specifically the /scoreboard command, to help me make a player counter

fallow cliff
uncut notch
#

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

fallow cliff
#

what is this 💀

lament beacon
fallow cliff
lament beacon
#

Yeah if im Home

rose tusk
#

That unnecessarily inflates the scoreboard data

fallow cliff
rose tusk
#

Setting scores is cheap. It's always better to specifically use one command for one score

fallow cliff
#

I see

rose tusk
#

Although I could be inflating the problem; it depends on how Bedrock handles score holders.

fallow cliff
#

hmm

rose tusk
#

In Java Edition, * selects not just all score holders in a single objective, but all score holders in all objectives.

fallow cliff
#

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

rose tusk
#

The overhead of the command can't be worse than the overhead of modifying so many score holders

lament beacon
# fallow cliff With commands? that's good! you can share it with us
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

rose tusk
#

That needs two scoreboard objectives?

lament beacon
#

yeah thats the problem, this is the reason the other commands are better

topaz venture
fallow cliff
topaz venture
fallow cliff
#

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

topaz venture
dusty nymph
#

Can someone help me on how I can make this work?

#

player counter

rose tusk
#

Ah, this pattern takes me back.

rose tusk
# dusty nymph

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
fallow cliff
fallow cliff
rose tusk
#

@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.

dusty nymph
#

hmm

#

So what would be the best option?

rose tusk
#

What I described

thick rampart
rose tusk
#

You darn whippersnappers have no appreciation for The Olden Ways

topaz venture
fallow cliff
#

oi oi olden ways were the stepping stones to the new stuff

zealous rain
#

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

golden hound
zealous rain
golden hound
zealous rain
zealous rain
#

How do I delay a function in Minecraft bedrock

bright stump
#

Is it possible to detect if a player is looking at a other player

#

By command that is

zealous rain
jade dirge
jade dirge
zealous rain
#

Can I use the play animation command when the animation is on the behavior side

quick falcon
#

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?

fallow cliff
quick falcon
#

what.

#

there is it

fallow cliff
#

you can ask in #1067869318383157430

quick falcon
topaz venture
rose tusk
#

The structure of the controller is fine.

dusky badger
#

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 ~
fallow cliff
quick falcon
rose tusk
#

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.

quick falcon
#

thank you

bright stump
#

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 😂

thick rampart
#

~192~ —> ~ 192~ (add space)
unless —> if

rose tusk
#

Generally, it helps readability to add spaces between every coordinate. It is not required on Bedrock but it can be ambiguous

topaz venture
rose tusk
#

That would follow. Still not a reason to write ~ 192~ over ~ 192 ~ IMHO

topaz venture
#

agreed, having a space after every coordinate should always exist, except when its "~~~" or "^^^"

fallow cliff
fallow cliff
fallow cliff
bright stump
#

Thank you eveyone it make my heat beat even just for a secon seeing a community help one and

haughty musk
#

/replaceitem entity @s slot.armor.body 1 iron_chestplate 1 1 {enchantments:[{id:"minecraft:protection",lvl:1}]}
whats wrong with this 😭

uncut notch
#

You need to use /enchant

bright stump
#

I've done this before but it's way more complicated than it needs to be

uncut notch
#

I ain't advertising scripts just stating facts

bright stump
uncut notch
bright stump
uncut notch
bright stump
#

Huh?

uncut notch
#

It's just preference tbh Soo if it works then it works lmao

bright stump
#

Im not exporting the structure in to a addon

#

Like i said i literally do everything in vanilla by command blocks

uncut notch
bright stump
#

Ya

haughty musk
#

I just wanna make it so when they purchase protection if they have any of the permeant armor it gives them prot

rose tusk
#

Technically you can equip the armor through a dispsenser.

dusky badger
#

How to execute a command in a specific coordinate? for example /kill @e ~5~~

verbal bear
#

r-Radius

rose tusk
#

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]

dusky badger
#

Ty

elfin girder
#

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

fallow cliff
#

Assuming your structure file is called custom.mcstructure within the structures folder, you can load it by running:
/structure load mystructure:custom ~~~

haughty musk
#

/load structure "ts/tree/custom" ~ ~ ~

#

(btw i just saw this was a few days ago

elfin girder
hard dawn
#

What the hell is the /load command

jade dirge
hard dawn
rose tusk
#

Not at all intended to be confused with /structure load 🙃

true laurel
#

Hello all

cyan jetty
#

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?

true laurel
#
execute unless score DummyWorld world matches 0 run...
scoreboard players set DummyWorld world 0```
fallow cliff
cyan jetty
#

Thank y’all widepeepoHappy3

cyan jetty
fallow cliff
cyan jetty
#

I've tested it extensively YEPGE
(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

cyan jetty
#

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

fallow cliff
fallow cliff
fallow cliff
#
  • /execute if score "Initialised" world matches 0 run <command>
rose tusk
#

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.

rose tusk
fallow cliff
lavish spade
#

@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.

pallid linden
quick falcon
#

guys how do i make the functions work

fallow cliff
still dawn
quick falcon
fallow cliff
quick falcon
#

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

fallow cliff
#

what's in the function
does the function itself work?

#

have you made a post in #1067869136606220288

still dawn
uncut notch
flat cloak
#

Trying to add color to this particle, if possible how would one do it?

/particle minecraft:splash_spell_particle ~~~

#

Respond with @ ing me

rose vector
#

If dynamically.. You need to use Scripting, (and your particle should have configured rgb variables for it not all vanilla ones have it)

flat cloak
rose vector
thick apex
#

Can I toggle on/off keepinventory with a command block?

thick apex
#

Done.

uncut notch
#

Guys

#

Can you guys explain what does follow orbit do?

fickle patio
#

also is there a way to run a server animation with commands?

wispy wave
#

6969

gentle harbor
#

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.

sweet plume
#

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

gentle harbor
#

I got it working

sweet plume
#

figures

gentle harbor
#

I'm trying to get a command to fill and area with fully grown wheat on bedrock edition. How do I do it?

wispy wave
gentle harbor
#

Ty

tidal turret
#

/execute at @initiator[scores={HoneycombHunt=0}] run /scoreboard players add @initiator HoneycombHunt 1

tidal turret
#

For npc

#

It wont work

true laurel
#

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

tidal turret
#

idk how to fix

true laurel
#

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

tidal turret
tidal turret
#

Yes

jade dirge
tidal turret
#

adish helped me

chrome pawn
#

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

grim ocean
#

so sad

lone abyss
#

how many commands can minecraft run per tick?

grim ocean
#

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 )

hazy oriole
#

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

grim ocean
#
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

hazy oriole
hazy oriole
grim ocean
#

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
grim ocean
hazy oriole
grim ocean
#

np owo_yay

tawny chasm
#

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.

rose tusk
#

@tawny chasm Is it not opening the dialogue?

tawny chasm
#

The scene_1 button starts the function. Maybe it can't close the first scene to open the second using the function inbetween.

grim ocean
# tawny chasm Hello, I have a problem running a function. The second line is working fine and...

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 )

tawny chasm
# grim ocean i dont have much experience with custom dialogues but i do have some experience ...

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.

grim ocean
#

dayum lmao

quick falcon
#

guys,how do i make a item lock in inventory of the player on 1.21.20

lilac pilot
#

Hi, I would like to add a tick to my function, but how do I do it?

#

I am bedrock

true laurel
true laurel
lilac pilot
#

Oh shit

true laurel
lilac pilot
#

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

true laurel
#

So are you using tick delay on there?

lilac pilot
#

And on bedrock the /schedule doesn't work 😕

true laurel
lilac pilot
#

I don't know how to do it 🥲

#

I'm not good at commands..

#

I try to learn well

true laurel
lilac pilot
#

Too bad, thanks anyway

true laurel
#

Use scoreboard tick delay bro

lilac pilot
#

I don't think I understand, it's too complicated for me.

lilac pilot
#

I am French, I have difficulty

#

With English

fallow cliff
# lilac pilot I am French, I have difficulty

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

lilac pilot
#

Does it work for bedrock?

dusty nymph
#

Hello, does anyone know how I can create a 10 second countdown with just mcfunction?

fallow cliff
#

Bedrock

#

you are using functions, right?

lilac pilot
#

Yes

fallow cliff
#

then u can use :)

lilac pilot
#

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

fallow cliff
# dusty nymph Hello, does anyone know how I can create a 10 second countdown with just mcfunct...

▶️ 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
dusty nymph
#

.-.

#

THANKS!!!!

vagrant remnant
#

Does anyone know how to test for 50% of an area if the blocks are broken? With command blocks that is,

lilac pilot
#

@fallow cliff

lilac pilot
#

In fact I managed to get by...

abstract shale
#

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.

abstract shale
#

How to give a unique tag to the same mob type every time it spawns and how to get the value of that tag?

grim ocean
#
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

iron meadow
#

How can I check if a player has died using command blocks?

jade dirge
dusty nymph
#

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?

fallow cliff
upper bison
#

Does anyone know the ticking area command for command blocks working on the whole world

fallow cliff
#

why would you wanna tick the whole world? that would be unplayable

Tickingareas must be used sparingly