Origins-Reborn
  • Contents
  • FAQ
  • Addons
  • Custom origins
    • Origin Powers
    • Layers
  • Placeholders
  • Troubleshooting
  • Configuration
  • Skript
  • Making your own Origins-Reborn addon
    • Creating the addon
    • Custom abilities
    • Ability
    • VisibleAbility
Powered by GitBook
On this page

Was this helpful?

  1. Making your own Origins-Reborn addon

VisibleAbility

How to create abilities that show up in the selection GUI

PreviousAbility

Last updated 18 days ago

Was this helpful?

Note: This page only contains information relevant to the VisibleAbility interface.

For information on giving your ability a key and running code for players who have the ability, see the interface.

When creating a VisibleAbility, you need to implement the description and title methods with your ability's description and title.

Note: These set the default description and title for your ability.

These will be saved to the ~/plugins/Origins-Reborn/translations.yml file, allowing people who use your addon to easily customise the description and title.

Because of this, updating the description and title in your class will not update the ability title and description if you have already loaded the server with the old versions.

You can fix this by changing them in the translations.yml file, or by deleting the file to make the plugin regenerate it.

Example:

public class ExampleCustomAbility implements VisibleAbility {
    @Override
    public @NotNull Key getKey() {
        return Key.key("my_cool_addon", "my_ability");
    }

    @Override
    public String description() {
        return "My Description";
    }

    @Override
    public String title() {
        return "My Title";
    }
}
Ability