Returning a player your looking at

Discussion in 'Plugin Development' started by eagledude4, Feb 5, 2011.

Thread Status:
Not open for further replies.
  1. Offline

    eagledude4

    Never mind, please delete
     
  2. Offline

    Timberjaw

    I don't think there's a simple way to do that right now. You'd probably have to brute force it with by calculating the player's look vector and searching through the world's living entity list.

    Maybe someone else has a more elegant solution though. :)
     
  3. Offline

    Plague

    Hmm I think (well I did look through the docs) that you can only get the right click on blocks, not entities.

    BUT! And this is just a wild idea from he top of my head... You could click a block underneath the player and then find the player by its position (Y+1 of course). The problem is that some blocks react to the right click :/

    Anyway, if you just want to give somebody an item from your hand, you can just throw it at him via the default throw action in minecraft (Q?).
     
  4. Offline

    eagledude4

    I was going for sort of a more realistic way to exchange items. Timberjaw came up with a good idea, but I still dont know how to return things you look at, I couldnt find the method for it. (looked through the javadoc)

    I'm just gonna scratch this idea and use q like normal people lol.
     
  5. Offline

    Raphfrk

    You could have a look at this thread.

    It sounds like he is planning to implement a targeting system.
     
Thread Status:
Not open for further replies.

Share This Page