• 0

    posted a message on Executing command does not produce a signal at all...

    If all you are trying to do is not let anyone with a score less than 10 have any diamond picks, just put this command in a repeating command block:


    /clear @a[score_intelligence=9] minecraft:diamond_pickaxe

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on How would I check that all players are in one area?

    You can test if all players are in the area by inverting the output from:


    /testfor @a[rm=50]


    Change 50 to the radius of the lobby and put this command block in the center of it.

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on GUI help

    Donkeys and mules can be invisible.

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Custom Join Message

    You could also combine the two:


    /tellraw @a[tag=!handled] ["Welcome to the server!"]

    /execute @a[tag=!handled] ~ ~ ~ tellraw @a[tag=handled] [{"selector":"@s"},{"text":" has just become one with this world."}]

    /scoreboard players add @a[tag=!handled] add handled


    None of these commands need to be conditional, but both of the commands after the first can be. If you make the second command conditional, then you do not need to use execute; you can simply use the tellraw command as it is.


    Note this will only work on version 1.12, if you are using an earlier version, change every instance of "@s" to "@a[c=1]".


    Edit: If you want to display a sort of motd (message of the day) when a player joins the server, regardless of whether or not it is their first time joining, you could do something like this:


    Type into chat: /scoreboard objectives add left stat.leaveGame


    On a repeating command chain or a function on the game loop (without the slashes):


    /scoreboard players reset @a[score_left_min=2] left

    /scoreboard players add @a left 0

    /tellraw @a[score_left=0] ["Message"]

    /scoreboard players add @a[score_left=0] left 1


    The first time they join their "left" score will be set to 0, then increased to 1. When they leave the game, it will increase to 2, but the commands will not be able to find them until they reconnect to the server. When someone reconnects, the first command will reset their "left" score, as if they were never connected, allowing the rest of the commands to target them and send them the motd message.

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on The Command Box
    Quote from AlexDAM»

    i found a problem and on the wiki page it doesn't say something about it there are some commands that need to be on Conditional mode is there a way to make the command in the function do the same?

    Well there aren't exactly conditional statements yet, but what is the command who's condition needs to be met, there are work arounds.
    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on The Command Box

    Remove all slashes. Also read up on this page here: http://minecraft.gamepedia.com/Function


    "Commands are no longer allowed to begin with a / (forward slash)"

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Item into another item
    Quote from mine_boy60»

    I think I found a more simple way to achieve this but it doesn't work well in a multiplayer world due to closest player reasons. I set up a repeat command block pointing at two conditional chain command blocks with the following commands:

    testfor @p {Inventory:[{id:"minecraft:iron_ingot",Count:16b}]}
    
    clear @p minecraft:iron_ingot -1 16
    
    give @p minecraft:diamond


    I set it up ingame and it worked, just note that all of the ingots need to be in the same stack.

    Hope this helps :3


    This will only work for exact stacks of 16. If you have 17 ingots, nothing happens. Also, instead of using testfor, you should use:

    /scoreboard players tag @a add hasIron {Inventory:[{id:"minecraft:iron_ingot",Count:16b}]}

    Then target via "@a[tag=hasIron]" and be sure to remove the tag at the end. This will fix your multiplayer issue.

    But again, this is not the ideal way to achieve what you're looking for. This is one of the reasons we have the stats command. After you switch to using tags instead of testfor, this only becomes one command less than the proper method using stats.
    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on The Command Box

    entitydata as well as every single other command works just fine in functions. The only things that are a bit different are stuff like stats; if you wanted to grab the output of the previous command, normally you would use "stats block ~-1 ~ ~" or wherever the command block is located, but now you can only use "stats entity" and an execute on the command in question.


    Reply with your full function file's contents and I'll be more able to address your problem.

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Item into another item
    Quote from CyrenArkade»

    Should i run them all at once, or any comparators or delay? Do any of these need to be on a clock? I am using 1.11.



    If this is 1.11, then you will need to change both of the "@s" into "@p". And you put them in a command block chain in the order I provided, all commands should run in the same game tick. No repeaters/comparators. Just make sure the order does not change.


    Edit: And you only need a clock if you always want to exchange 16 iron for 1 diamond as soon as anyone obtains 16 iron ingots. But if you want to do that, then use these commands instead:


    /scoreboard players set @a iron 0

    /stats entity @a set AffectedItems @a[c=1] iron

    /execute @a ~ ~ ~ clear @a[c=1] minecraft:iron_ingot -1 0

    /clear @a[score_iron_min=16] minecraft:iron_ingot -1 16

    /give @a[score_iron_min=16] minecraft:diamond 1

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Item into another item

    You can use the /stats command to store the result of a command as a scoreboard objective. First you need to create an objective so type this into chat:


    /scoreboard objectives add iron dummy


    Now these commands need to be in command blocks or a function:


    /scoreboard players set @a iron 0

    /stats entity @p set AffectedItems @s iron

    /execute @p ~ ~ ~ clear @s minecraft:iron_ingot -1 0

    /clear @p[score_iron_min=16] minecraft:iron_ingot -1 16

    /give @p[score_iron_min=16] minecraft:diamond 1


    The execute command is necessary for /stats to track the result, even though it may appear that "clear @p minecraft:iron_ingot -1 0" does the same thing, it does not assign the command stats result to the objective.


    When you clear 0 items from a player, it will return the total number of that item in their inventory. This allows us to target the player only if they have at least 16 before removing any or giving any diamonds.

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Time Protecting Multiplayer Sleeping (TPMS): New 'Percentage' mode, and MC1.12 Support!
    Quote from Romaq»

    I'm really not clear on the details, but instead of a string of sequential command blocks an .mcfunction file can just have a bunch of /commands in sequence, and in my opinion there are two really cool things about this: 1) .mcfunction files exist outside of the world, so a "big bunch of command blocks" collapses into a few blocks, or perhaps no command blocks at all. 2) .mcfunction files allow comments, which means you can make notes for yourself to make it easier to figure out what you were trying to do so you can fix the bug.

    I am looking at http://minecraft.gamepedia.com/Weather. Can you detect rain, and simply toggle it? If you /weather clear without specifying time, does it pick a random value between 0.5 - 7.5 day delay? Having the game internals pick a random value would be very useful to avoid the whole issue.


    More detail on the weather command here: http://minecraft.gamepedia.com/Commands#weather

    You cannot feasibly detect rain or thunder, unless possibly with advancements.. I have yet to dive much into advancements, but they allow some pretty nifty new things.
    Posted in: Commands, Command Blocks and Functions
  • 1

    posted a message on 1.12 testfor command bug?

    You must use quotes to define id as a type string:


    /testfor @p {Inventory:[{id:"minecraft:lapis_block",Count:64b}]}

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Problem with functions

    Right off the bat, if you plan for this to run on the game loop, it will not function, because there is no origin. You must execute from somewhere before you are able to summon something. Now if you are planning to trigger this function via player (either by typing it, in an execute, or as an advancement) then you are fine.


    Next, if you are on windows, you may need to disable the option "hide extensions for known file types" in folder settings, then make sure there is no .txt at the very end of the file name.

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Can't '/testfor' EXP Levels.

    To detect if a player has at least 1 level:


    /testfor @a[l=1]


    To detect if a player has exactly 1 level:


    /testfor @a[l=1,lm=1]


    To detect if a player has no more than 1 level:


    /testfor @a[lm=1]


    But you should not be using /testfor for something like this, here is how you could turn 1 level into 1 half heart:


    /effect @a[tag=regen] minecraft:regeneration 0

    /scoreboard players tag @a[tag=regen] remove regen

    /scoreboard players tag @a[l=1] add regen

    /effect @a[tag=regen] minecraft:regeneration 1 6 true

    /xp -1L @a[tag=regen]


    Now if this is constantly running, as soon as you get 1 level you will get a half heart of health instantly and then lose that level.


    If you use the /xp command to give yourself 5L, "/xp 5L", then you will keep the regen effect for 5 ticks, each tick will give you a half heart and take a level away leaving you with +2.5 hearts and 0 levels.

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