Hello people, I have looked around on how to summon a falling block in 1.14.4 and have been unable to find anything other than basic spawn entity - Code: FallingBlock block = (FallingBlock) player.getWorld().spawnEntity(randomLoc, EntityType.FALLING_BLOCK); And when I tried it the block doesn't appear at all, I'm assuming it's got to do with how long it's meant to live for but I have no clue what to do to make the block actually appear. I'd also like to know how to set the falling block to a certain material. Thanks, Me
Material.values() returns an array of all materials, get a random number within the range of the array and use it as the index. You should also check if the material is a block EDIT: Since there are a lot of materials which aren't blocks, maybe it's more efficient to shuffle the array (convert to arrayList e.g.) and loop over it until there is a block, maybe not