would require client mod. Sorry, new content can not be added, only new features like gameplay, but no new blocks/specialeffects/etc... are possible without clientside modding
Havent looked into the technical details yet but it should be possible with (Craft)Bukkit! I added (Craft) as the methods might be missing in Bukkit yet.
lol dont think too much code all the time ... I just meant that you might have to use craftbukkit instead of bukkit
ok, I think I may have found a way, not sure, and I not going to take 2 hours (not that long really) to make it and test to see if it works. Basically import org.bukkit.entity.Fireball and create a new fireball object. then set its location to a position in the world and that should make it appear, then I think just set its velocity, as seeing it's an entity I think that's how you could do it. I've done it with other entities, like spawning creepers I just make a new Creep entity and set a location using the teleport and it appeared...
I forget, I'd have to look up my script again. making a new entity was hard, I was confused for like 2 weeks, cause it's an interface, there's no constructors, I found a way but... I'll get back to you when I get it again.
Courtesy of Nathanwolf: CraftPlayer craftPlayer = (CraftPlayer) player; EntityLiving playerEntity = craftPlayer.getHandle(); EntityFireball fireball = new EntityFireball(((CraftWorld) player.getWorld()).getHandle(), playerEntity, dx, dy, dz); // Start it off a bit away from the player double distance = 4; Vector aim = targeting.getAimVector(); fireball.locX = playerLoc.getX() + aim.getX() * distance; fireball.locY = playerLoc.getY() + (height / 2.0) + 0.5; fireball.locZ = playerLoc.getZ() + aim.getZ() * distance; ((CraftWorld) player.getWorld()).getHandle().a(fireball);
Thanks I got it now Lol thankyou more thats better than what I got, except for the .a part crashes and thinks its a lightning strike, instead do .addEntity Although how do u get targeting? EDIT by Moderator: merged posts, please use the edit button instead of double posting.
I like to use Location target = null; for (Block b : player.getLineOfSight(null, 200) { if (!b.getType().equals(Material.AIR) { target= b.getLocation(); }
ty But it doesnt give any accuracy the way Im doing it, how would I spawn it directly were Im aiming, it seems to change to different directions all the time, unles when I double fire it goes perfectly straight
Fireballs are really iffy, I think! I spent quite a bit of time making them available in Bukkit via the World.spawn(Location, Class<? extends Entity>) method. Basically, they need a direction vector that's a bit larger than a normalized direction vector for better accuracy. See the [CraftBukkit implementation](https://github.com/Bukkit/CraftBukkit/commit/7a32a38e72e605d3d2c7c7fb5f979ab50f799291) for an example. For my own plugin CannonBall (soon to be named "Cannons and Grenades"), I calculate the player's hand position to make them fly from about there (they explode right away if spawned in an occupied location). They will still fly a bit off target though since they use a built-in random spread factor. If there is enough interest in exposing that (like it is for arrows), I would be happy to have a go at that.
thanks btw what is the entity fish? EDIT by Moderator: merged posts, please use the edit button instead of double posting.
It's not a fish! It's the little bobber at the end of a fishing line when you fish. Someone misnamed it and the associated Bukkit interface.
Oh lol, I thought It was like a secret new entity that noone told us about I could read the code and I noticed it had something to do with the bobber But I just didnt realise lol Btw how do you spawn a fish then? world.spawn(location,fish);? While I have you here, since when has the play effect method been there?
I dont know why you are having such a hard trouble finding a way to shoot fireballs. The Essentials plugin allows a player to /fireball as well as assign a command such as /fireball to an item using /pt