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.

SteriCraft

Members
  • Joined

  • Last visited

Everything posted by SteriCraft

  1. Thank you for you quick and efficient answer ! I searched for a method like the one you suggested and found shouldCauseReequipAnimation(). I overrided it with return false; and now it works ! For the people who would have the same problem, there is the full overrided method :
  2. Hi everyone ! First of all I'd like to apologize about my English, I'm French and I don't speak English fluently yet. Also, I'd like to add that I began coding with Minecraft Forge 4 days ago, although I have a good experience with Java. My problem lies in the onUsage() method of a custom item I made, a simple dosimeter that mesure the irradiation dose that the player get by being exposed to radiation sources. In that method, I use the item NBTTagCompound to store the radiation measure made by another item (a geiger counter) and the irradiation related. I perform (successfuly) the following calculation : irradiation += radiationMeasure. In the code, it looks like this : Even if the calculation is correctly executed and the mathematical behavior matches my expectations, I have a sort of "bug" or strange behavior in the item. Indeed, my item moves continuously as if it was right-clicked on a block every tick. To show you, I recorded a short video that I posted on my Youtube Channel : https://www.youtube.com/watch?v=CsxCDbUtz7U To identify the problem, I tried to store each NBTTagCompound double value in an independant standard Java double variable, and then performed the calculation as follows : I also tried to perform the operation in a third double value, and to set the "irradiation" value from that variable. As you can guess, I didn't change anything. Concerned by this very weird problem, I tried to perform a simple c = a + b operation in the method without assigning any NBTTagCompound with the result, just as I would do in a simple Java console program, and then of course the movement stopped (as the item NBTTagCompound values weren't modified). Here is my full ItemDosimeter.java file : Does anyone of you have an idea why that happens ? And possibly a solution ? Thank you for reading, and sorry if I missed a post in the past that talked about this problem already. As I said my English isn't perfect yet and maybe I didn't search for the right thing before to post. SteriCraft

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.