Custom abilities
Last updated
Was this helpful?
Last updated
Was this helpful?
Next, read through for information on how to register your plugin as an Origins-Reborn addon, and register custom abilities.
To create custom abilities, you need to make classes that implement Ability interfaces.
Different ability interfaces let you create custom abilities that do different things, and you can implement multiple ability interfaces in a single ability.
Any Ability
classes that implement Bukkit's Listener
will automatically be registered as event listeners, so you don't need to do that yourself.
These are the main Ability interfaces that can be used (ones in blue have been documented):
Used for basic abilities with no description
Used for abilities that appear in the origin selection GUI
TriggerableAbility
Used for abilities which grant players special powers that can be triggered through certain actions and configured in the ability-config.yml
, such as left clicking with an empty hand, toggling sneak, right clicking and more.
CooldownAbility
Used for abilities that have a cooldown, which may also use the HUD cooldown bar system
When using custom cooldown bars, you must create an icons
folder in your plugin's resources that contains an image for the cooldown bar and icon.
AttributeModifierAbility
Used for abilities that modify the attributes of a player
BreakSpeedModifierAbility
Used for abilities that change the player's break speed in certain areas
FlightAllowingAbility
Used for abilities that allow players to fly (or abilities that wish to use the flight toggle to trigger some kind of event)
SkinChangingAbility
Changes the player's Minecraft skin
Requires the SkinsRestorer hook to be set up in the Origins-Reborn config.yml
MultiAbility
Used to combine multiple abilities under a single key
Useful if you want to create something like a single ability that can modify multiple attributes without needing to create multiple different keys.
Not all interfaces are documented yet, full documentation is currently in development.
To register your custom abilities, you need to return a new instance of them in the getRegisteredAbilities
method, like this:
For now, you can join the for help with using any of these.