command/Reference

List of variables for use with commands.

command

  • /command
    • Aliases: /c
    • Description: Main command for LogiBlocks.
    • Sub-Commands:
      • eject
        • Usage: eject <entity/player>
        • Description: Forces the entity or player out of the vehicle they are in
        • Example: /c eject @p (ejects the nearest player out of a minecart/boat)
      • kill
        • Usage: kill <entity/player>
        • Description: Kills the entity or player
        • Example: /c kill @e[t=creeper] (kills the nearest creeper)
      • accelerate
        • Usage: accelerate <entity/player> <x> <y> <z>
        • Description: Sets the entity or player's velocity to x,y,z
        • Example: /c accelerate @a 0 1 0 (sends all players flying upwards at a speed of 1 m/s)
      • delay
        • Usage: delay <time> <command>...
        • Description: After <time> delay in server ticks, executes <command>
        • Example: /c delay 20 say blah blah (After 20 ticks (about 1 second), says "blah blah" to the server)
      • redstone
        • Usage: redstone <time>
        • Description: Turns all surrounding levers on for <time> ticks, and then flips them off. Does not affect any levers already turned on.
        • Example: /c redstone 40 (Turns all surrounding levers on for 40 ticks (about 2 second) and then flips them off)
      • explode
        • Usage: explode <location> <force> [fire] [destroyblocks]
        • Description: Creates a <force>-sized explosion at <location>. If [fire] is true, will also spawn fire. If [destroyblocks] is false, doesn't destroy anything.
        • Example: /c explode @l[c=200|64|-300] 20 true false (Creates an explosion at 200,64,-300 with a radius of 20 that spawns fire, but doesn't destroy anything)
      • equip
        • Usage: equip <entity/player> <slot> <item>
        • Description: Sets the entity/player's <slot> to <item>. Acceptable slots are head helmet chest chestplate shirt legs leggings pants feet boots shoes
        • Example: /c equip @e[t=skeleton] head @i[m=skull_item,d=3,o=FootofTape] (Makes the nearest skeleton wear a FootofTape (my good friend) head on their head)
      • repeat
        • Usage: repeat <delay> <repetitions> <command>...
        • Description: Repeats <command> <repetitions> times with <delay> ticks in-between each repetition. The first command is instant.
        • Example: /c repeat 20 5 say blah (Says "blah" 5 times every 20 ticks (about 1 second))
      • setflag
        • Usage: setflag <name> <flag>
        • Description: Saves a local flag called <name> for use by other command blocks with getflag. Can only be true or false. Flags do not reset when the server restarts. Local flags can only be used by command blocks of the same name.
        • Example: /c setflag thisisaflag true (Sets the flag "thisisaflag" to true)
      • setglobalflag
        • Usage: setglobalflag <name> <flag>
        • Description: Saves a global flag called <name> for use by other command blocks with getglobalflag. Can only be true or false. Flags do not reset when the server restarts. Global flags are the same for every command block.
        • Example: /c setglobalflag thisisaflag true (Sets the flag "thisisaflag" to true)
      • teleport
        • Usage: teleport <entity> <location>
        • Description: Teleports <entity> and its vehicle(s)/passenger(s) to <location>
        • Example: /c teleport @e[t=minecartrideable] @l[c=50|100|50] (Teleports the nearest rideable minecart to 50,100,50 , even if someone is riding it)
      • safeteleport
        • Usage: safeteleport <entity> <location>
        • Description: Teleports <entity> and its vehicle(s)/passenger(s) to a location near <location> that is safe (i.e. not above lava/cactus and has two blocks of air and a block below)
        • Example: /c safeteleport @e[t=creeper] @l[rand=true] (Safely teleports the nearest creeper to a random location within 100 blocks)
      • spawn
        • Usage: spawn <entity stack> [location] [amount]
        • Description: Spawns a stack of entities at the target location. Read the spawn tutorial to learn more.
        • Example: /c spawn creeper:n=steve;charged,&,& (Spawns 3 charged creepers named steve stacked on top of each other above the user)
      • message
        • Usage: message <player> <message>...
        • Description: Works just like the vanilla /tell. Made for plugins (like Essentials) that override that command. Also works with color codes.
        • Example: /c message @p &aWelcome, @p ! (If the command block is named "Shop Owner", will print "Shop Owner: Welcome, bleachisback !" to bleachisback (or the nearest player)).
      • rawmessage
        • Usage: rawmessage <player> <message>...
        • Description: Works just like /c message, but does not include the name of the sender.
        • Example: /c rawmessage @p &aWelcome, @p ! (If the command block is named "Shop Owner", will print "Welcome, bleachisback !" to bleachisback (or the nearest player)).
      • setdata
        • Usage: setdata <entity> <data>
        • Description: Sets the data of an entity with the same syntax of the data in /c spawn. Read the spawn tutorial for more info,
        • Example: /c setdata @e[t=sheep] naked;red (Makes the nearest sheep naked and red).
      • inventory
        • Usage: inventory [location/player] <sub-command> [args]...
        • Description: Manages the inventory of either the block found at [location] or the [player]. If neither are specified, tries to use an inventory surrounding the command block.
        • Example: /c inventory copy @p (Makes the nearest player's inventory the same as a chest nearby the command block).
        • Sub-commands:
          • add <item>
            • Description: Adds <item> to the inventory.
          • remove <item>
            • Description: Removes <item> from the inventory. The amount removed is equal to the size of <item>.
          • removeall <item>
            • Description: Removes all <item> from the inventory. The size of <item> is ignored.
          • clear
            • Description: Removes all items from the inventory.
          • refill [ignoreMax]
            • Description: Sets all items to their max stack size. If ignoreMax is true, sets them to 64, regardless of their maximum stack size.
          • set <slot> <item>
            • Description: Sets the slot at <slot> to <item>. If <slot> is greater than the inventory can handle, places it at the last slot.
          • copy <location/player>
            • Description: Copies the inventory to the inventory of <location> or <player>. If the target inventory is smaller than the original, some items won't be copied.
          • show <player> [copy]
            • Description: Opens the inventory to the player. If [copy] is true, then when the player edits the popup inventory, it will not edit the original inventory
      • voxelsniper
        • Usage: voxelsniper <location> [args]
        • Description: Uses a VoxelSniper brush at the target location. See the tutorial for more info.
        • Example: /c voxelsniper @p b=b b=10 v=1 vr=0 p=mm (Replaces all air in a radius of 10 meters around the nearest player with stone)

if

  • /logicif
    • Aliases: /if
    • Usage: /if <flag> [args]... ? [command1]... : [command2]
    • Description: Allows for true/false logic with commands. If the specified <flag> is true, executes [command1], otherwise it executes [command2]
    • Example: /if getflag thisisaflag ? say true : say false (If a command block has used /c setflag thisisaflag true previously, it will print "true" to the server, otherwise it will print "false" to the server)
    • Example: /if hasequip @p helmet ? : c equip @p helmet @i[m=diamond_helmet] (If the closest player doesn't have a helmet, make them wear a diamond helmet, otherwise do nothing)
    • Flags:
      • getflag
        • Usage: getflag <name>
        • Description: Returns true if a command block with the same name has previously used /c setflag <name> true, or false if it has previously used /c setflag <name> false
      • getglobalflag
        • Usage: getglobalflag <name>
        • Description: Returns true if a command block has previously used /c setglobalflag <name> true, or false if it has previously used /c setglobalflag <name> false
      • hasequip
        • Usage: hasequip <entity/player> [slot] [item]
        • Description: Returns true if <entity/player> has [item] equipped in [slot]. If [item] is empty, it will try to match any items. If [slot] is empty, it will look at every slot. Accepted slots are head helmet chest chestplate shirt legs leggings pants feet boots shoes
      • haspassenger
        • Usage: haspassenger <entity>
        • Description: Returns true if an entity is riding <entity>
      • ispassenger
        • Usage: ispassenger <entity>
        • Description: Returns true if <entity> is riding another entity
      • inventory
        • Usage: inventory [location/player] <sub-command> [args]...
        • Description: Manages the inventory of either the block found at [location] or the [player]. If neither are specified, tries to use an inventory surrounding the command block.
        • Sub-commands:
          • contains <item>:
            • Description: Returns true if the inventory contains <item>, ignoring amount
          • containsexact <item>:
            • Description: Returns true if the inventory contains the exact amount of <item>
          • isfull:
            • Description: Returns true if the inventory has no empty slots
          • isempty:
            • Description: Returns true if the inventory has no items
          • slot <slot> <sub-command>:
            • Description: Checks the <slot> in the inventory for <sub-command>
            • Sub-commands:
              • is <item>: Returns true if the slot is equal to <item>, ignoring amount
              • isexact <item>: Returns true if the slot has the exact amount of <item>
              • isenchanted: Returns true if the item in the slot is enchanted

Comments

Posts Quoted:
Reply
Clear All Quotes