Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.astred.gptotnt;
- import org.bukkit.Material;
- import org.bukkit.command.Command;
- import org.bukkit.command.CommandExecutor;
- import org.bukkit.command.CommandSender;
- import org.bukkit.entity.Player;
- import org.bukkit.inventory.Inventory;
- import org.bukkit.inventory.ItemStack;
- public class TNT implements CommandExecutor
- {
- Player player;
- Inventory inv;
- ItemStack powder;
- ItemStack boom;
- public boolean onCommand(CommandSender sender, Command cmd, String s, String[] args)
- {
- if (cmd.getName().equalsIgnoreCase("tntc"))
- {
- if (sender instanceof Player)
- {
- this.player = ((Player)sender);
- this.inv = this.player.getInventory();
- this.powder = new ItemStack(Material.SULPHUR, 5);
- this.boom = new ItemStack(Material.TNT, 1);
- if (this.inv.containsAtLeast(this.powder, 5))
- {
- this.inv.removeItem(new ItemStack[] { this.powder });
- this.inv.addItem(new ItemStack[] { this.boom });
- this.player.sendMessage("success");
- }
- }
- }
- return true;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement