Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Some questions about Events

Comments in 'Plugin Development' started by iksaku, Mar 25, 2014.

  1. iksaku
    Offline

    iksaku Notable Member Plugin Developer

    Joined:
    Sep 2, 2013
    Posts:
    1,130
    Plugins:
    4
    Minecraft User:
    iksaku
    Hi everyone! Well I have serval questions:
    1.- How can I define the cause of a Player health change? Like, detect if he/she fall from a high place and lose 1 heart (-2 of life) or if he/she get hurted because other player attacked him/her.


    2.- Whats the function of player.interact? Does it means touch a player or attack him?

    Thanks in advantage
  2. Falk
    Offline

    Falk Staff Member Global Moderator

    Joined:
    Sep 2, 2013
    Posts:
    1,706
    Plugins:
    22
    Minecraft User:
    Falkirknh
    player.interact is called on attack, aren't touch and attack basically the same?
    iksaku likes this.
  3. iksaku
    Offline

    iksaku Notable Member Plugin Developer

    Joined:
    Sep 2, 2013
    Posts:
    1,130
    Plugins:
    4
    Minecraft User:
    iksaku
    Wooo... That's true xD thanks! :D

    BTW: How can I define the victim and the issuer of the attack?
  4. Falk
    Offline

    Falk Staff Member Global Moderator

    Joined:
    Sep 2, 2013
    Posts:
    1,706
    Plugins:
    22
    Minecraft User:
    Falkirknh
    I'm not sure, I have always used entity.health.change, but I can see this being favourable.
  5. iksaku
    Offline

    iksaku Notable Member Plugin Developer

    Joined:
    Sep 2, 2013
    Posts:
    1,130
    Plugins:
    4
    Minecraft User:
    iksaku
    Well... I will try using player.interact with $data["targetentity""] for victim and $data["entity"] for issuer :p

Share This Page

Advertisement