1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Detect that I am touching a specific sign

Discussion in 'Development' started by bpsys, Apr 10, 2019.

  1. bpsys

    bpsys Spider

    Messages:
    7
    GitHub:
    bptube
    Hello, I need to do the following, let's assume that there are two signs and one has written [Yes] and the other [No], what I want is to detect when someone touches the signal that says [Yes]
     
  2. Levi

    Levi Skeleton

    Messages:
    955
    GitHub:
    captainleviftw
    Get the position of the two signs
    On PlayerInteractEvent,
    Check if $event->getBlock() is instance of sign
    Then check if the block's x, y, and z are equals to the position of the signs

    Not sure if this will work but

    On PlayerInteractEvent, check if the item clicked is instance of Sign
    And if it is then get the line of the sign and check if it "[Yes]" or "[No]"
     
    Last edited: Apr 10, 2019
    bpsys likes this.
  3. Mr174

    Mr174 Baby Zombie

    Messages:
    187
    GitHub:
    mr174
    I use this second option on occasion so..... +1
     
  4. bpsys

    bpsys Spider

    Messages:
    7
    GitHub:
    bptube
    Solved
     
    Last edited: Apr 10, 2019
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.