1. Configuration and Example/1.1 Command Type's and PlaceHolders

Type Version Info
TEXT 1.0  Execute a text command type
BROADCAST_TEXT 1.4  Execute a text command type visible from the whole server
RUN_COMMAND 1.3  
RUN_COMMAND_RANDOM 3.6  Run a command randomly choosen from the runcmd list
RUN_COMMAND_TASK 5.2.4  Execute indeterminately a runcmd list until a condition or an custom amount of time it played
ADD_PERMISSION 2.3.1  Overlay an already existing command to hide it.
RUN_CONSOLE 2.4  Works as RUN_COMMAND but every commands are executed directly from the console, bypassing the user permissions
WARMUP 2.6 Apply a WARMUP to an already existing command (ex. another plugin command)
COOLDOWN 5.0  Apply a COOLDOWN to an already existing command (ex. another plugin command)
WARMUP_AND_COOLDOWN 5.3.2  Apply both, WARMUP and a COOLDOWN to an already registered command.
RUN_AS_OPERATOR 3.7  Same as RUN_COMMAND, but in this case the sender user gets Opped while executing the commands, bypassing, again, the permissions
ICONMENU 3.9.3  Allows you to create Inventory-Like Icon Menu.
SCOREBOARD 4.0.0  
ALIAS 4.1  An easier way to create aliases.
BUNGEE_TP 4.1 Works only if you are connected in a bungeecord proxy
BAR_API_TEXT 5.0.1 Require BarAPI in older version
BAR_API_BROADCAST_TEXT 5.0.1 Require BarAPI in older version
CALL_URL 5.1.2 Contact a web-page / php-script to retrieve informations.
RUN_CONSOLE_RANDOM 5.1.2  Run a command randomly choosen from the runcmd list
TITLE 5.1.7  
BROADCAST_TITLE 5.1.7  
ACTION_BAR 5.2.5  
BROADCAST_ACTION_BAR 5.2.5  
RAW_TEXT 5.1.8  
BROADCAST_RAW_TEXT 5.2.5  
EXP_BAR 5.3.4  
ADD_COST 5.3.4  
BLOCK_PATTERN 5.4.2  
HOLOGRAPHIC_TEXT 5.5.0  
BROADCAST_HOLOGRAPHIC_TEXT 5.5.0  
MERCHANT 5.5.0 Merchant shop GUI
LEADERBOARD 5.6.0 Sort playerdata number values by the highest amount.
BOOK 5.6.0 Open up a Book GUI without the need of having a book in the inventory.
ANVIL_GUI 5.6.4 Open up an Anvil graphical interface.
RAW_BOOK 5.6.4 Open up a Book GUI without the need of having a book in the inventory, with clickable text.

 

Removed types. Listed here if you use older versions:

 

PERM_BROADCAST_TEXT   removed in 5.3.0
RUN_COMMAND_TEXT 1.4

 Execute commands and text togheter

removed in 5.6.0

RUN_COMMAND_BROADCAST_TEXT 1.4  Execute commands and broadcast_text togheter removed in 5.6.0
RUN_COMMAND_PERM_BROADCAST_TEXT 3.0 removed in 5.3.0
SPOUT_TEXT 2.3 Require SpoutPlugin Removed 5.5.0
SPOUT_NOTIFICATION 3.7 Require SpoutPlugin Removed 5.5.0

 

Text PlaceHolders : Compatible "almost" in every section of the plugin. text,runcmd ecc..

Variable Description
$space Get replaced with a space " ".
$player Show the player sender name
$uuid Show the player sender UUID
$health Show the amount of the player sender health level (0 to 20)
$food Show the amount of the player sender food level (0 to 20)
$world Show player sender current world name
$biome Show the biome name, from the player current location
$exp Show player sender current experience amount
$level Show player sender current experience level
$gamemode Show player sender current gamemode
$lastdamage Show the amount (number) of the last received damage
$locX , $locY , $locZ Show the respective coordinate X,Y,Z
$target_X, $target_Y, $target_Z Show the coordinate of the target block where the player is looking at
$loc_highestY Show the highest block in the Y coordinate
$loc_pitch, $loc_yaw Show coordinate pitch and yaw
$getaddress Show the player current IP
$getdisplayname Get the player custom name showed in the chat
$getplayerlistname Get the player custom name showed in the TAB list
$canpickupitems true or false
$getmaxhealth Get the maximum level of the health (Default 20)
$getallowflight Get true or false
$gettotalexperience Get the total experience earned
$getexptolevel Get the amount of missing experience for reach the next level
$rnd6 , $rnd64 ,$rnd100 generate a random number. rnd6 (1-6),rnd64 (1-64),rnd100 (1-100)
$randomnumber%n%     or   $randomnumber%25<to>50% Custom randomnumber generator. Example : $randomnumber%100% give you one number taked randomly from 1 to 100
$online Show the mount of the of the players connected in the server (number)
$ponline Show all the online players as a text list (name1, name2 ecc)
$server-name Show the server name
$server-motd Show the server motd
$oplist show all the "opped" players in the current server as a text list.
$randomplayer Get randomly a playername from the online players
$todaydate Show the current date. Change the format below scheduler settings
$wgregionname (Require WorldGuard) Get the current region name from the player sender
$chatprefix , $chatsuffix , $primarygroup

(Require an Chat plugin and Vault) Get Prefix, Suffix and Primary Group

$NoReplace If any string start with this variable, nothing get replaced. Example, if you put $player in the final output you get $player and not the sender name.
$iditeminhand Show Item ID (Number) of your item. Example: STONE = 1
$iteminhand Show the item name of your main hand
$amount_iteminhand Show the amount (number) of the items in your hand
$name_iteminhand Show the custom name of the item in your hand
$iteminoffhand Show the item name of your off hand
$BCPlayerCount%servername% Get the amount of connected players in a specific server. Require Bungeecord
$BCPlayerList%servername% Get the list of the players connected in a specific server. Require Bungeecord
$GetPlayerByName%playername% Replace all the variable after this, with another player name
$GetRandomStringFromList%string1;string2;...3% Choose one String in the list randomly. Split with ";" Example in a command
$PlayerData%Variable% Get the value from playerdata.yml, and return as a text
$PlayerDataFor%PlayerName%VarName% Same as above but get the datas for another player (permission needed : mycommand.placeholders.playerdatafor.
$arg1 , $arg2 ... $arg9 , $multiargs

Arguments typed in the command /yourcomand $arg1 ecc

$money

Show the player sender current balance. (Require Vault Plugin)

$targetblockname

return the name of the block the player is looking at

$time

Show current server time

$loc_direction

Works like $loc_yaw but returns with a written cardinal point North, South ecc

$teams

Show's a list of all the teams the sender is in

$tags

Show's a list of all the tag the sender is in

$hasemptyinventory

return true or false

$inventorysize

return with the amount of items held by the player.

$nearestplayer

return with the name of the closest player. Will return with "NoPlayer" if nothing is found.

 

  • Use &1 , &2 , &3 ... &f for colored text.
  • $hex%#123456% (RGB Colors 1.16+)
  • $random_color (Choose one color randomly from &0 to &f)
  • $rainbow_color (randomly gives each letter a random color)
  • &l = bold
  • &m = Stike
  • &n = Underline
  • &o = Italic
  • &r = Reset text format/color
    You can also use the § instead of &
    or
    $darkblue,$darkgreen,$darkteal,$darkred,$purple,$gold,$gray,$darkgray,$blue,$black,$brightgreen,$teal,$red,$pink,$yellow,$white,$bold,$strike,$underline,$italic,$reset

"runcmd" PlaceHolders :


$delay$ (before the command) Wait a custom amount of time before the next command
$text$  or $rawtext$ (before the command)Send a direct text message without using the "text" line
$broadcasttext$  or $rawbroadcasttext$ (before the command)Like $text$ but send the message to all the online players
$log$ Same thing like $text$, but show an log message only in the console
$text_to_specific_player%playername% (before the command)Send a text message to a specific player
$arg1 , $arg2 , $arg3 , $arg4 ... $arg9 ... $arg100 Every typed argument can get replaced
$multiargs Get all the typed arguments without a specific order
$Script$ Script suffix
$Script$%if%, $Script$%else% If and Else (see more in Script page example)
$Script$%PlayerData% (see more in Script page example)
%PlayerOptions% Manage some player variables
$Script$%while% Works only in the command type RUN_COMMAND_TASK
  • all "text" placeholders

$CheckPlayerStatus%Player_Name%Status%

 

All fields : isOnline, isOnGround, isDead, isFlying, isSwimming, isSneaking, isInsideVehicle, isSprinting, isSleeping, isOp

 

Example:

runcmd:
- $Script$%if%$CheckPlayerStatus%$arg1%isOnline%==true
- /playerisonline
- $Script$%else%
- /notonline

 


mycmd-itemset PlaceHolders :


$targetentity (Old plugin version $playertarget) If a player return with the target player name, if an entity like a mob, return with the mob name
  • all "text" placeholders

Blocks, signs , npcs, lmcmd... ecc PlaceHolders :


  • all "text" placeholders

Events Placeholders (playerevents.yml)


$text$ (before the command)Send a direct text message without using the "text" line
$broadcasttext$ (before the command)Like $text$ but send the message to all the online players
$killer Show the name of the killer
$killed_player Show the name of the killed player
$death_cause Show the cause of the death of the dead player

 

 

ICONMENU commant type specific one's

 

if you're using the "iconmenu_mode: PLAYER_LIST", it's possible use the following placeholder to get the target player name:

 

$playerhead

 

TAB_COMPLETER special placeholders :

 

$player_list (returns with the list of all the connected players in that server)

$customnames_player_list (Returns with the list of custom player names)

$server_operators (Returns with the list of the players with the OP status)

$world_player_list (Returns with the list of the players playing in the same world of the sender)

$worlds_list (Returns with the list of all the worlds running on the server)

$block_list (Returns with the list of all the Materials available on the game (Blocks and Items)

$potions_list (Returns with the list of all the Potion types)

$enchantments_list (Returns with the list of all the Enchantments types)

$sounds_list (Returns with the list of all the Sounds names)

$effects_list (Returns with the list of all the Effects names)

$particles_list (Returns with the list of all the Particles names)

$entity_list (Returns with the list of all the Entities type)

 

tab_completer_test:
  command: /tct
  type: RUN_COMMAND
  runcmd:
 - $broadcasttext$&0[&e$player&0]&r $multiargs
  required_args: 1
  register: true
  tab_completer:
    '1':
   - $entity_list
    '2':
   - $potions_list

 


PlaceholderAPI Support :


From the version 5.2.3, MyCommand supports this plugin and it's able to utilize his placeholders.

 

Check on the official page all the supported placeholder.

 

To use with MyCommand just put them as usual inside a text line, runcmd or even inside a if condition of the scripts.

 

papi_example:
 command: /papiexample
 type: TEXT
 text:
 - Welcome to %server_name% %player_name%!

 

 

It's not all here, Mycommand also provide, some special placeholders, to be used from other plugins through PlaceholderAPI

 

%mycommand_playerdata_<variable_name>%
%mycommand_playerdatafor_<player_name>_<variable_name>%
%mycommand_variables_<variable_name>%
%mycommand_cooldown_<command_name>%


PlaceholderAPI Spigot Page

 

 TIP: If you want use PAPI placeholder and retrieve any player data, there is an useful extension caller Parse Other. Give a look.


Custom PlaceHolders


/mycmd-variables (permission : mycommand.variables)


Make custom placeholder or variable who get replaced in every section of the plugin.

 

  • Type "/mycmd-variables create " to create a new variable.
  • Type "/mycmd-variables set " for set an value inside of the variable.
  • If the variable is a number (Integer or Double) you can use "/mycmd-variables add/remove 123" for +/- operation.
  • Check the script page for see some useful scripts lines that's allow you to manage those new created variables without using the commands above.

 


Disable/Prevent certain PlaceHolders from being replaced


Use the command field placeholders_replace_mode :

 

Allows you to choose what placeholders the command have to replace, when it runs a command.

 

NORMAL_MODE (Replace everything, default).
ONLY_ARGUMENTS (Replace only the $args (and $player) typed in).
NO_COLORCODE (Like NORMAL_MODE but no colors).
ONLY_COLORCODE (Replace only the color codes).
ONLY_PLACEHOLDER_API (Replace only PAPI placeholders.)
NO_CUSTOM_VARIABLES (Like NORMAL_MODE but no variables created with /mycmd-variables).

 

Become :

mycmd:
  command: /donotreplaceplaceholders
  type: RUN_COMMAND
  placeholders_replace_mode : ONLY_ARGUMENTS
  runcmd:
  - /do stuff $player $arg1 $arg2