Suggested name: Talismans What I want: The idea is to add talismans (like those in D2). If player has one in his inventory, he gains buffs/debuffs. - it should be able to set drop rate from mobs (may be set for all mobs, or for each other separately), - they should consisct of unique, colored name and short lore, - it would be awesome to be able to made them via config file (set item ID to be seen, emerald for example, set name, lore, buffs/debuffs), - player can have up to 4 talismans in his inventory (to prevent OP), - buffs should not stack, neither should talismans, - buffs are status effects, active till Ideas for commands: /talisman give <talisman_name> - gives you specified talisman Ideas for permissions: talisman.give - permission for command When I'd like it by: asap
darkon12 I like the idea, can you specify the buffs that are given and the names of the talisman(s)? I may take a look at this tonight. EDIT: I'll just make it configurable.
Marten Mooij Yeah, It would be really awesome if it were possible to create talismans in config file, using all available status effecs, set name and lore for them.
darkon12 I am sorry I can no longer make this plugin high school is getting in the way and unfortunately that goes first. The plugin needs working on but is close to done I believe, for any developers that want to take over this project here is everything I have worked on in my free time: Main class: Code:java package me.MartenMooij.Talismans; import java.util.ArrayList;import java.util.List; import org.bukkit.Bukkit;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.inventory.ItemStack;import org.bukkit.inventory.meta.ItemMeta;import org.bukkit.plugin.java.JavaPlugin; public class Main extends JavaPlugin{ public void onEnable(){ Bukkit.getServer().getConsoleSender().sendMessage(ChatColor.DARK_GREEN + "[Talismans] Is Now Enabled!"); this.getServer().getPluginManager().registerEvents(new Second(this), this); getConfig().options().copyDefaults(true); saveDefaultConfig(); } public void onDisable(){ Bukkit.getServer().getConsoleSender().sendMessage(ChatColor.DARK_RED + "[Talismans] Is Now Disabled!"); } public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { if(label.equalsIgnoreCase("tm")){ if(!(sender instanceof Player)){ sender.sendMessage(ChatColor.DARK_RED + "[Talismans] Only players can perform this command."); return true; } if(args.length == 0){ Player player = (Player) sender; player.sendMessage(ChatColor.AQUA + "[" + ChatColor.DARK_AQUA + "Talismans" + ChatColor.AQUA + "] " + "Please specify a player to give a talisman to."); }else{ Player target = Bukkit.getPlayerExact(args[0]); if(target == null){ Player player = (Player)sender; player.sendMessage(ChatColor.AQUA + "[" + ChatColor.DARK_AQUA + "Talismans" + ChatColor.AQUA + "] " + "The player " + args[0] + " is not online."); }else{ if(args.length == 1){ Player player = (Player)sender; player.sendMessage(ChatColor.AQUA + "[" + ChatColor.DARK_AQUA + "Talismans" + ChatColor.AQUA + "] " + "Please specify a talisman type."); player.sendMessage(ChatColor.DARK_AQUA + "Available types: " + ChatColor.AQUA + this.getConfig().getString("talismanGiveName1") + " "); }else{ if(args[1].equalsIgnoreCase(this.getConfig().getString("talismanGiveName1"))){ Player player = (Player)sender; player.sendMessage(ChatColor.AQUA + "[" + ChatColor.DARK_AQUA + "Talismans" + ChatColor.AQUA + "] " + "Successfully gave " + args[0] + " a talisman."); String message1 = getConfig().getString("talismanName1"); String message2 = message1.replaceAll("&", "§"); String loreline1 = getConfig().getString("talismanLoreLineOne1"); String loreline2 = message1.replaceAll("&", "§"); String itemStack1 = this.getConfig().getString("talismanItem1"); String itemStack2 = itemStack1.toUpperCase(); ItemStack item1 = new ItemStack(Material.getMaterial(itemStack2)); ItemMeta meta1 = item1.getItemMeta(); meta1.setDisplayName(message2); List<String> lore1 = new ArrayList<String>(); lore1.add(loreline2); meta1.setLore(lore1); item1.setItemMeta(meta1); target.getInventory().addItem(item1); } } } } } return false; }} Second class: Code:java package me.MartenMooij.Talismans; import java.util.ArrayList;import java.util.List; import org.bukkit.Material;import org.bukkit.entity.Player;import org.bukkit.event.EventHandler;import org.bukkit.event.Listener;import org.bukkit.event.player.PlayerMoveEvent;import org.bukkit.inventory.ItemStack;import org.bukkit.inventory.meta.ItemMeta;import org.bukkit.potion.PotionEffect;import org.bukkit.potion.PotionEffectType; public class Second implements Listener{ ArrayList<String> one = new ArrayList<String>(); Main main; public Second(Main main){ this.main = main; } //onPlayerMove - 1 @EventHandler public void onPlayerMove1(PlayerMoveEvent event){ Player player = event.getPlayer(); String message1 = main.getConfig().getString("talismanName1"); String message2 = message1.replaceAll("&", "§"); String loreline1 = main.getConfig().getString("talismanLoreLineOne1"); String loreline2 = message1.replaceAll("&", "§"); String itemStack1 = main.getConfig().getString("talismanItem1"); String itemStack2 = itemStack1.toUpperCase(); ItemStack item1 = new ItemStack(Material.getMaterial(itemStack2)); ItemMeta meta1 = item1.getItemMeta(); meta1.setDisplayName(message2); List<String> lore1 = new ArrayList<String>(); lore1.add(loreline2); meta1.setLore(lore1); item1.setItemMeta(meta1); //Doesn't contain item in inventory if(!(player.getInventory().contains(item1))){ if(one.contains(player.getName())){ one.remove(player.getName()); player.removePotionEffect(PotionEffectType.getByName(main.getConfig().getString("talismanPotionType1"))); } } //Contains item in inventory if(player.getInventory().contains(item1)){ if(!(one.contains(player.getName()))){ one.add(player.getName()); player.addPotionEffect(new PotionEffect(PotionEffectType.getByName(main.getConfig().getString("talismanPotionType1")), main.getConfig().getInt("talismanPotionDuration1"), main.getConfig().getInt("talismanPotionAmplifier1"))); } } }} Config: Code: #The item name when typing /Tm <Player> <ItemName>. talismanGiveName1: Air #The name of the talisman. (WARNING: Do not remove the quotes) talismanName1: "&6Air" #The first lore line of the talisman. (WARNING: Do not remove the quotes) talismanLoreLineOne1: "&6This is an example lore." #The talisman item. (WARNING: Use a '_' for any spaces) talismanItem1: nether_star #The potion given when the talisman is in the players inventory. #WARNING Only you use following potions: # #ABSORPTION BLINDNESS CONFUSION DAMAGE_RESISTANCE FAST_DIGGING FIRE_RESISTANCE HARM HEAL #HEALTH_BOOST HUNGER INCREASE_DAMAGE INVISIBILITY JUMP NIGHT_VISION POISON REGENERATION SATURATION SLOW SLOW_DIGGING SPEED #WATER_BREATHING WEAKNESS WITHER talismanPotionType1: JUMP #The duration of the potion effect. (1 second = 20) talismanPotionDuration1: 100000 #The potion Amplifier. (0 = I) talismanPotionAmplifier1: 0 I am truly sorry that I cannot continue making this plugin for you. The plugin is usable but currently only supports the creation of one talisman. If you want to try it out here you go: https://www.dropbox.com/s/kqhlnsc289wb50m/Talismans.jar?dl=0 The main command is: /Tm
Ok if you would like, since I was doing your other plugin request, I could try to take this one over as well... I'm not sure yet, I'll tell you if I make up my mind (Everything in this is new to me o.o)