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

Netherportal ->TeleportPortal

Comments in 'Plugin Development' started by Marcelo234, Jan 27, 2016.

  1. Marcelo234
    Offline

    Marcelo234 New Member

    Joined:
    Oct 18, 2014
    Posts:
    204
    Hey Guys...As you know in the MCPE are Netherportals,how to coding this? :

    If A Player use a Netherportal He should be teleported to a special location...
    Thx
  2. Marcelo234
    Offline

    Marcelo234 New Member

    Joined:
    Oct 18, 2014
    Posts:
    204
    Than....how to Do it in PM?:)
  3. MyNameIsTriXz
    Offline

    MyNameIsTriXz Notable Member

    Joined:
    Aug 17, 2015
    Posts:
    538
    Minecraft User:
    MyNameIsTriXz
    Code it by yourself like this

    PHP:
    public function onMove(PlayerMoveEvent $event){
    $player $event->getPlayer();
    if(
    $player->getLevel()->getBlockIdAt($player->x$player->y$player->z) == 90){
    To let the animation go and tp the player after animation:
    add a scheduler wih 40 ticks
    Pair the scheduler 
    and let a function be executed when its over
    if($this->schedulerIsOver){
    Now you can teleport the player
    }}}

    Because players get suffocated in blocks who arent liquid blocks or spider web

    public function onDamage(EntityDamageEvent $event);
    if(
    $player $event->getEntity() instanceof Player){
    if(
    $player->getLevel()->getBlockIdAt($player->x$player->y$player->z) == 90){
    if(
    $event->getCause() == EntityDmageEvent::CAUSE_SUFFOCATION[/B]){
    $event->setCancelled();
    }}}}
    Last edited: Jan 27, 2016
  4. PocketKiller
    Offline

    PocketKiller Notable Member

    Joined:
    Jul 20, 2015
    Posts:
    741
    delete this part
  5. MyNameIsTriXz
    Offline

    MyNameIsTriXz Notable Member

    Joined:
    Aug 17, 2015
    Posts:
    538
    Minecraft User:
    MyNameIsTriXz
    You mean sleep? I dont know why everyone hates sleep? Why is it bad practise?
  6. PocketKiller
    Offline

    PocketKiller Notable Member

    Joined:
    Jul 20, 2015
    Posts:
    741
    it stops the whole pocketmine process. like lagging server for x seconds
    Last edited: Jan 27, 2016
  7. MyNameIsTriXz
    Offline

    MyNameIsTriXz Notable Member

    Joined:
    Aug 17, 2015
    Posts:
    538
    Minecraft User:
    MyNameIsTriXz
    The whole?! Oh okay so its more than useless
  8. Yoyo95220
    Offline

    Yoyo95220 New Member

    Joined:
    Sep 2, 2015
    Posts:
    8
    Minecraft User:
    Yoyo95220
    What is imagicalmine ?
  9. Tim // robske Büba
    Offline

    Tim // robske Büba Notable Member

    Joined:
    Feb 26, 2014
    Posts:
    606
    Minecraft User:
    robske_110
    Won't discuss that here.
  10. thebigsmileXD
    Offline

    thebigsmileXD Banned

    Joined:
    May 19, 2015
    Posts:
    845
    Plugins:
    1
    Minecraft User:
    XenialDan
    Its a third party pocketmine. Don't use that for coding, because you want your plugins to work on any PM, right?

    In this forum there was a discussion about nether portal blocks.. wrote there yesterday.. wait a mom.. Aaah, there: https://forums.pocketmine.net/threads/nether-portal-block.12353/

Share This Page

Advertisement