Jigsaw Logic Lib

Jigsaw Logic Lib

Mod

A library that allows modders to add custom game logic when a structure loads.

Server LibraryUtilityWorld Generation

85 downloads
1 follower
Follow Save
90% of ad revenue goes to creators. Go ad-free while supporting creators with Modrinth Plus. Subscribe today!

Jigsaw Logic Lib

A library that allows modders to add custom game logic when a structure loads.

Modrinth Github

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.
    }
);
  1. Set up the structure blocks and your structure, then place a logic block inside.
  2. In game, run the following command: /give @s jigsawlogiclib:logic
  3. Place it and set the command value to what you what you set above yourModId:commandName.
  4. Optionally, add some metadata. This will be passed to your function you specified above.
  5. Press "Done" to save, or press "Run" to test it.
  6. Save your structure and set up all of the worldgen data files.

Project members

Totobird-Creations

Owner

Details

Licensed MIT
Created 2 years ago
Updated 2 years ago