01Overview
RDragonRide lets players mount and fully control an Ender Dragon directly in Minecraft. Built on pure Paper API, zero NMS required, with no version-specific internals to maintain. One jar runs on Paper 1.21.4 and newer. Summon timed or permanent dragons, configure every stat, and hook into the public API in minutes.
02Features
DragonRideEvent, plus DragonDismissEvent with the dismiss reason03API reference
Add RDragonRide as a dependency and use RDragonRideAPI to summon, dismiss and query dragons from your own plugin. RDragonRide adds no commands or items by itself.
Add the dependency
RDragonRide is not published to a Maven repository. Build the jar from the GitHub source with gradle build and copy build/libs/RDragonRide-1.0-all.jar into your project's libs/ folder. Keep it compile-only; do not shade it into your plugin.
dependencies { compileOnly files('libs/RDragonRide-1.0-all.jar') }
dependencies { compileOnly(files("libs/RDragonRide-1.0-all.jar")) }
With Maven, install the jar into your local repository first:
mvn install:install-file -Dfile=RDragonRide-1.0-all.jar -DgroupId=net.rdevelopment -DartifactId=rdragonride -Dversion=1.0 -Dpackaging=jar
<dependency>
<groupId>net.rdevelopment</groupId>
<artifactId>rdragonride</artifactId>
<version>1.0</version>
<scope>provided</scope>
</dependency>
plugin.yml dependency
depend: [RDragonRide] # or, if the integration is optional: softdepend: [RDragonRide]
Methods
Click a method to see its parameters, return value and an example.
get()Get the API instance
- Signature
static RDragonRideAPI get()- Returns
- The registered API instance
- Throws
IllegalStateExceptionif RDragonRide is not enabled
RDragonRideAPI api = RDragonRideAPI.get();
summonDragon(player)Summon a dragon with the default config
- Signature
@Nullable EnderDragon summonDragon(Player player)- player
- The player to summon for
- Returns
- The dragon, or
nullon cooldown or if the event was cancelled - Fires
DragonRideEvent
EnderDragon dragon = api.summonDragon(player);
summonDragon(player, config)Summon a dragon with your own config
- Signature
@Nullable EnderDragon summonDragon(Player player, DragonConfig config)- player
- The player to summon for
- config
- The settings of this dragon
- Returns
- The dragon, or
nullon cooldown or if the event was cancelled - Fires
DragonRideEvent
api.summonDragon(player, DragonConfig.builder() .durationTicks(6000) // 5 minutes .maxHealth(1000) .fireballEnabled(false) .build()); // Never times out api.summonDragon(player, DragonConfig.permanent());
dismissDragon(player, reason)Remove the active dragon
- Signature
boolean dismissDragon(Player player, DismissReason reason)- player
- The player who owns the dragon
- reason
- Passed on to the event
- Returns
trueif there was an active dragon- Fires
DragonDismissEvent
api.dismissDragon(player, DismissReason.MANUAL);
hasDragon(player)Check for an active dragon
- Signature
boolean hasDragon(Player player)- player
- The player to check
- Returns
trueif the player has an active dragon
boolean active = api.hasDragon(player);
getDragon(player)Get the active dragon
- Signature
Optional<EnderDragon> getDragon(Player player)- player
- The player who owns the dragon
- Returns
- The active dragon, or empty
Optional<EnderDragon> mount = api.getDragon(player);
getOwner(dragon)Find out who a dragon belongs to
- Signature
Optional<UUID> getOwner(EnderDragon dragon)- dragon
- Any Ender Dragon
- Returns
- The UUID of the owner, or empty if it is not an RDragonRide dragon
Optional<UUID> owner = api.getOwner(dragon);
getActiveOwners()List every player with an active dragon
- Signature
Set<UUID> getActiveOwners()- Returns
- Unmodifiable snapshot of the owner UUIDs
Set<UUID> owners = api.getActiveOwners();
getRemainingTicks(player)Time left before the dragon despawns
- Signature
long getRemainingTicks(Player player)- player
- The player who owns the dragon
- Returns
- Remaining ticks,
-1without a dragon,Long.MAX_VALUEif permanent
long ticksLeft = api.getRemainingTicks(player);
getSummonCooldownTicks(player)Time left before the next summon
- Signature
long getSummonCooldownTicks(Player player)- player
- The player to check
- Returns
- Remaining ticks,
0if ready
long cooldown = api.getSummonCooldownTicks(player);
fireFireball(player)Shoot a dragon fireball
- Signature
boolean fireFireball(Player player)- player
- The shooter, the fireball flies in their look direction
- Returns
falseon cooldown, without an active dragon or if fireballs are disabled
boolean fired = api.fireFireball(player);
getFireballCooldownTicks(player)Time left before the next fireball
- Signature
long getFireballCooldownTicks(Player player)- player
- The player who owns the dragon
- Returns
- Remaining ticks,
0if ready
long cooldown = api.getFireballCooldownTicks(player);
summonDragon returns null if the player is on cooldown (12000 ticks, 10 minutes) or the DragonRideEvent was cancelled. An already active dragon is dismissed first, even if the new summon is then rejected.Types
DragonConfigAll options and their defaults
| Option | Type | Default | Description |
|---|---|---|---|
| durationTicks | long | 2400 | Ticks until auto-despawn (20 ticks = 1 second), ignored when permanent |
| maxHealth | double | 500.0 | Maximum HP |
| baseSpeed | double | 0.9 | Forward and backward speed |
| strafeFactor | double | 0.65 | Lateral speed relative to base |
| verticalFactor | double | 0.55 | Jump and sneak vertical speed |
| pitchFactor | double | 0.45 | Pitch contribution when flying forward |
| showBossBar | boolean | true | Show the HP and timer boss bar to the rider |
| fireballEnabled | boolean | true | Allow dragon fireballs |
| fireballCooldownTicks | long | 600 | Ticks between fireballs (600 = 30 seconds) |
| permanent | boolean | false | The dragon never times out |
DismissReasonWhy a dragon was dismissed
| Value | When |
|---|---|
| MANUAL | The owner dismissed it |
| TIMER_EXPIRED | The duration ran out |
| DRAGON_DIED | The dragon was killed |
| OWNER_DIED | The owner died |
| OWNER_OFFLINE | The owner disconnected |
| API | Dismissed programmatically |
04Events
Both events are fired on the Bukkit event bus. Only DragonRideEvent is cancellable.
| Event | Fired when | Cancellable | Key getters |
|---|---|---|---|
| DragonRideEvent | A dragon was spawned, just before the player mounts it | Yes | getPlayer(), getDragon() |
| DragonDismissEvent | A dragon is dismissed (timer, API call, owner death or quit) | No | getPlayer(), getDragon(), getReason() |
Listener example
@EventHandler public void onRide(DragonRideEvent event) { event.getPlayer().sendMessage("You mounted a dragon!"); } @EventHandler public void onDismiss(DragonDismissEvent event) { if (event.getReason() == DismissReason.TIMER_EXPIRED) { event.getPlayer().sendMessage("Your dragon despawned."); } }
05Requirements
06Download
- Build the plugin from source with
gradle build. - Place
build/libs/RDragonRide-1.0-all.jarin your server's/pluginsfolder. - Restart the server, no reload needed.