Invisible Plugin

Discussion in 'Plugin Requests' started by Dropix, Oct 30, 2017.

Thread Status:
Not open for further replies.
  1. Plugin category: RPG (PvE)

    Minecraft version: 1.11.2

    Suggested name: MobInvis (Or anything like this)

    What I want: I need a Plugin that should allow a player to hide his armor if he goes invisible (just by potion) and should be revealed, if he get any damage or deal any damage. I allready found plugins like this, but I need it to get invisible across from mobs as well. Would that be possible?

    Ideas for commands: Like /invis or something like this

    Ideas for permissions: Not needed

    When I'd like it by: asap
     
  2. Offline

    MightyOne

    I'd like to do this
     
  3. Hey! I'd be happy to take this request! However, when you say you need it to get invisible across from mobs as well, do you mean the mob not be able to track the player or the mob to be completely invisible if the mob is wearing armor?

    Sorry ignore that ^^. I can't really be bothered to work with packets and reflection xD.
     
    Last edited: Oct 30, 2017
  4. Offline

    MightyOne

    I made a version without packets. I jut used the method Player#hide(Player)
    Here is a drop box link:
    *link*
    I could not test it that intensivly since I would need to be 2 players at the same time.
    If you find any bug you can tell me about it and I'll look how I can fix it.

    Monsters will not stop to target you if you slurp a potion infront of them. Idk if that is important for you
     
  5. Sorry for my late reply. I tried it and this only works as the normal invisible potion :/.
     
  6. Offline

    MightyOne

    @Dropix what exactly do you mean? I already explained that movs that already targeted you will not stop to follow you if you drink a potion
     
  7. @MightyOne is saying that it would require packets to do this for mobs, as Bukkit does not provide a way to do this (but minecraft does). Basically, he will have to import from your minecraft server version and send a code packet telling the player that the mob's armor has disappeared. This could be done by calculating the equivalent of the damage resistance the mob would get from specific sources with armor, and actually removing the armor, but applying that damage reduction. (If you need help MightyOne, let me know)


    Edit:
    @MightyOne he is asking for mobs to not show their armor when the mob has invisibility.

    @Dropix Note that hackers can still see invisible entities, unless you prevent them from rendering to the client. However that would prevent you from hitting them :b
     
  8. Offline

    MightyOne

    @0ct0berBkkitPlgins oh mhhh... I am not a friend of packets. I have not tried to wor kwith that a lot. Well if you want you can continue with... maybe what i coded. But I found out that there a re still bugs
     
  9. Remember what I said? You could calculate the damage reduction that the armor would normally give. (Note: this will vary depending on the game version)
     
  10. Nah, I thought about to get invisible across the mobs as a player :D. I dont know if thats even possible
     
  11. @MightyOne (he clarified)
    @Dropix That's what MightyOne has done :p Try the plugin he made, it should work! Only thing is, while a player is invisible they can't be attacked...
     
  12. Yea, but it just give me the invisible effect and the mobs starts attacking me, if I walk in their ~5 Block radius, even if I dont attack them (And thats because my armor is still shown). I need something that allows me to get invisible accross mobs, until I attack them :/
     
  13. Offline

    MightyOne

    I did not find any way without nms to stop mobs from attacking a already targeted player. Ill look it up in this week
     
  14. Offline

    timtower Administrator Administrator Moderator

    @MightyOne Did you try setting the targer to null?
     
  15. Offline

    MightyOne

    @timtower of course i did. Bu this methid is broken. For 1.12 it looked like it would work if you set the target to itself and then to null but idk it seems to not quiet work good.
     
  16. Offline

    timtower Administrator Administrator Moderator

    @MightyOne Does it not work or does it retarget right away?
     
  17. Offline

    MightyOne

    Last edited: Nov 7, 2017
  18. I tested this and this one works just for creepers, but not to spider and Zombies, somehow. Whatever, you tried it so thank you :)
     
  19. Offline

    MightyOne

    I always tested with zombies... it worked

    well slimes are not handled as Monster xD but everything else...

    aaand i forgot the permission for /hide and /show
     
    Last edited: Nov 7, 2017
  20. I guess its just because the armor, which is still shown. ._. Im not sure, but Zombies start attacking me if I get close to them
     
  21. Sorry, haven't been on Bukkit for a bit.
    @MightyOne I've taken a look at the plugin, if you're alright with that...

    You spelled listeners wrong... and the plugin is a bit complex and hard to read... I think you could simplify it to just running a repeating task when a player receives invisibility, then removing the task and their no-target status whenever they no longer have the effect (the effect may be removed by commands). You should also check for cancelled events, such as when attacking/combat is cancelled. To do this, just use:

    Code:
    @EventHandler(ignoreCancelled=true)
    Please let me know if you're going to do the plugin, and if not or if you'd rather not go through the (sometimes lengthy) process of finding the error in your plugin, I'm happy to do it.
     
  22. Offline

    timtower Administrator Administrator Moderator

  23. Perhaps I phrased it oddly... if combat is cancelled, most likely this plugin shouldn't act on the combat. Checking if it's cancelled before proceeding or only proceeding when it isn't cancelled is the general idea I meant.
     
  24. Offline

    MightyOne

    @OctaDragon yeah added the tag. Guess the @Dropix does not read it anymore anyway. I dont know why you would call this plugin hard to read. For me it is good and at some point it feels pestering to me that you correct every minor spelling mistake or call the plugin hardl to undertandable. I mean if it works fine there should not be anything to complain about.
     
Thread Status:
Not open for further replies.

Share This Page