#development
1 messages · Page 132 of 1
I don't wanna spoonfeed you code
cause you're not learning
but it's literally just telling you to do something you've already done in that class
I'm trying to use MySQL in a maven project and I have this as mentioned by a thread I found:
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.28</version>
</dependency>
I put this in pom.xml but when I compile and run it in a server it throws java.lang.ClassNotFoundException: com.mysql.cj.jdbc.MysqlConnectionPoolDataSource upon enabling
nvm i fixed it
So I guess I need set up own code for it or use nms? For should be set someware in the Minecraft code :)
=paste
how the fuck
?
Code https://paste.helpch.at/uneyolepax.coffeescript
Error https://paste.helpch.at/weranoraxu.js
What the data looks like
Just not sure why im getting the above error, can provide more code if necessary
probably because the array is inside course-applications?
I tried making it like
data class CourseApplications(
@JsonProperty("course-applications") val courseApps:Array<JRCourseApp>
)``` and just got another error about not being able to map it correctly
Can you not access course-apllications and tell jackson it is an Array of JRCourseApp?
val data = makeRequest("url?party_id=$partyId", arrayOf<JRCourseApp>())```
```kotlin
private inline fun <reified T> makeRequest(url: String, t: T?): T? {
val headers = org.springframework.http.HttpHeaders()
headers.contentType = MediaType.APPLICATION_JSON
headers.accept = Collections.singletonList(MediaType.APPLICATION_JSON)
headers.setBasicAuth("a", ACCESS_KEY)
val entity = HttpEntity<T>(headers)
try{
val response = restTemplate.exchange("$BASE_URL/$url".trim(), HttpMethod.GET, entity, T::class.java)
return response.body
}catch(exc: HttpClientErrorException.NotFound) {
return null
}
}```
Is there something like JsonObject that you can turn the response body into, and then access the array?
wdym
why is this way not working tho it works for other json objects and itd be easier if i cankeep it as consistant as possible across the whole program
What gradle dependency/repo would I need to use to access the spigot packet: ClientboundInitializeBorderPacket
It doesn't seem to be in the org.spigotmc:spigot-api:1.17.1-R0.1-SNAPSHOT one.
yeah, because it's not part of the api
How would I access it via nms?
I've seen it used before
Oh. I found it! I needed maveLocal() + org.spigotmc:spigot:1.17.1-R0.1-SNAPSHOT
why would calling PlaceholderExpansion#register on a PlaceholderExpansion built-in to my plugin return false?
please ping me if you reply 🙂
normally means that canRegister has not been properly implemented
hard to tell without any code
getVersion() is @NotNull annotated
oh, thats weird, i wonder how that happened. it def used to have a version 😄
would that be why?
also if it is, why does it only fail for one person?
just realized i forgot to mention, it only fails for one person. it works fine for everyone else
most likely something is erroring out, in which case a stacktrace would be very helpful
or another plugin is cancelling the register event
i dont think there was a stacktrace, unless the user removed it for some reason
not really sure to suggest tbh other than making sure that papi is up to date
ok, thanks
Alright say I got two branches: dev and master
dev was where I would develop new features, while master is the latest stable version of my mod... now though I got the issue that I want the version of the mod in dev to completely replace what's in master, since now it will be the new stable version of the mod
How do I do that?
How could I implement durability to my grappling hook? https://github.com/lucian929/GrapplingHook/blob/master/src/main/java/net/maploop/GrapplingHook.java
Could I just get the current durability and then remove 1 from it each time its used?
create a pull request
checkout -m 🥺
Yeah you can cast the ItemMeta to Damageable (make sure to import the right one!) and get/set the damage
uh what I'm not sure about is how it counts the damage.. because there are places it means "durability" and the whole thing is backwards..
Damageable damageable = (Damageable) item.getItemMeta();
damageable.setDamage(damageable.getDamage() - 1);
item.setItemMeta(damageable);
Does that seem right? I imagine not because it didn't seem to change anything
Try increasing it instead I suppose lol, in that case damage would actually mean damage dealt to the item (how many times it was used)
does anyone know how to set the player's camera back to their own after sending a ClientboundSetCameraPacket without making them relog?
do I have to send another packet referring to the player?
The notchian client also loads certain shaders for given entities:
Creeper → shaders/post/creeper.json
Spider (and cave spider) → shaders/post/spider.json
Enderman → shaders/post/invert.json
Anything else → the current shader is unloaded
so im guessing u can just put random number
and it'll go back to normal
or
To return control to the player, send this packet with their entity ID.
yeah don't just throw random numbers in there 🥴
Also you can achieve all of that without using packets lmao
🥴
With springs @Scheduled annotation can i make it run at a certain time every day and not break if the program stops and then starts?
possibly? but you're better off using a cron job or something
cron job best job
Does someone know why I can't use matt's triumph gui libs?
I can't even access the repo https://repo.mattstudios.me/artifactory/public/
it's on central now
Oh, where can I get the updated groupId, artifactId, etc.
no idea lol should be updated in the documentation tho
but releases are published in maven central now
Is it this one? https://mf.mattstudios.me/triumph-gui/setup-1
It's not updated there
On the command and message framework, it doesn't show the repo anymore
¯\_(ツ)_/¯
What is the best way to create a command cooldown for pvp? Like if they havn't been hit for 5 sec they can use the command again
Store the timestamp of when the command was used, then when you try to use it again check if current timestamp - saved timestamp > 5 seconds
System.currentTimeMillies() or whatever? Or using a java Instant?
System#currentTimeMillis should be enough
hey, is there way to control refresh rate of placeholder? can't find any option PlaceholderExpansion class , I'm registering placeholder from my plugin. Some values are not updating too often, so it is too much waste to periodically update them.
Yeah it will work, but what's best?
idk, it's really not that different anyway
Instant has nice util methods that you can definitely take advantages of, but if it's just simple cooldown then milis should be more than enough
Papi doesnt do any refresh
Yeah that's your responsibility
^
lol
so.. when does onRequest happen exactly?
looked at expansion code, and read wiki but still not sure when is it actually called
nvm it's really dumb question
I got it
Will this disable the command?
@EventHandler
public void onCommand(PlayerCommandSendEvent e) {
Player player = e.getPlayer();
Collection<String> commands = e.getCommands();
if(!player.hasPermission("aurorapeaks.pvplog")) {
commands.removeIf(str -> str.equalsIgnoreCase("spawn") || str.equalsIgnoreCase("home") || str.contains("tpa"));
}
}
Or do I need to cancel the event
I'm not sure what I have done but now when trying to build my plugin i get all these build errors saying my classes are not found? Any way to fix this
https://i.imgur.com/KHodHPE.png
Hmm try doing invalidate cache and restart or maybe do a clean build
https://paste.helpch.at/ayosalisuh.cs
annyone can help me with this weird error?
im making a sign gui and it gives this error when i try to open an invertory
this is my sign gui: https://paste.helpch.at/rugahelele.java
and here i make the inv: https://paste.helpch.at/erakobexaq.cs
Invalidating caches and restarting sadly doesn't resolve the issue, also just doing a clean build not from artifacts throws the same thing
I remember I accidently built the project using maven which I do not normally do as I have my own API attached as a dependency in the project structure which I do not know how to add with maven
Well you have a maven project, you should be building with maven
How can I add my custom api to the plugin using maven in that case?
You would need to publish the artifact of the api (assuming it's something separate) to either maven local or some other repository like maven central or a personal one
And then add it as usual with the <dependencies> tag
Alright I managed to add the api from system into maven now however even tho I have the spigot api in my maven added it throws package net.minecraft.server.v1_16_R3 does not exist
That is not present in the api, that's NMS, if you want NMS you need to add spigot instead of spigot-api (after running buildtools)
I get this error when I start my server Tried to read NBT tag with too high complexity, depth > 512, is it the amount of chars in a tag that is too high? Or what does it mean?
Let me send my hikari code
HikariConfig hikariConfig = new HikariConfig();
hikariConfig.setJdbcUrl("jdbc:mysql://" + host + ":" + port + "/" + database+"?useSSL="+useSSL);
hikariConfig.setDriverClassName("com.mysql.jdbc.Driver");
hikariConfig.setUsername(username);
hikariConfig.setPassword(password);
hikariConfig.addDataSourceProperty("cachePrepStmts", "true");
hikariConfig.addDataSourceProperty("prepStmtCacheSize", "250");
hikariConfig.addDataSourceProperty("prepStmtCacheSqlLimit", "2048");
hikariConfig.setMinimumIdle(1);
hikariConfig.setAutoCommit(true);
hikariConfig.setMaximumPoolSize(maxPoolSize);
hikariDataSource = new HikariDataSource(hikariConfig);```
com.mysql.jdbc.Driver
this class is outdated
check for the new one
yep
but I use gradle
implementation 'com.zaxxer:HikariCP:4.0.2' (for java 8)
implementation 'com.zaxxer:HikariCP:5.0.1' (for java 9+)
with gradle or maven ?
I know nothing about maven sorry
you need to set the scope to compile I believe
no it's because this class is probably not included in hikaricp
depends on the server version
Someone knows why this happens when /wild is used? https://paste.helpch.at/kihehiraze.apache - did the main thread just get overused or whatever it's called?
show some code
load chunk
It's not my plugin
Does anyone know a good tutorial for holograms that are also saved?
uh is it normal for PlayerInteractEvent to fire twice with only one click???
to add to the above ^^ with empty hand it fires twice
It may fire once for each hand
is it because we have two hands now?
oh ye
thought so
ty
uhm, I might be just stupid, but like, does uuid change when I relog to the server?
Because I store the owner of a certain block in an object, and check if the player interacting is the owner, it works fine, but when I relog, it says I am not the owner?
implying that the uuid isn't that same?
For context on the above, tried debugging it, and it's exactly the same, doesn't make any sense
gen.getOwner() which returns the uuid of the owner isn't the same as my uuid?
tf?
(and yes, they both return the uuid object, not a string)
And the weird part is it only happens when I relog
I'm not super well versed in it so this comment could mean nothing, but is your server in offline mode?
nop
Then no idea.
what is the uuid each time
if the uuid doesn't match your actual player uuid then something is wonky
always the same, aka mine
they do match
that's the weird af part
hmm
uuid should be .equals()
if a enum has private String message, i can edit it without issues?
something like
ENUM1("this is a value")
and using
setValue(String message){
this.message = message;
}
would that change the value to the new one
right?
oh yeah that would do it you definitely can't just do ==
or its bad? xd
if(!gen.getOwner().equals(uuid))
some1? xd
totally fixed it, ty, I am dumb sometimes xD
Try and see it
You shouldn’t change the values of enums
what would be the best way to do something similar
as it needs to be attached to an enum
(switch or else if is what i try to avoid)
What are you trying to do?
few words
yeah this sounds like an x y problem
That shouldn’t be an enum
sounds like a map
Editable and enum do not go together
no reason to have enum as key
to be able to create an API
can i still buy delux chat
I would just make an enchantment class
hasEnchant(Enchant enchant)
no
it needs to be enum
damn why
but you can buy AlonsoChat
the creator has left the plugin scene, we're working on a free replacement called ChatChat right now
is that simular
Why?
oh nice
so people can use using the API
That doesn’t answer the question
hasEnchant(block, enum)
API's don't have to be enums
unless it's for backwards compatibility
but still
🤷
you think APIs are solely composed of enums?

🥲

where can it be bought
so, class with static
If you use enums you limit the amount of enchants you can add
that was a joke dm me
So other people can’t add enchants
wdym
I would not buy that lmao
what is the string
Look into VentureChat or Carbon if you need something complicated

I know you have it this is a goverment conspiracy
wouldn't it just be ```java
public enum Enchant {
LUCK_1,
LUCK_2
}
true, 2 servers are using it 
yeah, but i mean
lets say if i want LUCK_1 to be added in lore
keep in mind, EnumMap also does exist
with a replacement like Luck 1
you can map an enum to an object
huh?
then why not put config path
as the enum variable

i don't really know what you mean by "without else if statements"
They want to get an enchantment with having to use if else to check if it is the enchant they are talking about
So basically like you said
Using a map
or you can just have a variable for "Luck 1" and have code outside of the enum automatically convert it to like "Some Lore " + enum.getString() + " yes"
yes, an EnumMap would serve them well then
I think they should go with enchant classes though
basically
well you could have both
but that thing editable
enum for the list of types, class for the actual representation
it is Java, after all
everything is a class
But keep in mind with enums people can’t register custom enchants if they use the API
so an enchantment plugin for...?
What is it?
either ```java
public enum Enchant {
LUCK_1("Luck I"),
LUCK_2("Luck II");
private final String enchantString;
// constructor blah blah
}
String lore = ChatColor.RED + Enchant.LUCK_1.getEnchantString();
or java
public enum Enchant {
LUCK_1("luck.1"),
LUCK_2("luck.2");
private final String configPath;
// constructor blah blah
}
String lore = config.getString(Enchant.LUCK_1.getConfigPath());
imo these are what you should do
or
use bukkit `Enchantment` and create a `Map<Enchantment, String>`
hmmm
oh this is a plugin api
i think i'm going for the map thing
ye i think thats best
then you can do like setLore api method
plus you won't have to re-type all the enchants 

personally i had a Map<EnchantEnum,EnchantObject> and then used nbt and put them in a CompoundTag of <String,Integer> on the itemstack, checked for the enchant depending on where it was needed or just forwarded the event to the EnchantObject, i had stuff like onBlockBreak, entity damage events, etc and just did things based on that.
is there a substitue for deluxe chat since its gone down
what if i need soemthing not complicated
VentureChat with one channel is not very complicated
EssentialsChat if you don't need placeholders and want something beyond simple
want something that is really beyond simple? VCF
what if i dont speak spanish
Well I have news for you, VentureChat does not care about what language you speak
Nor is anything related to it in Spanish
is there a rough release date for this or is it unknown rn?
it's under development
We're not sure yet, still working on it. We might have a public beta in a few weeks
nice
when i do /pl
it dousnt appear
and it seems others have had the same error
might want to ask in #general-plugins chief, this channel is for programming support
thx cheif
What would be the best way to have an armor stand removed with PacketPlayOutDestroyEntity repear when needed for the client? Using spawn packets doesn't seem to do the trick
uh
well
the packet name says what it does
you would need to store the armorstand data and then send back a spawn packet with that info
Alright
PacketPlayOutSpawnEntity move = new PacketPlayOutSpawnEntity(((CraftEntity) removeStand).getHandle(), 30, 0);
((CraftPlayer) player).getHandle().playerConnection.sendPacket(move);```
Yeah this doesn't seem to do it
I'm honestly not sure what the third parameter does, but it looks like everything should work out
public PacketPlayOutSpawnEntity(Entity var1, int var2, int var3) {
this.a = var1.getId();
this.b = MathHelper.floor(var1.locX * 32.0D);
this.c = MathHelper.floor(var1.locY * 32.0D);
this.d = MathHelper.floor(var1.locZ * 32.0D);
this.h = MathHelper.d(var1.pitch * 256.0F / 360.0F);
this.i = MathHelper.d(var1.yaw * 256.0F / 360.0F);
this.j = var2;
this.k = var3;
if (var3 > 0) {
//random stuff
}
}```
No errors or anything, strange
pretty sure this is why protocollib was invented lmao
I might be wrong but isn't armorstand is using PacketPlayOutSpawnEntityLiving? assuming you're trying to spawn an armor stand
I saw a thread earlier that said that it that packet wasn’t for armor stands
I’ll give it another go though
ArmorStands are EntityLiving
would you like to explain how it doesn't work and what you're trying to do
It is to be a nicksystem. I don't know how to remove the player from the table list with Protocollib. This code above does not work, but there is no error message either
How should delayed commands be handled? Like a player uses /spawn and has to stand still for 5 seconds before they are teleported, if they move the command cancels. I suppose a map of UUID and time stamp, or what?
Map<UUID, Long>
use guava's CacheBuilder. ez
check CachedTime + 5000 < CurrentTime iirc
wouldn't using a cache builder be better? it would expire on its own as well. so ez
a Queue could be used too
// Check if player is vanished
// In the database. TableName: player_data, ColumnName: isVanished
Connection connection = sql.getConnection();
if(sql.isVanished(connection, player.getUniqueId().toString())){
// Player is vanished
// Set isVanished to false
sql.setVanished(connection, player.getUniqueId().toString(), false);
player.sendMessage(plugin.prefix() + "§aYou are now visible to other players.");
} else {
// Player is not vanished
// Set isVanished to true
sql.setVanished(connection, player.getUniqueId().toString(), true);
player.sendMessage(plugin.prefix() + "§aYou are now invisible to other players.");
}
Then these
public boolean isVanished(Connection connection, String toString) {
try {
if (this.getConnection() != null && !this.getConnection().isClosed()) {
String query = "SELECT * FROM player_data WHERE uuid = '" + toString + "'";
java.sql.Statement statement = this.getConnection().createStatement();
java.sql.ResultSet resultSet = statement.executeQuery(query);
if (resultSet.next()) {
return resultSet.getBoolean("isVanished");
}
}
} catch (SQLException ex) {
ex.printStackTrace();
}
return false;
}
public void setVanished(Connection connection, String toString, boolean b) {
try {
if (this.getConnection() != null && !this.getConnection().isClosed()) {
String query = "UPDATE player_data SET isVanished = '" + b + "' WHERE uuid = '" + toString + "'";
java.sql.Statement statement = this.getConnection().createStatement();
statement.executeUpdate(query);
}
} catch (SQLException ex) {
ex.printStackTrace();
}
}
But when issue the command it doesn’t update anything in the database… no errors -__-
debug
also i don't think this is very efficient
first of all, use PreparedStatements
omw to setVanished "; DROP TABLE player_data"
Alright thanks
Wouldn't this lag the main thread?
ofc
ideally you don't want to directly set the value into the database
you only need to save it into the database on plugin disable
or if the server crashes
ServerCrashEvent
if (StopReason == Crash) {
NO();
}```
while(isCrashing()) {
Dont()
}
the thread safe version!
?paste
Paste Services
When asking for help with a config/menu/code issue please use our paste bin:
(we prefer it over pastebin.com)
• HelpChat Paste - How To Use
new Timer().scheduleAtFixedRate(new TimerTask() {
@Override
public void run() {
customizeshopGUI();//refresh inv
if (main.inventory.getItem(12) == null)return; //looks if item != null
if(main.inventory.getItem(12).getType() == Material.AIR) { // checks if item is air (normal empty slot is set to air)
System.out.println("air");
return;
}else { //if not air it runs this
System.out.println("called!!");
customizeshopGUI();
player.openInventory(main.inventory);
}
}
},0, 50000);
i got this code in the event on inventory click but it doesnt print annything? i added commands to make it more clear and it should just work if you wanna see the whole file check this link: https://paste.helpch.at/coxuwaferu.cs
Hello , i have a question about something iam programming
so iam trying to make a killstreaks , for my plugin and i endded up with this idea ..
killstreaks:
3:
msg: '&eYou got 3 killstreaks'
prize:
coins: 3 //if coins == nul [nothing in it] then use item
item: diamond
6:
msg: '&eYou got 6 killstreaks'
prize:
coins: 6 //if coins == nul [nothing in it] then use item
item: diamond
but it give me an error here :
any ideas will be great and thanks
whats the error?
How do i make a while loop that doesnt crash my server?
as.setVelocity(vec);
}``` tried this
I’m pretty sure the issue is with Integer.valueOf
you use the bukkit scheduler to repeat a task on a set interval
Is it possible to also stop a repeating task?
yes
i tried cancel(); but i gues that doesn't work
it does work if used correctly
i can't find it on google 😭
can't find what
how to use it correctly
you might want to share some of your code given that I forgot my crystal ball this week
@Override
public void run() {
if(!as.isOnGround()) {
scheduler.cancelTask();
}
}}, 0L, 20L
);```
casting this to Plugin is kinda strange.. why are you doing that? what is "this" in that context? any errors on the console?
what is scheduler
BukkitScheduler scheduler = Bukkit.getServer().getScheduler();
forgot to add that to the code snippit
did you get that to compile..?
Try parseInt
And getting keys and then getting it as a string to get a section?
Yeah that’s not going to work
Your specific rank is getKeys().toString()
That might not be the method you actually want to use there
com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Client does not support authentication protocol requested by server; consider upgrading MySQL client
I've tried mysql servers 8.0 and 5.7 and neither seem to work. There isn't much help online either.
Is there a way to make items "unique"?
So that I can read out with a plugin whether a certain chest has been clicked on?
public void onEnable() {
if(Bukkit.getPluginManager().getPlugin("PlaceholderAPI") != null) {
new SomeExpansion(this).register();
}``` main class
placeholderapi class:
https://paste.md-5.net/remejateva.java
placeholders dont work
Clipboard clipboard = ClipboardFormat.SCHEMATIC.getReader(new FileInputStream(file)).read(worldData);
Im in 1.8 trying to paste a schematic but im getting this error here:
https://paste.helpch.at/tarokopohi.bash it points to the line above
idk about 1.8 but it sounds like the schem file is corrupted or invalid in some other way
strongly suggest you check out how the //schem load did it back then and also try to load that same schematic file in-game to ensure it's not corrupted, it's open source https://github.com/EngineHub/WorldEdit/tree/legacy/1.12.2
Alright thanks
What do you mean by "placeholders don't work"? how does it not work? any errors in console? what does it show when you try to use them? what happens? how are you trying to use them?
i put it in scoreboard-revision scoreboard and it spams [18:37:36 WARN]: org.apache.commons.lang.UnhandledException: Plugin Scoreboard-revision vR4 1.1 RELEASE generated an exception while executing task 25 at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:56) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748)
and the scoreboard just doesnt have anythng
is that the entire stack trace?
bruh wait
i only copied that and logs deleted for some reason
at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:56)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NullPointerException
at me.frandma.disabler.SomeExpansion.onRequest(SomeExpansion.java:39)
at me.clip.placeholderapi.replacer.CharsReplacer.apply(CharsReplacer.java:161)
at me.clip.placeholderapi.PlaceholderAPI.setPlaceholders(PlaceholderAPI.java:70)
at me.clip.placeholderapi.PlaceholderAPI.setPlaceholders(PlaceholderAPI.java:98)
at rien.bijl.Scoreboard.r.Plugin.Utility.ScoreboardStrings.placeholders(ScoreboardStrings.java:56)
at rien.bijl.Scoreboard.r.Board.ConfigBoard.run(ConfigBoard.java:86)
at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftTask.run(CraftTask.java:71)
at org.bu```
e
Playerdata is yamlconfiguration
Hola, I'm trying to use a precompiled gradle script as a convention plugin as is done in the docs at https://docs.gradle.org/current/samples/sample_convention_plugins.html but I cannot get it to work. I have default-module-config.gradle.kts in the right place at buildSrc/src/main/kotlin/ but when I go to use it in a submodule with ```kts
plugins {
id("default-module-config")
}
Uh could someone help me out here? Quite confused on why this is happening.
For context, this is looping through a list of generators and either dropping an item on top of them OR adding the items to a list if they have a so called "Locker" placed.
This gets executed every 25 seconds by a BR. The first time, it drops everything perfectly, but after it drops, unsure why, all the generators vanish (the objects that are stored in cache), probably from the cache, making it throw an error in the console.
Error: https://paste.helpch.at/ayokuwavob.bash
Method: https://paste.helpch.at/tacegonavi.cs
Explaining the above a bit better, I am unsure where or how it's happening since I don't modify the cache anywhere.
Rip
Can you send your project? Or at least the project structure with the build scripts and the settings
I'm having a problem on my laptop, whenever I boot up intellij with a maven project i get an error:
All of the libraries work fine on my PC but when I git pulled it broke.
Time to move to gradle? Jokes aside, have you tried invalidating cache?
are you able to update? 🥲
Its not even in my pom so im not sure how i could update it
Also invalidating cache did not work
They need to go on their own module with that set in the settings, here are some examples that work https://github.com/TriumphTeam/triumph-cmds/
On settings.gradle do:
dependencyResolutionManagement {
includeBuild("build-logic") // where the convention plugins will go
repositories.gradlePluginPortal()
}
Then they go into /build-logic/src/main/kotlin/, the build-logic gradle probably needs something like this
plugins {
`kotlin-dsl`
}
repositories {
gradlePluginPortal()
}
dependencies {
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.20-RC")
}
At least the applying of the kotlin-dsl is needed iirc
could it be that my wifi is just too slow?
nah
thank you
suspicious stew is not listed as normal recipe when use recipe iterator?
Event or a way to know when an item starts cooking in furnace (not in 1.18, i know there is an event for that in newer versions) i need it for 1.14+
someone?
Its too sus to that
well they don't have a recipe, you milk brown mooshrooms to get it, that's why they aren't in the recipe iterator
Hm, when read the wiki it exist a recipe for it (or is it some old info I get hold on).
also 
Does anyone know how to use Protocollib to change a player's skin and the name displayed above them?
With maven is there something extra I need to do for placeholders to work?
Ex; plugin.yml
name: '<Name>'
main: '<Main>'
author: '<Author>'
description: '<Description>'
version: ${project.version}
```version isn't being updated to whats in my pom.
Was that response directed towards me?
yes
What relevance does that have to my question?
dont want to offend
idk
lol
not sure about Maven, but for Gradle you have to tell it to replace the patterns, and it's just ${version}
dunno though, Maven kinda stinky
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<includes>
<include>plugin.yml</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
<filtering>false</filtering>
<excludes>
<exclude>plugin.yml</exclude>
</excludes>
</resource>
</resources>
but that in build block
e.g.
center of the block?
location.add(x > 0 ? 0.5 : -0.5, 0.0, z > 0 ? 0.5 : -0.5);
should work? xD
or it's always add(0.5,0,0.5)
Always add 0.5 on x and z
doesnt affect if its negative coords right?
good question, but try it and see xd

i don't know actually
block coordinates are always rounded down

confused how to use reified to get the type of a generic class from within. i have a method randomValue() for my generic class MyClass<T>. i'm trying to do it like
class MyClass<T>(value: ArrayList<T>?): ArrayList<T>() {
// ...
private inline fun <reified T> getType(): KClass<T> {
println(T::class)
return T::class
}
fun randomValue(): ArrayList<*> {
when (getType<ArrayList<T>()) {
getType<ArrayList<T>().equals(String::class) -> return arrayListOf("a")
getType<ArrayList<T>().equals(Int::class) -> return arrayListOf(1)
// ...
}
}
// ...
}
randomValue() is being called from Java
it just prints class java.util.ArrayList
I actually can't even get it to compile now, but the thought is there lol
well, inline means that the code is in the caller function, so type erasure isn't applied there, so reified works
or do u mean the type inside of a type
oh like the T inside of the ArrayList?
uh, is it possible to override this and make it serializable?
otherwise, what are my options?
what are you trying to do?
serialize an object, that contains a Location and other stuff
serialize to where
theres BukkitObjectOutputStream
Location is not serializable by default with GSON due to having a World field
yes but can that be used with the "normal" ones?
would making it a string be a good alternative?
Type erasure still applies, reified just inlines the class type
wdym
what is "normal"
if you're talking about gson, then you need to make a serializer/deserializer thingy
the default Serialization method
if you use gson for example, you can just create a serializer for Location, or World I guess
BukkitObjectOutputStream out = new BukkitObjectOutputStream(new GZIPOutputStream(new FileOutputStream(filePath)));
out.writeObject(this);
out.close();
```then there's also this
no it's not compatible with java serialization if you mean that
yes it is
you just need to use BukkitObjectOutputStream

then you can do the usual java.io.Serializable stuff
I mean exactly that
yes but Locations don't have that?
ohhh wait 🤦
Type erasure is always present, what reified does is replace it with the actual class
test<String>()
inline fun <reified T> test() {
println(T::class.java)
}
Just turns into
System.out.println(String.class)
The generic itself is still erased
oh ye but i meant that since the print is in the caller function the generic isn't being passed through
ex ```kt
fun main() {
test<String>()
}
inline fun <reified T> test() {
println(T::class.java)
}
turns into java
public static final void main(String[] args) {
System.out.println(String.class);
}
// $FF: synthetic method
public static final void test() {
Intrinsics.reifiedOperationMarker(4, "T");
System.out.println(Object.class);
}
Iirc synthetic method is always present because it still needs to be accessible through reflection, since the code is normally inlined there has to be a way to still get it
Same way as constants, they are inlined but the original variable is still present for reflection
other fun thing, is recipeIterator() only return one type (chest can you make of any plank, but it only return OAK_PLANKS 8 times in an array).
So I need add code to deal with this and on top of this is the custom recipe´s from other plugins (I understand now way you should use namespacedKey all the time when make own recipes in bukkit).
ohh
yes
you cant bypass type erasure no matter how much syntax sugar you use
the T still gets erased
and reified only knows if the compiler knows the concrete type
inline fun <reified R, reified T : ArrayList<R>> test() {
```this is the best i could do 🤷
test<String, ArrayList<String>>()
Im trying to paste a schematic with worldedit in 1.8 like so:
WorldEditPlugin worldEditPlugin = (WorldEditPlugin) Bukkit.getPluginManager().getPlugin("WorldEdit");
EditSession session = worldEditPlugin.getWorldEdit().getEditSessionFactory().getEditSession(new BukkitWorld(spawn.getWorld()), 100000);
try {
CuboidClipboard clipboard = MCEditSchematicFormat.getFormat(file).load(file);
clipboard.setOrigin(new Vector(spawn.getBlockX(),spawn.getBlockY(), spawn.getBlockZ()));
clipboard.paste(session, clipboard.getOrigin(), false);
} catch(MaxChangedBlocksException e) {
e.printStackTrace();
} catch (DataException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}```
But im getting this error, anyone know why? https://paste.helpch.at/qokojujigo.bash It points to the CuboidClipboard line
that means that getFormat returns null
show code for it
assuming thats not in the worldedit api
oh wait is it
oh wait it is
yeah thats in worldedit
hmm
what if you print out file.isFile()
since as long as it's a valid schematic it should work
file.isfile() prints true.
This is the same way i did it in a previous plugin in 1.8 but it doesnt work now for some reason
Could someone explain me this error? https://paste.helpch.at/ixidamonol.rb
I don't understand it
is it because it's null?
my guess is that you're modifying a collection while looping it
that just means theres no exception message
oh ye. fk
need to do a copy
ty
uh any ideas what might be causing this? It's supposed to stack them.
var copyItems = items;
if (copyItems.size() > 0) {
for (var lockerItem : copyItems) {
if (lockerItem.getMaterial().equals(item.getMaterial())) {
lockerItem.addAmount(amount);
} else {
copyItems.add(item);
locker.getData().setLockerItems(copyItems);
}
}
} else {
copyItems.add(item);
locker.getData().setLockerItems(copyItems);
}
I am probably doing the the checks wrong lmao
wait no it's of the same type? cringe
god I am stupid
ooh ok
btw var copyItems = items; won't copy the list
wait actually?
yes
you're just referencing the items list when u do stuff with the copyItems list
so basically, I am stupid
understood
var copyItems = new ArrayList<>(items);
this would right?
yes
ye I think it's an issue on how I am doing the system
shallow copy is var copyItems = items;.
deep copy is a new list copy from arraylist, or loop through each old list index and copy.
uh no it's not
that's just getting the reference, nothing is being copied other than the pointer to the list itself
this is a shallow copy, a deep copy would also replicate each individual element, so something like a copy constructor, recursive copying or implemented .clone
How can i store a larger object in redis?
Thank you. Just needed <filtering>true</filtering>
I had the variable right. Just needed filtering tag.
Ah, then that must just be the variable for Gradle
👍
@ashen sigil the list created by Arrays.asList is not resizable
you could do something like this instead new ArrayList<>(Arrays.asList(...))
yeah that's what the new ArrayList does ^
I mean if you're going for efficiency then you should first create the array list, and then use Collections.addAll
but bleh
https://paste.md-5.net/alolazomij.java Im making an invertory for a bank acount and im getting a strange thing where the title and the lore is the same. eventho on every item i set the meta again and i delete the lore (lorelist.clear()) so i dont understand why its doing this? could somebody help?
You're likely just repeatedly setting the same values
so how would i fix that?
I'm not sure what you think you're doing?
?
meta.setLore(loreList);
item.setItemMeta(meta);
meta.setLore(null);```
like this for instance
i make the lorelist null so the next item wont have lore
Oh I see, ok sec.
Doesn't look like you're resetting properly in areas.
Let me pop this in my IDE, minute
What's the output look like btw?
Uh so.. this is caused because bukkit can't find a material that corresponds to the given String but the thing is, it's dropping the items, which means, it did get?, so I am confused on why I am getting this issue https://paste.helpch.at/gegederami.bash
line 53: var drop = Material.valueOf(gensConfig.getString("gens." + tier + ".drop"));
Just tested it and all of them are working? so makes no sense lol
public class Typewriter {
static void pause(int millis) {
try {
Thread.sleep(millis);
} catch (Exception e) {
}
}
static void writer(String text) {
for (String s : text.split("")) {
System.err.print(s);
pause(60);
}
Typewriter.writer("test");
}
}
``` why can't I run this?
it doesn't show anything to run it
read the error
drop is empty
what the
Best way to make a material "cookable" without adding FurnaceRecipe?
Context: I want some furnaces be able to cook diamonds (without affecting other furnaces)
couldn't you just cancel that item from being cooked in any furnance that isnt the specific furnaces
yes, even is only available in 1.18+ (before it starts to cook)
in lower versions only smelt event is available (which would make it run the cook animation and then stop when you cancel the event)
how to make my main method call my other method presumably
you can do fileTree("libs") but yes that will work
InventoryClickEvent / hopper event etc
Does anyone know of a way to regenerate a chunk since World#regenerateChunk() is broken?
well it didn't work 
pretty sure the path is right
code?
build.gradle?
I don't have specific code, I can't even import anything
events, etc don't even show up in the ide
compileOnly fileTree(dir: './libs', includes: ['*.jar']) this is what I use
legit not working
Hit the 'Reload all Gradle Projects' button.
still not showing
this but not specifically plotsquared
hover over
ye it is here
but that doesn't explain why I can't access anything from it
wth
I might not even need plotsquared because when a plot gets deleted/cleared, it uses worldedit to do so right?
Cause currently, what I want to do is remove the generators from the database, if they get deleted by the plot being cleared/deleted. Any ideas on how I could do this?
Check if the block is air when the generators generate
but what if, I clear the plot and I place blocks where the generators were, then they won't be air lol
Make a custom Spigot jar
pain
Doesn't worldedit have a way of getting deleted blocks?
or an event that gets called when blocks are deleted using it
ye gotta check
wut
I added WorldEdit to my dependencies
it's showing in the dependencies in gradle
but it's not letting me import it
TF
wtf
still haven't found a fix for this ^^
show build script
okay now I was trying to use the fawe api instead
Could not resolve com.fastasyncworldedit:FastAsyncWorldEdit-Core:2.1.1.
lol
ye but doesnt
are there more to the error?
like where it tried searching
urls
Required by:
project :
Possible solution:
- Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html
it's on mavenCentral
mhm
I have no idea what's happening with my gradle tbh
git gud
It doesn't depend on adventure
bruh ye I forgot to remove that from the last version
the other version used it
at least I got told by you to add that exclude group
harder than it seems xD
The other version didn't use it either
can anyone tell me if you are able to add it as a dependency without any issues?
Only GUI does
oh oof
ye can someone test if adding FAWE as a dependency is working fine?
like, I can't see what's wrong lmao
GOD really gradle.
Found out the issue
def targetJavaVersion = 16
needs to be 17
can't gradle specify this next time? lmao
okay that that's done
how the hell can I detect the blocks I delete in an EditSession
I have no idea how to work with WE api
lmao
how to remove permission from a player in luckperms api?
https://luckperms.net/wiki/Developer-API-Usage#modifying-usergroup-data
Node.builder("your.node.here").value(false).build()
or you might have to remove the node
depending on what you need
removing a permission isn't the same as denying btw
ye i wasn't sure which one they wanted 🤷
thanks I will use the vault to remove the permission (I only thought about it now, sorry)
hey guys, im currently making a lobby plugin, and ran into a problem
whenever i right click an item, the tps drops considerably
if i hold it for a long time, the tps drops to single digits and eventually crashes the server
show code
download https://www.spigotmc.org/resources/spark.57242/
/spark profiler to start
right click item
/spark profiler --stop
are you interacting with a database sync?
nope
show code
oh yea
thats for database
@EventHandler
public void onInteract(PlayerInteractEvent event) {
Player player = event.getPlayer();
if (manager.isInBuildMode(player.getUniqueId())) return;
event.setCancelled(true);
ItemStack item = event.getItem();
if (item == null) return;
if (item.getType() == Material.AIR) return;
for (LobbyItem lobbyItem : JoinItems.getLobbyItems()) {
ItemStack itemStack = lobbyItem.getItemStack();
if (itemStack.getType() == item.getType()) {
lobbyItem.onClick(event);
return;
}
}
}
is this PassiveListener or StaffModeListener
Alright, so im using Gson to serialize an object jsona nd store it in a redis db. How can i store that in a mongo db persistantly? as the redis db is just for caching
LobbyInteractListener
it seems like the lag is coming from either PassiveListener or StaffModeListener
or both
¯_(ツ)_/¯
ill check staffmodelistener
alr
@EventHandler
public void onInteract(PlayerInteractEvent event) {
Player player = event.getPlayer();
User user = User.get(player.getUniqueId());
if (!user.getSettings().isInStaffMode()) return;
if (!event.getAction().isLeftClick()) return;
switch (player.getInventory().getItemInMainHand().getType()) {
case CLOCK -> {
Player target = PlayerUtils.getRandomPlayer(player);
if (target == null) {
Lang.PLAYER_TELEPORT_NO_PLAYERS.send(player);
break;
}
player.teleport(target.getLocation());
Lang.STAFF_RANDOM_TELEPORT.send(player, "%TARGET%;" + target.getName());
}
case LIME_DYE -> {
vanishHandler.unvanish(player);
player.getInventory().setItem(8, StaffModeHandler.getVanishItem(false));
}
case GRAY_DYE -> {
vanishHandler.vanish(player);
player.getInventory().setItem(8, StaffModeHandler.getVanishItem(true));
}
}
event.setCancelled(true);
}
StaffModeListener
can you show the code for User?
thats a huge file
Paste Services
When asking for help with a config/menu/code issue please use our paste bin:
(we prefer it over pastebin.com)
• HelpChat Paste - How To Use
at line 344 can you add a java Bukkit.broadcastMessage("Added user " + getUniqueId() + " to cache"); debug in save? to make sure that it's being added to the cache
and also one at line 503 in getFromDatabase ```java
Bukkit.broadcastMessage("Using database for " + uuid);
both should only be called once even when right clicking multiple times
mk
ok so i didnt click anything, and it broadcasts multiple times
i dont think thats a good thing
which one?
clicking something will broadcast even faster
the database one
💀 you sure the cache is working correctly? 🥲
well something is definitely wrong lmao
check getDataStore().save(profile)
since that's the only place where the save cache can be
Datastore is a morphia thing
oh
then run java instance.getDatabase().getUserCache().put(uuid, profile); below the save
then that should work
instance.getDatabase().getDatastore().save(profile);
instance.getDatabase().getUserCache().put(uuid, profile);
like this?
yep
its keep showing Using database?
yep
try putting it right above the return actually
not below the save
so outside of the if statement
now that should work
instance.getDatabase().getUserCache().put(uuid, profile);
return profile;
yep
isn't that a Map<UUID, User>?
O
uhhhhhhhh well i have 0 experience in redis
so
uhhh
get or put is prob not working
damn
actually now i see right click run multiple times a second if i click once and let go quickly
iirc spigot calls right click event twice for each hand
even if i hold right click?
yes - then it calls 10 times per second due to mc having a 5 cps rmb "autoclicker"
i think
🥲
Use jedispubsub for things like that
And just publish serialized data to channel
Anyone here knows how to use EditSessions from WE?
Whats the question
do u guy know how can i sort players by luckperms ranks weights on tablist??
i want do that in my plugin
ok i can get weight, but now i want to sort players on tablist, i mean i know how to sort arraylist but i dont know how to even modify players order on tablist
I think you need teams, and teams are ordered by name in tab
good idea
but i saw someone doing that with packets
but teams seems easier
so u mean i can make team "a" and in this team will be owner and it will be on top of other teams?
but name of team is not displayed on tablist?
idk how teams works i never used it
it worked thx, very good idea
so i did
onJoin event
int count = 97;
ArrayList<Group> sortedGroups
= new ArrayList<>(LuckPermsProvider.get().getGroupManager().getLoadedGroups());
sortedGroups.sort(Comparator.comparingInt(o -> o.getWeight().getAsInt()));
Collections.reverse(sortedGroups);
for(Group group : sortedGroups){
Utils.createTeam(scoreboard, (char)count, group);
count++;
}```
Team team = scoreboard.getTeam(String.valueOf(name));
if (team == null) {
team = scoreboard.registerNewTeam(String.valueOf(name));
}
for(Player player : getAllPlayersFromGroup(group)) {
team.addEntity(player);
}
}
public static ArrayList<Player> getAllPlayersFromGroup(Group group){
ArrayList<Player> result = new ArrayList<>();
for(Player player : Wrapper.getPlugin().getServer().getOnlinePlayers()){
if(LuckPermsProvider.get().getGroupManager().getGroup(LuckPermsProvider.get().getPlayerAdapter(Player.class).getUser(player).getPrimaryGroup()).equals(group)){
result.add(player);
}
}
return result;
}
and rest of methods
max distance a player can click a block? (survival)
Hello!
I'm trying to give a npc a custom skin but I'm having some trouble doing so.
gameProfile.getProperties().put("textures", new Property(config.getString("npcs.jeff.texture"), config.getString("npcs.jeff.signature")));
I saw this code in a tutorial so I tried it but it doesn't seem to change the skin. Am I forgetting something? Please let me know.
Thank you!
I'm getting the skin texture and signature from this site:
https://mineskin.org/
Okay so basically I have a mining system and I'm trying to get the material's pretty name so like "Coal Ore" instead of "COAL_ORE"
But the material name is returning null or "E"
If you can, use components and translate the material name
I've tried using XMaterial
Well
I can log the material name by literally just outputting the material object and returns what I want
But It's not a string so I can't format it
I've tried material.toString()
I've tried material.name()
It outputs Unsupported material with no data value: E
When using XMaterial
I'm not sure why
how do I convert this buildscript to the new plugin block in a build.gradle.kts file? KTS buildscript { ext.objectboxVersion = '2.9.1' repositories { mavenCentral() google() } dependencies { classpath "io.objectbox:objectbox-gradle-plugin:$objectboxVersion" } }
I tried this kt plugin { id("io.objectbox") version "2.9.1" }
but gradle says
Caused by: org.gradle.api.plugins.UnknownPluginException: Plugin [id: 'io.objectbox', version: '2.9.1'] was not found in any of the following sources:
- Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
- Plugin Repositories (could not resolve plugin artifact 'io.objectbox:io.objectbox.gradle.plugin:2.9.1')
Searched in the following repositories:
Gradle Central Plugin Repository
Google
MavenRepo```
Isn't that what im already doing?
Conversion plugin?
If so, take a look at this ^
no, I have this exact block on my android project's build.gradle file, and I was converting it to kts, but if I remember correctly, buildscript block is deprecated and was replaced solely by the plugins block
should I post the full files?
Oh i read it wrong, give me a sec
settings.gradle.kts: https://paste.helpch.at/inokucenok.cpp
build.gradle.kts (global): https://paste.helpch.at/oxitujaxud.m
build.gradle.kts (app/main): https://paste.helpch.at/upogunelaq.m
I guess best choice would be to try finding the plugin on gradle portal and see the id
Doesn't seem to be in portal hmm
He's trying to do it without buildscript though
Tried putting central in the plugin repositories but doesn't seem like you can, you might have to use the buildscript thing
I guess I'll use it only for this plugin then, thanks for the help 👍
weird plugin though
yeah but their docs says to use it =/
yeah, ngl this objectbox kinda sucks, I used it when I was learning android for this specific project because I had no idea what I was doing, and now I kinda wanted to converted this app to Kotlin applying proper OOP principles, so I guess I'm stuck with it for some time
any ideas how I can display the elder guardian "curse" effect on a player?
Couldn't find this anywhere
For the effect
/execute [name of the player] ~ ~ ~ particle mobappearance ~ ~ ~ 0 0 0 1
For the sound
/playsound minecraft:entity.elder_guardian.curse hostile [name of the player]
I was kinda obviously asking in spigot
this is a development support channel
unsure why I would ask for the vanilla method
lol
You can run the comamnd using spigot but yeah i get that
isn't it a particle effect?
it is but it's not in the Effect enum and so you have to use packets to play it
when was this added...
also that name wtf mojang
ah it was added since the particle exists, cool ig
lol ty
I'm trying to get started with creating npc's but when I try to create a simple command that spawns a npc I get this error:
Caused by: java.lang.ClassNotFoundException: net.minecraft.world.entity.player.Player
This is my code: https://paste.md-5.net/ovifopayul.java
Could someone please help me?
yes
alright
i'll try
I'm getting an error at:
ServerPlayer serverPlayer = craftPlayer.getHandle();
Is this not the proper way to get a ServerPlayer?
Player player = (Player) commandSender;
CraftPlayer craftPlayer = (CraftPlayer) player;
ServerPlayer serverPlayer = craftPlayer.getHandle();
that looks about right
the issue is likely with your plugin's NMS classes not being the same as your servers
And how do I fix that?
well first of all what version is this & are you using maven/gradle
im using maven and this is 1.18.1
uh send your pom.xml
Paste Services
When asking for help with a config/menu/code issue please use our paste bin:
(we prefer it over pastebin.com)
• HelpChat Paste - How To Use
what could cause org.bukkit.Location.getWorld() to return null?
did you do the buildtools thing
if the location world is null
it's nullable
where are you getting the Location?
I store the location as a key in a json file world::X::Y::Z and then on load, I create a new location, by getting the world by name, and x, y and z.
do you use MultiVerse?
u might have to add softdepend on it
(so that the worlds load)
since by default the plugin loads after (vanilla) worlds
(also assuming you're using gson I'd recommend making your own - not Bukkit's bc Bukkit's would attempt to serialize the world - Location class instead and storing that instead of a string)
nop
I have a task running every 15s and it's returning this
but only in some, which is weird.
can it be an issue that I am running that task async?
when do you cache the locations?
at start
and how, send the code
on a hashmap
for (var key : json.singleLayerKeySet("gens")) {
var temp = key.split("::");
var location = new Location(plugin.getServer().getWorld(temp[0]), Double.parseDouble(temp[1]), Double.parseDouble(temp[2]), Double.parseDouble(temp[3]));
var gen = (Generator) SerialManager.fromString(json.getString("gens." + key));
cache.getGenerators().cache(location, gen);
}```
cache part is just putting the data into a hashmap
nothing else
worlds are not loaded on enable yet
IndexOutOfBoundsException
If it's exactly world::X::Y::Z, if you miss a single thing, you'll have an error
print out location
I already debugged it, it's not missing anything
sure
also what lib is that 🤔 i can't find it online
I'm not talking about that, I am saying you need to validate it or you'll get errors
Remember, users are stupid and they'll break your stuff
it's not going to be public sooo
it's a private plugin
try caching the locations 1 tick later, it should work
already only caching it 2 seconds later
lol
okay this is funny.
I completely deleted the json file
at first, it works perfectly fine
but the issues only come when I first restart
lol
Also,
null is indeed null
which means getServer().getWorld() isn't working properly
but what's weird is that the world does exist.
and even weirder, if I reload, now it works
print it out
probably because plots world is already loaded? idk
temp[0]
are you using a world other than world, world_nether, or world_the_end?
if so, you need to softdepend on the plugin that manages that world
yes
do u have a world plugin?
nop, plotsquared created the world
like legit just adding it to depend?
yes
k
ah
lets see, added the depend thing
okay nop
depending on it, didn't work
this is funny af
because if I reload afterwards
it works
ye I gotta find a way to check if the world is loaded.
and if it isn't, load it
found this: new WorldCreator("arena").createWorld(); doesn't this create a totally new world?
uh you probably shouldn't do that
you should really just depend on the plugin that is in charge of loading the worlds and loading the config stuff after that's done instead
alternatively load the config in ServerLoadEvent ig
wb WorldLoadEvent
then the loading stuff will be called each time a world is loaded, but that doesn't guarantee that the world in the config will be
#equals
:)
oh ic
what u mean
ye ig he should try serverloadevent
and if that doesnt work
then worldloadevent
although that'll complicate things a bit
but I am depending on plotsquared
still didn't load
will try
depend, not softdepending? and this is in onEnable?
although u prob dont even need to run it async if its in onEnable 🤷
will try the serverload event
big bruh
so, wait like 10 ticks before loading it?
on serverloadevent
?
that should do it lmao
we will see
omg poggers actually worked lul
you guys are pro's
thx for the help
🙂
Best way to get the enchantment name?
(getName is deprecated in new versions and getKey is not available in old versions)
just use getName
in newer versions yes, but you are basically coding for an old version
woozy_face
would be enchant.getKey().getKey()
but it would return something like minecraft:silk_touch or similar
right?
depends uh
What about enchant.toString()?
what does the first getKey return
yeah NamespacedKey#getKey would return silk_touch
dw it can't be null
there are getById/getByWhatever methods
static
in Enchantment, those are the ones you should use
i hate those breaking changes
how is any of that breaking?
it won't be lmao

it hasn't been removed for years when it should have, why would it be removed anytime soon? and the entire ecosystem is designed to not break old plugins



