EggAPI
What is this?
EggAPI is a plugin which I made to make it easier for plugin developers who are fairly new to be able to add spawn eggs easily to a player's inventory using an easy method
How does it work?
First you must import the plugin in to your build path
After importing, you're pretty much set! Now all you need to do is learn how to add eggs:
Player p = (Player) sender ; p.getInventory().addItem(getEgg.EggMooshroom) ;
The 'Mooshroom' part can be replaced with anything, the names are exactly the same as in minecraft.
So you could do: EggCow, EggSkeleton, EggGhast, EggZombiePigman etc...
Finally you must add the plugin in to your plugins folder in your Minecraft Server
You're all done!
Note: If it does not ask you to import anything it says it cannot be found: you can import it manually using:
import EggAPI.getEgg;
How this can be used
This is a very simple demonstration
if ( cmd.getName().equalsIgnoreCase("soupcow") ) { Player p = (Player) sender ; p.getInventory().addItem(getEgg.EggMooshroom) ; }
Summary
Very simple plugin to help out beginners
Known Errors
None, if any found please tell me
@ZodiacTheories
Then define it differently according to your event/command.
And NPC's cannot execute commands.
What if the sender isn't a Player?
@UHoplite
Thanks, and I fixed the code :D
Very nice idea indeed, I may test this.
BTW, use this code:
The code in the description won't work.