Skip to content

Timepsan Infinity #7458

@ShaneBeee

Description

@ShaneBeee

Suggestion

Skript's Timespan should support infinity.
Potion effects with a time of -1 are considered infinite.
Returning the timespan from a potion that is infinite is impossible since Timespan requires 0+ milliseconds.

Suggestion:

  • An infinite boolean field definition that the timespan is infinite.
  • A new constructor to create an infinite timespan (which can set milliseconds to -1 and set the infinite field to true
  • A method to return infinite

Why?

In SkBee I have an expression timespan of %potioneffect%, my only option is to return a timespan with Long/Integer.MAX_VALUE.
This isn't what I really want.

Not to mention if Skript ever has this expression (which it should), its going to have the same issue.

Other

No response

Agreement

  • I have read the guidelines above and affirm I am following them with this suggestion.

Metadata

Metadata

Assignees

No one assigned

    Labels

    completedThe issue has been fully resolved and the change will be in the next Skript update.enhancementFeature request, an issue about something that could be improved, or a PR improving something.priority: lowIssues that are not harmful to the experience but are related to useful changes or additions.

    Type

    No type

    Projects

    Status

    Done - Released

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions