Essentials PLUGIN

Discussion in 'Archived: Plugin Requests' started by CrispyLipz, Oct 19, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    CrispyLipz

    Is it possible for someone to recode Essentials? Only one part of it, see my donators get /enchant and in the guidelines for my ranks you aren't supposed to give enchanted items away. I've seen this done before and I would like for when someone /enchant and item it adds lore onto the item with the person that enchanted its name. So lets say someone used /enchant fireaspect 2 on a diamond sword it would normal just enchant. But I would like for the /enchant to add lore to the item with like the players name as the lore. FAIL Example below \/

    ___________
    |Diamond Sword|
    |Example Name |
    ____________
     
  2. Offline

    theearlypc423

    You could probably make it so the items with /enchant have to have a certain lore and non donators can't pick up an item with that lore. I saw this on a guy's server but to be honest it's never a good idea to give /enchant
     
  3. Offline

    CrispyLipz

    Yeah, but I just started learning Java a few days ago and all this is way to complicated for me...

    And that is actually a good IDEA! Like with the lore DONATOR in dark red and non donators cant pick it up?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jul 3, 2016
  4. Offline

    theearlypc423

    Ermm find a plugin I guess bukkitdev is a good place to start.

    Yes there are plugins that can disable that. Check on bukkitdev

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jul 3, 2016
  5. Offline

    CrispyLipz

    I can't find anything like that only Item-Restrict and it doesn't support a lore tag

    And I made /enchant less OP because it has a cooldown, also the only thing I need is for a tag or lore to be applied to the item when someone uses /enchant

    So I found the source code for enchanting :) I was wondering if I can get some help with it I've tried it a couple times it fail where can I add the tag for lore when they enchant?

    Code:java
    1. package com.earth2me.essentials.commands;
    2.  
    3. import com.earth2me.essentials.Enchantments;
    4. import static com.earth2me.essentials.I18n._;
    5. import com.earth2me.essentials.MetaItemStack;
    6. import com.earth2me.essentials.User;
    7. import com.earth2me.essentials.utils.StringUtil;
    8. import java.util.Locale;
    9. import java.util.Map;
    10. import java.util.Set;
    11. import java.util.TreeSet;
    12. import org.bukkit.Material;
    13. import org.bukkit.Server;
    14. import org.bukkit.enchantments.Enchantment;
    15. import org.bukkit.inventory.ItemStack;
    16.  
    17.  
    18. public class Commandenchant extends EssentialsCommand
    19. {
    20. public Commandenchant()
    21. {
    22. super("enchant");
    23. }
    24.  
    25. //TODO: Implement charge costs: final Trade charge = new Trade("enchant-" + enchantmentName, ess);
    26. @Override
    27. protected void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
    28. {
    29. final ItemStack stack = user.getItemInHand();
    30. if (stack == null || stack.getType() == Material.AIR)
    31. {
    32. throw new Exception(_("nothingInHand"));
    33. }
    34. if (args.length == 0)
    35. {
    36. final Set<String> enchantmentslist = new TreeSet<String>();
    37. for (Map.Entry<String, Enchantment> entry : Enchantments.entrySet())
    38. {
    39. final String enchantmentName = entry.getValue().getName().toLowerCase(Locale.ENGLISH);
    40. if (enchantmentslist.contains(enchantmentName) || (user.isAuthorized("essentials.enchantments." + enchantmentName) && entry.getValue().canEnchantItem(stack)))
    41. {
    42. enchantmentslist.add(entry.getKey());
    43. //enchantmentslist.add(enchantmentName);
    44. }
    45. }
    46. throw new NotEnoughArgumentsException(_("enchantments", StringUtil.joinList(enchantmentslist.toArray())));
    47. }
    48.  
    49. int level = -1;
    50. if (args.length > 1)
    51. {
    52. try
    53. {
    54. level = Integer.parseInt(args[1]);
    55. }
    56. {
    57. level = -1;
    58. }
    59. }
    60.  
    61. final boolean allowUnsafe = ess.getSettings().allowUnsafeEnchantments() && user.isAuthorized("essentials.enchantments.allowunsafe");
    62.  
    63. final MetaItemStack metaStack = new MetaItemStack(stack);
    64. final Enchantment enchantment = metaStack.getEnchantment(user, args[0]);
    65. metaStack.addEnchantment(user.getSource(), allowUnsafe, enchantment, level);
    66. user.getInventory().setItemInHand(metaStack.getItemStack());
    67.  
    68. user.updateInventory();
    69. final String enchantmentName = enchantment.getName().toLowerCase(Locale.ENGLISH);
    70. if (level == 0)
    71. {
    72. user.sendMessage(_("enchantmentRemoved", enchantmentName.replace('_', ' ')));
    73. }
    74. else
    75. {
    76. user.sendMessage(_("enchantmentApplied", enchantmentName.replace('_', ' ')));
    77. }
    78. }
    79. }


    Can anyone help? :eek:

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jul 3, 2016
  6. Offline

    mactown21

    What you want is that you want to add item meta, to Items, instead of giving?
     
  7. Offline

    CrispyLipz

    I'm not sure what that means sorry, but what I need is when someone /enchant it tags the enchanted item with the name of the person that enchanted it. So like enchant it puts the enchantment on the item, but also with a tag. Like this [​IMG] so I can track items :) to see if donators are giving enchants away.

    Like all I need it a recoded Essentials or someone to tell me how to? I guess :/ I'm noob at Java only a few days so I will probably fail -...-

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jul 3, 2016
  8. Offline

    mactown21

    So mainly, you want it so that whatever item they got in hand, you can do /enchant and it will put the lore or name to the item? Im just trying to get things more clear, Because i can recode essentials if you really need that
     
  9. Offline

    CrispyLipz

    Yes the item you are holding for example you are holding diamond sword you /enchant sharpness 10 It does the usuall thing and puts the enchantment on the item BUT with the name of the person that enchanted it Like the image

    The lore would be the players name

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jul 3, 2016
  10. Offline

    mactown21

    Put a lore onto players name? more like if a player do /enchant player lore <player_namta_lore>

    and then it comes out like this

    <CrispyLipz>
    <Need Help>
     
  11. Offline

    CrispyLipz

    ./enchant (enchantment)
    - applies enchantment
    - gets playername
    - puts player name as lore

    So I know who enchants what and if someone like a default rank has a god sword I can check that sword to see who enchanted it.

    Try this command /give (name) bow 1 lore:~playername~ that is the format I would like for the items I would like the /enchant command to stay the same but when they execute the command it puts the player name into the item

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jul 3, 2016
  12. Offline

    mactown21

    Ok, So if they add a lore to a item, it goes to the name also?


    But! What if they want to make multiple enchantments? How can they just add a lore just to there characters? I can make a plugin that can add a lore that they wont under there name but not hooked onto with essentials, Just because that enchant, And also, If you want to do enchant, Why not just use /item (essentials command), You can use this command also to add lores to items that characters to there items, But not names so do you want /enchant /item or a custom command? and sorry, I dont speak good english

    I can just add that addon to the command /item because /enchant isnt what you want to use for this method!

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jul 3, 2016
  13. Offline

    CrispyLipz

    If they do enchantments over and over again it would reapply the name? All I need is a tagging system for the item. When they /enchant (enchantment) it enchants but also renames the item to the playername or adds the player name as item lore

    This is for donators because i have problems with them giving out gear and I want to see where its coming from.
    I dont want them to spawn items.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jul 3, 2016
  14. Offline

    mactown21

    How about i just make a small plugin that when a player do /lorenick it will give them a nick, but as a lore that cannot be longer that a (certain) amount of charactors?

    Ok first you want to add lores to players name with enchant command, now you dont want players to give items to other items, what do you want??

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jul 3, 2016
  15. Offline

    CrispyLipz

    Um... I don't know, if you make that are you able to hook it into the /enchant command? I dont want players to use item renaming commands

    I'm not sure I thought it was like adding a player event for the command /enchant then it gets player name and applies that player name to the item that is being enchanted

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jul 3, 2016
  16. Offline

    mactown21

    How about this, i can make the plugin with /lorenick,

    and i can remove the essentials command with give other players items with /enchant???
     
  17. Offline

    CrispyLipz

    I'm stupid what does /lorenick do? :/

    What you want is that you want to add item meta, to Items, instead of giving?
    Yes this! It enchants and give the item that the player enchants item data with lore of the persons name

    Not giving them items just enchating it and it puting the players name in the item

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jul 3, 2016
  18. Offline

    mactown21

    what command usage do you want to use for this?
     
  19. Offline

    CrispyLipz

    I just need /enchant recoded to put a player name when they enchant

    I don't need a new plugin just Essnetials tweaked a bit

    So like when you add lore to an item with a command I just need that to happen with the players name when they /enchant

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jul 3, 2016
  20. CrispyLipz
    So you basically just want an enchantment plugin? Also, that enchantment code that you provided isn't really relevant to enchanting. All the methods have been defined in other classes :p Anyways, this wouldn't be too hard to do :p
     
  21. Offline

    CrispyLipz

    Not sure I just need a tagging system for /enchant the only thing I need with this is enchanting with built in item renaming and the item renamed or having lore set to the player that enchants name
     
  22. Offline

    CrispyLipz

    Thanks! You get what I mean though right? Just a simple item tag when donators use /enchant (enchatment)
     
  23. Offline

    Necrodoom

Thread Status:
Not open for further replies.

Share This Page