[Discontinued] ✏ Create a plugin in JavaScript [v2.0.2]

The plugin is amazing, but add more examples, please!
For example, how I can get all players? How to use “convertToJSObject” on Server class? I don’t understand :confused:

1 Like

I will try to find some time to update the doc.

So i need help in Reverting any block if a player breaks it.
I have the createEventListenerBlockBreak() from your example, and it tracks when a player breaks a block, but how would i then Revert it to the previous state, where a chest would keep all its items, and modded blocks would stay the same.

If the event is set as cancelled, i.e. event.setCancelled(true), then everything is reverted.

1 Like

Yes, you only have to cancel the event like @pie_flavor said.

djxy Can you open a Discord Server so that all your fans can communicate and ask questions? I think it would be really helpful and you or someone else could respond to people much faster. https://discordapp.com

I created one https://discord.gg/GqSwu52.

I am having hard time to find “on use of a stone button” event, someone may help ?

Is there a kind of list showing all events of Sponge ?

The JavaDocs should help. Look in packages that start with org.spongepowered.api.event.

1 Like

Thanks, I will try with event.interact and some others.

Well, sounds like a must have for me…

However, I have a question. Is there a way to get to the vanilla minecraft objects? (And coming back to the sponge ones from them?)

Thanks!

Not sure to understand what you want, but this project is no longer supported. I replaced it by https://github.com/djxy/MultiScripts and I will release it soon(very soon). With MultiScripts, you are going to be able to do more thing than SpongeJavaScript and you will be able to create a plugin in JavaScript, Lua and Python and share it easily with the community.

1 Like

Oooh, alright, then I will wait for it, thanks!

And what I was asking is that if you can access to minecraft elements like… for instance, from org.spongepowered.api.entity, being able to access net.minecraft.entity.Entity. (And basically the same for other objects)

Anyway, I look forward to see it out.

With the MultiScripts, you will be able to use any Java class loaded, So yes, it will be possible to access net.minecraft.entity.Entity.

Oh? Perfect then! Waiting for your plugin to be released! :smiley:

2 Likes

Can this plugin be used to make a wrapper for other plugins’ commands?
Reason why I ask is that PermissionManager plugin does not support the @a selector in its commands.
But using the @a selector with name argument and the tag argument set to !tag-here is the only way to set MinePass to run a command only once.
Issue on PermissionManager Github asking for support from them for the @a selector.

Yes probably, but you should wait that I release my new plugin MultiScripts. SpongeJavaScript is no longer supported because I merge it to MultiScripts.

how long until MultiScript is released?

I don’t know, I’m trying to release it before Christmas.

1 Like

My new plugin MultiScripts is now released. SpongeJavaScript is now discontinued.

1 Like