Actions

A list of all actions with examples.

Generator Actions

Keep Stage

Stay on the current stage when a generator block is mined. (Same behavior as if idle was true)

on-break:   # Only works on-break
  do: keepStage

Grow Stage

Grow the generator to the next stage.

do: growStage

Next Stage

Set the generator to the next non-transitional stage.

do: nextStage

Set Stage

Set the generator to a specific stage.

do: setStage 1

Damage Generator

Decrease the health of the current generator stage.

do: damageGenerator 1-3   # Do 1 to 3 damage

do: damageGenerator   # Leave empty to use config.yml powerful damage options
                      # i.e. tool type, efficiency, ect..

Server Actions

Broadcast

Sends a chat message to all players on the server. Supports placeholders and color codes.

do: broadcast <This is a broadcast message>

Lightning

Strikes lightning at a specific coordinate in a given world.

  • Optional: world, doDamage

do: lightning world=world_name x=0 y=0 z=0 doDamage=true

Console Command

Runs a command from the server console.

do: consoleCommand <say Hello World!>

Drop Item

Drops a specific item at a given coordinate.

  • Optional: world

do: dropItem dirt world=world_name x=0 y=0 z=0

Drop Exp

Drops specific exp at the given coordinate. Supports amount (fixed, ranged, multi).

  • Optional: world, orbs

do: dropExp 100 orbs=100 world=world_name x=0 y=0 z=0

do: dropExp 10-100 x=0 y=0 z=0

do: dropExp 50;100 orbs=1-10 x=0 y=0 z=0

Spawn Particle

Spawns a particle effect at a specific coordinate.

  • Optional: world

do: spawnParticle particle_name world=world_name x=0 y=0 z=0

Play Sound

Plays a sound at a specific coordinate.

  • Optional: world

do: playSound sound_name world=world_name x=0 y=0 z=0

Function Actions

Stop

Ends function execution completely when called from anywhere.

function:
  do:
    - stop
    - chatMessage <This message will NOT be sent!>

Even when used inside a global function:

# Global Function
giveDiamondIfFirstJoin:
  if: hasPlayedBefore
  do:
    - chatMessage <This is the first time playing huh? Have a diamond!>
    - giveItem diamond 
    - stop

on-break:
  - giveDiamondIfFirstJoin
  - do: chatMessage <This message will NOT be sent!>

Return

Ends current function execution. It will only have effect on the function it is used in.

function:
  do:
    - return
    - chatMessage <This message will NOT be sent!>

When used inside a global function:

# Global Function
giveDiamondIfFirstJoin:
  if: hasPlayedBefore
  do:
    - chatMessage <This is the first time playing huh? Have a diamond!>
    - giveItem diamond 
    - return

on-break:
  - giveDiamondIfFirstJoin
  - do: chatMessage <This message will be sent!>

Goto

Go to a specific line in a multi function. It is kind of pointless and I discourage you from using it.

  • DANGEROUS: if used improperly it will cause a StackOverflowError and crash your server.

function:
  - if-not: hasPermission example.permission
    do: goto 5
  - if-not: hasMoney 1000
    do: goto 5
  - if-not: hasExpLevel 100
    do: goto 5
  - do: chatMessage <&aYou met all requirements.>
  - do: chatMessage <&4You are missing some requirements.>

Event Actions

Cancel Event

Stops the event that triggered the function from continuing.

Supported by: on-break

# Triggered by GeneratorBreakEvent
on-break:   
  do: cancelEvent # The generator stays on the current stage and items/exp are not dropped

Set Cancelled

Manually sets whether the event is cancelled (true or false).

do: setCancelled true

Block Actions

Strike Block

Creates a lightning effect on the block that was interacted with.

do: lightningAtBlock

Drop Item at Block

Drops an item from the block towards the player or on top of the block.

do: dropItemAtBlock dirt

# Specify the amount
do: dropItemAtBlock lapis_lazuli amount=2-3

# Do fortune drop if the player's tool has the enchant
do: dropItemAtBlock diamond doFortune=true

# Combined
do: dropItemAtBlock redstone amount=1-4 doFortune=true

Spawn Particle at Block

Spawns a particle effect on the block.

Play Sound at Block

Plays a sound directly on the block.


Player Actions

Drop Item at Player

Drops an item at the player's location.

Spawn Particle at Player

Spawns a particle effect on the player.

Play Sound at Player

Plays a sound for the player.

Give Exp

Gives a specific amount of experience points to the player.

Give Flag

Assigns a flag to the player.

Give Item

Gives a specific item to the player.

Give Money

Gives a specific amount of money to the player.

Take Exp

Removes a specific amount of experience points from the player.

Take Flag

Removes a flag from the player.

Take Item

Removes a specific item from the player's inventory.

Take Money

Removes a specific amount of money from the player.

Set Exp

Sets the player's experience points to a specific value.

Heal

Restores a specific amount of health to the player.

Damage

Deals a specific amount of damage to the player.

Command

Runs a command as the player.

Chat Message

Sends a chat message to the player.

Message

Sends a predefined message to the player.

Strike Player

Creates a lightning effect on the player.

Set Flight

Enables or disables flight for the player.

Teleport

Teleports the player to a specific coordinate and rotation.

Open Ender Chest

Opens the player's ender chest.

Damage Tool

Damage the player's main hand tool. Compatible with unbreaking enchant.

do: damageTool   # Default damage is 1

do: damageTool 3

do: damageTool 1-3

Last updated