I'm trying to make the wither shoot multiple witherskulls at once, here's my current code: Code: public void onWitherAttack(ProjectileLaunchEvent event){ if(event.getEntity() instanceof WitherSkull){ for (int i = 0; i < 3; i++) { WitherSkull e = (WitherSkull) event.getEntity().getWorld().spawnEntity(event.getEntity().getLocation().add(randInt(-1, 1), randInt(-1, 1),randInt(-1, 1)),EntityType.WITHER_SKULL); e.setVelocity(event.getEntity().getVelocity()); } } public int randInt(int min, int max) { Random rand = new Random(); int randomNum = rand.nextInt((max - min) + 1) + min; return randomNum; } } I keep getting this error: Code: at net.minecraft.server.v1_8_R2.World.addEntity(World.java:1020) ~[spigot-1.8.3.jar:git-Spigot-2ec6f06-7722428] at org.bukkit.craftbukkit.v1_8_R2.CraftWorld.spawn(CraftWorld.java:1121) ~[spigot-1.8.3.jar:git-Spigot-2ec6f06-7722428] at org.bukkit.craftbukkit.v1_8_R2.CraftWorld.spawn(CraftWorld.java:861) ~[spigot-1.8.3.jar:git-Spigot-2ec6f06-7722428] at org.bukkit.craftbukkit.v1_8_R2.CraftWorld.spawnEntity(CraftWorld.java:377) ~[spigot-1.8.3.jar:git-Spigot-2ec6f06-7722428] at me.leothepro555.campaign.Specter.onWitherAttack(Specter.java:135) ~[?:?] at sun.reflect.GeneratedMethodAccessor469.invoke(Unknown Source) ~[?:?] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_11] at java.lang.reflect.Method.invoke(Method.java:483) ~[?:1.8.0_11] at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:301) ~[spigot-1.8.3.jar:git-Spigot-2ec6f06-7722428] at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[spigot-1.8.3.jar:git-Spigot-2ec6f06-7722428] at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:502) ~[spigot-1.8.3.jar:git-Spigot-2ec6f06-7722428] at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:487) ~[spigot-1.8.3.jar:git-Spigot-2ec6f06-7722428] Specter.java line 135 is WitherSkull e = (WitherSkull) event.getEntity().getWorld().spawnEntity(event.getEntity().getLocation().add(randInt(-1, 1), randInt(-1, 1),randInt(-1, 1)),EntityType.WITHER_SKULL);
@megamichiel Same error @megamichiel Okay, i tried other projectiles, and they all work except witherskull EDIT by Moderator: merged posts, please use the edit button instead of double posting.
@megamichiel that is the full error. Just multipied by 100 + times, over and over again then the server crashes.
@timtower @Hex_27 This does now belong to this forum, It belongs here. http://bukkit.org/forums/plugin-help-development-requests.91/ Because, ~[spigot-1.8.3.jar:git-Spigot-2ec6f06-7722428]
@megamichiel I used the search function on the log where this happened for the word (or part of word) Exception, but found none that was applicable.