Apotheosis

Apotheosis

78M Downloads

Splitting enchanted books is unreliable

Darkere opened this issue ยท 5 comments

commented

Sometimes the book does not get split. Sometimes it does. I am unable to figure out a pattern that would apply for either of the cases.

There seems to be a chance for the book to get voided entirely.

Unbreaking enchant on the anvil seems also somewhat unreliable but that is chance-based I imagine.

commented

Splitting only has a 20% chance per level to split the book (but will always damage the anvil)
The vanishing of the book, however, is not intentional...

commented

Yeah looking at the code I see that it is chance based... annoyingly.

if (world.rand.nextInt(Math.max(1, 6 - split)) == 0)
not sure where the 20% chance per level is supposed to come from though.

commented

16% for 1, 20%, for 2, 25% for 3, 33% for 4, 50% for 5 and up.

commented

java rand is exclusive on the top bound, rand(1) returns 0 in all cases

commented

Ah so it's 20%, 25%, 33%, 50%, 100%. Still no 20% per level but much better than what I had. Thx I missed that.