The Meaning of Life, the Universe, and Everything.
Join Date:
7/21/2014
Posts:
58
Minecraft:
Skkkitzo
Member Details
So I am a pretty average modder. I do a few things, fix bugs, finish mods... Etc. But recently I have found the strangest error ever in ModPE. I can't give any names of blocks away just yet because it has not been released, but I will give the code without the name
Now when I load up the game, and try to craft this block, something very odd happens. First of all, the game lags a bit, then in your hotbar it says you have the block, but in your hand it isn't there, and then on the floor next to the crafting table it has this "Ghost Item". By this I mean whenever you go 1 block near it, it crashes your whole game — sometimes even my device. I have no idea why this is happening and I've tried everything; from changing the id to changing the recipe. Nothing works. This is why I have come here, please can someone help me?
Edit: Oh yeah and I forgot to add, the pi and pb bit are variables that I declared earlier on. Sorry for the confusion!
I though the mistake is that you called the function Block.defineBlock() false and that you could look on that to see how you can write it without mistakes.
The Meaning of Life, the Universe, and Everything.
Join Date:
7/21/2014
Posts:
58
Minecraft:
Skkkitzo
Member Details
OK thank you so much. It has now worked. I don't know how I missed it so many times... Well, the mod will be coming out soon, so keep your eyes peeled!
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
So I am a pretty average modder. I do a few things, fix bugs, finish mods... Etc. But recently I have found the strangest error ever in ModPE. I can't give any names of blocks away just yet because it has not been released, but I will give the code without the name
Block.defineBlock(200, "Name Here", [pb, pi, pb, pb, pb, pb]);
And then the part where I get the error:
Item.addShapedRecipe(200, 0, 1, ["wcw", "rar", "wrw"], ["w", 17, 0, "c", 263, 0, "r", 331, 0, "a", 279, 0]);
Now when I load up the game, and try to craft this block, something very odd happens. First of all, the game lags a bit, then in your hotbar it says you have the block, but in your hand it isn't there, and then on the floor next to the crafting table it has this "Ghost Item". By this I mean whenever you go 1 block near it, it crashes your whole game — sometimes even my device. I have no idea why this is happening and I've tried everything; from changing the id to changing the recipe. Nothing works. This is why I have come here, please can someone help me?
Edit: Oh yeah and I forgot to add, the pi and pb bit are variables that I declared earlier on. Sorry for the confusion!
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumYou should read this and rewrite Block.defineBlock():
https://github.com/Connor4898/ModPE-Scripts/wiki/ModPE-Scripts-Functions-List#block-1
How does that help me? I already know how to create custom blocks. :|
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumI though the mistake is that you called the function Block.defineBlock() false and that you could look on that to see how you can write it without mistakes.
Well, yeah... I can't see any mistakes!
It's because the Item.addShapedRecipe() that you did is wrong!
What you did is this:
But it shoud be like this:
That's why the block you're trying to craft is an invisible/glitched item because you typed 0 in the parameter which was meant for the COUNT.
*Notice the texts that are bold...
OK thank you so much. It has now worked. I don't know how I missed it so many times... Well, the mod will be coming out soon, so keep your eyes peeled!