Started by
danhowe0
on
Topic category: Help with Minecraft modding (Java Edition)
Im looking to make a mod that deals with power and energy and cant seem to make a cable that connects to a block or other cable next to it. how would i do this in mcreator 2020.2
Also if anyone finds it easier to do than explain then say and ill add you to collab on my project temporarily and then review it to see what you did.
I might have a solution, but i haven't tried it myself yet
Okay. Try it and let me know then or explain the concept here please.
Im currently making cables that can transport items and energy and I found a way to make cables connect that can connect to all 6 sides (that would be 64 possibilities 2^6)
You would have to create 10-14 different models (if I calculated correctly) and enable D/U/N/S/W/E rotation to all of them dont know why but when I set it to Y-axis it crashes the game. (I made it able to connect with 0,1 or 2 cables currently) Then make a procedure that all cables trigger when neighbour block changed and on update tick that checks all 6 sides and replaces the block at XYZ with a new block and changes Rotation to make it connect. Now that procedure would take around 8000+ procedure blocks if it can also transport nbt or items but there is a way to compact it by making If else Statements that checks the block at Y+1 then in both (If and else) Segments you put another if else that checks it only for an other coordinate and repeat that for all 6 sides (X-1/X+1/Y-1/Y+1/Z+1/Z-1) and then put the [replace block at procedure block] and [Set Rotation of block at XYZ] there. You also need to enable tile Entity for all cable parts.
Here`s an Image of how I made it:
(Too large to fit in a single image)
You need a procedure [when block added] that sets a logic NBT true for every cable because if you dont you have to check for every cable part that would cost too much procedure parts ((~60)*64 = 3800+) just for checking.
I currently havent made all models so I just print to Chat that there is no model because else it would say "Missing if part"
Here`s how it currently looks in-game:
I just trial and errored a bit to make the Rotation correct
Hope I could help :)
Why are you making several blocks for your cable?
Just make several models and with NBT you can choose what model is displayed!
And you can also modify the hitbox according to this.
How? I mean what do you mean by choosing what model is displayed using NBT? Is it even possible to make block states and if yes how?
Yes it's possible. Look at furnace : if the furnace is smelting something, its texture changes. Basically it's a boolean system inside your block's code. Every tick, you can check if your block's NBT tag is true and if yes, you turn your block's boolean true too.
Then, in the blockstate file of your block, you can add "bolean=true" and "boolean=false" and choose what model is displayed.
You can also do that with ints.
I have a friend good at making tutorials who will make one about that when his MCreator will be fixed (he has some unfortunate problems with it so...)
Ok thx for help unfortunately I cannot code so I`ll let my current system stay as it is and when your friend releases the tutorial I`ll try to optimize that.
So I think I will later make a number NBT that goes from 1 to 64 for every state and in the Code I have to check for every value and change the model and somehow also the rotation. Item or Energy transport could be done using that procedure I made that instead of setting a block and the rotation it checks its own number NBT and adds the own energy NBT to that of the neighbor cable plus an additional "import" logic NBT to see in which direction to send the items or Energy. And if one has multiple connections it will check which cable has the "import" NBT true and just split the amount of items to the other neighboring cables.
What do you think?
Could you also please send me a link to your friends tutorial when he`s done?
Hello ,
it's really cool what you did. you can send me your cable procedure please
thank you. 😁
I'm sorry Yusufhum3 I totally forget to give u the link to the tutorial to change a block's texture without having multiple blocks elements. Here is the link : https://www.youtube.com/watch?v=M2ksabM0xR8
this looks promising.
he is french like me. xD Max094_Reikeb
hey i have exactly the same problem xD it seems that Mcreator doesn't handles the fact that a custom models (or a block) can be turn in the Y axis while he is facing up.
hello, could you give me the procedure of your cable, thanks in advance