Plugin category: Mechanics Suggested name: UniqueSets What I want: Currently on my server we are running 3 Important plugins for our players, these are http://dev.bukkit.org/bukkit-plugins/legendaryweapons http://dev.bukkit.org/bukkit-mods/enchantmentapi http://dev.bukkit.org/bukkit-plugins/enchantmentpack Basically, what I want is for when a player has a group of these "Enchanted Items" equipped. e.g. "Helmet Of God", "Chest Of Pain", "Pants of Cleansing", "Moon Boots" they will receive "special effects" such as e.g. Movement 2, or even the custom enchantments from the enchantment pack. On our server, we are currently setting up god sets, e.g. A god called Zerox (made up). And when a player has all 4 of zerox's Armour items equipped he will be able to use the set to full functionality, e.g. Applies tier 2 strength when hit by an enemy for (0.5 + 0.5 level) seconds which is a part of the enchantment pack plugin. I would like this to be configurable with just the set names, and the effects it gives. Functional Requirements: (Required to be in the plugin) To give a user effects based on the set of item names they are wearing Adjusting in the configuration. The ability to make new sets. Non Functional Requirements: (not required, but would like) Receive effects from the enchantment pack. Not being able to rename items in an anvil. Possibly more to come Ways to go about programming this: -Using an if statement or select case in an order as such (if player has equipped "Goditem1" and "Goditem2" and "Goditem3" and "Godltem4" then) { effect.apply(movement.5) effect.apply(strength.3) //customizable in config } This is how I would go about, but I am unaware of java syntax Ideas for commands: None Ideas for permissions: uniquesets.use - allows users to get the special effects When I'd like it by: As soon as possible, but the sooner the better, and the happier Ill be with you I also found this plugin: http://dev.bukkit.org/bukkit-plugins/armorset-effects/ Which is sort of what I want, but to work only with the items given name, in this case e.g. "Zerox Platelegs"
timtower Its different in many ways considering it has nothing to do with item names instead uses ID's Is this something you would be able to do? Thanks for replying
timtower How difficult would something like this be to make, compared to lets say your own plugin TimeLikeMe
timtower something you're willing to take on? I can see this getting used by others using the same legendary plugin. Thanks for the fast reply
timtower wouldn't you just be able to match the items GIVEN name (probably sets the name to a string when using anvils, perhaps related) with a string? If it helps, I could actually show you on my server. Found something on another forum for Anvil Renaming Spoiler (Move your mouse to the spoiler area to reveal the content) Show Spoiler Hide Spoiler @EventHandler(priority = EventPriority.MONITOR) public void onInventoryClick(InventoryClickEvent e){ // check if the event has been cancelled by another plugin if(!e.isCancelled()){ HumanEntity ent = e.getWhoClicked(); // not really necessary if(ent instanceof Player){ Player player = (Player)ent; Inventory inv = e.getInventory(); // see if the event is about an anvil if(inv instanceof AnvilInventory){ InventoryView view = e.getView(); int rawSlot = e.getRawSlot(); // compare the raw slot with the inventory view to make sure we are talking about the upper inventory if(rawSlot == view.convertSlot(rawSlot)){ /* slot 0 = left item slot slot 1 = right item slot slot 2 = result item slot see if the player clicked in the result item slot of the anvil inventory */ if(rawSlot == 2){ /* get the current item in the result slot I think inv.getItem(rawSlot) would be possible too */ ItemStack item = e.getCurrentItem(); // check if there is an item in the result slot if(item != null){ ItemMeta meta = item.getItemMeta(); // it is possible that the item does not have meta data if(meta != null){ // see whether the item is beeing renamed if(meta.hasDisplayName()){ String displayName = meta.getDisplayName(); // do something
tommyhoogstra It is not about getting the names but how do I see what items are used to combine a entire suit
timtower wouldn't there be like a PlayerHasEquipped method within bukkits package. I have little knowledge on java syntax.
I know how to get the items, but not how you want to store the types, do you just want to check for a certain name or something?
That would work, the easiest way possible you can think of. timtower Even if you could clarify that more for me. Should look something like this in lets say C# Just checking that the player has each items given name, its pretty weird to explain :S Code: equipped "Goditem1" and "Goditem2" and "Goditem3" and "Godltem4" then) { effect.apply(movement.5) effect.apply(strength.3) //customizable in config } <Removed double post - Use edit button to edit your post - Necrodoom>
timtower Hi tim, would coloured item names affect developing this plugin in anyway. In the legendary config all the items start with "c4" to make the item name ingame dark Red Thanks
Daily Bump, currently attempting to learn java syntax through thenewboston. If anyone else would like to try this, let me know. timtower found something that may be of use hasDisplayName () and getDisplayName () You need HAS for GET to work, would that make this possible?
timtower Code:java @EventHandlerpublic void onInventoryClose(InventoryCloseEvent event) { Player player = (Player) event.getView().getPlayer(); ItemStack[] playerArmor = player.getInventory().getArmorContents(); if((playerArmor[0] != null && playerArmor[0].getType() == Material.getMaterial("Zeroxes Moonlanders")) && (playerArmor[1] != null && playerArmor[1].getType() == Material.LEATHER_CHESTPLATE) && (playerArmor[2] != null && playerArmor[2].getType() == Material.LEATHER_LEGGINGS) && (playerArmor[3] != null && playerArmor[3].getType() == Material.LEATHER_BOOTS) ) { player.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, Integer.MAX_VALUE,4)); player.sendMessage("You have equipped the Assassin class."); Hey tim, was doing more research and learning java itself, I thought maybe if you changed it to Material.getMaterial from Material.Item_ID Thoughts? I tried running this without the customisation and it doesn't seem to run the event, SO i have some work to do.
timtower package me.Hoogstra.Bukkit; import java.util.logging.Logger; import org.bukkit.ChatColor; import org.bukkit.Material; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.inventory.InventoryCloseEvent; import org.bukkit.inventory.ItemStack; import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; Other than that, I only started java 2 days ago, help me out
That is not enabling it Code:java this.getServer().getPluginManager().registerEvent(this,this); And won't be offering more support here, this has turned into plugin development