Welcome & Getting Started

Hello! This guide will help you understand MRPremiumAddons. We'll explain how to create cool custom features for your Minecraft server, step by step.

The best way to start is by watching these videos. They'll give you a good overview.

After you've read through this guide, we recommend watching this newer video for the latest information:

Using Special Codes (Placeholders) in Commands

When you create abilities, you'll often use "template codes" or "placeholders." Think of them as fill-in-the-blanks that the plugin automatically replaces with real game information (like a player's name or location). This makes your abilities dynamic!

These codes usually go inside the commands part of your abilities. Here are the common ones:

  • {name}: This is the player who is using the ability. If the ability is tied to a player, {name} will be that player's Minecraft name.
  • {hitPlayer}: This refers to another player affected by the ability. For example, if an ability targets nearby players, {hitPlayer} would be one of those targeted players (not the one who used the ability).
  • {x}, {y}, {z}: These are coordinates (X, Y, Z location in the game world). They usually refer to the location of the player or entity affected by the ability.

Doing Math with Coordinates

You can even do simple math with these coordinate placeholders! For example, if you want to target a block 5 units above the player, you could use something like {[mathY+5]}.

You can use addition (+), subtraction (-), multiplication (*), or division (/). For example:

  • {[mathX+100]} (adds 100 to the X coordinate)
  • {[mathY-10]} (subtracts 10 from the Y coordinate)
  • {[mathZ*3]} (multiplies the Z coordinate by 3)
  • {[mathZ/2]} (divides the Z coordinate by 2)

Important: You can only do one math operation per placeholder (e.g., {[mathX+5-2]} won't work; do {[mathX+3]} instead).

Random Choices with rand()

Want your ability to do something random? Use the rand() function. You give it a list of options, and it picks one.

For example: rand(banana, apple, carrot) will randomly pick "banana", "apple", or "carrot".

Here's how you might use it in an ability:

CUSTOMABILITY====IRON_INGOT===say rand(hey, hello, hi) I'm feeling random!====100====10====SELF====ALL====RIGHTCLICKAIR

This ability, when triggered, will make the server say "hey I'm feeling random!", "hello I'm feeling random!", or "hi I'm feeling random!".

Helpful Links & Documentation

When creating abilities, you'll often need to know the exact names for Minecraft items, blocks, entities, etc. These official documentation links are super helpful:

Making Your Own Special Powers (Custom Abilities)

"Custom Abilities" are the heart of MRPremiumAddons. They let you define unique actions that happen based on specific triggers. You create them by writing a line of text with different parts separated by ==== (four equal signs).

Here's the basic recipe for a custom ability:

CUSTOMABILITY===={IDENTIFIER}===={commands}===={chance}===={milliseconds}===={self_or_custom_num}===={target_type}===={event_type}

Let's break down each part:

  1. CUSTOMABILITY: This keyword tells the plugin, "Hey, I'm defining a new custom power!"
  2. {IDENTIFIER}: This is often an item, block, or entity name (like DIAMOND_SWORD or ZOMBIE). It helps define *what* you interact with to trigger the ability. Sometimes, an event type doesn't need an identifier (e.g., an ability that triggers when you enter a bed). In those cases, you can just type placeholder.
  3. {commands}: These are the Minecraft commands that run when the ability is successfully triggered. You can use placeholders like {name} here. For multiple commands, you might need to structure them according to your server setup or use the scripting system (covered later).
  4. {chance}: How likely is this ability to happen when triggered? This is a number from 0 to 100 (representing 0% to 100%). For example, 50 means a 50% chance.
  5. {milliseconds}: This is the cooldown period in milliseconds. After the ability triggers, the player has to wait this long before it can trigger again. (1000 milliseconds = 1 second). So, 5000 means a 5-second cooldown.
  6. {self_or_custom_num}: Who do the commands affect?
    • SELF: The commands affect only the player who triggered the ability.
    • CUSTOM[num]: The commands affect entities within a certain radius ([num] blocks) around the player. For example, CUSTOM5 targets entities within 5 blocks.
  7. {target_type}: If you used CUSTOM[num], this specifies what *kind* of entities to target within that radius. Options include:
    • ALL: Targets all entities (players, mobs, animals).
    • PLAYERS: Targets only other players.
    • MOB: Targets hostile and neutral mobs.
    • ANIMALS: Targets passive animals.
    • (And more specific types if supported)
  8. {event_type}: This is crucial! It defines *when* or *how* the ability is triggered. For example, does it happen when you right-click, break a block, or take damage? We'll cover common event types next.

When Do Powers Activate? (Event Types)

The {event_type} tells the plugin what action triggers your ability. Here are many of the available event types. For each, remember that the {IDENTIFIER} often needs to be a specific Material name (item/block).

  • RIGHTCLICKBLOCKHAND: Player right-clicks a block while holding a specific item. {IDENTIFIER} = the item material in hand.
  • RIGHTCLICKBLOCK: Player right-clicks a specific type of block. {IDENTIFIER} = the block material.
  • RIGHTCLICKAIR: Player right-clicks while holding a specific item (not aiming at a block). {IDENTIFIER} = the item material.
  • LEFTCLICKBLOCKHAND: Player left-clicks (punches) a block while holding a specific item.
  • LEFTCLICKBLOCK: Player left-clicks a specific type of block.
  • LEFTCLICKAIR: Player left-clicks while holding a specific item (not aiming at a block).
  • BLOCKBREAK: Player breaks a specific type of block. {IDENTIFIER} = the block material.
  • BLOCKPLACE: Player places a specific type of block. {IDENTIFIER} = the block material.
  • RIGHTCLICKAIRCONSUME: Player right-clicks with a consumable item (like food), and it gets used up. {IDENTIFIER} = the consumable item material.
  • LEFTCLICKAIRCONSUME: Similar, but with a left-click (if applicable for the item).
  • ENTERBED: Player gets into a bed. {IDENTIFIER} is usually placeholder.
  • SLEEPING: Player is currently sleeping in a bed. {IDENTIFIER} is placeholder.
  • EXITBED: Player gets out of a bed. {IDENTIFIER} is placeholder.
  • EXITVEHICLE: Player leaves a vehicle (e.g., boat, minecart, horse). {IDENTIFIER} can be HORSE, MINECART, BOAT, or placeholder for any.
  • ENTERVEHICLE: Player enters a vehicle.
  • WORLDCHANGEEVENT: Player moves to a different world/dimension (e.g., Overworld to Nether). {IDENTIFIER} = name of the world they entered.
  • COMBUSTEVENT: Player catches on fire. {IDENTIFIER} is placeholder.
  • EXPLODEEVENT: Player is involved in an explosion. {IDENTIFIER} is placeholder.
  • ISSWIMMINGEVENT: Player is swimming. {IDENTIFIER} is placeholder.
  • ISFLYINGEVENT: Player is flying (e.g., with Elytra or in Creative mode). {IDENTIFIER} is placeholder.
  • ISFALLINGEVENT: 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: Player is affected by entity cramming. {IDENTIFIER} is placeholder.
  • FALLDAMAGEEVENT: Player takes damage from falling. {IDENTIFIER} is placeholder.
  • FIREHURTEVENT: Player takes damage from fire or lava. {IDENTIFIER} is placeholder.
  • SUFFOCATIONHURTEVENT: Player takes damage from suffocating in a wall. {IDENTIFIER} is placeholder.
  • PLAYERRESPAWN: Player respawns after dying. {IDENTIFIER} is placeholder.
  • ISSLEEPING: Player is currently asleep (checked periodically). {IDENTIFIER} is placeholder.
  • ISBLOCKING: Player is blocking with a shield. {IDENTIFIER} is placeholder.
  • CRAFTITEM: Player crafts a specific item. {IDENTIFIER} = the crafted item material.
  • WEARINGARMOR: Player is wearing a specific piece of armor. {IDENTIFIER} = armor material (e.g., DIAMOND_CHESTPLATE) or custom model ID (e.g., IRON_INGOT,100:).
  • TIME: Triggers at a specific time of day in the game world. {IDENTIFIER} = world time (a number, e.g., 1000 for morning).
  • PICKUPEVENTCANCEL: Player tries to pick up a specific item, and this ability can cancel it and run commands. {IDENTIFIER} = item material.
  • PICKUPEVENT: Player successfully picks up a specific item. {IDENTIFIER} = item material.
  • PASSIVE: Triggers automatically at regular intervals (defined in config.yml). {IDENTIFIER} is usually placeholder.
  • ISSPRINTING: Player is sprinting. {IDENTIFIER} is placeholder.
  • INBIOME: Player is in a specific biome. {IDENTIFIER} = biome name (see resources for list).
  • DAMAGECAUSEEVENTCANCEL: Player takes damage from a specific cause, and this can cancel it. {IDENTIFIER} = damage cause name.
  • HOLDINGITEM: Player is holding a specific item in their main hand (checked periodically). {IDENTIFIER} = item material.
  • HOLDITEM: Triggers once when the player starts holding a specific item. {IDENTIFIER} = item material.
  • HASPOTIONTYPE: Player has a specific potion effect on them. {IDENTIFIER} = potion effect name (e.g., SPEED).
  • DAMAGECAUSEEVENT: Player takes damage from any of a list of specific causes. {IDENTIFIER} = damage cause name(s), comma-separated.
  • PLAYERKILLENTITY: Player kills a specific type of entity. {IDENTIFIER} = entity type name.
  • ISSNEAKING: Player is sneaking (crouching). {IDENTIFIER} is placeholder.
  • HASITEMINVENTORY: Player has a specific item anywhere in their inventory. {IDENTIFIER} = item material.
  • DEATHEVENTCANCEL: Player is about to die, and this can cancel the death. {IDENTIFIER} is placeholder.
  • DEATHEVENT: Triggers when the player dies. {IDENTIFIER} is placeholder.
  • DEATHEVENTCAUSE: Player dies from a specific cause. {IDENTIFIER} = damage cause name.
  • DEATHEVENTCAUSECANCEL: Cancels death if caused by a specific type. {IDENTIFIER} = damage cause.
  • CHATWHISPEREVENT: Player types specific text in chat. This hides the original message and runs commands. {IDENTIFIER} = the text to look for.
  • CHATLOUDEVENT: Player types specific text in chat. This does *not* hide the message. {IDENTIFIER} = the text.
  • PLAYERCONSUMEEVENT: Player finishes consuming an item (like food). {IDENTIFIER} = item material.
  • PLAYERJOINEVENT: Player joins the server. {IDENTIFIER} is usually placeholder.

Sneaking Versions (SHIFT+Action)

Many of the event types above also have a "SHIFT" version. These trigger only if the player is sneaking (holding the Shift key) while performing the action. Just add SHIFT to the beginning of the event type name. For example:

  • SHIFTRIGHTCLICKAIR
  • SHIFTBLOCKBREAK
  • SHIFTPLAYERKILLENTITY
  • ...and so on for most other event types. The {IDENTIFIER} and other parts work the same way.

This lets you create different outcomes for an action depending on whether the player is sneaking or not!

The Basic Building Blocks of All Abilities

No matter what kind of ability you're making with MRPremiumAddons, they generally share these core parts:

  • Type of Ability: What kind of power is it? (e.g., CUSTOMABILITY, INFLICTDAMAGEEVENT). This is usually the first word.
  • Trigger (Event & Identifier): What makes the ability activate? This is a combination of the {event_type} and often an {IDENTIFIER} (like a specific item or block).
  • Action (Command): What does the ability do? This is the {command} part, often using placeholders.
  • Chance: How likely is it to work each time it's triggered? (A percentage from 0-100).
  • Cooldown: How long (in milliseconds) until it can be used again?

For CUSTOMABILITY types specifically, you also define:

  • Who it Affects (Self or Nearby): Does it target just the player (SELF) or entities in an area (CUSTOM[num])?
  • Target Type: If it affects nearby entities, what kind? (ALL, PLAYERS, MOBS, etc.).

Ability Examples (Putting It Together)

Let's look at a couple of simple CUSTOMABILITY examples:

Example 1: Diamond Heal

  • Goal: When a player right-clicks the air holding a diamond, they get a regeneration effect. The diamond is used up.
  • Chance: 50%
  • Cooldown: 10 milliseconds (very short)
CUSTOMABILITY====DIAMOND====effect give {name} regeneration 10 10====50====10====SELF====ALL====RIGHTCLICKAIRCONSUME

Explanation:DIAMOND is the item.effect give {name} regeneration 10 10 gives the player ({name}) regeneration.50 is the 50% chance.10 is the 10ms cooldown.SELF means it affects the player.ALL is the target type (though for SELF, it's less critical).RIGHTCLICKAIRCONSUME means it triggers on right-click and uses the diamond.

Example 2: Bedtime Regeneration Aura

  • Goal: When a player enters a bed, heal ALL nearby entities (not the player themselves) within 5 blocks.
  • Chance: 100%
  • Cooldown: 10 milliseconds
CUSTOMABILITY====placeholder====effect give @e[distance=..5,name=!{name}] minecraft:regeneration 3 3 true====100====10====CUSTOM5====ALL====ENTERBED

Explanation:placeholder is used because ENTERBED doesn't need a specific item. The command effect give @e[distance=..5,name=!{name}] minecraft:regeneration 3 3 true gives regeneration to entities within 5 blocks (distance=..5) but excludes the player (name=!{name}).100 is 100% chance.10 is 10ms cooldown.CUSTOM5 means it targets entities within 5 blocks (the @e[distance=..5] in the command handles the actual selection).ALL is the general type of entity to look for.ENTERBED is the trigger.

These examples show the basic structure. You can get much more creative!

More Types of Powers (Simpler Abilities)

Besides the super-flexible CUSTOMABILITY, there are other, simpler ability types for common scenarios. You add these as lines in your race or class configuration files.

1. Inflict Damage Event

What it does: Triggers when the player damages any entity.

INFLICTDAMAGEEVENT====[command_to_run]====[chance_0_to_100]====[cooldown_in_ms]

Example: Say "Ouch!" when you hit something (10% chance, 10-second cooldown).

INFLICTDAMAGEEVENT====say Ouch, {hitPlayer} felt that!====10====10000

2. Receive Damage from Entity Event

What it does: Triggers when the player takes damage from an entity.

RECIEVEDAMAGEFROMENTITY====[command_to_run]====[chance_0_to_100]====[cooldown_in_ms]

Example: Say "Hey, stop that!" when hurt (10% chance, 10-second cooldown).

RECIEVEDAMAGEFROMENTITY====say Hey, stop that {attackerName}!====10====10000

(Note: {attackerName} might be a valid placeholder here, check plugin specifics.)

3. Level Up Event

What it does: Triggers when the player levels up their race/class.

LEVELUP====[command_to_run]
LEVELUP====[command_to_run]====[specific_level_to_trigger_at]

Example 1: Announce every level up.

LEVELUP====say Woohoo! {name} just leveled up!

Example 2: Special message only at level 10.

LEVELUP====say Wow! {name} reached Level 10! Mighty!====10

4. Friendly Mobs

What it does: Makes certain mobs ignore or not attack the player.

FRIENDLYMOBS====[MOB_NAME_1],[MOB_NAME_2],[etc]

Example: Zombies and Witches become friendly.

FRIENDLYMOBS====ZOMBIE,WITCH

5. Projectile Event

What it does: Triggers when the player damages an entity with a specific type of projectile (e.g., arrow, snowball).

PROJECTILEEVENT====[PROJECTILE_TYPE]====[command_to_run]====[chance_0_to_100]====[cooldown_in_ms]

Example: If an arrow hits, 10% chance to say "Bullseye!". (Projectile types: ARROW, SNOWBALL, EGG, etc.)

PROJECTILEEVENT====ARROW====say Bullseye!====10====5000

6. Extra Damage to Race/Class

What it does: Lets the player deal extra damage to other players of a specific race or class.

EXTRADMG====[RaceOrClassName]====[extra_damage_amount]

Example: Deal 3.0 extra damage to players of the "Vampire" race.

EXTRADMG====Vampire====3.0

7. Immune to X (Potion Effects)

What it does: Makes the player immune to certain potion effects. The plugin checks and removes these effects periodically (defined by timerCheckingPotionEffects in config).

IMMUNETOX====[POTION_EFFECT_NAME]

Example: Player becomes immune to Slowness. (Effect names: SLOWNESS, POISON, WEAKNESS, etc.)

IMMUNETOX====SLOWNESS

If the check timer is high, you might briefly get the effect before it's removed.

8. Restricting Items, Armor, Tools, Food

What they do: Prevent players of this race/class from using or having certain items.

Use Material names or Custom Model IDs (e.g., DIAMOND_SWORD, IRON_INGOT,100:).

RESTRICTARMOR====[MATERIAL_OR_CUSTOM_MODEL_ID]
RESTRICTWEAPON====[MATERIAL_OR_CUSTOM_MODEL_ID]
RESTRICTTOOL====[MATERIAL_OR_CUSTOM_MODEL_ID]
RESTRICTFOOD====[MATERIAL_OR_CUSTOM_MODEL_ID]
RESTRICTITEMSFROMINVENTORY====[ITEM1],[ITEM2,CUSTOM_ID:],etc

Example: Prevent using wooden swords and having an iron ingot with custom model ID 1 or 2.

RESTRICTWEAPON====WOODEN_SWORD
RESTRICTITEMSFROMINVENTORY====1:,IRON_INGOT,2:

RESTRICTFOOD actually works for any item consumed using the ITEMCONSUME event, not just food.

Advanced Tricks for Custom Abilities

Using Custom Model IDs in Abilities

If you use resource packs with custom item appearances (Custom Model Data), you can make abilities trigger based on these specific items.

To specify a custom model ID, use the format: [ID]:,[ITEM_MATERIAL],[ID2]:. The ITEM_MATERIAL part is optional but good practice if the custom model is tied to a base item type. If it's just an ID, you can use [ID]:.

CUSTOMABILITY====123:,IRON_INGOT,412:====say You clicked a special Iron Ingot!====100====10====SELF====ALL====RIGHTCLICKAIR

This ability triggers if the player right-clicks with an item that:

  • Has Custom Model ID 123 (could be any base item).
  • Is an IRON_INGOT (standard iron ingot without a custom model).
  • Has Custom Model ID 412 (could be any base item).

Adding Cool Visuals (Particle Effects)

You can add particle effects to your CUSTOMABILITY to make them look awesome! Add this to the {self_or_custom_num} part:

SELF_OR_CUSTOM[NUM]:PARTICLENAME_OR_LIST:LENGTH:SPACING:SPEED:SHAPE

Let's break that down:

  • PARTICLENAME_OR_LIST: The name of the particle (e.g., HEART, FLAME). You can list multiple, separated by commas (e.g., ASH,CRIT).
  • LENGTH: How far or big the particle effect spreads (a number).
  • SPACING: How far apart individual particles are (a number, e.g., 0.5).
  • SPEED: How fast the particles appear/move. Options: INSTANT, MEDIUM, FAST, SLOW.
  • SHAPE: The pattern the particles form. Options: CONE, CUBE, CIRCLE, CROSS, LINE, SPHERE, etc. (Check plugin docs for all shapes).

Example: Ash particles in a cross shape.

CUSTOMABILITY====DIAMOND====say Sparkle!====100====10====SELF:ASH:10:0.4:FAST:CROSS====ALL====RIGHTCLICKAIR

This creates an ASH particle effect in a CROSS shape, with a length/size of 10, spacing of 0.4 between particles, appearing at a FAST rate, around the player (SELF).

Targeting What Players Look At (Ray Tracing)

"Ray tracing" abilities let you detect what a player is aiming at, whether it's a block or an entity, up to a certain distance. This is great for "skill shot" type abilities. These are special event types, which we'll detail more in the "Special Custom Ability Setups" section.

Essentially, instead of just RIGHTCLICKAIR, you might use RIGHTCLICKAIRRAYTRACE and specify a distance. The ability then triggers based on what's in the player's line of sight.

Special Custom Ability Setups

CUSTOMABILITY has some extra tricks up its sleeve for more complex scenarios.

Chat-Triggered Abilities & Capturing Words

For CHATWHISPEREVENT (hides original message) and CHATLOUDEVENT (doesn't hide), you can capture parts of what the player typed!

In your {IDENTIFIER}, use a semicolon ; to mark the end of the fixed text you're listening for. Then, in your {commands}, you can use {0}, {1}, etc., to insert the words the player typed after your fixed text.

CUSTOMABILITY====Server repeat after me;====say The server repeats: {0} {1}====100====10====SELF====ALL====CHATLOUDEVENT

If a player types: "Server repeat after me hello world"

  • The plugin matches "Server repeat after me;".
  • {0} becomes "hello".
  • {1} becomes "world".
  • The command run is: say The server repeats: hello world.
You can usually use up to {5} or more such placeholders.

Repeating, One-Time, and Delayed Actions

You can make abilities that repeat their command, run only once until reset, or run a second command after a delay. You do this by adding extra parts at the end of the CUSTOMABILITY line:

  • Repeating Action:
    ...===={event_type}====REPEATING===={ticks_between_repeats}===={command_to_run_on_stop}

    The main {command} runs, then repeats every {ticks_between_repeats} (20 ticks = 1 second). If the ability is triggered again while it's repeating, it stops, and the {command_to_run_on_stop} is executed.

  • One-Time Action (Toggle):
    ...===={event_type}====ONCE===={command_to_run_on_toggle_off}

    The main {command} runs once. If the ability is triggered again, the {command_to_run_on_toggle_off} is executed (turning the effect "off"). Triggering it a third time would run the main command again ("on").

  • Delayed Action:
    ...===={event_type}===={later_command_to_run}===={ticks_to_wait}

    The main {command} runs immediately. Then, after {ticks_to_wait}, the {later_command_to_run} is executed.

Pushing & Pulling Players (Velocity)

You can directly change a player's movement (velocity) using special commands in the {commands} part:

  • setVelocity-X-Y-Z: Sets the player's velocity directly. Positive Y is up, positive Z is often Minecraft's "south", positive X is "east".
    Example: setVelocity-0-1.5-0 would launch the player straight up.
  • addVelocity-X-Y-Z: Adds to the player's current velocity.
    Example: addVelocity-0-0.5-0 gives a little upward boost.
  • setLookVelocity-MultiplierX-MultiplierY-MultiplierZ: Sets velocity based on where the player is looking, multiplied by your values.
    Example: setLookVelocity-0-1-2 would launch the player upwards (Y) and strongly in the direction they are looking horizontally (Z-like component of look vector). Use carefully!
  • addLookVelocity-MultiplierX-MultiplierY-MultiplierZ: Adds to velocity based on where the player is looking.
    Example: addLookVelocity-0-0-1 gives a gentle push in the direction they're looking.

Example: Launch player forward slightly on right click with a feather.

CUSTOMABILITY====FEATHER====addLookVelocity-0-0.3-0.5====100====1000====SELF====ALL====RIGHTCLICKAIR

Advanced Targeting: Ray Trace Abilities

These event types let your abilities target entities or locations in the player's line of sight up to a certain {distance}.

Structure:

CUSTOMABILITY===={IDENTIFIER}===={command}===={chance}===={cooldown}===={SELF_or_CUSTOM}===={target_type}===={RAYTRACE_EVENT_TYPE}===={distance}

Common Ray Trace Event Types:

  • RIGHTCLICKAIRRAYTRACE / LEFTCLICKAIRRAYTRACE: Triggers if the player is looking at an entity within {distance} when they click. The placeholders {x}, {y}, {z}, and {uuid} will refer to the hit entity.
  • RIGHTCLICKAIRRAYTRACEBLOCK / LEFTCLICKAIRRAYTRACEBLOCK: Similar, but stops if it hits any solid block first. If it hits an entity before a block (or no block in range), it targets the entity.
  • RIGHTCLICKAIRRAYTRACELOCATION / LEFTCLICKAIRRAYTRACELOCATION: The command runs for each block location along the player's line of sight up to {distance} or until it hits an entity/solid block.{x}, {y}, {z} refer to each point along the ray. Useful for creating "beams" or paths of effects.
  • RIGHTCLICKAIRRAYTRACELOCATIONBLOCK / LEFTCLICKAIRRAYTRACELOCATIONBLOCK: Like ...RAYTRACELOCATION, but stops if it hits any solid block.

When an entity is hit by a ray trace, {uuid} can be used in your command to get the Unique ID of the entity that was hit (not the player who used the ability).

Powers That Unlock at Certain Levels

Want an ability to only work if a player has reached a certain race/class level? You can! Add a level requirement directly after the ability type (like CUSTOMABILITY or INFLICTDAMAGEEVENT), separated by a semicolon ;.

  • Require level X OR HIGHER: Use ;X (e.g., ;10 means level 10 or above).
    CUSTOMABILITY;10====DIAMOND====say You are skilled enough!====...rest of ability...
    This ability only works if the player is level 10 or higher.
  • Require level X OR LOWER: Use ;-X (e.g., ;-5 means level 5 or below).
    CUSTOMABILITY;-5====APPLE====say Still a beginner, eh?====...rest of ability...
    This ability only works if the player is level 5 or lower.

Extra Tips for Custom Abilities

Cooldown Notifications: Let Players Know!

It's helpful to tell players when their ability is on cooldown and when it's ready again. You can add a cooldown notification message to CUSTOMABILITY and PROJECTILEEVENT.

Add these parts at the very end of the ability line:

...===={event_type}===={message_with_{{cooldown}}_placeholder}===={display_type}====NOTIFY
  • {message_with_{cooldown}_placeholder}: The message shown to the player. Use {cooldown} where you want the remaining cooldown time (in seconds) to appear. Example: "Ability ready in {cooldown} seconds!"
  • {display_type}: How the message is shown.
    • HOTBAR or ACTIONBAR: Shows above the hotbar.
    • MESSAGE: Shows as a regular chat message.
  • NOTIFY: This keyword tells the plugin to enable this notification.

Example with notification:

CUSTOMABILITY====GOLD_INGOT====say Golden Power!====100====5000====SELF====ALL====RIGHTCLICKAIR====Cooldown: {cooldown}s====HOTBAR====NOTIFY

When this ability is used and goes on its 5-second (5000ms) cooldown, the player will see "Cooldown: 5s" (then 4s, 3s, etc.) on their action bar.

Useful Command Examples

Here are a few practical examples to inspire your own creations. Remember to adjust chance, cooldown, and targeting to your needs!

# Example 1: Poison nearby entity when right-clicking grass with CUSTOM5
# (Note: @e selector needs careful tuning for specific targeting)
CUSTOMABILITY====GRASS_BLOCK====effect give @e[distance=..5,limit=1,sort=nearest,name=!{name}] minecraft:poison 3 1====100====5000====CUSTOM5====ALL====RIGHTCLICKBLOCK

# Example 2: Player says their own name when right-clicking air with a Salmon
CUSTOMABILITY====SALMON====say My name is {name}!====100====1000====SELF====ALL====RIGHTCLICKAIR

# Example 3: Repeating "say" command, ends with another "say"
CUSTOMABILITY====STICK====say Repeating...====100====10====SELF====ALL====RIGHTCLICKAIR====REPEATING====60====say ...Stopped repeating.

# Example 4: Inflict poison on entity damaged by player
INFLICTDAMAGEEVENT====effect give {hitPlayerUuid} minecraft:poison 3 1====100====10000
# Note: {hitPlayerUuid} or similar placeholder for target's UUID might be needed depending on plugin version for /effect command to target correctly.
# Or, if commands run from console and need player context for @e:
# INFLICTDAMAGEEVENT====execute at {name} run effect give @e[distance=..1,limit=1,sort=nearest,name=!{name}] minecraft:poison 3 1====100====10000


# Example 5: Poison entity hit by an arrow
PROJECTILEEVENT====ARROW====effect give {hitPlayerUuid} minecraft:poison 3 1====100====10000
# Similar targeting considerations as above.

# Example 6: Make Witches and Zombies friendly
FRIENDLYMOBS====WITCH,ZOMBIE

# Example 7: Toggle invisibility (60s duration) on right-click with String. Repeats every 5s (100 ticks).
# If clicked again, clears effect.
CUSTOMABILITY====STRING====effect give {name} minecraft:invisibility 60 0 false====100====5000====SELF====ALL====RIGHTCLICKAIR====REPEATING====100====effect clear {name} minecraft:invisibility

Important: For commands targeting other entities (like in INFLICTDAMAGEEVENT or PROJECTILEEVENT), ensure your command syntax correctly targets the {hitPlayer} or uses their UUID ({hitPlayerUuid} if available). Vanilla commands like /effect might need execute at {name} run ... @e[tag=...] or similar for precise targeting if placeholders aren't directly substitutable into target selectors.

Time-Based Powers & Organizing Your Abilities

Day/Night Specific Commands (MythicalRaces Style)

MRPremiumAddons lets you run specific Minecraft commands automatically, only during the day or only at night. This system works very much like the passive potion and attribute effects in the base MythicalRaces plugin, using a similar "Data" string to define complex conditions. For each command you want to run, there's a corresponding "Data" line that precisely defines all the conditions that must be met for that command to activate.

You configure these directly under your race (or class) definition in its YAML file—this is different from how you define a CUSTOMABILITY. You'll create a list of commands under dayRaceCommandExecution and a matching list of "Data" strings under dayRaceCommandExecutionData. The same applies for nighttime commands with nightRaceCommandExecution and nightRaceCommandExecutionData.

Let's look at a real example for a "Pixie" race:

Pixie:
  dayRaceCommandExecution:
  - minecraft:effect give {player} minecraft:slow_falling 10 0 true
  - minecraft:effect give {player} minecraft:speed 10 4 true
  - minecraft:effect give {player} minecraft:luck 10 2 true
  - minecraft:effect give {player} minecraft:regeneration 10 0 true
  dayRaceCommandExecutionData:
  - ALL Y > -1000 -1 ALL ALL ALL ALL
  - ALL Y > -1000 -1 ALL ALL ALL ALL
  - ALL Y > -1000 -1 ALL ALL ALL ALL
  - ALL Y > -1000 -1 ALL ALL ALL ALL

  nightRaceCommandExecution:
  - minecraft:effect give {player} minecraft:slow_falling 10 0 true
  - minecraft:effect give {player} minecraft:speed 10 4 true
  - minecraft:effect give {player} minecraft:luck 10 2 true
  - minecraft:effect give {player} minecraft:regeneration 10 0 true
  nightRaceCommandExecutionData:
  - ALL Y > -1000 -1 ALL ALL ALL ALL
  - ALL Y > -1000 -1 ALL ALL ALL ALL
  - ALL Y > -1000 -1 ALL ALL ALL ALL
  - ALL Y > -1000 -1 ALL ALL ALL ALL

  abilities: # Other MRPremiumAddons abilities
  - 'CUSTOMABILITY====STRING====effect give {name} levitation 3 0====100====10====SELF====ALL====RIGHTCLICKAIR'

Each line under dayRaceCommandExecution (and its night equivalent) is the exact console command that will be run. Notice the use of {player} as the placeholder for the player's name in these commands. (This is slightly different from CUSTOMABILITY lines, which often use {name}).

The "Data" string (e.g., 'ALL Y > -1000 -1 ALL ALL ALL ALL') controls the "when and where." In its default form, where all arguments are set to their most inclusive option, it essentially means "no restrictions." Because this system often checks conditions very frequently (potentially every tick, like passive effects), these commands will run repeatedly as long as it's day (or night) and the conditions are met.

Understanding the "Data" String

The 'Data' string is a sequence of arguments, each separated by a space. If an argument needs multiple values (like a list of biomes or blocks), these are typically comma-separated within that single argument slot.

The standard format for the string is as follows, using 'ALL Y > -1000 -1 ALL ALL ALL ALL' as a base example:

  • BIOMES: Specifies the biome(s) in which the command applies. Example: ALL, PLAINS, FOREST,DESERT. (For biome names, use this list).
  • Y: Indicates a check against the player's Y-axis (vertical position).
  • Comparison: Specifies how the player's Y-axis should be compared to the next number. Options: > (greater than), < (less than), = (equal to), >= (greater than or equal to), <= (less than or equal to).
  • Number: The Y-axis value for comparison. Example: -1000 in Y > -1000.
  • Amplifier/Default Value: Leave this as -1, as it is a placeholder no matter what
  • Position: Specifies where the player needs to be in relation to certain blocks (defined next). Options include: ALL (no specific position check), ABOVE, MID (inside), BELOW, AROUND. Only one can be chosen.
  • Blocks: Specifies the block(s) that the 'Position' argument refers to. Example: ALL, WATER, STONE,DIRT. (Use this list for block names).
  • Storm: Specifies if the command applies during a storm. Options: TRUE, FALSE, ALL.
  • World: Specifies the world(s) in which the command applies. Options: ALL, or the name of your world(s) (e.g., world_nether, my_custom_world).

Special Data Types and Examples

In addition to the standard arguments, the "Data" string system (especially if based on MythicalRaces' core logic) supports several special keywords or argument types that can replace or augment parts of the standard string. These allow for even more specific conditions:

  • VAMPIRE: The command applies if all blocks above the player up to the sky limit are not solid blocks (i.e., the player is exposed to the sky).
    Example: 'ALL Y > -1000 -1 VAMPIRE VAMPIRE ALL ALL'
    (Here, VAMPIRE typically replaces both the 'Position' and 'Blocks' arguments).
  • CUSTOM[num] [BLOCK_LIST]: Checks for specified blocks within a [num] radius around the player. [num] is the radius. [BLOCK_LIST] is a comma-separated list of block materials.
    Example: 'ALL Y > -1000 -1 CUSTOM10 STONE,DIAMOND_ORE ALL ALL'
    (This usually means the 'Position' argument becomes CUSTOM[num] and 'Blocks' becomes the list of materials).
  • LIGHTA[num]: The command applies if the light level at the player's location is greater than [num]. Light levels range from 0 to 15.
    Example: 'ALL Y > -1000 -1 LIGHTA6 LIGHT ALL ALL' (applies if light level > 6)
    (LIGHT might be a required keyword in the 'Blocks' slot when using LIGHTA/LIGHTB).
  • LIGHTB[num]: The command applies if the light level is lower than [num].
    Example: 'ALL Y > -1000 -1 LIGHTB6 LIGHT ALL ALL' (applies if light level < 6)
  • TEMPA[num]: The command applies if the biome temperature at the player's location is higher than [num].
    Example: 'ALL Y > -1000 -1 TEMPA0.8 TEMP ALL ALL' (Minecraft temperatures are often between 0.0 and 2.0)
    (TEMP might be a required keyword in the 'Blocks' slot).
  • TEMPB[num]: The command applies if the biome temperature is lower than [num].
    Example: 'ALL Y > -1000 -1 TEMPB0.2 TEMP ALL ALL'
PlaceholderAPI Integration

If your version of MRPremiumAddons or MythicalRaces supports it, you can use PlaceholderAPI placeholders within the Data string for even more dynamic conditions. This usually involves a specific keyword like PAPI in one of the later slots (e.g., 'Blocks' or 'Storm' slot) and then the placeholder check in an earlier slot, often replacing a standard condition.

  • %placeholder%==[string/number]: Checks if the value of %placeholder% is equal to the given string or number.
    Example: 'ALL Y > -1000 -1 %mythicalraces_race%==Elf PAPI ALL ALL'
    Note: This type of check usually works best for single words or numbers, not full sentences.
  • %placeholder%!=[string/number]: Checks if the placeholder is not equal.
    Example: 'ALL Y > -1000 -1 %mythicalraces_race%!=Human PAPI ALL ALL'
  • %placeholder%>[number]: Checks if the (numeric) value of the placeholder is greater than the number.
    Example: 'ALL Y > -1000 -1 %mythicalraces_get_level%>10 PAPI ALL ALL'
  • %placeholder%<[number]: Checks if the (numeric) value of the placeholder is less than the number.
    Example: 'ALL Y > -1000 -1 %playerpoints_points%<100 PAPI ALL ALL'

Because every field in the default 'ALL Y > -1000 -1 ALL ALL ALL ALL' is set to "no restriction," each command listed under dayRaceCommandExecution will run very frequently (potentially every game tick) for all players of that race during the day. The same applies to nightRaceCommandExecution at night.

If you want to add a specific condition—for instance, the command should only run if the player is in water—you would modify the "Blocks" argument (seventh slot) from ALL to WATER, and likely the "Position" argument (sixth slot) to MID. The Data string would then look something like: ALL Y > -1000 -1 MID WATER ALL ALL.

This "Data" string system is incredibly flexible. Always check the latest plugin documentation for a complete list of all possible arguments, their exact order, and special condition types, as precision is key.

Important Note: Be mindful that commands set to run with very broad or no restrictions (like the default ALL Y > -1000 -1 ALL ALL ALL ALL) will execute very frequently for every player with that race. If you have many such commands or very resource-intensive ones, it could impact server performance. Use specific conditions where possible to ensure commands only run when truly needed.

WorldGuard Flags

The plugin adds WorldGuard flags to control abilities in specific regions:

  • mrbase-potionandattributes: Set to DENY to disable MR-applied potion effects and attributes in a region.
  • allow-mrabilities: Set to DENY to block MRPremiumAddons abilities from working in a region.

Organizing Abilities in Separate Files

If you have many abilities, your race/class config files can get very long! You can keep them tidy by putting abilities into separate .yml files inside an "abilities" folder (within your plugin's data folder).

Then, in your race/class config's abilities: list, you can load these files:

# In your race_config.yml
abilities:
  - 'LOAD=MyWeaponRestrictions.yml'
  - 'LOAD=MagicSpells.yml'
  - 'CUSTOMABILITY====DIAMOND====say Direct ability====...' # You can still mix direct abilities

Inside an ability file (e.g., MyWeaponRestrictions.yml), you list the parts of your ability on separate lines. The plugin automatically puts the ==== separators between them. You can use # for comments.

Example: MyWeaponRestrictions.yml

# This file restricts wooden swords
RESTRICTWEAPON
WOODEN_SWORD
# (This becomes: RESTRICTWEAPON====WOODEN_SWORD)

# Another ability in the same file to restrict diamond chestplates
# A blank line or comment line acts as a separator for the plugin to know a new ability starts
# Or ensure a clear visual break for your own sanity; the plugin usually looks for the main ability keyword
# like CUSTOMABILITY, RESTRICTARMOR etc. to start a new definition.

RESTRICTARMOR
DIAMOND_CHESTPLATE

This makes managing large sets of abilities much easier! The plugin typically reads line by line, inserting ==== until it hits a new ability keyword or the end of the file for that ability block.

Supercharge Your Powers: The Scripting System (Beta)

Want ultimate control? The MRPremiumAddons Scripting System (currently in Beta V1) lets you write custom code to create incredibly dynamic and complex game behaviors. You can use conditions (if-statements), store information (variables), run commands, and much more.

How to start:

  1. Go to the plugins/MRPremiumAddons/scripts/ folder on your server.
  2. Create a new text file, for example, my_awesome_script.txt.
  3. Write your script code inside this file.
  4. Then, you can trigger this script using a CUSTOMABILITY.

Making Decisions: if Statements

Scripts can make decisions using if statements. If a condition is true, the code inside the curly braces { } will run.

if (condition_is_true) {
  // Do these things
  executeConsoleCommand("say The condition was true!");
}

You can also have if statements inside other if statements (called "nested ifs") for more complex logic.

Storing Information: Variables

Variables are like little boxes where you can store information (numbers, text, true/false values) to use later in your script.

  • private variableName = value: A private variable is unique to the player who triggered the script. If PlayerA runs the script, their private myHealth = playerHealth() will be different from PlayerB's.
  • global variableName = value: A global variable is shared by *everyone* on the server. If PlayerA changes a global variable, PlayerB will see that change. Use these with caution!

Example:

private currentHealth = playerHealth();
global serverMessage = "Welcome to our awesome server!";

Making Things Happen: Running Commands

To run a Minecraft command from your script (as if typed in the server console), use:

executeConsoleCommand("your minecraft command here")

Important: Currently, you can generally only use executeConsoleCommand *inside* an if statement whose condition has just evaluated to true.

Math and Text

You can do basic math (+, -, * for multiply, / for divide, % for remainder) when setting variables.

You can also combine text (strings) and variables. Use curly braces {{ }} (double curly braces for scripts, single for regular ability commands) to insert a variable's value into a string:

private score = 10 * 5; // score is now 50
private message = "Your score is: {{score}} points.";
executeConsoleCommand("say {{message}}"); // Server says: "Your score is: 50 points."

If you add a string and a number, they usually get joined together as text (e.g., "Score: " + 10 becomes "Score: 10").

Handy Built-in Tools (Functions)

The scripting system gives you some ready-to-use functions to get information about the player running the script:

  • playerXPosition(), playerYPosition(), playerZPosition(): Player's X, Y, Z coordinates.
  • playerWorldName(): Name of the world the player is in.
  • getWorldTime(): Current time in the player's world (a number).
  • playerName(): The player's Minecraft name.
  • playerHealth(): Player's current health (a number).
  • playerHunger(): Player's current hunger level.
  • playerExperience(): Player's current XP level.
  • playerGameMode(): Player's game mode (e.g., SURVIVAL, CREATIVE).
  • playerIsOnGround(): Is the player standing on the ground? (true or false).
  • playerIsSneaking(): Is the player sneaking? (true or false).
  • playerIsSprinting(): Is the player sprinting? (true or false).
  • playerIsFlying(): Is the player flying? (true or false).
  • playerIsInWater(): Is the player in water? (true or false).
  • playerIsInAir(): Is the player in the air? (true or false). (Added based on example usage)
  • playerRaceLevel(): Player's level in their current race.
  • playerClassLevel(): Player's level in their current class.

Example: private yPos = playerYPosition();

Running Your Script with a Custom Ability

To make your script run in-game, you link it to a CUSTOMABILITY. In the command part of the ability, use EXECUTESCRIPT~your_script_filename.txt.

# In your race/class abilities list:
- 'CUSTOMABILITY====STICK====EXECUTESCRIPT~my_awesome_script.txt====100====1000====SELF====ALL====RIGHTCLICKAIR'

This means: When a player right-clicks the air holding a STICK, there's a 100% chance (with a 1-second cooldown) to run the my_awesome_script.txt file from your scripts folder.

Leaving Notes: Comments

You can write comments in your script to explain what's happening or leave notes for yourself. The script ignores these. Start a comment line with //.

// This is a comment, the script will ignore it.
private x = 10; // This part is code, but this comment explains it.

Comparing Things: Logical & Comparison Operators

These are used in your if (condition) to compare values:

  • == : Equal to (e.g., playerHealth() == 20)
  • != : Not equal to (e.g., playerWorldName() != "Nether")
  • > : Less than (e.g., playerYPosition() < 64)
  • > : Greater than (e.g., score > 100)
  • <= : Less than or equal to
  • >= : Greater than or equal to
  • && : Logical AND (both sides must be true, e.g., playerIsSneaking() && playerIsOnGround())
  • || : Logical OR (at least one side must be true, e.g., playerHealth() < 5 || playerHunger() < 5)

Example using operators:


  private playerHealth = playerHealth()
private playerIsInAir = playerIsInAir()

if(playerHealth > 10 && playerIsInAir == true) {
  // commands
}

The commands inside the if block will only run if the player's health is greater than 10 AND they are in the air.

Example Scripts

Here are a few examples showing these features in action. These scripts can be placed in .txt files in your scripts folder.

Script 1: Location-based events & player info.


  // 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_2 = playerYPosition(); // Renamed to avoid conflict with playerY above
  private playerHealth_2 = playerHealth(); // Renamed
  private worldTime = getWorldTime();

  // Reward player for climbing high (above Y=100)
  if(playerY_2 > 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_2 < 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.");
  }

Script 2: Conditional effects based on world and stats.


  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()}}!")
  }
}

Script 3: Rewards based on height, health, and time.


  // 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) { // Note: Original had >= 0, this has > 0. Keeping as is.
  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) { // Note: Original had >= 12000, this has > 12000. Keeping as is.
  executeConsoleCommand("minecraft:give {{playerName()}} minecraft:bed 1")
  executeConsoleCommand("say It's nighttime, {{playerName()}}! Here's a bed for you to skip to daylight.")

}

Script 4: More location and status checks. (Similar to Script 1 but structured as a separate example)


  // 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!")
}

Scripting System: Current Limitations (Beta V1)

While powerful, the scripting system is still in beta and has some limitations to be aware of:

  • Simple ifs Only: No else or else if parts for if statements yet. You can use multiple separate if statements.
  • No Loops: Features like for loops or while loops are not currently supported.
  • Basic Math: Only basic arithmetic (+, -, *, /, %). No advanced math functions like square roots or powers.
  • Simple Variables: Variables can hold numbers, text (strings), or true/false (booleans). No complex data structures like lists or arrays directly within the script language.
  • Command Execution Context: As mentioned, executeConsoleCommand typically needs to be within an if block that just evaluated to true.
  • Nested Ifs are Supported: You can put an if statement inside another if statement for more complex logic paths.

Despite these limitations, you can still achieve a lot of cool and complex behaviors!