Description:
EventBlock API is a Minecraft Forge mod for 1.20.1 that adds special blocks that generate random events every in-game noon. These blocks can add excitement and unpredictability to your world, making them perfect for adventure maps, custom worlds, or modpacks.
Features:
For Modpack Creators:
To add a custom event to a block’s event list:
Import the RandomBlock class:import com.creatorsindrome.eventblock.common.block.RandomBlock;
Register your event using the static method:
RandomBlock.regBlockEvent(new BlockEvent() {
@Override
public void run(BlockState blockstate, ServerLevel world, BlockPos pos) {
// Your custom event code here
}
});
The run method receives the following arguments:
BlockState blockstate — the state of the block triggering the eventServerLevel world — the server-side worldBlockPos pos — the position of the blockUsage:
Simply place the Random Event Block in your world. Every in-game noon, it will execute one of the registered events. Combine multiple blocks for more complex behaviors.
Recommended For: