PacketHub

Central interface for all packet-level operations.

Combines connection, entity, environment, interaction, inventory, visual effects, view, and miscellaneous sub-hubs into a single API entry point.

Inheritors

Functions

Link copied to clipboard
abstract fun createFakeEntityBuilder(player: Player, type: EntityType, location: Location): FakeEntityBuilder

Creates a new FakeEntityBuilder for faking an entity to the player.

Link copied to clipboard
abstract fun fakeEquipment(player: Player, entityId: Int, slot: EquipmentSlot, item: ItemStack)

Sends a fake equipment packet to the player for the specified entity slot.

Link copied to clipboard
abstract fun fakeExperienceBar(player: Player, bar: Float, level: Int, experience: Int)

Sends a fake experience bar update to the player via a packet.

Link copied to clipboard
abstract fun fakeExplosion(player: Player, location: Location, power: Float)

Sends a fake explosion effect to the player at the given location.

Link copied to clipboard
abstract fun fakeFurnaceProgress(player: Player, cookProgress: Int, fuelProgress: Int)

Fakes the progress bars (cook time, fuel) in a furnace GUI for the player.

Link copied to clipboard
abstract fun fakeItemSlot(player: Player, windowId: Int, slot: Int, item: ItemStack)

Fakes an item in a specific inventory slot for the player.

Link copied to clipboard
abstract fun fakeLightning(player: Player, location: Location)

Sends a fake lightning strike effect to the player at the given location.

Link copied to clipboard
abstract fun fakePlayerName(player: Player, target: Player, name: String)

Fakes the display name of a player in the tab list or above their head.

Link copied to clipboard
abstract fun fakeStatistic(player: Player, statistic: Statistic, value: Int)

Sends a fake statistic update to the player via a packet.

Link copied to clipboard
abstract fun forceHeldSlot(player: Player, slot: Int)

Forces the player's held item slot to the specified index via a packet.

Link copied to clipboard
abstract fun getCoroutineDispatcher(player: Player): CoroutineDispatcher

Gets a CoroutineDispatcher that executes tasks on the player's Netty event loop.

Link copied to clipboard
abstract fun getNetworkSettings(player: Player): NetworkSettings

Gets the network settings (e.g. protocol version, latency) for a player.

Link copied to clipboard
abstract fun hideCredits(player: Player)

Hides the end credits screen for the player via a packet.

Link copied to clipboard
abstract fun hideEntity(player: Player, entityId: Int)

Hides an entity from the player via a packet.

Link copied to clipboard
abstract fun injectPlayer(player: Player)

Injects a player into the Netty pipeline to begin packet interception.

Link copied to clipboard
abstract fun localSound(player: Player, sound: Sound, location: Location, volume: Float = 1.0f, pitch: Float = 1.0f)

Plays a sound at a specific location for the player only, without affecting other players.

Link copied to clipboard
abstract fun lockInventorySlot(player: Player, slot: Int, item: ItemStack?)

Locks an inventory slot for the player by sending a fake item packet.

Link copied to clipboard
abstract fun placeFakeBlock(player: Player, location: Location, material: Material)

Sends a fake block placement packet to the player at the given location.

Link copied to clipboard
abstract fun removeFakeBlock(player: Player, location: Location)

Sends a fake block removal packet to the player at the given location, restoring the appearance of the original block.

Link copied to clipboard
abstract fun removePlayer(player: Player)

Removes a player from the Netty pipeline, stopping packet interception.

Link copied to clipboard
abstract fun resetCamera(player: Player)

Resets the player's camera back to their own perspective.

Link copied to clipboard
abstract fun resetWorldBorder(player: Player)

Resets the player's world border to the server's actual world border.

Link copied to clipboard
abstract fun sendActionBar(player: Player, message: String)

Sends an action bar message to the player via a packet.

Link copied to clipboard
abstract fun sendCamera(player: Player, entityId: Int)

Sets the player's camera to the specified entity.

Link copied to clipboard
abstract fun sendFakeBlocks(player: Player, builder: FakeBlockBuilder.() -> Unit)

Sends fake block changes to the player using a FakeBlockBuilder.

Link copied to clipboard
abstract fun sendMetadata(player: Player, entityId: Int, data: MetadataBuilder.() -> Unit)

Sends a raw metadata update for an entity to the player.

Link copied to clipboard
abstract fun sendOpenSign(player: Player, location: Location, front: Boolean)

Opens a sign editor for the player at the given location.

Link copied to clipboard
abstract fun sendPacket(player: Player, packet: Any)

Sends a raw NMS packet object to the player.

Link copied to clipboard
abstract fun sendParticles(player: Player, type: Particle, location: Location, amount: Int, offset: Vector, extra: Double, data: Any?)

Sends a particle effect to the player via a packet.

Link copied to clipboard
abstract fun sendRawPacket(player: Player, channel: String, buf: ByteBuf)

Sends a raw packet via a custom plugin channel.

Link copied to clipboard
abstract fun sendSound(player: Player, type: Sound, volume: Float, pitch: Float, relative: Boolean, offset: Vector)

Sends a named sound effect to the player via a packet.

Link copied to clipboard
abstract fun sendTitle(player: Player, title: String, subtitle: String, fadeIn: Int, stay: Int, fadeOut: Int)

Sends a title and subtitle to the player via packets.

Link copied to clipboard
abstract fun sendWorldBorder(player: Player, builder: WorldBorderBuilder.() -> Unit)

Sends a world border update packet to the player.

Link copied to clipboard
abstract fun setBlockCrack(player: Player, location: Location, stage: Int)

Sends a block crack (mining progress) animation to the player.

Link copied to clipboard
abstract fun setBowAnimation(player: Player, entityId: Int)

Sends a bow/crossbow charging animation packet for an entity to the player.

Link copied to clipboard
abstract fun setCameraEntity(player: Player, entityId: Int)

Sets the player's camera to spectate the specified entity.

Link copied to clipboard
abstract fun setEatingAnimation(player: Player, entityId: Int)

Sends an eating animation packet for an entity to the player.

Link copied to clipboard
abstract fun setEntityGlowing(player: Player, entityId: Int, glowing: Boolean)

Sets the glowing visual effect on an entity for the player via a metadata packet.

Link copied to clipboard
abstract fun setEntityMotion(player: Player, entityId: Int, velocity: Vector)

Sets the velocity/motion of an entity for the player via a packet.

Link copied to clipboard
abstract fun setEntityOnFire(player: Player, entityId: Int, onFire: Boolean)

Sets the on-fire visual state of an entity for the player via a metadata packet.

Link copied to clipboard
abstract fun setEntityScale(player: Player, entityId: Int, scale: Float)

Sets the display scale of an entity for the player via a metadata packet.

Link copied to clipboard
abstract fun setEntityUpsideDown(player: Player, entityId: Int, upsideDown: Boolean)

Sets whether an entity appears upside-down for the player via a metadata packet.

Link copied to clipboard
abstract fun setFakeBiome(player: Player, biomeKey: String)

Sends a fake biome override to the player for their current chunk.

Link copied to clipboard
abstract fun setFakeSkyColor(player: Player, color: Int)

Sends a fake sky/fog color to the player (via biome hack or similar).

Link copied to clipboard
abstract fun setFakeTime(player: Player, time: Long, locked: Boolean = false)

Sends a fake time update to the player.

Link copied to clipboard
abstract fun setFakeWeather(player: Player, rain: Boolean, thunder: Boolean)

Sends a fake weather state to the player.

Link copied to clipboard
abstract fun setFakeWorldBorder(player: Player, builder: FakeWorldBorderBuilder.() -> Unit)

Sends a fake world border configuration to the player.

Link copied to clipboard
abstract fun setGuardPose(player: Player, entityId: Int)

Sends a shield/sword guard pose packet for an entity to the player.

Link copied to clipboard
abstract fun setItemCooldown(player: Player, item: Material, ticks: Int)

Sets a fake item cooldown for the player.

Link copied to clipboard
abstract fun setSleepAnimation(player: Player, entityId: Int, location: Location)

Sends a sleep animation packet for an entity at the given location to the player.

Link copied to clipboard
abstract fun setWeatherLevel(player: Player, rainLevel: Float, thunderLevel: Float)

Sets the rain and thunder intensity levels for the player via packets.

Link copied to clipboard
abstract fun showCredits(player: Player)

Shows the end credits screen to the player via a packet.

Link copied to clipboard
abstract fun showEntity(player: Player, entityId: Int)

Shows a previously hidden entity to the player.

Link copied to clipboard
abstract fun showFakeDeathScreen(player: Player, message: String)

Shows a fake death screen to the player via a packet.

Link copied to clipboard
abstract fun transformEntityType(player: Player, entityId: Int, type: EntityType)

Sends a fake entity type transformation to the player, making the entity appear as a different type without changing it server-side.

Link copied to clipboard
abstract fun updateInventoryTitle(player: Player, title: String)

Updates the title of the player's currently open inventory via a packet.