Compass needle spins only in lower half randomly in the End and Nether
The bug
In the End and the Nether the compass needle is supposed to spin randomly. In 1.8 it spun all the way around, but since then it only spins in the lower half of the compass and very rarely some pixels above.
How to reproduce
- Open Minecraft 1.8 and enter the Nether with a compass in your hotbar
The needle spins all the way around - Open a newer version of Minecraft and enter the Nether with a compass in your hotbar
The needle spins only in the lower half
Fix is attached (fixes the wobble function by properly keeping the angle values in range)
Linked Issues
relates to1
Created Issue:
Compass needle spins only in lower half randomly
The bug
In the End and the Nether the compass needle is supposed to spin randomly. In 1.8 it spun all the way around, in the latest snapshot versions it only spins in the lower half of the compass and very rarely some pixels above.
How to reproduce
- Open Minecraft 1.8 and enter the Nether with a compass in your hotbar
The needle spins all the way around- Open a snapshot version of Minecraft and enter the Nether with a compass in your hotbar
The needle spins only in the lower half
relates to
Attaching a javascript demo of a possible fix.
If you open the file in a browser, you'll see on the left, the broken version, and on the right, the working version.
On line 63 of the html file, the fix is indicated:
if( diff > Math.PI ){
diff = diff - Math.PI*2
}In english: If the difference between the "new random angle" and the "current angle" is more than a half-turn away, instead proceed around the circle in the other direction.
You would put it inside the wobble() function, just before the call to MathHelper.clamp_double(), on the equivalent of where line 66 of ItemCompass.java is, from MCP 9.28.
Cheers!
The bug
In the End and the Nether the compass needle is supposed to spin randomly. In 1.8 it spun all the way around,
in the latest snapshot versionsit only spins in the lower half of the compass and very rarely some pixels above.How to reproduce
- Open Minecraft 1.8 and enter the Nether with a compass in your hotbar
The needle spins all the way around- Open a
snapshotversion of Minecraft and enter the Nether with a compass in your hotbar
The needle spins only in the lower halfThe bug
In the End and the Nether the compass needle is supposed to spin randomly. In 1.8 it spun all the way around, but since then it only spins in the lower half of the compass and very rarely some pixels above.
How to reproduce
- Open Minecraft 1.8 and enter the Nether with a compass in your hotbar
The needle spins all the way around- Open a newer version of Minecraft and enter the Nether with a compass in your hotbar
The needle spins only in the lower halfFix is attached (fixes the wobble function by properly keeping the angle values in range)
is duplicated by
Attached is a javascript demo of a possible fix for the compass, which also fixes MC-95460.
Code examples refer to (and the demo is based on) MCP 9.28.
It rewrites the ItemPropertyGetter in ItemCompass to bring it in line with the one in ItemClock (removing extra conversions to/from 2*PI), while keeping all the angle variables within range using MathHelper.positiveModulo.
Specifically, here, the needle flips as the player rotates / moves because the this.rotation is not being kept in range; the fix here is to apply MathHelper.positiveModulo to this.rotation after updating this.rotation, within the wobble function, rather than simply applying positiveModulo on the returned value of the wobble function.
The Bug
In Minecraft 1.20.4, and likely other versions, the needle on the compass item spins randomly in both the Nether and the End dimensions.
How to Reproduce
- Enter the End or Nether dimension
- Obtain a Compass item
- In both the inventory and held item view, the clock's needle will spin randomly
Likely Explanation
In Minecraft, the compass points to the world spawn point, unless changed otherwise. In the dimensions besides the Overworld, there is no spawn point; you get there through portals, not dying. As there is no actual spawn point, it is likely that the compass is unable to find where to point and just points randomly.
Notes
- A similar report has been reported (
MC-95460)- Marked as Fixed as of 1.11+
Thank you for your report!
We're tracking this issue in MC-95460, so this ticket is being resolved and linked as a duplicate.
If you would like to add a vote and any extra information to the main ticket it would be appreciated.
If you haven't already, you might like to make use of the search feature to see if the issue has already been mentioned.
Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki
– I am a bot. This action was performed automatically! The ticket was resolved by one of our moderators, and I left this message to give more information to you.
Still happens in 16w04a.
Still happens in 16w07a.
Affects 16w07b.
Affects 1.9 Pre-release 1.
Affects 1.9.1 Pre-release 1.
Affects 1.9.4.
Affects 16w20a.
Affects 1.10.
Attached is a javascript demo of a possible fix for the compass, which also fixes
MC-83905.Code examples refer to (and the demo is based on) MCP 9.28.
It rewrites the ItemPropertyGetter in ItemCompass to bring it in line with the one in ItemClock (removing extra conversions to/from 2*PI), while keeping all the angle variables within range using MathHelper.positiveModulo.
Specifically, here, the needle is restricted to one side because the wobble function uses clamp_double to attempt to keep an angle variable in range, when MathHelper.positiveModulo would be more appropriate.
Why isn't that issue community consensus?
Can confirm as well, if that helps...