mirror of
https://github.com/eaglerforge/EaglerForgeInjector
synced 2025-07-24 14:41:18 -09:00
Add enchant effect to the wooden axe of the worldedit mod
This commit is contained in:
parent
d2e25b28b2
commit
ceecec3478
@ -144,3 +144,30 @@ ModAPI.addEventListener("lib:libcustomitems:loaded", () => {
|
||||
});
|
||||
});
|
||||
})();
|
||||
|
||||
ModAPI.addEventListener("update", () => {
|
||||
let inventoryItems = ModAPI.mcinstance.$thePlayer.$inventory.$mainInventory.data;
|
||||
inventoryItems.forEach((item) => {
|
||||
if (item != null) {
|
||||
if (item.$getDisplayName() == 'Wand' && item.$isItemEnchanted() === 0) {
|
||||
craftResult.$addEnchantment(); // add effect to item in inventory
|
||||
}
|
||||
}
|
||||
})
|
||||
if (String(ModAPI.mcinstance.$currentScreen).indexOf('inventory.GuiCrafting') > -1) {
|
||||
let craftMatrixItems = ModAPI.mcinstance.$currentScreen.$inventorySlots0.$craftMatrix1.$stackList.data;
|
||||
craftMatrixItems.forEach((item) => {
|
||||
if (item != null) {
|
||||
if (item.$getDisplayName() == 'Wand' && item.$isItemEnchanted() === 0) {
|
||||
craftResult.$addEnchantment(); // add effect to item in crafing grid
|
||||
}
|
||||
}
|
||||
})
|
||||
let craftResult = ModAPI.mcinstance.$currentScreen.$inventorySlots0.$craftResult0.$stackResult.data[0];
|
||||
if (craftResult != null) {
|
||||
if (craftResult.$getDisplayName() == 'Wand' && craftResult.$isItemEnchanted() === 0) {
|
||||
craftResult.$addEnchantment(); // add effect to item in crafing result
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user