From 95cc961f137cf53e20b53deddab0dd187b811eb2 Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Thu, 22 Jul 2021 09:36:51 +1000 Subject: [PATCH] SPIGOT-6545: Unable to set Guardian target via API while awareness is disabled By: DerFrZocker --- .../main/java/org/bukkit/EntityEffect.java | 2 +- .../main/java/org/bukkit/entity/Guardian.java | 20 +++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/paper-api/src/main/java/org/bukkit/EntityEffect.java b/paper-api/src/main/java/org/bukkit/EntityEffect.java index 0d8ee0cb1a..96ab9a599a 100644 --- a/paper-api/src/main/java/org/bukkit/EntityEffect.java +++ b/paper-api/src/main/java/org/bukkit/EntityEffect.java @@ -114,7 +114,7 @@ public enum EntityEffect { */ ENTITY_POOF(20, LivingEntity.class), /** - * Guardian sets laser target. + * Guardian plays the attack sound effect. */ GUARDIAN_TARGET(21, Guardian.class), // 22-28 player internal flags diff --git a/paper-api/src/main/java/org/bukkit/entity/Guardian.java b/paper-api/src/main/java/org/bukkit/entity/Guardian.java index 4da9f3c5f1..812af884d0 100644 --- a/paper-api/src/main/java/org/bukkit/entity/Guardian.java +++ b/paper-api/src/main/java/org/bukkit/entity/Guardian.java @@ -2,6 +2,26 @@ package org.bukkit.entity; public interface Guardian extends Monster { + /** + * Sets whether the guardian laser should show or not. + * + * A target must be present. If no target is present the laser will not show + * and the method will return false. + * + * @param activated whether the laser is active + * @return true if the laser was activated otherwise false + * @see #getTarget() + * @see #setTarget(LivingEntity) + */ + boolean setLaser(boolean activated); + + /** + * Gets whether the guardian laser is active or not. + * + * @return true if the laser is active otherwise false + */ + boolean hasLaser(); + /** * Check if the Guardian is an elder Guardian *