Invisible Enchantments and custom damage

Discussion in 'Archived: Plugin Requests' started by Prophettt, May 31, 2013.

  1. Offline



    I know this is possible but I'm not finding a plugin that can do this.
    I need a plugin that can add an enchantment to an item (ex: sword) and it won't say it in the lore so it becomes invisible.

    Also I need a plugin that can make it so an item does custom damage. For example a sword does 20 damage (10 hearts) at once, etc.

    Thank you

    No one that knows this?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: Jun 1, 2016
  2. Online

    timtower Administrator Administrator Moderator

    Zarius, is OtherDrops capable of doing this?
    Ultimate_n00b likes this.
  3. Offline


  4. Offline


    This adds a lot of lore though.

    You would kinda need enchantments recoded to do that..
  5. Offline


    The only way I can see this being possible is having a custom name for the item. For example, if you had a diamond sword that you wanted to deal 10 damage, you would need to name the diamond sword to something else such as "Diamond Sword of the Dragon!"

    This would be required, because a plugin like this would look for the item name and change the damage event whenever an item with that name is being used. This also opens up gateways for players to create the weapon themselves through an anvil, and that is why lore is so important.

    Players can not create lore with anvils, but they can change the name to match the plugin's keywords. (I'm not sure if the color of the name effects a plugin's search or not.) It would be quite hard to limit people from creating the items they are not supposed to have without some type of keyword lore.

    But this is what I could see: Permission nodes that effect the damage output of a weapon. For example, damage.<itemname>.<damageamount> would specify the amount of damage that item does, and it keeps players that aren't supposed to have that damage output from having it because they won't have the permission node.

    Also, if you want to configure the damage output of a diamond sword on your server, I know there has to be a plugin out there for it, but I'm not sure if you could change the damage based on your specifications with the current plugins available.
    Maulss likes this.
  6. add a potion effect (Strength)
    best I can think of
  7. Offline


    timtower - yeah, could probably do some of it with OtherDrops. And keeping it invisible (not sure why you'd want to...)

    ##### FIRE_ASPECT
    toolDIAMONDSWORD~&0&rDiamond Sword
    ##### Extra 20 damage
    toolDIAMONDSWORD~&3&rDiamond Sword
    toolDIAMONDSWORD~&1&rDiamond Sword
    5  # add an additional 5 damage
    toolDIAMONDSWORD~&1&rDiamond Sword
    5  # add an additional 5 damage
      ##### DAMAGE_UNDEAD
    toolDIAMONDSWORD~&2&rDiamond Sword
    5  # add an additional 5 damage
    As slimedog007 noted - a problem with displaynames is that items can be renamed at an anvil. They cannot be given color codes however, so the color code (eg. &1&r) at the start of each of those names is like a "key". &r resets the color so you can have as many numbers before it as you want (eg. &1&6&4&rDiamond Sword) and it'll still appear as a normal diamond sword.
  8. Offline


    It would be possible to add invisible enchantments without doing any sort of custom naming/loring, but it'd be reaaally tough and probably server intensive. You'd have to track a weapon through every inventory change, every drop, every location change, and then if it ends up in someone's hand when they hit something it does the effect. One small bug and it loses its "enchantment".

    The other thing you could do is assign "enchantments" to damage value ranges and then make the items repair themselves back to the assigned damage value every time it an event happens that would do damage to the sword. Unfortunately, this would mean that the damage value can't be used for anything else, including damage, unless you get veeeerry clever with the code and break the item when it reaches the bottom of the range. Of course, the enchantment wouldn't be truly invisible, you could always look up what each damage value range means, but it's at least interesting.

    I even wonder if you could do it so that, say, every even damage value does one effect and every odd damage value does another one, and then have all actions have a half chance of not doing any damage to the and a half chance of doing two damage to it. Of course, even this wouldn't be invisible if the player checked the damage remaining on their sword with F3+h.

    As a note, no way am I touching this in terms of actual code. Waaay beyond me. @_@
  9. Offline


    Hedgehogs4Me - why bother with all that :) You can rename items to "&6&4&6&8&rDiamond Sword" with as many numbers as you want in front of the &r and it still looks like a diamond sword - voila, invisible :)

    You could then use that invisible name to apply effects at the appropriate places rather than trying to track the specific weapon or using durability values.
    Hedgehogs4Me and AndyMcB1 like this.
  10. Offline


    Holy crap, I looked at your previous post and found what you just said underneath your OtherDrops configging - I saw that part and assumed the entire thing would be about OtherDrops. It turns out, you made a fool out of me. :p

    I have a really tight deadline to meet (my posts on here are my breaks! I'm very bad at relaxing), but I could probably get on this by late June or early July if no one's done it already.
  11. Offline


    Hedgehogs4Me - no worries, the previous bit was tucked away under my example so I can see why it'd be missed :)

    Good luck with your deadlines :)
    Hedgehogs4Me likes this.
  12. Offline


    Zarius Your idea was very brilliant :) I did not think of this at all.
  13. Offline


    Isn't there metadata for ItemStacks? Just to get the italics gone :)

    Edit: Or could you remove the italics of an item by applying §r to it?
  14. Offline


    whitehooder - what italics? My items (enchanted or not) don't seem to have italics, but yes - §r should reset (remove) the italics as well as the color.
  15. Offline


    Whenever I rename items (in-game using an anvil) I get the text in italics.
  16. Offline


    whitehooder - ah, didn't noticed that. Most of the time I use renamed items is through OtherDrops in which case the name comes out without italics, unless you specifically add the italics color-code.
  17. Offline


    Okay. Good to know, thank you :)
  18. Offline


    What about .setData()? 1 would be sharpness, 2 would be ...(using minecraft enchantment ids) and &13&r at the beginning with a Data of 1 would be sharpness 13?
  19. Offline


    Some items (if wanting to enchant saplings and etc xD) use the data for other purposes. Does anyone know if ItemStacks have MetaData?
  20. Offline


    whitehooder ItemStacks have metadata. We can start the data around 20 so nothing uses it.

Share This Page