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.

JHPrime

Members
  • Joined

  • Last visited

  1. Thanks, that worked! For future askers: The signature to override is public boolean isCrossbow(ItemStack stack) This needs to be overridden because Minecraft's Item class checks if an itemStack is a crossbow by asking if the stack's Item is the Crossbow.
  2. I'm trying to make a musket, but while working on the loading logic I ran into some trouble - the item gets used in a loop, making onPlayerStoppedUsing get called with a bad time left in the use. Since I based my code on the Crossbow, I tried to subclass the Crossbow directly to see if I was doing something wrong. But I can't subclass a crossbow and still get the same loading behaviour as a crossbow - here's my code for the subclassed crossbow: package ca.zootron.totalwar.common.item; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.CrossbowItem; import net.minecraft.item.ItemStack; import net.minecraft.util.ActionResult; import net.minecraft.util.Hand; import net.minecraft.world.World; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; public class MyCrossbow extends CrossbowItem { private static final Logger LOGGER = LogManager.getLogger(); public MyCrossbow(Properties propertiesIn) { super(propertiesIn); } @Override public ActionResult<ItemStack> onItemRightClick(World worldIn, PlayerEntity playerIn, Hand handIn) { LOGGER.debug("MyCrossbow#onItemRightClick"); return super.onItemRightClick(worldIn, playerIn, handIn); } } Why does this not have the same behaviour as a normal crossbow?

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.