Skip to content

Add ComponentLike argument to #failWithAdventureComponent method #577

@ipiepiepie

Description

@ipiepiepie

Description

I'd like to send error messages, using my custom message class, which implements ComponentLike interface.

At the moment, my error handling in commands looks like this:

if (!player.hasTown())
    throw CommandAPIBukkit.failWithAdventureComponent(message(ERR_WITHOUT_TOWN).asComponent());

After implementing suggested feature, my error handling would be:

if (!player.hasTown())
    throw CommandAPIBukkit.failWithAdventureComponent(message(ERR_WITHOUT_TOWN));

The second option looks much easier and prettier.

Expected code

CommandAPIBukkit#failWithAdventureComponent(ComponentLike)

Extra details

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestimplemented for next releaseThis has been implemented in the current dev build for the next public release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions