Skip to content
This repository was archived by the owner on Jul 25, 2024. It is now read-only.

Create custom spells ".spell files"

jamailun edited this page Jun 28, 2020 · 1 revision

How to create custom spells without java

You want to create new spells ? But you don't know anything about java ? Don't worry !


First of all : create a new file named however you'd like, but with a .spell extension.
Then open it with your favorite text editor. I recommand you Notepad++ because i made a syntax colouring on it.
Each spell file can be decomposed in 2 parts :

The 'data' part.

With informations such as the id, the displayed name, the cost in mana... It's always the same format : <data>: value. For example, a valid data part could be :

id: example_spell
name: Good example spell
level: 1
classe: NONE
color: GREEN
lore: One line of description;Another line
mana: 5
cooldown: 2

The 'casting methods' part.

You have to open bracket to enter this part (bracket = {). Then, line by line, you may enter 'orders'.
Just note something : i use a system of variables. Variables are words who starts with a % character, such as %variable or %V4ri1AblE. When a spell is casted, only 1 variable will be defined by the code itself : %caster wich represents... the player who casted the spell.

Actually, we are the 28 june 2020. Here's a list off all commands :

One-line commands

One line is enought for them.

  • send "<TEXT>" to %PLAYER : Send a message (wich allow color codes like &a or &l) to a player.
  • heal %ENTITY of <INTEGER> : Heal an entity by an amount of health.
  • damage %ENTITY of <INTEGER> : Damage an entity by an amount of health.
  • apply <POTION_EFFECT> [level] during <DURATION> <TIME_UNIT> to %ENTITY : Apply a potion effect during an amount of time to an entity.
  • define %VARIABLE as (closest) @SELECTOR from %ENTITY around <RANGE> : Set a variable to the closest @SELECTOR around an entity, with the limit of blocks.

Data-blocks commands

Just one line command but with additionals and optionals data. Don't forget to close the bracket after a data block structure.

  • spawn [INTEGER] <ENTITY_TYPE> around %ENTITY with { : spawn some instance of the ENTITY_TYPE.

Data tags are : "health", "speed", "name", "damages", "duration", "max-alive"

  • throw <PROJECTILE_TYPE> from %ENTITY with { : Make an entity throw a projectile.

Data tags are : "bounce", "damages", "fire-chances", "critical-chances", "gravity", "pierce-level", "velocity", "speed"

  • emit [INTEGER] <PARTICLE_TYPE> around %ENTITY with { : spawn particles.

Data tags are : "offset-x", "offset-y", "offset-z", "speed"

Structures blocks

Bigger shot than the others. You have to put structure in thoses block structures.

  • for @SELECTOR as %VARIABLE around %ENTITY in <RANGE> do { : For all entities matching @SELECTOR around the entity (with the limite of range), affects one by one to the variable %VARIABLE, wich can be use by other structures in the block.
  • delay during <INTEGER> <TIME_UNIT> then { : delay the structures in the DELAY structure by an amount of time, then call the substructures.

Examples

  • 1 : Send message and apply effect to closest entity.

send "Hello world ! ? &aI'm green :D" to %caster
define %truc as closest entity from %caster within 5
apply levitation 2 during 5 seconds to %truc`

  • 2 : Damage all mobs around caster

for mobs as %o around %caster in 16 do {
   damage %o of 5
   emit 50 FLAME round %o with {
      speed: 0.14
      offset-x: 0.2
      offset-y: 0.1
      offset-z: 0.2
   }
}