Код: Выделить всё
public ActionResultType onBlockActivated(BlockState state, World worldIn, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) // Client-side: Only show a status message
if (worldIn.isRemote()) {
player.sendStatusMessage(new StringTextComponent("Client: Block activated!"), true);
return ActionResultType.SUCCESS;
}
// Server-side logic below
player.sendMessage(new StringTextComponent("blockActivated"), player.getUniqueID());
}
Подробнее здесь: https://stackoverflow.com/questions/796 ... rge-1-16-5