Jump to content

[1.7.2] Interact mob with a block [Solved]


thomassu

Recommended Posts

i am creating a turtle and when you right click with a block there happens something

so i tried this:

public boolean interact(EntityPlayer par1EntityPlayer)

    {

    ItemStack itemstack = par1EntityPlayer.inventory.getCurrentItem();

   

    if (itemstack != null && itemstack.getItem() == Blocks.chest && !par1EntityPlayer.capabilities.isCreativeMode)

    {

   

    }

 

return true;

    }

 

but it doesnt work because it is itemstack.getItem

does anyone know how to do a interact function with a block

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.