Listener - twoone-3/BDSpyrunner GitHub Wiki

'此页内容待完善'

Listener

事件监听器

  • 使用setListener来设置监听器
  • 回调函数有且只有一个参数,类型为字典

onJoin

  • 拦截可否:否
  • 回传数据:
    • Player

onPreJoin

  • 拦截可否:是
  • 回传数据:
    • IP
    • Player
    • XUID

onLeft

  • 拦截可否:否
  • 回传数据:
    • Player

onRespawn

  • 拦截可否:否
  • 回传数据:
    • Player

onPlayerDie

  • 拦截可否:否
  • 回传数据:
    • Cause
    • Entity
    • Player

onPlayerCmd

  • 拦截可否:是
  • 回传数据:
    • Player
    • Command
    • isSuccess
    • FullCode

onChat

  • 拦截可否:是
  • 回传数据:
    • Player
    • Message

onChangeDim

  • 拦截可否:否
  • 回传数据:
    • Player
    • ToDimensionId

onJump

  • 拦截可否:否
  • 回传数据:
    • Player

onSneak

  • 拦截可否:否
  • 回传数据:
    • Player
    • IsSneaking

onAttackEntity

  • 拦截可否:是
  • 回传数据:
    • Player
    • Target

onAttackBlock

  • 拦截可否:是
  • 回传数据:
    • BlockInstance
    • ItemStack
    • Player

onUseItem

  • 拦截可否:是
  • 回传数据:
    • Player
    • ItemStack

onUseItemOn

  • 拦截可否:是
  • 回传数据:
    • Player
    • ItemStack
    • BlockInstance
    • Face

onTakeItem

  • 拦截可否:是
  • 回传数据:
    • Player
    • ItemEntity
    • ItemStack

onDropItem

  • 拦截可否:是
  • 回传数据:
    • Player
    • ItemStack

onEat

  • 拦截可否:是
  • 回传数据:
    • Player
    • FoodItem

onConsumeTotem

  • 拦截可否:否
  • 回传数据:
    • Player

onEffectChanged

  • 拦截可否:否
  • 回传数据:
    • Player
    • Effect
    • EventType

onStartDestroyBlock

  • 拦截可否:否
  • 回传数据:
    • Player
    • BlockInstance

onDestroyBlock

  • 拦截可否:否
  • 回传数据:
    • Player
    • BlockInstance

onPlaceBlock

  • 拦截可否:否
  • 回传数据:
    • Player
    • BlockInstance

onOpenContainer

  • 拦截可否:否
  • 回传数据:
    • BlockInstance
    • Player
    • Container

onCloseContainer

  • 拦截可否:否
  • 回传数据:
    • BlockInstance
    • Player
    • Container

onInventoryChange

  • 拦截可否:否
  • 回传数据:
    • NewItemStack
    • Player
    • PreviousItemStack
    • Slot

onMove

  • 拦截可否:否
  • 回传数据:
    • Player
    • Pos

onChangeSprinting

  • 拦截可否:否
  • 回传数据:
    • Player
    • IsSprinting

onSetArmor

  • 拦截可否:否
  • 回传数据:
    • Player
    • Slot
    • ArmorItem

onUseRespawnAnchor

  • 拦截可否:否
  • 回传数据:
    • Player
    • BlockInstance

onOpenContainerScreen

  • 拦截可否:否
  • 回传数据:
    • Player

onMobDie

  • 拦截可否:否
  • 回传数据:
    • Mob
    • Cause
    • Entity

onMobHurt

  • 拦截可否:否
  • 回传数据:
    • Mob
    • Damage
    • Cause
    • Entity

onEntityExplode

  • 拦截可否:否
  • 回传数据:
    • Actor
    • Pos
    • Dim
    • Radius
    • MaxResistance
    • Breaking
    • Fire

onProjectileHitEntity

  • 拦截可否:否
  • 回传数据:
    • Target
    • Source

onWitherBossDestroy

  • 拦截可否:否
  • 回传数据:
    • WitherBoss
    • Min
    • Max

onRide

  • 拦截可否:否
  • 回传数据:
    • Rider
    • Vehicle

onStepOnPressurePlate

  • 拦截可否:否
  • 回传数据:
    • Actor
    • BlockInstance

onSpawnProjectile

  • 拦截可否:否
  • 回传数据:
    • Shooter
    • Type

onProjectileCreated

  • 拦截可否:否
  • 回传数据:
    • Shooter
    • Projectile

onNpcCmd

  • 拦截可否:否
  • 回传数据:
    • Npc
    • Player
    • Command

onChangeArmorStand

  • 拦截可否:否
  • 回传数据:
    • ArmorStand
    • Player
    • Slot

onEntityTransformation

  • 拦截可否:否
  • 回传数据:
    • EntityId
    • AfterEntity

onBlockInteracted

  • 拦截可否:否
  • 回传数据:
    • Player
    • BlockInstance

onBlockChanged

  • 拦截可否:否
  • 回传数据:
    • PreviousBlockInstance
    • NewBlockInstance

onBlockExplode

  • 拦截可否:否
  • 回传数据:
    • BlockInstance
    • Radius
    • MaxResistance
    • Breaking
    • Fire

onBlockExploded

  • 拦截可否:否
  • 回传数据:
    • BlockInstance
    • ExplodeSource

onFireSpread

  • 拦截可否:否
  • 回传数据:
    • Target
    • DimentionId

onCmdBlockExecute

  • 拦截可否:否
  • 回传数据:
    • BlockInstance
    • Command
    • IsMineCart
    • MineCart

onContainerChange

  • 拦截可否:否
  • 回传数据:
    • Player
    • Actor
    • Container
    • Slot
    • PreviousItemStack
    • NewItemStack

onProjectileHitBlock

  • 拦截可否:否
  • 回传数据:
    • BlockInstance
    • Source

onRedStoneUpdate

  • 拦截可否:否
  • 回传数据:
    • BlockInstance
    • RedStonePower
    • IsActivated

onHopperSearchItem

  • 拦截可否:否
  • 回传数据:
    • IsMineCart
    • HopperBlock
    • MineCartPos
    • DimentionId

onHopperPushOut

  • 拦截可否:否
  • 回传数据:
    • Pos
    • DimentionId

onPistonTryPush

  • 拦截可否:否
  • 回传数据:
    • PistonBlockInstance
    • TargetBlockInstance

onPistonPush

  • 拦截可否:否
  • 回传数据:
    • PistonBlockInstance
    • TargetBlockInstance

onFarmLandDecay

  • 拦截可否:否
  • 回传数据:
    • BlockInstance
    • Actor

onUseFrameBlock

  • 拦截可否:否
  • 回传数据:
    • Player
    • BlockInstance

onLiquidFlow

  • 拦截可否:否
  • 回传数据:
    • BlockInstance
    • Target
    • DimentionId

onScoreChanged

  • 拦截可否:否
  • 回传数据:
    • Player
    • Score
    • Objective

onServerStarted

  • 拦截可否:否
  • 回传数据:

onConsoleCmd

  • 拦截可否:是
  • 回传数据:
    • Command

onConsoleOutput

  • 拦截可否:是
  • 回传数据:
    • Output

onMobTrySpawn

  • 拦截可否:否
  • 回传数据:
    • TypeName
    • Pos
    • DimentionId