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
  • 1. Core Syntax
  • 2. Data Types
  • 3. Variables
  • 4. Operators

Was this helpful?

  1. Others
  2. Scripting Language

Syntax and Semantics

1. Core Syntax

The syntax of our language combines elements of Ruby and Java. It's designed to be simple and easy to read, with all keywords and function names written in lowercase, separated by underscores when necessary. For example, to send a message to a player, you would write:

player.send_message("Hello World")

2. Data Types

Our language supports the following basic data types:

  • Numbers: Includes both integers and floating-point numbers.

health = 20
damage = 12.5
  • Strings: Textual data, surrounded by double quotes.

"Hello World"
  • Booleans: Represents true or false values.

true
false
  • Enums: To work with enum values, you need to prefix the enum with a :. For example, setting a player’s gamemode:

player.gamemode = :SURVIVAL

3. Variables

Variables are dynamically typed and can be defined by simply assigning a value. You can access both variables and functions using the dot notation.

Defining Variables:

cool_name = "Steve"
health = 100

Accessing Variables and Functions: You can access variables and call functions using the dot notation. For example:

player.health // Accessing a variable
player.send_message("Hello, {{player.name}}!")  // Calling a variable and accessing a function

Embedding Variables and Function Calls in Strings: You can include both variables and function calls inside strings using {{}} to create dynamic messages:

// You can send a String directly to the send_message function
player.send_message("Am I sneaking? {{player.sneaking?}}")

// Or you can save it on a variable first 
cool_variable = "Am I sneaking? {{player.sneaking?}}"
player.send_message(cool_variable)

4. Operators

Arithmetic Operators: You can use standard operators like +, -, *, /, and % for calculations.

score = 10
score += 5  // Increment by 5
health -= 10  // Decrement by 10

Comparison Operators: These include ==, !=, >, <, >=, and <= for comparing values.

player.health >= 10 // Returns true if health is greater than 10
player.gamemode == :SURVIVAL // Returns true if gamemode is survival

Logical Operators: Use && for AND, || for OR, and ! for NOT operations.

// Same as: Is player sneaking and his health is greather than 10?
player.sneaking? && player.health > 10 

Assignment Operators: For modifying variables, you can use compound assignment operators such as +=, -=, *=, and /=.

player.level += 10 // Will add 10 levels
player.health -= 2 // Will remove 2 units of health

Last updated 6 months ago

Was this helpful?