KubeJS-Mods / KubeJS

https://kubejs.com
GNU Lesser General Public License v3.0
297 stars 87 forks source link

Modify item groups (creative inventory) #843

Closed mageowl closed 1 month ago

mageowl commented 1 month ago

Describe the feature

It would be nice to be able to change or remove items from the creative inventory for modpacks.

Additional info

Often two mods have conflicting features (both add an iron rod), and modpack developers can use KubeJS to remove these from recipes, tags, and JEI, but not from the creative inventory without a mod like MoreCreativeTabs.

ChiefArug commented 1 month ago

This should already be possible using Forge's events via ForgeEvents, but a dedicated JS side event would be nice.

MundM2007 commented 1 month ago

You can add and remove Items from the creative Inventory like so:

StartupEvents.modifyCreativeTab('minecraft:redstone_blocks', event => {
    // Adds example item after redstone
    event.addAfter('minecraft:redstone', 'kubejs:example_item')
    // Removes redstone
    event.removeDisplay('minecraft:redstone');
})
mageowl commented 1 month ago

I didn't see that in the documentation. Thanks for the fix.