New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Human entities or NPCs (such as GlowNPC on Glowstone or human on Sponge) #13

Open
satoshinm opened this Issue Apr 13, 2017 · 6 comments

Comments

Projects
None yet
2 participants
@satoshinm
Owner

satoshinm commented Apr 13, 2017

From Glowstone chat, investigate this plugin which shows how to create non-player characters, since world.spawn cannot be used to spawn Player or HumanEntity directly (error: https://gist.github.com/satoshinm/ebc87cdf1d782ba91b893fe24cd8ffd2):

https://github.com/DenAbr/GlowNPC

Momo - Today at 4:16 AM
For NPC's, you can refer to this plugin: https://github.com/DenAbr/GlowNPC. We have a custom entity registry for such cases, but you will have to use Glowstone as your dependency (not Glowkit/Spigot/Bukkit API)

...

Momo - Today at 6:00 AM
Thats what GlowNPC does iirc
But its much simpler to do with Glowstone
Than with NMS

but this may cause incompatibilities with other Bukkit implementations, since it isn't Bukkit API? So maybe not worth it.

satoshinm added a commit that referenced this issue Apr 14, 2017

Update comments regarding Glowstone
GlowstoneMC/Glowstone@47b0e0b
Change SHOW_NAME_TAG getter to boolean
fixed:
https://gist.github.com/satoshinm/8a7cb999c09bb42048e70647875f53c8

and HumanEntity cannot be spawned naturally, the way to do it is:
#13
@mastercoms

This comment has been minimized.

mastercoms commented Apr 15, 2017

You can use reflection. Or, we can add player spawn functionality to world.spawn to automatically fake players.

@satoshinm

This comment has been minimized.

Owner

satoshinm commented Apr 15, 2017

Glowstone allowing spawning fake players (or at least HumanEntity) with world.spawn would be great 👍

@satoshinm

This comment has been minimized.

Owner

satoshinm commented Apr 15, 2017

I'm thinking now it may be preferable to have "true" fake players, that is, players which are real for most purposes of the server (show up in chat, have a player entity, etc. - to seamlessly integrate web players with other plugins, such as for chat as suggested in comment https://www.spigotmc.org/threads/websandboxmc.232807/#post-2359661), except without the TCP network connection.

It is an interesting consequence of the current design of WebSandboxMC. If I had instead interfaced web players through the MC protocol, then no player faking would be necessary because they would be real as can be. However, by interfacing through the Bukkit API instead, connection/player management has to be handled explicitly. The major upside of Bukkit is it seems to be the most popular and well-supported API of its kind, working on all different versions of different server implementations. not true if built on the protocol instead; WebSandboxMC wouldn't be able to get to its current functional state on top of raw protocol packets without significant engineering effort, and wouldn't be as compatible. Yet, there may be further limitations this plugin hits up against as it progresses further. For example: sound #22 - there is a World#playSound API, but no event I could find to receive sound (Bukkit plugin listening for when a sound effect is played, not possible currently? unlike listening to sound effect packets).

@satoshinm

This comment has been minimized.

Owner

satoshinm commented Apr 16, 2017

Found this, Sponge implemented spawning "human entities" in their API, maybe useful for how Bukkit/Glowkit API could do it: SpongePowered/SpongeAPI#502

@satoshinm satoshinm changed the title from GlowNPC for web players instead of sheep on Glowstone to Human entities or NPCs (such as GlowNPC on Glowstone or human on Sponge) Jun 5, 2017

@satoshinm

This comment has been minimized.

Owner

satoshinm commented Jun 5, 2017

Looks like Sponge has finished implementing human entities: https://forums.spongepowered.org/t/how-do-i-make-a-npc-human-entity-face-a-player/19186 - and it supports rotation, probably would be practical to implement in WebSandboxMC, but need #51 Sponge support.

@mastercoms

This comment has been minimized.

mastercoms commented Jun 5, 2017

https://www.spigotmc.org/threads/lib-npclib-create-fake-players-1-8-1-7-10-1-7-9.48010/

We will be adding something similar to this in a future Glowstone release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment