How does Sponge Work?

Hello Everyone:

I am interested in scripting in Minecraft and I want to know if
I can do the following in Sponge?

a) create objects
b) create events when certain conditions are met
c) create text that can be displayed on the screen or chat session
d) save variable states in a sql or text file
e) setup a build where certain scenes are set up

Thank you all,
Tom

Sponge isn’t a scripting mod/plugin. You’ll need to know Java, Scala, or some other JVM-compatible language to function with our API.

create objects

Can you be more specific? If you mean a literal programming Object, then yes, Sponge doesn’t somehow limit your ability to do that. If you mean an in-game Object, the answer is technically yes, but it must be represented as an already existing Minecraft entity.

create events when certain conditions are met

Sponge has a wide array of events that you can listen for and, if you want, create more specific versions of.

create text that can be displayed on the screen or chat session

Yup!

save variable states in a sql or text file

I’m not certain that Sponge has a built-in SQL API, but you can certainly use any of the widely available Java/SQL bridges to do this.

setup a build where certain scenes are set up

I’m not certain what you mean by “scene”.

1 Like

Can verify Sponge does have SQL support via the SqlService, that supports MySQL, SQLite and H2

2 Likes

I don’t know if I’m interpreting e) correctly, but if you’re asking whether you can delete and create structures, then yes. In fact, with Sponge’s Schematic API, this is easier than ever.

Hello Everyone:

   So just to be clear in java I can create a script that would

run when a character dies. I can query the interface to determine
how many skeletons there are (plus their health) and run code when
they die. I can access and modify the items list. I can pre-mod certain
structures and place them in the world. I assume after I set up the server
this is done by creating a (java) plugin? I assume if I setup a server with
spongepower I use it with a Minecraft Realm?

Thank you very much for your help,

                    Tom

I hate to be pedantic here, but there’s a big difference between programming and scripting.

A few things wrong with that:

  • SpongeVanilla or SpongeForge, not “SpongePower”.
  • With SpongeForge, you’d actually be using Forge and SpongeForge would be a core mod.
  • Minecraft Realms is a Minecraft-hosted server that doesn’t give you access to the actual files (meaning you can’t mod it).

Minecraft Realms can’t be modded. Additionally, you can’t edit the items list. Sponge can only change processing; it can’t change content. You’d need a Forge mod for that. The rest of what you said is correct.