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
ConstructorsConstructorDescriptionSecurityVillagersProtectionChangeEvent(org.bukkit.entity.Player player, org.bukkit.entity.Entity entity, boolean protection) -
Method Summary
Modifier and TypeMethodDescription@NotNull org.bukkit.entity.EntityGet the selected entity@NotNull org.bukkit.entity.PlayerGet the player who is changing the protectionbooleanGet the new protection value for the entitybooleanIs the event cancelled?voidsetCancelled(boolean cancel)Set the event as cancelledvoidsetProtection(boolean protection)Set a new protection value for the entityMethods inherited from class com.alessiodp.securityvillagers.api.events.BukkitSecurityVillagersEvent
getApi, getHandlerList, getHandlers, setApiMethods inherited from class org.bukkit.event.Event
getEventName, isAsynchronousMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:ISecurityVillagersProtectionChangeEventGet the player who is changing the protection- Specified by:
getPlayerin interfaceISecurityVillagersProtectionChangeEvent- Returns:
- the
Player
-
getEntity
@NotNull public @NotNull org.bukkit.entity.Entity getEntity()Description copied from interface:ISecurityVillagersProtectionChangeEventGet the selected entity- Specified by:
getEntityin interfaceISecurityVillagersProtectionChangeEvent- Returns:
- the
Entity
-
getProtection
public boolean getProtection()Description copied from interface:ISecurityVillagersProtectionChangeEventGet the new protection value for the entity- Specified by:
getProtectionin interfaceISecurityVillagersProtectionChangeEvent- Returns:
- true if protected
-
setProtection
public void setProtection(boolean protection)Description copied from interface:ISecurityVillagersProtectionChangeEventSet a new protection value for the entity- Specified by:
setProtectionin interfaceISecurityVillagersProtectionChangeEvent- Parameters:
protection- the protection value
-
isCancelled
public boolean isCancelled()Description copied from interface:CancellableIs the event cancelled?- Specified by:
isCancelledin interfaceCancellable- Returns:
trueif the event is cancelled
-
setCancelled
public void setCancelled(boolean cancel)Description copied from interface:CancellableSet the event as cancelled- Specified by:
setCancelledin interfaceCancellable- Parameters:
cancel-trueto cancel
-