It's pretty simple in thought. Mobs have a chance to drop enchanted armour, tools, or weapons. The plugin would do math to calculate the chance of dropping an item with 1 or more enchantments. Of course, it would be possible to get a sword with 4 enchantments, it would just be SUPER rare, unless otherwise set in the config. And THAT is my idea. -Caid.
i like that idea, perhaps could you give some ideas about how the plugin should calculate the enchantments like give some examples? would take it
I hadn't thought about how they would be calculated, until you asked. I just had the basic idea to have it happen. But now that you ask, I think that some basic rules the plugin could follow could be mob type and depth would affect probability. At or above sea level would have a higher chance of wood tools and weapons, as well as leather armour. There would be a low probability of iron, even lower of gold, and extremely low amount of diamond. A player would able to pick up wooden tools and weapons, pretty commonly, as well as pieces of leather armour, though they chance that they have an enchantment on them would be lower. This would make finding an enchanted piece, a lucky and meaningful event. Another possibility would be that some items would have an enchantment on them, and also have an extra slot for another enchantment. This means they could be enchanted again, or even again and again if there were more slots. I suppose it would be a bit more work to make that possible, but basically, the item would for example say Bane of anthropods empty slot empty slot meaning it has two empty slots. If the player enchants it, and only one enchantment is added, there would still be one slot left. If the table puts on two enchantments, both slots would be full. And if the table tried to put in three enchantments, the item would have 4 enchantments. Back to the basics of it, deeper depth would mean higher chances for better items. This is not to say that one should expect diamond tools a huge percentage of the time because they are near bedrock. It just means they're going to have much better odds than being at surface. Once could say that the depths of ore occurrence would be relative to the depths of greater likelihood of getting a tool or armour of that type. The plugin could be made to roll on the drop type. To do calculations similar to those done by other rpg games with unique drops. I believe they use a dice system, though the particulars, I'm not exactly sure. http://www.anwu.org/games/dice_calc.html here's a web based calculator which rolls dice. It presents something that is the right idea for behind the scenes calculations. To get a better idea of calculating, though, I recommend looking at examples of currently available mobdrop plugins. I think there is at least one, though it just rolls on normal items, nothing enchanted or anything. The roll would determine if an item was to be dropped first. Then which quality (iron, gold, diamond, leather(armour)) and then enchantment + any empty slots (possible but not certain). Once it finishes the first set and first enchantment calculation, it would run another calculation with a 1/100 (definable by plugin dev) chance of doing another randomly chosen applicable enchantment. We could even have the player's current experience level play a factor in the plugin's choice of enchantment level or type. So, when it rolls a positive on enchantment, the plugin uses the enchantment table mechanic to enchant the equipment, and according to the player's level, but doesn't remove the exp from their person. The plugin will also be certain to only choose a single enchantment, and then re-roll for additional enchantments with modifiers affected slightly by depth and possibly even mob type. This would mean that they would be better off saving up experience and adventuring with lots of levels under their belt, also increasing the risk of losing them upon death. This higher exp level would not increase the chances of getting an item, either plain or enchanted. And it would not increase the chances of their item getting enchanted, if the plugin calculated a positive equipment drop. It would only effect the highest possible level of enchantment on the item. It would also not cause any difference in the roll for empty slots which would take place during equipment generation. All of these calculations would occur pretty much instantly, as the math is pretty simple for the plugin, so it could even be decided on first striking the mob, and ready to drop as soon as they die. Or it could happen as they die. Doesn't really matter. Well, that's it for now. 1am and I'm ready for bed. I hope that makes things a lot more clear. -Caid.
After looking at ecocreatures, running it, and seeing the way it works, I'll admit it is very similar. It isn't, however, as concise or flexible as the idea I have. If you re-read what I've written, you'll see that I don't wish for a plugin with predetermined item drops. I'm thinking of a plugin with the ability to generate its own enchantments upon mob death. I like a lot of the configuration options available in ecocreatures, like time of day for drops and all that, but again, it's not quite the same thing at all. While they both provide drops, eco's items (and enchantments) are all set, where my idea is all random. The work of eco creatures does, however, make my idea seem much more plausible. If the code was altered heavily, and the generation portion was added to the code, it would be one and the same. -Caid.
@Caid Your idea with having extra slots is not possible in my opinion, but the rest is likely doable and why not? You could create a spreadsheet which contains height/mob and the dropchance of each item, this would help much!