And also, the mobs dont do loot when I use custom weapon to kill them.
That's a weird issue with custom weapons. You'll have to use the deathHook() function to make mobs drop loot manually.
Let me see if I can make up an example code here.
ModPE.setItem(710, "sword", 0, "Better Wooden Sword", 1);
ModPE.setItem(711, "skull_zombie", 0, "Zombie Head", 1);
Item.setHandEquipped(710, true);
Item.setHandEquipped(711, true);
/*Any crafting recipes,
Damage settings, or
other Item functions should
be put here.*/
/*Your attackHook()
function here*/
function deathHook(a, v) {
x = Entity.getX(v);
y = Entity.getY(v);
z = Entity.getZ(v);
mobid = [insert array of mob IDs];
mobdrops = [insert array of item IDs that correspond to the mob IDs]
if (Player.getCarriedItem() == 710) {
for (i = 0; i < mobid.length; i++) {
random = Math.floor(Math.random()*(3));
if (v == mobid<em>) {
if (random > 0) {
Level.dropItem(x, y, z, mobdrops<em>, random, 0);
}
}
}
}
if (Player.getCarriedItem() == 710) {
for (i = 0; i < mobid.length; i++) {
random = Math.floor(Math.random()*(3));
if (v == mobid) {
if (random > 0) {
Level.dropItem(x, y, z, mobdrops, random, 0);
}
}
}
}
}
The Meaning of Life, the Universe, and Everything.
Join Date:
4/7/2016
Posts:
48
Member Details
1. Can someone tell me how to use texture offset for custom mob models, like how you know where x, y on the png file and where setTextureOffset (0,0) starts at
2. Do any one know how to spawn a mob facing the direction your facing at?
I think I have a problem with the custom texture, It seems that modded items does not have its custom texture and when I pressed it, blocklauncher crashes.
Hello! I was wondering if anyone could help me, I really want to make a mod which includes random mob textures for MCPE. I’ve already figured out how to do this using OptiFine on the Java PC edition, but I really want to do this on pocket edition as well. For example: I would really like to make a bunch of different types of textures for cows, I’ve already made 46 different textures named cow2.png, cow3.png etc. and I’ve loaded OptiFine on my MCPE with no luck. I’ve tried several different options, also tried including a JSON file in my MCPACK zip file but the only thing that happens is I can get the main cow texture to change. If anyone has any ideas or insight, it would be greatly appreciated!
I've tried replacing the first "Monado.png" with a direct imgur link as well, but BlockLauncher keeps saying that "the item icon Monado.png/(imgur link):0 doesn't exist." I'm beyond confused at this point, but thanks for any help.
Hi guys, this is my first tread here and i hope you can help me.
It's been a while since i've been trying to install some mods on minecraft pe, i've found the right minecraft version(0.14/0.15/0.16) and i've found the right block launcher version, but when i try to open block launcher, it just doesn't work...
My smartphone is a Zenfone 3 (8.0.0 android version) and the message that appears, when i try to open the app, says: "BlockLaucher Stopped".
I'll be very grateful if you can help me.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
So for what I'm reading, you have a working code. Right after the:
Add this in for every item that you want to wield like a normal sword or tool, right after the setItem() functions:
Make sure to replace id for the ID of your custom weapons.
That's a weird issue with custom weapons. You'll have to use the deathHook() function to make mobs drop loot manually.
Let me see if I can make up an example code here.
ModPE.setItem(710, "sword", 0, "Better Wooden Sword", 1); ModPE.setItem(711, "skull_zombie", 0, "Zombie Head", 1); Item.setHandEquipped(710, true); Item.setHandEquipped(711, true); /*Any crafting recipes, Damage settings, or other Item functions should be put here.*/ /*Your attackHook() function here*/ function deathHook(a, v) { x = Entity.getX(v); y = Entity.getY(v); z = Entity.getZ(v); mobid = [insert array of mob IDs]; mobdrops = [insert array of item IDs that correspond to the mob IDs] if (Player.getCarriedItem() == 710) { for (i = 0; i < mobid.length; i++) { random = Math.floor(Math.random()*(3)); if (v == mobid<em>) { if (random > 0) { Level.dropItem(x, y, z, mobdrops<em>, random, 0); } } } } if (Player.getCarriedItem() == 710) { for (i = 0; i < mobid.length; i++) { random = Math.floor(Math.random()*(3)); if (v == mobid) { if (random > 0) { Level.dropItem(x, y, z, mobdrops, random, 0); } } } } }getCarriedItem();
{if (getCarriedItem ()== 331)
{
clientMessage("Hi");
}
}
It doesnt work.
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumHey,
Ive been trying to get custom textures in my mcpe mod but i cant get it to work., ill give you the script im using
ModPE.overrideTexture("images/items-opaque.png", "my drop box link to items_opaque");
ModPE.setItem(369, "blaze_rod", 0, "Blood Rod");
Btw the blaze rod is the item i edited and i made it red!
Ok and if you say to make a var thing, dont. I tried and it doesnt make a difference
2. Its in the wrong order? the other way brings up an error msg in block launcher (same with the var)
Plz help!
1. Can someone tell me how to use texture offset for custom mob models, like how you know where x, y on the png file and where setTextureOffset (0,0) starts at
2. Do any one know how to spawn a mob facing the direction your facing at?
How do you make a consumable item as in like when you attack something holding this item, the item will be reduced by one as in number not data?
Remember the time where minecraft was in development? Oh wait, I actually don't remember it...
I think I have a problem with the custom texture, It seems that modded items does not have its custom texture and when I pressed it, blocklauncher crashes.
Someone please help me.
Remember the time where minecraft was in development? Oh wait, I actually don't remember it...
tbh I just do what other mods are doing
I will post it here since its pretty basic enough.
ModPE.setItem(500,"papersword",0,"Paper Sword",1);Item.setHandEquipped(500, true);
I save the texture in papercraftformyself.zip/assets/images/items-opaque
Also, many ppl commented this too in zhouwei's twitter
Remember the time where minecraft was in development? Oh wait, I actually don't remember it...
Nvm, I decided to use the beta that is able to support modpkgs...
anyway, how do you set another mob to look at the player?
Remember the time where minecraft was in development? Oh wait, I actually don't remember it...
Hello! I was wondering if anyone could help me, I really want to make a mod which includes random mob textures for MCPE. I’ve already figured out how to do this using OptiFine on the Java PC edition, but I really want to do this on pocket edition as well. For example: I would really like to make a bunch of different types of textures for cows, I’ve already made 46 different textures named cow2.png, cow3.png etc. and I’ve loaded OptiFine on my MCPE with no luck. I’ve tried several different options, also tried including a JSON file in my MCPACK zip file but the only thing that happens is I can get the main cow texture to change. If anyone has any ideas or insight, it would be greatly appreciated!
Thank you so much!
Amber
Hey,
I've been attempting to just get a texture going. Here's my code:
var montex = "Monado.png";
ModPE.overrideTexture("images/items-opaque.png", montex);
ModPE.setItem(500, montex, 0, "Monado");
I've tried replacing the first "Monado.png" with a direct imgur link as well, but BlockLauncher keeps saying that "the item icon Monado.png/(imgur link):0 doesn't exist." I'm beyond confused at this point, but thanks for any help.
Hi guys, this is my first tread here and i hope you can help me.
It's been a while since i've been trying to install some mods on minecraft pe, i've found the right minecraft version(0.14/0.15/0.16) and i've found the right block launcher version, but when i try to open block launcher, it just doesn't work...
My smartphone is a Zenfone 3 (8.0.0 android version) and the message that appears, when i try to open the app, says: "BlockLaucher Stopped".
I'll be very grateful if you can help me.