The Veggie Way [FABRIC]

The Veggie Way [FABRIC]

503k Downloads

[1.18.2] [SUGGESTION] Add dehydration support

Sunconure11 opened this issue ยท 8 comments

commented

Just what it says on the tin. Can be done via tags.

commented

I think this is best handled by data packs that wish to support it.

commented

Looks like the mod already provides tags for players to create a datapack for fluid support.

commented

I was referring more to the items and such

commented

you can add any items to the Dehydration mod you want via a datapack.

If I add them to the my mod and Dehydration is not present, it will cause errors.

The point of the tags is to make things mod independent

Welcome to the new world of data-driven modding!

commented

Hm, I'm noticing a thing. You don't need to use tags to have support. After talking with a specific dev, I think you might just need to define specific things in your drink item's class. Let me look a little further as to find how this is done.

commented

Try defining the actions for your drinks as well, drinking.

public UseAction getUseAction(ItemStack stack) {
    return UseAction.DRINK;
}

Try adding this to said classes and see if it works. Dehydration has it's own sound for drinks, so it should give you a sound cue if it is working.

commented

Many of my foods do not use individual classes, because they are not needed. I just extend Item and attach food attributes to them.

For drinks, I just use a DrinkBase class for all drinks and it has the UseAction.

I have getUseAction() defined in my DrinkBase class and I then just extend DrinkBase on any class that needs it, reducing dup code.