Skip to content

Instantly share code, notes, and snippets.

@JanTuck
Created April 20, 2018 18:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JanTuck/1ebd5c4cff3b4b7db471be804a737937 to your computer and use it in GitHub Desktop.
Save JanTuck/1ebd5c4cff3b4b7db471be804a737937 to your computer and use it in GitHub Desktop.
private static void removeItem(Player p, Material mat, int removeAmount) {
ItemStack itemStack = new ItemStack(mat, removeAmount);
p.getInventory().removeItem(itemStack);
}
private static void removeItem(Player p, ItemStack item, int removeAmount) {
ItemStack clonedItem = item;
clonedItem.setAmount( removeAmount);
p.getInventory().removeItem(clonedItem);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment