• 1

    posted a message on How to specify block states in fill commands?
    fill <x1> <y1> <z1> <x2> <y2> <z2> <block> [dataValue|state] [oldBlockHandling] [dataTag]
    Posted in: Commands, Command Blocks and Functions
  • 1

    posted a message on Detect entity with less than X HP

    Set the entity's AbsorptionAmount tag to X, then test when it reaches zero.

    /scoreboard players tag @e[type=Cow,name=Kevin] add belowX {AbsorptionAmount:0.0f}
    Posted in: Commands, Command Blocks and Functions
  • 1

    posted a message on Using Damage Values with CanPlaceOn/CanDestroy

    This is not possible right now. However, it might become in 1.13 or so with the new block ID system.

    Posted in: Commands, Command Blocks and Functions
  • 1

    posted a message on Detecting Item in Inventory or Being Moved Around in Inventory

    You can do something like this. Keep in mind that it does not work in creative mode.

    https://goo.gl/H9MKAO

    Posted in: Commands, Command Blocks and Functions
  • 1

    posted a message on how to check for player wearing specific item?

    There are two ways you can test for a player's NBT. /scoreboard and / testfor.

    I suggest to use /scoreboard, but if you are sure that there will only ever be one player, you can just aswell use /testfor and conditional.


    The way to testfor a player wearing something, is as follows:

    /testfor @a {Inventory:[{id:minecraft:chainmail_leggings,tag:{display:{Name:""},ench:[{}]}}]}

    The player has a base tag with an array named Inventory in it:

    {Inventory:[]}

    Inside this array you can have as many item compounds, as you want. The order doesn't matter. It will only succees when it matches all things.

    {id:minecraft:diamond,Count:1b,Slot:103b,tag:{}}

    The Slot tag defines where that item has to be.

    100b = feet; 101b = legs; 102b = chest; 103b = helmet; -106b = offhand

    every other tag of the item go into tag:{}. Except: id, Count, Damage, Slot

    Posted in: Commands, Command Blocks and Functions
  • 1

    posted a message on URGENT! Please help with a creation of a command! (UNSOLVED!)

    Okay, so if I understand correctly, there is one tower of blocks, starting from a bedrock block. The player has to build this tower, but every block can only occur once in the stack, otherwise it would disappear. Right?

    Posted in: Commands, Command Blocks and Functions
  • 2

    posted a message on My Command Doesn't Work - FAQ!

    My Command Doesn't Work - FAQ!

    Commands in Minecraft sometimes just don't want to work. Here are a few common problems:

    (Read over the headlines and find what applies for you)


    Does the command produce any error messages?

    In most cases, the command block throws an error message when the command fails. There is no error message? Try to enter the command in chat. Or, if the command block contains a small button with an X, click on it and run the command block again.

    The output comes with a timestamp. Compare it to the current time to see if the command has been running recently. (Note: On servers the timestamp might be off, consider time zones)

    Here are a few error messages explained:

    • "Selector '@...' found nothing" > The submitted arguments can't find a matching entity. Read "Are you working with entity selectors"!
    • "Failed to execute '...' ad '...'" > The command behind execute is flawed. Try this command on it's own. (Note: This doesn't necessarily mean, no entity managed to execute the command)
    • "Unable to summon object" >
    • "Data tag parsing failed" > Issue in NBT. Read "Are you working with NBT"!
    • "Invalid json" > JSON can be extremely fragile. Read "Are you working with JSON"!
    • "Usage: ..." > Your command syntax is wrong. Check if you didn't switch two parts of the command. Make sure there are no spaces in objectives, names and selectors. Make sure there is only ever one space in between to arguments. This the place to look up command syntax: http://minecraft.gamepedia.com/Commands
    • "'...' is not a valid number" > Your command syntax is wrong. Read "Usage: ..."
    • "Unable to [...] out(side) of the world" > The given coordinates are in unloaded chunks or the Y value is not in range 0-255 for block changing commands.

    Are you on a Bukkit/Spigot server or in a modded world?

    Some plugins or mods (mostly "Essentials") overwrite Vanilla commands with their own commands.

    In this case you have to prefix the command with "/minecraft:" to make sure you are accessing the vanilla command. For example:

    "/tp @a ~ 4 ~" > "/minecraft:tp @a ~ 4 ~".

    This is usually only the case for following commands: /tp, /kill, /give, /summon.


    Is the command in a repeating command block or chain?

    There is a bug in the game where changing a powered command block to repeating doesn't make it start running. (https://bugs.mojang.com/browse/MC-86846")

    Try the following: Set the command block to 'Needs Redstone', click on 'Done'. Enter it again, set it to 'Always Active' and click on 'Done' again.


    Are you working with entity selectors?

    The entity with the given score, tag etc. might not exist. Try to use the selector with /say. "/say @e[...]". It this doesn't print names in chat, you have found your problem.

    Check if you are in the right version. If you are in 1.10.2 or earlier, your entity names behind "type=" must start with a Capital letter.

    If you are in 1.11 or newer, entity names are completely lowercase and seperated with underscores.

    Check if there are blank spaces in the selector. Spaces won't work here.


    Are you working with NBT?

    If you are setting NBT or spawning en entity / tile entity with NBT, this doesn't matter, but if you test for it, you must use the exact NBT syntax.

    Numers in NBT are saved in an data type, that needs to be added behind the number. For most this is "b", but for others it can be "s", "f", "d", or nothing. IDs however have to be prefixed with the correct namespace, for example id:"minecraft:stone" a

    To find the correct value, execute the /entitydata or /blockdata command with empty curly brackets. For example "/entitydata @e[type=zombie,c=1] {}". This prints the current data in chat.


    Are you working with JSON?

    Everything in JSON needs to be enclosed in "quotation marks". The only exceptions are: Square and curly brachets, colons and commas, numbers and the values true and false. When there is a JSON construct inside another, every quotation mark has to be escaped. This means there need to be one ore more backslashes "\" in front of it. Since this is pretty hard, I recommend using generators such as minecraftjson.com.

    - "How can I find the incorrect part" you may ask?

    Look at the error message. It usually says "Invalid JSON: [...] at line 1, column #". Copy your command to Notepad ++. Delete everything that's not JSON. Start selecting the text word by word until you the value for "Sel: " in the bottom right reaches the number from the error message. Look a few characters before or after the current cursor position and find the error.


    Are you using CommandStats?

    Command stats (blocks or entities modified with the /stats command to return a number from a command into a scoreboard) only work when the score is already set to any value. Make sure you set the value of the score you want to modify to 0 first.

    Posted in: Commands, Command Blocks and Functions
  • 1

    posted a message on Test if player dies near entity
    Quote from einstein5»

    Note:

    MUST BE IN THIS ORDER!


    This doesn't quite work. I fixed it for you:
    https://goo.gl/RIIOgl

    (Explaination: dead players can't be targeted with @p, r=, dx/y/z= etc.)
    Posted in: Commands, Command Blocks and Functions
  • 1

    posted a message on Test if mob kills player

    Create an a new scoreboard objective

    /scoreboard objectives add killed stat.entityKilledBy.<Entity>


    When it increases, the playerhas been killed by that mob.

    Posted in: Commands, Command Blocks and Functions
  • 2

    posted a message on how to add tags to player that clicked sign

    i know what you mean with "signclicker", but i dont thing there is something like that in the game right now. You kinda have to use the closest player....


    Don't worry, @p will always select the player who clicked the sign due to sender bias.
    Posted in: Commands, Command Blocks and Functions
  • To post a comment, please .