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

Arrow Touches Block ..

Comments in 'Plugin Development' started by PmServer, Aug 31, 2016.

  1. PmServer
    Offline

    PmServer New Member

    Joined:
    May 7, 2015
    Posts:
    53
    Minecraft User:
    PmServer
    Welcome My Frinds.
    I want to code when it touches the arrow block any stops or when it touches any player stops Example:
    Fired the arrow on the block and was in stock when it touches the flame particle arrow block stops the particle
  2. PmServer
    Offline

    PmServer New Member

    Joined:
    May 7, 2015
    Posts:
    53
    Minecraft User:
    PmServer
    Any Help ? :(
  3. JonsMC
    Offline

    JonsMC Active Member

    Joined:
    Jul 26, 2016
    Posts:
    107
    Minecraft User:
    JonsMC
  4. PmServer
    Offline

    PmServer New Member

    Joined:
    May 7, 2015
    Posts:
    53
    Minecraft User:
    PmServer
  5. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    Use ProjectileHitEvent and check if the projectile is instanceof Arrow(Entity, not the item.) Then do whatever you want.
    MichaelM04 likes this.
  6. JonsMC
    Offline

    JonsMC Active Member

    Joined:
    Jul 26, 2016
    Posts:
    107
    Minecraft User:
    JonsMC
    Yes, please i cannot understand your grammar :/
    Primus likes this.
  7. JonsMC
    Offline

    JonsMC Active Member

    Joined:
    Jul 26, 2016
    Posts:
    107
    Minecraft User:
    JonsMC
    Can i use custom projectile to teleport?, so i created a snowball projectile and i want it to teleport player to where it landed, but only that snowball can teleport, not other snowball, how would i do this?
  8. SOFe
    Offline

    SOFe Banned

    Joined:
    May 28, 2016
    Posts:
    386
    Minecraft User:
    Herobrine
    In stock? Do you seriously mean an arrow in stock?
  9. wolfdale
    Offline

    wolfdale Active Member Plugin Developer

    Joined:
    Dec 3, 2014
    Posts:
    276
    Plugins:
    1
    Minecraft User:
    ace
    If you want to get the block the arrow is touching after it landed, though its not always accurate
    PHP:
    $e $event->getEntity();
         
    $pos $e->add($e->lastMotionX/4,$e->lastMotionY/4,$e->lastMotionZ/4);
         
    $block $e->level->getBlock($pos);
  10. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    PHP:
    if(Entity instanceof SnowballCustom)

Share This Page

Advertisement