Phoenix Store
Webstore
Plugins
Plugins
  • 🔌Phoenix Plugins
  • Plugins
    • 📦Phoenix Crates
      • 💎Features
      • 🛑Commands & Permissions
      • 🔍Placeholders
      • 💐Crate Engine Mode
        • 🌻Vanilla Block
        • 🌺Vanilla Model
        • 🌹Model Engine
      • 📦Add a Crate
        • 🖌️Edit Crate
        • 🔑Add a Key
        • 💥Misc Options
        • 🔓Extra Options
      • 🎉Animations
        • 🧍‍♂️Idle Animations
        • 🎇Opening Animations
        • 🎁Premade Animations
      • 🏆Rewards
        • 🎁Random
        • 📬Selective
        • 📦Add Rewards
          • ✏️Edit Reward
          • 🎟️Reward Chance
          • 🗃️Alternative Reward
      • 🎲Reroll
      • 🎯Milestones
      • 🔎Log the Actions
      • 🎑Customize Menus
      • 🚢Migration
      • 📁Main Configuration
      • 📂Crate Configuration File
      • 🤖Action Types
      • ⁉️Questions & Answers
        • ⁉️Does the plugin support bedrock versions?
        • ❓Why my crates can only be open by OP Players?
        • ❓Why my custom models are not being displayed correctly?
        • ❓Why my custom model from model engine keep flickering?
        • ❓Why my furtnite models are being destroyed when clicked?
        • ❓Why when using the chat from the editor there are color to the value?
        • ❔How do i check the animations of my custom model?
        • ❔How can i create a CSGO crate?
        • ❔How do i remove the amount of the item won from the Hologram?
        • ❔How can i create a reward where the player doesn't receive a Physical Item?
        • 🤔What is the difference between "Your Chance" and "Percentage" in the preview?
      • 🛠️GeyserMC (Bedrock)
      • 🗺️Plugin's RoadMap
      • 🌐API
        • 🔧Custom Animations
    • 🏠Phoenix Lobby
      • 💎Features
      • 🛑Commands & Permissions
      • 🔍Placeholders
      • ⛓️Integrate with Proxy
      • 🌎Integrate with Worlds
      • 🧍‍♀️Create NPCs
      • ⚙️NPC Engine
        • 🪽Flying Head
        • 🪁Huge Item
        • 🧑‍🤝‍🧑Citizens
        • 🐖Model Engine
      • 🏠Lobby
        • 🪄Items
      • 🔔Announcements
      • 🗨️Join Actions
      • 📁Main Configuration
      • 🤖Action Types
      • ⁉️Questions & Answers
        • ❓Why my compass is teleporting me?
        • ❓Why proxy command is not working on Velocity?
        • ❓Why my npcs keep disappearing?
        • ❔How to make Essentials overwrite /spawn command?
    • 🎣Phoenix Duels
      • 💎Features
      • 🛑Commands & Permissions
      • 🔍Placeholders
      • 🗺️Create a Map
        • 🔨Create an arena
        • 🎨Customize the Arena
        • 🖌️Edit the Arena
        • 🌀Duplicate an Arena
        • ☘️Arena Regeneration
      • 🎮Add a Mode
        • 🏹Create a Kit
        • ⚽Match Settings
        • 📋Scoreboard
      • 🕐Start a Match
      • 🥇Betting
      • 📖Statistics
      • 📐Player Settings
      • 🎑Customize Menus
      • 🗃️Configuration Files
        • 📁Main Configuration
        • 📁Map Configuration
        • 📁Mode Configuration
      • 🤖Action Types
      • ⚙️Settings
      • ⁉️Questions & Answers
        • ❓Why Regeneration causes lag to my server
        • ❓Why does the scoreboard stays the same even when i edit it?
        • ❔How can I use a void world for my arenas?
        • ❔How can i remove the kit items from being displayed in the menu?
        • 🤔What is the difference between Battle Region and the Universal Region?
    • ⚔️Phoenix Practice
      • 💎Features
      • 🛑Commands & Permissions
      • 🔎Placeholders
      • 🗺️Create a Map
        • 🔨Create an arena
        • 🎨Customize the Arena
        • 🖌️Edit the Arena
        • 🌀Duplicate an Arena
        • ☘️Arena Regeneration
      • 🎮Add a Mode
        • 🏹Create a Kit
        • ⚽Match Settings
        • 📋Scoreboard
      • 🌎Integrate with Worlds
      • 🕐Start a Match
      • 🥳Party
      • 🥇Elo
      • 🏠Lobby
        • 🪄Items
      • ✏️Create Custom Kits
        • 🎨Edit Kit Category
        • 🪁Add Items
        • 💺Configure Slots
      • 🖌️Kit Editor
      • 📖Statistics
      • 📐Player Settings
      • 🎑Customize Menus
      • 🗃️Configuration Files
        • 📁Main Configuration
        • 📁Map Configuration
        • 📁Mode Configuration
      • 🤖Action Types
      • ⚙️Settings
      • ⁉️Questions & Answers
        • ❓Why Regeneration causes lag to my server
        • ❓Why does the scoreboard stays the same even when i edit it?
        • ❔How can I use a void world for my arenas?
        • ❔How can i make npcs queue?
        • ❔How do i allow only Ranked mode?
        • ❔How can i remove the kit items from being displayed in the menu?
        • 🤔What is the difference between Battle Region and the Universal Region?
  • Others
    • 🤖API Usage
      • 🆕Custom Addons
  • Add-ons
    • 🎃Halloween Crate Animations
    • 🎅Christmas Crate Animations
Powered by GitBook
On this page
  • Yaml Syntax
  • Timer
  • Take Damage
  • Attack
  • Arrow Hit
  • Brew Potion
  • Catch Fish
  • Consume Item
  • Craft
  • Fall Damage
  • Harvest
  • Kill Entity
  • Kill Player
  • Move
  • Break Block
  • Place Block
  • Smelt
  • Sprint
  • Take Damage
  • Take Entity Damage
  • Trade Entity

Was this helpful?

  1. Others
  2. Scripting Language

Triggers

In our scripting language, triggers are essential for executing specific blocks of code based on various events occurring in the game.

Triggers can be initiated by player actions, game mechanics, or specific conditions, enabling you to create dynamic interactions and gameplay experiences.

Yaml Syntax

When working with our plugins, you can expect to define triggers and actions in a simple, readable format. For instance, you might configure something like this in YAML:

cool-thing:
  trigger: "onTick:20"
  actions:
  - 'player.send_message("&aA second just passed!")'

In this example, the trigger is set to activate every 20 ticks (which is approximately one second in Minecraft). When the trigger is activated, the actions specified will be executed, sending a message to the player. This straightforward approach makes it easy to customize and extend functionality within your scripts.

Below are the types of triggers available, categorized with their respective descriptions and associated variables.

Timer

The onTick trigger executes code at specified intervals, making it useful for periodic actions.

This requires an extra data which is the interval. Example: onTick:20

Available Variables:

  • event: Access the actual Spigot Event object.

  • interval: Represents the time interval since the last tick.


Take Entity Damage

The onEntityDamage trigger fires when an entity takes damage from any source.

Available Variables:

  • event: Access the actual Spigot Event object.

  • entity: The entity that received damage.

  • damage: The amount of damage dealt.


Take Damage

The onDamage trigger fires when a player or entity takes damage.

Available Variables:

  • event: Access the actual Spigot Event object.

  • entity: The entity taking damage.

  • damage: The amount of damage inflicted.

  • cause: The reason for the damage.


Attack

The onAttack trigger fires when a player attacks another entity.

Available Variables:

  • event: Access the actual Spigot Event object.

  • player: The player who initiated the attack.

  • target: The entity that was attacked.

  • damage: The damage inflicted by the player.


Arrow Hit

Description: The onArrowHit trigger fires when an arrow hits an entity or block.

Available Variables:

  • event: Access the actual Spigot Event object.

  • shooter: The entity that shot the arrow.

  • hit_block: The block that was hit by the arrow.

  • hit_entity: The entity that was hit by the arrow.


Brew Potion

The onBrewPotion trigger fires when a potion is brewed.

Available Variables:

  • event: Access the actual Spigot Event object.

  • player: The player who brewed the potion.

  • item: The type of potion brewed.


Catch Fish

The onCatchFish trigger fires when a player catches a fish.

Available Variables:

  • event: Access the actual Spigot Event object.

  • player: The player who caught the fish.

  • state: The state of the fishing event (e.g., whether the player caught something).

  • caught: The item that was caught (if applicable).


Consume Item

The onConsume trigger fires when a player consumes an item.

Available Variables:

  • event: Access the actual Spigot Event object.

  • player: The player consuming the item.

  • item: The item being consumed.

  • hand: The hand from which the item was consumed (main or off-hand).


Craft

The onCraft trigger fires when a player crafts an item.

Available Variables:

  • event: Access the actual Spigot Event object.

  • player: The player crafting the item.

  • recipe: The recipe used for crafting.

  • result: The item result of the crafting action.


Fall Damage

The onFallDamage trigger fires when an entity takes fall damage.

Available Variables:

  • event: Access the actual Spigot Event object.

  • entity: The entity that took fall damage.

  • damage: The amount of fall damage inflicted.


Harvest

The onHarvest trigger fires when a player harvests a crop or breaks a block.

Available Variables:

  • event: Access the actual Spigot Event object.

  • player: The player performing the harvest action.

  • block: The block being harvested or broken.


Kill Entity

The onKillEntity trigger fires when an entity is killed.

Available Variables:

  • event: Access the actual Spigot Event object.

  • killer: The entity responsible for the kill.

  • entity: The entity that was killed.

  • drops: The items dropped by the killed entity.


Kill Player

The onKillPlayer trigger fires when a player is killed.

Available Variables:

  • event: Access the actual Spigot Event object.

  • killer: The entity responsible for the player's death.

  • player: The player who was killed.

  • drops: The items dropped by the killed player.


Move

The onMove trigger fires when a player moves from one location to another.

Available Variables:

  • event: Access the actual Spigot Event object.

  • player: The player who moved.

  • from: The location from where the player moved.

  • to: The location to which the player moved.


Break Block

The onBreak trigger fires when a player breaks a block.

Available Variables:

  • event: Access the actual Spigot Event object.

  • player: The player breaking the block.

  • block: The block being broken.


Place Block

The onPlace trigger fires when a player places a block.

Available Variables:

  • event: Access the actual Spigot Event object.

  • player: The player placing the block.

  • block: The block being placed.

  • block_against: The block against which the new block is placed.


Smelt

The onSmelt trigger fires when an item is smelted in a furnace.

Available Variables:

  • event: Access the actual Spigot Event object.

  • player: The player performing the smelting action.

  • block: The furnace block being used.

  • result: The item produced from the smelting process.

  • amount: The number of items produced.


Sprint

The onSprint trigger fires when a player starts or stops sprinting.

Available Variables:

  • event: Access the actual Spigot Event object.

  • player: The player who started or stopped sprinting.


Take Damage

The onDamage trigger fires when an entity takes damage.

Available Variables:

  • event: Access the actual Spigot Event object.

  • entity: The entity that took damage.

  • damage: The amount of damage taken.

  • cause: The cause of the damage.


Take Entity Damage

The onEntityDamage trigger fires when an entity takes damage from another entity.

Available Variables:

  • event: Access the actual Spigot Event object.

  • player: The player receiving damage.

  • damager: The entity that inflicted the damage.

  • damage: The amount of damage dealt.


Trade Entity

The onTradeEntity trigger fires when a player trades with a villager or another entity.

Available Variables:

  • event: Access the actual Spigot Event object.

  • player: The player engaged in the trade.

  • current_item: The item currently being traded.

  • offered_items: The items offered by the player for trade.

Last updated 6 months ago

Was this helpful?