Fully packet based PetsAPI (1.8 - 1.21) using PacketEvents and EntityLib
Important
Project version is required to be Java 16 at least!
PetsAPI allows you to place floating heads in the world or attach them as pets that follow players — all fully packet-based.
Fired when a player interacts with a pet.
Accessors:
getPlayer()
→ The player who clicked the petgetPet()
→ The clicked pet
- Clone repo
- run
mvn install
- Add this to pom.xml
<dependency> <groupId>dev.lrxh</groupId> <artifactId>PetsAPI</artifactId> <version>1.0.0</version> </dependency>
PetsAPI.init(this);
// Example Player Pet
Player player = ...;
PlayerPet pet = new PlayerPet(SkinData.ofPlayerName(player.getName()));
pet.setLookAtPlayer(true);
pet.spawn(player);
// Example World Pet
Pet pet = new Pet(AnimalSkinData.SHEEP);
Location location = ...;
pet.spawn(location);
// Remove player pets
for (Pet pet : PetsAPI.getPets(player)) {
pet.remove();
}
pet. // See all methods