Skip to content

Instantly share code, notes, and snippets.

@nathanfranke
Created March 25, 2022 23:12
Show Gist options
  • Save nathanfranke/0db5c4b3ff97c48adb08697fd2663182 to your computer and use it in GitHub Desktop.
Save nathanfranke/0db5c4b3ff97c48adb08697fd2663182 to your computer and use it in GitHub Desktop.
minecraft paper create potion item
final ItemStack item = new ItemStack(Material.POTION);
final PotionMeta meta = (PotionMeta)item.getItemMeta();
meta.setBasePotionData(new PotionData(PotionType.MUNDANE));
item.setItemMeta(meta);
player.getInventory().setItem(0, item);
val item = ItemStack(Material.POTION)
val meta = item.itemMeta as PotionMeta
meta.basePotionData = PotionData(PotionType.SPEED)
item.itemMeta = meta
player.inventory.setItem(0, item)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment