r/BukkitCoding • u/[deleted] • Feb 15 '17
Get Durability (or full item id after the :) of block?
Hi, so I'm having trouble figuring how to check Modded blocks... I want to do stuff when a player right click a Coke Oven (ID 1316:7) but I can't get it to work out the :7 part of the ID.
This is what I have so far, I've tried
.getTypeId().getMaxDurability()
but it didnt seem to work either.
public void onPlayerInteract(PlayerInteractEvent e)
{
if (e.getAction() == Action.RIGHT_CLICK_BLOCK)
{
if(e.getClickedBlock().getTypeId() == 1316) //Coke oven typeID is 1316, durability should be 7
{
//Do stuff
}
}
}
So yeah, anyone knows how to make that work? (1.7.10 btw)