Hey treebl, dude great work with all your doing c:
Im sure people have already asked this but im wondering if using this i could add a new mob? If not i dont mean to come off as another annoying person badgering you with questions lol cx
But if its possible id love to know, and thanks again for all your work bro!
L0L how dafuq do i use this??? wanna make 3 zombies in-game... 1 looks like herobrine, 1 like a player and 1 as a normal zombie... ok i'll get the PNG but Wat do i do??? BTW i also want the player to spawn less frequent, let him be non-hostile and normal-speed... Any Way to do it??
Hey guys, I figured I would release some code to show you how to make entities programmatically. Tommorow I'm going to be posting a tutorial on vTables and adding different behaviors/attributes to your entities (ex health, drop item, movement, etc.), but this is a good start =).
/*
Entity Creation Research and Code by Carter Feldman - aka TreeBl
If you use this, you MUST NOT remove this comment block.
Licensed under the creative commons attribution license.
*/
//Add this to the top of your tweak
typedef void (*int2)(int a, int B);
typedef void (*int3)(int a, int b, int c);
typedef void (*ifff)(int a, float b, float c, float d);
int2 MakeAnimal;
int2 LevelAddEnt;
int3 MobSetSize;
ifff setPos;
//--End
//Add this below
unsigned int * makeChicken(float x, float y, float z, char * imageName)
{
unsigned int * chicken = new unsigned int[0xC30/4];
MakeAnimal((int)chicken,(int)levelAddr);
chicken[0] = (unsigned int)(0x207AA8-0x1000+myPidAddr);//vtable
*((char *)((int)chicken+0xC14)) = 0;
chicken[0xC18/4] = 0;
chicken[0xC1C/4] = 0;
chicken[0xC20/4] = 0;
chicken[0xC24/4] = 0;
chicken[0xC28/4] = 0x3F800000;
chicken[0xC2C/4] = 0;
chicken[0xb0/4] = 6;
std::string * charImg = (std::string *)((int)chicken+0xB64);
*charImg = imageName;
MobSetSize((int)chicken, 0x3E99999A, 0x3F333333);
setPos((int)chicken,x,y,z);
LevelAddEnt(levelAddr,(int)chicken);
return chicken;
}
unsigned int * makeCow(float x, float y, float z, char * imageName)
{
unsigned int * cow = new unsigned int[0xC30/4];
MakeAnimal((int)cow,(int)levelAddr);
cow[0] = (unsigned int)(0x207CF8-0x1000+myPidAddr);
cow[0xb0/4] = 7;
std::string * charImg = (std::string *)((int)cow+0xB64);
*charImg = imageName;
MobSetSize((int)cow, 0x3f666666, 0x3FA66666);
setPos((int)cow,x,y,z);
LevelAddEnt(levelAddr,(int)cow);
return cow;
}
//--End
//Add this somewhere else and call it on init
void setupCFunctions(int baseAddress)//Call this with the base address of minecraftpe
{
int myPidAddr=baseAddress;
MakeAnimal = (int2)(0xB2004-0x1000+myPidAddr);
MobSetSize = (int3)(0xC124C-0x1000+myPidAddr);
setPos = (ifff)(0xB5174-0x1000+myPidAddr);
LevelAddEnt = (int2)(0xF4FAC-0x1000+myPidAddr);
}
//--End
Example Usage:
unsigned int * myCow = makeCow(10.0f, 100.0f, 20.0f, "mob/cow.png");
unsigned int * myCow2 = makeCow(10.0f, 100.0f, 20.0f, "mob/customskin.png");
unsigned int * myChicken = makeChicken(10.0f, 100.0f, 20.0f, "mob/chicken.png");
unsigned int * myChicken2 = makeChicken(10.0f, 100.0f, 20.0f, "mob/customchicken.png");
I understand the code but I don't under stand where. Would I place this?
The lib file?
I don't really know but this must be i think the minecraftpe file... open it with IDA demo (google it) and paste da code... then test it!!! PS:make a backup coz i never tried it but i think this should work...but still back up... if works then tell me... good luck 4 ur mod!!!
Can we add mobs that actuly spawn in the game not that we have to spawn them. Also in the next update for carbon can u move it next to the chat sign and make it so that it has a minecraft feel to it.
What do you mean?
Im sure people have already asked this but im wondering if using this i could add a new mob? If not i dont mean to come off as another annoying person badgering you with questions lol cx
But if its possible id love to know, and thanks again for all your work bro!
The lib file?
I meant I convert your Code and converted it to strings and pasted the strings in a file ( HI.js)but I do not know where to put it
Endermen
GiantHerobrineGhast
?????????
This is C, not javascript, and what the hell do you mean by converted it to strings, its already a string!
I meant where do you put the hihi,js file
I'm smart your stupid
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumCheck out my game! It's an open-world, sandbox text adventure.
Follow @hexdro_
Hexdro © 2012-2015
How can he say that with that kind of spelling?
I don't really know but this must be i think the minecraftpe file... open it with IDA demo (google it) and paste da code... then test it!!! PS:make a backup coz i never tried it but i think this should work...but still back up... if works then tell me... good luck 4 ur mod!!!