From 46877fe5a40209d5bbc5019f9ec5d34091e070d7 Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Fri, 15 Apr 2022 13:48:49 +1000 Subject: [PATCH] #735: Add Villager#zombify By: Doc --- .../src/main/java/org/bukkit/entity/Villager.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/paper-api/src/main/java/org/bukkit/entity/Villager.java b/paper-api/src/main/java/org/bukkit/entity/Villager.java index 6545e568b7..6bf3af3ed8 100644 --- a/paper-api/src/main/java/org/bukkit/entity/Villager.java +++ b/paper-api/src/main/java/org/bukkit/entity/Villager.java @@ -5,6 +5,7 @@ import org.bukkit.Keyed; import org.bukkit.Location; import org.bukkit.NamespacedKey; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; /** * Represents a villager NPC @@ -101,6 +102,18 @@ public interface Villager extends AbstractVillager { */ public void shakeHead(); + /** + * Convert this Villager into a ZombieVillager as if it was killed by a + * Zombie. + * + * Note: this will fire a EntityTransformEvent + * + * @return the converted entity {@link ZombieVillager} or null if the + * conversion its cancelled + */ + @Nullable + public ZombieVillager zombify(); + /** * Represents Villager type, usually corresponding to what biome they spawn * in.