Well this is more a "help" thread; but i am requesting help... Anyway what I need: Plugin: Special Items What it DOes; help coders develop special items What It needs to have: a explanation of how to rename Items (Eg name boots "greg" or something I know how to do colour codes , But metadata is hard ) It also needs to show how this item can be used to gain special items. Eg when you rightclick dirt named "george" in the air "I know how to do this rightclick registerer, but not a specific bit of ddrt) it will do something cool . If you just rightclick normal dirt, it does nothing what I then plan to do is create kits using skript; but with java implantation. What I really need to learn is small snipets of: How metadata can be used to give items special abilities Some special abilities (eg: reistering fall damage, and then applying it to others. As well as this cancelling it) Velocity settign the damage of something (eg: a iron axe does 5 hearts more) Download: Source code If someone could do this it would help me a lot. Atm all I can do in Java is type /cat and make chat make a red "meow"
a quick google search will show that these plugin already are made. you didnt make it obvious if you plan to add onto the plugin but considering your lack of knowledge im guessing not please clear that up for me
Instead of making a plugin to help you how to do things, how about skip the middle man and help you how to do things. Moved to correct section.
beaudigi Here's basic code for setting Metadata: Code:java ItemStack stack = new ItemStack(Material.GRASS, 1);ItemMeta stackMeta = stack.getItemMeta();stackMeta.setDisplayName(""); // Insert name here!ArrayList<String> lore = new ArrayList<String>();lore.add(""); // Insert whatever lore here!stackMeta.setLore(lore);stack.setItemMeta(stackMeta);
Thanks, but say how to ensure that if the player is wearing boots with that metadata stuff occur. I know heaps of effects; I just dont know how to implanment them I dont want a plugin; I want help What I want to do is create items that when theyever they must have that name. This way I can then implament this with the pugin Skript
beaudigi Basically something like this then? Code:java @EventHandler public void onInteractWith(PlayerInteractEvent event) { if(event.getAction() == Action.RIGHT_CLICK_BLOCK || event.getAction() == Action.RIGHT_CLICK_AIR) { if(event.getPlayer().getItemInHand().hasItemMeta()) { if(event.getPlayer().getItemInHand().getItemMeta().getDisplayName().equals("yourItemDisplayName")) { event.setCancelled(true); } if(event.getPlayer().getItemInHand().getItemMeta().getLore().contains("yourLore")) { event.setCancelled(true); } } } }
Better not use the display name. Because it can be changed by the player using an anvil. Stick with he lore to create special items. Or at least use only the information in the lore to determine if an item is special. So it does not matter if the player changes the items name at some point.
CubieX I added that purely to show him how basic usage of checking for metadata would look like, not supposed to be "use it nao in all teh things!" code. =P
Ty this Ty this really helps; a begginer like me I dont need to worry about anvils As the server is not survival/ plus I could make it use colours codes EDIT by Moderator: merged posts, please use the edit button instead of double posting.
IS it possible to check meta data whilst the player is wearing boots; this is my code atm (stomper) Code:java public void onEntityDamage(EntityDamageEvent event) { if (!(event.getEntity() instanceof Player)) return; final Player eventPlayer = (Player) event.getEntity(); if (Material.CHAINMAIL_BOOTS.equals(eventPlayer.getInventory() if(eventPlayer.getInventory().getItemInHand().hasItemMeta()) { if(eventPlayer.getInventory().getBoots().getType().getItemMeta().getDisplayName().equals(ChatColor.RED + "Stomper")) { event.setCancelled(true); } if(eventPlayer.getInventory().getBoots().getType().getBootsMeta().getLore().contains("Hold This to Stomp Players")) { event.setCancelled(true); event.getCause().equals(DamageCause.FALL)) if(Damage > 4){ event.setDamage(4); } for(Entity nearby : eventPlayer.getNearbyEntities(5D, 5D, 5D)){ if(nearby instanceof Player){ Player nearbyPlayer = (Player) nearby; if(nearbyPlayer.isSneaking()){ nearbyPlayer.damage(3); } else { nearbyPlayer.damage(dmg);
Code:java @SuppressWarnings("deprecation") @EventHandler public void onEntityDamage(EntityDamageEvent event) { if (!(event.getEntity() instanceof Player)) return; Player eventPlayer = (Player) event.getEntity(); if(eventPlayer.getInventory().getBoots().hasItemMeta()) { if(eventPlayer.getInventory().getBoots().getItemMeta().getDisplayName().equals(ChatColor.RED + "Stomper")) { event.setCancelled(true); } if(eventPlayer.getInventory().getBoots().getItemMeta().getLore().contains("Equip these to stomp on others!")) { if (event.getCause().equals(DamageCause.FALL)) { event.setCancelled(true); for(Entity nearby : eventPlayer.getNearbyEntities(5D, 5D, 5D)){ if(nearby instanceof Player){ Player nearbyPlayer = (Player) nearby; if(nearbyPlayer.isSneaking()){ nearbyPlayer.damage(3); } else { nearbyPlayer.damage(event.getDamage()); } } } } } } }} beaudigi It is yes, here, your code is a bit messy, I've fixed it up a bit -^