Skip to content
On this page
通用

KattonEventsArg

top.katton.api.eventcommon/src/main/kotlin/top/katton/api/event/KattonEventsArg.kt
Argument for server-level events.

ServerArg

ServerArg通用数据类
kotlin
data class ServerArg(val server: MinecraftServer)

Argument for server-level events.

属性

属性说明
server服务端级事件的参数。
serverMinecraftServer 实例。

SyncDatapackContentsArg

SyncDatapackContentsArg通用数据类
kotlin
data class SyncDatapackContentsArg( val player: ServerPlayer, val joined: Boolean )

Argument for datapack contents synchronization event.

属性

属性说明
playerThe player receiving the sync
joined数据包内容同步事件的参数。
player接收同步内容的玩家。
joined是否因为玩家加入而触发本次同步。

StartDatapackReloadArg

StartDatapackReloadArg通用数据类
kotlin
data class StartDatapackReloadArg( val server: MinecraftServer, val resourceManager: ResourceManager )

Argument for datapack reload start event.

属性

属性说明
serverThe MinecraftServer instance
resourceManager数据包重载开始事件的参数。
serverMinecraftServer 实例。
resourceManager正在重载的资源管理器。

EndDatapackReloadArg

EndDatapackReloadArg通用数据类
kotlin
data class EndDatapackReloadArg( val server: MinecraftServer, val resourceManager: ResourceManager, val success: Boolean )

Argument for datapack reload end event.

属性

属性说明
serverThe MinecraftServer instance
resourceManagerThe resource manager that was reloaded
success数据包重载结束事件的参数。
serverMinecraftServer 实例。
resourceManager已完成重载的资源管理器。
success重载是否成功完成。

ServerSaveArg

ServerSaveArg通用数据类
kotlin
data class ServerSaveArg( val server: MinecraftServer, val flush: Boolean, val force: Boolean )

Argument for server save event.

属性

属性说明
serverThe MinecraftServer instance
flushWhether data should be flushed to disk
force服务端保存事件的参数。
serverMinecraftServer 实例。
flush是否将数据立即刷新到磁盘。
force是否为强制保存。

ServerTickArg

ServerTickArg通用值类
kotlin
@JvmInline
value class ServerTickArg(val server: MinecraftServer)

Argument for server tick event.

属性

属性说明
serverThe MinecraftServer instance

WorldTickArg

WorldTickArg通用值类
kotlin
@JvmInline
value class WorldTickArg(val world: ServerLevel)

Argument for world tick event.

属性

属性说明
worldThe ServerLevel being ticked

EntityLoadArg

EntityLoadArg通用数据类
kotlin
data class EntityLoadArg( val entity: Entity, val world: ServerLevel ): CancellableEventArg()

Argument for entity load event.

Triggered when an entity is loaded into a world. Can be cancelled to prevent the entity from loading.

属性

属性说明
entityThe entity being loaded
worldThe ServerLevel the entity is loading into

EntityUnloadArg

EntityUnloadArg通用数据类
kotlin
data class EntityUnloadArg( val entity: Entity, val world: ServerLevel )

Argument for entity unload event.

Triggered when an entity is unloaded from a world.

属性

属性说明
entityThe entity being unloaded
worldThe ServerLevel the entity is unloading from

EquipmentChangeArg

EquipmentChangeArg通用数据类
kotlin
data class EquipmentChangeArg( val entity: LivingEntity, val slot: EquipmentSlot, val from: ItemStack, val to: ItemStack )

Argument for equipment change event.

Triggered when a living entity's equipment changes.

属性

属性说明
entityThe entity whose equipment changed
slotThe equipment slot that changed
fromThe previous ItemStack in the slot
toThe new ItemStack in the slot

ChunkLoadArg

ChunkLoadArg通用数据类
kotlin
data class ChunkLoadArg( val world: ServerLevel, val chunk: LevelChunk, val generated: Boolean

Argument for chunk load event.

属性

属性说明
worldThe ServerLevel containing the chunk
chunkThe LevelChunk that was loaded
generatedWhether the chunk was newly generated

ChunkUnloadArg

ChunkUnloadArg通用数据类
kotlin
data class ChunkUnloadArg( val world: ServerLevel, val chunk: LevelChunk )

Argument for chunk unload event.

属性

属性说明
worldThe ServerLevel containing the chunk
chunkThe LevelChunk being unloaded

ChunkStatusChangeArg

ChunkStatusChangeArg通用数据类
kotlin
data class ChunkStatusChangeArg( val world: ServerLevel, val chunk: LevelChunk, val oldStatus: FullChunkStatus, val newStatus: FullChunkStatus )

Argument for chunk status change event.

Triggered when a chunk's loading status changes.

属性

属性说明
worldThe ServerLevel containing the chunk
chunkThe LevelChunk whose status changed
oldStatusThe previous chunk status
newStatusThe new chunk status

BlockEntityLoadArg

BlockEntityLoadArg通用数据类
kotlin
data class BlockEntityLoadArg( val blockEntity: BlockEntity, val world: ServerLevel )

Argument for block entity load event.

属性

属性说明
blockEntityThe BlockEntity that was loaded
worldThe ServerLevel containing the block entity

BlockBreakArg

BlockBreakArg通用数据类
kotlin
data class BlockBreakArg( val world: Level, val player: Player, val pos: BlockPos, val state: BlockState, val blockEntity: BlockEntity?

Argument for block break event.

Can be cancelled to prevent the block from being broken.

属性

属性说明
worldThe Level containing the block
playerThe player breaking the block
posThe position of the block
stateThe BlockState being broken
blockEntityThe BlockEntity at the position, if any

BlockPlaceArg

BlockPlaceArg通用数据类
kotlin
data class BlockPlaceArg( val world: Level, val player: Player?, val pos: BlockPos, val state: BlockState, val blockEntity: BlockEntity?

Argument for block place event.

Can be cancelled to prevent the block from being placed.

属性

属性说明
worldThe Level where the block is being placed
playerThe player placing the block (may be null for non-player placement)
posThe position where the block is being placed
stateThe BlockState being placed
blockEntityThe BlockEntity being placed, if any

UseItemOnArg

UseItemOnArg通用数据类
kotlin
data class UseItemOnArg( val stack: ItemStack, val state: BlockState, val world: Level, val pos: BlockPos, val player: Player, val hand: InteractionHand, val hitResult: BlockHitResult )

Argument for item use on block event.

属性

属性说明
stackThe ItemStack being used
stateThe BlockState of the block being interacted with
worldThe Level containing the block
posThe position of the block
playerThe player using the item
handThe hand holding the item
hitResultThe block hit result containing face and position details

UseWithoutItemOnArg

UseWithoutItemOnArg通用数据类
kotlin
data class UseWithoutItemOnArg( val state: BlockState, val world: Level, val pos: BlockPos, val player: Player, val hitResult: BlockHitResult )

Argument for block interaction without item event.

属性

属性说明
stateThe BlockState of the block being interacted with
worldThe Level containing the block
posThe position of the block
playerThe player interacting with the block
hitResultThe block hit result

AllowEnchantingArg

AllowEnchantingArg通用数据类
kotlin
data class AllowEnchantingArg( val enchantment: Holder<Enchantment>, val target: ItemStack, val context: EnchantingContext )

Argument for enchantment allowance check event.

Used to determine if an enchantment can be applied to an item.

属性

属性说明
enchantmentThe enchantment being checked
targetThe target ItemStack
contextThe enchanting context (PRIMARY or ACCEPTABLE)

ModifyEnchantmentArg

ModifyEnchantmentArg通用数据类
kotlin
data class ModifyEnchantmentArg( val key: ResourceKey<Enchantment>, val builder: Enchantment.Builder )

Argument for enchantment modification event.

属性

属性说明
keyThe ResourceKey of the enchantment being modified
builderThe Enchantment.Builder for modification

ElytraAllowArg

ElytraAllowArg通用数据类
kotlin
data class ElytraAllowArg(val entity: LivingEntity)

Argument for elytra flight allowance check.

属性

属性说明
entityThe entity attempting to use elytra flight

ElytraCustomArg

ElytraCustomArg通用数据类
kotlin
data class ElytraCustomArg( val entity: LivingEntity, val tickElytra: Boolean )

Argument for custom elytra flight event.

属性

属性说明
entityThe entity using elytra flight
tickElytraWhether vanilla elytra tick logic should run

AllowSleepingArg

AllowSleepingArg通用数据类
kotlin
data class AllowSleepingArg( val entity: LivingEntity, val pos: BlockPos )

Argument for sleeping allowance check.

属性

属性说明
entityThe entity attempting to sleep
posThe position of the bed

SleepingArg

SleepingArg通用数据类
kotlin
data class SleepingArg( val entity: LivingEntity, val pos: BlockPos )

Argument for sleeping event.

属性

属性说明
entityThe entity that is sleeping
posThe position of the bed

AllowBedArg

AllowBedArg通用数据类
kotlin
data class AllowBedArg( val entity: LivingEntity, val pos: BlockPos, val state: BlockState, val vanillaResult: Boolean )

Argument for bed usage allowance check.

属性

属性说明
entityThe entity attempting to use the bed
posThe position of the bed
stateThe BlockState of the bed
vanillaResultThe vanilla game's result for this check

AllowNearbyMonstersArg

AllowNearbyMonstersArg通用数据类
kotlin
data class AllowNearbyMonstersArg( val entity: Player, val pos: BlockPos, val vanillaResult: Boolean )

Argument for nearby monsters check during sleeping.

属性

属性说明
entityThe player attempting to sleep
posThe position of the bed
vanillaResultThe vanilla game's result for this check

AllowResettingTimeArg

AllowResettingTimeArg通用数据类
kotlin
data class AllowResettingTimeArg(val player: Player)

Argument for time reset allowance check.

属性

属性说明
playerThe player attempting to reset the time

ModifySleepingDirectionArg

ModifySleepingDirectionArg通用数据类
kotlin
data class ModifySleepingDirectionArg( val entity: LivingEntity, val pos: BlockPos, val direction: Direction? )

Argument for sleeping direction modification.

属性

属性说明
entityThe entity sleeping
posThe position of the bed
directionThe direction the entity is facing while sleeping

AllowSettingSpawnArg

AllowSettingSpawnArg通用数据类
kotlin
data class AllowSettingSpawnArg( val entity: LivingEntity, val pos: BlockPos )

Argument for spawn point setting allowance.

属性

属性说明
entityThe entity whose spawn point is being set
posThe position of the spawn point

SetBedOccupationStateArg

SetBedOccupationStateArg通用数据类
kotlin
data class SetBedOccupationStateArg( val entity: LivingEntity, val pos: BlockPos, val state: BlockState, val occupied: Boolean )

Argument for bed occupation state change.

属性

属性说明
entityThe entity occupying the bed
posThe position of the bed
stateThe BlockState of the bed
occupiedWhether the bed is now occupied

ModifyWakeUpPositionArg

ModifyWakeUpPositionArg通用数据类
kotlin
data class ModifyWakeUpPositionArg( val entity: LivingEntity, val sleepingPos: BlockPos, val bedState: BlockState, val wakeUpPos: Vec3? )

Argument for wake-up position modification.

属性

属性说明
entityThe entity waking up
sleepingPosThe position where the entity was sleeping
bedStateThe BlockState of the bed
wakeUpPosThe calculated wake-up position (may be modified)

ItemUseOnArg

ItemUseOnArg通用数据类
kotlin
data class ItemUseOnArg(val context: UseOnContext)

Argument for item use on block context.

属性

属性说明
contextThe UseOnContext containing all interaction details

ItemUseArg

ItemUseArg通用数据类
kotlin
data class ItemUseArg( val world: Level, val player: Player, val hand: InteractionHand )

Argument for item use event.

属性

属性说明
worldThe Level where the item is being used
playerThe player using the item
handThe hand holding the item

LootTableReplaceArg

LootTableReplaceArg通用数据类
kotlin
data class LootTableReplaceArg( val key: ResourceKey<LootTable>, val original: LootTable, val registries: HolderLookup.Provider )

Argument for loot table replacement event.

属性

属性说明
keyThe ResourceKey of the loot table
originalThe original LootTable
registriesThe registry lookup provider

LootTableModifyArg

LootTableModifyArg通用数据类
kotlin
data class LootTableModifyArg( val key: ResourceKey<LootTable>, val tableBuilder: LootTable.Builder, val registries: HolderLookup.Provider )

Argument for loot table modification event.

属性

属性说明
keyThe ResourceKey of the loot table
tableBuilderThe LootTable.Builder for modification
registriesThe registry lookup provider

LootTableAllLoadArg

LootTableAllLoadArg通用数据类
kotlin
data class LootTableAllLoadArg( val resourceManager: ResourceManager, val lootDataManager: Registry<LootTable> )

Argument for all loot tables load event.

属性

属性说明
resourceManagerThe resource manager
lootDataManagerThe loot data manager registry

LootTableModifyDropsArg

LootTableModifyDropsArg通用数据类
kotlin
data class LootTableModifyDropsArg( val table: Holder<LootTable>, val context: LootContext, val drops: List<ItemStack> )

Argument for loot table drops modification.

属性

属性说明
tableThe loot table holder
contextThe loot context for the drop
dropsThe list of dropped ItemStacks (may be modified)

PlayerAttackBlockArg

PlayerAttackBlockArg通用数据类
kotlin
data class PlayerAttackBlockArg( val player: Player, val world: Level, val hand: InteractionHand, val pos: BlockPos, val direction: Direction, )

Argument for player attack block event.

属性

属性说明
playerThe player attacking the block
worldThe Level containing the block
handThe hand used to attack
posThe position of the block being attacked
directionThe face being attacked

PlayerAttackEntityArg

PlayerAttackEntityArg通用数据类
kotlin
data class PlayerAttackEntityArg( val player: Player, val world: Level, val hand: InteractionHand, val entity: Entity, val hitResult: EntityHitResult? )

Argument for player attack entity event.

属性

属性说明
playerThe player attacking
worldThe Level where the attack occurs
handThe hand used to attack
entityThe entity being attacked
hitResultThe entity hit result

PlayerUseBlockArg

PlayerUseBlockArg通用数据类
kotlin
data class PlayerUseBlockArg( val player: Player, val world: Level, val hand: InteractionHand, val hitResult: BlockHitResult )

Argument for player use block event.

属性

属性说明
playerThe player interacting
worldThe Level containing the block
handThe hand used for interaction
hitResultThe block hit result

PlayerUseEntityArg

PlayerUseEntityArg通用数据类
kotlin
data class PlayerUseEntityArg( val player: Player, val world: Level, val hand: InteractionHand, val entity: Entity, val hitResult: EntityHitResult? )

Argument for player use entity event.

属性

属性说明
playerThe player interacting
worldThe Level containing the entity
handThe hand used for interaction
entityThe entity being interacted with
hitResultThe entity hit result

PlayerUseItemArg

PlayerUseItemArg通用数据类
kotlin
data class PlayerUseItemArg( val player: Player, val world: Level, val hand: InteractionHand )

Argument for player use item event.

属性

属性说明
playerThe player using the item
worldThe Level where the item is used
handThe hand holding the item

PlayerPickFromBlockArg

PlayerPickFromBlockArg通用数据类
kotlin
data class PlayerPickFromBlockArg( val player: ServerPlayer, val pos: BlockPos, val state: BlockState, val includeData: Boolean )

Argument for player pick block event.

属性

属性说明
playerThe player picking the block
posThe position of the block being picked
stateThe BlockState of the block
includeDataWhether block entity data should be included

PlayerPickFromEntityArg

PlayerPickFromEntityArg通用数据类
kotlin
data class PlayerPickFromEntityArg( val player: ServerPlayer, val entity: Entity, val includeData: Boolean )

Argument for player pick entity event.

属性

属性说明
playerThe player picking the entity
entityThe entity being picked
includeDataWhether entity data should be included

AfterKilledOtherEntityArg

AfterKilledOtherEntityArg通用数据类
kotlin
data class AfterKilledOtherEntityArg( val world: ServerLevel, val entity: Entity, val killedEntity: LivingEntity, val source: DamageSource )

Argument for after entity killed another entity event.

属性

属性说明
worldThe ServerLevel where the kill occurred
entityThe killer entity
killedEntityThe entity that was killed
sourceThe damage source that caused the death

AfterEntityChangeLevelArg

AfterEntityChangeLevelArg通用数据类
kotlin
data class AfterEntityChangeLevelArg( val originalEntity: Entity, val destinationEntity: Entity, val originalLevel: ServerLevel, val destinationLevel: ServerLevel )

Argument for entity level change event.

属性

属性说明
originalEntityThe entity before level change
destinationEntityThe entity after level change
originalLevelThe ServerLevel the entity was in
destinationLevelThe ServerLevel the entity is now in

AfterPlayerChangeLevelArg

AfterPlayerChangeLevelArg通用数据类
kotlin
data class AfterPlayerChangeLevelArg( val player: ServerPlayer, val originalLevel: ServerLevel, val destinationLevel: ServerLevel )

Argument for player level change event.

属性

属性说明
playerThe ServerPlayer who changed level
originalLevelThe ServerLevel the player was in
destinationLevelThe ServerLevel the player is now in

AllowDamageArg

AllowDamageArg通用数据类
kotlin
data class AllowDamageArg( val entity: LivingEntity, val source: DamageSource, val amount: Float )

Argument for damage allowance check.

属性

属性说明
entityThe entity potentially receiving damage
sourceThe damage source
amountThe damage amount

AfterDamageArg

AfterDamageArg通用数据类
kotlin
data class AfterDamageArg( val entity: LivingEntity, val source: DamageSource, val initialDamage: Float, val finalDamage: Float, val handled: Boolean )

Argument for after damage event.

属性

属性说明
entityThe entity that received damage
sourceThe damage source
initialDamageThe damage amount before reductions
finalDamageThe damage amount after reductions
handledWhether the damage was handled

AllowDeathArg

AllowDeathArg通用数据类
kotlin
data class AllowDeathArg( val entity: LivingEntity, val source: DamageSource, val amount: Float )

Argument for death allowance check.

属性

属性说明
entityThe entity potentially dying
sourceThe damage source causing death
amountThe damage amount

AfterDeathArg

AfterDeathArg通用数据类
kotlin
data class AfterDeathArg( val entity: LivingEntity, val source: DamageSource )

Argument for after death event.

属性

属性说明
entityThe entity that died
sourceThe damage source that caused death

MobConversionArg

MobConversionArg通用数据类
kotlin
data class MobConversionArg( val oldEntity: Mob, val newEntity: Mob, val keepEquipment: ConversionParams? )

Argument for mob conversion event.

属性

属性说明
oldEntityThe original Mob before conversion
newEntityThe new Mob after conversion
keepEquipmentParameters for equipment retention during conversion

AllowChatMessageArg

AllowChatMessageArg通用数据类
kotlin
data class AllowChatMessageArg( val message: PlayerChatMessage, val sender: ServerPlayer, val params: Bound )

Argument for chat message allowance check.

属性

属性说明
messageThe PlayerChatMessage being sent
senderThe ServerPlayer sending the message
paramsThe chat type bound parameters

AllowGameMessageArg

AllowGameMessageArg通用数据类
kotlin
data class AllowGameMessageArg( val server: MinecraftServer, val message: Component, val overlay: Boolean )

Argument for game message allowance check.

属性

属性说明
serverThe MinecraftServer instance
messageThe message Component
overlayWhether the message should show as overlay

AllowCommandMessageArg

AllowCommandMessageArg通用数据类
kotlin
data class AllowCommandMessageArg( val message: PlayerChatMessage, val source: CommandSourceStack, val params: Bound )

Argument for command message allowance check.

属性

属性说明
messageThe PlayerChatMessage from command
sourceThe CommandSourceStack executing the command
paramsThe chat type bound parameters

ChatMessageArg

ChatMessageArg通用数据类
kotlin
data class ChatMessageArg( val message: PlayerChatMessage, val sender: ServerPlayer, val params: Bound )

Argument for chat message event.

属性

属性说明
messageThe PlayerChatMessage being sent
senderThe ServerPlayer sending the message
paramsThe chat type bound parameters

GameMessageArg

GameMessageArg通用数据类
kotlin
data class GameMessageArg( val server: MinecraftServer, val message: Component, val overlay: Boolean )

Argument for game message event.

属性

属性说明
serverThe MinecraftServer instance
messageThe message Component
overlayWhether the message shows as overlay

CommandMessageArg

CommandMessageArg通用数据类
kotlin
data class CommandMessageArg( val message: PlayerChatMessage, val source: CommandSourceStack, val params: Bound )

Argument for command message event.

属性

属性说明
messageThe PlayerChatMessage from command
sourceThe CommandSourceStack executing the command
paramsThe chat type bound parameters

PlayerArg

PlayerArg通用数据类
kotlin
data class PlayerArg(val player: ServerPlayer)

Argument for player-related events.

属性

属性说明
playerThe ServerPlayer involved in the event

ServerPlayerAfterRespawnArg

ServerPlayerAfterRespawnArg通用数据类
kotlin
data class ServerPlayerAfterRespawnArg( val oldPlayer: ServerPlayer, val newPlayer: ServerPlayer, val alive: Boolean )

Argument for player respawn event.

属性

属性说明
oldPlayerThe ServerPlayer before respawn
newPlayerThe ServerPlayer after respawn
aliveWhether the player was alive before respawn

ServerPlayerAllowDeathArg

ServerPlayerAllowDeathArg通用数据类
kotlin
data class ServerPlayerAllowDeathArg( val player: ServerPlayer, val damageSource: DamageSource, val damageAmount: Float )

Argument for player death allowance check.

属性

属性说明
playerThe ServerPlayer potentially dying
damageSourceThe damage source causing death
damageAmountThe damage amount

ServerPlayerCopyArg

ServerPlayerCopyArg通用数据类
kotlin
data class ServerPlayerCopyArg( val oldPlayer: ServerPlayer, val newPlayer: ServerPlayer, val alive: Boolean )

Argument for player copy event (dimension change, etc.).

属性

属性说明
oldPlayerThe original ServerPlayer
newPlayerThe new ServerPlayer copy
aliveWhether the player was alive during copy

AnimalTameArg

AnimalTameArg通用数据类
kotlin
data class AnimalTameArg( val animal: Animal, val tamer: Player ): CancellableEventArg()

Argument for animal tame event.

Can be cancelled to prevent taming.

属性

属性说明
animalThe Animal being tamed
tamerThe Player taming the animal

BabySpawnArg

BabySpawnArg通用数据类
kotlin
data class BabySpawnArg( val parentA: LivingEntity, val parentB: LivingEntity, val child: AgeableMob? ): CancellableEventArg()

Argument for baby spawn event.

Can be cancelled to prevent baby spawning.

属性

属性说明
parentAThe first parent LivingEntity
parentBThe second parent LivingEntity
childThe baby AgeableMob (may be null)

CriticalHitArg

CriticalHitArg通用数据类
kotlin
data class CriticalHitArg( val player: Player, val target: Entity, val isVanillaCritical: Boolean )

Argument for critical hit event.

属性

属性说明
playerThe Player making the attack
targetThe Entity being attacked
isVanillaCriticalWhether vanilla considers this a critical hit

PlayerWakeUpArg

PlayerWakeUpArg通用数据类
kotlin
data class PlayerWakeUpArg( val player: Player, val wakeImmediately: Boolean, val updateLevelList: Boolean )

Argument for player wake up event.

属性

属性说明
playerThe Player waking up
wakeImmediatelyWhether to wake immediately
updateLevelListWhether to update the level list

EntityTeleportArg

EntityTeleportArg通用数据类
kotlin
data class EntityTeleportArg( val entity: Entity, val fromX: Double, val fromY: Double, val fromZ: Double, val toX: Double, val toY: Double, val toZ: Double ): CancellableEventArg()

Argument for entity teleport event.

Can be cancelled to prevent teleportation.

属性

属性说明
entityThe Entity teleporting
fromXThe original X coordinate
fromYThe original Y coordinate
fromZThe original Z coordinate
toXThe destination X coordinate
toYThe destination Y coordinate
toZThe destination Z coordinate

EndermanAngerArg

EndermanAngerArg通用数据类
kotlin
data class EndermanAngerArg( val enderman: EnderMan, val player: Player ): CancellableEventArg()

Argument for enderman anger event.

Can be cancelled to prevent the enderman from becoming angry.

属性

属性说明
endermanThe EnderMan becoming angry
playerThe Player the enderman is targeting

ExplosionStartArg

ExplosionStartArg通用数据类
kotlin
data class ExplosionStartArg( val level: Level, val explosion: Explosion ): CancellableEventArg()

Argument for explosion start event.

Can be cancelled to prevent the explosion.

属性

属性说明
levelThe Level where the explosion is starting
explosionThe Explosion instance

ExplosionDetonateArg

ExplosionDetonateArg通用数据类
kotlin
data class ExplosionDetonateArg( val level: Level, val explosion: Explosion, val affectedEntities: List<Entity> )

Argument for explosion detonate event.

属性

属性说明
levelThe Level where the explosion is detonating
explosionThe Explosion instance
affectedEntitiesList of entities affected by the explosion

ItemTossArg

ItemTossArg通用数据类
kotlin
data class ItemTossArg( val player: Player, val item: ItemEntity )

Argument for item toss event.

属性

属性说明
playerThe Player tossing the item
itemThe ItemEntity being tossed

PlayerDestroyItemArg

PlayerDestroyItemArg通用数据类
kotlin
data class PlayerDestroyItemArg( val player: Player, val item: ItemStack, val hand: InteractionHand?

Argument for item destruction event.

属性

属性说明
playerThe Player whose item was destroyed
itemThe ItemStack that was destroyed
handThe hand the item was in (may be null)

LivingUseItemStartArg

LivingUseItemStartArg通用数据类
kotlin
data class LivingUseItemStartArg( val entity: LivingEntity, val item: ItemStack, val hand: InteractionHand, val duration: Int ): CancellableEventArg()

Argument for item use start event.

Can be cancelled to prevent item use.

属性

属性说明
entityThe LivingEntity starting to use the item
itemThe ItemStack being used
handThe hand holding the item
durationThe initial use duration in ticks

LivingUseItemTickArg

LivingUseItemTickArg通用数据类
kotlin
data class LivingUseItemTickArg( val entity: LivingEntity, val item: ItemStack, var duration: Int ): CancellableEventArg()

Argument for item use tick event.

属性

属性说明
entityThe LivingEntity using the item
itemThe ItemStack being used
durationThe remaining use duration (modifiable)

LivingUseItemStopArg

LivingUseItemStopArg通用数据类
kotlin
data class LivingUseItemStopArg( val entity: LivingEntity, val item: ItemStack, val duration: Int ): CancellableEventArg()

Argument for item use stop event.

属性

属性说明
entityThe LivingEntity that stopped using the item
itemThe ItemStack that was being used
durationThe remaining use duration when stopped

LivingUseItemFinishArg

LivingUseItemFinishArg通用数据类
kotlin
data class LivingUseItemFinishArg( val entity: LivingEntity, val item: ItemStack, val duration: Int, var result: ItemStack )

Argument for item use finish event.

属性

属性说明
entityThe LivingEntity that finished using the item
itemThe ItemStack that was used
durationThe total use duration in ticks
resultThe resulting ItemStack (modifiable)

NeoPlayerAttackEntityArg

NeoPlayerAttackEntityArg通用数据类
kotlin
data class NeoPlayerAttackEntityArg( val player: Player, val target: Entity ) : CancellableEventArg()

Argument for NeoForge player attack entity event.

Can be cancelled to prevent the attack.

属性

属性说明
playerThe Player attacking
targetThe Entity being attacked

NeoPlayerInteractEntityArg

NeoPlayerInteractEntityArg通用数据类
kotlin
data class NeoPlayerInteractEntityArg( val player: Player, val entity: Entity, val hand: InteractionHand ) : CancellableEventArg()

Argument for NeoForge player interact entity event.

Can be cancelled to prevent the interaction.

属性

属性说明
playerThe Player interacting
entityThe Entity being interacted with
handThe hand used for interaction

NeoPlayerInteractBlockArg

NeoPlayerInteractBlockArg通用数据类
kotlin
data class NeoPlayerInteractBlockArg( val player: Player, val pos: BlockPos, val face: Direction?, val hand: InteractionHand ) : CancellableEventArg()

Argument for NeoForge player interact block event.

Can be cancelled to prevent the interaction.

属性

属性说明
playerThe Player interacting
posThe BlockPos being interacted with
faceThe Direction of the face being interacted with
handThe hand used for interaction

NeoPlayerInteractItemArg

NeoPlayerInteractItemArg通用数据类
kotlin
data class NeoPlayerInteractItemArg( val player: Player, val hand: InteractionHand ) : CancellableEventArg()

Argument for NeoForge player interact item event.

Can be cancelled to prevent the interaction.

属性

属性说明
playerThe Player interacting
handThe hand holding the item

NeoPlayerLeftClickBlockArg

NeoPlayerLeftClickBlockArg通用数据类
kotlin
data class NeoPlayerLeftClickBlockArg( val player: Player, val pos: BlockPos, val face: Direction? ) : CancellableEventArg()

Argument for NeoForge player left click block event.

Can be cancelled to prevent the action.

属性

属性说明
playerThe Player left-clicking
posThe BlockPos being clicked
faceThe Direction of the face being clicked

PlayerXpChangeArg

PlayerXpChangeArg通用数据类
kotlin
data class PlayerXpChangeArg( val player: Player, val amount: Int ): CancellableEventArg()

Argument for player XP change event.

Can be cancelled to prevent the XP change.

属性

属性说明
playerThe Player receiving XP
amountThe amount of XP points being added

PlayerXpLevelChangeArg

PlayerXpLevelChangeArg通用数据类
kotlin
data class PlayerXpLevelChangeArg( val player: Player, val levels: Int ): CancellableEventArg()

Argument for player XP level change event.

Can be cancelled to prevent the level change.

属性

属性说明
playerThe Player receiving levels
levelsThe number of levels being added

PlayerPickupXpArg

PlayerPickupXpArg通用数据类
kotlin
data class PlayerPickupXpArg( val player: Player, val orb: ExperienceOrb ): CancellableEventArg()

Argument for player pickup XP orb event.

Can be cancelled to prevent the pickup.

属性

属性说明
playerThe Player picking up the orb
orbThe ExperienceOrb being picked up

LivingHurtArg

LivingHurtArg通用数据类
kotlin
data class LivingHurtArg( val entity: LivingEntity, val source: DamageSource, val amount: Float ): CancellableEventArg()

Argument for living entity hurt event.

Can be cancelled to prevent the damage.

属性

属性说明
entityThe LivingEntity being hurt
sourceThe DamageSource causing the hurt
amountThe damage amount

NeoLivingDamageArg

NeoLivingDamageArg通用数据类
kotlin
data class NeoLivingDamageArg( val entity: LivingEntity, val source: DamageSource, val amount: Float )

Argument for NeoForge living damage event.

属性

属性说明
entityThe LivingEntity receiving damage
sourceThe DamageSource
amountThe damage amount

NeoLivingDeathArg

NeoLivingDeathArg通用数据类
kotlin
data class NeoLivingDeathArg( val entity: LivingEntity, val source: DamageSource )

Argument for NeoForge living death event.

属性

属性说明
entityThe LivingEntity that died
sourceThe DamageSource that caused death

LivingDropsArg

LivingDropsArg通用数据类
kotlin
data class LivingDropsArg( val entity: LivingEntity, val source: DamageSource, val drops: List<ItemStack> ): CancellableEventArg()

Argument for living entity drops event.

Can be cancelled to prevent drops.

属性

属性说明
entityThe LivingEntity dropping items
sourceThe DamageSource that caused the drops
dropsThe list of ItemStacks being dropped

LivingFallArg

LivingFallArg通用数据类
kotlin
data class LivingFallArg( val entity: LivingEntity, val distance: Double, val damageMultiplier: Float ): CancellableEventArg()

Argument for living entity fall event.

Can be cancelled to prevent fall damage.

属性

属性说明
entityThe LivingEntity falling
distanceThe fall distance in blocks
damageMultiplierThe damage multiplier

LivingJumpArg

LivingJumpArg通用值类
kotlin
@JvmInline
value class LivingJumpArg(val entity: LivingEntity)

Argument for living entity jump event.

属性

属性说明
entityThe LivingEntity jumping

ServerChatArg

ServerChatArg通用数据类
kotlin
data class ServerChatArg( val player: ServerPlayer, val message: String, val component: Component ) : CancellableEventArg()

Argument for server chat event.

Can be cancelled to prevent the message from being sent.

属性

属性说明
playerThe ServerPlayer sending the message
messageThe raw message string
componentThe message as a Component

ShieldBlockArg

ShieldBlockArg通用数据类
kotlin
data class ShieldBlockArg( val entity: LivingEntity, val source: DamageSource, val blockedDamage: Float, val originalBlockedState: Boolean )

Argument for shield block event.

属性

属性说明
entityThe LivingEntity blocking with a shield
sourceThe DamageSource being blocked
blockedDamageThe amount of damage blocked
originalBlockedStateWhether the shield was originally blocking

MobEffectAllowAddArg

MobEffectAllowAddArg通用数据类
kotlin
data class MobEffectAllowAddArg(val entity: Any, val effect: Any)

Placeholder mob effect argument stubs