Minecraft Pi - normalise block code

mc_block_id  name (symbol_or_number)

Given a block name or id will return a number representing the id of the block or throw an exception if the name or id isn’t valid

Introduced in v2.5

Examples

# Example 1

puts mc_block_id :air



#=> 0



# Example 2

puts mc_block_id 0 



#=> 0



# Example 3

puts mc_block_id 19



#=> Throws an invalid block id exception



# Example 4

puts mc_block_id :foo



#=> Throws an invalid block name exception