Skip to content
On this page
Common

KattonMiscApi

common/src/main/kotlin/top/katton/api/dpcaller/KattonMiscApi.kt
Send a system message to a player.

tell ​

tellCommonFunction
kotlin
fun tell(player: ServerPlayer, message: String)

Send a system message to a player.

Parameters ​

ParameterDescription
playertarget ServerPlayer
messageplain string message

tell ​

tellCommonFunction
kotlin
fun tell(player: ServerPlayer, message: Component)

Send a system message to a player.

Parameters ​

ParameterDescription
playertarget ServerPlayer
messagemessage component

tell ​

tellCommonFunction
kotlin
fun tell(player: ServerPlayer, message: Any)

Send a system message to a player.

Parameters ​

ParameterDescription
playertarget ServerPlayer
messagemessage object, converted to string

tell ​

tellCommonFunction
kotlin
fun tell(players: Collection<ServerPlayer>, message: String)

Send a system message to multiple players.

Parameters ​

ParameterDescription
playerstarget ServerPlayer collection
messageplain string message

tell ​

tellCommonFunction
kotlin
fun tell(players: Collection<ServerPlayer>, message: Component)

Send a system message to multiple players.

Parameters ​

ParameterDescription
playerstarget ServerPlayer collection
messagemessage component

tell ​

tellCommonFunction
kotlin
fun tell(players: Collection<ServerPlayer>, message: Any)

Send a system message to multiple players.

Parameters ​

ParameterDescription
playerstarget ServerPlayer collection
messagemessage object, converted to string

tell ​

tellCommonFunction
kotlin
fun tell(message: Any)

Send a system message to all players.

Parameters ​

ParameterDescription
messagemessage object, converted to string

particle ​

particleCommonFunction
kotlin
fun particle(level: ServerLevel, players: Collection<ServerPlayer>, particle: ParticleOptions, pos: Vec3, delta: Vec3 = Vec3.ZERO, speed: Double = 1.0, count: Int = 0, forced: Boolean = false)

Send particles to a collection of players.

Parameters ​

ParameterDescription
levelserver level
playersplayers to send to
particleparticle options
poscenter position
deltaspread vector (default zero)
speedparticle speed
countparticle count
forcedwhether to force sending and ignore client settings

teleportToEntity ​

teleportToEntityCommonFunction
kotlin
fun teleportToEntity(collection: MutableCollection<out Entity>, entity: Entity)

Teleport a collection of entities to another entity's position.

Parameters ​

ParameterDescription
collectionentities to teleport
entityentity used as the destination position

teleportToPos ​

teleportToPosCommonFunction
kotlin
fun teleportToPos(collection: MutableCollection<out Entity>, serverLevel: ServerLevel, pos: Vec3, rot: Vec2? = null)

Teleport a collection of entities to a position with optional rotation.

Parameters ​

ParameterDescription
collectionentities to teleport
leveldestination level
posdestination position
rotoptional rotation vector; if null, keep the entity's current rotation

teleportToPos ​

teleportToPosCommonFunction
kotlin
fun teleportToPos(collection: MutableCollection<out Entity>, serverLevel: ServerLevel, pos: Vec3, lookAt: Entity, anchor: EntityAnchorArgument.Anchor = EntityAnchorArgument.Anchor.FEET, lookAtAnchor: EntityAnchorArgument.Anchor = EntityAnchorArgument.Anchor.FEET)

Teleport a collection of entities to a position and make them face another entity.

Parameters ​

ParameterDescription
collectionentities to teleport
leveldestination level
posdestination position
lookAtentity to look at after teleporting
anchoranchor used on the teleported entity
lookAtAnchoranchor used on the entity being looked at

teleportToPos ​

teleportToPosCommonFunction
kotlin
fun teleportToPos(collection: MutableCollection<out Entity>, serverLevel: ServerLevel, pos: Vec3, lookAt: Vec3, anchor: EntityAnchorArgument.Anchor = EntityAnchorArgument.Anchor.FEET)

Teleport a collection of entities to a position and make them face another position.

Parameters ​

ParameterDescription
collectionentities to teleport
leveldestination level
posdestination position
lookAtposition to look at
anchoranchor used on the teleported entity

setWaypointStyle ​

setWaypointStyleCommonFunction
kotlin
fun setWaypointStyle(serverLevel: ServerLevel, waypointTransmitter: WaypointTransmitter, resourceKey: ResourceKey<WaypointStyleAsset>)

Set waypoint style for a waypoint transmitter.

Parameters ​

ParameterDescription
serverLevelserver level
waypointTransmitterwaypoint transmitter to modify
resourceKeywaypoint style asset key

setWaypointColor ​

setWaypointColorCommonFunction
kotlin
fun setWaypointColor(serverLevel: ServerLevel, waypointTransmitter: WaypointTransmitter, chatFormatting: ChatFormatting)

Set waypoint color using ChatFormatting.

Parameters ​

ParameterDescription
serverLevelserver level
waypointTransmitterwaypoint transmitter
chatFormattingformatting to convert to color

setWaypointColor ​

setWaypointColorCommonFunction
kotlin
fun setWaypointColor(serverLevel: ServerLevel, waypointTransmitter: WaypointTransmitter, integer: Int)

Set waypoint color using an integer color value.

Parameters ​

ParameterDescription
serverLevelserver level
waypointTransmitterwaypoint transmitter
integerinteger color value

resetWaypointColor ​

resetWaypointColorCommonFunction
kotlin
fun resetWaypointColor(serverLevel: ServerLevel, waypointTransmitter: WaypointTransmitter)

Reset waypoint color to default (unset).

Parameters ​

ParameterDescription
serverLevelserver level
waypointTransmitterwaypoint transmitter

teamMsg ​

teamMsgCommonFunction
kotlin
fun teamMsg(entity: Entity, playerTeam: PlayerTeam, list: MutableList<ServerPlayer>, playerChatMessage: PlayerChatMessage, commandSourceStack: CommandSourceStack = requireServer().createCommandSourceStack())

Send a team chat message to a list of players with filtering and formatting.

Parameters ​

ParameterDescription
entitysource entity (sender)
playerTeamteam being messaged
listrecipients
playerChatMessagemessage content
commandSourceStackcommand source used for formatting and filtering