⚑ X-Commands⚑ Action Engine

Advanced Action System

X-Commands features an incredibly powerful action execution engine that allows you to go beyond simple text commands. You can create complex sequences, visual effects, and conditional logic.

How does it work?

Each line in a command’s actions list is an instruction. The plugin reads actions from top to bottom and executes them on the player.

actions:
  - "[TITLE] &6&lHello!;&fWelcome to the server;10;70;20"
  - "[SOUND] ENTITY_EXPERIENCE_ORB_PICKUP;1.0;1.0"
  - "[MESSAGE] &aYou have received your daily reward."

🎭 General Actions

General and Communication

  • [MESSAGE] text: Sends a private message to the player. Supports color codes.
  • [BROADCAST] text: Sends a message to the entire server (all online players).
  • [ACTIONBAR] text: Shows a message in the bottom bar (Action bar).
  • [TITLE] title;subtitle;fadein;stay;fadeout: Shows a title on the screen. Times are in ticks (20 ticks = 1 second).

Sounds and Effects

  • [SOUND] sound;volume;pitch: Plays a native Minecraft sound. Example: [SOUND] ENTITY_PLAYER_LEVELUP;1.0;1.2
  • [PARTICLE] particle x_offset y_offset z_offset amount: Generates particles around the player.
  • [EFFECT] potion;ticks;level: Adds a potion effect. Example: [EFFECT] SPEED;600;2 (Speed II for 30s).

Mechanics and Gameplay

  • [HEAL]: Completely restores the player’s health.
  • [FEED]: Automatically fills the player’s food and saturation bar.
  • [DAMAGE] amount: Deals direct damage to the player (in half hearts).
  • [GIVE] material;amount;optional_name: Gives items to the player. Example: [GIVE] DIAMOND_SWORD;1;&cEpic Sword.
  • [CLOSE_INVENTORY]: Forcibly closes any menu or inventory the player has open.

Commands and Teleportation

  • [CONSOLE] command: The server executes a hidden command as Administrator. Example: [CONSOLE] eco give %player% 500.
  • [PLAYER] command: Forces the player to type a command or talk in chat.
  • [TELEPORT] world;x;y;z;yaw;pitch: Silent and instant teleportation to exact coordinates.

🌐 External Support

  • [BUNGEE] server: Connects and teleports the player to another server in your network (BungeeCord/Velocity/Waterfall). Example: [BUNGEE] survival-1.
  • [GIVE_MONEY] amount: Requires the Vault plugin. Adds balance to the player’s economy.
  • [TAKE_MONEY] amount: Requires Vault. Subtracts money.
  • [KICK] reason: Instantly kicks the player from the server with the specified reason.

🧩 Logic Engine (Conditionals)

πŸ’‘

Logical actions allow the next action in the list to only execute if the condition is true.

[IF_PERMISSION]

Only executes the next action if the player has the permission.

actions:
  - "[IF_PERMISSION] rank.vip"
  - "[MESSAGE] &aHello VIP. Here is your exclusive access."

[IF_PERMISSION_NOT]

Ideal for sending error messages if the player does not have permission.

actions:
  - "[IF_PERMISSION_NOT] rank.admin"
  - "[MESSAGE] &cYou do not have sufficient money."

[IF_MONEY] and [IF_MONEY_NOT]

Conditionals based on the Vault economy balance.

actions:
  - "[IF_MONEY] 1000"
  - "[CONSOLE] give %player% diamond_block 1"
  - "[IF_MONEY_NOT] 1000"
  - "[MESSAGE] &cYou are missing coins!"

⏱️ [DELAY] - Creating Sequences

Use delay to pause execution in ticks (20 ticks = 1 second). This allows you to create short cinematics or spaced events.

actions:
  - "[TITLE] &c3...;;10;20;10"
  - "[DELAY] 20"
  - "[TITLE] &e2...;;10;20;10"
  - "[DELAY] 20"
  - "[TITLE] &a1...;;10;20;10"
  - "[DELAY] 20"
  - "[TELEPORT] world;0;100;0;0;0"

πŸ€” What is the Logic Engine for?

It allows you to create β€œsmart” commands. Instead of a command always doing the exact same thing, you can make it behave differently depending on the circumstances (for example, checking if the player has a special VIP rank, or if they have enough money in their Vault account).

πŸ› οΈ Practical Example: /heal command that charges money

πŸ‘€ View Code Example / Cases

You want to create a command called /heal that fills the player’s health, but costs 500 economy coins. Additionally, if the player is poor and doesn’t have enough money, the command should notify them of the cost and cancel the healing.

This is how the action list would look configured using the logic engine:

actions:
  - "[IF_MONEY] 500" # CONDITION: Does the player have at least 500 coins?
  - "[TAKE_MONEY] 500" # If the answer is YES, we take 500 coins...
  - "[HEAL]" # ...and heal them.
  - "[MESSAGE] &aYou have been healed for 500 coins."
  - "[IF_MONEY_NOT] 500" # CONDITION: Does the player have LESS than 500 coins?
  - "[MESSAGE] &cYou do not have enough money. It costs 500 coins." # If the answer is YES, we send the error message.

This level of advanced customization allows you to create complex systems without needing to know how to program!