Retard script - Sponge-RPG-dev/NT-RPG GitHub Wiki

Language Reference

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.

Special characters

  • @<name> - references a variable
  • $settings.<name> - Within a skill references skill node value

Function call

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}

Keywords

  • IF statement

    Function call, that returns boolean value must follow after the IF keyword

    Selects a statement to execute based on the value of a Boolean expression

    Must always end with the END keyword

    IF exists{test=@target}
       call_some_function
    END
    

    To negate the expression

    IF NOT exists{test=@target}
       call_some_function
    END
    
  • DELAY

    Schedules enclosed code block to run later, time is in milliseconds

    Must always end with the END keyword

    call_function_executed_now
    DELAY 1000
        call_function_executed_later
    END
    
  • RETURN

    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
    
⚠️ **GitHub.com Fallback** ⚠️