Compatibility
Minecraft: Java Edition
1.19
Platforms
Fabric
Supported environments
75% of ad revenue goes to creators
Support creators and Modrinth ad-free with Modrinth+Links
Creators
Details
Licensed MIT
Created 2 years ago
Updated 2 years ago
Jigsaw Logic Lib
A library that allows modders to add custom game logic when a structure loads.
Installation:
Add the following to your build.gradle
.
repositories {
maven { url 'https://jitpack.io' }
}
dependencies {
modImplementation 'com.github.Totobird-Creations:JigsawLogicLib:${jigsawlogiclib_version}'
// Optional:
include 'com.github.Totobird-Creations:JigsawLogicLib:${jigsawlogiclib_version}'
}
Add the following to your gradle.properties
.
jigsawlogiclib_version = v1.0.1-mc1.19
Ad the following to your fabric.mod.json
.
"depends": {
"jigsawlogiclib": "1.x.x"
}
Usage:
In your initialiser's onInitialize
method, add the following:
LogicCommandManager.register(
new Identifier("yourModId", "commandName"),
(metadata, world, blockPos, structureOrigin) -> {
// Arguments:
// - String metadata : Some extra info given by the logic block.
// - World world : The world where the logic block was run.
// - BlockPos blockPos : The position of the logic block when it was run.
// - BlockPos structureOrigin : The position where the structure started generating.
// Safety notes:
// - Make sure that if you set any blocks, they are in the same chunk.
}
);
- Set up the structure blocks and your structure, then place a logic block inside.
- In game, run the following command:
/give @s jigsawlogiclib:logic
- Place it and set the command value to what you what you set above
yourModId:commandName
. - Optionally, add some metadata. This will be passed to your function you specified above.
- Press "Done" to save, or press "Run" to test it.
- Save your structure and set up all of the worldgen data files.