Farmer's Delight

Farmer's Delight

97M Downloads

[1.18.2+ mod compat request] Spice of Life: Carrot & Sweet Potato compatibility

tarinoita opened this issue ยท 1 comments

commented

Hello, thank you for the mod! It is, indeed, delightful.

I'd like to request that you fire a LivingEntityUseItemEvent.Finish each time a player successfully eats directly from a placed food block (PieBlock), but with the item on the event being the corresponding slice rather than the whole pie item. So for example, each time a player successfully eats from a placed Apple Pie block, there would be a LivingEntityUseItemEvent.Finish fired that specifies the Player and the Apple Pie Slice item.

This would improve compatibility with "Spice of Life: ___ Edition" mods, which subscribe to that event in order to track which foods each player has eaten. (Sweet Potato Edition here, Carrot Edition here.) Currently, neither one will recognize food eaten from a placed block at all, including vanilla Cake, but I plan to change this soon for Sweet Potato Edition.

In the meantime, I believe I can add compatibility within Sweet Potato by listening for the PlayerInteractEvent.RightClickBlock and independently computing whether the player can eat from the block or not, but I think the event makes the most sense long-term. Or if you have a better idea, I'm open to suggestions!

I've specified 1.18.2+ because that's all I really care about, but Carrot Edition goes way back, so compatibility could still be worthwhile for earlier versions of FD, if you're up for it.

Thanks for considering!

commented

Hello! Sorry for the long delay; your issue caught me during a hiatus. ๐Ÿ˜…

Although this event call makes sense from a gameplay standpoint (biting a pie is functionally the same as eating the slice item), after asking other modders, calling this specific event would (probably) not be a good practice here, as it could cause unintended behaviors when mods cancel/change it, since it's not a literal item usage action.

The ideal scenario here would be for my mod to launch its own event, explicitly for when a block is "eaten", or rely on a block interaction event somehow. If this were to be added, it would need to be a major integration, and planned more carefully. :(

I'll move this issue to Discussions, so we can compile details on how to do this, if it ends up happening. ๐Ÿ‘