Posted March 23, 20205 yr For the mod I recently started building I'd like to make heavy use of (potion) effects. If all effects could easily be cancelled through the use of a milk bucket, that would be pretty broken. Is there a way to change the behaviour of existing items (in general), or (specifically) make the milk bucket less powerful in any other way? EDIT: I'm currently coding for MC 1.15 Edited March 23, 20205 yr by Kombat Kitten
March 23, 20205 yr Author I have been able to completely prevent the player from drinking milk. This might not be the perfect solution, so please suggest it if you know something better. The code that prevents the player from drinking milk: @Mod.EventBusSubscriber public class EventListening { @SubscribeEvent public static void useItemStart(LivingEntityUseItemEvent.Start e) { SpellCrafters.LOGGER.log(Level.DEBUG, "start using item"); if(e.getItem().getItem() == Items.MILK_BUCKET) { SpellCrafters.LOGGER.log(Level.DEBUG, "drinking milk"); e.setCanceled(true); } } }
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.