Question : What is the word id for Cooked pork? [Solved]

Discussion in 'Spigot Plugin Development' started by TheMrJezza, May 3, 2015.

  1. Hello spigot community, I have another question I can't seem to work out, I have this bit of code:
    Code (Text):
    if (player.getItemInHand().getType() == Material.ANVIL) {
    My question is where it says Material.ANVIL what do I put there to make it a Very Damaged Anvil?
    I have tried Material.VeryDamagedAnvil and Material.Very_Damaged_ANVIL but with no
    Cooked Pork? Thanks in advance.
    This is just an edit of another related thread, scroll down past the anvil parts
    #1 TheMrJezza, May 3, 2015
    Last edited: May 3, 2015
  2. gigosaurus


    Very Damaged Anvil is still Material.ANVIL, just with some extra data, so your if statement there will be true for very damaged anvils.

    If you only want very damaged anvils, you will have to check if the item has a durability of 2 as well.
    • Like Like x 1
  3. There isn't a Material name, but if you create an ItemStack, you can set the DataValue(duribility) to set that.

    Anvil with data value is 0, is normal. Data value 1 is is slightly damages, and Data value 2 is very damaged!

    Hope I helped :)
    • Like Like x 1
  4. The very damaged anvil has the same id of the anvil and damage value 2
  5. Thank you all, its working now.
  6. I now have to get the ID for Cooked pork, nothing I try seems to work... Can anyone help?
  7. 320
  9. @inventivetalent Thanks, do you also know what salmon and cooked salmon is as well?
  10. Should be FISH Edit: RAW_FISH and COOKED_FISH with a damage value of 1.
    #10 inventivetalent, May 3, 2015
    Last edited: May 3, 2015
  11. so
    Code (Text):
    ((player.getItemInHand().getType() == Material.RAW_FISH ) && player.getItemInHand().getDurability() == 1) {
  12. Yes.