В зависимости от меты айтемблока менять параметр блокстейты поставленного блока.

Версия Minecraft
1.12.2
699
9
53
Как мне сделать, чтобы айтемблок моего блока записывал мету айтема в параметр type блокстейта, когда ставиться блок.
type это число от 0 до 3
Заранее спасибо!
 
699
9
53
Решено:
Нужно переопределить метод:
public IBlockState getStateForPlacement(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer, EnumHand hand)
meta это мета айтемблока.
В итоге у меня получилось так:
Java:
public IBlockState getStateForPlacement(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer, EnumHand hand)
    {
        return this.getDefaultState().withProperty(TYPE, meta);
    }

@Thunder закрой тему.
 
Сверху