Habitats - MWall541/Dragon-Mounts-Legacy GitHub Wiki
This section covers the different types of Habitats, and includes examples of what dragon uses them. It's more for a technical view for datapacks. If your looking for in-depth information on what habitat to use for a specific dragon breed, check out the [Breeds] page!
Habitats are the environments that dragon eggs can adapt to, and overtime decide its hatching breed. Once the egg has hatched however, there's no turning back.
You can manipulate the habitat of a dragon egg by changing its environment around. Whether replacing blocks, dipping it in fluids, or keeping it in the dark. The list goes on.
A habitat json object can look as simply as this:
{
"type":<Habitat ID>,
"parameter": "value",
"parameter2": 5
}
Internally, An egg breed is chosen based on habitat using a point system. Some habitats can take in direct points to award, and some take in multipliers; it depends on the type of habitat. For example, if a habitat looks for a bunch of blocks, it will take in a point multiplier. This is because the amount of blocks present are counted to represent each point. the points are added up, and is then multiplied by the supplied multiplier, and the final result is the awarded points. Picky type awards all points added up by its arguments; It is recommended to keep points awarded by picky arguments somewhat low because of this.
The most points a breed is awarded, that breed wins the decision to transform the egg into that breed. For example, if more magma blocks are present than water, fire egg wins because there are more magma blocks to award points.
Habitat ID: "biome"
Parameters:
-
"biome_tag"
- A tag consisting of biomes.
Biome habitats are just what the name suggests. If the egg is present in any of the biomes in the tag, it will get a liking to that breed. Forest dragons use this in jungles, and Nether in the nether biomes.
Habitat ID: "nearby_blocks"
Parameters:
-
"block_tag"
- A tag consisting of blocks.
Again, fairly self explanatory. The egg will check its surrounding blocks to see if they are within the tag. Ice dragons use this for snow and ice blocks.
Habitat ID: "in_fluid"
Parameters:
-
"fluid_tag"
- A tag consisting of fluids.
The egg will check its surrounding fluids to see if they are within the tag. Water dragons use this for surrounding water.
Habitat ID: "world_height"
Parameters:
-
"height"
- A number to describe the height the egg needs to be at, over, or under. -
"below"
- (Optional) true or false. Whether to check if the egg should be below the specified"height"
or above it.
Pick a height, and if you want this egg to check BELOW this height, ensure you specify "below"
as true. Otherwise, you don't need it.
Aether dragons use this for really high world heights.
Habitat ID: "light"
Parameters:
-
"light"
- A number to describe what light level the egg needs to be, over, or under. -
"below"
- (Optional) true or false. Whether to check if the egg should be below the specified"light"
level or above it.
The egg will see if it likes to be in this light value. (Ensure you specify "below"
as true if you want the light to be BELOW "light"
)
Ghost dragons use this for low-light areas.
Habitat ID: "dragon_breath"
No Parameters.
The egg must be in an Area Effect Cloud consisting of Dragon Breath. This comes from the ender dragon herself, after a fireball lands. End dragons use this.
Habitat ID: "picky"
Parameters:
-
"required_habitats"
- A list of other different habitats.
The Picky habitat is exactly what the name suggests it to be. The egg is picky on its environment and everything described MUST be satisfied in order to even be considered. For example, if a Biome habitat consisting of Ice biomes, and a Nearby Blocks habitat consisting of grass blocks, is described, the egg MUST be in an icy biome, with grass blocks near it to choose this breed. Ghost dragon uses this for required low light levels, and low world heights.