Archive eaglerforge-injector (tool, 1.8.8, clean-with-notes)

This commit is contained in:
2026-11-27 22:15:15 -06:00
parent 5f406cdc02
commit 606dab7e6e
91 changed files with 9667 additions and 0 deletions
@@ -0,0 +1,45 @@
//Demo mod showing how to use lib.customitems.js
ModAPI.addEventListener("lib:libcustomitems:loaded", () => {
console.log("Registered my cool custom item.");
LibCustomItems.registerItem({
tag: "mymod:test_item_1",
base: "magma_cream",
name: "Custom Item",
qty: 32,
useRecipe: true,
recipe: [
"###",
"# #",
"###"
],
recipeLegend: {
"#": {
"type": "block",
"id": "dirt"
}
},
//Optional: onRightClickGround
onRightClickGround: `/*/user, world, itemstack, blockpos/*/
itemstack.stackSize -= 1;
if (itemstack.stackSize < 1) {
user.inventory.mainInventory[user.inventory.currentItem] = null;
}
user.setHealth(2);
return true; //PreventDefault
`,
//Optional: onLeftClickGround
onLeftClickGround: `/*/user, world, itemstack, blockpos/*/
itemstack.stackSize -= 1;
if (itemstack.stackSize < 1) {
user.inventory.mainInventory[user.inventory.currentItem] = null;
}
user.setHealth(20);
return true; //PreventDefault
`,
//Optional: craftingExtra
craftingExtra: `/*/itemstack/*/
let enchant = ModAPI.reflect.getClassByName("Enchantment").staticMethods.getEnchantmentById.method(5); //ENCHANTMENT_OXYGEN (respiration)
itemstack.addEnchantment(enchant);
`,
});
});