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
Jigsaw Logic Lib

Jigsaw Logic Lib

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

124
3
Library
Utility
World Generation

Compatibility

Minecraft: Java Edition

1.19

Platforms

Fabric

Supported environments

Server-side

90% of ad revenue goes to creators

Support creators and Modrinth ad-free with Modrinth+

Links

Report issues View source

Creators

Totobird-Creations
Totobird-Creations Owner

Details

Licensed MIT
Created 2 years ago
Updated 2 years ago
DescriptionGalleryChangelogVersions

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.

Modrinth is open source.

main@bd61f5d

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