Class SecurityVillagersProtectionChangeEvent
java.lang.Object
org.bukkit.event.Event
com.alessiodp.securityvillagers.api.events.BukkitSecurityVillagersEvent
com.alessiodp.securityvillagers.api.events.bukkit.SecurityVillagersProtectionChangeEvent
- All Implemented Interfaces:
Cancellable
,ISecurityVillagersProtectionChangeEvent
,SecurityVillagersEvent
public class SecurityVillagersProtectionChangeEvent
extends BukkitSecurityVillagersEvent
implements ISecurityVillagersProtectionChangeEvent
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result
-
Constructor Summary
ConstructorDescriptionSecurityVillagersProtectionChangeEvent(org.bukkit.entity.Player player, org.bukkit.entity.Entity entity, boolean protection)
-
Method Summary
Modifier and TypeMethodDescription@NotNull org.bukkit.entity.Entity
Get the selected entity@NotNull org.bukkit.entity.Player
Get the player who is changing the protectionboolean
Get the new protection value for the entityboolean
Is the event cancelled?void
setCancelled(boolean cancel)
Set the event as cancelledvoid
setProtection(boolean protection)
Set a new protection value for the entityMethods inherited from class com.alessiodp.securityvillagers.api.events.BukkitSecurityVillagersEvent
getApi, getHandlerList, getHandlers, setApi
Methods inherited from class org.bukkit.event.Event
getEventName, isAsynchronous
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.alessiodp.securityvillagers.api.events.SecurityVillagersEvent
getApi, setApi
-
Constructor Details
-
SecurityVillagersProtectionChangeEvent
public SecurityVillagersProtectionChangeEvent(org.bukkit.entity.Player player, org.bukkit.entity.Entity entity, boolean protection)
-
-
Method Details
-
getPlayer
@NotNull public @NotNull org.bukkit.entity.Player getPlayer()Description copied from interface:ISecurityVillagersProtectionChangeEvent
Get the player who is changing the protection- Specified by:
getPlayer
in interfaceISecurityVillagersProtectionChangeEvent
- Returns:
- the
Player
-
getEntity
@NotNull public @NotNull org.bukkit.entity.Entity getEntity()Description copied from interface:ISecurityVillagersProtectionChangeEvent
Get the selected entity- Specified by:
getEntity
in interfaceISecurityVillagersProtectionChangeEvent
- Returns:
- the
Entity
-
getProtection
public boolean getProtection()Description copied from interface:ISecurityVillagersProtectionChangeEvent
Get the new protection value for the entity- Specified by:
getProtection
in interfaceISecurityVillagersProtectionChangeEvent
- Returns:
- true if protected
-
setProtection
public void setProtection(boolean protection)Description copied from interface:ISecurityVillagersProtectionChangeEvent
Set a new protection value for the entity- Specified by:
setProtection
in interfaceISecurityVillagersProtectionChangeEvent
- Parameters:
protection
- the protection value
-
isCancelled
public boolean isCancelled()Description copied from interface:Cancellable
Is the event cancelled?- Specified by:
isCancelled
in interfaceCancellable
- Returns:
true
if the event is cancelled
-
setCancelled
public void setCancelled(boolean cancel)Description copied from interface:Cancellable
Set the event as cancelled- Specified by:
setCancelled
in interfaceCancellable
- Parameters:
cancel
-true
to cancel
-