Class PacketEvent
java.lang.Object
org.bukkit.event.Event
com.shanebeestudios.coreapi.event.PacketEvent
- All Implemented Interfaces:
Cancellable
- Direct Known Subclasses:
PacketClientboundEvent,PacketServerboundEvent
Abstract class for packet events
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
Event.Result -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.network.protocol.Packet<?> Get the packet from the eventGet the player that sent/received the packetbooleanCheck if event was cancelledvoidsetCancelled(boolean cancel) Cancel the eventvoidsetPacket(net.minecraft.network.protocol.Packet<?> packet) Set the packet to use in this eventMethods inherited from class org.bukkit.event.Event
callEvent, getEventName, getHandlers, isAsynchronous
-
Method Details
-
getPacket
public net.minecraft.network.protocol.Packet<?> getPacket()Get the packet from the event- Returns:
- Packet from event
-
setPacket
public void setPacket(net.minecraft.network.protocol.Packet<?> packet) Set the packet to use in this event- Parameters:
packet- Packet to switch to
-
getPlayer
Get the player that sent/received the packet- Returns:
- Player that sent/received packet
-
isCancelled
public boolean isCancelled()Check if event was cancelled- Specified by:
isCancelledin interfaceCancellable- Returns:
- True if cancelled
-
setCancelled
public void setCancelled(boolean cancel) Cancel the event- Specified by:
setCancelledin interfaceCancellable- Parameters:
cancel- Whether to cancel this event
-