• 0

    posted a message on (SOLVED) Detect when a skeleton shoots an arrow
    Quote from Megacrafter107»

    You could run a test to see if there is an arrow near a skeleton and then increment a counter objective if there is.

    It would look something like this:


    in a repeating command_block:

    /execute as @e[type=skeleton] at @s run execute as @e[type=arrow,distance=..5,tag=!tagged] run scoreboard players add @e[type=skeleton,limit=1,sort=nearest,distnace=..5] counter 1




    in a chain command_block:


    /execute as @e[type=skeleton] at @s run tag @e[type=arrow,distance=..5,tag=!tagged] add tagged


    (Not tested yet)



    Change that a little bit.

    Also, try to reduce that distance as much as possible to reduce the chances of wrong counting when multiple skeletons is standing near each other.


    /execute as @e[type=skeleton] at @s positioned ~ ~1.62 ~ if entity @e[type=arrow,distance=..5,nbt={pickup:0b},tag=!tagged] run scoreboard players add @s counter 1
    
    /execute as @e[type=skeleton] at @s positioned ~ ~1.62 ~ as @e[type=arrow,distance=..5,nbt={pickup:0b},tag=!tagged] run tag @s add tagged
    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Help with a death system

    A "death" mob that do several things on players within 5 radius?


    First, when you said don't work, do you mean these commands didn't activate?

    Try this...

    execute at @e[name="death"] as @a[scores={StartGame=180..},distance=..5,gamemode=adventure] run say check?

    If this doesn't work, check either if these command block/function is activated or not, or find out which argument doesn't match by adding more commands...

    execute at @e[name="death"] run say check?_1
    execute at @e[name="death"] as @a[scores={StartGame=180..}] run say check?_2
    execute at @e[name="death"] as @a[distance=..5] run say check?_3
    execute at @e[name="death"] as @a[gamemode=adventure] run say check?_4


    Second, since you use at @e[name="death"], particle and playsound will run base on that coordinate. Which mean particle will appear at "death", sound will start at that place as well. If this is what you want, great. If you want those run at player's position, fix this.


    Lastly, same target selector is used twice in your commands. Try to simplify them. Also, function is recommended.

    p.s. 1000 and 10000 particles maybe too much...

    execute as @e[name="death"] at @s if entity @a[scores={StartGame=180..},distance=..5,gamemode=adventure] run function foo:bar
    execute as @e[name="death"] at @s as @a[scores={StartGame=180..},distance=..5,gamemode=adventure] run function foo:bar2
    
    #foo:bar
    particle minecraft:large_smoke ~ ~ ~ 1 100 1 0 1000
    particle flame ~ ~ ~ 1 1 1 5 10000
    playsound minecraft:entity.lightning_bolt.thunder block @a ~ ~ ~ 99999 2
    tellraw @a ["",{"selector":"@a[scores={StartGame=180..},distance=..5]"},{"text":" died!","color":"red","bold":true}]
    
    #foo:bar2
    scoreboard players remove @s Lives 1
    effect give @s levitation 5 0 true
    tp @s 20 50 20
    Posted in: Commands, Command Blocks and Functions
  • 1

    posted a message on how to test for a player in a radius

    i want to make a door that opens when you have a tripwire_hook in your inventory, and that is named Key, and you are in a radius of 5. there is a block placed. i already have this command but the player detection in a certain range doesn't work.


    Much better now...

    I have no idea why you put or even need if entity there, anyways...

    distance=5 means exactly at a distance of 5 block away, changing it to distance=..5 means within a radius of 5 block.

    execute at @p[nbt={Inventory:[{id:"minecraft:tripwire_hook",Count:1b,tag:{display:{Name:"{\"text\":\"Key\"}"}}}]}] if entity @p[distance=..5] run setblock ~ ~2 ~
    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Converting this command to 1.13.2?

    Because you didn't specific the coordinate for executor(the command block), the default coordinate will be at where the command block is located.


    This is the fix:

    [repeat,unconditional,always active]/tp @e[name=stand,limit=1] @e[name=wolf,limit=1]

    [chain,conditional,always active]/execute as @e[name=stand,limit=1] at @s run tp @s ~ ~-1.4 ~


    And here is a simplified one:

    /execute as @e[name=wolf,limit=1] at @s run tp @e[name=stand,limit=1] ~ ~-1.4 ~

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on (SOLVED) Executing command when certain gametime?

    I think you explained well enough...The process is the same for 1.13 and prior to 1.13, use something that either detect time or represent time, output when requirement are meet. In this case, /execute store...time query detect and store time, /execute if score...run tellraw is the output.


    /execute store result score #time time run time query daytime

    Repeat this, it store a score that represent daytime in tick.

    1000 is day, 18000 is midnight, 13000 is night, and 6000 is noon.

    All you need is detect the score and run commands

    /execute if score #time time matches 6666 run tellraw @a "here"


    Another way to do this is setup a constantly score adding command that represent daytime tick, nice and simple, but it could be inaccurate. There is also one more way to do it, which is using worldborder get...

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on (SOLVED) Executing command when certain gametime?

    /execute store result score #time time run time query daytime

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Why isnt this execute command not working?
    Quote from saka29»

    Yes!

    Very stupid mistake, my bad (embarrassed face emoji here)

    I set the command block to impulse - always active...


    But I set it to Repeat - Always Active and it did not keep outputting "hi", why?


    Well...sounds like is that annoy bug again(That's why I switch to function...fast, easy to edit and manage).

    Sometimes the command block just doesn't activate even when it is set to Always Active.


    In that case, either open the UI set it to Needs Redstone, click done. Open again, set back to Always Active, done.

    Or break and place the command block, try again...

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Why isnt this execute command not working?

    Checked it, it works fine. I guess is stupid mistake then...


    Not activated?

    Chain?

    Conditional?

    Wrong coordinates?

    Wrong item?

    Not 1.13 or higher version?

    Posted in: Commands, Command Blocks and Functions
  • 1

    posted a message on 1.13 get entity with score of x or y?

    For your first try, only the last argument of the same scoreboard will be used, which is myScore=3, others will be ignore.

    For your second try, "When the player has a score of 1 and a score of 3." But the fact is, player can have only one score under the same scoreboard.


    Unless you are using if to detect a range of score, and define the exception in the sub-command using unless or !, there is no way to do this in one command without separating. However, unless and @s cannot be used since the executor is unknown, as should take the place of if in order to let @s to work.



    There you go, all in one command. But most of the time, using tags or just separating commands is recommended.

    execute as @a[scores={myScore=1..3}] unless entity @s[scores={myScore=2}] run say found...

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Tildes in tp command not working as intended

    I was more referring to the command that worked just fine before. Yeah, 1.12 had problems, but this was not one of them.


    The reason is that the relative coordinates of every command comes from the executor, except /tp.

    Instead of taking it from the executor, /tp use the coordinate from the target.

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Sounds stop when overlapping - 1.13

    From what I know, this is a limit of Minecraft. Maximum amount of stream:true of the same category sound that can be play at the same time is 4.

    See File Structure-stream

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Round coordinates to .0?

    Absolutely.

    See align


    /execute as @a at @s align xyz run teleport @s ~ ~ ~
    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Is it possible to test for a range of values in an NBT tag?

    All I can think of is that he forgot to put the s.

    number.. wouldn't work on nbt, use /execute data get to get the time into score, and then you should be fine.

    Posted in: Commands, Command Blocks and Functions
  • 1

    posted a message on Changing Biomes in 1.13.2?

    k I am back. The reason why I couldn't get this work because I was using a old nbtexplorer, never knew it need a update...


    Make sure your NBTExplorer is at least version 2.8.0.

    Write down the coordinates or chunks that you want to change.

    You can know which coordinate and chunk you are currently in by pressing F3, or

    Use this https://dinnerbone.com/minecraft/tools/coordinates/ to find out which r.x.x.mca you need to open.

    Check your Biome ID here, https://minecraft.gamepedia.com/Biome/ID




    For example, I want to change the entire chunk(0 0 0 to 15 255 15) where xyz coordinate is 4 3 10 from void into snowy_beach biome.

    x y z: 4 3 10

    Chunk: 0 0 0

    region: r.0.0.mca

    Biome ID: Void(127), Snowy_Beach(26)


    Close your world before you start editing.

    Use NBTExplorer to open your world, saves/<your world>/region/r.0.0.mca/Chunk[0,0]/Level/Biomes

    Double click Biomes, Text view, export and save it as a .txt format.

    Open that file, Ctrl+F to find and replace 127 with 26.

    Open your NBTExplorer...Import this file back to Biomes, OK, and make sure you press save on the top left corner.

    Posted in: Commands, Command Blocks and Functions
  • 1

    posted a message on Changing Biomes in 1.13.2?

    My bad, WorldEdit is not here yet.


    Strange...I tried multiple time for the past 1 hour, the result for NBTEdit is either nothing change or crash between the software and the world...

    emmm.Then I guess...no it's not possible

    Posted in: Commands, Command Blocks and Functions
  • To post a comment, please or register a new account.