BlunthornAPI
An API created for Blunthorn mods. Adds various events and a permission system. Does nothing on its own.
介绍
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).
<img src="https://cdn.modrinth.com/data/cached_images/8bd6d7ff822dc33ffb55af6cc0c7062cec53e9e3.png"
width=150>
常见问题
BlunthornAPI 支持哪些 Minecraft 版本?
BlunthornAPI 支持 Minecraft Java 版 1.20.1–1.20.6,共 6 个版本,可用的加载器:Fabric。下载时注意选择和你游戏版本一致的文件。
BlunthornAPI 怎么安装?
先用 PCL2 或 HMCL 启动器安装对应版本的 Fabric,再把下载的 .jar 文件放进游戏目录的 mods 文件夹,重新启动游戏即可。开启了版本隔离的,mods 文件夹在 versions/版本名 下面。
Blunthorn 的其他作品
查看全部 →
BlockBlock
Block blocks, item usage, entity interaction and more!
Create: Forced Expansion
A modpack that forces you to not live in one place!
FlintAndStone
Adds a primitive, single use Flint and Stone
Distant Creations
Explore a beautiful world using Create and Distant Horizons!

评论
登录后评论和评分