07-12-2013, 04:27 AM
I prefer to call the number "type", rather than "id". ID means unique, two spiders have different IDs So why not call the function StringToMobType(). If you write it in C/C++, you can also make it built in into MCS as an API (see StringToDamageType and DamageTypeToString functions in BlockID.cpp for inspiration)
Instead of doing a ForEachPlayer(), you can also do DoWithPlayer() that calls the callback only once. But then, if you have multiple players of the same name (perfectly legal in MCS), only the first one would match.
Instead of doing a ForEachPlayer(), you can also do DoWithPlayer() that calls the callback only once. But then, if you have multiple players of the same name (perfectly legal in MCS), only the first one would match.