NMS

interface NMS

Handles direct interactions with Minecraft's internal server code (NMS).

This interface provides methods for creating displays, managing packets, handling hitboxes, and adapting entities for different server environments (e.g., Folia).

Since

1.15.2

Functions

Link copied to clipboard
@NotNull
abstract fun adapt(@NotNull entity: @NotNull PlatformEntity): @NotNull BaseEntity
Adapts a Bukkit entity to a BaseEntity, handling Folia compatibility.
@NotNull
abstract fun adapt(@NotNull player: @NotNull PlatformPlayer): @NotNull BasePlayer
Adapts a Bukkit player to a BasePlayer, handling Folia compatibility.
Link copied to clipboard
@NotNull
open fun create(@NotNull location: @NotNull PlatformLocation): @NotNull ModelDisplay
Creates a model display at the specified location.
@NotNull
open fun create(@NotNull location: @NotNull PlatformLocation, @NotNull initialConsumer: @NotNull Consumer<ModelDisplay>): @NotNull ModelDisplay
Creates a model display at the specified location with an initial configuration.
@NotNull
abstract fun create(@NotNull location: @NotNull PlatformLocation, yOffset: Double, @NotNull initialConsumer: @NotNull Consumer<ModelDisplay>): @NotNull ModelDisplay
Creates a model display at the specified location with a Y-offset and initial configuration.
Link copied to clipboard
@NotNull
abstract fun createBundler(initialCapacity: Int): @NotNull PacketBundler
Creates a packet bundler with an initial capacity.
Link copied to clipboard
@Nullable
abstract fun createHitBox(@NotNull entity: @NotNull BaseEntity, @NotNull bone: @NotNull RenderedBone, @NotNull boundingBox: @NotNull ModelBoundingBox, @NotNull controller: @NotNull MountController, @NotNull listener: @NotNull HitBoxListener): @Nullable HitBox
Creates a delegate hitbox for a target entity.
Link copied to clipboard
@NotNull
abstract fun createModAnimationBuilder(initialCapacity: Int): @NotNull ModAnimationBundler
Creates a mod animation bundler.
Link copied to clipboard
@NotNull
abstract fun createNametag(@NotNull bone: @NotNull RenderedBone): @NotNull ModelNametag
Creates a nametag for a rendered bone.
@NotNull
open fun createNametag(@NotNull bone: @NotNull RenderedBone, @NotNull consumer: @NotNull Consumer<ModelNametag>): @NotNull ModelNametag
Creates a nametag for a rendered bone with configuration.
Link copied to clipboard
@NotNull
abstract fun createParallelBundler(threshold: Int): @NotNull PacketBundler
Creates a parallel packet bundler with a size threshold.
Link copied to clipboard
@NotNull
open fun createSkinItem(@NotNull model: @NotNull String, @NotNull floats: @NotNull List<Float>, @NotNull flags: @NotNull List<Boolean>, @NotNull strings: @NotNull List<String>, @NotNull colors: @NotNull List<Integer>): @NotNull TransformedItemStack
Creates a custom skin item stack.
Link copied to clipboard
abstract fun hide(@NotNull channel: @NotNull PlayerChannelHandler, @NotNull registry: @NotNull EntityTrackerRegistry)
Sends a hide packet for an entity to a player via their channel handler.
open fun hide(@NotNull channel: @NotNull PlayerChannelHandler, @NotNull registry: @NotNull EntityTrackerRegistry, @NotNull condition: @NotNull BooleanSupplier)
Sends a hide packet for an entity to a player if a condition is met.
Link copied to clipboard
@NotNull
abstract fun inject(@NotNull player: @NotNull PlatformPlayer): @NotNull PlayerChannelHandler
Injects a Netty channel handler into a player's connection.
Link copied to clipboard
abstract fun isProxyOnlineMode(): Boolean
Checks if the server is in online mode (either natively or via proxy).
Link copied to clipboard
abstract fun mount(@NotNull registry: @NotNull EntityTrackerRegistry, @NotNull bundler: @NotNull PacketBundler)
Adds a mount packet for an entity tracker to a bundler.
Link copied to clipboard
@NotNull
abstract fun profile(@NotNull player: @NotNull PlatformPlayer): @NotNull ModelProfile
Retrieves the model profile (skin) for a player.
Link copied to clipboard
@NotNull
abstract fun tint(@NotNull itemStack: @NotNull PlatformItemStack, rgb: Int): @NotNull PlatformItemStack
Applies a tint color to an item stack.
Link copied to clipboard
@NotNull
abstract fun version(): @NotNull NMSVersion
Returns the NMS version of the server.