Is there a way to check what side of the block you are right-clicking?

Started by TeknosQuet on Fri, 03/27/2020 - 22:19

Topic category: Help with MCreator software

Last seen on 01:32, 23. Apr 2020
Joined Mar 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Is there a way to check what side of the block you are right-clicking?
Fri, 03/27/2020 - 22:19

As the title states, is there a way to do this? I've searched this up on Google and looked at other MCreator forum threads to no avail.

 

Thanks in advance!

Last seen on 00:51, 3. Nov 2020
Joined Apr 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
you could see which…
Fri, 03/27/2020 - 22:51

you could see which direction the player is facing when right clicking but if you are trying tho make directional blocks you can already do that on the first page of the block section. 

Last seen on 17:02, 24. Jan 2021
Joined Jan 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
How about just using "on…
Fri, 03/27/2020 - 22:59

How about just using "on when block right clicked"

Then using IF statements to decide which side the player is standing relative to the block

IF entity x position = x-1, he's on one side so much have clicked from that side...

IF entity x position = x+1, he's on the other side

IF entity z position = z+1

IF entity z position = z-1

Might work..?

 

 

 

Last seen on 01:32, 23. Apr 2020
Joined Mar 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
I'll try doing that later. I…
Fri, 03/27/2020 - 23:07

I'll try doing that later. I'm making a torch and I needed two models, so I made two blocks. Then I make an item that has a right click procedure so if I placed it on a wall, it would place the wall torch model; or if it was placed on the ground, it would place the normal torch model.

Last seen on 17:02, 24. Jan 2021
Joined Jan 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
yeah so i think use entity…
Fri, 03/27/2020 - 23:22

yeah so i think use entity direction combined with "if x+1 is not air", x-1, z+1, z-1 depending on player direction.

But to make it worse, I think you would have to combine that with head pitch to see if you're not looking at the floor..?

Last seen on 01:32, 23. Apr 2020
Joined Mar 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
So it partially works…
Sat, 03/28/2020 - 04:20

So it partially works. Whenever I place on a wall it will place the wall model, but I tried making it work on the ground too by using entity pitch and entity direction but it doesn't work.

 

I'm quite new to MCreator, so here's what my procedure looks like:

Last seen on 01:32, 23. Apr 2020
Joined Mar 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Okay I fixed it! Just had to…
Sat, 03/28/2020 - 04:48

Okay I fixed it!

Just had to get rid of "if [(Entity direction) = (DOWN)]" Thank you fuchiashock for helping me. :)

Last seen on 17:02, 24. Jan 2021
Joined Jan 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Great. No problem.
Sat, 03/28/2020 - 09:25

Great. No problem.

Last seen on 13:57, 24. May 2020
Joined Apr 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Is this still the only way…
Mon, 04/27/2020 - 19:59

Is this still the only way to do this? Because if you use the direction or position of the player to detect what side of the block is clicked, you can place a torch (in this case) on the front while clicking on the side of the block. It feels really unnatural.