2020.2 how to make cables

Started by danhowe0 on

Topic category: Help with Minecraft modding (Java Edition)

Joined Apr 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
2020.2 how to make cables

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

 

Joined Apr 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Also if anyone finds it…
Fri, 04/24/2020 - 21:03

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.

Joined May 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I might have a solution, but…
Fri, 04/24/2020 - 21:13

I might have a solution, but i haven't tried it myself yet

 

Joined Apr 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Okay. Try it and let me know…
Sat, 04/25/2020 - 10:30

Okay. Try it and let me know then or explain the concept here please.

Joined Dec 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Im currently making cables…
Sat, 04/25/2020 - 12:13

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)

 

Cable-System-prototype

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:

Cablesystem

I just trial and errored a bit to make the Rotation correct

Hope I could help :)

Joined Jun 2015
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Why are you making several…
Sat, 04/25/2020 - 13:24

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.

Joined Dec 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How? I mean what do you mean…
Sat, 04/25/2020 - 14:07

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?

Joined Jun 2015
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Yes it's possible. Look at…
Sat, 04/25/2020 - 22:09

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...)

Joined Dec 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Ok thx for help…
Sun, 04/26/2020 - 11:04

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?

Joined Jun 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Hello , it's really cool…
Wed, 06/03/2020 - 12:57

Hello ,

it's really cool what you did. you can send me your cable procedure please

thank you. 😁

Joined Jun 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
he is french like me. xD…
Wed, 06/03/2020 - 13:14

he is french like me. xD Max094_Reikeb

Joined Sep 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
hey i have exactly the same…
Thu, 06/18/2020 - 15:17

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.

Joined Aug 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
hello, could you give me the…
Mon, 10/12/2020 - 17:00

hello, could you give me the procedure of your cable, thanks in advance