Skip to content

Optional "other" argument provided by playerAction by default can lead to two execute blocks being triggered when manually adding another block that takes a player argument #90

@0ffz

Description

@0ffz

This is very odd behaviour that led to an oversight in a command in our main plugin:

playerAction {
    // do something
}
val offlinePlayer by offlinePlayerArg { default = sender as? Player }
action {
    // do something involving another player, but not AS that player
}

If players have the .other permission it seems BOTH actions get executed which is unexpected.

Proposed solution

  • I personally expected only one block to fire, seeing as we use brigadier under the hood it might not be super easy to change this, but should be investigated since it would prevent such an edge case
  • Stop providing the default .other and instead provide a helper for it that is more explicit. Ex. something with an argument that defaults to current player. We could still likely run into this problem with optional arguments however since they abstract away all the execute blocks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Default

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions