Skip to content
On this page

Common

KattonMiscApi

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

tell

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

Send a system message to a player.

Parameters

ParameterDescription
playertarget ServerPlayer
messageplain string message

tell

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

Send a system message to a player.

Parameters

ParameterDescription
playertarget ServerPlayer
messagemessage component

tell

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

Send a system message to a player.

Parameters

ParameterDescription
playertarget ServerPlayer
messagemessage object, converted to string

tell

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

Send a system message to multiple players.

Parameters

ParameterDescription
playerstarget ServerPlayer collection
messageplain string message

tell

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

Send a system message to multiple players.

Parameters

ParameterDescription
playerstarget ServerPlayer collection
messagemessage component

tell

CommonFunction
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

CommonFunction
kotlin
fun tell(message: Any)

Send a system message to all players.

Parameters

ParameterDescription
messagemessage object, converted to string

particle

CommonFunction
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
countnumber of particles
forcedwhether to force send (ignores client settings)

teleportToEntity

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

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

Parameters

ParameterDescription
collectionentities to teleport
entitydestination entity whose position to use

teleportToPos

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

Teleport a collection of entities to a given position and optionally set rotation.

Parameters

ParameterDescription
collectionentities to teleport
serverLeveldestination level
posdestination position
rotoptional rotation vector; if null, keeps entity rotation

teleportToPos

CommonFunction
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 look at an entity.

Parameters

ParameterDescription
collectionentities to teleport
serverLeveldestination level
posdestination position
lookAtentity to look at after teleport
anchoranchor used for target orientation
lookAtAnchoranchor used for lookAt orientation

teleportToPos

CommonFunction
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 look at a position.

Parameters

ParameterDescription
collectionentities to teleport
serverLeveldestination level
posdestination position
lookAtposition to look at
anchoranchor used for target orientation

setWaypointStyle

CommonFunction
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

CommonFunction
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

CommonFunction
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

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

Reset waypoint color to default (unset).

Parameters

ParameterDescription
serverLevelserver level
waypointTransmitterwaypoint transmitter

teamMsg

CommonFunction
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