I want to make api 5.x plugins need help

Hi… i want to make plugins api 5.x but in intellij i type this in dependencies
compile ‘org.spongepowered:spongeapi:5.0.0’
but there is no library for sponge after refresh…
i know there is no docs for 5.x yet but pls help me and others…

5.0.0 is not officially released yet. You will need to replace 5.0.0 with 5.0.0-SNAPSHOT, which will provide development builds for 5.0.0.

Thank you :slight_smile: i was trying 5.0.0-BETA :smile:

1 Like

no docs

https://jd.spongepowered.org/5.0.0-SNAPSHOT/

i just started to make plugins and by docs i mean something like this:
https://docs.spongepowered.org/master/en/contributing/index.html
i cant understand that page in the link…

That’s for if you’re contributing to Sponge. Plugin development is here. And the basic concepts stay the same, the specific differences are outlined in the JavaDocs.

@DemonWav released an awesome plugin for minecraft development under intelliJ, you might give it a try :

You can chose API 4 or 5 and it is really convenient as you can quickly write your first lines.

thx i started to learn last night (i didnt sleep :sweat_smile:)
i have learnt how to add a command and teleport player etc. (basics)
what i need is and example of how to open a doublechest gui and make ppl click the items to use commands or change the page…
there are some bukkit plugin examples but they seemed really complicated to me :cry:

Well, the Bukkit inventory API is completely different from the Sponge inventory API. Additionally, it’s not implemented yet for chests, so it wouldn’t work.

I don’t think you’ll be able to accomplish this yet, with the Inventory API being unfinished.

Yeah :cry:
Even with API java is really hard to understand for me…
I like coding with VBA or VB but java has too much detail…
I really want to make plugins but i need a professional to show me how to do…

actually i might try my chance on mod making…

Why its too hard…
This code is from payday plugin and its only giving money!!!
"BigDecimal pay = new BigDecimal(Double.parseDouble(optionSubject.getOption(“pay”).get()));
player.sendMessage(Text.of(TextColors.GOLD, "[PayDay]: “, TextColors.GRAY, “It’s PayDay! Here is your salary of " + pay + " dollars! Enjoy!”));
UniqueAccount uniqueAccount = economyService.getOrCreateAccount(player.getUniqueId()).get();
uniqueAccount.deposit(economyService.getDefaultCurrency(), pay, Cause.of(NamedCause.owner(this)));”

There should be a command like this
Player.Eco.Account.deposit(“Playername”, 100);

im reading it like:
get…get…get…get…get…

First of all, learn Java first, then the Sponge API. If you learn Sponge at the same time as Java, you won’t get anywhere. Much of what you are complaining about is standard Java practices. And yes, Java is too formal, but it can be a good thing. Other languages like Scala or Kotlin are much less formal, while still running on the JVM.

Second, all that is for a reason. BigDecimal is used instead of double because BigDecimal has theoretically infinite capacity, whereas double has a maximum. A service is used instead of a simple method because otherwise, plugins couldn’t reimplement the API (and Sponge is all about ‘no special cases’). A Currency is used so that the economy can support multiple currencies. Specific accounts are used because maybe you want a VirtualAccount which isn’t tied to anything, or maybe the economy plugin supports UniqueAccounts for UUIDs that don’t correspond to players. Causes are used so the reason that things happen can be tracked.

If you want to program like that, you could always check out the Kotlin programming language, where gets and sets are treated like variables. For instance: Sponge.serviceManager.provideUnchecked(EconomyService.class)

1 Like

actually i found the problem… :disappointed_relieved: i just didnt work on C languages for a while but after deffining some public void main etc i remembered and actually last night i made my first plugin :smile: yeeey but im awake for maybe 40 hours :sleeping:
This is the thread for my plugin

PS: i know that im a beginner… im watching some tutorials on youtube… im trying to improve my knowledge slowly…

Tip: Don’t watch tutorials on YouTube. They’re nearly always outdated. The SpongeDocs is a great way to learn the API, and if that fails, ask on IRC.

3 Likes