Non drop-able items

Discussion in 'Archived: Plugin Requests' started by JabaJamesHD, Feb 17, 2014.

  1. Offline

    JabaJamesHD

    Hello,

    I have a kit-pvp server where you click signs to get certain items and then you pvp. I want these items to not be dropped upon death so they are soul bound or something like that. But in the arena I have enchantment table where they can enchant. When they enchant I want the soul bound to come of them so they can then drop.

    Commands:

    /Set soulbound
    /Unset soulbound

    Premissions:

    None. Just op can do the commands

    Thanks
     
  2. Offline

    JabaJamesHD

    Thats doesn't do what Im looking for. I want it so they can't drop that specific item and when they die it doesn't drop and they don't get it back. Also the soul bound plugin has to have the play use it before its soul bound so they could just drop it to a normal player also they get it back. Any help?
     
  3. Offline

    timtower Administrator Administrator Moderator

    JabaJamesHD Quote from their page:
    And if you have a good kit plugin then you can set the lores yourself per player so it is soulbound when they get the item
     
  4. Offline

    JabaJamesHD

    • /soulbound - General info
    • /soulbound [help] - Help information
    • /soulbound [reload] - Reload settings
    • /bind [player] <inventory> - Binds the item in hand to the player, or an entire inventory
    • /bindonpickup - Marks the item as Bind on Pickup
    • /bindonequip - Marks the item as Bind on Equip
    • /bindonuse - Marks the item as Bind on Use
    • /unbind - Unbinds the item
    You can only set soul bound items when the player either picks it up, equips it or uses it so, this is not what I want. If you don't have anything important to say then don't say it.
     
  5. Offline

    timtower Administrator Administrator Moderator

    JabaJamesHD The plugin uses lores to define the soulbound items, if you set the lore with your kit plugin then they are bound when the player gets the item. Commands aren't everything developers use
     
  6. Offline

    JabaJamesHD

    @timtower I have a plugin where you get your kit from clicking it on the item frame so thats why I need to set the item to soul bound. Then I put that soul bound item in the frame then when people get the item it is already soul bound
     
  7. Offline

    timtower Administrator Administrator Moderator

    JabaJamesHD In the first post you said signs, that is why I thought that you had the ability to change the lore per player.
     
  8. Offline

    JabaJamesHD

    @timtower Sorry, This post is old and thats when I used signs. Now I dont

    Bump. Anyone help me?

    Can someone please help me?
     
  9. Offline

    timtower Administrator Administrator Moderator

  10. Offline

    JabaJamesHD

  11. Offline

    BappleCraftColt

    JabaJamesHD
    No death drops is very easy I can do that in a 2 minutes
    But could you explain the whole soulbound thing a bit more?
    Would it be something as when they respawn/join they cant drop
    But after they enchant something dropping is enabled for that player till they die or leave?
     
  12. Offline

    JabaJamesHD

    @BappleCraftColt I have a server where you get your kit by clicking the item frame and you receive that item. Them items I have made so when you die they don't drop and they don't come back. But if you enchant it and die it will drop. In my donator rooms you can get poison swords with enchants, these are drop able so donors will share them with friends. If I make the item soul bound then put it in the item frame when the donators click to get it, it will be souldbound so they can't drop it and when they die the don't drop it but they don't receive it back again. Thats why I need a soul bound plugin where you type /soulbound to make it souldbound
     
  13. Offline

    BappleCraftColt

    What plugin are you using in the first place to get the soulbound swords?
    I could just make it so ,
    /soulbound gives the player a soubound sword.
     
  14. Offline

    JabaJamesHD

    @BappleCraftColt Im using a plugin called item drop and in the config you put the ids of the items you don't want to be dropped. They aren't soul bound
     
  15. Offline

    BappleCraftColt

    JabaJamesHD
    Okay, I'm sorta confused atm
    Now that I know the reason of all this
    Can you explain just the concept of this request
     
  16. Offline

    JabaJamesHD

    @BappleCraftColt I have a kit pvp server. You click item frames to get the diamond armour, sword, bow, arrows and goldenapples. In the donor rooms you click the diamond swords with custom enchants like poison to get it. This item can be dropped as its an enchanted diamond sword and not a regular. I want a plugin where I can type /soubound and it makes the item souldbound. So if they drop it, it will come back in there inventory. but if they die with it they don't drop it or get it back.
     
  17. Offline

    timtower Administrator Administrator Moderator

    JabaJamesHD Isn't that what soulbound does? Kinda confused right now
     
    DairyKing__ likes this.
  18. Offline

    JabaJamesHD

    @timtower No, soul bound has to have the person either use it or equip it. And then when they die it comes back in there inv. I have used it before, its not what I want
     
  19. Offline

    BappleCraftColt

    JabaJamesHD
    Okay,
    When they do the /soulbound command will it change the item in anyway?
    Like add a lore or change name or such?
     
  20. Offline

    JabaJamesHD

    It will add a lore in orange saying Non-Shareable
     
  21. Offline

    BappleCraftColt

    JabaJamesHD
    And this was a typo right?
    but if they die with it they don't drop it or get it back.
    That makes no sence..
     
  22. Offline

    timtower Administrator Administrator Moderator

    Config option for that...
     
  23. Offline

    JabaJamesHD

    @timtower And there is a config option for the people not having to use the item before its souldbound?
     
  24. Offline

    timtower Administrator Administrator Moderator

    It is checking the lores as far as I know, so no option needed. Told you that 2 times already, and try hitting the tahg button, or just typing my name after an @, placing an @ and then pasting my user account link won't tag me
     
  25. Offline

    BappleCraftColt

    JabaJamesHD
    Uhmm?
     
  26. Offline

    JabaJamesHD

    @BappleCraftColt whats uhmm about that?

    @BappleCraftColt They don't drop it so others can pick it up, but they don't get it back again. It just disappears

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

    BappleCraftColt

    JabaJamesHD
    Oh, my bad
    It clears the item on death,okay.

    JabaJamesHD
    Okay i'm working on the plugin
    Will be done soon

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

    JabaJamesHD

    @BappleCraftColt Okay, thank you. Message me when done. Could you give me a estimated time?
     
  29. Offline

    BappleCraftColt

    JabaJamesHD
    I really have to go.. I've been up allnight and its 8am
    I can finish the plugin tomorow
    But If anybody else wants to take it from here
    This is what I got so far
    Code:java
    1. package com.bapplecraftcolt;
    2.  
    3. import java.util.ArrayList;
    4. import java.util.List;
    5.  
    6. import org.bukkit.ChatColor;
    7. import org.bukkit.command.Command;
    8. import org.bukkit.command.CommandSender;
    9. import org.bukkit.entity.Item;
    10. import org.bukkit.entity.Player;
    11. import org.bukkit.event.EventHandler;
    12. import org.bukkit.event.entity.PlayerDeathEvent;
    13. import org.bukkit.event.player.PlayerDropItemEvent;
    14. import org.bukkit.inventory.ItemStack;
    15. import org.bukkit.inventory.meta.ItemMeta;
    16. import org.bukkit.plugin.java.JavaPlugin;
    17.  
    18. public class Main extends JavaPlugin {
    19.  
    20. public void onEnable(){
    21. System.out.println("Soulbound Activated");
    22. getCommand("soulbound").setExecutor(new Main());
    23.  
    24. }
    25. public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args)
    26. {
    27. if ((cmd.getName().equalsIgnoreCase("soulbound")) &&
    28. ((sender instanceof Player))) {
    29. Player player = (Player) sender;
    30. ItemStack hand = player.getItemInHand();
    31. ItemMeta meta = hand.getItemMeta();
    32. ArrayList<String> lore = new ArrayList<String>();
    33. lore.add(ChatColor.GOLD + "Non-Shareable");
    34. meta.setLore(lore);
    35. hand.setItemMeta(meta);
    36. }
    37. return false;
    38. }
    39.  
    40. @EventHandler
    41. public void death(PlayerDeathEvent event) {
    42. List<ItemStack> iteml = event.getDrops();
    43. ItemStack[] items = iteml.toArray(new ItemStack[0]), removed = new ItemStack[0];
    44. int removedi = 0;
    45. for (int i = 0; i < items.length; i++) {
    46. ItemStack item = items[I];[/I]
    47. [I] ItemMeta itemi = item.getItemMeta();[/I]
    48. [I] List<String> lore = itemi.getLore();[/I]
    49. [I] if (lore != null) {[/I]
    50. [I] if (lore.contains("Non-Shareable"))[/I]
    51. [I] event.getDrops().remove(item);[/I]
    52. [I] removed[removedi] = item;[/I]
    53. [I] removedi++;[/I]
    54. [I] }[/I]
    55. [I] }[/I]
    56. [I] }[/I]
    57.  
    58. [I] @SuppressWarnings("deprecation")[/I]
    59. [I] @EventHandler[/I]
    60. [I] public void drop(PlayerDropItemEvent e)[/I]
    61. [I] {[/I]
    62. [I] Player p = e.getPlayer();[/I]
    63. [I] Item item = e.getItemDrop();[/I]
    64. [I] List<String> lore = ((ItemMeta) item.getItemStack()).getLore();[/I]
    65. [I] if (lore.contains(ChatColor.GOLD + "Non-Shareable")) {[/I]
    66. [I] p.sendMessage("Swag");[/I]
    67. [I] e.setCancelled(true);[/I]
    68. [I] p.updateInventory();[/I]
    69. [I] }[/I]
    70. [I] }[/I]
    71. [I] }[/I]
     

Share This Page