Filled Set individual items as unbreakable (Do not degrade)

Discussion in 'Archived: Plugin Requests' started by Svedrigailov, Apr 23, 2013.

  1. Offline

    Svedrigailov

    Plugin category: Mech

    Suggested name: Unbreakable

    What I want: A plugin that allows an admin to make a particular item unbreakable (So it does not degrade) To be clear, It should not make all of one type of an item to be unbreakable, but only that specific item. I'd prefer it not to be done with enchantments as Unbreaking100000 on an item isn't very attractive, unless you can disguise or hide the enchantment somehow.

    Ideas for commands: /unbreakable - sets held item unbreakable​
    /breakable - sets held item breakable

    Ideas for permissions: unbreakable.use - Allows use of unbreakable and breakable commands.

    When I'd like it by: Anytime.​
     
  2. Offline

    Svedrigailov

    To the top!
     
  3. Offline

    Dunsuro

    Svedrigailov

    I'll make this for you, but I have a baseball game to go to tonight.
    In the end, it should be made by tomorrow.
     
  4. Offline

    Xerfox

    Hey...Mind if I help? I need something small like this to get me off my feet xD Thanks!
     
  5. Offline

    Svedrigailov

    You sir, are a gentleman and a scholar.
     
  6. Offline

    Dunsuro

    If you want, sure :)
    You could do the event portion while I'm gone

    My advice, (don't look if you want to try and figure it out)
    Show Spoiler


    Toy around with an event (block break perhaps)
    And see if you can figure out where something like this should go.
    Set Durability works with a short variable. (as in the date type "short")
    Code:
    p.getItemInHand().setDurability();
    


    This way, you can handle the event portion. When I come back, I will finish up the plugin and add in commands.
    Thanks for the help!
     
  7. Offline

    Xerfox

    Alright...Do you have Saros? I would love to help as soon as possible!
     
  8. Offline

    Svedrigailov

    *wipes tear* My little request... *sniffle* bringin' people together.
     
    myrrdin777 and Xerfox like this.
  9. Offline

    Dunsuro

    Xerfox
    I do not have Saros, I just assumed you would message me the code once it was done. d:
    Anyways, I'm going to resume work, so let me know if you have something
     
  10. Offline

    Xerfox

    I have run into a little puzzle here. Dunsuro would you like to add me on skype please? Skype: The_Xerfox
     
  11. Offline

    Svedrigailov

    I have a question for both of you, what makes you want to make plugins for strangers?
     
  12. Offline

    Xerfox

    I just like helping people :) Gives me a good feeling :D
     
  13. Offline

    Dunsuro

    Well, I mostly do it because it helps others and I enjoy programming. That's about it.
     
  14. Offline

    Xerfox

    On my way! Just starting now! (Adding more stuff into the code before the actually part xD Just thought I would copy and paste it in there haha.

    Code:
    package me.xerfox.Unbreakable;
     
    import org.bukkit.plugin.java.JavaPlugin;
     
    public final class Unbreakable_Main extends JavaPlugin {
    short p.getItemInHand( ).setDurability;
    }
    
    Here goes nothing :D
     
  15. Offline

    Dunsuro

    Svedrigailov

    I've basically finished the plugin, but there are a few tweaks I want to work on tomorrow
    I'm kinda tired right now, thus why I don't want to continue work tonight.

    Things I want to fix list:

    -Right now, the items want to fully repair themselves while they are unbreakable, I dunno if this is the goal, or if keeping original durability is what we want. (I assume you want to keep the tools durability stable)
    -Making items breakable again causes issues.
     
  16. Offline

    Svedrigailov

    Please take as much time as you need, I would prefer you take more time and end up with a better quality plugin. You are correct in your assumptions.
     
  17. Offline

    Dunsuro

    Svedrigailov
    Hello mate, I've finished the plugin and tested it out!

    You can download it here <Edit by Moderator: Redacted mediafire url>

    Now, it works like this.
    /unbreakable makes a tools durability go up instead of down. In the end, this makes it so that it will never break.
    /breakable makes a tools durability reset to what it was before. Making it breakable

    Aliases for the commands are, /unbreak, or /break

    Permission Node: unbreakable.use
     
    Last edited by a moderator: Nov 7, 2016
  18. Offline

    Svedrigailov

    You're amazing! Thank you so much. I'll tell my children stories about your heroism.

    [quote uid=90681987 name="Dunsuro" post=1648968]Svedrigailov
    Hello mate, I've finished the plugin and tested it out!

    You can download it here <Edit by Moderator: Redacted mediafire url>

    Now, it works like this.
    /unbreakable makes a tools durability go up instead of down. In the end, this makes it so that it will never break.
    /breakable makes a tools durability reset to what it was before. Making it breakable

    Aliases for the commands are, /unbreak, or /break

    Permission Node: unbreakable.use[/quote]


    Hey, I hope I am allowed to point out flaws. With a tool that is used to break blocks, this works great, however it does not work so well with things like armor, weapons, flint and steel, and fishing rods. Is there any way it can be changed to accommodate these?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Nov 7, 2016
  19. Offline

    Dunsuro

    Svedrigailov

    Oh, I had completely forgotten that armor and such had durability
    Haha.

    Although I'm not sure if I know how it would work on some things.
    I know I could do flint and steel and weapons.

    I can definitely try to do the fishing rods and armor, although that may be a bit more complicated.

    Done list
    -----------
    Flint n Steel - Finished (works same way as other tools)
    Weapons - Finished (works same way as other tools)
    Hoe - Finished (works just like other tools)
    Fishing Rod - Finished (works just like other tools)
    Armor - Finished (works just like the rest)
    I am done!!! :D

    Svedrigailov
    You can download the new version here!
    <Edit by Moderator: Redacted mediafire url>

    A word about armor,
    In order to make it unbreakable, you must unequip, select each individual piece, and type /unbreakable
    then you re-equip

    When you want to make it breakable, you must unequip, select each piece, and type /breakable, then re-equip.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Nov 7, 2016
  20. Offline

    Svedrigailov

    [quote uid=90681987 name="Dunsuro" post=1649419]Svedrigailov
    You can download the new version here!
    <Edit by Moderator: Redacted mediafire url>

    A word about armor,
    In order to make it unbreakable, you must unequip, select each individual piece, and type /unbreakable
    then you re-equip

    When you want to make it breakable, you must unequip, select each piece, and type /breakable, then re-equip.[/quote]

    Thank you very much! I'll give it a go!
     
    Last edited by a moderator: Nov 7, 2016
  21. Offline

    Dunsuro

    Svedrigailov
    Fantastic, let me know if there are further problems. I'll do my best to patch them up
     

Share This Page