Mods
Resource Packs
Data Packs
Modpacks
Shaders
Plugins
Mods Resource Packs Data Packs Plugins Shaders Modpacks
Get Modrinth App Upgrade to Modrinth+
Sign in
ModsPluginsData PacksShadersResource PacksModpacks
Sign in
Settings
BlunthornAPI

BlunthornAPI

An API created for Blunthorn mods. Adds various events and a permission system. Does nothing on its own.

1,969
2
Library
Utility
AboutChangelogVersions

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).


Blunthorn Banner

90% of ad revenue goes to creators

Support creators and Modrinth ad-free with Modrinth+

Compatibility

Minecraft: Java Edition

1.20.1–1.20.6

Platforms

Fabric

Links

Report issues View source Visit wiki Join Discord server
Donate on Ko-fi

Creators

Blunthorn
BlunthornOrganization

Details

Licensed MIT
Published 12 months ago
Updated 8 months ago

Modrinth is open source.

main@a0bd011

© Rinth, Inc.

Company

TermsPrivacyRulesCareers

Resources

SupportBlogDocsStatus

Interact

Discord X (Twitter) Mastodon Crowdin
Get Modrinth App Settings
NOT AN OFFICIAL MINECRAFT SERVICE. NOT APPROVED BY OR ASSOCIATED WITH MOJANG OR MICROSOFT.