Enchantment Control?

Discussion in 'Archived: Plugin Requests' started by jazzman170, Dec 20, 2012.

  1. Offline

    jazzman170

    Is it possible at all to have a plugin that control's the Percentage chance of gaining an enchantment? I hate how Mojang keeps fucking over the survival servers with economy's by making enchantments even MORE easy to get! In this latest version of MC now fortune comes so EASILY! And getting a high end durability and efficiency has never been so easy! I enchanted 3 picks right off the bat. 2 of them were fortune 3. and the third one was fortune 3, durability 3 and efficiency 4.

    Im very dissapointed with this as i want my items like diamonds and such to not get flooded from players using the now easy to get fortune pics. Not to mention i want the market for rare enchanted picks and such to STAY rare! I block anvils on my server to help combat easy to get enchants and god armor/weps/tools.
     
  2. Offline

    jazzman170

  3. Offline

    mncat77 Retired Staff

    It is possible but if you want a plugin be a little more specific please. Per level and material what percentage how would that be configured etc...
     
  4. Offline

    jazzman170


    Just a config file that has all enchants with a % rate, for example:

    Durability1: 25%
    Durability2:20%
    Durability3:15%

    Efficiency1: 35%
    Efficiency2:30%
    Efficiency3:25%

    Smite: 25%
    Fortune: 5%
    Silktouch: 2.5%


    Having all enchants listed like so and with a % rate so when a player enchants, he will get all the enchants from above at those chances.
     
  5. Offline

    mncat77 Retired Staff

    So that would mean a level 1 enchant would give the same enchantments as a level 30 enchant... Sure you want that? :D
    Also would you want custom max enchant levels? (e.g. lvl 45 -> smite 6 or something like that)?

    I would suggest something like -0.01(level-2)^2+0.2 or something like that for the probability including the level (that could maybe be efficiency 1 or something like that)...
     
  6. Offline

    jazzman170

    Ya i would still want it so higher exp you spend, better/more enchants you can get, i have NO idea how to use or setup a system like that (in terms of explaining it) Do you have any idea? I want things to basicly still work like the default system but i just want to make the more rare enchants MORE rare.

    For example, you could just make the plugin just effect silk touch and fortune. As long as i can make those enchants much more rare , i would be quite happy.
     
  7. Offline

    mncat77 Retired Staff

    If you just want that I could just replace silk / fortune enchants with a chance to something else. That would be coded in a few minutes ^^...
     
  8. Offline

    jazzman170

    ya, but i still want silk touch and fortune to be possible to get. Not sure if you noticed but in the recent update, silk touch and fortune are super easy to get. i want them back to how they were before the 1.4.6 update. in 1.4.5 they were perfect.

    on my server i have anvils blocked from being used, so players cant stack their enchants so now i just need to fix the problem of silk touch and fortune being way too easy to gain from enchatning.
     
  9. Offline

    mncat77 Retired Staff

    Code:java
    1. @EventHandler(priority = EventPriority.HIGHEST)
    2. public void onItemEnchant(EnchantItemEvent event)
    3. {
    4. for(int i=0;i<=event.getEnchantsToAdd().size();i++) {
    5. if(event.getEnchantsToAdd().containsKey(Enchantment.SILK_TOUCH) && new Random().nextInt()<60){event.getEnchantsToAdd().remove(Enchantment.SILK_TOUCH);}
    6. else if(event.getEnchantsToAdd().containsKey(Enchantment.LOOT_BONUS_BLOCKS) && new Random().nextInt()<60){event.getEnchantsToAdd().remove(Enchantment.LOOT_BONUS_BLOCKS);}
    7. }
    8. }


    I guess this would work? (40% chance to get the enchantment silk/fortune and 60% to loose it after minecraft has given it to you already)
    BTW: I don't think enchantment changed from 1.4.5 to 1.4.6....
     
  10. Offline

    jazzman170

    im confused as to wha tyou mean by that haha. Also how can you have NOT noticed the massive jump in how EASY it is to get fortune and silk touch in latest update from 1.4.5 to 1.4.6? ITs so damn noticeable its rediculous if you havent noticed it! lol. A player enchants a pick and they get like almost all enchants at max level, includeing fortune!

    Its pissing me off i want to punch jeb in the damn face.
     
  11. Offline

    mncat77 Retired Staff

    They didn't change anything :confused: . Where is evidence that there is? They would have said that in the update news...
     
  12. Offline

    jazzman170

    they did :p


    Minecraft 1.4.6

    * Added fireworks
    * Added enchantable books
    * A lot of enchantments have been tweaked
    * A Christmas surprise
    * Added option to enable touchscreen input for buttons and inventory
    * Many issues have been fixed!
     
  13. Offline

    mncat77 Retired Staff

    Yeah, they tweaked stuff like fireprotection proj. prot. blast prot. and normal protection...
     
  14. Offline

    jazzman170

    they also tweaked silk touch and fortune, they are a but TON more common and no longer rare. I gave a guy 200 levels of exp today and he enchanted 4 picks. 3 of those picks had fortune 2 and fortune 3 on them. As well as durability 2 and dura 3, and efficiency 4.

    Its rediculous, if i dont fix this soon its going to destroy my economy. I beg of you please help me if your able.

    edit: Silk touch is still more rare then all the others, but it still much easier to come by now.
     
  15. Offline

    mncat77 Retired Staff

    The code above in a plugin should fix it ^^.
     
  16. Offline

    jazzman170

    i see, care to explain how it works to me? :3

    edit: Also, i dont know where to begin on how to save it as a jar haha, just save as and name it .jar ?
     
  17. Offline

    mncat77 Retired Staff

    Here you go...
    Just rename the .txt to .jar...
    License: GNU General Public License (GPL) v3.0

    Source:

    Code:java
    1. package me.mncat77.rareenchantments;
    2.  
    3. import java.util.Random;
    4. import org.bukkit.enchantments.Enchantment;
    5. import org.bukkit.event.EventHandler;
    6. import org.bukkit.event.EventPriority;
    7. import org.bukkit.event.Listener;
    8. import org.bukkit.event.enchantment.EnchantItemEvent;
    9. import org.bukkit.plugin.java.JavaPlugin;
    10.  
    11. public class RareEnchantments extends JavaPlugin implements Listener {
    12.  
    13. @Override
    14. public void onDisable() {
    15. }
    16.  
    17. @Override
    18. public void onEnable() {
    19. getServer().getPluginManager().registerEvents(this, this);
    20. }
    21.  
    22. @EventHandler(priority = EventPriority.HIGHEST)
    23. public void onItemEnchant(EnchantItemEvent event)
    24. {
    25. for(int i=0;i<=event.getEnchantsToAdd().size();i++) { // Don't mind this loop it's useless and just eats up capacity
    26. if(event.getEnchantsToAdd().containsKey(Enchantment.SILK_TOUCH) && new Random().nextInt()<60){event.getEnchantsToAdd().remove(Enchantment.SILK_TOUCH);}
    27. else if(event.getEnchantsToAdd().containsKey(Enchantment.LOOT_BONUS_BLOCKS) && new Random().nextInt()<60){event.getEnchantsToAdd().remove(Enchantment.LOOT_BONUS_BLOCKS);}
    28. }
    29. }
    30. }
    31.  
    32.  
     
  18. Offline

    jazzman170

    every time i paste it in the document of notepad or even notepad ++ it messes up the way its lined -.-

    i have tried 5 times now lol wtf.
     
  19. Offline

    mncat77 Retired Staff

    no don't open it just change .txt into .jar....
     
  20. Offline

    jazzman170

    that doesnt make any sense :p. I copy and paste your text into notepad and save it as .jar, but all the code is on the same line. I even save it as .jar and run it but it errors upon starting server.

    Did you give me a file to save that im not seeing?
     
  21. Offline

    mncat77 Retired Staff

    Try again... Don't open it just rename the extension... (Changed to .zip shouldn't show up raw but as file I hope)
     
  22. Offline

    jazzman170

    lol no your not understanding. Is there a file that you posted somewhere? cause thats how you talking :p Like there is a file im sapposed to download from you and just save it as .jar, but im only seeing that code you posted. I can only copy and paste that into notepad. There is no save as or download button anywhere :p

    Im completely confused here :p
     
  23. Offline

    mncat77 Retired Staff

    I attached a file to my post....
     
  24. Offline

    jazzman170

    there is no file anywhere :p
     
  25. Offline

    mncat77 Retired Staff

    forums.bukkit.org/attachments/rareenchantments-1-0-zip.12107/
    I attached that lol...
     
  26. Offline

    jazzman170

    ok got the zip file now, but ya it wasnt anywhere in any of your post lol. not sure what happend

    haha another problem. Its a .zip, so what do i do now? i cant save it as a .jar, cause its still a zip/rar file. If i open it up with notepad, just a bunch of jibberish code lol. What must i do now? :p

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 30, 2016
  27. Offline

    mncat77 Retired Staff

    rename it to .jar....
     
  28. Offline

    jazzman170

    i did, now its name is .jar, and its a winzip or winrar file :p renaming it to .jar has changed nothing, it did not change to a jar file.

    see for yourself :p Rename the one you have to enchants.jar and it continues to stay a .zip.

    oh great you gave up on me -.- just want to let you know its not my fault, i have done everything correctly, something with your file isnt right.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 30, 2016
  29. Offline

    mncat77 Retired Staff

    What is the problem with renaming it to a .jar? I can't upload .jars on the bukkit forums...
     
  30. Offline

    jazzman170

    heres what i did.
    1. download your file and saved it to desktop
    2. renamed it from its name to enchants.jar
    3. its still a zip file, renaming it to enchants.jar makes it enchants.jar.zip

    its not making it a jar for some reason.
     

Share This Page