Please let me know if there are any issues with the beta, We haven't had any multiplayer mods to test it on yet.
Changelog:
v1.1.0: Added server version, removed getTier(), as it was ambiguous and not very useful, and there was no real reason to make people fill it out.
What is Sparrow?
Sparrow is an API that allows for better interaction between Entities. It has two main components: SparrowAPI (made by RaustBlackDragon), and SimplyID (made by Lil Avii).
SparrowAPI is an interface that any entity can implement, and it adds various methods of obtaining and giving out standardized bits of information, so that entities can make more informed decisions.
SimplyID is a system that allows for entities to save and load entities by giving each Sparrow-using entity a unique ID that they keep until they die.
Sparrow is easy to use, edits no base classes, and won't conflict with any mod that doesn't use it, so there are no downsides to joining! To adopt the API, just make your entities implement SparrowAPI, and then assign values for each of the functions contained within SparrowAPI.
Here's the source code for SparrowAPI, and the kinds of questions you can ask by implementing it:
package net.minecraft.src;
public interface SparrowAPI
{
/**Is this thing like a creeper, in that engaging it in combat has unexpected consequences? Would this entity and its allies be better off not fighting it at all? Set this to true if the attacker's combat abilities are basically a non-factor in what will happen to it if it fights this.*/
public boolean isStupidToAttack();
/**When a mod triggers an event that would set an entity to be dead with no reference to damage, should this entity be spared?*/
public boolean doNotVaporize();
/**Does this entity attack non-player entities on sight?*/
public boolean isPredator();
/**Does this entity attack the player on sight?*/
public boolean isHostile();
/**Is this entity incapable of combat?*/
public boolean isPeaceful();
/**Is this entity viable prey for a predator?*/
public boolean isPrey();
/**Will this entity attack, but only when provoked?*/
public boolean isNeutral();
/**Is this entity incapable of taking damage, and thus pointless to attack?*/
public boolean isUnkillable();
/**Should this entity be considered a threat to par1entity?*/
public boolean isThreatTo(Entity par1entity);
/**Should this entity be considered a friend of par1entity?*/
public boolean isFriendOf(Entity par1entity);
/**Is this entity what people would generally consider to be an NPC?*/
public boolean isNPC();
/**Is this a pet? 0 if not, 1 if it can be but isn't currently, 2 if it is.*/
public int isPet();
/**Who is this pet's owner?*/
public Entity getPetOwner();
/**What is the name of this individual entity?*/
public String getName();
/**What is this entity currently targeting with intent to kill? Used to differentiate between the attack method monsters use and the attack method used for breeding and following*/
public Entity getAttackingTarget();
/**What is the size of this entity? Multiply its two dimensions (X and Z are considered the same) in terms of blocks and put in the result ( a chicken would be .3 * .7, which is roughly .2)*/
public float getSize();
/**What should this entity be referred to as? (Dog, Cat, Human, Enderman, etc.)*/
public String getSpecies();
/**What is this entity's gender? 1 for male, 2 for female, 0 for neither*/
public int getGender();
/**This is for mod-specific features. A mod can search for a response to a custom string, and you can add in whether or not they'll respond to it here, and what the response will be.*/
public String customStringAndResponse(String s);
/**Have this return the string you store your simplyID in. Use the function SimplyID.getNextSimplyID(this) to assign a simplyID to your entities that implement Sparrow.*/
public String getSimplyID();
}
Note about SimplyID:
Set it to "needID" by default, save and load it with NBT tags, and add this into onLivingUpdate():
Take the class files in the zip file download, and put them directly into your minecraft jar. It edits no base classes, but it needs to go into the jar to make sure it loads before any folder-loaded mods that use it.
DISTRIBUTION:
Sparrow is distributed freely, and neither I nor Lil' Avii have any issues with you adding Sparrow into your own API to reduce the number of downloads needed, which would be quite convenient for your users.
All we ask is that you don't claim it as your own original work, and that you mention it in any API you include it in, so people know where to ask questions about it.
If you have any questions about the API, please contact me, RaustBlackDragon, via PM.
Great Stuff guys! Avii, I didn't know you were involved with this? Sneaky!
Thanks for sharing this with everyone. Perhaps an example list could be provided in OP of the kinds of information this API would allow people to share and gain regarding mobs and how it would benefit them? What you showed me certainly made me a believer.
Rollback Post to RevisionRollBack
- The Cubic Chunks Mod is back! Be a part of it's rebirth and Development.
-- Robinton's Mods: [ Mirror ] for some of his Mods incl Cubic Chunks Mod, due to DropBox broken links.
Great Stuff guys! Avii, I didn't know you were involved with this? Sneaky!
Thanks for sharing this with everyone. Perhaps an example list could be provided in OP of the kinds of information this API would allow people to share and gain regarding mobs and how it would benefit them? What you showed me certainly made me a believer.
Excellent Idea, I've just posted the source code in the OP!
Yes it does. Basically, it lets entities get a more accurate assessment of eachother, categorize them, etc. You can make mass-attacks not harm your friends/pets, you can have your mobs easily determine what they should and shouldn't attack, among other things
Sure thing!Alright, just added the download for the source code to the OP. It's separate so as not to complicate the download for mod-users, but I think it's just as convenient for mod-makers.
This is pretty amazing, it would be wonderful to start seeing more meaningful interaction between MC creatures. =D
Thanks for the votes of confidence! We're trying to get more modders to use it, and we've gotten a few who sound interested. If you know any modders who could benefit from this API, feel free to let them know about it!
Download Sparrow1.1.0 Client Here!
Download Sparrow1.1.0 Server Here!
Download Sparrow1.1.0's Source Here!
Download Beta for 1.3.2 HERE!
Betas for 1.3.1:
Beta Client
Beta Client Source
Beta Server
Beta Server Source
Example Sparrow Entity Here
Please let me know if there are any issues with the beta, We haven't had any multiplayer mods to test it on yet.
Changelog:
v1.1.0: Added server version, removed getTier(), as it was ambiguous and not very useful, and there was no real reason to make people fill it out.
What is Sparrow?
Sparrow is an API that allows for better interaction between Entities. It has two main components: SparrowAPI (made by RaustBlackDragon), and SimplyID (made by Lil Avii).
SparrowAPI is an interface that any entity can implement, and it adds various methods of obtaining and giving out standardized bits of information, so that entities can make more informed decisions.
SimplyID is a system that allows for entities to save and load entities by giving each Sparrow-using entity a unique ID that they keep until they die.
Sparrow is easy to use, edits no base classes, and won't conflict with any mod that doesn't use it, so there are no downsides to joining! To adopt the API, just make your entities implement SparrowAPI, and then assign values for each of the functions contained within SparrowAPI.
Here's the source code for SparrowAPI, and the kinds of questions you can ask by implementing it:
Note about SimplyID:
Set it to "needID" by default, save and load it with NBT tags, and add this into onLivingUpdate():
HOW TO INSTALL:
Take the class files in the zip file download, and put them directly into your minecraft jar. It edits no base classes, but it needs to go into the jar to make sure it loads before any folder-loaded mods that use it.
DISTRIBUTION:
Sparrow is distributed freely, and neither I nor Lil' Avii have any issues with you adding Sparrow into your own API to reduce the number of downloads needed, which would be quite convenient for your users.
All we ask is that you don't claim it as your own original work, and that you mention it in any API you include it in, so people know where to ask questions about it.
If you have any questions about the API, please contact me, RaustBlackDragon, via PM.
good mod
No wood required!
Thanks for sharing this with everyone. Perhaps an example list could be provided in OP of the kinds of information this API would allow people to share and gain regarding mobs and how it would benefit them? What you showed me certainly made me a believer.
- The Cubic Chunks Mod is back! Be a part of it's rebirth and Development.
-- Robinton's Mods: [ Mirror ] for some of his Mods incl Cubic Chunks Mod, due to DropBox broken links.
- Dungeon Generator for the Open Cubic Chunks Mod
- QuickSAVE-QuickLOAD for the Open Cubic Chunks Mod
Excellent Idea, I've just posted the source code in the OP!
Yes it does. Basically, it lets entities get a more accurate assessment of eachother, categorize them, etc. You can make mass-attacks not harm your friends/pets, you can have your mobs easily determine what they should and shouldn't attack, among other things
It's compatible with everything, it edits no base classes
Sweet thanks!!!
Sure thing!Alright, just added the download for the source code to the OP. It's separate so as not to complicate the download for mod-users, but I think it's just as convenient for mod-makers.
Thanks for the votes of confidence! We're trying to get more modders to use it, and we've gotten a few who sound interested. If you know any modders who could benefit from this API, feel free to let them know about it!
...
Although, I do have one question: What new features will this API have in the near future?