#Attemping to remove EMC values from all items, then add custom ones to a select handful:

9 messages · Page 1 of 1 (latest)

raven wave
#

I'm dtuck on the removing part. Most of the code for getting items is from Copilot as I'm not familiar with javascript as much as I am python

Here's the segment that's meant to remove then readd the EMC values

ServerEvents.tags('item', event => {
// adds all items in game to a tag for EMC value removal
    let all = "*";
    event.getAll().forEach(item => {
        if (all.test(item.id)) {
            event.defaultPrevented('pack:all_items', item)
        }
    })
// adds all chemlib periodic table elements to an array to have EMC values added later.
    let elements = "chemlib:*";
    let underscore = elements.split("_");
    let elementsArray = [];
    event.getAll().forEach(item => {
        if (underscore[0].test(item.id)) {
            elementsArray.push(item)
        }
    })
})
ProjectEEvents.setEMC(event => {
    // sets the absolute emc value of an item
    event.setEMC("#pack:all_items", 0) // alias. setEMCAfter
})
plucky beaconBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!

quiet reefBOT
#

Paste version of server.log from @raven wave

#

NEVER use any AI to generate KubeJS code. They currently know very little about it, and what they do know is often outdated or false. You can instead look at the KubeJS wiki or ask for help in #1047320998199955458.

half orbit
#

To achieve this I recommend setting all crafting Mapper config option in the mapping.toml file to false (See Image)
after that modify the last few items which you want to change the emc of with /projecte setemc or /projecte removeemc

#

No kubejs required

raven wave
#

ok that actually helps a lot

plucky beaconBOT
#

Ticket closed!

half orbit
#

sorry for reopening, but if you also set these configs you will get even less items with emc