Sueta
EV

EventCmds

1.2.1

Bind commands to events | Variables

·Plugin

EventCmds 1.2.1
Bind commands to events

Events, Variables

Variable types

Player
.name string Player name (M1nef4n)
.uuid string Player uuid (8b1be82e-f06c-3f6d-9e16-a14be50f57ad)
.hp number (decimal) Health (20.0, 15.8, 0.85, ...)
.hpi number (integer) Health as integer (20, 15, 0, ...)
.foodlevel number (integer) Foodbar (20, 12, 1, 0, ...)
.saturation number (decimal) Saturation level (5.0, 4.8, 1.1, ...)
.saturationi number (integer) Saturation as integer (5, 4, 1, ...)
.exp number (decimal) Experience bar (from 0 to 1) (0.9, 0.1111, ...)
.level number (integer) Level
.gamemode string Current GameMode (CREATIVE, SURVIVAL, ADVENTURE, SPECTATOR)
.gamemodei number (integer) Current GameMode as integer (1, 0, 2, 3)
.sneak boolean Is player sneaking? (true/false)
.sneaki number (integer) Is player sneaking? as integer (1/0)
.fly boolean Is player flying? (true/false)
.flyi number (integer) Is player flying? as integer (1/0)
.sprint boolean Is player sprinting (true/false)
.sprinti number (integer) Is player sprinting? as integer (1/0)
.ip string Player IP (35.164.99.178)
.loc type Location Player actual location
.hand type Item Item in hand

Block

.loc
type Location Block location
.id number (integer) Block id (264, 0, 3, 1, 35, ...)
.material string (DIAMOND, AIR, DIRT, STONE, WOOL, ...)
.data number (integer) Block data (wool color, clay color, ...)

Item
.id
number (integer) (276, ...)
.material string (DIAMOND_SWORD, ...)
.data number (integer)
.durability number (integer)
.amount number (integer)

Location
.worldname
string
.x number (decimal)
.y number (decimal)
.z number (decimal)
.yaw number (decimal)
.yawi number (integer)
.pitch number (decimal)
.pitchi number (integer)
.bx number (integer) Block x
.by number (integer) Block y
.bz number (integer) Block z
.xi number (integer) Same as bx
.yi number (integer) Same as by
.zi number (integer) Same as bz

Events

join
When player joins the server
$player type Player
say Player $player.name joined the server on location $player.loc.x $player.loc.y $player.loc.z

leave
When player leaves the server
$player type Player
say Player $player.name left the server with $player.hp HP!

blockbreak
When player breaks the block
$player type Player
$block type Block Broken block
say Player $player.name broke the block ($block.id) on $block.loc.x $block.loc.y $block.loc.z

blockplace
When player places the block
$player type Player
$block type Block Placed block
say Player $player.name built the block $block.id:$block.data

rightclick
When player rightclicks (air or block)
$player type Player
$item type Item Item in hand

rightclickblock
When player rightclicks on block
$player type Player
$item type Item Item in hand
$block type Block Clicked block
tell $player.name This is $block.material ($block.id:$block.data)

rightclickair
When player rightclicks the air
$player type Player
$item type Item Item in hand

leftclick
When player leftclicks (air or block)
$player type Player
$item type Item Item in hand

leftclickblock
When player leftclicks on block
$player type Player
$item type Item Item in hand
$block type Block Clicked block

leftclickair
When player leftclicks the air
$player type Player
$item type Item Item in hand

playerdeath
When player dies
$player type Player

playerkillplayer
When player kills another player
$killer type Player Killer
$victim type Player Killed player

respawn
When player clicks the respawn button
$player type Player
$bed boolean Has bed to respawn in? (true/false)
$bedi number (integer) Has bed to respawn in? as number (1/0)

sneak
When player toggles sneak
$player type Player
$sneak boolean Is now sneaking? (true/false)
$sneaki number (integer) Is now sneaking? as number (1/0)

Commands

  • /eventcmds reload - reloads config.yml

Permissions

  • eventcmds.reload - permission to /eventcmds reload

Cheatsheet

Spoiler
Event               Variables
-----------------------------------------------------------------------------
join                player (impl Player)
leave               player (impl Player)
blockbreak          player (impl Player), block (impl Block)
blockplace          player (impl Player), block (impl Block)
rightclick          player (impl Player), item (impl Item)
rightclickblock     player (impl Player), item (impl Item), block (impl Block)
rightclickair       player (impl Player), item (impl Item)
leftclick           player (impl Player), item (impl Item)
leftclickblock      player (impl Player), item (impl Item), block (impl Block)
leftclickair        player (impl Player), item (impl Item)
playerdeath         player (impl Player)
playerkillplayer    killer (impl Player), victim (impl Player)
respawn             player (impl Player), bed, bedi
sneak               player (impl Player), sneak, sneaki

-----------------------------------------------------------------------------
Player:
  name, uuid, hp, hpi, foodlevel, saturation, saturationi,
  exp, level, gamemode, gamemodei, sneak, sneaki,
  fly, flyi, sprint, sprinti, ip,
  loc (impl Location), hand (impl Item)

Location:
  worldname, x, y, z, yaw, yawi, pitch, pitchi
  bx, by, bz (same as xi, yi, zi)

Item:
  id, material, data, durability, amount

Block:
  loc (impl Location), id, material, data


Conditions

You can use all variables defined in specific event

Spoiler
1:
  event: rightclickblock
  if:
    block.id: "[1,4]" #list - stone or cobblestone
    player.hp: ">=10" #greater or equal 10
    player.gamemode: "!=CREATIVE" #not creative
    player.loc.worldname: "my_world" #worldname equals 'my_world'
    block.loc.y: "range:0,64" #from 0 to 64 (inclusive)
    player.hand.amount: "<6" #clicked with less than 6 items in hand
  cmd: "say Player $player.name clicked on $block.material with $player.hp health!"

[a,b,c,...] list (contains value)
![a,b,c,...] list (does not contain value)
= equal
!= not equal
< less than
> greater than
<= less or equal
>= greater or equal
range:from,to is value in range (inclusive)
!range:from,to is value not in range (inclusive)

Config

1:
  event: blockbreak
  if:
    block.id: 17
    player.level: "<10"
    player.hand.id: "!=258"
  cmd: "tell $player.name You can only break block $block.material with iron axe"

  delay: 0 #(in ticks) delay command execution
  ignoreCancelled: false #command will be executed even when other plugin cancel this event (Residence, Plot)
  cancel: true #cancel event - block will not be broken)


Todo

  • Add more events

Similar projects

Plugin →