Just a quick question, i'm wanting to spawn tnt at specified locations and I cannot figure out how to add world to the code: Code: } Location loc18 = new Location(Bukkit.getWorld("world"), 1, 60, 1); if(event.getPlayer().getItemInHand().getTypeId() == Material.GHAST_TEAR.getId()){ TNTPrimed tnt = (TNTPrimed) world.spawn(loc18, TNTPrimed.class); player.getInventory().remove(Material.GHAST_TEAR); } The error is world.spawn..... I know I have to do something like World world = I dont know what goes here Thanks! -Cosmicluck
Well you can do this: Code:java TNTPrimed tnt = (TNTPrimed) loc18.getWorld().spawn(loc18, TNTPrimed.class);
You already used the exact code that you need in the first line... the new Location(world, x, y, z); wanted a World as the first argument, and look at what you passed into it: so thats how you get a world. (though its far from the best way, that's a topic for a different discussion) now you just put 2 and 2 together: World world = I dont know what goes here Bukkit.getWorld("world");