Solved How to spawn hidden entities

Discussion in 'Plugin Development' started by Deleted user, May 22, 2014.

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

    Deleted user

    I need to spawn an hidden entity which can be hit by players. Type doesn't matter. Then, I need to handle its EntityDamageByEntityEvent event.
    No sounds should be heard by players, so avoid Invisibility effect.
     
  2. Joiner This sounds like a basic forcefield checking plugin :p

    And since you didn't ask any questions I'll say: Okay, do that.
     
  3. Offline

    Deleted user

    What do you mean?
     
  4. Joiner How many questions have you actually asked? I have no idea how to help you if I don't know your problem.
     
  5. Offline

    Deleted user

    AdamQpzm My problem is:
     
  6. Offline

    Garris0n

  7. Joiner How much of that do you know how to do? You didn't make that clear at all.
     
  8. Offline

    Deleted user

    Garris0n
    AdamQpzm I know how to spawn normal entities and how to use EntityDamageByEntityEvent event.
     
  9. Offline

    Garris0n

    But why would you need to do this?
     
  10. Joiner Easiest solution is probably to use the invisible potion effect and block the sending of the sound packets, which I believe can be done with protocollib.

    Garris0n I believe:
     
  11. Offline

    Garris0n

    I assumed, but I wanted confirmation from the OP before explaining why that's a terrible way to check for forcefield.
     
    AdamQpzm likes this.
  12. Offline

    Deleted user

    Garris0n I want to create a simple basic forcefield checking plugin.
    AdamQpzm Examples?
     
  13. Garris0n Fair enough. And I agree it's terrible, yet see it done fairly often. The sheer number of false positives that could result in is just a start. :p

    Joiner What do you want examples of? The invisibility or the sound packets?

    If the invisibility, I would say just look in the JavaDocs.
    If the sound packets, I've never tried it, and don't use protocollib but I seem to remember someone suggesting it before, so I repeated it. But I'll let you into a little secret I, and probably many of the other people who help people out and seem to know everything:

    We search.
     
  14. Offline

    Garris0n


    Use NoCheatPlus. First of all, it's just unclean in general to spawn mobs everywhere. Second, the hacker probably has their FF set to player-only. Third, the hacker is probably toggling it on and off depending on when they're actually fighting players.

    Either use NCP or implement an actual check to see if they're looking at players when they hit them. That is the only inconspicuous and effective way to go about it.
     
    AdamQpzm likes this.
  15. Offline

    Deleted user

    I know, but I want to improve it.
    So teach me how to spawn a bot (such as Citizens).
    Lag isn't the problem.
    Plan B.
     
  16. Offline

    Garris0n

    What you are doing is not an improvement, it's significantly inferior. NCP will catch them actually cheating against players, this will only catch somebody if you get really lucky.
    Look at the Citizens code. Or the numerous resources and other things scattered around.
    Nobody said anything about lag.
    Which is pointless because NoCheatPlus already does that.
     
  17. Offline

    Deleted user

    To hit entities above the player is 100% killaura. I want to make this.
     
  18. Offline

    Garris0n

    looks up
    clicks
     
    xTigerRebornx likes this.
  19. Offline

    Deleted user

    Sorry for my incorrect english!
    I meant: I want to detect this behavior, not play it.
     
  20. Offline

    Garris0n

    What I meant was that it is not a behavior limited to forcefield. Also, the mob would never float perfectly and it would get in the way of things.

    If what you want to do was the best strategy, NoCheatPlus would have implemented it a long time ago. It is not the best strategy.
     
  21. Offline

    Deleted user

  22. Offline

    RawCode

    if you spawn entity server side only client wont damage with, with or without cheats.

    your actions make no sense.
     
  23. Joiner I didnt read all what have been said here, but you can spawn random entity that will follow the player, and after that send the player packet of named entity spawn (player entity), after that, you can probably add to it invisible effect, and maybe cancel the effect animation (?),
     
  24. Offline

    Deleted user

  25. Offline

    Garris0n

    You asked for an entity that the client isn't aware of but at the same time will attack. That doesn't make sense. The client has to be aware of the entity to attack it.

    ...which is why it's a stupid way to detect cheaters.
     
    RawCode likes this.
  26. Joiner You can spawn a skeleton entity for example, after that, send player packet with the entity id to add servers after that give the fake "player" invisibility effect, and run delayed task that will teleport the entity to the back of the player, if the player hits the entity, he MIGHT be hacker... note that lags can make the player attack the entity even if its in his back... you probably add the player every 3~ ticks to hashmap with his UUID as key, and the times he hit the entity (so every 3~ ticks, increase the number by 1, ) if the player is in the map with 20~ . ban him.. ;) good luck!
     
  27. Offline

    Deleted user

    Invisible as texture, visible as entity.
    This is my question. How?
     
  28. Offline

    RawCode

    Invisible as texture, visible as entity. Joiner

    what about hot cup of no?

    client does not support this.
     
  29. Joiner I cant explain better than that...
    1. extend entity skeleton and make it doesnt move and remove his sounds when idle/attack/damaged.
    2. send PacketPlayOutNamedEntitySpawn to the player you think is the cheater, for the rest of the players send destroy entity packet.
    3. teleport the entity every 1~3 ticks (depend how precise you want it to be) to the back of the player
    4. check if the player is looking at the entity
    4. make map with UUID as key and integer,
    5. every time the player hits the entity, (and not looking at the entity) add one to the integer in the map (key = uuid),
    6. remove the player if he isnt attacking the entity for like 20 ticks,
    7. if the player still in the map, and the integer is over ~20, ban him..
     
  30. Offline

    Deleted user

    I understood what I should do, but I don't know how.
    How to?
     
Thread Status:
Not open for further replies.

Share This Page