Skip to content

Creating Custom Dragons

Parker Hawke edited this page May 31, 2020 · 5 revisions

As of DragonEggDrop - Revival version 1.4.1, DragonEggDrop allows you, as the server owner, to define dragon templates to customize a set of dragons to spawn in the end. Templates are easily configurable YAML files found in the DragonEggDrop/dragons folder that will be parsed and loaded as the plugin enables and randomly applied when a dragon respawns in The End. By default, there are 12 dragon templates created by the plugin on the first run. The dragon names and bar styles are pre-configured and will have default loot which should be optimal for survival servers.

As of DragonEggDrop - Revival version 1.8.0, the loot system is now driven entirely by loot tables - a system inspired by Minecraft's loot table system. These loot tables are a powerful JSON file that define a set of loot pools to be generated when the dragon has been killed. See here for information on loot tables.

Creating a New Template

There are 2 ways to start creating a template

  1. Create a template from scratch. (i.e. New File -> "YourDragon.yml")
  2. Copy an existing template and rename it (recommended)

When creating a file, you must be mindful that there are limitations on the file names. Failing to meet one of these requirements will result in your file not being loaded.

  • The file name MUST be unique
  • The file name cannot contain spaces (' ' or \u0020)

The name of the file does not necessarily need to match the name of the dragon. The dragon's name is configured within the file itself, but the file name is used as a reference in-game for the /dragontemplate command

Copying a File

Customizing Your Dragon

Once a new file has been created, the dragon template is ready to be parsed and loaded into memory. However, having a copy of a dragon is most likely not what was intended. In order to customize the dragon, open the file and view its contents with your favorite text editor (Notepad++ is recommended but you may use your editor of choice).

Below are the default file contents for a dragon template

dragon-name: '&5Nveryoth, Lord of Light'
bar-style: SEGMENTED_20
bar-color: YELLOW

spawn-weight: 0.05
spawn-announcement:
  - "&8[&c!!!&8] %dragoneggdrop_dragon% has respawned in the end!"
  - "&7Kill it before the others can reap its rewards!"

attributes:
  GENERIC_MAX_HEALTH: 600
  GENERIC_ARMOR: 15
  GENERIC_ATTACK_DAMAGE: 9

loot: "legendary_dragon"

Many of these features should be self-explanatory, but for an in-depth guide on all supported configuration values, see Supported Template Options. Once your dragon has been configured the way you like, head in-game and execute the /dragoneggdrop reload command. Once reloaded, you should see your dragon when executing the /dragontemplates command

Below you will see a new dragon template being loaded in game

dragon-name: '&cMy Custom dragon'
bar-style: SEGMENTED_20
bar-color: RED

spawn-weight: 0.5
spawn-announcement:
  - "&8[&c!!!&8] %dragoneggdrop_dragon% has respawned in the end!"
  - "&7Kill it before the others can reap its rewards!"

attributes:
  GENERIC_MAX_HEALTH: 600
  GENERIC_ARMOR: 15
  GENERIC_ATTACK_DAMAGE: 9

loot: "example_dragon"

Seen In-Game

Supported Template Options

Using the example of Tilenth.yml, one of the default dragon template files, the default dragon template file looks something similar to this:

dragon-name: "&8Tilenth, Lord of Death"
bar-style: SEGMENTED_20
bar-color: PURPLE

spawn-weight: 0.05
spawn-announcement:
  - "&8[&c!!!&8] %dragoneggdrop_dragon% has respawned in the end!"
  - "&7Kill it before the others can reap its rewards!"

attributes:
  GENERIC_MAX_HEALTH: 600
  GENERIC_ARMOR: 15
  GENERIC_ATTACK_DAMAGE: 9

loot: "legendary_dragon"

dragon-name

The name of the dragon to be displayed above the boss bar. Colour codes are supported

bar-style

The style of the boss bar to be displayed. A list of all supported bar style constants may be found on Spigot's BarStyle Javadoc page. Defaults to "SOLID".

bar-color

The colour of the boss bar to be displayed. A list of all supported bar colour constants may be found on Spigot's BarColor Javadoc. Defaults to "PINK"

spawn-weight

The weight chance that the dragon will respawn. Weight is defined as weight over the sum of all weight. For example, if 2 dragons are created, one with a weight of 2 and the other 7, the first dragon will have a 2/9 chance to spawn whereas the second dragon will then have a 7/9 chance to spawn (2 + 7 = 9, the sum of all weight). This option supports decimal values.

spawn-announcement

A list of messages to send to all players when this dragon template has been spawned in the end. This option is not mandatory and may be removed or set to [] if no messages should be sent (i.e. spawn-announcement: [])

attributes

Attributes are a feature implemented by Mojang to determine the qualities or attributes so to speak, of an entity. There is a large list of attributes which may be found on Spigot's Attribute List (or, for more detail, on Minecraft's Attribute Wiki). Attributes may be applied similarly to enchantments in the loot section where a key (Spigot's attribute page lists all valid attributes) may be mapped to a decimal value from 0 to the maximum of the attribute. Any attribute listed in this section will be applied to the dragon when it is spawned.

loot

A string defining which loot table should be used to generate the loot for the dragon upon death. The loot table name must match the file name found in the loot_tables directory in the plugin's root directory. (plugins/DragonEggDrop/loot_tables/) without the file extension. If this option is not specified or is invalid, vanilla behaviour will be used and a dragon egg will be generated instead.

For information on how to write a loot table, see the wiki on loot tables.