From 7eccce6d6f8c3e535147d6a61b7bf181a2e9b73a Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Tue, 17 May 2022 19:26:59 +1000 Subject: [PATCH] #743: Support setting individual Wither head targets By: Yannick Lamprecht --- .../main/java/org/bukkit/entity/Wither.java | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/paper-api/src/main/java/org/bukkit/entity/Wither.java b/paper-api/src/main/java/org/bukkit/entity/Wither.java index 3bc332ee7f..225c65a20a 100644 --- a/paper-api/src/main/java/org/bukkit/entity/Wither.java +++ b/paper-api/src/main/java/org/bukkit/entity/Wither.java @@ -1,7 +1,51 @@ package org.bukkit.entity; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + /** * Represents a Wither boss */ public interface Wither extends Monster, Boss { + + /** + * {@inheritDoc} + *

+ * This method will set the target of the {@link Head#CENTER center head} of + * the wither. + * + * @see #setTarget(org.bukkit.entity.Wither.Head, org.bukkit.entity.LivingEntity) + */ + @Override + void setTarget(@Nullable LivingEntity target); + + /** + * This method will set the target of individual heads {@link Head} of the + * wither. + * + * @param head the individual head + * @param target the entity that should be targeted + */ + void setTarget(@NotNull Head head, @Nullable LivingEntity target); + + /** + * This method will get the target of individual heads {@link Head} of the + * wither. + * + * @param head the individual head + * @return the entity targeted by the given head, or null if none is + * targeted + */ + @Nullable + LivingEntity getTarget(@NotNull Head head); + + /** + * Represents one of the Wither's heads. + */ + enum Head { + + CENTER, + LEFT, + RIGHT + } }