Ok i have a plugin called start with item and you start of with a minecart and i was wondering if someone could make me a plugin which you start with a Golden nugget? Here is the code from the start with item: This class is called PListener Code: package com.Aldimensch; import org.bukkit.ChatColor; import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.player.PlayerJoinEvent; import org.bukkit.event.player.PlayerRespawnEvent; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.PlayerInventory; public class PListener implements Listener { public static SpawnWithCart plugin; public PListener(SpawnWithCart instance) { plugin = instance; } @EventHandler public void onPlayerJoin(PlayerJoinEvent e) { Player player = e.getPlayer(); ItemStack[] inventory = player.getInventory().getContents(); for (ItemStack x : inventory) { if ((x != null) && (x.getTypeId() == 328)) { player.sendMessage(ChatColor.AQUA + "You dont need a Minecart"); return; } } for (ItemStack x : inventory) { if (x == null) { player.sendMessage(ChatColor.AQUA + "You got a Minecart!"); player.getInventory().addItem(new ItemStack[] { new ItemStack(Material.MINECART, 1) }); return; } } player.sendMessage(ChatColor.AQUA + "You dont have Space for a Minecart!"); } @EventHandler public void onPlayerRespawn(PlayerRespawnEvent e) { Player player = e.getPlayer(); ItemStack[] inventory = player.getInventory().getContents(); for (ItemStack x : inventory) { if ((x != null) && (x.getTypeId() == 328)) { player.sendMessage(ChatColor.AQUA + "You dont need a Minecart"); return; } } for (ItemStack x : inventory) { if (x == null) { player.sendMessage(ChatColor.AQUA + "You got a Minecart!"); player.getInventory().addItem(new ItemStack[] { new ItemStack(Material.MINECART, 1) }); return; } } player.sendMessage(ChatColor.AQUA + "You dont have Space for a Minecart!"); } } And this class is called SpawnWithCart Code: package com.Aldimensch; import java.util.logging.Logger; import org.bukkit.Server; import org.bukkit.plugin.PluginManager; import org.bukkit.plugin.java.JavaPlugin; public class SpawnWithCart extends JavaPlugin { private final PListener playerListener = new PListener(this); Logger log = Logger.getLogger("Minecraft"); public void onDisable() { this.log.info("****SpawnWithCart NOT is Running*****"); } public void onEnable() { PluginManager pm = getServer().getPluginManager(); pm.registerEvents(this.playerListener, this); this.log.info("SpawnWithCart is Running"); } } If someone could do this i would be very grateful
If you're going to write it, add item id to config file. It's better than hardcoded id Also, you can add variable to set if user will get item only once or every time.
Konkz I don't think Start Kits are every respawn. I'll get on writing it. MrGhettoGFX Alright, got it working: SpawnItem It gives the player the item id in config, with the amount. It checks and if the player already has a "Item ID" when the log in, it doesn't give them one, but if they don't it gives them one. EDIT by Moderator: merged posts, please use the edit button instead of double posting.