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

KnockBack

Comments in 'Plugin Development' started by Skullex, Feb 5, 2016.

  1. jojoe77777
    Offline

    jojoe77777 Notable Member Plugin Developer

    Joined:
    May 28, 2015
    Posts:
    653
    Plugins:
    1
    Minecraft User:
    jojoe77777
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    minebuilder0110 likes this.
  2. minebuilder0110
    Offline

    minebuilder0110 Notable Member

    Joined:
    Dec 8, 2014
    Posts:
    485
    Minecraft User:
    Apparitional
    Oh right. I thought they were talking about the first post. I'm disappointed about myself for not being able to find that... :p
  3. XdmingXD
    Offline

    XdmingXD New Member

    Joined:
    Jun 24, 2016
    Posts:
    12
    Minecraft User:
    XdmingXd
    Here lol

    PHP:
    public function onDamage(EntityDamageEvent $event){$entity $event->getEntity();
     if(
    $event instanceof EntityDamageByEntityEvent){$fizz = new BlazeShootSound($entity);$entity->getLevel()->addSound($fizz);$entity->knockBack($entity0101);
     } 
    // KnockBack in PVP}

     
    public function onDamage(EntityDamageByBlockEvent $event){$entity $event->getEntity();
     if(
    $event instanceof EntityDamageByEntityEvent){$entity->knockBack($entity0101);
     } 
    // KnockBack from block damage, not explosion friendly because you'll fly away}
  4. XdmingXD
    Offline

    XdmingXD New Member

    Joined:
    Jun 24, 2016
    Posts:
    12
    Minecraft User:
    XdmingXd
    Also the threads starter should import TextFormat IF you really want that colour when it is loaded

    like this?lol
    Idk if it is correct because I am a new starter...XD
    BTW hope I can open my server on 1st,August....

    PHP:
    use pocketmine\utils\TextFormat as Color;
  5. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    It's better to use TextFormat, correct.
  6. XdmingXD
    Offline

    XdmingXD New Member

    Joined:
    Jun 24, 2016
    Posts:
    12
    Minecraft User:
    XdmingXd
    YS! Thank you! lel
    So this plugin is like a lanuchPad?
    Skullex likes this.
  7. Skullex
    Offline

    Skullex Active Member

    Joined:
    Nov 14, 2015
    Posts:
    212
    Minecraft User:
    Skullex
    Yes and no, but a plugin that deals knock back when you are attacked rather than when you've moved across a specific block

Share This Page

Advertisement