Skip to content

2.4

Choose a tag to compare

@Ontey6 Ontey6 released this 06 Sep 07:08
· 9 commits to v2 since this release

Changes

  • Code & API Changes

    • Moved away from enums. Now using interfaces (Foo), registries (FooRegistry), creators (FooCreator), parsing factories (Foos)
      • converted CommandComponentType
      • converted ExecutionType
      • converted RequirementType
      • converted SuggestionType
    • Made CustomCommand and CommandSection records. Both now implement CommandSectionLike with methods for name, children, command component and values. They also no longer have parent and root fields as you can not have those and children on an immutable object.
  • Added a plugin command (/customcommand or /ccmd)

    • Subcommand command gives you the values (permission, description, aliases...) of the command (section) specified after.
    • Subcommands commands sends a list of all commands with values into chat.
      • Subcommand with only shows the value entries (permission, description, aliases) specified after for each command.
    • Subcommand help sends the description of the command (section) specified after.
    • Subcommand reload Rebuilds all commands, registers them using NMS and sends command update packets to all players.
    • Subcommand update If there is a new update, downloads it after confirmation. It will be applied on the next restart.
  • All executions except for javascript and javascript_reference are now wrapped in a section like this to more easily support multi-typing in the future:

    executes:
      type: message
      message:
        message: '<green>Hello, World!'
        broadcast: true
    executes:
      type: boss_bar
      boss-bar:
        name: 'Custom boss bar'
        progress: 1.0
        color: yellow
        stay-ticks: 100 # 5s
  • Arguments now start with either literal or argument instead of then

    v2.3.1:

    then:my-argument:
      type: LITERAL
    # or
    then:my-argument:
      type: ARGUMENT
      argument:
        type: INTEGER

    vs. now:

    literal:my-argument:
    # or
    argument:my-argument:
      type: integer
  • When one command can't be parsed, now skips only that command instead of the entire file

  • Made Javascript not spam the console

  • Added Javascript variables:

    • console - the console
    • args - A utility object for getting arguments
      • get("name") gets the argument with the name. Resolves ArgumentResolvers, so it will return a Player instead of a PlayerSelectorArgumentResolver for an argument type of player.
      • resolveAngle("name") resolves an angle argument. get("name") already does this.
      • resolveAngle("name", source) allows you to specify a custom source to resolve the angle with
      • resolve("name") resolves the argument. get("name") already does this.
      • resolve("name", source) allows you to specify a custom source
    • isExecutorEntity - If the executor is an entity. If false, it is a console
    • isExecutorConsole - If the executor is a console. executor is unusable (null) if this is true. Use sender in that case.
    • suggestions Utility object for creating suggestion entries (only in suggestions)
      • string("suggestion") - A string suggestion
      • string("suggestion", "tooltip") - A string suggestion with tooltip (hover text)
      • integer("suggestion") - An integer suggestion
      • integer("suggestion", "tooltip") - An integer suggestion with tooltip (hover text)
  • Fixed javascript_reference

  • Updated examples

  • Renamed commands execution type to command