Help in plugin - new item and teleport

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

  1. Offline

    RoiyAk

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    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. Online

    chasechocolate

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
  3. Offline

    RoiyAk

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    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. Online

    chasechocolate

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    @RoiyAk it's Material.GOLD_HOE.
  5. Offline

    RoiyAk

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    It is still with errors.
    Can you get me the full code?
  6. Offline

    RoiyAk

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
  7. Offline

    timtower

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    @RoiyAk You are creating things outside an function, it is useful if you have an player to add items to

Share This Page