NMS With SpongeVanilla

Basically what the title says. I was very inexperienced with NMS when I used it with Bukkit and now that I need it, I am clueless on how I can begin to use it in my project. I know what I can do with it, I just don’t know how to implement/depend on it inside my project.

Just out of curiosity, what do you need it for?

I’ve always been just a Sponge Vanilla guy and I am trying to see what is possible and I’ve moved on to NMS and want to try the popular things such as disguise, interchangeable versions, NPCs, etc…

You don’t need NMS for NPCs. You can create and spawn new Humans.

Thanks for that but as I said that wasn’t my only purpose.

@intronate67, as much as we’re more than willing to support you in figuring out how to set up a plugin development environment with internals, as one of the primary developers of the project, I’d like to ask whether it’s possible to do what you need to do with the API, and if not, explain exactly what’s required for the API to provide you with as working with internals is something that we’ve developed the API to avoid being a necessity.

As such however, we do understand that there are certain cases where messing with internals is required. To get access to internals, and some of the underlying implementation details with Sponge, a plugin setup with GitHub - MinecraftPortCentral/GriefPrevention: GriefDefender has replaced GP. See github link for latest information. as a reference is a decent place to start. Note that you must be very careful to only use internal methods that are available from vanilla Minecraft, and not anything added by Forge.

Thanks for clarifying, I only was looking for to see what is possible with Sponge so I can further my knowledge and become more connected to the project, I will be experimenting for the next few days and get back to you on what is possible and not. I am doing this for the people who are coming from Bukkit can find out how to do what they’re doing in Bukkit, in Sponge and mainly in Sponge Vanilla.

Right, I understand. It’s just that what used to absolutely require internal NMS is no longer a requirement with Sponge (such as spawning NPC’s, since that’s supported directly through the API, including adding custom AI to those NPC’s). And throughout the last year and a half, we’ve drastically improved what the API required to do some various interactions that required NMS beforehand, now supporting various things that are native to SpongeAPI alone (such as custom persisting data).

2 Likes

And I am ecstatic that you guys have done such because messing with NMS in Bukkit, while not the worst thing ever, I tried avoiding at all costs. I am mainly focused on handling client/server interactions with different versions such as when the server is version 1.11 but a client is on 1.10. Mainly ones that don’t support each other such as when you load your server list and it has the red server version.

This is going to be hard to accomplish, essentially impossible with the new additions made. It is much easier to allow clients of future versions to join, which you can find with ViaVersion. You won’t be able to back port most additions, so might as well use a 1.10.2 server and allow 1.11 clients to join if you need them playing together. This is my understanding of it at least.

1 Like

Ummm why didn’t I know about ViaVersion being updated to work with Sponge :joy: I didn’t realized it was updated, thanks for showing me. And, yeah, having 1.11 clients join a server with a lower version would be easier but I wasn’t worried about clients getting items and additions in newer versions since clients would be a restricted environment with low permissions anyways so newer additions wouldn’t be a worry.

2 Likes

Also remember, NMS won’t be any different than NMS with Sponge or Bukkit. NMS is Minecraft’s server-side code. Although Sponge is much more accomdating with it’s API as mentioned above by gabizou.

It also doesn’t remap packages and has the latest version of MCP.

1 Like