TransWikia.com

Are Minecraft enchantment values applied to items float based (and so carry fractional values over) or integer based (and so lost?)

Arqade Asked by science_1 on January 14, 2021

This seems like an important question, but different searches using different phrasings returned no matches. I apologize if it has been answered before. Here is my question.

When applying enchantments from books to items, I’ve noticed that often no level improvement is shown. For example, applying a sharpness level II to a sword with sharpness III will show no change, even though the player is charged full price in experience for the ‘upgrade’. In the most extreme example, I have a crossbow with level IV piercing and a book with level IV piercing. Placing both items on the anvil shows a cost of 35 experience, but the resulting crossbow shows as the same level IV. Would using this rare and precious book on the crossbow be wasted, or am I better off waiting until I can combine two level IV piercing books to obtain a level V, and then apply that to the crossbow? In other words, would applying the level IV piercing to the crossbow increase the float value of the enchantment (even though it falls short of the level V displayed integer) and so carry over until I can apply additional piercing enchants (say several level II’s or a level III) to reach the next full displayed integer level V, or are integer values only used, and anything that fails to reach the level V integer is wasted and lost, at the expense of exp?

One Answer

Shorts (Integers)

Enchantment levels are short integer. A short is an integer between -32767 and 32767 (inclusive). If you use a Sharpness II + Sharpness III book, nothing will happen except you will get scammed for your XP.
You can only combine the same level enchantments, it will let you combine them but the level you see there is exactly what you get, meaning if you see V that is exactly 5, not something like 5.294.

Why?

Why are is XP still taken? Probably because sometimes only one enchantment you want to combine and you don't care if you lose out on another one if the item has multiple enchantments on it.

Correct answer by Penguin on January 14, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP