• Chào bạn, hãy đăng ký hoặc đăng nhập để tham gia cùng bọn mình và sử dụng được đầy đủ chức năng của diễn đàn :).
Sầu Vô Lệ

Hỏi về code plugin Code SetSpawn

Trạng thái
Không mở trả lời sau này.

Sầu Vô Lệ

THÀNH VIÊN
Tham gia
02/10/2019
Bài viết
2,199
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 về Plugin  Plugins Đố Vui
Hỏi về Plugin  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.
Similar content Most view Xem thêm
Back
Top Bottom