How do i spawn a rainbow sheep ? I wan't to spawn a rainbow sheep and name it something like: "Colorful sheep".
I dont think that this is possible without having lots of code. Maybe you can name a sheep spawn egg jeb_ and find a way to give it a 'fake name'
Nojus Create a BukkitRunnable. Create a sheep. Create an array of sheepwool colors in the order you want the sheep to change colors. Create an int variable which is used as indicator. Inside the runnable; check if variable equals arraylength, if so, set variable back to 0. get color from array using the variable and put it on the sheep. increase int variable by 1.
Aqua Can you make the code, i don't really understand what you said.. (My english is not really good)
we don't make a plugin/code for you. you need to learn it by yourself. so what I mean you can begin with making the code and when you have found something that doesn't work, then can you post it here. here is something that can help you Code: Sheep p = Bukkit.getWorld("world").spawn( e.getPlayer().getLocation(), Sheep.class); p.setCustomName("§cSwagg"); p.setCustomNameVisible(true);
Code:java Sheep p = Bukkit.getWorld("world").spawn(player.getLocation(), Sheep.class); p.setCustomName("§cSwagg"); p.setCustomNameVisible(true); p.addPotionEffect(new PotionEffect(PotionEffectType.SLOW, Integer.MAX_VALUE, Integer.MAX_VALUE)); Its working but server crashes when i spawn it.. Why? It says: Internal Exception: io.netty.handler.timeout.ReadTimeoutException
Nojus The error means the connection between client and server timed out. This error happen with bad internet connection or the server crashing.
If you believe that those crashes are connected to your plugin, we need more data. For example any excpetions that pop up, the server crash logs, ...
DxDy Server just freezez and i can't do command or see anything like errors. FIXED IT So can someone make the code? EDIT by Moderator: merged posts, please use the edit button instead of double posting.
I made this: Code:java BukkitTask runnable = new BukkitRunnable() { int colors = 16; @Override public void run() { colors -= 1; p = world.spawn(loc, Sheep.class); p.setCustomName("§aS§bp§ca§dl§ev§fo§at§ba §favis!"); p.setCustomNameVisible(true); p.setColor(dyeColors[colors]); p.addPotionEffect(new PotionEffect(PotionEffectType.SLOW, 1000000, 1000000)); if (colors == 1) { colors = 16; } } }.runTaskTimer(this, 20L, 20L); now inside that i need scheduleSyncDelayedTask but i can't put that there... (to remove the sheep after some time) any sugestions?
Make your runnable a proper class and store the reference to your sheep instead of spawning a new sheep every second