Skip to content

Instantly share code, notes, and snippets.

@Lothrazar
Created August 31, 2022 07:52
Show Gist options
  • Save Lothrazar/8e2feb95b390cf0bb2a63ebb16dc9f25 to your computer and use it in GitHub Desktop.
Save Lothrazar/8e2feb95b390cf0bb2a63ebb16dc9f25 to your computer and use it in GitHub Desktop.
CauldronInteraction water recipe
private void setup(final FMLCommonSetupEvent event) {
event.enqueueWork(() -> {
CauldronInteraction WASH_PEEL = (state, level, pos, player, hand, stack) -> {
if (stack.is(Items.POTATO)) {
//replace all the item, be generous. we could instead stack.shrink and drop just one
player.setItemInHand(hand, new ItemStack(PotatoModRegistry.PEELED.get(), stack.getCount()));
LayeredCauldronBlock.lowerFillLevel(state, level, pos);
return InteractionResult.sidedSuccess(level.isClientSide);
}
return InteractionResult.PASS;
};
CauldronInteraction.WATER.put(Items.POTATO, WASH_PEEL);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment