Jump to content




How to figure out where a player is looking


  • You cannot reply to this topic
4 replies to this topic

#1 moomoomoo3O9

  • Members
  • 82 posts
  • LocationPork roll land

Posted 22 June 2015 - 12:12 AM

So, I've looked high and low for a way to get what block the player is looking at for WorldEdit without using Immibis's adventure map interface. I even posted a ridiculous way it could be done using the command computers and OpenCCSensors or OpenPeripherals sensors.

The idea was that I wanted to see if I could make the program without using Immibis's adventure map interface, instead using Command Computers to do the block operations and a chat box from either peripherals++ or moarperipherals or even terminal glasses to get chat from the user for commands. The only thing I cannot figure out for the life of me is how to get the block the player is looking at. I have command computers and any peripherals aside from Immibis's at my disposal. Does anyone have any ideas or some obscure feature in a peripheral from some mod that I'm missing?

Edited by moomoomoo309, 22 June 2015 - 12:13 AM.


#2 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 22 June 2015 - 09:49 AM

The only method I'm aware of is using sensors to track the player's head location/facing, just as you're thinking. Even that wouldn't be easy, though, as not all blocks are the same shape; if the cursor is near a torch, for example, then it wouldn't be easy to tell if you're looking at or past it.

Methinks you might be best off pinning down the specifics of the features you want, and suggesting them to a peripheral author. Who knows, you might get it!

#3 MKlegoman357

  • Members
  • 1,170 posts
  • LocationKaunas, Lithuania

Posted 22 June 2015 - 09:54 AM

Well, it is possible in vanilla Minecraft using command blocks. It should be possible with command computers too :P.

#4 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 22 June 2015 - 10:12 AM

 MKlegoman357, on 22 June 2015 - 09:54 AM, said:

Well, it is possible in vanilla Minecraft using command blocks. It should be possible with command computers too :P/>.

RPL is built around MC 1.8's commands. Not sure the techniques can be reproduced with 1.7.10, but it may indeed be worth looking into.

#5 moomoomoo3O9

  • Members
  • 82 posts
  • LocationPork roll land

Posted 22 June 2015 - 05:53 PM

@e doesn't work until 1.8, so I can't use most of the vanilla methods. In fact, command blocks can't really do much of anything with entities beyond summoning them in 1.7.

How unfortunate. I guess I'll have to settle for the moment with using the player's position to determine the selection for now (which while it works, is a bit more tedious.) I saw a thread earlier which explained how to do that, by teleporting the player.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users