#help-development
1 messages Ā· Page 1105 of 1
Typically you develop on the lowest version you wish to support
If you wanna support 1.16+ develop on 1.16
so forwards compatibility is easy
backwards not so much
or how should i understand that
hey! ive been learning kotlin for plugin development, but im not really sure how to start making one in the language. i want to make a basic plugin that i can use to build other plugins out of, but i dont really know where to begin with making one! any help would be appreciated :D
https://www.spigotmc.org/wiki/how-to-use-kotlin-in-your-plugins/ found this on the wiki
all other guides on the wiki should still work, api is the same
thank you :D
youd just have to rewrite the actual code snippets
but that should be simple enough
how should i apply upwards knockback
positive Y velocity
how do i register a command that is like in my main class
getCommand("levelup").setExecutor(this); i have this but it doesnt work
why are you doing reference equality on entities
Testing for weird parity issues
(we have like 2 different custom entity systems at work and they're tripping up)
In specific, I spawn an entity -> convert it to a "component entity" (tracks with entity ids) and apply a model (converts back to the real entity) and that's throwing errors
Solution is to load the chunk. Fairly dumb imo
hi guys
i really need help
how do i fix this
how do i send images
but anyome
click here to see it
e
bruh
?verify
?noimage
?image
?image
Just split jars for each platform š
TurboPlaceholder<?> placeholderSyntax = syntaxParser.parse(parsedPlaceholder, TurboPlaceholder.class);
Object result = placeholderSyntax == null ? "<" + placeholder + ">" : placeholderSyntax.get(parsedElement);
if (string && placeholderSyntax != null && result != null)
return placeholderSyntax.toString(result);
is there a way to cast it? because i know for a fact that result is an instance of TurboPlaceholder's generic
String toString(T object)
T get(ParsedElement element)
these are the methods
use intelliJ'
let ma man use vscode š
Skript ahh text editor š
guys, which is better? using minecraft development kit or doing it manually with gradle and using artifacts
?img
Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.
Here's some screenshot utilities that you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org
use the plugin
dont use artifacts in any case
build using gradle or maven
some people say to do it manually
some say use the plugin
which one is better if you are going to create a full fledge plugin to sell
like not use the plugin
MDC really should not be used by beginners. Its for more advanced users to skip mundane tasks.
Use the plugin lol
Whats the point of setting it up manually?
to learn
ig
but who likes learning anyways
the plugin also has to create a not too optimal build.gradle.kts as it supports like everything
yeah, lets get a room, fill it with monkeys at keyboards.
if you are just going to compile against spigot 1.21.1, you can create a much neater build.gradle.kts than the plugin can
yay i can send pictures now! :)
I just create the project using the plugin and then edit it to what I need
but I guess that requires you to know what you need
or that xD yea. But I mean, a plain build.gradle.kts for spigot is like, 6 lines after gradle --init -dsl kotlin
hey guys. does anyone know good tutorials that explain how serialization to a yaml file works? I understand but it's just confusing how come there is a map of Strings and Objects - how does an object get stored to config as a readable value?
(spigot configurationserializable)
like i dont get how itemmeta saves in the serialize method of ItemStack
ItemMeta is a snapshot of an item stack
all it does when serializing is taking all of its fields, and putting them in a Map where the keys are the field names and the values are well, the values of these fields
some encoding might be done in the process to obtain a a more compact serialiazed form and whatnot, but that's the gist of it
?stash if you want to see the source
how do you clone GameMode
oh interesting. i just dont understand how like its just "result.put("meta", meta);" to serialize it when it has so many variables. sorry im a bit dumb XD
to store previous gamemode of player
previousGameMode() doesn't seem to work
wouldn't that store a reference
a reference to an immutable enum constant yes
Bro has no idea what an enum is
so ig when the gamemode changes, it wont be reflected to that variable right?
It would not no
calling getGameMode would simply return a different value
but the referenced enum instance itself is immutable
ok thanks
that's because it delegates the serialization to the implementation of the ItemMeta (CraftMetaItem)
this is the serialize method for default ItemMeta impl
though since meta has various subclasses, each sub-class has its own serialize method where they put their own data into the map builder and pass it along to the parent
why not link the original source
that's generally how serialization of complex object graphs is done, albeit the one bukkit uses is pretty barebones to say the least
making an account and accepting the CLA just to show a piece of code is eh
you don't need to sign the CLA to view the code 
You don't need an account either kek
I might be remembering things wrong but wasn't it the case that you couldn't see the craftbukkit source unless you created an account and agreed to something first?
that is for PRs
dang so complicated
ah, makes sense
If that was the case buildtools wouldn't work
it looks daunting but all it is doing is serializing each field the ItemMeta to a format the YAML specification supports
there are fancier serialization frameworks out there such as the one GSON uses which scale much better for this kind of complex object graph
@NotNull
@Utility
public Map<String, Object> serialize() {
Map<String, Object> result = new LinkedHashMap<String, Object>();
result.put("v", Bukkit.getUnsafe().getDataVersion()); // Include version to indicate we are using modern material names (or LEGACY prefix)
result.put("type", getType().name());
if (getAmount() != 1) {
result.put("amount", getAmount());
}
ItemMeta meta = getItemMeta();
if (!Bukkit.getItemFactory().equals(meta, null)) {
result.put("meta", meta);
}
return result;
}```
wait so where here does it delegate to the implementation of itemmeta?
by putting in the meta
and the meta will serialize itself
similar to the itemstack
somewhere along the call chain, that Map will be iterated in order to create the yaml structure, and when setting the value corresponding the meta key, it'll call serialize on the Object (or rather, the ConfigurationSerializable)
oh interesting!
sorry lol i appreciate your help. i always like to understand as much as i can about what im doing haha
\
it's fine, we're all here to help
š„ yeah i understand like basic OOP and inheritance and stuff but all this nitty-gritty is pretty confusing for me haha
i wonder how painful it would be to serialize to a sql database š¤£
pretty easy actually
I mean, you don't really have to think of all of this when serializing stuff, often times you can just let the serialization framework do most of the work for you
question to those who know is there any sense to create class loading in runtime api plugins together with the build system or is it of no use?
and since things like items are actually serializable in multiple ways (you can serialize them as binary data by calling ItemStack#serializeAsBytes for example), all you have to do is pass that along in your query as a VARBINARY or a Blob
package me.lolnypop.myplugin.commands;
import me.lolnypop.myplugin.myplugin;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.plugin.Plugin;
public class SetFeedCommand implements CommandExecutor {
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
Plugin plugin = myplugin.getPlugin();
if (args[0].equals("true")) {
plugin.getConfig().set("feed-player", true);
} else if (args[0].equals("false")) {
plugin.getConfig().set("feed-player", false);
} else if (args.length > 1) {
sender.sendMessage(ChatColor.translateAlternateColorCodes('&', "&c" + "Invalid syntax!"));
return true;
} else sender.sendMessage(ChatColor.translateAlternateColorCodes('&', "&c" + "Please select between true or false"));
return true;
}
}
[15:00:21 ERROR]: Error occurred while enabling myplugin v1.0.0 (Is it up to date?)
java.lang.NullPointerException: Cannot invoke "org.bukkit.command.PluginCommand.setExecutor(org.bukkit.command.CommandExecutor)" because the return value of "me.lolnypop.myplugin.myplugin.getCommand(String)" is null
at MinecraftPractice-1.0.0.jar/me.lolnypop.myplugin.myplugin.onEnable(myplugin.java:41) ~[MinecraftPractice-1.0.0.jar:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:288) ~[paper-api-1.21-R0.1-SNAPSHOT.jar:?]
at io.papermc.paper.plugin.manager.PaperPluginInstanceManager.enablePlugin(PaperPluginInstanceManager.java:202) ~[paper-1.21.jar:1.21-130-b1b5d4c]
at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.enablePlugin(PaperPluginManagerImpl.java:109) ~[paper-1.21.jar:1.21-130-b1b5d4c]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:520) ~[paper-api-1.21-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.CraftServer.enablePlugin(CraftServer.java:640) ~[paper-1.21.jar:1.21-130-b1b5d4c]
at org.bukkit.craftbukkit.CraftServer.enablePlugins(CraftServer.java:589) ~[paper-1.21.jar:1.21-130-b1b5d4c]
at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:754) ~[paper-1.21.jar:1.21-130-b1b5d4c]
at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:516) ~[paper-1.21.jar:1.21-130-b1b5d4c]
at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:329) ~[paper-1.21.jar:1.21-130-b1b5d4c]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1215) ~[paper-1.21.jar:1.21-130-b1b5d4c]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:330) ~[paper-1.21.jar:1.21-130-b1b5d4c]
at java.base/java.lang.Thread.run(Thread.java:1570) ~[?:?]```
u hm
a h m
is there anything wrong with my code that spigot dislikes?
did you define the command in your plugin.yml?
no command in plugin.yml
then that's your issue
owh
... my bad
how do you guys read this goobledy gock
this stacktrace
you just have to read the first line
its easy once you understand it.
the rest is just the call stack
which line gave you guys that something was wrong with the plugin.yml
it says me.lolnypop.myplugin.myplugin.getCommand(String)" is null
getCommand is a method from JavaPlugin
a stack trace is just a list of all calls currently on the call stack (in order). There is always an error and usually an explanation.
spigot was unable to get the getCommand() since plugin.yml was not initialized
when you read stacktraces, usually reading the lines that involve your code (the classes and packages) will give away what went wrong
usually, you'll see the exceptions the method throws listed in the method documentation too
correct?
yes, basically
I think plugin.yml was initialized for you still?
sometimes, due to there being too much abstraction going on, the cause might be buried deep into the call stack, but often times it's enough to check the first few lines of the stack trace to know
im slowly learning to understand these stuff :)
its just the command declaration in plugin.yml is missing
i didnt register the command in the plugin.yml at first, now i did lets see if it works
oh interesting, how would you deserialize?
its a common error here so easily recognised.
Your plugin would still run fine if you didnāt call getCommand(ā¦).setExecutor(ā¦) even if the command is missing in plugin.yml
deserializeFromBytes or something
Spigot already has a way to dynamically load libraries at runtime, see the libraries section described here: https://www.spigotmc.org/wiki/plugin-yml/#wikiPage
so long as you caught the error and didn;t allow it to propogate through the onEnable the plugin would still run
just calling ItemStack#deserializeBytes(byte[] data) (though now that I look at it, this is Paper-only API, woops)
i was about to say i cant find it hahaha
What do you think if we make some api plugin and add a system of its loading in runtime and update api maintaining old versions of the plugin (package names, methods, etc.) and change only the logic, then it turns out it will not be necessary to update the version of api in the build system at the first loading of classes?
Hey there, why wont there be a auto fill suggestion? (true/false)
package me.lolnypop.myplugin.commands;
import me.lolnypop.myplugin.myplugin;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.plugin.Plugin;
public class SetFeedCommand implements CommandExecutor {
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
Plugin plugin = myplugin.getPlugin();
if (args[0].equals("true")) {
plugin.getConfig().set("feed-player", true);
} else if (args[0].equals("false")) {
plugin.getConfig().set("feed-player", false);
} else if (args.length > 1) {
sender.sendMessage(ChatColor.translateAlternateColorCodes('&', "&c" + "Invalid syntax!"));
return true;
} else sender.sendMessage(ChatColor.translateAlternateColorCodes('&', "&c" + "Please select between true or false"));
return true;
}
}```
My code
You mean like an extension system?
do you have a tabcompleter
is that a spigot interface?
Well, if you can call it that, yeah.
dont u also have to register it
yes
Like are we talking placeholder api expansion/luckperms extension stuff?
I mean papi is a bad example since their classloaders are leaking iirc
yes addons etc
ok, the tabexecute implements both commandexecutor and tab executor?
yes
good to know that ;)
runtime class loading for auto update
iirc its just an interface that literally just extends commandexecutor and tab complete
no change maven version
I mean thatās fine, its completely doable and valid to implement such a feature
i was thinking, if there isnt any tab completion how would people know its a true or false answer haha
tab completion is so cool
As a result, the person just adds the necessary classes to the project via maven, but the logic of these classes is changed in runtime.
You describe it a bit odd for being an addon system
I've recently heard about command frameworks, could you quickly explain what they actually do or if they help or not
Itās code people wrote to make writing commands easier
maybe but it wasn't my idea
my friend create this system and now we think how use it
That includes parsing arguments, structuring literals and argument and deal with tab completion automatically and thread execution coordination
there's a whole lot of cruft when it comes to commands, these frameworks help with that
There are a lot of command frameworks that utterly suck so its far from pure good
yo @sly topaz do you know any good serialization tuts for bukkit / spigot or whatever that i can watch? its hard to know what info is reliable
woah niceeee
The spigot wiki has some info about it relly, not sure how āupdatedā it is
i think i found one from 2016
main ones are dealing with cross-platform and cross-version abstractions as well as integrating with brigadier to support client-side suggestions, among a bunch of other stuff
The fun thing is that we make an api plugin with addons system and then we only realized at the end of the work that addons are not needed because the api user interacts with the code and in any case the classes will have to be loaded through the build system and the only benefit I saw in this is the ability to automatically change the logic of classes in runtime.
if you want to utilize commands to their fullest, it's better to go with a command framework like cloud or CommandAPI
or just brigadier
you donāt have to use a third party framework for the sake of it
Spigot doesn't have support for it yet
you can invoke on nms
yeah but that's just messy
a little bit
just use the framework at that point
there is a problem with playerkits every time I try to move the kit to another slot it appears 2 times in the position I inserted and in the previous position how do I solve this Bug?
Eh, depends I mean its like some extra casting and one or two extra method calls
Only argument against brig is that it doesnt support annotations
yeah, for one version, then when updating it'll cause issues or when you want to support more versions and what not, it is just not a good choice if you consider the future scaling of your project
Which seems to be a huge deal breaker to most
Ahhhh, even though there are more than 1 arguments, the game still sets the value to true! Idk why I made sure in the code that if args.length > 1 then it should say Invalid Syntax and return true;
there is a problem with playerkits every time I try to move the kit to another slot it appears 2 times in the position I inserted and in the previous position how do I solve this Bug??????
its stayed quite consistent for the time being, if it changes in the future I reckon you just update accordingly and it would imply support for the future
But sure, spigot does prioritize ver compat
so its maybe not aligned with their core values
only recently has the version been removed from nms packages, if you want to support older versions then you have to do the whole thing with reflections or creating interfaces which have an impl per version, it is just messy
thats cause you dont check any other value so they're just completely ignored
Even better is paper w its little abstraction on top
then when you want to move to another platform, you have to do all your ccommands again
there is a problem with playerkits every time I try to move the kit to another slot it appears 2 times in the position I inserted and in the previous position how do I solve this Bug?
} else if (args.length > 1) {
sender.sendMessage(ChatColor.translateAlternateColorCodes('&', "&c" + "Invalid syntax!"));
return true;
}```
This is the part of the code
but why should it say invalid syntax?
in paper it is fine since they got support for it, but if it comes to touching internals, I can't recommend it to beginners in good conscience
I mean most people here donāt account to write platform agnostic in the first place
there is a problem with playerkits every time I try to move the kit to another slot it appears 2 times in the position I inserted and in the previous position how do I solve this Bug?
I want it that, if the player provides more than 1 arguments, no matter what it is, it should provide a "Invalid Syntax"
Even if somebody writes /setfeed true oaijeoaij, There are two arguments here and i want to say Invalid Syntax here
I mean, it does already no?
but instead the game sets it to true
there is a problem with playerkits every time I try to move the kit to another slot it appears 2 times in the position I inserted and in the previous position how do I solve this Bug?
there is a problem with playerkits every time I try to move the kit to another slot it appears 2 times in the position I inserted and in the previous position how do I solve this Bug?
but the second one is just ignored
so it doesnt matter
you have to return false if the command failed
its only a restriction to the player
owhhhh
but still, that part of the code shouldn't be executed, make sure your if statement is in the right place
why are you spamming your message
but returning false prompts the sender with an ugly message, a lot of devs just return true regardless and send messages to the sender themselves
i mean i just wanted if the player says two arguments "/setfeed true aoijoiaej" or even gibberish "/setfeed oiajeo oijse", as long as there are two arguments, i want it to send an invalid sytax message and cancel the code yk
ok ill try it with return false;
Because don't you answer
the channel is run by volunteers, people will answer when they want to answer
you check in your command if there are too many arguments
being obnoxious about it doesn't help
Hey there, i know its a bit frustrating but please don't spam. Sometimes i have to wait to get a proper reply too :)
Do u have any code to showcase?
idk if i should say this, but i think people would appreciate if you would share the code, and shared the stacktrace before asking for help repeatedly
?nocode
Itās hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.
there is no error code I get the kit in the slot where the moved is in the previous slot and I cannot send test videos
but you have written code to do this behavior right?
are you a developer or a server owner?
Hey there i changed it to return false, still doesn't behave like the way I want it to. I also mentioned that
plugin.getConfig().set("feed-player", true)
}```
I mentioned only the at arguments index 0, if its "true" then set it to true, but how do I make it that if there are multiple arguments even if the "true" is at index 0, it should cancel everything and provide invalid syntax :)
check the command on amount of arguments
if its more than you expected, return the error
if (args[0].equals("true")) {
plugin.getConfig().set("feed-player", true);
} else if (args[0].equals("false")) {
plugin.getConfig().set("feed-player", false);
} else if (args.length > 1) {
sender.sendMessage(ChatColor.translateAlternateColorCodes('&', "&c" + "Invalid syntax!"));
return true;
} else sender.sendMessage(ChatColor.translateAlternateColorCodes('&', "&c" + "Please select between true or false"));```
here is my if statements
#help-server seems like the better place since I'm 90% sure you're using an existing plugin
well you would have to return before you change the config
like perform all your checks that prevent it from working first, and then do stuff with whats left
in this case
args[0] has nothing to do with the overall size
so if you check that first, it will skip the size check
Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.13.0:compile (default-compile) on project: Fatal error compiling: java.lang.NoSuchFieldError: Class com.sun.tools.javac.tree.JCTree$JCImport does not have member field 'com.sun.tools.javac.tree.JCTree qualid' -> [Help 1]
@pseudo hazel thanks, idk why it didnt came into my mind earlier but will this work? im now checking for the argument length
if (args[0].equals("true")) {
if (args.length > 1) return false;
{
plugin.getConfig().set("feed-player", true);
sender.sendMessage(ChatColor.GREEN + "Set the value to true");
}```
yeah
2 things, check args.length before invoking args[n]
donāt forget to save the changes to the config
(thereās a plugin.saveConfig() method)
if this command only supports 1 argument I would check it even before seeing if args[0] is true
yippee lemme try it and see, idk sometimes these simple java stuff dont come into my mind and i go asking dumb questions
like if args.length != 1, you done messed up
okie
How to add a separate module to the repository in a common project. I have several plugins
maven?
i mean add to repository for use in build system
how i remember exists site where the project is added to the repository via a github link but there are several plugins in the github repository
hey there im very sorry to bother you, but my brain is not braining right now. If you feel like doing it could you show me how i could do that?
if (args.length != 1) {
// your failed
return true;
}
// everything else
sometimes false returns the command you executed idk why
i see
return false if you want it to show an error/usage for the command. return true if you want a clean exit
or return true if you already show your own error
yup
anyoen know?
what?
your plugin class implements commandexecutor?
default JavaPlugin is already a CommandExecutor. IF the command is in your plugin.yml it will fire via JavaPlugin
so long as you add an override onCommand
oh nice I didnt know
Whenever i set (args.length != 1) return true;, all the else if statements turn red
yes because your syntax is broke
whats broken :(
what best module system?
doing the same check three times means only the first ever runs
looks like a basic java syntax error
first version using build system
if () return whater; is already the whole statement and result, you cant use {} after that
oh i see
Assuming we are talking about maven/gradle multi-module builds, I personally prefer the first approach, but either one would be decent.
Although the second approach might be more difficult to represent as a maven project, if not straight-up impossible
For me such structure working well project.api (interfaces) <- project
.core (impl) <- project.spigot
Player p = (Player) sender;
PlayerLevelManager playerLevelManager = this.levelManagerHashMap.get(p.getUniqueId());
int level = playerLevelManager.getLevel();
Double moneyneeded = getConfig().getDouble("levels." + level + ".moneyreq");
if (playerLevelManager.getXp() >= getConfig().getInt("levels." + level + ".xpneeded")) {
if (econ.getBalance(p) >= moneyneeded) {
econ.withdrawPlayer(p, moneyneeded);
p.sendMessage("§d§l(!) §dYou just leveled up from §d§nLevel " + playerLevelManager.getLevel() + " §d to §d§nLevel " + (playerLevelManager.getLevel() + 1));
playerLevelManager.setLevel(playerLevelManager.getLevel() + 1);
playerLevelManager.setXp(0);
setscore(p, playerLevelManager.getLevel(), playerLevelManager.getXp());
} else {
p.sendMessage("§c§l(!) §cYou don't have enough §c§lMoney§c to §c§lLevel Up");
p.sendMessage("§c§l* §7Level up Cost: §7§n$" + moneyneeded);
p.sendMessage("§c§l* §7Your Balance: §7§n$" + econ.getBalance(p));
}
}
}```
anyone know why this isnt doing anything the command runs but doesnt do anything all i did was add the ```playerLevelManager.setXp(0);```
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
Plugin plugin = myplugin.getPlugin();
if (args.length == 0 || args.length < 0) {
sender.sendMessage(ChatColor.translateAlternateColorCodes('&', "&c" + "Incomplete Syntax: Choose true or false"));
return true;
}
if (args.length > 1) {
sender.sendMessage(ChatColor.translateAlternateColorCodes('&', "&c" + "Invalid Syntax: Choose true or false"));
return true;
}
if (args[0].equals("true")) {
plugin.getConfig().set("feed-player", true);
sender.sendMessage(ChatColor.GREEN + "Set the value to true");
plugin.saveConfig();
} else if (args[0].equals("false")) {
plugin.getConfig().set("feed-player", false);
sender.sendMessage(ChatColor.GREEN + "Set the value to false");
plugin.saveConfig();
} else {
sender.sendMessage(ChatColor.translateAlternateColorCodes('&', "&c" + "Please select either true or false"));
return true;
}
return true;
}```
YIPPEEEE!!, Thanks Steaf and all the others for helping me! This code functions just the way I want it to :)
now realize ChatColor.translateAlternateColorCodes can be a utility function
using translatealternatecolorcodes on your hardcoded strings is beyond criminal
i didnt even notice before
just use the chatcolor constants
like you are doing for green funnily enough
use a string processor š¤
nah write the string in a databse and then use an enum to get the hardcoded value anyways, but now from a database instead
use mm :/
no
anyone know
why even bother doing ChatColor translate in hardcoded messages if you can simply use §
cuz i dont have that thing on my keyboard ;-;
what keyboard lang you got
UK/EU don't have that character on a key
I got German layout and shift + 3 is it
tbf idk
reminds me of one of those memes
a Dvorak and QWERTZ key layout has it on Shift + 3
Hey does anyone know how to install the latest build of ProtocolLib so I can use their APIs?
All they provide is a jar file but there's no instruction on how to use this API in my code and load it into my spigot server
use maven or gradle i suppose
oh German, Nordic and Swedish. I don;t see it on any other key layout
I tried adding it as a local maven dependency but I just got "plugin not found"
scroll the readme
that's outdated for my version 1.20.6
and just gives the same error
there is no repository after 5.1.0 sadly
although https://repo.dmulloy2.net/repository/public/ is down im wondering if it's literally just a server issue
they got 5.2 in their releases on the github
yeah that's what i mean here
you can't just change that version to your pom.xml afaik
like if you enter <version>5.2.0</version> is errors out
they only provide a jar file
but im unsure how you would link that to your project
because i tried it locally and it gave the same error weirdly
5.1 also throws an error so prob server issues
ah alr, ill wait out and hope that's the case š¤
thanks
a lot of people when searching the issue just said to update it from 5.1.0
but weird they don't have a server for that
ĀÆ_(ć)_/ĀÆ
what is the best way to create package location in a module project?
- {group_id}.{global project name}.{project name}.
- {group_id}.{project name}
Most people don't live in Northern Europe/Germany
Hey, I'm trying to make this system that serializes inventory as itemstack array in form of bytes to save it in database however there seems to be an EOFException happening and i have no idea what causes it.
My code: https://paste.md-5.net/otaxaronav.cs
no need to write bools
What line?
you are writing a bool only when its null, but on read you always read a bool
ah yeah I didn;t see that
i dont get the decodeItem() , just call is.readObj
dunno why youre creating a new input stream on the existing byte array
ahhhh the wiki on serialization doesnt cover sql yet
:(((
anyone know any good tuts on serializing itemstackz to sql
theyre having an outage at the moment
write them to a BukkitObjectOutputStream and optionally convert the byte array to base64
im wondering if that conversion would use more bytes or less
interesting
sick! any good tuts on that on the interwebs u know of?
paste site above ur head
does anyone know?
just write the size of the inventory and all items to the stream
dont bother using booleans
ill have cases where i need to load a singular item
hmm?
so it's not possible?
no I think you cant force them only when they click on chat links / TextCompontents
is storing vaults in yaml a dumb idea? like would that be excessively laggy?
what is a vault?
its just an inventory of items
How to properly colorize note particles?
but each player might have like 10
prob least laggy if yaml then would be base64 encode the inv
like base64 is least laggy?
Guys, not about this conversation, but is there a plugin + mod combo that allows sending client side code from the server to the client that the mod then runs to avoid latency?
its just making it to a string witch stores all of the data and then you can decode it using spiot natives
but how do i write a null item
if i dont save the null ones inventory slots are messed up
dataOut.writeObj(null)
and inv must be a multiplir of 9
I think therse a way bc therse a way to block eg LabyMod features using a plugin
but no clue how
Yeah but that just sends a couple of packets, not full code with a vm on client
But what im asking about is not like something widely known in the plugin community, right?
Are you talking about arbitary code execution with code sent from the server to the client ?
Noone in their right mind would ever create that without ill intent or just plain stupidity.
yeah just saw your reply to the issue haha
are there any good tutorials anywhere on this? this sounds like what i want to do
i just told you what to do
oh i thought you were talking to the other guy
xD
doesnt writing null just write nothing
always worked for me, ig it just writes some placeholder
how would this avoid latency?
If you send over code that does for example a cool particle animation, that code could run on the client for multiple seconds and no lag because particles arent send over to the client
In this episode, I show you how to use serialize Bukkit/Spigot objects like ItemStacks and then encode into Base64. #Spigot #Minecraft
Code: https://gitlab.com/kody-simpson/spigot/serialization-and-encoding
Discord: https://rebrand.ly/discordlink
Support: https://www.youtube.com/channel/UC_LtbK9pzAEI-4yVprLOcyA/join
More Videos coming soon. ...
client still has to render said particles which can be achieved via a packet the same way
š„
now that we know that a packet can achieve the same result, the question is back at, where did it avoid latency?
sending packets takes 50 - 100ms based on serverlocation, but running the code on client could render the particles next tick
you still have to send the code via network
but you send that once
at server join
okay i fixed the issue now
I am guessing you have shitty internet and this is why it is an issue for you?
no im just thinking about if you could make a gamemode with this on a server https://www.youtube.com/watch?v=r70xJytj0sw
yall know how big an SQLITE blob is?
LOL how big
and if you can offload work to the client, less packets send + less processing server side = more fancy things you can do on servers
with a mod sure, but not sure why RCE is needed for this o.O
servers are not hurting via networking related stuff by any means
It could be done without RCE, just send "animation files" instead of code.
But I know of no mod that does this
So you only need one mod for all servers, and every server can add their own functionality
this is what I was going to say
seems you have no understanding in how servers work
My guess is that this will become possible once we get custom entities with custom models.
But that can take anywhere from next monday snapshot to few years.
(in vanilla)
wdym
so you want to use RCE which is notorious for being a security risk however there is ways to use such things in a safe manner that wouldn't compromise someones system. But RCE so far isn't needed to achieve what you are wanting.
but thats with nulls included
your excuse for wanting the mod, is because "reduce network load" Which is not even an issue unless you just have a shitty system and internet and shitty hosting provider
then I could see networking being an issue for you
RCE is not insecure if you do it with a vm, limited api and a certificate system so only checked code is allowed
stfu
I am not about to take security advice from a random on discord
no its about latency
This much complexity is not needed even if you have this "security"
yes shitty internet
the things shown would not be very smooth even with good internet
and your proof of that is?
thanks for linking me to that vid @peak depot š«”
and what do you if a server is in location like japan
asked the guys who made the second demo
most of your latency isssue is with rendering and not networking
also have to take into consideration that the vanilla client isn't super well made either
Also, with such a mod you can hotswap textures, you can technically implement some shader api for servers, you could do a lot
you can do all that without RCE
resource packs āØ
there is a place for RCE but so far what you are wanting it for isn't a reason to use such things and would only compromise people's systems if anything else
why would it be unsafe if its based on a certificate system
"certificate system" 
not sure what you are talking about certificate system?
nah for that you gotta need artis skills to much for a dev
no the dev the reviews this client pack and then adds a certificate the client checks for when receiving this code
"the mod"
the dev
the client adds a certificate to a mod the client is going to run?
what dev??
so....how does the client know its good?
let bro dream
so the mod dev needs to review every consumer of their mod API
every single version release
Seems okay to me
sounds easy
evil is a necessity sometimes you know
for big servers, maybe, but even if you do it without certificates, theres safe way to make java scriptable and whats even stopping me from using lua, which is op for scripting
You are trying to solve a problem which doesn't exist
maybe they will make another javascript š
yeah true
but i have ideas sometimes
facts, scriptable java is just javascript
but you dont need to use java, just run lua an client
Well I know java,I just need to learn the script part
this entire conversation has gone completely over my head
cant blame you
"just use lua"
tf is wrong with that then
we already have mods and plugins that allow you to use other languages if you want, however doing so adds latency which is what you were trying to reduce or remove, as the language now needs to be interpreted in order to interact with java
the thing is the api is not going to be big, as big apis are bad for security
oh no lynx your api is a security risk now
rather powerful apis
yea damn, spigot-api is ded
True, like APIs that allow sending lua code to run on clients
ā
lua goes fast af bro
paper shill detected
you are programming for hypixel or why are you so hard concerned about security
what does speed have to do with security
š
people should always be concerned with security
guy before was concerned, but bitcoin mining on clients could otherwise happen
to be fair, security does at times get in the way of speed. It is a known thing that if you want to be fast as possible you also have to do away with security
Well yea, but that is a general vibe, not specific to lua
but you know gaining that extra 1kb/s isn't necessarily worth it either
what?
not the point, but if i cant imaging running something like this https://cdn.discordapp.com/attachments/1041278575145402448/1041278575380267008/mcvideo.mp4?ex=66c068be&is=66bf173e&hm=0eaa0bcfc90f811c03784aa159ce99620391c35e7f93ba43a49d4f57d8ba8808&
would be smooth for the client, or good for servers to process
I mean, the video of the spider you sent earlier is literally a spigot plugin 
maybe bad internet too
shhhh
nope valence local server
rust goes brrrr
I was wanting to see how long it would have gone on for before they noticed that XD
???
In this video, I show you how to create a spider with a procedural galloping animation.
Previous Video:
https://www.youtube.com/watch?v=Hc9x1e85L0w
Source Code:
https://github.com/TheCymaera/minecraft-spider
World Download:
https://www.planetminecraft.com/project/spider-garden/
All my links:
https://heledron.com/links/
Inspired by:
Coding A...
literally a spigot plugin
thats spigot yeah
but thats also locally
i dont think that would be nearly as cool on a server
ok, lets take a minute to process that
so....the server is running on the pc and the client is also running on the pc, two things that are notorious in needing resources
and they even recorded it at the same time in HD
thats not resource intensive, but its bad with latency
this is before any packets flying around the internet
packets are quicker then you think
how fast
over 9000!
as long as you have 100ms in average latency to the server you wouldn't notice any lag
Quick question, can you simulate latency on local server
yes
tc 
@hot walrus Try joining Wynncraft.
They got shitload of custom mobs with animations like this.
It does not lag in the latency meaning.
(Any lag you would see is most likely a server dying due to new update and many players)
Oh true
fair point
š¤¦āāļø
I love they accepted your input without hesitating guess I should have just gave some random network name next time
To be fair, wynncraft guess was quite lucky
not sure what that has to do with anything or why you believe I am interested in some random network
Ig what im asking for is a on server join modloader, with an api for the server
is this a mod?
no that is a spigot plugin
i refuse to believe this is a plugin, it has super cool custom models
Does he use a resourcepack?
probably
might just be block displays with a transformation?
or that
so no resource pack?
200ms more than enough for minecraft, I play every day with that latency just fine
whats equivalent to <scope>provided</scope> in gradle?
compileOnly
compileOnly
compileOnly
thansk I thought so
ElgarL, just so you know, it is compileOnly
are you sure š
100%, been there, done that
Hey, I want to use this small library uploaded on https://jitpack.io.
But the problem is if it were to get deleted I would have no idea how to recreate it. Does it make sense for me to just copy the classes into my project or is it impossible for a library to get deleted?
is bukkit yaw between 0 and 360?
I thought it can be any number, just looping
it is 0 to 360, but the sun is odd
Don't quote me but if I remoeber it was messed up when they changed the sun direction
š¤”
sun rises in the north? thats something new
it used to
only read the "so notch changed it" when i hit enter
Notch changed it and now its 90 degrees
it won't get deleted unless the git repo gets deleted
you can just make a fork and use the coordinates of your fork if you're concerned about that
someone have shop gui
Thank you š¤
wheres a good place to start a dev team
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
if I need to store an int in an item's persistent data container to keep track of its ammo or whatever, but I am already storing an int for its custom item ID, should I just use doubles instead?
another int?
you can use different NamespacedKey
you can only store one data type per NamespacedKey
no problem!
any way i could get the mob type based on the SPAWN_EGG material or the opposite?
Illegal char <"> at index 0: "
what the hell does this mean?
Illegal char <"> at index 0: "C:\Users\domino\IdeaProjects\VoxelTeamsZ\target\VoxelTeamsZ-1.0.jar"
There is literally no illegal char
and that is not the path I'm using either
is intellij actually fucked?
Sometimes you have a certain .jar file that you need as dependency, but the author of that .jar was too lazy to properly upload it to a public repository. Thatās bad, but not a problem. There are two ways to solve this, but only one proper way. The proper way: install the dependency The proper...
Yes
That answers about 0% of what I asked
im doing the bad way, sure
it is still a way, there's no reason for why It's screaming at the air
Ok, now it's doing this even after I removed the dependency
I love Intellij.
it loves its broken caches
Have to reinstall OS then š
Is it possible to choose the order of the tab completion, like i wanna show true first then false? But in game it shows false first
do i use array? and add the array to the arraylist

im legit using the paid version
You can't. Client will display alphabetically
although for free since im a student
but if i paid $100 for this
I'd kms
um what?
it costs $600?
LOL
THIS SHIT COSTS 600???
per year
in the first year
Hey it gets cheaper in later years!
which is still ridiculous
Which is kinda weird
if you were a student, you can insta skip the first two years iirc
you can super charge it for an additional $200
Normally itās the opposite
what
basically
Well for domains at least
oh xD
you buy the more expensive ones then you cant ever leave because if you come back it means you have to pay it again
I mean most subscriptions reward staying with them for long
They offer you like 99Ā¢ the first year and then $20 after
Yea because domains you cannot really afford to loose xD
I can compile with maven
but intellij
cries about literally nothing
wth dude
this is taking too long
LOOOL
THE COMMUNITY EDITION WORKS
THATS RIDICULOUS BRO
i see, so not possible. Only way to do that would be intercept packets and change them or make a mod changing the game code lul
I even have a method for that somewhere in my Util class
StringUtil.copyPartialMatches
How to prevent LivingEntity from colliding with a player? The LivingEntity.setCollidable(false) doesn't work for me.
You need to use teams
imagine if we had mixins...
team.setOption(Team.Option.COLLISION_RULE, Team.OptionStatus.NEVER);
Yeah did that
Can't mixin the client from the server
ah it's a client thing?
Show your code
Yes
That entity isn't colliding with the player
It's the other way around now
And is controlled by client as all player movement is
public void setNoCollision(Player player) {
Scoreboard scoreboard = player.getScoreboard();
String teamName = "noCollide_" + player.getName();
Team team = scoreboard.getTeam(teamName);
if (team == null) {
team = scoreboard.registerNewTeam(teamName);
team.setOption(Team.Option.COLLISION_RULE, Team.OptionStatus.NEVER);
}
team.addEntry(player.getName());
}
You're never adding the other entity to the team
I uh
would need some help with images
I'm trying to render an image bigger than 128x128
on 4 maps
and uh
and I'm not sure what I'm doing wrong
https://paste.md-5.net/elavisowuy.java tis the code
You checked if the buffered image split works correctly right
When you get the sub images
Also donāt name your class Main
how else would you want to name a main class?
I replaced Location::add with Location::subtract
and somehow everything works now
I have no idea why
Read my guide
but I'm just gonna leave it at that
?main
I didn't pick up the name from anything
One big origin comes from those many horrible Spigot plugin tutorials on Youtube, where they do not explain anything and force new people to copy and paste code
I learned java from one guy
and got the naming from him
that is so stupid
Give me a second
what
is this nonsense
I swear some people are just real life twitter
just spread misinformation instead of cancelling people
it is, just for this particular framework
why would somebody think that?
how are we spigot gang
good
ain't nobody gonna be using my class
I have another main class that's of a different name
I use Main in the spigot boostrap because the name is short and perfect for debugging
while if I tried to type this, then damn, would many Bukkit- classes be suggested
I'm explaining my reasoning
and why I think that this doesn't bear much sense
And I donāt care because many people do and I donāt wanna argue abt it the thousandth time
if I have a Vector that I want to apply to a player's launched projectile's direction (I want it to add a horizontal and vertical "recoil" to the projectile), how would I do that?
like we ain't arguing about including underscores in class names
this stuff straight up illegal
depends
Ok šš»
I love you brother
does anyone know good a good tutorial on use of .class in java?
š¤
im trying to expand my tiny brian
usually listen to ProjectileLaunchEvent and just Entity::setVelocity
uh
.class is a compiled .java file
I think
truer but like you know in code how sometimes there are references to class objects like ItemStack.class
or whatevers
that references the Class<T> object
so Class<ItemStack> clazz = ItemStack.class
dang interesting
the T?
ye!
right but how do I add a vector to the projectile's velocity? and how do I make it relative to the direction the player is facing, not the X, Y, and Z axis
generic type
do I use vector multiply or vector add or something else?
Entity::getVelocity
Vector::add
Entity::setVelocity
np š
yeah that just
messed up the QR code
it's now invalid
xD
damn
wait no
it was background noise that made it invalid
Hello, a friend of mine made this Plugin called "Commandbinder". There youcan bind Commands on a certain item. It's still pretty buggy and there are placeholders that should work but don't. The one I'd need is "%lookingAt%. It displays the coordinates of a block, that the player's looking at, that's not air, but it doesn't work. I have almost no idea how to code, sadly, so I'm asking you, to maybe tell me what the problem is.
if (cmd.contains("%lookingAt%") && this.p.getEyeLocation().getBlock().getType() != Material.AIR) {
Location loc = this.p.getTargetBlock((Set)null, 128).getLocation();
cmd = cmd.replace("%lookingAt%", loc.getX() + " " + loc.getY() + " " + loc.getZ());
}
Why would you check if the block on the players eye location is not air
Unless they are suffocating in a wall it should always be air (or a liquid)
Yes, but I need it to detect for example if you want to break a tree, you're looking at a log, I need exactly that, that it would display the coordinates of the log
Then remove the air check and just use the getTargetBlock
Wouldn't it be just air then?
Ah okay thanks
what is the feature?
Itās like objective number format or something
I donāt think the api pr for it ever got merged
so it isn't possible with spigot?
Not without NMS
how can it be done with NMS?
I cant find anything online. everything just says it isnt possible
I think paper also has it xD
is paper a different API?
like if Ive been coding a spigot plugin would switching to paper be a pain in the ass
or is it the same code?
it's a fork of spigot, meaning it has the same APIs and more
but if you use paper api in your plugin, it will not work on a spigot server
will I have to change anything in my code when I switch over?
if I plan on completely switching to paper?
there are a few methods which have been changed, but nothing significant
generally the only methods which are API-incompatible are ones where Paper had a method named smth, and spigot later added a method that did smth else with a conflicting signature
there are lots of deprecations Paper adds for broken/outdated/legacy functionality that suggests alternatives to use
but the deprecated methods usually function the same as before
even if your server runs paper, its better to use spigot api, unless there is a very specific method you need that only paper has.
Whats the best way to write a file
Depends on what you are writing. what do you plan to save/read?
So im making a audio client plugin that when you do /createregion <wgname> <audioname>
That it would in the yaml file fill out underneath the Regions:
It will read and write it
Regions:
Epcot:
main.mp3
such audio info, is that just a string you need saved?
Yea so they would do that command then it would write in a config file called regionlist and then a listener would read that config file for all the regions to see if a player is in a region then play the audio through a websocket
Well then to save it like that you can do it with yaml, the line to write that is dataConfig.set("Regions." + region, name);
public String getName(String region) {
return dataConfig.getString("Regions." + region);
}
```then grab it like this i believe
Is that just the reading part it seems?
which parts do you need? do you know how to have a custom config?
Yea I have that made already
ok ill write a little bigger example of just the set and get one sec
public void saveDataConfig() {
try {
dataConfig.save(dataConfigFile);
} catch (IOException e) { }
}
public void setRegionInfo(String region, String filename) {
dataConfig.set("Regions." + region + ".filename", filename);
saveDataConfig();
}
public String getRegionInfo(String region) {
return dataConfig.getString("Regions." + region + ".filename");
}
Right. String something = MainClass...getRegionInfo(region); then something like this would be used elsewhere you have the region name to request with
if (!event.getAddress().getHostAddress().equals(event.getRealAddress().getHostAddress())){} would something like this work in playerlogin event
what are you checking for?
to see if its a vpn
lol yeah no that's not how that works
found a forums post
Spigot spoofs the IP address when running under bungeecord mode; getAddress() should return the spoofed address (e.g. the clients IP address) if one has been set, while getRealAddress() in those instances should return the IP of the bungeecord instance
as far as blocking VPNs I thnk the best way to do that is dig up some way to find which IPs are associated with a specific service
you might need to pay for that
no ik, im just asking to see if they was an easier way
not really
cuz i saw that while looking through playerlogineventr
the client wouldn't know your real IP anyways if you were under a VPN
it would only know the VPN IP
^
hey
Hey @river oracle, Should i have stuff like setHome() in Playerdata or should i be doing all of this in playerDataManager?
and in playerData i should make methods like java public void setConfigurationSection(String name) { this.getFileHandler().getConfig().createSection(name); }
instead of calling the fileHandler
idk if this is completely "ideal" but usually I'll have a setup like
public interface StorageHandle {
// usually I abstract this for different databases and such but you really don't have to
}
public class PlayerData {
public void save(StorageHandle handle)
public static void load(UUID uuid, StorageHandle handle)
}
Currently im doing it like this, and i dont feel like its the correct way. yK?
public void setPlayerRank(String rank) {
this.playerRank = rank;
getFileHandler().getConfig().set("Settings.Rank", rank);
}
public void setHome(String name, Location location) {
getFileHandler().getConfig().set(String.format("Homes.%s", name), location);
}```
I mean its not horrible, but at the same time its not great
Personally I think this structure is only fine because you're using configs
if this were a database or any other file type I'd say this structure would be unacceptable
however, because Configs are 100% in memory doing stuff like this really isn't an issue
thinking of making a website & plugin where, for example, clicking a button on the website runs a command in the game. what would be the best approach towards this? websockets with something like jetty?
don't even need WebSockets if you're on the same server you could just use regular Sockets
really any communication protocol will work as long as youre comfortable with it
Okay i see, so doing it the way im doing it is called structure.
what no?
oh alright, i'm not very used to using sockets
But would it be better if i just did something like
public void set(String path, String value) {
fileHandler().getConfig.set(path, value);
}```
instead of making multiple things to set?
I mean an abstraction like that is one way to go about things but if you're saving using 1 method I'd honestly go for the methods I stated above
I doubt everyone would agree with such design, but to me its most clean and keeps saving and loading logic in one place
you could even dump the StorageHandler and just use whatever FileHandler you're using
there is no reason to make abstractions at that level unless you're planning to support like 5 different databases
Yeah, i dont plan on that unless needed but YML files arent that big. it would be if there was 1k+ players but databases sound out of my reach atm lol.
honestly for you my reccomendation
Detach the FileHandler object from the player and instead use it in save and load methods. That way each PlayerData object is blissfully unaware of its FileHandler, but when the server stops or the player leaves you can get then and run the according save method
that way if you ever add a database like SQLite it'll be much less time to add it in than if you were to do that now
NP I was a newbie myself not to long ago
I just dont wanna base everything off it again and it all be wrong like the first plugin xD
I still have one of my first plugins
https://github.com/Y2Kwastaken/SimpleHoes
wait so what would be the recommended way to do this if i wasnt hosting the website on the server.
probably Websockets
but you need to be careful
make sure there is proper auth in place
public static void cSend(CommandSender sender, String string) {
sender.sendMessage(clr(string));
}```
is this just a newbie thing to do?
xD
Everything reminds me of her
meh I dislike such a pattern
but its personal opinion
eh, sometimes a quick utility function is nice
Ik, its in your SimpleHoes xD you said ew
My opinion have changed a lot in 3 years I guess
ohh, so would having them on the same server be better due to privacy reasons?
A programmer is constantly changing the way they do stuff, a once wise one once told me š
not if you make good authentication
i doubt i will
I mean there are libraries and also payed services
to ensure your auth is great
wrong reply
Well honestly if you don't look at the code you wrote even a few weeks ago and think man I could improve this you've started to plateau
I do it after a day xD
if you look at the code you wrote 1 year ago and don't go what the fuck is this mess you are trash šŖ š„ šÆ
i could make you throw up if you want xD
I have a compiled jar of my oldest project ever still
it can't be much worse than that
something like jetty?
Idk take a gander
xD
makes sense
I started coding in 2020 I rage quit for nearly a year and a half with java
I'd code for a few weeks and go I fucking hate this why do I keep doing this
then come back after a few months
never learned properly though, i had someone that knew a lot and he thought me the basics and then somebody that was in uni but he would just spoon feed certain problems. I made this plugin for his server.
Coding is addicting š¤·āāļø
I had a mentor too
he did not abandon me š and was good
the one person I follow on github kekw
I'm better than him in java, but he's got my beat in pretty much every other department
Lol these stories are nice to hear coming from somebody experienced. He never really abandoned me he kinda just got bored with java/minecraft and started learning py and other things lol
Hello, im sorr but why event doesn't ececute when i eat food
@EventHandler
public void onEat(PlayerItemConsumeEvent e) {
Player p = e.getPlayer();
Material food = p.getInventory().getItemInMainHand().getType();
p.sendMessage("§8(§c!§8)§7Tavoevent");
i cant get debug message
not sure if its right event anymore
Wasnt that auto hot key or something?
its not doing anything?
make sure you're registering it in your main class
it just didn't compile somehow lmao, sorrry
is there any event that listens for lighting levels when spawning hostile mobs?
You might be able to listen to entity spawn even and check the light level of the block where it's being spawned
Is there a way to fade out a sound with a plugin (or mod)?
You could play it with an emitter entity and move it around
Is your listener registered
or make a custom sound with a resource pack that fades natively
how can i make that?
yell hard at your mic, then fade to a softer voice, convert the audio file to ogg then put it into a valid resource pack format and call it using the normal play sound methods (or even commands, minecraft is even nice enough to autosuggest custom sound files from your resource pack)
oh, but what i'm trying to make is ambient music, like, play a sound (obviously a song) and when needed, fade it out
Q: Is it better to generate a new yaml file for each player uuid to save their data in. or is it better to make one data file and store each player in that one file with their data? yaml config
the concern is if one file would lag searching for the tree of data, but would it actually?
It's better to have one yaml file each player, but if the data is small then it doesn't matter for me at least.
maybe so. so in one file there would for example be 10k player uuid list and under each stores a few ints
but, the other method would be to have 10k yaml files that were generated and each stores those ints
this is to store crate key amounts
Personally I would just go for one file, just don't save/load the file everytime there are some changes.
Just save and load on server stop and server start.
if you dont save it, how would you read the updated int
You create like a hashmap to store the user data, basically like caching it.
You do the update there and only save on server stop
If you want to make the map size smaller, consider saving and loading on player quit and player join
but they can earn keys from gameplay
Yes, create User object that stores the keys data for each player
possibly
just seems concerning for if the player client crashes or server crashes that it may not save
You can create an auto-save system every 5 minutes or so.

