Help Me

Discussion in 'Help' started by Sesamo, Jun 28, 2020.

?

I want to crrate plugin when player death remove item 260 ,288 ,262

Poll closed Jun 28, 2020.
  1. Can

    0 vote(s)
    0.0%
  2. Cant

    0 vote(s)
    0.0%
Multiple votes are allowed.
  1. Sesamo

    Sesamo Silverfish

    Messages:
    18
    GitHub:
    Lowzer
    public function whenplayerdie(EntityDeathEvent $ev){
    $event = $ev->getEntity;
    if($event instanceof player){
    if($ev instanceof ItemSpawnEvent){
    $entity = $ev->getEntity();
    $item = $entity->getItem();
    $item1 = $entity->getItem();
    $item2 = $entity->getItem();
    if(!($entity instanceof Human)){
    if($item->getid() == 260){
    $entity->close($item);
    }
    if($item1->getid() == 288){
    $entity->close($item1);
    }
    if($item2->getid() == 262){
    $entity->close($item2);
    }

    }
    }
    } }
     
  2. dadodasyra

    dadodasyra Spider Jockey

    Messages:
    27
    GitHub:
    dadodasyra
    Okay so, already, put a title appropriate to your request, then explain your concern then paste your code in a code block and cleanly please because it is clearly illegible here and we have no idea what you want to do.
     
  3. JviguyGamesYT

    JviguyGamesYT Slime

    Messages:
    88
    GitHub:
    jviguy
    from my understanding he wants to get rid of the players drops on death which i can do that ,but i have no idea if thats right and i wont copy and paste in code if its not what is needed.
     
  4. Primus

    Primus Zombie

    Messages:
    352
    Doesn't sound like you tried.
    PHP:
    /** @var event PlayerDeathEvent */
    foreach(drops as drop) if(drop.id === xxx) unset(drops[drop.key]);
    event.setDrops(drop);
    Little did I.
     
  5. dadodasyra

    dadodasyra Spider Jockey

    Messages:
    27
    GitHub:
    dadodasyra
    Sorry ? For my thread I have an appropriate title. For the code he is in a code block. I don't see the problem.

    Just to warn in PHP there are $
     
  6. Primus

    Primus Zombie

    Messages:
    352
    Pseudocode. You made me look like I'm a newbie :D
     
  7. Sesamo

    Sesamo Silverfish

    Messages:
    18
    GitHub:
    Lowzer

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.