Recently, I saw the best map ever, and it had a menu identical to the main minecraft menu, and I'm trying to replicate it. I believe I have found a way, but it requires more knowledge than the internet is willing to offer. I need the 'pumpkinblur' texture to:
1. Have multiple possible textures, and
2. Change between these textures based on where I am looking (similar to the rx, rxm, ry, and rym arguments)
also, why is there no minecraft-resourcepacks/ minecraft-textures tag?
1 Answer
I need the 'pumpkinblur' texture to: 1. Have multiple possible texture
There is no way, in vanilla Minecraft, to have the pumpkinblur texture have multiple frames. You can animate the texture of blocks and items, but not the more irregular textures like paintings, GUI elements, etc..
How to add animation to textures
The basis of animating a block/item is that each frame should be below the previous one vertically. The width of the image is taken as the height of each frame (16px here):
Then, a file with the same name as the texture you're animating (including the .png
), but with .mcmeta
on the end, must exist in the same directory as this texture.
To have the animation play (at 20FPS) all that you'll need to do is open up the .mcmeta
file with a text editor, and add the following:
{ "animation": { } }
There's a fair bit that you can do with animated textures, such as interpolation ("fading") and changing frame order, so you may want to look at the wiki page on it or a tutorial.
Change between these textures based on where I am looking (similar to the rx, rxm, ry, and rym arguments)
You cannot change between frames of the same texture based on rotation, but you could change an item's data value or switch to a different item (this doesn't work with pumpkinblur) that has a different texture. For example, replacing the player's first hotbar slot with a hoe with a certain damage value if they look upwards:
/replaceitem entity @a[rxm=-90] slot.hotbar.0 diamond_hoe 1 25
This is likely how the menu you saw worked, giving different items or data values different menu textures, changing the item's model rotation so that they face the player when held, and then changing what item the player is holding based off of their rotation.
Could also be teleporting a mob with the item on its head to where the player is facing, or just constantly teleporting a player so that they look at a textured changing block, I can't really tell without knowing what the map is.
-
-
@KJBuilds Checked out the map, seems to be a combination of teleporting an ArmorStand with an item on its head for parts such as the title logo, and then a held retextured item (hence why it asks you to highlight a specific slot) for the menu options.– SirBenetCommented Feb 11, 2016 at 21:51
-
okay, i did some searching through the depths of .json files, and found that in the compass model, it has numbers and things that I don't understand, but I'm pretty sure have to do with directions. I COULD do the directional crap with commands (I made a 72 direction x and y calculator) but it would be cooler to do it with the resource pack. Here's the file:– JamCommented Feb 13, 2016 at 20:49
-
{"parent": "builtin/compass","textures": {"layer0": "items/compass"},"display": {"thirdperson": {"rotation": [ -90, 0, 0 ],"translation": [ 0, 1, -3 ],"scale": [ 0.55, 0.55, 0.55 ]},"firstperson": {"rotation": [ 0, -135, 25 ],"translation": [ 0, 4, 2 ],"scale": [ 1.7, 1.7, 1.7 ]}}} (I didn't have enough space to put this in the last comment)– JamCommented Feb 13, 2016 at 20:52
-
@KJBuilds That's a good find; I forgot to consider the compass. You would be able to use it change between frames of the item based on the the player's ry (relative to the spawnpoint direction), but not based on their rx. It'd also only work for one item, so you can't use this trick for multiple GUI elements. May or may not be useful depending on what you want to do.– SirBenetCommented Feb 13, 2016 at 21:40