• 注册
  • 技术交流 技术交流 关注:8 内容:20

    [OpenMod]事件文档

  • 查看作者
  • 打赏作者
  • 当前位置: 未转变者中文社区 > 技术交流 > 正文
    大版主
    Lv.15

    搬运自OpenMod官网,经过翻译,可能有些不足,欢迎指正!原文链接

    OpenMod.Core 事件

    事件 什么时候引发事件
    UserConnectingEvent 用户试图连接到服务器
    UserConnectedEvent 用户已连接到服务器
    UserDisconnectedEvent 用户已断开与服务器的连接
    CommandExecutingEvent 将要执行一个命令
    CommandExecutedEvent 已执行命令
    OpenModInitializedEvent OpenMod已初始化
    OpenModShutdownEvent OpenMod正在关闭
    PluginActivatingEvent 正在激活插件
    PluginContainerConfiguringEvent 正在创建插件IoC容器
    PluginConfigurationChangedEvent 插件配置已更改
    PluginLoadEvent 正在加载插件
    PluginLoadedEvent 已加载插件
    PluginUnloadEvent 插件正在卸载
    PluginUnloadedEvent 插件已卸载

    OpenMod.Extensions.Economy.Abstractions 事件

    事件 什么时候引发事件
    BalanceUpdatedEvent 余额已添加到玩家帐户或从中删除

    游戏事件

    这些事件是由OpenMod.Extensions.Games.Abstractions包,并且不是OpenMod API核心的一部分。

    它们可能不在所有受支持的OpenMod平台上都可用。

    事件 什么时候引发事件 可撤销性 命名空间
    IPlayerChattingEvent 在玩家聊天之前 Yes OpenMod.Extensions.Games.Abstractions.Players
    IPlayerSpawnedEvent 玩家出生后 No OpenMod.Extensions.Games.Abstractions.Players
    IPlayerDamagingEvent 在玩家受伤之前 Yes OpenMod.Extensions.Games.Abstractions.Players
    IPlayerDamagedEvent 在玩家受伤之后 No OpenMod.Extensions.Games.Abstractions.Players
    IPlayerDyingEvent 在玩家受到致命伤害之前 Yes OpenMod.Extensions.Games.Abstractions.Players
    IPlayerDeadEvent 在玩家死后 No OpenMod.Extensions.Games.Abstractions.Players
    IPlayerEnteringVehicleEvent 在玩家进入载具之前 Yes OpenMod.Extensions.Games.Abstractions.Players
    IPlayerEnteredVehicleEvent 在玩家进入载具之后 No OpenMod.Extensions.Games.Abstractions.Players
    IPlayerExitingVehicleEvent 在玩家离开载具之前 Yes OpenMod.Extensions.Games.Abstractions.Players
    IPlayerExitedVehicleEvent 在玩家离开载具之后 No OpenMod.Extensions.Games.Abstractions.Players
    IPlayerItemEquippingEvent 玩家装备物品前 Yes OpenMod.Extensions.Games.Abstractions.Players
    IPlayerItemEquippedEvent 玩家装备物品后 No OpenMod.Extensions.Games.Abstractions.Players
    IPlayerUnequippingEvent 在玩家取消装备物品之前 Yes OpenMod.Extensions.Games.Abstractions.Players
    IPlayerUnequippedEvent 在玩家取消装备物品之前 No OpenMod.Extensions.Games.Abstractions.Players

    Unturned 事件

    动物事件

    这些事件存储在OpenMod.Unturned.Animals.Events命名空间。

    事件 什么时候引发事件 可撤销性
    UnturnedAnimalSpawnedEvent 动物出生后(复活或添加新实例) No
    UnturnedAnimalAddedEvent 添加新动物实例后(触发繁殖事件) No
    UnturnedAnimalRevivedEvent 动物复活后(触发繁殖事件) No
    UnturnedAnimalAlertingEvent 在动物被惊吓之前 Yes
    UnturnedAnimalAttackingEvent 在动物攻击玩家/目标之前(触发惊吓事件) Yes
    UnturnedAnimalAttackingPlayerEvent 动物攻击玩家之前(触发攻击事件) Yes
    UnturnedAnimalAttackingPointEvent 在动物攻击目标之前(触发攻击事件) Yes
    UnturnedAnimalFleeingEvent 在动物逃跑之前 Yes
    UnturnedAnimalDamagingEvent 在动物受到伤害之前 Yes
    UnturnedAnimalDyingEvent 在动物遭受致命伤害之前 Yes
    UnturnedAnimalDeadEvent 动物死后 No

    建筑事件

    这些事件存储在OpenMod.Unturned.Building.Events命名空间。

    路障和结构事件源自其可构建的对应项。每当发出可放置建筑物或房屋结构建筑物事件时,也将发出可构建版本。

    事件 什么时候引发事件 可撤销性
    UnturnedBuildableDeployedEvent 放置建筑物后 No
    UnturnedBuildableSalvagingEvent 在一个建筑被回收之前 Yes
    UnturnedBuildableDamagingEvent 在建筑物损坏之前 Yes
    UnturnedBuildableDestroyingEvent 在建筑受到足够的伤害被摧毁之前 Yes
    UnturnedBuildableDestroyedEvent 在建筑被破坏后 No
    IUnturnedBarricadeEvent 任何可放置建筑物事件都会被触发
    UnturnedBarricadeDeployedEvent 设置可放置建筑物后 No
    UnturnedBarricadeSalvagingEvent 在可放置建筑物被回收之前 Yes
    UnturnedBarricadeDamagingEvent 在可放置建筑物被破坏之前 Yes
    UnturnedBarricadeDestroyingEvent 在可放置建筑物受到足够的伤害被摧毁之前 Yes
    UnturnedBarricadeDestroyedEvent 可放置建筑物被摧毁后 No
    IUnturnedStructureEvent 任何房屋结构建筑物事件都将触发
    UnturnedStructureDeployedEvent 放置房屋结构建筑物后 No
    UnturnedStructureSalvagingEvent 在回收房屋结构建筑物之前 Yes
    UnturnedStructureDamagingEvent 在房屋结构建筑物损坏之前 Yes
    UnturnedStructureDestroyingEvent 在房屋结构建筑物受到足够的伤害被摧毁之前 Yes

    环境事件

    这些事件存储在OpenMod.Unturned.Environment.Events命名空间。

    事件 什么时候引发事件 可撤销性
    UnturnedDayNightUpdatedEvent 昼夜循环更新后 No
    UnturnedWeatherUpdatedEvent 天气更新后 No

    玩家事件

    封禁

    这些事件存储在OpenMod.Unturned.Players.Bans.Events命名空间。

    事件 什么时候引发事件 可撤销性
    UnturnedPlayerBanningEvent 在玩家被封禁之前 Yes
    UnturnedPlayerBannedEvent 在玩家被封禁之后 No
    UnturnedPlayerUnbanningEvent 在玩家被解封之前 Yes
    UnturnedPlayerUnbannedEvent 在玩家被解封之后 No
    UnturnedPlayerCheckingBanEvent 在检查玩家的封禁状态之前 Yes

    聊天

    这些事件存储在OpenMod.Unturned.Players.Chat.Events命名空间。

    事件 什么时候引发事件 可撤销性
    UnturnedPlayerChattingEvent 在玩家聊天之前 Yes
    UnturnedServerSendingMessageEvent 在服务器向玩家显示聊天信息之前 No, 但是有可修改的字段

    衣服

    这些事件存储在OpenMod.Unturned.Players.Clothing.Events命名空间。

    事件 什么时候引发事件 可撤销性
    UnturnedPlayerClothingEquippingEvent 在装备任何一件衣服之前 Yes
    UnturnedPlayerClothingEquippedEvent 任何一件衣服装备之后 No
    UnturnedPlayerClothingUnequippingEvent 在任何一件衣服脱掉之前 Yes
    UnturnedPlayerClothingUnequippedEvent 在任何一件衣服都没有装备之后 No

    连接

    这些事件存储在OpenMod.Unturned.Players.Connections.Events命名空间。

    事件 什么时候引发事件 可撤销性
    UnturnedPlayerConnectedEvent 玩家连接后 No
    UnturnedPlayerDisconnectedEvent 玩家断开连接后 No

    合成

    这些事件存储在OpenMod.Unturned.Players.Crafting.Events命名空间。

    事件 什么时候引发事件 可撤销性
    UnturnedPlayerCraftingEvent 在玩家合成之前 Yes

    装备

    这些事件存储在OpenMod.Unturned.Players.Equipment.Events命名空间。

    事件 什么时候引发事件 可撤销性
    UnturnedPlayerItemEquippingEvent 在玩家装备任何东西之前 Yes
    UnturnedPlayerItemEquippedEvent 在玩家装备任何东西之后 No
    UnturnedPlayerItemUnequippingEvent 在一个玩家取消装备任何东西之前 Yes
    UnturnedPlayerItemUnequippedEvent 在一个玩家取消装备任何东西之后 No

    库存

    这些事件存储在OpenMod.Unturned.Players.Inventory.Events命名空间。

    事件 什么时候引发事件 可撤销性
    UnturnedPlayerOpenedStorageEvent 在玩家打开一个存储后 No
    UnturnedPlayerClosedStorageEvent 玩家关闭存储后 No
    UnturnedPlayerTakingItemEvent 在玩家从地上拿东西前 Yes
    UnturnedPlayerDroppedItemEvent 在玩家扔下物品后 No
    UnturnedPlayerInventoryResizedEvent 玩家的库存调整后 No
    UnturnedPlayerInventoryUpdatedEvent 玩家的库存更新后 No
    UnturnedPlayerItemAddedEvent 将物品添加到玩家的库存后 No
    UnturnedPlayerItemRemovedEvent 从玩家的库存中移除物品后 No
    UnturnedPlayerItemUpdatedEvent 在玩家的物品更新后 No

    生命

    这些事件存储在OpenMod.Unturned.Players.Life.Events命名空间。

    事件 什么时候引发事件 可撤销性
    UnturnedPlayerDamagingEvent 在玩家受伤之前 Yes
    UnturnedPlayerDamagedEvent 玩家受伤后 No
    UnturnedPlayerDyingEvent 在玩家受到致命伤害之前 Yes
    UnturnedPlayerDeadEvent 玩家死后 No
    UnturnedPlayerSpawnedEvent 玩家出生后(连接或复活) No
    UnturnedPlayerRevivedEvent 玩家复活后 No

    运动

    这些事件存储在OpenMod.Unturned.Players.Movement.Events命名空间。

    事件 什么时候引发事件 可撤销性
    UnturnedPlayerGestureUpdatedEvent 玩家的手势更新后 No
    UnturnedPlayerStanceUpdatedEvent 在玩家的姿势更新后 No
    UnturnedPlayerTeleportingEvent 在玩家传送之前 Yes
    UnturnedPlayerSafetyUpdatedEvent 玩家安全区更新后 No

    技能

    这些事件存储在OpenMod.Unturned.Players.Skills.Events命名空间。

    事件 什么时候引发事件 可撤销性
    UnturnedPlayerExperienceUpdatedEvent 玩家经验更新后 No
    UnturnedPlayerReputationUpdatedEvent 玩家声望更新后 No

    状态

    这些事件存储在OpenMod.Unturned.Players.Stats.Events命名空间。

    事件 什么时候引发事件 可撤销性
    UnturnedPlayerStatUpdatedEvent 在玩家的任何状态被更新后 No
    UnturnedPlayerBleedingUpdatedEvent 在玩家的出血状态更新后 No
    UnturnedPlayerBrokenUpdatedEvent 在玩家的骨折状态更新后 No
    UnturnedPlayerFoodUpdatedEvent 玩家的食物数据更新后 No
    UnturnedPlayerHealthUpdatedEvent 玩家的健康数据更新后 No
    UnturnedPlayerLifeUpdatedEvent 玩家的生命状态更新后 No
    UnturnedPlayerOxygenUpdatedEvent 玩家的氧气状态更新后 No
    UnturnedPlayerStaminaUpdatedEvent 玩家的耐力状态更新后 No
    UnturnedPlayerTemperatureUpdatedEvent 玩家的体温状态更新后 No
    UnturnedPlayerVirusUpdatedEvent 玩家的病毒状态更新后 No
    UnturnedPlayerVisionUpdatedEvent 在玩家的视野更新后 No
    UnturnedPlayerWaterUpdatedEvent 玩家的水状态更新后 No

    可使用的

    这些事件存储在OpenMod.Unturned.Players.Useables.Events命名空间。

    事件 什么时候引发事件 可撤销性
    UnturnedPlayerPerformingAidEvent 在一个玩家帮助另一个玩家之前 Yes

    UI

    这些事件存储在OpenMod.Unturned.Players.UI.Events命名空间。

    事件 什么时候引发事件 可撤销性
    UnturnedPlayerButtonClickedEvent 在玩家单击UI按钮之后 No
    UnturnedPlayerTextInputtedEvent 玩家将文本输入文本框后 No

    语音

    这些事件存储在OpenMod.Unturned.Players.Voice.Events命名空间。

    事件 什么时候引发事件 可撤销性
    UnturnedPlayerTalkingUpdatedEvent 玩家开始或停止说话后 No
    UnturnedPlayerRelayingVoiceEvent 在玩家开始说话之前 Yes

    请登录之后再进行评论

    登录
  • 发布内容
  • 任务中心
  • 实时动态
  • 偏好设置
  • 帖子间隔 侧栏位置: