public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) {
ItemStack item = playerIn.getHeldItem(hand);
if (item == null || item.isEmpty()) return false;
if (item.getItem() != ТвОй_КлЮч) return false;
//Двери открываются...
return true;
}
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) {
ItemStack item = playerIn.getHeldItem(hand);
if (item == null || item.isEmpty()) return false;
if (item.getItem() != ТвОй_КлЮч) return false;
//Двери открываются...
return true;
}
Или просто рядом с дверью блоки сломатьЗачем в двери замок, если её можно выломать? )