Json Things

A mod that enables players to define blocks and items (and more!) via thingpacks, zip files similar to datapacks and resource packs
Back to Files

JsonThings-1.18.1-0.3.0.jar

File nameJsonThings-1.18.1-0.3.0.jar
Uploader
gigaherzgigaherz
Uploaded
Feb 27, 2022
Downloads
279
Size
370.9 KB
Mod Loaders
Forge
File ID
3666584
Type
B
Beta
Supported game versions
  • 1.18.1

Curse Maven Snippet

Forge

implementation fg.deobf("curse.maven:json-things-541617:3666584")

Learn more about Curse Maven

What's new

Merged PR #4: Fix missing shapes in compound shapes

 

Introduced an initial version of scripting support.

This scripting support is very rudimentary, and will require using SRG names at runtime. I have plans to improve that, but they will take time.

 

Script files are javascript (.js) files located in a scripts folder on the thingpacks.

 

Eg: This is things/testpack/scripts/test.js -- it wouldn't work as-is if you copy it, because I wrote it in dev and you'd have to turn the method and field names to SRG.

 

import("net.minecraft.world.effect.MobEffectInstance");
import("net.minecraft.world.effect.MobEffects");
import("net.minecraft.world.item.ItemStack");
import("net.minecraft.world.item.Items");

function apply(eventName, args)
{
Log.info("Test");

let player = args.user;
if (player != null)
{
player.addEffect(new MobEffectInstance(MobEffects.REGENERATION, 200))
}

return FlexEventResult.success(new ItemStack(Items.STICK));
}

 

 

You can specify events on an item, block, or enchantment. You can specify a single handler, or an array of handlers, on each event.

 

Example: This assigns the test event to the use_on_block event. 
"events": {
"use_on_block": "testpack:test"
}

 

 

This mod has no additional files