Hello, I'm trying to spawn some blocks at some locations. However I can't find any documentation in the javadoc's.
Do you want the blocks to drop so players can pick them up or do you want the be stacked at a particular location?
location.getBlock().setType(...) will "spawn" a block at a given location (it will replace the block at the location)
You don't spawn blocks, you change blocks, and all the blocks you ever need are there. In empty places there's a block called "air," so to create a block you would do Code: location.getBlock().setType(material) Hope I helped Oh rats, you beat me to it.
Thank you all, well I have a new problem now. Ever since adding this block code, my monsters spawn for like half a second then disappear. Any ideas why? Code: if (argument.equalsIgnoreCase("start")) { player.sendMessage(ChatColor.GOLD + "The invasion has been started!"); checkfor = true; currentworld = player.getWorld(); blockspawnpoint = entrancepoint; blockspawnpoint.add(0, 1, 0); zombie = CreatureType.ZOMBIE; for (int i = 0; i < 10; i++) { currentworld.spawnCreature(entrancepoint, zombie); } blockspawnpoint.getBlock().setTypeId(52); }
Ah now I did not think of that, duh! Ya my bad, I will go to my other world and see if it works thanks.