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.

x1a0

Members
  • Joined

  • Last visited

  1. Got the same problem and resolved by putting texture files under forge's resources folder rather than the mod project's. However is there a better way?
  2. Hi all, greetings from a newbie in MC modding I am writing a mod which adds repeating crossbow to MC. The plan is when user holds right mouse button it should shoot repeatly with a certain interval - until user releases the key. As the first step I created a class which extends Item class, put it in tabCombat. I copied essential methods from ItemBow class to make it work same as a bow - till here everything works fine. Then, I need a way to remember the status of a crossbow. i.e. it needs to know it is on fire. So I decided to use NBTTagCompound: This is added at the beginning of onItemRightClick method. It's in Scala. What it does is if par1ItemStack doesn't have a tagCompound then create a new one for it. Then set "shooting" tag to true. println("ON ITEM RIGHT CLICK") Option(par1ItemStack.getTagCompound).getOrElse { par1ItemStack.setTagCompound(new NBTTagCompound) } par1ItemStack.getTagCompound.setBoolean("shooting", true) .... And this is added at the beginning of onPlayerStoppedUsing. It just resets shooting tag. println("ON PLAYER STOPPED USING") par1ItemStack.getTagCompound.setBoolean("shooting", false) Then something strange happened... Before I added this tagCompound thing, while holding right mouse button on my item, both onItemRightClick and onPlayerStoppedUsing methods are called twice (one for client and one for server I guess?). But after I added it, onItemRightClick is called 4 times while onPlayerStoppedUsing is still called twice. In the game UI I can also see that my item is used twice rather than once like before. And the first time happens very quickly - it's like I first click (press and release) the right mouse key then hold it again. I don't understand why does this happen... Thanks for reading and any help would be appreciated

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.