Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package ep21;
- import org.bukkit.Material;
- import org.bukkit.command.Command;
- import org.bukkit.command.CommandSender;
- import org.bukkit.entity.Player;
- import org.bukkit.inventory.Inventory;
- import org.bukkit.inventory.ItemStack;
- import org.bukkit.plugin.java.JavaPlugin;
- public class Main extends JavaPlugin{
- @Override
- public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
- if(!(sender instanceof Player))return true;
- Player p = (Player) sender;
- Inventory inv = p.getInventory();
- if(label.equalsIgnoreCase("potion-heal")){
- ItemStack potionHeal = new ItemStack(Material.POTION);
- potionHeal.setDurability((short)16421);
- inv.addItem(potionHeal);
- p.updateInventory();
- }
- else if(label.equalsIgnoreCase("granite")){
- ItemStack granite = new ItemStack(Material.STONE);
- granite.setDurability((short) 1);
- inv.addItem(granite);
- p.updateInventory();
- }
- return true;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment