How Do I write The Direction A Block Is Facing To A Variable

Started by Faceless Pikachu on

Topic category: Help with MCreator software

Last seen on 18:50, 16. Oct 2021
Joined Jan 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How Do I write The Direction A Block Is Facing To A Variable

I need to be able to set it that a variable is set to be the direction of a block.

How would I do this? When I tried to do it I tried combining [set variable [x]] and [get block direction x y z] but it didn't work.

Last seen on 12:52, 22. Jan 2023
Joined May 2015
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Hello! I made to 3 elements…
Wed, 01/01/2020 - 20:12

Hello!

I made to 3 elements for testing.

An item, which checks the direction on right click. ( it's not necessary)

A global string variable.

A procedure, which does the Variable setting and the outprint(which is also not necessary).

 

I will try to insert a picture here with the procedure, if the picture is not working, then I will write a link which points at the picture.

This is the link if you don't see the image:  https://ibb.co/NKQtbK9

 

Last seen on 18:50, 16. Oct 2021
Joined Jan 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thank you!
Thu, 01/02/2020 - 23:19

Thank you!

Last seen on 03:03, 6. Feb 2024
Joined Apr 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Depending for what you…
Fri, 01/03/2020 - 02:36

Depending for what you actually need it, however I reccomend you to get blocks current direction and define it in NBT tag binded to this block as a number, example 0 = north or 6 = down than just call it with whatever you want 

I also don't recommend using variables other than NBT tags with blocks, items or Entities because they are not very stable to use
but note that if you want to use NBT tags on a block than you will need to set it as TileEntity block