Fabric API

Fabric API

108M Downloads

Item group modifications affect the inventory item group

haykam821 opened this issue ยท 3 comments

commented
ItemGroupEvents.MODIFY_ENTRIES_ALL.register((group, entries) -> {
    entries.addAfter(Items.HOPPER, OAK_HOPPER);
});

image

commented

I can see the use case of wanting to add after only when an existing item exists, so I think something needs to be done to accomodate this better.

One idea I had would be to add some methods to allow querying if an item existis.

So this would become something like:

if (entries.contains(Items.HOPPER))
   entries.addAfter(Items.HOPPER, OAK_HOPPER);

Another option would be to add an addAfterExisting but I think the above would be more verstile.

commented

Please retest once 22w45a is out as I cannot reproduce this.

commented

Fixed with #2653