Help in plugin - new item and teleport

Discussion in 'Plugin Development' started by RoiyAk, Jun 3, 2013.

  1. Offline

    RoiyAk

    Hey,
    I make a new metiral for the clock but i want a new item. (new clock with new name)
    I do not know how to do it.

    One more thing I want to make plugin to teleport two people at random.
    player one type /tp req <name> and player tow type /tp accept.

    Can anyone help me?
    Thank you!
     
  2. Offline

    RoiyAk

    I have many errors:

    Code (Text):
    1. package BookTelepot;
    2.  
    3. import java.util.ArrayList;
    4. import java.util.logging.Logger;
    5. import org.bukkit.plugin.java.JavaPlugin;
    6. import org.bukkit.ChatColor;
    7. import org.bukkit.Location;
    8. import org.bukkit.Material;
    9. import org.bukkit.World;
    10. import org.bukkit.command.Command;
    11. import org.bukkit.command.CommandSender;
    12. import org.bukkit.plugin.java.JavaPlugin;
    13. import org.bukkit.entity.Player;
    14. import org.bukkit.event.inventory.PrepareItemCraftEvent;
    15. import org.bukkit.inventory.ItemStack;
    16. import org.bukkit.inventory.meta.ItemMeta;
    17. public class BookTelepot extends JavaPlugin
    18. {
    19.     private static final World World = null;
    20.     public final Logger log = Logger.getLogger("minecraft");
    21.     public static BookTelepot plugin;
    22.         public void onEnable()
    23.         {
    24.             log.info("Hello");
    25.         }
    26.         public void onDisable() {
    27.             log.info("Gosa Is BH");
    28.         }
    29.  
    30.         ItemStack item = new ItemStack(Material.GOLDENHOE);
    31.         ItemMeta meta = item.getItemMeta();
    32.         meta.setDisplayName("LockPick");
    33.         ArrayList<String> description = new ArrayList<String>();
    34.         description.add("Test");
    35.         meta.setLore(description);
    36.         item.setItemMeta(meta);
    37.         player.getInventory().addItem(item);
    38.       }
    39.  
    You can fix it for me please?
     
  3. RoiyAk it's Material.GOLD_HOE.
     
  4. Offline

    RoiyAk

    It is still with errors.
    Can you get me the full code?
     
  5. Offline

    RoiyAk

  6. Online

    timtower Ninja on the waves Moderator

    RoiyAk You are creating things outside an function, it is useful if you have an player to add items to
     

Share This Page