Hello, I am creating an addon which has some different sea creatures, such as sea slugs and new tropical fish (inspired by EightSidedSquare). I was wondering if there was any way to stack overlays on top of each other? As in, like how a random tropical fish like, lets say a blue and cyan coloured snooper. I want a code ( or file) that helps me to understand how to make an entity such as a fish, have 2 new colours, like if i want to make a new tropical fish and put options for colours for it like tropical fish has. For the blocks, i also want a similar code to paint a block in an option of 2 colours, (visit EightSidedSquare’s video - Adding way too many fish to minecraft at 7:25 mark). If anyone has a zip file or knows how to explain it to me, please do, I need all the help i can get.
#Dual Overlays on blocks and entities
1 messages · Page 1 of 1 (latest)
i also checked a lot of other addons and pages to find if they had any code i needed. Sadly, no luck. If you do have an addon that has similar code to what i need, please post here
You can try this tutorial: https://wiki.bedrock.dev/entities/render-controllers.html#texture-layering
You can also use a separate render controller for the base and the pattern
thanks for the help!
do you know how to make the layers say, have chance? Like how when a fish spawns, one colour comes out of a list and the other comes out of the other list and they layer on top of each other (tropical fish)
You use spawn events to randomize a property in the entity, and then query for that property in the render controller
do you know if it also works for blocks?
The same principle should apply for block states and an on_player_placing event, but I'm not sure what the specifics would be as I've never randomized blocks myself
thanks
if it isnt too much trouble, can you make like a simple code that i can reference off of that is for a tropical fish?
Do you mean for the texture layering? I can probably throw something together for that using like a single cube for geometry. I won't be able to do anything more than that or add any behaviors though
Ok, I got the examples done. I'll be sending them and a video of them below. I hope this helps!
BP file(it randomizes to 4.9 so that there is a chance of the highest value being chosen, as when it converts from the random(a float) to an integer, it just removes the decimal place):
RP file:
Render controllers(I used 2 because I'm more comfortable with that then using a single render controller)
Model that I used:
Video showing what it looks like ingame:
thanks! Really helpful and sorry if it took a bit lomg
was really good explanation! If u want i can include your user in credits
I don't care either way
do you know if the code would change to add a third layer?
as in, the sea slugs would have a sort of frill around them
would the code change or would the code stay the same, like basically i copy one of the render controller layers for the third layer
I don't think so
so the code wouldnt change
You would just need a third render controller, and to play around with the order a bit to make sure it's rendering properly
ah ok
how would an example code for a block look like instead
so like i find a type of coral and i break it, i get the item and i place it and its still the same 2 colours
also when it generates naturally it chooses colours like the entity above
I'm not sure how you'd do that for blocks to be honest. It might be good to ask that as a separate question in #1067876857103536159
alright, thanks
Hi. This thread is precisely what I was looking for, but I am a loss of words and ideas, as the example files you provided don't seem to work, for me at least. I am wondering what else i might have set up differently. Does the world need experiments enabled? (tested both with and without all toggles) What did your manifest files looked like. I've tried on both latest retail version (1.20.51) and preview (1.20.60.26).
The entities can exist in the world, but the spawn egg is a blank item, and the entity itself also does not have any textures. I can't seem to understand how, since I simply downloaded the provided files without editing them at all.
Huh, strange. I was using the latest release without any experimental toggles. It sounds like the resource pack is having issues though. Any content log errors, and did you double check both the BP and rp are enabled in your world? I didn't make them dependant on each other
yeah, none of this actually shows up on youtube
Yeah i made sure i enabled them both, and no content logs appear when loading into the world. I'll tinker around later today more
I don't know why you mention youtube here
bc theres literally no tutorials anywhere except here on how to do that stuff
Oh you meant that. Yeah i am aware. I tried following the bedrock.dev tutorial for layered textures first and that didn't work so i searched here 🙂
yeah
so since i have no idea how to do thay in blocks, would it be a wise course of action just to make it an entity that acts like a block?
it would still require the same code right
You could do that
Or make an invisible block that summons your entity
It should be the same visual wise
alr thanks man
do i have to add a new file that specifies the hex codes of mentioned colours? Such as concrete_red then the hex code #fa5321 for example.
You shouldn't need to for the overlays. Are you talking about map colors?
wait so if i just say like cherry colour then it will be cherry coloured?
Ah. You're best bet would be to make different textures for each color. Like a cherry colored texture, a blue texture. etc.
If you really want to, you could use an overlay in the render controller, which is in the format of json "overlay_color": { "r": 1.0,//(0-1, can use molang) "g": 1.0,//(0-1, can use molang) "b": 1.0,//(0-1, can use molang) "a": 1.0//(0-1, can use molang) }