Spawn entity invisible?

Discussion in 'Plugin Development' started by CBaer4848, Jul 27, 2014.

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

    CBaer4848

    So here's the deal, I'm making an anti-forcefield plugin, and everytime the person clicks, a villager spawns behind them about 2-3 blocks, and the villager isn't invisible. Is there a line of code that will make them invisible? Thanks :)
     
  2. Offline

    Giraffeknee

    .addPotionEffect()

    (I believe) CBaer4848
     
  3. Offline

    CBaer4848

    Code:
    villager.addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, Integer.MAX_VALUE, 1));
    I've added this, would this work? Giraffeknee
     
  4. Offline

    Giraffeknee

  5. Wouldn't this cause a lot of lagg? Cause if they were hacking, they would automatically attack the villager (click) spawning another villager, attack again, spawn again etc
     
  6. Offline

    Giraffeknee

  7. Giraffeknee
    Just some advice :p and I wouldn't make it everytime they clicked, I would go with a timer, spawning in an invisible bat above the player for 1 second, and checking if the player attacks it.
     
  8. Offline

    CBaer4848

    XxShadow_NinjaxxX I've did what you said, but, the bat is visible for one second then disappears, any advice?
     
  9. CBaer4848
    Same thing with the villager? Make it invisible
     
  10. Offline

    CBaer4848

  11. CBaer4848
    Do you get the same problem with villagers?
     
  12. Offline

    CBaer4848

  13. Can you post what you have?
     
  14. Offline

    Xerucide

    Since as far as I know this hasn't been resolved, I'll just dump what I know and/or think.
    This is easily possible, although I can see a few issues with your idea.
    1. Most PvP hackers using kill aura will have unticked or otherwise removed attacking of animals due to them getting in the way during actual PvP. This will decrease your detection rate significantly.
    2. Many current clients either allow the user to toggle attacking of invisible entities or altogether ignore anything invisible. Once again, will lower detection rate.
    3. It would be best to spawn the NPC at an either 10:00 or 2:00 angle to the front of the player. This is because many kill auras will only pay attention to entities (players usually) in the 45 degree field in front of the player. Correct me if I'm wrong here, just based on the limited experience I've had with the latest clients with killaura.
    I would suggest spawning visible NPCs named "killauratest" followed by random numbers. Make it a somewhat regular audit to show players that the staff are actively screening for PvP hacks.
     
Thread Status:
Not open for further replies.

Share This Page