Starting Point
Please watch the video below after giving this entire wiki a quick read
Understanding Template Codes
Abilities (commands that have certain rules) are formed by different sections. To create abilities, look at this guide and also see the comments in config files. Begin by checking those comments carefully.
Please note that CUSTOMABILITY and other abilities exist and can be used in different ways!
Template codes often appear in abilities (inside the commands section of each ability). However, some events do not use them:
- {name}: Refers to the player using the ability. If the ability is in the player's list, {name} is that player.
- {hitPlayer}: This stands for another player affected by the ability. For example, CUSTOM[num] might target nearby players, so {hitPlayer} would be any target(s). It is not the player using the ability.
- {x}, {y}, {z}: Coordinates (or location placeholders), usually processed for each entity affected.
You can do math on these coordinates. For instance, {[mathX+num]}, {[mathY+num]}, {[mathZ-num]} and so on. Only one operation is allowed per placeholder.
You can insert placeholders like {[mathX+100]}, {[mathY-10]}, {[mathZ*3]}, or {[mathZ/2]} to replace {x}, {y}, {z} and shift coordinates accordingly.
The rand() function can be used within commands to select something randomly. For example: rand(banana, apple, carrot) picks one of those three randomly.
Example of an ability using rand():CUSTOMABILITY====IRON_INGOT===say rand(hey, hello, hi) i executed====100====10====SELF====ALL====RIGHTCLICKAIR
Helpful resources:
- Biome Documentation
- Material Type Documentation - This is used instead of the 'IDENTIFIER' for many event types (e.g., right-clicking air with an APPLE in hand).
- Entity Type Documentation
- Particle Type Documentation
- Damage Cause Names
Guide to Creating Custom Abilities
A custom ability is separated into different parts using====. Below is the structure of a custom ability:
CUSTOMABILITY===={IDENTIFIER}===={commands}====10===={milliseconds}===={self}===={target}===={event type}
Breaking it down:
- CUSTOMABILITY: Indicates that you're creating a custom ability.
- {IDENTIFIER}: The item or block (or other element) used for an event. Sometimes this might be ignored if your event doesn't require it.
- {commands}: The command(s) run when the conditions are met.
- 10: This is the percent chance (0-100) for the ability to happen when triggered. In this example, it's a 10% chance.
- {milliseconds}: The cooldown between triggers of this ability, in milliseconds.
- {self} or CUSTOM[num]: Decides if the command affects the player themself (SELF) or nearby entities within [num] blocks.
- {target}: Who's targeted by the ability. Options include ALL, PLAYERS, MOB, ANIMALS, and more.
- {event type}: Determines when or how the ability is triggered (right click, left click, block break, etc.).
Understanding Event Types
The last argument {event type} can be many different triggers, indicating how or when the ability is used. Below are the common ones:
- RIGHTCLICKBLOCKHAND: Happens when a block is right clicked with a specific material in hand. Replace {IDENTIFIER} with the material.
- RIGHTCLICKBLOCK: Happens when you right click a certain block. Replace {IDENTIFIER} with a material (block).
- RIGHTCLICKAIR: Happens when you right click the air with a specific item. Replace {IDENTIFIER} with a material.
- LEFTCLICKBLOCKHAND: Similar but left-clicking a block with a certain item in hand.
- LEFTCLICKBLOCK: Left-clicking a specific block. {IDENTIFIER} is that block's material.
- LEFTCLICKAIR: Left-clicking the air with a specific item.
- BLOCKBREAK: Breaking a specific block.
- BLOCKPLACE: Placing a specific block.
- RIGHTCLICKAIRCONSUME: Right-clicking an item in the air that gets consumed (like food). Replace {IDENTIFIER} with that item.
- LEFTCLICKAIRCONSUME: Left-clicking an item in the air that gets consumed.
- ENTERBED: Happens when the player enters a bed. Replace {IDENTIFIER} with "placeholder."
- SLEEPING: Happens when the player is actually sleeping in bed. Replace {IDENTIFIER} with "placeholder."
- EXITBED: Happens when the player leaves a bed. Replace {IDENTIFIER} with "placeholder."
- EXITVEHICLE: Leaving a vehicle. {IDENTIFIER} can be [HORSE, MINECART, BOAT].
- ENTERVEHICLE: Entering a vehicle. {IDENTIFIER} can be [HORSE, MINECART, BOAT].
- WORLDCHANGEEVENT: Changing worlds/dimensions. {IDENTIFIER} is a world name.
- COMBUSTEVENT: When the player catches fire (combusts). {IDENTIFIER} is "placeholder."
- EXPLODEEVENT: Involvement in an explosion. {IDENTIFIER} is "placeholder."
- ISSWIMMINGEVENT: When the player is swimming. {IDENTIFIER} is "placeholder."
- ISFLYINGEVENT: When the player is flying. {IDENTIFIER} is "placeholder."
- ISFALLINGEVENT: When the player is falling. {IDENTIFIER} is "placeholder."
- BLOCKEXPLOSIONEVENT: A block explodes near the player. {IDENTIFIER} is "placeholder."
- ENTITYEXPLOSIONEVENT: An entity explodes near the player. {IDENTIFIER} is "placeholder."
- CRAMMINGEVENT: Entity cramming occurs near the player. {IDENTIFIER} is "placeholder."
- FALLDAMAGEEVENT: The player takes fall damage. {IDENTIFIER} is "placeholder."
- FIREHURTEVENT: The player is hurt by fire. {IDENTIFIER} is "placeholder."
- SUFFOCATIONHURTEVENT: The player is suffocating. {IDENTIFIER} is "placeholder."
- PLAYERRESPAWN: The player respawns. {IDENTIFIER} is "placeholder."
- ISSLEEPING: The player is sleeping. {IDENTIFIER} is "placeholder."
- ISBLOCKING: The player is blocking with a shield. {IDENTIFIER} is "placeholder."
- CRAFTITEM: The player crafts an item. Replace {IDENTIFIER} with a material name.
- WEARINGARMOR: The player is wearing specific armor. Replace {IDENTIFIER} with a material or a custom model ID (like "IRON_INGOT,100:").
- TIME: Triggers at a certain time of day in the world. Replace {IDENTIFIER} with a specific world time.
- PICKUPEVENTCANCEL: Cancels picking up a specific item from the ground. Replace {IDENTIFIER} with a material.
- PICKUPEVENT: Triggers when picking up a certain item. Replace {IDENTIFIER} with a material.
- PASSIVE: Passively triggered based on a timer in
config.yml
. {IDENTIFIER} can be "placeholder." - ISSPRINTING: The player is sprinting. {IDENTIFIER} is "placeholder."
- INBIOME: The player is in a specified biome. {IDENTIFIER} is the biome name.
- DAMAGECAUSEEVENTCANCEL: Cancels a certain damage cause event. {IDENTIFIER} is the damage cause name.
- HOLDINGITEM: The player is holding a specific item. {IDENTIFIER} is that item (e.g., IRON_SWORD).
- HOLDITEM: The player holds a specific item, but triggers once. {IDENTIFIER} is the item.
- HASPOTIONTYPE: The player has a certain potion effect. {IDENTIFIER} is the effect.
- DAMAGECAUSEEVENT: A damage cause occurs. {IDENTIFIER} is the damage cause name.
- PLAYERKILLENTITY: The player kills a certain entity type. {IDENTIFIER} is that entity.
- ISSNEAKING: The player is sneaking. {IDENTIFIER} is "placeholder."
- HASITEMINVENTORY: The player’s inventory has a specific item. {IDENTIFIER} is that material.
- DEATHEVENTCANCEL: Cancels the player’s death. {IDENTIFIER} is "placeholder."
- DEATHEVENT: Triggered on the player’s death. {IDENTIFIER} is "placeholder."
- DEATHEVENTCAUSE: Triggered on player’s death by a specific cause. {IDENTIFIER} is the damage cause.
- DEATHEVENTCAUSECANCEL: Cancels the death event if it was caused by a certain type. {IDENTIFIER} is the damage cause.
- CHATWHISPEREVENT: Cancels chat whisper event and runs a command. {IDENTIFIER} is the text needed in chat. This also hides the message. (Not a /msg event, it is triggered by the user saying certain text.)
- CHATLOUDEVENT: Triggered by certain words in chat. {IDENTIFIER} is the text. This does not cancel the message from chat.
- PLAYERCONSUMEEVENT: The player consumes a specific item. {IDENTIFIER} is the material name.
- PLAYERJOINEVENT: Triggered when the player joins the server.
- BELOW: The events below are the same types but require the player to be SHIFTING (sneaking). The IDENTIFIERS remain the same, but occur if the player is sneaking.
- SHIFTDEATHEVENT: The player dies while sneaking.
- SHIFTRIGHTCLICKBLOCKHAND: Right-clicking a block while sneaking, with an item in hand.
- SHIFTRIGHTCLICKBLOCK: Right-clicking a specific block while sneaking.
- SHIFTRIGHTCLICKAIR: Right-clicking air with a specific item while sneaking.
- SHIFTLEFTCLICKBLOCKHAND: Left-clicking a block with an item in hand while sneaking.
- SHIFTLEFTCLICKBLOCK: Left-clicking a specific block while sneaking.
- SHIFTLEFTCLICKAIR: Left-clicking air with a specific item while sneaking.
- SHIFTBLOCKBREAK: Breaking a block while sneaking.
- SHIFTBLOCKPLACE: Placing a block while sneaking.
- SHIFTRIGHTCLICKAIRCONSUME: Right-click + consume an item while sneaking.
- SHIFTLEFTCLICKAIRCONSUME: Left-click + consume an item while sneaking.
- SHIFTENTERBED: Entering a bed while sneaking.
- SHIFTSLEEPING: Sleeping in bed while sneaking.
- SHIFTEXITBED: Exiting a bed while sneaking.
- SHIFTEXITVEHICLE: Exiting a vehicle while sneaking.
- SHIFTENTERVEHICLE: Entering a vehicle while sneaking.
- SHIFTWORLDCHANGEEVENT: Changing worlds while sneaking.
- SHIFTCOMBUSTEVENT: The player combusts while sneaking.
- SHIFTEXPLODEEVENT: The player is involved in an explosion while sneaking.
- SHIFTISSWIMMINGEVENT: The player is swimming while sneaking.
- SHIFTISFALLINGEVENT: The player is falling while sneaking.
- SHIFTBLOCKEXPLOSIONEVENT: A block explodes near the player while sneaking.
- SHIFTENTITYEXPLOSIONEVENT: An entity explodes near the player while sneaking.
- SHIFTCRAMMINGEVENT: Entity cramming occurs near the player while sneaking.
- SHIFTFALLDAMAGEEVENT: The player takes fall damage while sneaking.
- SHIFTFIREHURTEVENT: The player is hurt by fire while sneaking.
- SHIFTSUFFOCATIONHURTEVENT: The player suffocates while sneaking.
- SHIFTPLAYERRESPAWN: The player respawns while sneaking.
- SHIFTISSLEEPING: The player is sleeping while sneaking.
- SHIFTISBLOCKING: The player is blocking while sneaking.
- SHIFTWEARINGARMOR: The player is wearing specific armor while sneaking.
- SHIFTTIME: A certain time of day while sneaking.
- SHIFTPICKUPEVENTCANCEL: Cancels pickup of a certain item while sneaking.
- SHIFTPICKUPEVENT: Picks up a certain item while sneaking.
- SHIFTPASSIVE: Triggered passively while sneaking.
- SHIFTISSPRINTING: The player is sprinting while sneaking.
- SHIFTINBIOME: The player is in a specific biome while sneaking.
- SHIFTDAMAGECAUSEEVENTCANCEL: Cancels a certain damage cause event while sneaking.
- SHIFTHOLDINGITEM: The player holds a certain item while sneaking.
- SHIFTHOLDITEM: Triggered once when the player holds a certain item while sneaking.
- SHIFTHASPOTIONTYPE: The player has a certain potion effect while sneaking.
- SHIFTDAMAGECAUSEEVENT: A damage cause event occurs while sneaking.
- SHIFTPLAYERKILLENTITY: The player kills a certain entity while sneaking.
- SHIFTISSNEAKING: The player is sneaking (so it's basically sneaking within a sneaking event).
- SHIFTHASITEMINVENTORY: The player’s inventory has a certain item while sneaking.
- SHIFTPLAYERCONSUMEEVENT: Consuming a certain item while sneaking.
- SHIFTPLAYERJOINEVENT: Player joins the server while sneaking. (Basically if they log in sneaking.)
These event types let you decide the exact conditions for your ability. You can have as many abilities as you want for a race/class. Each one can trigger differently!
Common Components Throughout Abilities
All abilities in this plugin share certain elements that define how they function:
- Type of ability: e.g. CUSTOMABILITY, INFLICTDAMAGEEVENT, etc.
- Event: When the ability runs, based on
IDENTIFIER
. - IDENTIFIER: This is required for many events to specify which block/item/entity you’re interacting with.
- Command: The actual command that runs when triggers are met (with placeholders, etc.).
- Chance: The percent that this ability occurs (0-100).
- Cooldown: The time in milliseconds before this ability can be tried again.
There are also some common aspects specifically for CUSTOMABILITY:
- Self or Nearby Entities: Do commands affect only the player (SELF) or a group of entities near them (CUSTOM[num])?
- Target Type: If you choose CUSTOM[num], you can target ALL, PLAYERS, MOBS, or ANIMALS within [num] blocks.
Ability Examples
Below are two straightforward examples using CUSTOMABILITY:
Example 1: Heal the player when they right-click the air holding a diamond. There’s a 10ms cooldown, and it has a 50% chance to happen, plus it consumes the diamond:
CUSTOMABILITY====DIAMOND====execute at {name} run effect give {name} regeneration 10 10====50====10====SELF====ALL====RIGHTCLICKAIRCONSUME
Sometimes you don’t need an IDENTIFIER
. Then you can use “placeholder” in its place.
Example 2: Make an aura of regeneration around the player when they enter a bed, healing nearby entities within 5 blocks (but not the player) with a 10ms cooldown and 100% chance:
CUSTOMABILITY====placeholder====execute at {name} run effect give @e[sort=nearest,x={x},y={y},z={z},limit=1] minecraft:regeneration 3 10====100====10====CUSTOM5====ALL====ENTERBED
Here, “execute at name” is a vanilla command snippet, which defines the place (world) to run the command. Plugin commands may not need that style.
This covers the fundamentals of abilities. Next, we’ll look at more advanced abilities.
Other Types of Abilities
Abilities are special features that players get. Below are several simpler ability types (beyond CUSTOMABILITY). All their relevant lines go inside your race or class config.
1. Inflict Damage Event
INFLICTDAMAGEEVENT====[command]====[chance]====[cooldown]
- This triggers when the player inflicts damage on an entity.
- [command]: command that is executed when triggered
- [chance]: 0-100 for percent chance
- [cooldown]: milliseconds
Example: INFLICTDAMAGEEVENT====say hello====10====10000
When the player damages an enemy, there’s a 10% chance to say “hello,” and it has a 10-second cooldown (10000ms).
2. Receive Damage from Entity
RECIEVEDAMAGEFROMENTITY====[command]====[chance]====[cooldown]
- Triggers when the player receives damage from an entity.
- [command]: command when triggered
- [chance]: 0-100 percent
- [cooldown]: ms
Example: RECIEVEDAMAGEFROMENTITY====say hello====10====10000
If a player is damaged by an enemy, it has a 10% chance to say “hello,” and a 10-second cooldown.
3. Level Up Event
LEVELUP====[command]
OR
LEVELUP====[command]====[level needed to execute command]
- Occurs when a player levels up in their race.
- [command]: The command to run
- [level needed]: Optional, triggers only at that level.
Example 1: LEVELUP====say wow look {name} leveled up
Example 2: LEVELUP====say Wow look {name} leveled up at 10?!?!====10
Example 1 runs whenever the player levels up. Example 2 runs only at level 10.
4. Friendly Mobs
FRIENDLYMOBS====[MOBNAME,MOBNAME,etc]
- Makes these mobs friendly to the player.
Example: FRIENDLYMOBS====ZOMBIE,WITCH
(So ZOMBIE and WITCH won't attack the player.)
5. Projectile Event
PROJECTILEEVENT====[IDENTIFIER/Projectile]====[command]====[chance]====[cooldown]
- Triggers when the player damages with a certain projectile.
Example: PROJECTILEEVENT====ARROW====say hello====10====10000
(So using an arrow to damage an enemy has a 10% chance to say “hello”.)
6. Additional Damage to Race/Class
EXTRADMG====RACE/CLASS====[num]
- Grants extra damage to that race or class.
Example: EXTRADMG====Cat====3.0
(You deal 3.0 extra damage to players of race “Cat”.)
7. Immune to X
IMMUNETOX====POTIONEFFECT
- Makes a player immune to certain potion effects (checked every "timerCheckingPotionEffects" ticks).
Example: IMMUNETOX====SLOWNESS
If timerCheckingPotionEffects
is high, you might still get the effect, but it will be cleared once the check runs.
8. Restricting Abilities
# All of these rely on MATERIAL or custom model IDs
RESTRICTARMOR===={IDENTIFIER}
- Blocks wearing armor.
RESTRICTWEAPON===={IDENTIFIER}
- Blocks using that weapon.
RESTRICTTOOL===={IDENTIFIER}
- Blocks using certain tools.
RESTRICTFOOD===={IDENTIFIER}
- Blocks consuming that item.
- This uses the ITEMCONSUME event, so it can be any consumable item, not only food.
RESTRICTITEMSFROMINVENTORY===={IDENTIFIER}
- Blocks having that item in inventory.
- This can include custom model IDs.
Example:
RESTRICTITEMSFROMINVENTORY====1:,IRON_INGOT,2:
(Blocks the player from having any item with custom model ID 1 or 2, or an iron ingot.)
These four abilities let you restrict usage of items/armor/food/tools. It’s very handy for forcing certain classes to only use certain gear.
Custom Abilities
Custom abilities are special triggers and commands that can do almost anything. Let’s see some more features.
Using Custom Model IDs in Abilities
You can use custom model IDs to specify items. For example:
CUSTOMABILITY====123:,IRON_INGOT,412:====say hey i executed====100====10====SELF====ALL====RIGHTCLICKAIR
This triggers if the player right-clicks with an item that has a custom model ID of 123 or 412, or is an IRON_INGOT.
Adding Particle Effects to Abilities
Particles can be added for visual flair:
SELF/CUSTOM[num]:PARTICLEEFFECT:LENGTH:SPACING:INSTANT/MEDIUM/FAST/SLOW:TYPE
- PARTICLEEFFECT: The particle name(s), separated by commas if multiple.
- LENGTH: Size/shape extent.
- SPACING: Distance between each particle.
- INSTANT/MEDIUM/FAST/SLOW: Speed of the particle effect.
- TYPE: The shape of the particle distribution (CONE, CUBE, CIRCLE, etc.).
Here’s an example:
CUSTOMABILITY====123:,IRON_INGOT,412:====say hey i executed====100====10====SELF:ASH:10:0.4:FAST:CROSS====ALL====RIGHTCLICKAIR
This uses an ASH particle in a CROSS shape, length of 10, spacing of 0.4, displayed at a FAST rate.
Ray Tracing Abilities
Ray tracing can add advanced interactions (like checking where the player is aiming). It can detect blocks or entities within a certain distance:
(We’ll see more specifics in the “Scripting Beta” part, but essentially these help you detect lines of sight.)
Remember, with custom abilities plus normal Minecraft commands, you can create nearly anything.
Special Cases of 'CUSTOM' Abilities
Beyond normal custom abilities, there are some special formats:
Chat Whisper and Chat Loud Abilities
CHATWHISPEREVENT
and CHATLOUDEVENT
can use placeholders from the player's typed message. For instance:
CUSTOMABILITY====Server repeat me! {0};====say {0} was said====100====10====SELF====ALL====CHATLOUDEVENT
If a player says “Server repeat me! test” in chat, the plugin sees {0} = “test,” so it runs say test was said. You can go up to {5} placeholders. The semicolon ;
helps parse the rest of the line as player placeholders.
Repeating, Once, and Later Timing Abilities
You can set abilities to repeat over time or trigger once.
CUSTOMABILITY===={IDENTIFIER}===={command}===={chance}===={milliseconds}===={self}===={target}===={event type}====REPEATING===={repeating timer}===={ending command}
CUSTOMABILITY===={IDENTIFIER}===={command}===={chance}===={milliseconds}===={self}===={target}===={event type}====ONCE===={ending command}
CUSTOMABILITY===={IDENTIFIER}===={command}===={chance}===={miliseconds}===={self}===={target}===={event type}===={later-command}===={timing}
- REPEATING: Re-run
{command}
everyrepeating timer
ticks. If triggered again, it ends and runs{ending command}
. - ONCE: Runs
{command}
once. If triggered again, it runs{ending command}
. - Later-command:
{command}
runs first, then after{timing}
ticks, it runs{later-command}
.
Set Velocity Custom Ability
You can also set or add velocity inside your custom ability commands:
CUSTOMABILITY===={IDENTIFIER}====setVelocity-0.1-0.0-10.0===={chance}===={milliseconds}===={self}===={target}===={event type}
CUSTOMABILITY===={IDENTIFIER}====addVelocity-0.1-0.0-10.0===={chance}===={milliseconds}===={self}===={target}===={event type}
CUSTOMABILITY===={IDENTIFIER}====setLookVelocity-0.1-0.0-10.0===={chance}===={milliseconds}===={self}===={target}===={event type}
CUSTOMABILITY===={IDENTIFIER}====addLookVelocity-0.1-0.0-10.0===={chance}===={milliseconds}===={self}===={target}===={event type}
setVelocity directly sets the player’s velocity to (x,y,z).addVelocity adds those values to the current velocity.
setLookVelocity sets velocity based on the player’s current looking direction (multiplied by those values).addLookVelocity adds to their velocity along the direction they are looking.
Ray Trace Abilities
These advanced triggers detect what the player is looking at (entities/blocks) for certain distances. Examples:
CUSTOMABILITY===={IDENTIFIER}===={command}====10====1000====SELF====ALL====RIGHTCLICKAIRRAYTRACE===={distance}
CUSTOMABILITY===={IDENTIFIER}===={command}====10====1000====SELF====ALL====RIGHTCLICKAIRRAYTRACEBLOCK===={distance}
CUSTOMABILITY===={IDENTIFIER}===={command}====10====1000====SELF====ALL====RIGHTCLICKAIRRAYTRACELOCATION===={distance}
CUSTOMABILITY===={IDENTIFIER}===={command}====10====1000====SELF====ALL====RIGHTCLICKAIRRAYTRACELOCATIONBLOCK===={distance}
CUSTOMABILITY===={IDENTIFIER}===={command}====10====1000====SELF====ALL====LEFTCLICKAIRRAYTRACE===={distance}
CUSTOMABILITY===={IDENTIFIER}===={command}====10====1000====SELF====ALL====LEFTCLICKAIRRAYTRACEBLOCK===={distance}
CUSTOMABILITY===={IDENTIFIER}===={command}====10====1000====SELF====ALL====LEFTCLICKAIRRAYTRACELOCATION===={distance}
CUSTOMABILITY===={IDENTIFIER}===={command}====10====1000====SELF====ALL====LEFTCLICKAIRRAYTRACELOCATIONBLOCK===={distance}
- RIGHTCLICKAIRRAYTRACE: If the player is looking at an entity in range, it triggers.
{x}
,{y}
,{z}
= that entity’s coordinates. - RIGHTCLICKAIRRAYTRACEBLOCK: Same but stops if it hits a block first.
- RIGHTCLICKAIRRAYTRACELOCATION: Goes through all points up to an entity and triggers for each coordinate.
- RIGHTCLICKAIRRAYTRACELOCATIONBLOCK: Same, but stops at the first block.
- The LEFTCLICK variants do the same, but for left-clicking.
You can also use {uuid}
for the entity that the ray hits. That references the entity’s unique ID, not the player's.
Level Specific Abilities
You can require certain levels for an ability. Put ;10
(for level above 10) or ;-10
(for level below 10) right after the ability name and before the ====.
Example (only if the player’s level is above 10):
CUSTOMABILITY;10===={IDENTIFIER}====...
Example (only if player’s level is below 10):
CUSTOMABILITY;-10===={IDENTIFIER}====...
Custom Abilities - Important Details
Some final considerations about using custom abilities effectively:
Cooldown and Notifications
You can add a NOTIFY message at the end of a custom ability or projectile data line:
[ability]===={message}===={type}====NOTIFY
Here, {message}
is what’s sent to the player about the cooldown, and {type}
can be HOTBAR, ACTIONBAR, or MESSAGE.
Example:
CUSTOMABILITY====123:,IRON_INGOT,412:====say hey i executed====100====10====SELF:ASH:10:0.4:FAST:CROSS====ALL====RIGHTCLICKAIR===={cooldown} seconds left====HOTBAR====NOTIFY
Some Helpful Commands
execute at {name} run effect give @e[sort=nearest,x={x},y={y},z={z},limit=1] minecraft:poison 3 10
CUSTOMABILITY====GRASS_BLOCK====heal {name}====100====10====CUSTOM5====ALL====RIGHTCLICKAIR
CUSTOMABILITY====SALMON====say {name}====100====10====SELF====ALL====RIGHTCLICKAIR====REPEATING====30====say ending
INFLICTDAMAGEEVENT====execute at {name} run effect give @e[sort=nearest,x={x},y={y},z={z},limit=1] minecraft:poison 3 10====100====10000
PROJECTILEEVENT====ARROW====execute at {name} run effect give @e[sort=nearest,x={x},y={y},z={z},limit=1] minecraft:poison 3 10====100====10000
FRIENDLYMOBS====WITCH,ZOMBIE
(Makes WITCH and ZOMBIE not attack the player)
CUSTOMABILITY====STRING====effect give {name} minecraft:invisibility 60 0====100====5000====SELF====ALL====RIGHTCLICKAIR====REPEATING====100====effect clear {name}
(This toggles invisibility every 5 seconds; if triggered again, it clears the effect.)
Day/Night Execution + Abilities Folder/Misc
Here is a snippet more similar to base Mythical Races:
dayRaceCommandExecution:
- 'say hello {player} its day time and im inside of water, also note that the -1 doesnt do anything!'
dayRaceCommandExecutionData:
- 'ALL Y > -1000 -1 CUSTOM1 WATER ALL ALL'
nightRaceCommandExecution:
- 'null'
nightRaceCommandExecutionData:
- 'null'
This is how Mythical Races’ dayRaceCommandExecution
ornightRaceCommandExecution
might look in the config, referencing positions, blocks, water, etc. Notice {player}
is used (instead of {name}
).
The plugin also has WorldGuard flags: mrbase-potionandattributes
(to disable certain effects/attributes in a region) and allow-mrabilities
(to block abilities in certain regions).
Another Way of Adding Abilities (Abilities Folder)
You can create separate files in an “abilities” folder. Each file can contain one or more abilities. Then, in your race’s abilities:
list, you can load that file with:
abilities:
- 'LOAD=RestrictWeapon.yml'
- 'LOAD={FileNameHere}'
Here’s an example, RestrictWeapon.yml
:
# RestrictWeapon.yml
RESTRICTWEAPON
WOODEN_SWORD
The plugin automatically inserts “====” between lines. Another example with multiple lines:
# RestrictAbilities.yml
RESTRICTWEAPON
WOODEN_SWORD
#
RESTRICTARMOR
DIAMOND_CHESTPLATE
This way, you can keep your abilities organized with comments.
Mythical Races Scripting Beta V1
Our scripting system allows you to create dynamic game behavior by using custom code. You can manipulate game objects, use conditions (if-statements), store variables, and run commands.
To make a script, go to the scripts
folder inside MRPremiumAddons
and create a file (for example example.txt
). Then, you can run it from a CUSTOMABILITY.
Control Structures
The scripting system supports if-statements:
if(condition) {
// commands
}
The code inside the brackets runs if condition
is true.
Variable Storage
Variables can be declared global or private:
global gVariableName = value
private pVariableName = value
global variables are shared across all players (anyone can overwrite them). private variables are specific to the player who triggered the script.
Command Execution
Use executeConsoleCommand("command")
to run a command as if typed in console. Currently, you can only call executeConsoleCommand
inside an if-statement whose condition is true.
Arithmetic Operations and String Interpolation
The system supports +, -, *, /, % in assignments, plus interpolation inside strings:
global variableName = value1 + value2
private interpolatedString = "Hello, {variableName}"
If value1
and value2
are numbers, it’s arithmetic. If you do string + number, it’s concatenated. The {variableName}
placeholder inside a string is replaced with that variable’s value.
Built-in Functions
The scripting system has built-ins for player info:
playerXPosition()
- The player's X coord.playerYPosition()
- Y coord.playerZPosition()
- Z coord.playerWorldName()
- The world name the player is in.getWorldTime()
- The time of that world.playerName()
- The player's name.playerHealth()
- The player's health.playerHunger()
- The player's hunger.playerExperience()
- The player's XP.playerGameMode()
- The player's game mode.playerIsOnGround()
- True if on ground.playerIsSneaking()
- True if sneaking.playerIsSprinting()
- True if sprinting.playerIsFlying()
- True if flying.playerIsInWater()
- True if in water.playerRaceLevel()
- The player's race level.playerClassLevel()
- The player's class level.
Executing Scripts with a Custom Ability
You can tie a script to a CUSTOMABILITY:
- 'CUSTOMABILITY====SALMON====EXECUTESCRIPT~testing.txt====100====10====SELF====ALL====RIGHTCLICKAIR'
This means: when a player right-clicks the air with SALMON, it runs testing.txt
from your scripts folder. The numbers represent chance, cooldown, targeting, etc.
Comments
Use //
for single-line comments:
// This is a comment
Logical and Comparison Operators
We support the following:
==
Equal to!=
Not equal to<
Less than>
Greater than<=
Less than or equal>=
Greater than or equal&&
Logical AND||
Logical OR
Put these in the if()
condition to check variables or combine conditions.
private playerHealth = playerHealth()
private playerIsInAir = playerIsInAir()
if(playerHealth > 10 && playerIsInAir == true) {
// commands
}
Commands run only if playerHealth > 10
and playerIsInAir
is true.
Example Script
Here are some scripts that show all of this in action:
// This script creates dynamic events based on the player's location and world.
// It uses logical operations, conditions, and various Minecraft commands to enhance the gameplay experience.
private playerX = playerXPosition()
private playerY = playerYPosition()
private playerZ = playerZPosition()
private playerWorld = playerWorldName()
private playerHealth = playerHealth()
private playerIsInAir = playerIsInAir()
private playerGreeting = "Hello, {{playerName()}}! Welcome to {{playerWorld}}."
private playerCoords = "Your coordinates are {{playerX}}, {{playerY}}, {{playerZ}}."
// Greet the player and inform them of their location
executeConsoleCommand("say {{playerGreeting}}")
executeConsoleCommand("say {{playerCoords}}")
// Give the player a diamond if they are in the Overworld and above Y=100
if(playerWorld == "Overworld" && playerY > 100) {
executeConsoleCommand("minecraft:give {{playerName()}} minecraft:diamond 1")
executeConsoleCommand("say You found a high-altitude diamond, {{playerName()}}!")
}
// Warn the player if they are in the Nether and below Y=30
if(playerWorld == "Nether" && playerY < 30) {
executeConsoleCommand("say Be careful, {{playerName()}}! The lava sea is dangerous.")
}
// Give the player a map if they are in the End
if(playerWorld == "End") {
executeConsoleCommand("minecraft:give {{playerName()}} minecraft:map 1")
executeConsoleCommand("say You might need a map to find your way, {{playerName()}}.")
}
// Teleport the player to spawn if they are far from the origin
if(playerX > 1000 || playerX < -1000 || playerZ > 1000 || playerZ > -1000) {
executeConsoleCommand("tp {{playerName()}} 0 100 0")
executeConsoleCommand("say {{playerName()}}, you were too far away. We've teleported you back to spawn.")
}
if(playerHealth > 10 && playerIsInAir == true) {
executeConsoleCommand("say hey you're in the air and your health is over 10!")
}
// This script rewards or penalizes the player based on their current height, health, and time of day.
private playerY = playerYPosition()
private playerHealth = playerHealth()
private worldTime = getWorldTime()
// Reward player for climbing high (above Y=100)
if(playerY > 100) {
executeConsoleCommand("minecraft:give {{playerName()}} minecraft:elytra 1")
executeConsoleCommand("say You've reached great heights, {{playerName()}}! Here's an Elytra for your efforts.")
}
// If player's health is below 5, provide a golden apple
if(playerHealth < 5) {
executeConsoleCommand("minecraft:give {{playerName()}} minecraft:golden_apple 1")
executeConsoleCommand("say Your health is low, {{playerName()}}! Here's a golden apple to help you.")
}
// If it's daytime, encourage exploration with a compass
if(worldTime > 0 && worldTime < 12000) {
executeConsoleCommand("minecraft:give {{playerName()}} minecraft:compass 1")
executeConsoleCommand("say It's daytime, {{playerName()}}! Here's a compass to aid your exploration.")
}
// If it's nighttime, provide a bed for the player to skip to daylight
if(worldTime > 12000 && worldTime < 24000) {
executeConsoleCommand("minecraft:give {{playerName()}} minecraft:bed 1")
executeConsoleCommand("say It's nighttime, {{playerName()}}! Here's a bed for you to skip to daylight.")
}
private playerX = playerXPosition()
private playerY = playerYPosition()
private playerZ = playerZPosition()
private playerWorld = playerWorldName()
private playerHealth = playerHealth()
// Check if the player is in the Overworld
if(playerWorld == "Overworld") {
// If the player is above Y=100 and their health is below 10, provide health boost
if(playerY > 100 && playerHealth < 10) {
executeConsoleCommand("effect give {{playerName()}} minecraft:instant_health 1 1")
executeConsoleCommand("say You've received a health boost, {{playerName()}}!")
}
// If the player is below Y=30, give them a jump boost to help them climb
else if(playerY < 30) {
executeConsoleCommand("effect give {{playerName()}} minecraft:jump_boost 30 1")
executeConsoleCommand("say You've received a jump boost, {{playerName()}}!")
}
}
// This script creates dynamic events based on the player's location and world.
// It uses logical operations, conditions, and various Minecraft commands to enhance the gameplay experience.
private playerX = playerXPosition();
private playerY = playerYPosition();
private playerZ = playerZPosition();
private playerWorld = playerWorldName();
private playerHealth = playerHealth();
private playerIsInAir = playerIsInAir();
private playerGreeting = "Hello, {{playerName()}}! Welcome to {{playerWorld}}.";
private playerCoords = "Your coordinates are {{playerX}}, {{playerY}}, {{playerZ}}.";
// Greet the player and inform them of their location
executeConsoleCommand("say {{playerGreeting}}");
executeConsoleCommand("say {{playerCoords}}");
// Give the player a diamond if they are in the Overworld and above Y=100
if(playerWorld == "Overworld" && playerY > 100) {
executeConsoleCommand("minecraft:give {{playerName()}} minecraft:diamond 1");
executeConsoleCommand("say You found a high-altitude diamond, {{playerName()}}!");
}
// Warn the player if they are in the Nether and below Y=30
if(playerWorld == "Nether" && playerY < 30) {
executeConsoleCommand("say Be careful, {{playerName()}}! The lava sea is dangerous.");
}
// Give the player a map if they are in the End
if(playerWorld == "End") {
executeConsoleCommand("minecraft:give {{playerName()}} minecraft:map 1");
executeConsoleCommand("say You might need a map to find your way, {{playerName()}}.");
}
// Teleport the player to spawn if they are far from the origin
if(playerX > 1000 || playerX < -1000 || playerZ > 1000 || playerZ < -1000) {
executeConsoleCommand("tp {{playerName()}} 0 100 0");
executeConsoleCommand("say {{playerName()}}, you were too far away. We've teleported you back to spawn.");
}
if(playerHealth > 10 && playerIsInAir == true) {
executeConsoleCommand("say hey you're in the air and your health is over 10!");
}
// This script rewards or penalizes the player based on their current height, health, and time of day.
private playerY = playerYPosition();
private playerHealth = playerHealth();
private worldTime = getWorldTime();
// Reward player for climbing high (above Y=100)
if(playerY > 100) {
executeConsoleCommand("minecraft:give {{playerName()}} minecraft:elytra 1");
executeConsoleCommand("say You've reached great heights, {{playerName()}}! Here's an Elytra for your efforts.");
}
// If player's health is below 5, provide a golden apple
if(playerHealth < 5) {
executeConsoleCommand("minecraft:give {{playerName()}} minecraft:golden_apple 1");
executeConsoleCommand("say Your health is low, {{playerName()}}! Here's a golden apple to help you.");
}
// If it's daytime, encourage exploration with a compass
if(worldTime >= 0 && worldTime < 12000) {
executeConsoleCommand("minecraft:give {{playerName()}} minecraft:compass 1");
executeConsoleCommand("say It's daytime, {{playerName()}}! Here's a compass to aid your exploration.");
}
// If it's nighttime, provide a bed for the player to skip to daylight
if(worldTime >= 12000 && worldTime < 24000) {
executeConsoleCommand("minecraft:give {{playerName()}} minecraft:bed 1");
executeConsoleCommand("say It's nighttime, {{playerName()}}! Here's a bed for you to skip to daylight.");
}
Scripting System Limitations
Although powerful, the system has some limits:
- Only basic if-statements (no else/else if).
- No loops (for/while) or switch-case.
- No advanced math (square root, exponent, etc.).
- Variables are only numbers, strings, or booleans.
executeConsoleCommand
must be inside a true if-condition.- Nested if-statements are supported (for more complex logic).