Make a block facing the Direction of a another block

Started by -Der_Floh- on

Topic category: Help with modding (Java Edition)

Last seen on 17:31, 29. Oct 2020
Joined Aug 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Make a block facing the Direction of a another block

What I want to do:

I made a Trigger which replaces a block with another block when right clicked. The problem is that the replaced block is a stair and have a direction in which it is facing, my question is : How can I make it, that the new block, that replaces the old one, have the same direction as the old block ?

 

My thoughts are the following:

I need to save the direction of the old block in a variable (String), then I can let the new block facing in the direction, which is written into the String.

 

The Problem is:

I can't do that because the Set direction of block at  X  Y  Z  to ... wont let my put a String after the to. So is there a way to convert the Direction, written in a String, to a direction, so that it fits in the Set direction method ? Or is there another way to let happen, what I've written at the top ?

 

 

Do not write direction into…
Thu, 08/27/2020 - 18:58

Do not write direction into the string, this makes no sense. In the future, we might add direction variable type. 

For now you have two options.

1. Save direction into integer with if statements and then place in the direction depending on the if statement (not recommended)

2. Use replace block procedure block and tick keep rotation (highly recommended)

Last seen on 17:31, 29. Oct 2020
Joined Aug 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Ok thank you very much for…
Fri, 08/28/2020 - 11:54

Ok thank you very much for the help

Last seen on 17:31, 29. Oct 2020
Joined Aug 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
So I have a more general…
Fri, 08/28/2020 - 12:08

So I have a more general problem on this topic:

 

in the block placed by entity procedure is written the following:

Set direction of block at X Y Z to [Direction of target entity] this simply don't work and I don't know why

 

I wan't to let the block face in the same direction the player is looking when it is placed

Last seen on 17:31, 29. Oct 2020
Joined Aug 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Wait I can't find the…
Fri, 08/28/2020 - 12:09

Wait I can't find the replace block procedure WITH keep rotation