Created
March 7, 2016 01:44
-
-
Save avighnash/f913e566ab9c5abcb257 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package us.universalpvp.play; | |
import java.util.logging.Logger; | |
import org.bukkit.Bukkit; | |
import org.bukkit.Material; | |
import org.bukkit.command.Command; | |
import org.bukkit.command.CommandSender; | |
import org.bukkit.entity.Player; | |
import org.bukkit.inventory.ItemStack; | |
import org.bukkit.plugin.java.JavaPlugin; | |
public class Inventory extends JavaPlugin | |
{ | |
Logger myPluginLogger = Bukkit.getLogger(); | |
@Override | |
public void onEnable() | |
{ | |
} | |
@Override | |
public void onDisable() | |
{ | |
} | |
public boolean onCommand(CommandSender theSender, Command cmd, String commandLabel, String[] args) | |
{ | |
if(theSender instanceof Player) { | |
Player player = (Player)theSender; | |
if(commandLabel.equalsIgnoreCase("openinventory")) | |
{ | |
Inventory inv = Bukkit.createInventory(null, 9, "The Inventory!"); [RED LINE] | |
inv.setItem(0, new ItemStack(Material.DIRT)); [RED LINE] | |
inv = inv; | |
player.openInventory(inv); [RED LINE] | |
} | |
} | |
return true; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment