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

when player touch something, make the player get killed

Comments in 'Plugin Development' started by LoveToBeDev, Aug 22, 2015.

  1. LoveToBeDev
    Offline

    LoveToBeDev Active Member

    Joined:
    Aug 19, 2015
    Posts:
    55
    Minecraft User:
    LoveToBeDev
    Hello guys, im trying to make something like as i said in the title, but i can't find out how to, i just have 1 week developing plugins and i don't know a lot of things, but if someone could help me, it will be amazing, thanks :)
  2. Svile
    Offline

    Svile Active Member

    Joined:
    Mar 30, 2015
    Posts:
    239
    Minecraft User:
    svile
    TapToDo plugin by falkirks
  3. LoveToBeDev
    Offline

    LoveToBeDev Active Member

    Joined:
    Aug 19, 2015
    Posts:
    55
    Minecraft User:
    LoveToBeDev
    nope, i dont nee that
  4. Svile
    Offline

    Svile Active Member

    Joined:
    Mar 30, 2015
    Posts:
    239
    Minecraft User:
    svile
    So , what do you need?
  5. basprohop
    Offline

    basprohop Active Member Plugin Developer

    Joined:
    Aug 8, 2015
    Posts:
    128
    Plugins:
    3
    Minecraft User:
    basprohop
  6. LoveToBeDev
    Offline

    LoveToBeDev Active Member

    Joined:
    Aug 19, 2015
    Posts:
    55
    Minecraft User:
    LoveToBeDev
    noooo, i don't need that, man, i need like, when a player touches something, he gets killed, i don't want a plugin already made men....
  7. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    PHP:
    public function onPlayerInteract(PlayerInteractEvent $event){
    $player $event->getPlayer(); // Get player who touches the block
    $block $event->getBlock(); // Get block that have been touches (including air)
    // $action = $event->getAction(); 
    if($block->getId() === 1){ // If touched block id is equal to stone
    // kill player
    $player->kill(); // or $player->setHealth(0);
    }
    }
  8. LoveToBeDev
    Offline

    LoveToBeDev Active Member

    Joined:
    Aug 19, 2015
    Posts:
    55
    Minecraft User:
    LoveToBeDev
    THAAAAANKS MAAAAN
  9. Gamecrafter
    Offline

    Gamecrafter Notable Member Plugin Developer

    Joined:
    Nov 20, 2014
    Posts:
    978
    Plugins:
    9
    Learn the PocketMine API. You can't gain without pains.
  10. Svile
    Offline

    Svile Active Member

    Joined:
    Mar 30, 2015
    Posts:
    239
    Minecraft User:
    svile
    Yes but you can unphar plugins and look how they are made ;)
    hoyinm14mc and LDX like this.
  11. LoveToBeDev
    Offline

    LoveToBeDev Active Member

    Joined:
    Aug 19, 2015
    Posts:
    55
    Minecraft User:
    LoveToBeDev
    yes i can men, its very easy :p
  12. CrazedMiner
    Offline

    CrazedMiner Notable Member Plugin Developer

    Joined:
    Jan 31, 2015
    Posts:
    348
    Plugins:
    2
    Minecraft User:
    CrazedMinerYT
    It's easy, but understanding the code that makes the plugin do stuff isn't if, you don't know what your doing.
    Primus likes this.
  13. jojoe77777
    Offline

    jojoe77777 Notable Member Plugin Developer

    Joined:
    May 28, 2015
    Posts:
    653
    Plugins:
    1
    Minecraft User:
    jojoe77777
    When someone taps the block, or when they bump into it?
    LDX likes this.
  14. LoveToBeDev
    Offline

    LoveToBeDev Active Member

    Joined:
    Aug 19, 2015
    Posts:
    55
    Minecraft User:
    LoveToBeDev
    no, when they touch it, not tap it, like, standing on it or something like that, primus gave a right code
  15. jojoe77777
    Offline

    jojoe77777 Notable Member Plugin Developer

    Joined:
    May 28, 2015
    Posts:
    653
    Plugins:
    1
    Minecraft User:
    jojoe77777
    Primus gave code for when someone taps it.
  16. LoveToBeDev
    Offline

    LoveToBeDev Active Member

    Joined:
    Aug 19, 2015
    Posts:
    55
    Minecraft User:
    LoveToBeDev
    i don't need the tapping function, but thanks :)
  17. jojoe77777
    Offline

    jojoe77777 Notable Member Plugin Developer

    Joined:
    May 28, 2015
    Posts:
    653
    Plugins:
    1
    Minecraft User:
    jojoe77777
    Yes, I know. But I'm saying that's what Primus gave you code for.
  18. hoyinm14mc
    Offline

    hoyinm14mc Notable Member Plugin Developer

    Joined:
    Jun 4, 2014
    Posts:
    502
    Plugins:
    9
    Minecraft User:
    hoyinm14mc
    Use PlayerMoveEvent and check if player's y position-1's block's id=1, then kill him.
  19. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    Tap and touch? Is'nt it the same ? I understood what he meant with that cuz i'm good at people psyhology
    UltimateMcraft likes this.
  20. hoyinm14mc
    Offline

    hoyinm14mc Notable Member Plugin Developer

    Joined:
    Jun 4, 2014
    Posts:
    502
    Plugins:
    9
    Minecraft User:
    hoyinm14mc
    Touch = when you stand on the block / when your standing next to (your body is touching it) the block
    Last edited: Aug 23, 2015
    Primus, Legoboy0215 and jojoe77777 like this.

Share This Page

Advertisement