MyPetORG / MyPet

🐕 Extensive pet plugin for Bukkit/Spigot
https://www.spigotmc.org/resources/mypet.12725/
GNU Lesser General Public License v3.0
179 stars 98 forks source link

Feature Request - Guardian and Water pets AI, Pet Call and water. #605

Open Onoitsu2 opened 8 years ago

Onoitsu2 commented 8 years ago

I do not know how possible this is, or if it is even possible, however if someone is brave enough to capture a guardian, is there any way to have it actually swim like a normal guardian would. I say this because for example if it is trained up enough to have the beacon abilities with water breathing in that list, it would be great. However currently that is rather pointless when they merely float at the top of the water and then despawn when you dive a little too deep.

I apologize if this was listed before, however my searching for this, I was unable to find it asked for before. If I am incorrect and it has been answered, please point me to that acceptance/denial of the feature request.

Also on that note, if you are at the surface of the water, it would be nice to have the ability to /pc your pet, instead I have had to locate a little block of land to /pc my pet there again, from it being "despawn happy"

Thank you much for making this amazing and very diverse plugin.

scomans commented 8 years ago

Nobody requested that yet but they requested a flying AI so it's the same in blue. Minecraft itself doesn't has an AI for both of them and I don't have the time and knowledge to do it myself :/

Onoitsu2 commented 8 years ago

How do the guardians function naturally then? Even the one that is claimed as a MyPet, tries to swim, but simply does not go under the water, as I am unsure of what part of the code is preventing that. Like Citizens there must be a toggle to allow swimming for an NPC as they have the /npc swim [true/false] command, and you already have a 3d range find, you would simply need to make it move in the appropriate direction, and the enabled swim code for the Pet should take over if Minecraft sees it as having such a flag. This is just an educated guess from a programmer of various other languages, but never touched a plugin for Minecraft, so I might be completely wrong.

As for the thoughts on the flying NPC, Citizens has /npc gravity which might be just the thing to look at what that does to an NPC, to enable a flying MyPet.

zerafox commented 8 years ago

If I recall correctly, pets are currently using a derivative of the Wolf AI. Since Wolves do not swim, and instead "float" on the water's surface, and rarely if ever will teleport to a player in the water, the MyPets act in a similar way. Once a pet is tamed, the previous AI for the mob isn't used anymore, which is why Guardians, Ghast or other similar mobs no longer retain their previous "wild" AI functions.

Such things as Bats "hover" or "float" by default of their model, which is why MyPet retains that appearance upon taming one. Yet of course Bats and Ghast MyPets cannot fly either. To achieve this, a code must be designed and written specifically for MyPet for the pet to swim or fly. Unfornately at this time (I may be wrong here) is not something that Keyle is capable of doing due to time and knowledge of how to do so.

scomans commented 8 years ago

All swimming and flying mobs in Minecraft are pretty much brainless. They fly at a random direction and change it every so often. So as long as I don't use a custom written AI pets will not be able to do both on purpose and with a goal in mind.