• 0

    posted a message on Datapack Functions 1.13 - Lightning Strikes Same Spot [SOLVED]

    One possible reason is that you didn't add at in the command. Sorry I can't download stuff at the movement so I can only guess...

    When running functions, the default coordinate would be the executor.

    If run it in command blocks, the coordinate would be where the blocks are.

    If run it in background, in your case, the default coordinate would start at 0 0 0.


    For example, if you run these:

    summon armor_stand ~ ~ ~

    particle <a particle name...> ~ ~ ~ 0 0 0 0

    playsound <a sound name> music @a

    It will display/play a sound at 0 0 0.


    So I think that's it. A simple fix would be:

    execute as @a[scores={usedcarrot=1..}] at @e[type=!player,distance=..5] run summon lightning_bolt ~ ~ ~

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Using CanDestroy to allow entire color range?

    Use block tag.


    For example, create a json file under this path, name it rainbow_glass

    .minecraft\saves\<emmm>\datapacks\<name of your datapack>\data\test\tags\blocks


    Save this into that json

    {
      "replace": false,
      "values": [
        "minecraft:black_stained_glass",
        "minecraft:blue_stained_glass",
        "minecraft:brown_stained_glass",
        "minecraft:cyan_stained_glass",
        "minecraft:gray_stained_glass",
        "minecraft:green_stained_glass",
        "minecraft:light_blue_stained_glass",
        "minecraft:light_gray_stained_glass",
        "minecraft:lime_stained_glass",
        "minecraft:magenta_stained_glass",
        "minecraft:orange_stained_glass",
        "minecraft:pink_stained_glass",
        "minecraft:purple_stained_glass",
        "minecraft:red_stained_glass",
        "minecraft:white_stained_glass",
        "minecraft:yellow_stained_glass"
      ]
    }


    Enable datapack, now you can use this to specific all the color stained glass

    CanDestroy:["#test:rainbow_glass"]




    emmm...I just check the tag list again, they already have one for all the glass block, so you don't have to create your own json block list.

    Just use CanDestroy:["#minecraft:impermeable"]


    https://minecraft.gamepedia.com/Tag

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on 1.13 Datapacks Issue: Not All Functions Are Listed [SOLVED]

    If the function aren't recognized in the game, then it means there's something wrong in the command.

    Of course, you can post those not working functions out and hope for some one check it for you. or


    One quick way to check which command is wrong is

    open your launcher > settings > open output log when the game starts > enter an world with the datapack enable

    Then every line marked red tells you what went wrong.

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Execute Entity If Positioned not working?

    I think it would be better to tell you what your command is before give you the solution.



    Run tp (playername) 500 500 500 if there is a entity (playername), and this command is execute in the coordinate -956 65 -179.


    If the command is execute as @p positioned 0 0 0 run summon armor_stand ~ ~ ~,

    This means let the nearest player as the executor, using 0 0 0 instead of whatever this player's position is, then summon an armor_stand. The armor stand will be summon at 0 0 0, not player's position.



    "positioned" is one of the execute's sub command, not part of the "if" sub command.

    Now you see what it does, moving on.




    I'm not quite familiar with xyz argument, but this should be what you are looking for.

    execute as @a[x=-956,y=65,z=-179] run teleport @s 500 500 500

    perhaps execute isn't even necessary.

    teleport @a[x=-956,y=65,z=-179] 500 500 500

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Need help detecting enchanted items in Inventory (1.13)

    Try these...


    @a[nbt={SelectedItem:{id:"minecraft:diamond_pickaxe",tag:{Enchantments:[{id:"minecraft:silk_touch",lvl:1s}]}}}]
    @a[nbt={SelectedItem:{tag:{Enchantments:[{id:"minecraft:silk_touch",lvl:1s}]}}}]
    @a[nbt={SelectedItem:{tag:{Enchantments:[{id:"minecraft:silk_touch"}]}}}]

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Adding multiple [type=XXX] arguments to a single command?

    To add tag for players and snowmans.

    scoreboard players tag @e[type=snowman] add hastag

    scoreboard players tag @a add hastag


    For the command that give effect

    execute @e[type=snowball] ~ ~ ~ effect @e[tag=!hastag,r=2] wither 5 2

    Posted in: Commands, Command Blocks and Functions
  • 1

    posted a message on Adding multiple [type=XXX] arguments to a single command?

    Give tag to player and snowman, use tag=!hastag instead of type.

    Multiple type argument is impossible until 1.13

    Posted in: Commands, Command Blocks and Functions
  • 1

    posted a message on Help with 1.13, setblock execute not working

    as @a at @s

    Posted in: Commands, Command Blocks and Functions
  • 1

    posted a message on Updating various things to 1.13

    Number that represent different data/state of the block doesn't exist anymore in 1.13.

    Instead, you use this format for block with its' blockstate minecraft:command_block[facing=north]

    or this minecraft:command_block{auto:1b} to let this item contain nbts

    And yes, both, why not. minecraft:command_block[facing=north]{auto:1b}

    And you can check their state on the middle right of your screen after pressing F3.



    For a cauldron with full water level, it shows level:3 in F3, so your first command should be

    execute if block 69 68 273 minecraft:cauldron[level=3]

    Same as setblock, setblock 69 68 273minecraft:cauldron[level=3]

    Button pressed is [powered=true]


    for distance, you do distance=..4 instead of distance=4

    The first one means in a radius of 4 block. The second one means with a distance of exactly 4 block.

    l and lm changed to level, so player with at least 1 level should be @p[level=1..]

    1.. means 1 or higher

    ..1 means 1 ore below

    0..2 means between 0 and 2 (inclusive)



    CustomName value is now use json format, which means you can have custom name with color. So CustomName:"boss" should be CustomName:{\"text\":\"boss\"}

    Last problem, /data only works when the target selector has only one target, or in other word, you need to write limit=1 unless you use @s.

    So it should be /data merge entity @e[type=ghast,distance=..32,limit=1] {Silent:1b}

    or(of course we want to change every single one with just one command) /execute as @e[type=ghast,distance=..32] run data merge entity @s {Silent:1b}


    Check here, look at the format and example they gave, and you should be fine.

    https://minecraft.gamepedia.com/1.13

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on 1.13 How would I use /data get to influence other command blocks

    Let /data get store string.

    However, you just can't...

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on How to use Custom Skulls as the output for a custom recipie

    "name": "Apple",←Remove this comma


    Now your recipes should work just fine, a steve head though... It is currently not possible to get a result with custom nbt.

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Updating various things to 1.13

    It is working fine. Mind to show us the command?

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on [1.13] How to summon an arrow the moves in the direction you are looking at?

    Oh..."that_entity" refer to "summon an entity at 0 0 0", this is an entity where you get the "motion" data from after you teleport it forward. It could be any entity, an area_effect_cloud is highly recommended.


    "that_arrow" refer to the arrow that the player summoned, and you are going to store the "motion" from "that_entity" to this arrow.



    All these should be inside a function, and the player is the one who run this command.

    Instead of @e[type=arrow,tag=that_arrow] and @e[type=area_effect_cloud,tag=that_entity], I used @e[tag=that_arrow] and @e[tag=that_entity]. Because a command expert told me that you wouldn't want unnecessary argument to slow down the targeting progress(Although it might seems negligible).


    Yes, a dummy scoreboard.







    If you still confuse, here is a briefly summary of what happens:

    When the player right clicked his carrot_on_a_stick(assume that's how you activate this shooting skill),

    summon an arrow(that_arrow) as @a[scores={...}] at @s anchored eyes positioned ^ ^ ^1,

    because you don't want the arrow hit yourself the movement it spawned, right?

    and an area_effect_cloud(that_entity) at coordinate 0 0 0.

    Let that_entity has the same facing as the player, tp it forward.



    Pos: 3 TAG_Doubles describing the current X,Y,Z position of the entity.
    Motion: 3 TAG_Doubles describing the current dX,dY,dZ velocity of the entity in meters per tick.

    See how Pos and Motion is related?


    So the next and final step is, you store the xyz position value from "that_entity" as motion value into "that_arrow".

    You may want to adjust the value that you get from position before you store it back with two reason.

    First, so you can adjust how fast you want.

    Second, even though motion is a doubles type, when this value is higher than 10 or lower than -10, it becomes broken. So you would have to make sure the value that you store back is between this value.

    Reset, kill "that_entity", reset player's carrot stick score...etc






    emmm...Actually, we don't even need "that_entity", we can just let "that_arrow" to handle the score, and tp it back at the end. Great...

    When player activated, summon an arrow at 0 0 0.

    Let the arrow rotated as player, teleport it forward.

    Store the 3 position value from the arrow into score.

    Adjust the score.

    Store it as 3 motion value back into the arrow.

    Teleport the arrow at player's ^ ^ ^1.

    Reset.

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on [HELP]Timer triggering commands at different times

    Summon an armor stand or area effect cloud, let them handle the score...

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