Help,i can't solve it.

Discussion in 'Plugin Development' started by Juprup, May 8, 2014.

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

    Juprup

    I trying to make a plugin that remove all itens with custom item-meta.
    But i don't know how to make exceptions to values. Ex: Atack Damage +6 and Speed +130%
    And i don't know how to make the plugin works.
    I using this code.
    Code:java
    1.  
    2. package com.MyName.Test
    3.  
    4. import org.bukkit.plugin.java.JavaPlugin;
    5.  
    6. public class Main extends JavaPlugin {}
    7.  
    8. public void onEnable(){
    9. getLogger().info("Removed other item");
    10. }
    11.  
    12. if(p.getItemInHand().hasItemMeta()) {
    13. if(p.getItemInHand().getItemMeta().hasDisplayName()) {
    14. String name = p.getItemInHand(Material.AIR).getItemMeta().getDisplayName();
    15. if(name.equalsIgnoreCase()) {
    16. }


    I using attualy this code,and what i need do implement to make more than 1 exception and the plugin works .
    HELP :'( :'( :'( :'( :'(
    I need this plugin working how fast i can.
    For mayor explication i need make a plugin that remove all items that have non-normal itemmeta.
    Example: AtackDamage +100 And MaxLife +100
     
  2. Offline

    ChazSchmidt

    The obvious but crude route here could be to make an if statement that checks the itemMetas for the normal values. This seems very cumbersome as you would have to check for each and every normal value...
     
  3. Offline

    Juprup

    I can not do it alone, could you give me one example?

    I tried to make 2 requeriments of this plugin but nobody tried or maked this plugin.
     
  4. Juprup ... You need methods.
    e.g:
    Code:
    @EventHandler
    public void event(PlayerJoinEvent event) {
    //do something
    } 
    In fact, you closed your class before you could even begin -.-

    You appear to be a beginner, so I recommend reading up on the Java documentation (oracle tutorials) to get a grasp of the language first.
     
Thread Status:
Not open for further replies.

Share This Page