플러그인으로 플레이어가 죽으면 자동으로 새로운 월드를 생성하는 것을 만들려고 하는데
버킷을 켜놓고 월드를 초기화하는 것이 가능하나요?
https://bukkit.org/threads/reset-world-on-command.486926/
보고 명령어로 작성해 봤는데, 'An internal error occurred while attempting to perform this command' 라고 뜨네요. 위에 있는 걸로도 해봐도 변화가 없고 어떻게 해야 하나요??
public class ResetCommand implements CommandExecutor {
private Hardcore plugin;
public ResetCommand(Hardcore plugin) {
this.plugin = plugin;
}
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
Player p = (Player) sender;
FileConfiguration config = plugin.getConfig();
World worldtp = Bukkit.getWorld(config.getString("Spawn.World"));
double x = config.getDouble("Spawn.X");
double y = config.getDouble("Spawn.Y");
double z = config.getDouble("Spawn.Z");
float yaw = (float) config.getDouble("Spawn.Yaw");
float pitch = (float) config.getDouble("Spawn.Pitch");
Location location = new Location(worldtp, x, y, z, yaw, pitch);
World world = p.getWorld(); // The world you want to reset
for(Player player : Bukkit.getOnlinePlayers()){
player.teleport(location);
String worldName = world.getName(); // The world name
if (!Bukkit.unloadWorld(world, false)) return false;
File worldFolder = new File(plugin.getDataFolder().getParentFile().getParentFile(), worldName); // World folder
worldFolder.delete(); // Delete world folder
Bukkit.createWorld(new WorldCreator(worldName)); // Create the world
return false;
'An internal error occurred while attempting to perform this command' 는 명령어 실행시 오류나면 어디서든 띄워주는 오류 메세지구요, 아래에 내용을 알려주셔야 뭐라도 해결해볼거같네요
건축
KHC
2024-10-25
2
2024-10-10
dbasd12
2024-10-09
레드스톤
노트블럭전문가
2024-10-08
1
팁
물귀신
2024-10-06
3
0reo
2023.06.17https://bukkit.org/threads/reset-world-on-command.486926/
오캣진
2023.06.17보고 명령어로 작성해 봤는데, 'An internal error occurred while attempting to perform this command' 라고 뜨네요. 위에 있는 걸로도 해봐도 변화가 없고 어떻게 해야 하나요??
public class ResetCommand implements CommandExecutor {
private Hardcore plugin;
public ResetCommand(Hardcore plugin) {
this.plugin = plugin;
}
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
Player p = (Player) sender;
FileConfiguration config = plugin.getConfig();
World worldtp = Bukkit.getWorld(config.getString("Spawn.World"));
double x = config.getDouble("Spawn.X");
double y = config.getDouble("Spawn.Y");
double z = config.getDouble("Spawn.Z");
float yaw = (float) config.getDouble("Spawn.Yaw");
float pitch = (float) config.getDouble("Spawn.Pitch");
Location location = new Location(worldtp, x, y, z, yaw, pitch);
World world = p.getWorld(); // The world you want to reset
for(Player player : Bukkit.getOnlinePlayers()){
player.teleport(location);
}
String worldName = world.getName(); // The world name
if (!Bukkit.unloadWorld(world, false)) return false;
File worldFolder = new File(plugin.getDataFolder().getParentFile().getParentFile(), worldName); // World folder
worldFolder.delete(); // Delete world folder
Bukkit.createWorld(new WorldCreator(worldName)); // Create the world
return false;
}
}
0reo
2023.06.18'An internal error occurred while attempting to perform this command' 는 명령어 실행시 오류나면 어디서든 띄워주는 오류 메세지구요, 아래에 내용을 알려주셔야 뭐라도 해결해볼거같네요