Retard script - Sponge-RPG-dev/NT-RPG GitHub Wiki
Retard script is a scripting functional language for NTRpg. Unlike many other script implementation you can find in plugins such as MythicMobs, SkillApi etc retard script is designed to work with as little overhead as possible. Theres no reflection or complex abstraction, retard script is translated directly into jvm bytecode.
-
@<name>
- references a variable -
$settings.<name>
- Within a skill references skill node value
All function calls must follow pattern
function_name{<parameter>=<value>, ... }
Some function parameters are mandatory and some might be optional.
targetted_entity{range=$settings.range, entityFrom=@caster}
spawn_lighting{location=@target}
-
Function call, that returns boolean value must follow after the
IF
keywordSelects a statement to execute based on the value of a Boolean expression
Must always end with the
END
keywordIF exists{test=@target} call_some_function END
To negate the expression
IF NOT exists{test=@target} call_some_function END
-
Schedules enclosed code block to run later, time is in milliseconds
Must always end with the
END
keywordcall_function_executed_now DELAY 1000 call_function_executed_later END
-
Ends execution of the script
Within skill script skill result value must follow
RETURN
keyword.- CANCELLED wont take caster`s mana, nor applies cooldown
- OK - takes caster mana and applies cooldown
IF is_in_biome{entity=@caster, biome=desert} RETURN CANCELLED END send_message{entity=@caster, message=you are in desert biome} RETURN OK