If I enchanted a sword with a level thirty enchantment what chance would i have to get fire aspect I or II or sharpness V, is it a definite or is it unpredictable?
It is not predictable what enchantments you will get but at certain enchantment levels, you will get some enchantments with a higher probability. This chart shows the probability for diamond tools:
Also, the Minecraft Wiki can give you the algorithm Minecraft uses for calculating enchantments. It is pretty complex and you really don't need to get into it, but it is definitely interesting: How Enchantments Are Chosen
The minecraft wiki offers a very detailed description of what enchantments you'll be able to get but the short version is:
- Do some math to calculate a modified level.
- Build a list of the possible enchantments and what levels they are (here it is determined whether you'll get Sharpness IV or V).
- Pick an enchantment from the list with a weighted chance. (see this page for a list of weights)
- 1 Divide the level by half and round it down.
- 2 Decide to keep going with a chance of ((level + 1)/50) in 1.
- 3 Remove all conflicting enchantments (no silk touch and fortune on the same thing)
- 4 Pick a possible enchantment and apply it
- 5 Go to step 1
With regards to Sharpness and Fire Aspect, Sharpness is pretty likely (about 1 in 3 chance of it being applied the first time), however it conflicts with the other damage enchantments (Smite and Bane of Anthropods) for which you also have about a 1 in 3 change of them getting picked (either one being picked is 1 in 3).
Fire aspect is less likely, it only has a 2 in 29 chance of being applied as the first enchantment.