This module adds a language element which most languages already have: Switch

Downloads

Version 1.0.2 for mc version 1.8 / API version 17

  • Switch can now be nested

Version 1.0.1 for mc version 1.8 / API version 17

  • Arguments in CASE now get parsed

Version 1.0.0 for mc version 1.8 / API version 17

Examples

&string = "World"

// Works with all types of variables (strings, integers and booleans)
switch(&string)
    case("Hello")
        // Gets called when &string equals "Hello"
        log("Hello")
    case("World","Example")
        // Gets called when &string equals "World" or "Example"
        log("World or Example")
    default
        // Gets called if none of the above match
        log("Default")
endswitch