SPIGOT-6918: Add SpawnCategory API and configurations for Axolotls

By: Doc <nachito94@msn.com>
This commit is contained in:
Bukkit/Spigot
2022-02-07 18:47:24 +11:00
parent 7c667b37d9
commit dd8840cd02
5 changed files with 297 additions and 1 deletions

View File

@@ -638,4 +638,12 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
*/
@NotNull
Pose getPose();
/**
* Get the category of spawn to which this entity belongs.
*
* @return the entity´s category spawn
*/
@NotNull
SpawnCategory getSpawnCategory();
}

View File

@@ -0,0 +1,43 @@
package org.bukkit.entity;
/**
* Represents groups of entities with shared spawn behaviors and mob caps.
*
* @see <a href="https://minecraft.fandom.com/wiki/Spawn#Java_Edition_mob_cap">Minecraft Wiki</a>
*/
public enum SpawnCategory {
/**
* Entities related to Monsters, eg: Witch, Zombie, Creeper, etc.
*/
MONSTER,
/**
* Entities related to Animals, eg: Strider, Cow, Turtle, etc.
*/
ANIMAL,
/**
* Entities related to Water Animals, eg: Squid or Dolphin.
*/
WATER_ANIMAL,
/**
* Entities related to Water Ambient, eg: Cod, PufferFish, Tropical Fish,
* Salmon, etc.
*/
WATER_AMBIENT,
/**
* Entities related to Water Underground, eg: Glow Squid.
*/
WATER_UNDERGROUND_CREATURE,
/**
* Entities related to Ambient, eg: Bat.
*/
AMBIENT,
/**
* All the Axolotl are represented by this Category.
*/
AXOLOTL,
/**
* Entities not related to a mob, eg: Player, ArmorStand, Boat, etc.
*/
MISC;
}