Antiaimbot

Discussion in 'Archived: Plugin Requests' started by xXSilverswordXx, Jul 14, 2014.

  1. Offline

    xXSilverswordXx

    Suggested name: Antiaimbot

    Suggested category: Misc

    What id like:
    A plugin that spawns an invisible harmless creeper npc and invis player npc (through citizens) behind all players every 2 minutes. The npcs delete themselves .2 seconds later. If that player hits the npc give them a watch counter. If they have 5+ watch counters run a command. Clear counters every 24 hours

    Perms and commands: None
     
  2. Offline

    au2001

    ?

    Please use this format :
    For lists use dots :
    • For important words use bold
    • italic
    • underline
    • For wrong phrases use strike-trough
    1. and number lists

    Code:
    And pieces of code (if you have some)
    or images / videos if you can!


    All that would really help doing it, thanks

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 9, 2016
  3. Offline

    xXSilverswordXx

    ive been told that italic and underline + bold annoy some people, its pretty small so i dont need videos / images (i think its explained well enough)
     
  4. Offline

    au2001

    humm, might be doing this when I finish some other plugin

    and does aimbot work with creepers?
    why do you want to spawn a creeper?
     
  5. Offline

    xXSilverswordXx

    ive seen videos of aimbot hacks like nodus

    aimbot makes you autoturn and hit mobs / players when they come into range

    doing this would mean that aimbot would autoattack the invis creeper behind the player. Aimbot turns faster than normal players can. (its very very hard to turn instantly around in .2 seconds) so if the npc was hit, its an indications that aimbot could be present.
     
  6. Offline

    au2001

    xXSilverswordXx
    Then, we could just spawn a harmless invisible creeper for .2 seconds behind the player and if this creeper is hit by this player, he gets a warning.
     
  7. Offline

    xXSilverswordXx

    yup.
    a message like "&4We have detected you may be using aimbot hacks. If so, please remove them."

    send a pm to all players with the perm

    player.aimbotdetect
    player.adminbypass

    "&4&kIIIII&r&4[Player] may be using aimbot, be sure to watch them&r&4&kIIIII"

    if the player gets the warning a second time, send the message

    "&4Suspicion level of aimbot has been raised. If you are using aimbot, turn it off. Admins are now watching you."

    if they activate the trigger again,

    "&4Turn off aimbot now. This is your last chance. A ban will follow if you are detected again."

    if they activate it again

    run a command defined in config.
     
  8. Offline

    Reynergodoy

    Good idea, but you can hit the creeper without aimbot
     
  9. Offline

    au2001

    Reynergodoy
    It will be behind you and it will spawn during .2 seconds...
    And even if you hit it, you must hit it 5 times in 24h, impossible without aimbot/forcefield...
    And even if this player gets banned, he will be able to ask on the forum for an unban...
    I think this way is the best way to catch hacking players...

    xXSilverswordXx
    Almost finished, permissions are AntiAimbot.bypass and AntiAimbot.detect
    Here is an example config :
    Code:
    # Config file
     
    maxWarning:
      number: 5
      command: 'ban {PLAYER} Aimbot or forcefield hacks are forbidden. Please uninstall them.'
     
    warnings:
      1:
        player: '&4We have detected you may be using aimbot or forcefield hacks. If so, please remove them.'
        admins: '&4&kIIIII&r&4{PLAYER} may be using aimbot or forcefield, be sure to watch them&r&4&kIIIII'
      2:
        player: '&4Suspicion level of aimbot or forcefield has been raised. If you are using hacks, turn them off. Admins are now watching you.'
        admins: '&4&kIIIII&r&4{PLAYER} may be using aimbot, be sure to watch them&r&4&kIIIII'
      3:
        player: '&4Suspicion level of aimbot or forcefield has been raised. If you are using hacks, turn them off. Admins are now watching you.'
        admins: '&4&kIIIII&r&4{PLAYER} may be using aimbot, be sure to watch them&r&4&kIIIII'
      4:
        player: '&4Suspicion level of aimbot or forcefield has been raised. If you are using hacks, turn them off. Admins are now watching you.'
        admins: '&4&kIIIII&r&4{PLAYER} may be using aimbot, be sure to watch them&r&4&kIIIII'
      5:
        player: '&4You have been warned, aimbot and forcefield hacks are forbidden.'
        admins: '&4&kIIIII&r&4{PLAYER} is using aimbot, he has been banned&r&4&kIIIII'
    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 9, 2016
  10. Online

    timtower Administrator Administrator Moderator

    MCMastery
     
  11. Offline

    MCMastery

    Yeah I messed up...


    Make the time configurable

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 9, 2016
  12. Offline

    au2001

    MCMastery
    What time? The delay between each check?

    timtower
    Do you know how to remove the "tsssss" from the creeper? (prevent him lightning up)
    Without any packets if it's possible ;)

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 9, 2016
  13. Online

    timtower Administrator Administrator Moderator

  14. Offline

    au2001

    xXSilverswordXx
    Is it okay if you hear the "tssssss" of the creeper when you're checked?
    Can't remove :eek:

    timtower
    What about spawning passive mobs?
    And change the attack radius of a mob?
    Even if you need packets, it's okay but it's really annoying to have a "tssss" every minute --'

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 9, 2016
  15. Offline

    daavko

    au2001 Wait, doesn't Nodus and other hacked clients have that little feature - Target invisibles: true/false?
     
  16. Online

    timtower Administrator Administrator Moderator

    au2001 Not sure if they will get targeted.
    NMS probably
     
  17. Offline

    au2001

    timtower daavko
    I could make them visible but the sound is still there --'

    Hacks are really well done -.- they've be designed considering EVERY way to detect them --'

    If a mob spawns during 1 tick, is it going to be detected by the forcefield/aimbot ?
     
  18. Offline

    daavko

    au2001 I don't know. But if you make it, I could test it out with various hacked clients (I have found very nice website full of them :D)
     
  19. Offline

    Deleted user

    au2001
    Use Packets so other players won't see it. It's difficult but well worth it.

    Have the mob spawn for at least 5 ticks. Put all cached Entity IDs into a HashMap or something that maps it to number of ticks spawned. Then, just have one runnable cycling through it. The HashMap size should be relatively small, so searching shouldn't be a big issue.

    If you'd like me to take a look at it, I'd be more than happy to
     
  20. Offline

    au2001

    zombiekiller753 Please do!
    Main.class (imports etc. + Creeper Damaged By Player Event) :
    Code:
    package me.au2001.AntiAimbot;
     
    import java.util.HashMap;
     
    import org.bukkit.Bukkit;
    import org.bukkit.ChatColor;
    import org.bukkit.entity.Entity;
    import org.bukkit.entity.Player;
    import org.bukkit.event.EventHandler;
    import org.bukkit.event.Listener;
    import org.bukkit.event.entity.EntityDamageByEntityEvent;
    import org.bukkit.plugin.java.JavaPlugin;
     
    public class Main extends JavaPlugin implements Listener {
     
        static Main plugin = null;
        static HashMap<Player, Entity> fakes = new HashMap<Player, Entity>();
     
        public void onEnable () {
            getConfig().options().copyDefaults(true);
            saveDefaultConfig();
         
            plugin = this;
         
            Bukkit.getPluginManager().registerEvents(this, this);
            Summons.task.runTaskTimer(this, 20, 1200);
        }
     
        @EventHandler
        public void onPlayerDamageMob (EntityDamageByEntityEvent event) {
            if (fakes.containsKey(event.getDamager())) {
                if (fakes.get(event.getDamager()).equals(event.getEntity())) {
                    event.setCancelled(true);
                    if (getConfig().isSet("warns." + event.getDamager().getUniqueId())) {
                        int warns = getConfig().getInt("warns." + event.getDamager().getUniqueId());
                        warns++;
                        String message = ChatColor.translateAlternateColorCodes('&', getConfig().getString("warnings." + warns + ".admins"));
                        Bukkit.broadcast(message, "AntiAimbot.detect");
                        message = ChatColor.translateAlternateColorCodes('&', getConfig().getString("warnings." + warns + ".player"));
                        ((Player) event.getDamager()).sendMessage(message.replaceAll("\\{PLAYER\\}", ((Player) event.getDamager()).getName()));
                        getConfig().set("warns." + event.getDamager().getUniqueId(), warns);
                        if (warns == getConfig().getInt("maxWarning.number")) {
                            getConfig().set("warns." + event.getDamager().getUniqueId(), null);
                            message = getConfig().getString("maxWarning.command").replaceAll("\\{PLAYER\\}", ((Player) event.getDamager()).getName());
                            Bukkit.dispatchCommand(Bukkit.getConsoleSender(), message);
                        }
                    } else {
                        getConfig().set("warns." + event.getDamager().getUniqueId(), 1);
                    }
                    saveConfig();
                    fakes.remove(event.getDamager());
                }
            }
        }
     
    }
    
    Summons.class (summon creeper + in commentary should summon fake player) :
    Code:
    package me.au2001.AntiAimbot;
     
    import org.bukkit.Bukkit;
    import org.bukkit.Location;
    import org.bukkit.entity.Entity;
    import org.bukkit.entity.EntityType;
    import org.bukkit.entity.LivingEntity;
    import org.bukkit.entity.Player;
    import org.bukkit.potion.PotionEffect;
    import org.bukkit.potion.PotionEffectType;
    import org.bukkit.scheduler.BukkitRunnable;
     
    public class Summons {
     
        static BukkitRunnable task = new BukkitRunnable() {
            public void run() {
                //int entityId = 2001;
                for (final Player player : Bukkit.getOnlinePlayers()) {
                    if (!player.hasPermission("AntiAimbot.adminbypass")) {
                        /*ProtocolManager manager = ProtocolLibrary.getProtocolManager();
                        Packet14SpawnNamedEntity spawned = new Packet14SpawnNamedEntity();
                     
                        spawned.setEntityID(entityId);
                        spawned.setPosition(player.getLocation().toVector());
                        spawned.setPlayerName("Bob");
                     
                        Main.fakes.add(spawned);
                     
                        spawned.setYaw(0);
                        spawned.setPitch(-45);
                     
                        WrappedDataWatcher watcher = new WrappedDataWatcher();
                        watcher.setObject(0, (byte) 0);
                        watcher.setObject(1, (short) 300);
                        watcher.setObject(8, (int) 0);
                        spawned.setMetadata(watcher);
                     
                        try {
                            manager.sendServerPacket(player, spawned.getHandle());
                        } catch (InvocationTargetException e) {
                            e.printStackTrace();
                        }*/
                        Location loc = player.getLocation().add(player.getEyeLocation().getDirection().multiply(-1.5).setY(0));
                        final Entity entity = loc.getWorld().spawnEntity(loc, EntityType.CREEPER);
                        ((LivingEntity) entity).addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, 400000, 1000));
                     
                        Main.fakes.put(player, entity);
     
                        new BukkitRunnable() {
                            public void run() {
                                /*ProtocolManager manager = ProtocolLibrary.getProtocolManager();
                                Packet29DestroyEntity spawned = new Packet29DestroyEntity();
                             
                                spawned.setEntityID(entityId);*/
                                entity.remove();
                                Main.fakes.remove(player);
                            }
                        }.runTaskLater(Main.plugin, 10);
                        //entityId++;
                    }
                }
            }
        };
     
     
     
    }
    
    zombiekiller753
    So this code would, every minute, spawn an invisible creeper behind the player during 10 ticks.
    If the player hits this creeper, then he gets a warning.
    After the number of warning set in the config, a command is executed.
    After 10 ticks, the creeper despawns.

    zombiekiller753 btw, I hate packets so the commented part might be totally wrong ;)

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 9, 2016
  21. Offline

    Deleted user

    au2001
    Hmm. Just realized an issue with the packets. The Server would never know where the actual players/creepers are.

    However, with packets, everyone would see flickering creepers/players.

    Ugh.
     
  22. Offline

    xXSilverswordXx

    the mob doesnt have to be a creeper, any hostile mob with no particle effect (dont do blaze) can be used- maybe silverfish that has a view range of zero? You wouldnt hear much of the sound because of the time the mob is there
     

Share This Page