AntiAura plugin (need help)

Discussion in 'Plugin Development' started by WingedMLGPro, Mar 19, 2015.

Thread Status:
Not open for further replies.
  1. Offline

    WingedMLGPro

    hey everyone,
    im trying to make a anti aura plugin that will spawn 4 player entities around the target player,
    things i need help with:
    1. spawning a player entity around the target player
    2. sending the message to the staff about how many entities they hit (*/4)

    if you can help me with this that would be great!
    thanks,
    WingedMLGPro.
     
  2. Online

    timtower Administrator Administrator Moderator

    @WingedMLGPro
    2. Loop through all players, check for a certain permissions, send if permission is there.
     
  3. Offline

    WingedMLGPro

    @timtower wait, I don't need to know how to send the message to the staff, I need help with sending them a message saying how many entities they hit, like how do u make it so when a entity is hit it maybe adds 1 to a int and then u send them a message with the int
     
  4. Offline

    Konato_K

    @WingedMLGPro Listen to EntityDamageEvent or something related and add one to your magical int?
     
  5. Offline

    WingedMLGPro

    @Konato_K How do u add 1 to a int?
    here is my Listener code...

    public class AuraListener implements Listener {

    public static int total = 0;
    @EventHandler
    public void onEDamage(EntityDamageByEntityEvent e) {
    Entity entity = e.getEntity();
    if (entity instanceof Player) {
    Player p = (Player) entity;
    Villager v1 = (Villager)entity;
    //add 1 to the int here (need help to do that)}
    }
    }
     
  6. Offline

    nverdier

    @WingedMLGPro Just use total++. You should learn Java before trying to use the Bukkit API. Bukkit is written in Java, and learning the Bukkit API before Java is like running before walking.
     
    Konato_K likes this.
  7. Offline

    guitargun

    also why are you casting the entity to player and to a villager. you just checked if the entity was a player so why casting it to the wrong thing?

    quick tip:
    event.getentity = victim
    event.getdamager = attacker

    you should use them. also note some killaura mods allow to switch between hitting mobs and hitting players
     
  8. Offline

    WingedMLGPro

    @guitargun kk, but how do you pawn a player entity? everytime i do
    Player entity1 = (Player) t.getLocation().getWorld().spawnEntity(t.getLocation(), EntityType.PLAYER);
    It comes up with an error!
     
  9. Offline

    Konato_K

    @WingedMLGPro You can't spawn a player naturally with Bukkit, you'll need to use NMS tricks or so
     
  10. Offline

    Funergy

    @WingedMLGPro There are great resources in the resource section about NPC's !
     
  11. Offline

    WingedMLGPro

    @Konato_K is there another way to do it, as NMS is shut down now!
     
  12. Offline

    nverdier

  13. Offline

    WingedMLGPro

    @nverdier well, i need to know how to spawn a Player Entity, and u cant do that in the Bukkit API, so i need another way to spawn the and he said NMS does it, but that is shut down so i need another API to do it.
     
  14. Offline

    nverdier

    @WingedMLGPro How is NMS "shut down" and what does that mean?
     
  15. Offline

    Monkey_Swag

    @nverdier he doesn't have a craftbukkit jar to work with.
     
  16. Offline

    nverdier

Thread Status:
Not open for further replies.

Share This Page