Interesting stuff is going to happen on this thread (I thought you realized that by looking at the title). Anyways, something curious that VERY few people know about ModPE is how to prevent, deflect, or even edit errors right? Im going to show you something cool. Lets take a look at our classic ModPE item creation function:
Cool for many reasons. First off, you can name the function Item.potatoRules() and itll still work perfectly XD. Next, recent ModPE updates let you use an ID HIGHER than 512. Also, in the "catch (e)", which checks for errors (aka 2LazyToInstallTexturePacks), It WILL still set a texture, which in this case, is the awesome zombie head.
Make a 16X16 picture of an item, in PNG format, like how you would in PC Minecraft.
IMPORTANT!!! Name it:
textureName_texureNumber.png
Reason for that, is so ModPE can recognize your texture. For example, I'm naming my picture of a shiny sword "glowstone_sword_0.png". Note that the texture name and number are separated by a underline "_".
Inside your assets/images folder in a texture pack, you have all the game textures. Make a folder called "items-opaque". Yes, you're forcing the API to search the folder for textures, and not just the items-opaque.png, meaning no original textures go to waste
Place your picture inside the "items-opaque" folder.
You should be done with the texture part. Now the coding. Use that replacement code to replace ModPE.setItem for something else. Im doing this for now:
If it worked, you should see your item with the custom "custom" texture on. If you messed up on texturing, then whatever you put in the catch (e) section of the code (hopefully it still isnt the zombie head because you copied & pasted XP), will be used instead. Hope this helps modders out there. Peace!
The Meaning of Life, the Universe, and Everything.
Location:
Auckland
Join Date:
9/20/2014
Posts:
126
Minecraft:
softmage114486
Xbox:
softmage114486
Member Details
Hey, I tried this with terrain, sure enough it works but... Sometimes block textures are either flowing water or lava (yes they are actually animated) any idea on how to fix, here is an example kinda, 1 is the t-p and 2 is the code
1.
assets/images/terrain-atlas/potatoBlock_0.png
2.
Block.defineBlock(23, "Block of potato lol", [["potatoBlock",0]],1,false,0);
That happened to me as well when making a steel ore block for my mod XD.
This is a BL bug that should be fixed in sometime. I found multiple workarounds for that so see which one works for you.
Delete Block Launcher data & cache
Install the texture pack, then restart BL, then install the mod, the restart for the last time
Copy and paste the same picture, but change the block name EXAMPLE I made "steel_ore_0" which shows up as a lava block... so I changed it to "hard_ingot_ore_0" and left the "steel_ore_0" as a decoy for the bug :3
Try changing the ID of the block
Last but not least, make sure you didnt put "lava",0 as your texture XD
Sorry if Im not online often, but school and stuff. Its currently 8:48 PM ._.
The Meaning of Life, the Universe, and Everything.
Location:
Auckland
Join Date:
9/20/2014
Posts:
126
Minecraft:
softmage114486
Xbox:
softmage114486
Member Details
I tried the same thing! Making a decoy texture, but it just doesn't work sometimes, the only other way I can think of is using existing block textures that aren't going to be added anytime soon like the command block
Rollback Post to RevisionRollBack
This is my signature..
clicked block quote Hey..How do i turn it off?Help! I'm scared This is my life now...
Have you seen when people say to install the texture pack first right? Well, this is what they meant. We can hope for ISE500 to fix it once he updates to 0.12.0
Interesting stuff is going to happen on this thread (I thought you realized that by looking at the title). Anyways, something curious that VERY few people know about ModPE is how to prevent, deflect, or even edit errors right? Im going to show you something cool. Lets take a look at our classic ModPE item creation function:
Now. What would happen if a person doesnt want to edit the items-opaque.png, or a person doesnt install a texture pack?
Heres a cool trick you may have not known. YOU CAN EDIT the function by adding so at the beggining of your code (before using setItem):
Cool for many reasons. First off, you can name the function Item.potatoRules() and itll still work perfectly XD. Next, recent ModPE updates let you use an ID HIGHER than 512. Also, in the "catch (e)", which checks for errors (aka 2LazyToInstallTexturePacks), It WILL still set a texture, which in this case, is the awesome zombie head.
Now Imagine if you could do this:
Heres how to do that :3
Good work, would prevent the most errors.
wait so you can modify built in functions and add more parameters...? where have we all been..
You could say that. :3
i like your signature, did you make it yourself
?
Yeah.
you tube, facebook, newgrounds, deviant art?
That, and any useful/good posts on the forum.
Hey, I tried this with terrain, sure enough it works but... Sometimes block textures are either flowing water or lava (yes they are actually animated) any idea on how to fix, here is an example kinda, 1 is the t-p and 2 is the code
1.
assets/images/terrain-atlas/potatoBlock_0.png
2.
Block.defineBlock(23, "Block of potato lol", [["potatoBlock",0]],1,false,0);
Sometimes the texture won't show???
That happened to me as well when making a steel ore block for my mod XD.
This is a BL bug that should be fixed in sometime. I found multiple workarounds for that so see which one works for you.
Sorry if Im not online often, but school and stuff. Its currently 8:48 PM ._.
I tried the same thing! Making a decoy texture, but it just doesn't work sometimes, the only other way I can think of is using existing block textures that aren't going to be added anytime soon like the command block
Have you seen when people say to install the texture pack first right? Well, this is what they meant. We can hope for ISE500 to fix it once he updates to 0.12.0