Hey guys this is agent mindstorm and welcome back to my bedrock edition resource pack tutorial today we’ll be covering advanced block features before this video you need to have watched the getting started tutorial to get the default files the editing textures video to understand textures and the animated textures video To learn about json formatting and flipbooktextures.json the first file we’re going to look at today is terraintexter.json it’s in the textures folder this file is mainly used to map texture files to what’s known as an atlas tile which is something that other files like blocks.json and flipbooktextures.json use Inside the texturedata object is a list of all the atlas tiles used by the pack each atlas tile is an object that has a textures property this property can be defined by a single texture file path or an array of texture file paths the point of connecting a texture file To an atlas tile is that the game now knows to interpret the file as a block texture most atlas tiles are only mapped to one texture file but a few are mapped to multiple when an atlas tile is attached to multiple texture files you’ll know that it’s used on a Block that has multiple data values with unique textures data values are part of the block id system used by bedrock edition they were originally created to save block ids as the game used to have a limited amount instead blocks that were mostly the same with only texture differences like Dirt and coarse dirt were assigned data values the data value tells the game which variant of the block id to use continuing the dirt example the block id minecraft colon dirt with the data value 0 is normal dirt but setting it to data value 1 makes it coarse dirt If we look at the dirt atlas tile it’s linked to two texture files textures block slash dirt and textures block slash coarse dirt just so you know the data values don’t correspond to the arrays one to one look at the farmland textures even though the farmland block has eight data Values it only has two file paths which file path controls which data values texture is entirely hard coded and you can only tell by looking at the file paths in the default resources now why would you ever want to modify this file well there are two main applications for terrain texture.json The first is that this allows tweaks to be applied through other resource packs what do i mean by that if you change the file path of a texture that will affect every resource pack applied above yours in global resources think of it like this the game first asks what’s this block’s id The block id determines the blocks.json entry which we’ll talk about later the blocks.json entry lists the atlas tiles to be used in the block which are set into raintexture.json terrain texture links the atlas tiles to texture files by changing the texture file paths into rain texture we can swap textures around Without ever having to touch an image file for example i created a resource pack called undying corals that uses the terrain texture file to replace all dead coral textures with living ones since undying corals changes the file paths of dead coral textures resource packs applied above it get Their living coral textures applied to dead coral too the only way that the resource pack would fail to replace dead coral with living coral is if a higher resource pack also changed the file paths of dead coral textures this same idea can be applied to any block want dirt to look like netherrack Easy just do a find and replace that finds dirt’s file paths and replaces them with netherax want all your concrete to look like glazed terracotta because you’ve lost your mind just replace the file paths for concrete with the glazed terracotta ones to explain the second reason you’d want To edit terraintexture.json we need to explain blocks.json this file is in the main resource pack folder next to the manifest when you open it you’ll see a long list of objects each with the name of a block this is a list of every block in the game sort of There’s a unique entry for each block id but not each data value that means that the properties of dirt and coarse dirt for example are controlled by the same object because they have the same block id each block id entry can be assigned up to five properties these properties are textures carried textures Sound isotropic and brightness gamma we won’t talk about brightness gamma though because it doesn’t do anything the most important property here is textures because all other properties will be set to default values if they’re blank but not textures the textures property can either be defined by a single atlas tile from Terrain texture.json or an object listing different atlas tiles for different sides of the block it can’t just be a file path to a texture the file paths can only be set into raintexture.json you have to use both files to texture a block the textures property has three Ways to texture all the faces of a block the first is to only define it by one atlas tile that texture will then be applied to every side of the block to give the top bottom and sides different textures you should define textures by an object containing up down and side properties each Property in the object can be defined by a different atlas tile which will be specific to that side of the block the up down and side object will at the bottom and top of the block use unique textures but all four sides of the block will still use the same texture To give every side a unique texture put up down east west north and south properties in the object by using cardinal direction properties instead of a blanket side property you can give every side of a block a different atlas tile there are blocks listed in blocks.json that use all of these methods already If you don’t want to write the object out by yourself i’d recommend you copy one of the textures objects that’s already filled out and replace the atlas tiles with the ones you want on your block the carried textures property is exactly the same as the textures property but it Only replaces the textures when the block is in your inventory your hand the ground or an item frame this is useful for blocks that have color overlays like the top of the grass block if there wasn’t a separate colored atlas tile for grass blocks they would be gray in inventories Choosing not to add a carried textures property will make it look the same in block and item form i already covered the sound property in the advanced sounds tutorial so you should watch that video if you want to know how to use it the final property is Isotropic from what i could figure out online the word isotropic is actually used incorrectly in this file usually it means something’s property is the same no matter what way it’s facing here though it basically just means can randomly rotate isotropic can only be set to true or False if a block doesn’t have the isotropic property it defaults to false this property is mainly used on blocks that can appear in large numbers like dirt sand and netherrack you can limit it to certain sides of a block using an object with up down and side properties like the way Unique textures are set on each side if the up property is set to true and the down property is set to false then the top of the block will randomly rotate but the bottom won’t to test what we learned so far let’s change a few blocks to have some nightmarish designs I’ve already created textures for each of them by modifying our old oak planks texture however these textures are in a folder that doesn’t even exist normally i called it agent mindstorm underscore textures just in case there was any doubt to add these beautiful textures to blocks we have to first map them to Atlas tiles into raintexture.json i’m just going to copy the entry for acacia planks and delete the file path so that i don’t have to retype everything first i’ll replace the atlas tile name of acacia underscore planks with red underscore beautiful underscore design then i’ll write the file path that goes Textures slash blocks slash agent mindstorm underscore textures slash red beautiful design just so you know the atlas tile name doesn’t have to match the file name it’s easier to remember if they are the same though since i have six quote-unquote beautiful designs i’ll copy and paste the red designs entry Five times then change the word red to the color of each different texture with my six different textures assigned atlas tiles into raintexture.json we can now map them onto a block the block i’m going to map them to is the block of diamond i’ll search for diamond in blocks.json Then find the right entry i want to use a different texture on all six sides so i’m going to copy a six-sided textures object from a different block entry the nearby dispenser entry has a six sided textures object so i’ll copy it from there and replace the default textures property Now i’ll replace the atlas tiles on each side of the block with the atlas tiles i created into raintexture.json let’s test it in game alright let’s search for block of diamond and oh my this is most certainly the block of the highest beauty i would go as far as to say that the Block of diamond has never looked better however i think there are two more things we still need to do before the block is truly perfect for starters i want the carried texture to still look normal so that the player is caught off guard when the true beauty of the block is revealed This is one of the advantages of adding new textures by using terrain texture.json instead of replacing existing files you can use the original texture and your new one in tandem by not replacing the original even though the diamond block doesn’t normally have a different carried texture we can add the carried textures property Ourselves and it will work fine i’ll set it to the diamond underscore block atlas tile so that it looks normal until you place it down i also want the block to randomly rotate but not on the south side or the top i’ll copy the six sided object from the Textures property and paste it after an added isotropic property just like the carried textures property the isotropic property works on any block even if the block doesn’t normally randomly rotate i’ll replace all the atlas tile names with true except for the south and up properties because i don’t want those ones to rotate The perfect block should now be working correctly let’s test it again what words come to your mind when you see this beautiful majestic grandiose seizure whatever it may be we have succeeded in our quest to forge a block that lacks any sort of imperfection so i’d say we did pretty well today However there are a few loose ends i couldn’t fit very well anywhere else in the video so i thought i’d shove them all here at the end we’ll start with two extra texture features you can use into raintexture.json the first texture feature is the ability for textures to have random variations Since the default game doesn’t have any textures that randomly vary we have to add the json for it ourselves in the description of this video there’s a basic object with a variations array that you can copy and paste into any textures array the object only counts as one texture File path in the list so for example you could add variations to normal sand while leaving red zand with its default texture if you wanted to add unique variations to multiple textures in a single atlas tile you just have to add a separate object with the variations array to each one If the atlas tile that you want to add variations to doesn’t have a textures array you’ll have to add the array brackets yourself if you try to do that and your json stops working you can always use the website jsonlint to check your formatting which i showed in the sound basics Tutorial once the variations array is in place you can start adding random variations to your texture you can add as many variations as you want but each variation needs its own object in the variations array those objects have path and weight properties path is defined by the file path to the variations texture By the way every variation of a single texture entry has to be in the same folder it doesn’t matter where that folder is or what it’s called as long as every variation is in it the weight property is defined by a number that number helps decide how common the variation will be The game calculates the rarity of each texture variant with this equation which is basically the weight of one variation divided by the sum of the weights of every variation in the variations array if you have two texture variations one with a weight of three and the other with a weight of one The first texture will be selected seventy-five percent of the time and the second will be selected twenty-five percent of the time set every weight to one to spread the variations evenly the other feature we need to cover in terraintexture.json is the ability for textures to have color overlays The overlays take a color written in hexadecimal and multiply it onto a texture it works best on grayscale textures so anything that’s just black and white tga textures treat color overlays from terrain texture.json like any other color overlay so pixels with a very low opacity are not changed The only textures that use the overlay feature by default are the grass side textures but it works on any block adding a color overlay to a texture is pretty easy all you have to do is replace the normal texture file path with an object containing two properties The two properties in an overlay object are overlay underscore color and path path works the same way as the path property from before overlay color is defined by the hexadecimal color you want to overlay on the texture to add a color overlay to a texture in a variations array just add the overlay Color property inside the object with the path and weight properties when adding a color to the overlay color property make sure you include the octathorp or the hashtag or the number sign or the pound sign or the hash or the waffle or the tic-tac-toe board or whatever name you call the square With a bunch of lines through it you should put it before the six digit hexadecimal code so the game understands that this is a color to get a hexadecimal color code from another image open the image in paint.net choose the eyedropper tool and click on the color you want then press the more Button by the color wheel to expand the color window the hexadecimal code is in this box copy it then paste it as the overlay color property paint.net doesn’t include the octathorp when you copy the hex code so you have to type it yourself we can actually recreate the way that a Color overlay will look in game by using paint.net this will save you a lot of time you would waste constantly tweaking the color and testing it over and over in game to recreate it open the texture that you’re going to put in overlay on and paint.net Add a new layer above the image and fill it with the color you want to test even though we can’t see the original texture at all now it’s still under the color layer now click the wrench on the layers window while the color layer is selected and change the blend mode to multiply This is how your texture will look once it gets the overlay from terrain texture.json if you want to change the color you’re testing select the fill bucket and choose any opaque pixel on the color layer that will change the color you’re multiplying to the one that’s currently selected Now that you know about data values and random block variants we can go back to flipbooktextures.json and explain the features that i ignored in the animated textures tutorial the most significant one is how you animate a block that only exists with a data value for example how would you animate coarse Dirt without animating normal dirt too the animation object for a data value block is pretty much the same as it is for a normal block but with one added property this property is atlas underscore index the atlas index property tells the game which texture to animate from a list of textures You know how the dirt atlas tile has the dirt and coarse dirt textures in it the atlas index tells the game which one to replace if the atlas index is zero then the normal dirt texture will be replaced with an animated texture if it’s one corster’s texture will be replaced instead The simplest way to think about it is that the atlas index tells the game how many textures to pass before reaching the one to replace when it’s 14 for example you’re telling the game to pass the first 14 textures in the list and replace the 15th So what if you want to animate a random block variant you can choose which texture variation to animate by adding the atlas underscore tile underscore variant property to the animation object this property works the same way as the atlas index property but it chooses from the variations array instead Setting the atlas tile variant to zero selects the top variation one selects the one under it and so on just like atlas index here’s a fun fact the developers used atlas tile variant wrong in the default files it seems like they thought it was the same thing as atlas index which it Isn’t at all don’t pay attention to the way it’s used on bubble columns and respawn anchors because it’s completely wrong while we’re in flipbooktextures.js i might as well explain the replicate property just so you understand the whole file this property tells the game to interpret the texture’s width differently Instead of doing what it would do normally which is taking the width of the texture and using that for the height of each frame the replicate property tells the game there are this many copies of the same texture in a line that way each texture grid is interpreted as one animation frame When an animated texture with the replicate property is applied to a block the texture size is scaled down to the pixel width divided by the number you set as the replicate property this is how the game makes flowing lava and water have a consistent pixel size to other blocks even though the flowing Liquids sometimes have textures longer than 16 pixels the replicate property should really only ever be set to 2 and only used on flowing liquids in the vanilla game you can set it to higher numbers but your texture grids have to match and that only creates more work for you Back in blocks.json there’s one entry that isn’t a block id that i should explain that entry is format underscore version which is defined by an array with three numbers in it this tells the game how to interpret blocks.json by giving a version number the numbers in the array here mean that The file is version 1.1.0 you never need to edit this property unless you’re updating an old blocks.json to a newer format the final things we need to talk about are the properties at the top of terrain texture.json the first one num underscore mip underscore levels sets something called The mipmap level of the game by default the mipmap level is 4. what a mipmap level does is decrease the size of distant textures to make the game run better the default level of 4 means that the length of a block texture will be divided by 4 past a certain distance The best way to show this in my opinion is to show the files of legacy console edition there are three different images with the default textures in the legacy console edition files each with a different mipmap level this first image is at map level 0 so it matches the default textures This second image has a midmap level of two so each texture is eight by eight pixels instead of sixteen by sixteen this last image has a map level of four so each texture is only four by four pixels since distant textures are so small you can barely even notice that they’re Lower resolution than normal the padding property is related to mid map levels i’m not actually sure what it does but it should be set to two times the mid map level to remove mipmap levels and padding you can set them to zero but watch out there’s a bug that causes there to be Small gaps between some blocks when you set mipmap levels and padding to zero after padding we have the texture underscore name property this should never be changed it tells the game that this file is terraintexture.json if you mess with this property the file will not work don’t touch it The last property aside from the texture data object is resource underscore pack underscore name this should be set to vanilla unless you’re making a companion behavior pack or mod 2 in which case it should be set to your mod’s namespace just leave it alone if you don’t know what it does And with that you have learned everything you can do to blocks in resource packs that’s not hyperbole you have now literally learned everything you can do with blocks in a resource pack the next resource pack tutorial will be the first in a series of ui tutorials If you want to prepare for that make sure you fully understand json formatting and minecraft textures for now though i do want to tell you all thanks for watching and i will see you later You Video Information
This video, titled ‘Advanced Blocks (terrain_texture.json, blocks.json, Variations, and More!) – Resource Pack Tutorial’, was uploaded by AgentMindStorm on 2020-12-15 15:00:10. It has garnered 23654 views and 756 likes. The duration of the video is 00:19:20 or 1160 seconds.
Today, I explain everything you can do with blocks in a Minecraft: Bedrock Edition resource pack. Enjoy!
Variations Array: { “variations”: [ { “path”: “textures/image1”, “weight”: 1 }, { “path”: “textures/image2”, “weight”: 1 } ] }
This video is monstrously large, so to help you find the information you’re looking for, I added topic timestamps below.
Timestamps: 0:00 – Intro 0:20 – terrain_texture.json 1:05 – Block IDs and Data Values 1:58 – Swapping Textures 3:20 – blocks.json 5:21 – Carried Textures 5:51 – Random Texture Rotation (Isotropic) 6:33 – In-Depth Example 9:54 – Random Texture Variations 11:39 – Color Overlays 13:56 – flipbook_textures.json 14:14 – Animating Data Values 14:57 – Animating Random Texture Variations 15:37 – Replicate Property 16:28 – blocks.json Version 16:56 – Mipmap Levels and Padding 18:02 – Miscellaneous Properties 18:28 – Outro
Playlist: https://www.youtube.com/playlist?list=PLwnviK9sp0sf3XKyLYvav-s9xwEodvJzf
YouTube: https://www.youtube.com/AgentMindStorm Twitter: https://twitter.com/agentms_ Xbox Club: AgentMindStorm Club
Outro Music is Danny by C418: https://youtu.be/X2ajI96FyAk