Skip to content

Conditions and Executors

Draww edited this page Jan 22, 2020 · 9 revisions

With conditions and executors you will be able to completely control the rank jump process. How much money the player has, how much item has. you'il be able to run conditions like that and you can do things you want to do after rank has been raised, like sending messages, giving items.


Conditions:

  • Money It is used to check how much money is in the player.
conditions:
  example_cond:
    queue: 1
    type: MONEY
    message: "&cYou don't have enough money [&e%value%&c]" #<--- the value "%value%" comes from below.
    value: 1500.00
  • Exp It is used to check the amount of the player's exp.
conditions:
  example_cond:
    queue: 1
    type: EXP
    message: "&cYou don't have enough exp [&e%value%&c]" #<--- the value "%value%" comes from below.
    value: 5
  • Has Item It is used to check the player's items
conditions:
  example_cond:
    queue: 1
    type: ITEM
    message: "&cYou don't have %item.amount% %item.material%" #<--- the values "%item.amount%" and "%item.material%" comes from below.
    item:
      material: APPLE
      amount: 3
  • PlayTime It is used to check the player's play time
conditions:
  example_cond:
    queue: 1
    type: PLAY_TIME
    message: "&cYour playing time is insufficient. %reqTime% required. now %onlineTime%"
    time: 86400 # second

Executors:

  • Message Sends a message to the player who jumps to the rank
executors:
  example_exec:
    queue: 1
    type: MESSAGE
    value: "&aRank Up! &6%rank_group%" #<--- Rank placeholders: "%rank%", "%rank_group%"
  • ActionBar Message Sends a actionbar message to the player who jumps to the rank
executors:
  example_exec:
    queue: 1
    type: ACTIONBAR_MESSAGE
    value: "&aRank Up! &6%rank_group%" #<--- Rank placeholders: "%rank%", "%rank_group%"
  • Broadcast Message Sends messages to all players on the server
executors:
  example_exec:
    queue: 1
    type: BROADCAST_MESSAGE
    value: "&aRank Up! &6%player_name% &8(&e%rank_group%&8)" #<--- Rank placeholders: "%rank%", "%rank_group%"
  • Broadcast ActionBar Message Sends actionbar messages to all players on the server
executors:
  example_exec:
    queue: 1
    type: BROADCAST_ACTIONBAR_MESSAGE
    value: "&aRank Up! &6%player_name% &8(&e%rank_group%&8)" #<--- Rank placeholders: "%rank%", "%rank_group%"
  • Withdraw Money withdraws from the player who jumps to the rank.
executors:
  example_exec:
    queue: 1
    type: WITHDRAW_MONEY
    value: 500.00
  • Deposit Money deposits from the player who jumps to the rank.
executors:
  example_exec:
    queue: 1
    type: DEPOSIT_MONEY
    value: 500.00
  • Console Command Runs the command from the console.
executors:
  example_exec:
    queue: 1
    type: CONSOLE_COMMAND
    value: "say rankup"
  • Player Command Runs the command from the player.
executors:
  example_exec:
    queue: 1
    type: PLAYER_COMMAND
    value: "examplecmd"
  • Sound Plays Minecraft Sounds

sounds list

executors:
  example_exec:
    queue: 1
    type: SOUND
    value: BLOCK_ANVIL_BREAK
  • Teleport Sends the player to coordinates.
executors:
  example_exec:
    queue: 1
    type: TELEPORT
    value: World;165;25;237
  • Give Item Gives the item to the player's inventory
executors:
  example_exec:
    queue: 1
    type: GIVE_ITEM
    item:
      material: DIAMOND_BLOCK
      amount: 3
  • Remove Item Removes the item to the player's inventory
executors:
  example_exec:
    queue: 1
    type: REMOVE_ITEM
    item:
      material: APPLE
      amount: 3
  • run javascript code (nashorn, javascript)
executors:
  example_exec:
    queue: 1
    type: JS
    file: file_name #<--- it should be in the scripts file.
    #value: | #<--- or u can write direct value
      #player.sendMessage(TextUtil.colorize("&aTest"));

file_name.js

player.sendMessage(TextUtil.colorize("&bHello, " + player.getName()));
bukkitServer.broadcastMessage("SuperRankup is being used on this server.");

A complete example:

example_rank1:
  group: example_group
  queue: 1
  icon:
    low:
      template: custom_low
    jump:
      material: DIAMOND_BLOCK:0
      amount: 1
      name: '&b%rank%'
      lores:
        - "&aYou need $1500 to raise your rank."
    high:
      template: custom_high
    equal:
      template: custom_equal
  conditions:
    cond_1:
      queue: 1
      type: MONEY
      message: "&cYou don't have enough money [&e%value%&c]"
      value: 1500.00
    cond_2:
      queue: 2
      type: HAS_ITEM
      message: "&cYou don't have %item.amount% %item.material%."
      item:
        material: APPLE
        amount: 3
  executors:
    exec_1:
      queue: 1
      type: MESSAGE
      value: "&aRank Up! &6%rank_group%"
    exec_2:
      queue: 2
      type: REMOVE_ITEM
      item:
        material: APPLE
        amount: 3
    exec_3:
      queue: 3
      type: GIVE_ITEM
      item:
        material: DIAMOND_BLOCK
        amount: 3
        name: "&b%rank_group% Gift 1"