JsonThings-1.18.1-0.3.0.jar
Curse Maven Snippet
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