I am trying to make a telekinesis plugin for mobs.

Discussion in 'Plugin Development' started by SpeckyDevy, Apr 1, 2021.

  1. Offline

    SpeckyDevy

    Cannot resolve method 'getDrops' in 'Entity'
    Cannot resolve method 'getInventor' in 'Player'
    I get these two errors line 85



    @EventHandlerpublic void getCoin1(EntityDeathEvent e) {
    Entity dead = e.getEntity(); if (dead.getLastDamageCause() instanceof Player) {
    if (e.getEntity().getKiller().getPlayer().getInventory().getItemInMainHand() == null)
    return; if (!e.getEntity().getKiller().getPlayer().getInventory().getItemInMainHand().hasItemMeta())
    return; if (!e.getEntity().getKiller().getPlayer().getInventory().getItemInMainHand().getItemMeta().hasEnchant(CustomEnchants.LIFESTEAL))
    return; if (e.getEntity().getKiller().getGameMode() == GameMode.CREATIVE || e.getEntity().getKiller().getGameMode() == GameMode.SPECTATOR)
    return; if (e.getEntity().getKiller().getInventory().firstEmpty() == -1)
    return; if (e.getEntity() instanceof Container)
    return;e.getEntity();Player player = e.getEntity().getKiller().getPlayer();Entity entity = e.getEntity();Collection<ItemStack> drops = entity.getDrops(Player.getInventor().getItemInMainHand()); if (drops.isEmpty())
    return;player.getInventory().addItem(drops.iterator().next());}
    }
     
  2. Offline

    timtower Administrator Administrator Moderator

    @SpeckyDevy getDrops is for the event
    getInventor needs to be getInventory
     

Share This Page