Help in plugin - new item and teleport

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

Thread Status:
Not open for further replies.
  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

    chasechocolate

  3. Offline

    RoiyAk

    I have many errors:

    Code:
    package BookTelepot;
     
    import java.util.ArrayList;
    import java.util.logging.Logger;
    import org.bukkit.plugin.java.JavaPlugin;
    import org.bukkit.ChatColor;
    import org.bukkit.Location;
    import org.bukkit.Material;
    import org.bukkit.World;
    import org.bukkit.command.Command;
    import org.bukkit.command.CommandSender;
    import org.bukkit.plugin.java.JavaPlugin;
    import org.bukkit.entity.Player;
    import org.bukkit.event.inventory.PrepareItemCraftEvent;
    import org.bukkit.inventory.ItemStack;
    import org.bukkit.inventory.meta.ItemMeta;
    public class BookTelepot extends JavaPlugin
    {
        private static final World World = null;
        public final Logger log = Logger.getLogger("minecraft");
        public static BookTelepot plugin;
            public void onEnable()
            {
                log.info("Hello");
            }
            public void onDisable() {
                log.info("Gosa Is BH");
            }
     
            ItemStack item = new ItemStack(Material.GOLDENHOE);
            ItemMeta meta = item.getItemMeta();
            meta.setDisplayName("LockPick");
            ArrayList<String> description = new ArrayList<String>();
            description.add("Test");
            meta.setLore(description);
            item.setItemMeta(meta);
            player.getInventory().addItem(item);
          }
    
    You can fix it for me please?
     
  4. Offline

    chasechocolate

    RoiyAk it's Material.GOLD_HOE.
     
  5. Offline

    RoiyAk

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

    UP

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 1, 2016
  6. Offline

    timtower Administrator Administrator Moderator

    RoiyAk You are creating things outside an function, it is useful if you have an player to add items to
     
Thread Status:
Not open for further replies.

Share This Page