IItemDestroyedBlock
Link to iitemdestroyedblock
The IItemDestroyedBlock function can be added to an Item and will run whenever you try to break a block with the assiciated Item.
Импорт пакета
Link to импорт-пакета
It might be required for you to import the package if you encounter any issues, so better be safe than sorry and add the import.
import mods.contenttweaker.IItemDestroyedBlock;
Parameters
Link to parameters
The IItemDestroyedBlock is a function with the following parameters:
- IMutableItemStack stack → The item.
- IWorld world → The world this takes place in
- ICTBlockState blockState → The state of the block that is being mined.
- IBlockPos pos → Where does this take place?
- IEntityLivingBase entity → Who/What mines the block?
The Function needs to return a boolean, that is true
if the blockBreaking process is successfull, and false
if it ain't.