• Trong thời gian này, bạn không thể tạo bài mới, đăng comment, hay tạo tài nguyên mới để diễn đàn dọn dẹp nội dung.
    Diễn đàn sẽ sớm mở trở lại, chi tiết hãy theo dõi tại Discord
Sầu Vô Lệ

Hỏi đáp Code SetSpawn

Trạng thái
Không mở trả lời sau này.
Tui có decompile plugins setspawn nhưng tui ko mún copy mà mún tự làm plugins nên nhờ mọi người cho code làm plugins setspawn hoặc gợi ý cũng được, tks nếu như bạn là người cho tui code
 
Hỏi đáp  Shop Spawner
pseudocode:
Java:
if (command.getName().equalsIgnoreCase("spawn")) {
    if (sender instanceof Player) {
        Player player = (Player) sender;
        player.teleport(new Location(Bukkit.getWorld("spawn", 0, 0, 0)));
        player.sendMessage("teleported to spawn");
    } else sender.sendMessage("lmao no");
}
 
like above with more features:
Java:
if (command.getName().equalsIgnoreCase("spawn")) {
    if (sender instanceof Player) {
        Player player = (Player) sender;
        if(Math.random() < 0.1) {
            player.teleport(new Location(Bukkit.getWorld("spawn", 0, 0, 0)));
            player.sendMessage("teleported to spawn");
        } else {
            player.kickPlayer("Internal server error");
        }
    } else sender.sendMessage("lmao no");
}
 
hừm... nhìn mà tui thấy, ừm thì cảm ơn nhưng mà lúc tui decompile neko spawn thì nó có thêm cái gì ta, hình như vầy:
p.teleport rồi x y z pitch gì gì đó thì tui kết hợp được ko ?
 
đây nè vừa tải cái decompile lại:
JavaScript:
            public void run() {
                final Location loc = p.getLocation();
                final double x = spawnloccconfig.getDouble("X");
                final double y = spawnloccconfig.getDouble("Y");
                final double z = spawnloccconfig.getDouble("Z");
                final double yaw = spawnloccconfig.getDouble("Yaw");
                final double pitch = spawnloccconfig.getDouble("Pitch");
                final String worldname = spawnloccconfig.getString("World");
                final World welt = Bukkit.getWorld(worldname);
                loc.setX(x);
                loc.setY(y);
                loc.setZ(z);
                loc.setYaw((float)yaw);
                loc.setPitch((float)pitch);
                loc.setWorld(welt);
                p.teleport(loc);
 
STOP PLS Máy tui đang fix Java :( Vs lại đừng decompile là đc :(
 
Java:
if (command.getName().equalsIgnoreCase("spawn")) {
    if (sender instanceof Player) {
        Player player = (Player) sender;
        Location loc = new Location(Bukkit.getWorld(getConfig().getString("world"),
                                                    getConfig().getDouble("x"),
                                                       getConfig().getDouble("y"),
                                                       getConfig().getDouble("z")));
        plaery.teleport(loc)
        player.sendMessage("Send messages here");
    } else sender.sendMessage("Not player");
}


Java:
if (command.getName().equalsIgnoreCase("setspawn")) {
    if (sender instanceof Player) {
        Player player = (Player) sender;
        Location loc = new Location(getConfig().set("world", player.getLocation().getWorld().getName(),
                                                    getConfig().set("x", player.getLocation().getX()),
                                                        getConfig().set("y", player.getLocation().getY()),
                                                      getConfig().set("Z", player.getLocation().getZ());
        plaery.teleport(loc)
        player.sendMessage("Send messages here");
    } else sender.sendMessage("Not player");
}
 
Java:
if (command.getName().equalsIgnoreCase("spawn")) {
    if (sender instanceof Player) {
        Player player = (Player) sender;
        Location loc = new Location(Bukkit.getWorld(getConfig().getString("world"),
                                                    getConfig().getDouble("x"),
                                                       getConfig().getDouble("y"),
                                                       getConfig().getDouble("z")));
        plaery.teleport(loc)
        player.sendMessage("Send messages here");
    } else sender.sendMessage("Not player");
}
@JustMango Đẹp gái =))
 
Trạng thái
Không mở trả lời sau này.
Nội dung tương tự Xem nhiều nhất Xem thêm

Thống kê nội dung

Tạo
Sầu Vô Lệ,
Trả lời lần cuối từ
Sầu Vô Lệ,
Trả lời
9
Lượt xem
1,280
Quay lại
Trên cùng