Skip to content

[Suggestion] A way to return erly #33

Open

Description

@kybe236

smth so you can return early like {player.get_item(38) != null && player.get_item(38).name != "Elytra" ? break : ""}

Activity

  1. DrParanoya commented on Jul 28, 2025

    @DrParanoya

    How would break be different from just returning null or an empy string?
    And wouldn't it just end up returning null or an emtpy string?

  2. kybe236 commented on Jul 28, 2025

    @kybe236
    Author

    i didnt know you could return

  3. kybe236 commented on Jul 28, 2025

    @kybe236
    Author

    prob can be closed

  4. DrParanoya commented on Jul 29, 2025

    @DrParanoya

    i didnt know you could return

    {"hello"}
    ^ this expression returns the string "hello"
    every single starscript expression returns something
    the empty string at the end of your example gets returned when your boolean expression results in false

  5. kybe236 commented on Aug 1, 2025

    @kybe236
    Author

    no like {return early} {this dosn't do anything}

  6. DrParanoya commented on Aug 3, 2025

    @DrParanoya

    no like {return early} {this dosn't do anything}

    Every expression ({}) returns something. There is no way around that!!!
    And even if for some reason this was implemented, it would most likely also just return null.
    And you can already return null.

    After reading your last message again, you can just use a conditional statement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions