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

how can i use attack ($damage, $source=EntityDamageEvent::CAUSE_MAGIC)?

Comments in 'Plugin Development' started by CoolGuyPL, Oct 28, 2014.

  1. CoolGuyPL
    Offline

    CoolGuyPL New Member

    Joined:
    Sep 24, 2014
    Posts:
    43
    Minecraft User:
    CoolGuyPlays
    the title is self explanatory. how can i use it?
    LDX likes this.
  2. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,306
    Plugins:
    11
    Minecraft User:
    PEMapModder
    It is an API function that gets called when an entity is hurt. You usually don't want to use it.

    Edit: if you want to make an entity hurt, yes. But make sure the source is a constant from EntityDamageEvent.php or an EntityDamageEvent instance, or just let it use the default value. $damage is the number of half hearts dealt.
    LDX likes this.
  3. CoolGuyPL
    Offline

    CoolGuyPL New Member

    Joined:
    Sep 24, 2014
    Posts:
    43
    Minecraft User:
    CoolGuyPlays
    thank you for the edit:)

Share This Page

Advertisement