Download Jigsaw Logic Lib — Minecraft Mods — MetaMods
Jigsaw Logic Lib

Jigsaw Logic Lib

Active

Downloads

0

Last update

3 years ago

Versions

1.19
Server
Fabric
Libraries
Utils

Jigsaw Logic Lib

A library for mod developers that enables creating custom game logic when structures load in the world.

Installation

To add the library to your project, follow these steps:

Add to your build.gradle file:

repositories {
    maven { url 'https://jitpack.io' }
}
dependencies {
    modImplementation 'com.github.Totobird-Creations:JigsawLogicLib:${jigsawlogiclib_version}'
    // Optional:
    include 'com.github.Totobird-Creations:JigsawLogicLib:${jigsawlogiclib_version}'
}

Specify the version in gradle.properties:

jigsawlogiclib_version = v1.0.1-mc1.19

Add the dependency to your fabric.mod.json file:

"depends": {
    "jigsawlogiclib": "1.x.x"
}

Usage

In your initializer's onInitialize method, add the following code:

LogicCommandManager.register(
    new Identifier("yourModId", "commandName"),
    (metadata, world, blockPos, structureOrigin) -> {
        // Arguments:
        // - String   metadata        : Additional information from the logic block.
        // - World    world           : The world where the logic block is executed.
        // - BlockPos blockPos        : The position of the logic block during execution.
        // - BlockPos structureOrigin : The position where structure generation started.
        // Important notes:
        // - If you modify blocks, make sure they are in the same chunk.
    }
);

In-Game Procedure

  1. Set up the structure using regular structure blocks and place a logic block inside it.
  2. Obtain the logic block with the command: /give @s jigsawlogiclib:logic
  3. Place it and set the command value as specified above: yourModId:commandName
  4. Optionally add metadata that will be passed to your function.
  5. Save changes with the "Done" button or test using "Run".
  6. Save the structure and configure all necessary world generation files.
Project members
Totobird-Creations

Totobird-Creations

Developer

Created: 12 Jul 2025

ID: 22430