Guest User

Untitled

a guest
Dec 22nd, 2022
21
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. Player player = (Player) sender;
  2.  
  3. FileUtil util = new FileUtil(FileUtil.getDataFile("test.yml", "mines"));
  4. YamlConfiguration configuration = util.getConfiguration();
  5.  
  6. Location center = player.getLocation();
  7. for (String key : configuration.getKeys(false)) {
  8. if (key.equalsIgnoreCase("spawn")) {
  9. continue;
  10. }
  11. Bukkit.broadcastMessage("ran");
  12.  
  13. ConfigurationSection section = configuration.getConfigurationSection(key);
  14. double x = section.getDouble("x");
  15. double y = section.getDouble("y");
  16. double z = section.getDouble("z");
  17.  
  18. player.getWorld().getBlockAt((int) (center.clone().getX() + x), (int) (center.clone().getY() + y), (int) (center.clone().getZ() + z)).setType(Material.valueOf(section.getString("material")));
  19. }
Advertisement
Add Comment
Please, Sign In to add comment