Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

iEviiL

Members
  • Joined

  • Last visited

  1. I made a method for filling an empty bowl with milk (a modded milk bowl item) when right-clicking a cow by handling the PlayerInteractEvent.EntityInteract event. However, seems like the method is called twice since each time that I right-click a cow two bowls are extracted and two milk bowls are added to the player's inventory. Any idea on why this happens? Here I attach the code of the method for handling the event: @SubscribeEvent public static void onRightClickBowl(PlayerInteractEvent.EntityInteract event) { if(!event.getLevel().isClientSide()) { // if the target entity is a cow if (event.getTarget() instanceof Cow cow) { // check if the target entity is an adult cow and if the player holds an empty bowl if ((cow.getAge() != -1) && event.getEntity().getItemInHand(InteractionHand.MAIN_HAND).getItem().equals(Items.BOWL)) { event.getEntity().setItemInHand(InteractionHand.MAIN_HAND, new ItemStack(Items.BOWL, event.getEntity().getItemInHand(InteractionHand.MAIN_HAND).getCount() - 1)); event.getEntity().addItem(new ItemStack(ModItems.MILK_BOWL.get())); } } } } Thanks in advance!!

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.