Setup
Ensure that you have SentryPremades in your plugin’sdepend or softdepend list in your plugin.yml.
plugin.yml
Triggering Premades
The plugin provides a centralSentryPremadesAPI object with static methods to execute premades seamlessly.
Executing Abilities
To execute an ability, provide the ability’s ID and the targetEntity. You can optionally provide a specific Location.
Executing Events
Events operate independently of a specific entity, typically affecting the environment.Important: If you specify a preset ID (e.g.,
flaming-shot:low-damage), ensure the preset ID is included exactly as formulated when calling the API!Programmatic Registration
While SentryPremades allows bundling addons into.jar files (see Custom Addons), you can also register abilities directly from your own plugin’s code without writing a premade.yml.
To do this, interact directly with the PremadeRegistry!
Registering an Ability
Auto-Registering Bukkit Listeners
When developing complex abilities, you’ll often need to listen to Bukkit events. SentryPremades makes this incredibly simple. If your customAbility or Event class implements org.bukkit.event.Listener, the PremadeRegistry will automatically register your event handlers when the ability is loaded, and automatically unregister them when the plugin reloads or the ability is removed!
.png?fit=max&auto=format&n=VrRd9ylcA_lbpmt6&q=85&s=4eb75c6784eda09d9cdee2d5224ca0e8)