这是一个 API 模组,它本身不添加任何内容。其当前主要目标是简化 BlockBlock 模组及其插件的开发流程。
功能
本模组添加了若干事件,以及一个权限系统框架,允许开发者阻止玩家执行某些操作。
事件
BlockBreakEvent.ATTACK - 当玩家开始挖掘方块时触发
BlockBreakEvent.BEFORE - 在方块被破坏前瞬间触发
BlockBreakEvent.AFTER - 在方块成功被破坏后触发(不可取消)
BlockPlaceEvent - 当玩家放置方块时触发
BlockUseEvent - 当玩家(右键点击)使用方块时触发
EntityItemDropEvent - 当被击杀的生物即将掉落战利品时触发
EntityUseEvent - 当玩家(右键点击)使用实体时触发
ItemUseEvent - 当玩家使用物品时触发
ObjectCraftedEvent - 当玩家在合成网格中输入有效配方时触发
权限框架
权限框架使得针对特定物品、方块、实体或其他操作锁定某项动作变得更加容易。锁定操作是针对每个玩家单独进行的。
API 提供了 3 个 ActionContext 类供你使用:
BlockActionContext - 用于处理方块的破坏、放置和交互。
ItemActionContext - 用于处理物品的使用和合成配方。
EntityActionContext - 用于处理与实体的交互并防止其掉落物。
这些上下文类包含了你可能需要用来决定如何处理某项操作的所有信息。
或者,你可以将其传递给 Permission 类并使用 Permission.isObjectLocked(context)。这将返回某个对象对于特定玩家是否被锁定。
有关如何使用该 API 的更详细指南,请参阅 维基(正在建设中)。

This is an API mod that adds nothing on its own. Its main goal currently is to simplify the process of creating the BlockBlock mod and its addons.
Features
This mod adds a number of events, as well as a permission system framework that allows developers to prevent players from doing certain actions.
Events
BlockBreakEvent.ATTACK - Triggered when a player starts mining a block
BlockBreakEvent.BEFORE - Triggered right before a block is broken
BlockBreakEvent.AFTER - Triggered after a block is sucessfully broken (cannot be cancelled)
BlockPlaceEvent - Triggered a player places a block
BlockUseEvent Triggered when a player (right click) uses a block
EntityItemDropEvent - Triggered when a killed entity is about to drop its loot
EntityUseEvent - Triggered when a player (right click) uses an entity
ItemUseEvent - Triggered when a player uses an item
ObjectCraftedEvent - Triggered when a player enters a valid recipe in a crafting grid
Permission framework
The permission framework makes it easier to lock a certain action, for a certain item, block, entity or other actions. Locking actions is done on a per-player basis.
The API adds 3 ActionContext classes you can use:
BlockActionContext - Used for breaking, placement and block interaction.
ItemActionContext - Used for item usage and crafting recipes.
EntityActionContext - Used for interacting with entities and preventing their drops.
These context classes contain all the info you might need to decide what you need to do with an action.
Alternatively, you can pass it along to the Permission class using Permission.isObjectLocked(context). This will return whether an object is locked or not for a certain player.
For a more comprehensive guide on how to use the API, please refer to the wiki (under construction).

下载 BlunthornAPI
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 BlunthornAPI
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 BlunthornAPI
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 BlunthornAPI
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 BlunthornAPI
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 BlunthornAPI
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 BlunthornAPI
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 BlunthornAPI
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
- 修复了跨维度旅行时客户端无法正确更新的问题
- 修复了使用物品日志功能时,对象 ID 日志会重复输出到聊天栏两次的问题
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
模组
一个用于收集生物掉落物的多区块模组。
模组
显示你正在注视的方块的信息。(适用于 Minecraft 1.16+ 的 Hwyla/Waila 分支)
模组
使用 JavaScript 编辑配方、添加自定义物品、编写世界事件!
模组
查看物品与配方
模组
在游戏画面角落显示附近世界地形、玩家、生物和实体的地图。可创建路径点,帮助你找到标记过的位置。
模组
适用于 MC 1.18+ 的 Effekseer 加载器
评论 0
登录后参与评分
还没有评论,来抢沙发吧