#development
1 messages ยท Page 106 of 1
I think its an interesting addition and would love to see a plugin with it
personally Id love so see all my mobs harder also
even though the mobs in my server are already stupied difficult x3
brutes can 2 shot you
allot of mobs have way more health
but honestly I dont like the way the plugin configures stats
I would prefer potion effects
@plucky helm
Ah, I see
ya its in json format and all over the place and harder to write than code
its called leveled mobs
you probably added it before adding listing it in gitignore
theres an old plugin yes you can update it if you want to decompile it
well you dont have to decompile I guess because it has a github repo
The problem is that whenever i do the dragon in 1.17.1 it spawns the egg
Making it not spawn
find an item excluder plugin
item and block excluder
I didnt find any so you may have to code a plugin yourself
it would be simple if the egg spawns at exact cordnates everytime
but Im not sure if it does
I dont think it does
well I cant really help you looking into it now
theres no such thing as block excluder
and dragon egg spawns in random locations
and its not a drop item so you cant change the loottable
It spawns at the same place everytime
thats if you kill it in same place everytime
When i kill it, then it always flyes down. After that it dies
then make a event when dragon dies it removes the egg block at location
but thats if end portal has 0 cordnates
if else its probably random end portal location spawn in each end you create
but if you dont plan on changing your end world then you can get the location of the egg and destroy the block
simple
you may want to include a wait after it dies for the code the execute destroying the block
How would I return a boolean from a diff class
DI?
Huh
dependency injection
dependency injection
Dependency Injection
Dependency Injection is a way of providing objects with the objects they need ("dependencies"). This is usually done with a constructor, but can also be done for individual methods
Read more here: https://en.m.wikipedia.org/wiki/Dependency_injection
Dependency Injection in Java:
https://paste.helpch.at/yijawupoju.java
Dependency Injection in Kotlin:
https://paste.helpch.at/esogakutod.kt
read here for more ^
if its a method then you can make the method bolean and have it return your bolean
its its a class bolean value then you can make it public
if its going to another class then make it public static
No
no?
Try to avoid static when not needed
why
Also, your variables shouldn't be public, instead you should have getters and setters
it's not about security
it's about flexibility
and static is absolutely hideous if used wrong and a major source of hard to track bugs
Can't remember if there's any convos saved on why static bad
Why is Lombok bad?
- It's a compiler hack - the Java compiler isn't designed to modify code, so it can cause difficult to debug errors, or worse
- It requires an IDE plugin, so unless you've properly configured Maven, Gradle and your IDE, you'll get hundreds of compilation errors. This process takes time too, it's not easy
- Lombok'd code won't show in Javadocs
- The code generation is often unpredictable and difficult to debug, and often you'll have to do it "the hard way" anyway
- Java is supposed to be explicit, Lombok hides a lot of key functionality into a subtle annotation which can be easy to miss
- While IDEs support it with a plugin, it's usually more difficult to find specific things, like usages of a getter because they don't exist in the source code
- Finally, Lombok'd bytecode doesn't match the source code, so it causes a pretty annoying warning in IntelliJ
Well static isn't bad, people just miss use it
i mean id argue it's bad because its so easily misused
I'm trying to make something that compiles a custom language into a spigot plugin (Basically, trying to make a web minecraft plugin creator).
What tools should I use to convert my (converted to) JSON markup into a compiled jar?
I'm thinking I have like 2 options, and would like to hear input
1 ) Write little snippets of java, then compile it via the command line, and return that on a webserver
2 ) Find a library in any language to work with compiled bytecode, and (probably in TS) convert the JSON to bytecode manually
which makes the most sense?
use gradle
huh? how does gradle effect anything
I'm not gonna use any compile time package managers
I'm gonna manually compile for times sake
๐ค
I'm trying to make a custom language compile to JVM as quickly as possible basically
and I'm wondering what my best bet is
Hi guys, how heavy for server would be sending all packets send to/from 20 players to another server? approx
it would be as heavy as if the other server had those extra 20 players
emily
i want to send the data to non minecraft server ok
well that's different
Can someone help me here, I'm trying to work with the UltraPrisonCore api but keep getting this error when trying to load my plugin.
java.lang.NullPointerException: Cannot invoke "me.drawethree.ultraprisoncore.UltraPrisonCore.getTokens()" because the return value of "me.drawethree.ultraprisoncore.UltraPrisonCore.getInstance()" is null
plugin code?
?
@slow kiln if you have intellij you will be able to see if something in your code may return null
in that case you have a wrong statement
unless your returning null on purpose
Nah it's nothing to do with that
it says right there
value of "me.drawethree.ultraprisoncore.UltraPrisonCore.getInstance()" is null
that part of the code is wrong
whatever instance your trying to get your not gonna get with getInstance() because its null
^
It's not my code lol, It's trying to access an api
um
access the api with a different statment
you dont need to use getInstance
just import it and your good
then you can use UltraPrision.AnyMethod
but if your trying to use it and its not letting you add to your method
myMethod(UltraPrision ultra) {}
what are you talking about
they are saying they cant access the api
yes because they're doing something wrong
well duh
but what you're saying is even worse
how is that worse
how do you know this for sure
and what does this even mean
because is some way or another they are getting an instance of the core
why I dunno
[16:34] Sophia: access the api with a different statment
[16:34] Sophia: you dont need to use getInstance
[16:35] Sophia: just import it and your good
[16:35] Sophia: then you can use UltraPrision.AnyMethod
this is wrong
they are not static methods
you need an instance, which you get by calling getInstance
you dont need a static method to do that
???
then you can use UltraPrision.AnyMethod
you mean likeUltraPrison.someMethod()?
that's a static method
Im sure someone understands but you
either way we'd need code and/or stack trace to provide any help
I've added the plugin jar as a dependency of my plugin, then I'm trying to get an instance of it, but when my plugin loads it says the instance is null. The depending jar is not my plugin.
java.lang.NullPointerException: Cannot invoke "me.drawethree.ultraprisoncore.UltraPrisonCore.getTokens()" because the return value of "me.drawethree.ultraprisoncore.UltraPrisonCore.getInstance()" is null
at xyz.foggies.buzzbackpacks.BuzzBackPacks.onEnable(BuzzBackPacks.java:26) ~[BuzzBackPacks.jar:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[patched_1.17.1.jar:git-Airplane-106]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:370) ~[patched_1.17.1.jar:git-Airplane-106]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:500) ~[patched_1.17.1.jar:git-Airplane-106]
at org.bukkit.craftbukkit.v1_17_R1.CraftServer.enablePlugin(CraftServer.java:561) ~[patched_1.17.1.jar:git-Airplane-106]
at org.bukkit.craftbukkit.v1_17_R1.CraftServer.enablePlugins(CraftServer.java:475) ~[patched_1.17.1.jar:git-Airplane-106]
at net.minecraft.server.MinecraftServer.loadWorld(MinecraftServer.java:733) ~[patched_1.17.1.jar:git-Airplane-106]
at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:319) ~[patched_1.17.1.jar:git-Airplane-106]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1220) ~[patched_1.17.1.jar:git-Airplane-106]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:319) ~[patched_1.17.1.jar:git-Airplane-106]
at java.lang.Thread.run(Thread.java:831) ~[?:?]
this.tokensAPI = UltraPrisonCore.getInstance().getTokens().getApi();
just to be sure, did you add the other plugin to your plugin.yml depend list?
yeah
well never mind my method I thought you were just grabbing a method
It loads before my plugin is loaded.
maven
make sure the UPC dependency has <scope>provided</scope>, or else you're (most likely) shading it (bundling it inside your jar which is a no no)
hey can someone help me with a problem
Alright I was building it incorrectly, but now it's giving an error saying:
package me.drawethree.ultraprisoncore does not exist
you'll have to elaborate. there might be people in here that can help
public void createArena(String id) {
if (arena.contains(id)) return;
// Create the arena.
arena.createSection(id);
arena.set(id + ".name", "Arena " + id);
arena.set(id + ".status", "closed");
arena.set(id + ".players", 0);
plugin.getArena().saveConfig();
}
I have this code but once I run the function I got this in my yml file:
'id814235':
name: Arena 1
status: closed
players: 0
How can I get rid of the ' ' around the id
you need a . after arena
Hi guys, is there any Java 3D library that can render image from X, Y, Z coordinates and its texture?
why does it matter? I think spigot auto adds it but it will work the same with or without it
can you send your pom.xml?
?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
I haven't gotten it in my pom.xml, I've went to modules and added it as a dependency that way via a jar.
you should never really mix build tools / building mechanisms
either use maven for all of your dependencies or don't use it at all
well it will autodelete it when you build it anyways
wat
ah yes indeed it worked ๐ sorry for the question
@lyric gyro can you help me change this static to a injection
public static Map<String, ItemStack[]> menus = PrivateVaultStorage.menus;
}```
Right, so
public void transfer(PrivateVaultStorage Vault) {
this.menus = Vault.menus;
}```
this is what I got
so far
public void transfer(PrivateVaultStorage Vault) {
this.menus = Vault.menus;
}```
in whichever class that is, you can take a PrivateVaultStorage in the constructor, and take the map from there
public class SomeClass {
private final Map<String, ItemStack[]> menus;
public SomeClass(PrivateVaultStorage vault) {
this.menus = vault.menus();
}
public void someMethod() {
// use menus
}
}
(as a side note: prefer getters/setters before public fields, in the case you want to add some extra logic inside the getter/setter then it's easier to add in the future without having to change every single place you change vault.menus to call the getter)
i never bought the whole "ruh roh everyone can change anything if it's public" speech, by itself it's no different than having both a getter and a setter -- the difference relies in that you can add extra logic, for instance you can check in a setter that the argument passed isn't null or that it matches certain criterion - or in a getter that certain things are initialized before something can be used, etc
opengl
CPU only*
so this is kinda messed
The PrivateVault methood of the class needs a parameter of PrivateVaultStorage when I try to use it in a third class method
seems like its only 2 way
what would be the best way to select a new area that isnt occupied by someone else, such as if i wanted to designate 1 chunk for every player.
like on a square grid that goes as far as the world border
like how islands are in skyblock plugins
How do I save a .yml file to a subfolder? Star, you told me to use Bukkit saveResource() but I'm unsure if that can't save to a subfolder. I haven't gotten it to do that any ways.
oh
ummmm
;d spigot saveResource
so this: public PrivateVault(PrivateVaultStorage vault) { this.menus = vault.menus; }
links this this:
public class PrivateVaultStorage extends JavaPlugin {
@Path("Player Vault")
public Map<String, ItemStack[]> menus = new HashMap<String, ItemStack[]>();
}```
but this method:
``` public void guiOPEN(CommandSender commandSender) {
Player player = (Player) commandSender;
Inventory inv = Bukkit.createInventory(player, 54, player.getName() + "'s Private Vault");
if (menus.containsKey(player.getUniqueId().toString())) {
inv.setContents(menus.get(player.getUniqueId().toString()));
player.openInventory(inv);
}
}```
needs to be open by this method:
``` @SubCommand("Private_Vault")
public void privateVaultCommand(final CommandSender commandSender, PrivateVault vault) {
vault.guiOPEN();
}```
@lyric gyro
they are all in different classes
dam
and in any other lang?
like a square grid, starting from 0,0 going out like a snake spiraling around that center area
what was the god damn method?
For?
saveconfig?
saveResources
javaplugin
declaration: package: org.bukkit.plugin.java, class: JavaPlugin
that god
Isn't this: https://www.spigotmc.org/threads/help-with-plugin-saveresource-string-boolean.263410/ the one you are talking about? Because, uhh, that one can't do it. And I currently do settingsConfig.save(settings); but that just clears the file.
d;spigot JavaPlugin#saveResource
void saveResource(@NotNull String resourcePath, boolean replace)
throws IllegalArgumentException```
Saves the raw contents of any resource embedded with a plugin's .jar file assuming it can be found using getResource(String).
The resource is saved into the plugin's data folder using the same hierarchy as the .jar file (subdirectories are preserved).
resourcePath - the embedded resource path to look for within the plugin's .jar file. (No preceding slash).
replace - if true, the embedded resource will overwrite the contents of an existing file.
IllegalArgumentException - if the resource path is null, empty, or points to a nonexistent resource.
Did you already send your code that you're working with?
Yeah, in the wrong channel lol. Here it is again: Data class: https://paste.helpch.at/ulowimanup.java, FileManager class: https://paste.helpch.at/kidoqemosi.java and my main class https://paste.helpch.at/uwoveqibew.js.
so sniskus, you get the plugin datafolder, make a new folder and inside you make your custom yml, then using the above method you save it so it doesnt delete
yeah
JavaPlugin#saveResource saves the resource and avoids it from getting deleted
if thats the problem
It worked before though lol, before I made the save function lmao. It is the save function that is the problem, trying to implement it rn so I can use it. I thought the files not saving was the cause of my original NPE so I tried fixing it.
whats its code?
in FileManager?
The save function? Row 290
need help with injection ^
I tried the function you sent and did this plugin.saveResource("/Settings.yml", true);. Though it is still not saving?
Does anyone actually know how to keep a chunk fully loaded all the time in spigot? I've tried and tried but cannot seem to get it work. I've tried
Chunk#setForceLoaded - Doesn't work
ChunkUnloadEvent wait 2 ticks load again - Doesn't work
I've tried NMS keeping the chunk forcefully loaded - Doesn't work
sorry but it is out of my knowledge now, it should really work tho
try removing the /
Try event.setCancelled, if you haven't?
and make sure its in the jar
it doesn't implement cancellable, so no u cant
It doesn't? I was certain it did...
me to, but nope
Huh...
declaration: package: org.bukkit.event.world, class: ChunkUnloadEvent
https://img.olziedev.com/o646406400640StlF.png i've tried this
https://img.olziedev.com/Cr554J555455544KTxn.png and also tried this too (with spawners also being able to spawn when a player aint there)
Noop, nothing. Any other idea?
do you have it compiling into the jar file
Ya
and did you confirm
This works fine settings = new File(folder + "/Settings.yml");
https://img.olziedev.com/673o673673nB673KA.png this is what i do
saveResource copies the file from the jar
into your plugin data folder
You know that right?
...no?
I can load the files from the .jar, then I want to be able to change them and save them again?
I thought saveResource did that, but I guess I was not clear enough when explaining what I wanted
you wanna make changes during runtime in the config?
You tried, thank you
Yeah
and then save that file
Yeah
personally I like sf-cfg and it autosaves and loads on chanegs
no problem
Though the file is empty
make sure you save the file from the jar folder
It isn't loading now lmao
Yeah...uhh
How do I do that to a sub folder?
I currently have this https://ibb.co/6120YbC where folder is the sub folder
no ur doing it wrong
check if settings exists
if it doesn't exist, saveResource (transfer file from the jar to the disk)
and then keep running code and load it
settings = new File(folder + "/Settings.yml");
if (!settings.exists()) {
plugin.saveResource("settings.yml, false");
}
settingsConfig = YamlConfiguration.loadConfiguration(settings);
settingsConfig.set("Effects.Positive.speed", false);
settingsConfig.save(settings);
@thick kestrel just tested the lib using Java 16 on paper 1.17.1, everything worked out, could you share more of your code so I can try to replicate it?
How can I reset a world easily? I've been trying to just disable auto-save and then Bukkit.unload(world, false) but it doesn't seem to work. Any suggestions?
unload the world, then restart
oh and delete the files
restarting isn't strictly necicarily, but I've had it try to save stuff to the new one on me
I cannot restart. So just unload the world then delete the files?
sure, try that
how can i get a location that "moves" itself closer to another location if it's too far? (bukkit)
for example with ```
X - - -
-
-
- O
if `O` needed to be next to `X`, `O`'s location would change to
X - - -
- O
-
- O - -
i feel like i could do something with normalize & multiplying that but idk what to multiply it by
(100 block range btw)
googling skills ๐
why cant u just do math and just plugin in numbers with the distance formula
and do the opposite
lol
me small ๐ง
no your brain was simple just too big 
๐
Anyone here ever written raw bytecode, and if so what's the best way to get used to / start to fully grasp it?
(I'm looking to make a bytecode based tool)
How do you actually guage when something isn't optimised like for one player using this plugin it uses this much, at what percentage would be concerning. this is the spark profiler
optimize by testing
put a hundred players on the server to see how it performs
then you will know if optimization is necessary
So don't even bother going by those percentages?
well if the percentage is worryingly high with only one player on then of course that's a good indicator
0.13% isn't very high for one player
but you don't know how it scales with more players
you have to test
as you get better with experience you may be able to spot areas which need optimization even prior to testing
but that comes with experience, not necessarily something that's easy to teach
Like this? #showcase message
Does that link not work
could I just invite you to my project?
I think its because I used static
Im trying to fix it but I dont know how to make dependancy injection 3 way
but your class seems to be static
config class
Still need help with this ^
sure, add me as collaborator of your project https://github.com/SecretX33
Dependency Injection
Dependency Injection is a way of providing objects with the objects they need ("dependencies"). This is usually done with a constructor, but can also be done for individual methods
Read more here: https://en.m.wikipedia.org/wiki/Dependency_injection
Dependency Injection in Java:
https://paste.helpch.at/yijawupoju.java
Dependency Injection in Kotlin:
https://paste.helpch.at/esogakutod.kt
is there a easy way to convert a string like "&4RED TEXT" to a component, with red text... but without knowing exactly the text or colour....
so i have a config with messages in them and i want to read the messages and send them to the user but i'm not sure how to add the colour to the text as Component.text("the test") doesn't convert the &4 into colours.
use a library to convert strings to components. minimessages is one but it uses xml tags, I personally use matt's messaging library
right ok ill take a look at them, thanks
Looking for useful libraries/frameworks?
Here are some which have been deemed useful by the community and are used daily.
-> Menus: https://mf.mattstudios.me/mf-gui/gui
-> Commands: https://mf.mattstudios.me/mf/mf-1/getting-started
-> Messages: https://mf.mattstudios.me/message/mf-msg
-> Config: COMING SOONโข๏ธ
@cinder nimbus see third one ^^
thanks
you'll have to use the adventure one because there's 2 one for bukkit stuff
and one for adventure
ok
LegacyComponentSerializer iirc
how do i fix pom.xml not finding/giving me errors on certain plugins
i.e in my <reporting> i have some plugins
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId>
<version>3.0.0-M5</version>
</plugin>```
and the artifact id/version arent being found
What's the best way to handle saving players in your opinion?
Option 1 is to use a cache and save on leave/load, but that means whenever they load we need to get all their entries, and whenever they leave we need to remove all their entries + reinsert them (in case they removed friends)
Option 2 is to save their friend list to cache in case they want a list of friends, but whenever they remove/add a friend we make a database call. Which means if someone joins with 100 friends and doesn't do any modification we only make 1 call
The downside of option 2 is that a player could spam mysql calls by adding/removing friends
Downside of option 1 is that we have to do a lot of requests on leave/shutdown and join
Hmm are you familiar with soft caches as well as expiring caches, and then with an appended removal callback? That might be something to look into?
But how would that work with mysql?
I'd still have to make the database call in the end
Yes of course, well wouldnโt you do it asynchronously anyways?
Right but I don't want to send 100 calls of to the database for no reason
Yeah well, just to say it, today we got an absurd amount of memory.
Right but in theory what would be the better option?
I donโt think itโd be such a biggie to do a lot of request on join and shutdown
After all itโs not during session
Yeah but it would also be on leave
Yuh, just schedule an asynchronous task and make sure they canโt join again before that task is completed
Right but the downside is I'd be making tons of calls for no reason
Lets say a player with a 1000 friends joined
Didn't remove/add any friends
when they leave we need to wipe all their friends and reinsert every friend back
even though they didn't do anything
Why would you need to wipe and readd everything?
Because I'm dumb and just realized that
๐
How does this sound
2 maps
one to store when they joined, and one i modify through the session
when they leave I do a comparison and remove any friends that aren't in the end of session set
or is there a better way to do it
Yeah that could work
Any other ideas?
Hmm let me think a bit
alright
Yeah well, this approach sounds good, but yeah tricky data model.
What causes my permissions to not appear in permission handlers such as LuckPerms?
LP will only suggest "known" permissions, that is, permissions that have been checked for
how would i go about replacing 1.12 protocol with 1.8 in a server jar
So I have some different GUIs for my plugin, and I want to know which GUI the player has open. So is there a good way of telling what inventory they clicked? I want to do this without using the title since I want the same title for some of the GUIs.
.equals()?
Ah okay thank you! Is there any way to easily do this on enable?
you can just add your permissions in your plugin.yml, the way bukkit works will make LP register them "automatically"
Wow ok, I did not think that worked
Thought == was the correct method to compare them
But that didn't work lol
Thanks
I think == simply runs .equals or something similar, not sure
It should only return true if the actual inventory objects are the same object (assuming it uses the default equals)
Wait
Nvm
It does not work
Im a dummy dumb
I added || 1 != 2 next to it just to show the GUI in-game
Imma try again lol
Ok it works lmao, thank you again
That was a rollercoaster
Hey is anyone experienced with the spigot/bukkit world loading an unloading features. I have been trying to setup a way to unload and load worlds after a minigame on my server is ran, but I keep getting IO errors about the files being locked by another process after the first trial. (DMS open)
Thanks a lot!
Here is the error I'm getting. https://paste.helpch.at/jexaviyoxi.sql
Here is the code I use to reload the world (Task is a runnable, and yes I know its scuffed)
https://paste.helpch.at/ayahovowuv.java
Called From:
https://paste.helpch.at/uniwameges.cs
So. I actually get no error in the console, but nothing works.
Here is the code:
https://pastebin.com/rT15ws09
ClassFile: neonowlgery.*************.core.lobby.events.JoinEvent.java
Did I mess up something?
(oh yes, and the stars are censors, due to the stars are censoring the server's name)
@EventHandler
ah yes the good old hide my package naming bcz I don't want to get hacked

I hide my package name because the server is currently inside the alpha state, and is also not English (as you can read it).
no offense but why would we care about it?
Well.. Nobody may know, who loves to leak here. I specially hate leakers, so I censor everything that is too important.
leak? what is there to leak?
a server that isn't even out?
again I mean no offense, I just don't get it so to me it seems pointless
I donโt see why itโs a big deal that he took 3 seconds to censor out something that he doesnโt want other people seeing/knowing
how is this an invalid event: @EventHandler public void onKill(PlayerDeathEvent e, Player player) { exp.addExp(player); String killed = e.getEntity().getName(); String killer = player.getName(); e.setDeathMessage(ChatColor.RED + killed + " has been slain by " + killer); }
You donโt put a second argument in there
Itโs just the event thatโs a parameter
it's not a big deal
I just don't get it so to me it seems pointless
Different people see things differently, it might not matter to you but itโs more important to him. Different perspectives I guess

using Event changes nothing
I need player to show killer
event.getKiller()
You canโt have multiple arguments in an event method
Bukkit doesnโt work like that sadly
but I also need player to pass into addexp
is it not Player#getKIller?
Player p = (Player) event.getKiller
Yeah i think
exp.addExp(player);
?
this is a leveling system
Ok
Ill figure a way around it
You can use methods on the PlayerDeathEvent to get the different players involved
fix it thanks
https://paste.helpch.at/ekedacepex
How can i fix the error "Dependency 'me.clip:placeholderapi:2.10.10' not found"
On these lines:
<dependency>
<groupId>me.clip</groupId> Error
<artifactId>placeholderapi</artifactId> Error
<version>2.10.10</version> Error
<scope>provided</scope>
</dependency>
ould be the spacing
but I really doubt it
Idk how, but when i committed the code to GitHub it fixed it.
yeah bcz its xml it would work even if it was all in one line
oh lol
how different is 1.8 protocol from 1.12? i.e how much/what would break if i made a 1.12 server jar accept 1.8 players
just use viaversion and viabackwards, profit
stonks
no need for vb
thats not what im trying to do lmao
wait what ๐ณ
im trying to convert/fork a 1.12 server jar, into a 1.8
why would you do that
i'm a special breed
how about just use paper 1.8?
again, no
but seriously, you gonna suffer a lot, every mc version changes a bunch of stuff internally
why not, lower version = performance profit
im trying to do this to a non-bukkit
i'm trying to convert a 1.12 open source/barebones server jar to be a 1.8 server jar
yeah I got ya, my point remains, it'll be very hard to properly convert it, or at least doing such feat would be very hard for my standards
wasn't there no major changes until 1.13? so 1.12 should be fine, no?
combat update on 1.9, right?
yes
they reworked the combat system
but i dont think that part is even implemented
ok currently
my main problem is making sure the actual player connection is fine
like, the player can join peacefully
i dont wanna just edit the PROTOCOL_VERSION = NoInline.of(754); values without knowing what it may fuck up or fix
Bardy is the one who is more knowledgeable about this matter I guess
who bardy
BomBardyGamer
fun
yes, I'm not telling you to use his code as a guide, I'm telling you to use him as a guide
i have no idea, but you can try pinging him (maybe?) or PMing him
Hey @weary hill, legend says you're pretty knowledgeable on minecraft protocol/etc, would u happen to how much I need to change to a 1.12 server jar (glowstone) to make it a 1.8 jar? mostly in terms of player connections/joining protocol/handing etc
i am trying to make a simple loop but it doesnt exactly work, is runs 10 times at once instead of a delay. But it needs to run once every 60ticks 10times
Bukkit.getServer().getScheduler().runTaskLaterAsynchronously(rsChatManager.get(), new Runnable() {
public void run() {
try {
create(new File(int_random + ".json"));
Bukkit.broadcastMessage("Test");
} catch (IOException e) {
System.out.print("Er ging iets mis!");
}
}
}, 60);
}```
1.12 and 1.8 are both old, outdated, shitty legacy versions that I've never worked with, I can point you in the places to look, but I won't give you any support with them, since I don't know, and I don't care about them
you can easily find the versions that you're looking for on that page
Aight thanks
that's exactly what your code says
for(int i = 1; i <= 10; i++) {
int delay = i*60;
Bukkit.getScheduler().runTaskLaterAsynchronously(<JavaPlugin>, () -> {
// Your code
}, delay);
}
// or
new BukkitRunnable() {
int countdown = 10;
public void run() {
countdown--;
if(countdown == 0) cancel();
// Your code
}
}.runTaskTimerAsynchronously(<JavaPlugin>, 0, 60);
```pseudo code untested.
i'll be honest the top one will probably reach the max number before the scheduler runs
Just a bit puzzled why not simply BukkitScheduler::runTaskTimer ๐
And then with a MutableInt or smtng
Iโm confused bcuz it seems the newer versions are getting even shittier
Not really, things have been improving if you compare it to earlier versions, still not the best, but at least we're getting somewhere
is html turing complete
is css turing complete
is html + css turing complete
any hot takes?
no
r u even turing complete
yes
why
html can't emulate a turing machine
html + css tho
you're right, it is
https://paste.helpch.at/iyesawotoz.java
Hey, this is my code to create a new placeholder, in the main class: i register it with
new Expansion().register();
But it doesn't work in-game
Console has this line:
[15:34:05] [Server thread/INFO]: [PlaceholderAPI] Successfully registered expansion: LostKingdom
and what's the placeholder you're parsing?
%tps%
%LostKingdom_tps%
ahhh, thxx
I have a plugin that adds custom item/xp dropping logic for when a player dies.
Now I want to be able to toggle this behavior on/off depending on the world / the world guard region or the kind of damage that caused the player to die.
Is the following config excerpt understandable?
remove_inventory_on_death:
chance_per_slot: 1.0
# ... a bunch of other settings such as % of stack size to drop per inventory slot etc.
filter:
world:
- world3_nether
- world3_the_end
worldguard_region:
- my_region_id
damage_cause:
- LAVA
- VOID
use_worlds_as_allow_list: false # used as deny list by default
use_worldguard_regions_as_allow_list: false
use_damage_causes_as_allow_list: false
ew yaml
is here a ticket place
y'all do non-yaml configs for your plugins? ๐
?
java.net.MalformedURLException: no !/ in spec after the latest paper update I am getting this error when I try to access an external jar file
What do you mean by that? If you need help with a plugin, ask in the plugin-specific support channel or in #general-plugins if there is none.
i use sql for configuring and yaml for saving
Since yaml is easiest for spigot/paper server owners and server admins thatโs why I do indeed choose yaml for configs. Itโs quite a nice "language" although too flexible imho.

Iโd love yaml if the specs specified comments to be attached to nodes
Maybe one day
๐
yes
Toml is nice but itโs a bit weird how it flats nested key to value mappings out
Yuh, I mean technically you could add a comment by an arbitrary key value
Altho ugly

hocon best
0/
welcome to the korm fields
<insert korm fields meme here>
Does anyone know if Pterodyctal doesn't support Hikari?
(taken from elsewhere)
2. Make sure there is no firewall blocking the connection from 172.18.0.0/16 to 172.18.0.1
3. Use 172.18.0.1 or 172.17.0.1 instead of localhost as database host address ( only if the database is on the same machine )
4. Make sure that the user can connect from 172.18.0.0/16 to the MySQL server. You can achieve that by creating the database user as 'username'@172.18.%.% . If you used the internal database management of Pterodactyl, you can ignore this step
public static void scoreboard() {
for (Player player: Main.getPlugin(Main.class).getServer().getOnlinePlayers()) {
String title = Main.getPlugin(Main.class).getConfig().getString("scoreboard.title");
Scoreboard scoreboard = ScoreboardLib.createScoreboard(player)
.setHandler(new ScoreboardHandler() {
@Override
public String getTitle(Player player) {
Bukkit.getLogger().info("Getting entries");
return title;
}
@Override
public List<Entry> getEntries(Player player) {
EntryBuilder sb = new EntryBuilder();
for(String str : Main.getPlugin(Main.class).getConfig().getStringList("scoreboard.body")) {
String bodyText = PlaceholderAPI.setPlaceholders(player, String.join("\n", str));
sb.next(bodyText);
}
return sb.build();
}
})
.setUpdateInterval(2l);
scoreboard.activate();
}
}``` When i run this code it does not create the scoreboard, i'm using ScoreboardLib in 1.17.... Hard to explain
static
?
avoid abuse static 
how do I clone a different branch again? I basically have cloned the main branch and its set up to the remote main but I also want to have another branch cloned locally and can't seem to find out how. now that I think about it, I Do have premium gitkraken. might look at that
git checkout other-branch?
Is it possible to update a plugin if you have only the Jar and no source?
The original developer cannot be contacted (trying tho)
its possible
decompile, fix the java issues (decompiled code usually doesn't compile), add the necessary dependencies in your build.gradle, update the plugin, profit
Code?
pla.playEffect(pla.getLocation(), Effect.HEART, 2);
'playEffect(org.bukkit.Location, org.bukkit.Effect, int)' is deprecated
how can I fix this?
d;spigot player#playeffect
void playEffect(@NotNull Location loc, @NotNull Effect effect, @Nullable T data)```
Plays an effect to just this player.
loc - the location to play the effect at
effect - the Effect
data - a data bit needed for some effects
Try 2.0
When I load a world right before my minigame starts (it waits 5 seconds then teleports players) it does not render the blocks. If you relog or leave and ender the world again it loads the blocks. I was wondering if anyone knows whats going on here or how to fix it?
probably cause that's not the potion effect's name?
I have an ItemStack thats being pulled from config.yml, it is always pulled from the config.yml the same way ever time
When i used the /data command on the 2 seperate stacks in this video and compared them using a string comparator online they 100% has the same /data
My question is, why are these ItemStacks doing this? https://www.youtube.com/watch?v=HBMoQmz1wlA
This also happens on restarts as well where items arent able to be stacked? If i need to provide code i can as the projects on github, but i seem to always remember having this issue with ItemStacks
Load those chunks server side maybe see what happens
I'm having trouble adding a new line to my enum class, no matter where I add the line or what line it breaks everything after it???
Probably a ; instead of ,
Is it possible to change the text colour for placeholder text in input fields?
I have this weird issue where my input is displayed in the right colour, but the placeholders aren't...
I think I found it
hey
i need rebuild the server expansion for fix a error with the software what im using
how i can rebuild a expansion?
i tryed but it doesnยดt compile correctly
it compile 4 me "caffeine" library
.
i need fix this error;
java.lang.NullPointerException: The expansion version is null!
The getVersion() method on the placeholder expansion class its not there or its null
you know how i can compile a expansion?
for example
And why exactly do you need to compile it yourself?
And what's the error
.
its a strange error
with the expansions what havent the @NotNull on the version works
i want delete the @NotNull and compile for test if works
but when i go to compile, it compile another thing
it doesn`t the Server expansion
can anyone tell me how I have to compile it?
Hi guys, I want to get chunk in which is player and save it in own format but only part which player can see (so no underground), is that possible somehow?
When essentials will be 1.18?
#general-plugins but to answer your question, you can use the development builds
That didn't seem to help.
TextComponent message = new TextComponent(String.format("%sBasic %scolors", ChatColor.of("#6D9293"), ChatColor.of("#C08251")));
sender.spigot().sendMessage(message);
Why does this show the default colors instead of the selected hex colors? (MC: 1.18.1)
Wtf is that jumbo
wdym?
Dont use mini
dw about that, it is easier for testing purposes
help?
Shit
Balls
Torture
I'm still having issues with this. I have increasing the delay before teleportation, loading the chunks before and after a player teleports to the world. Nothing seems to fix it other than manually teleporting between worlds after its loaded or relogging when in the world. Currently I am using Slime World Manager but this issue seems to occur even if I use the Bukkit api. I have checked with them to see if they know anything about it and it doesn't seem so.
@thorn steppewhat expansion are you trying to fix?
all what contains @notnull, for example Server expansion
I'm sure there is a working Server expansion for all versions of MC
i think its because youre using ChatColor.of, which converts it to the closest chatcolor (which are basic colors)
yes, but for the software what im using doesnt work fine, only work the expansions what doesnt have @notnull
@spare muskit's on sale for $7 right now, and there is no place you can get it for free and get support here
@thorn steppewhat version of Minecraft are you using?
1.16.5
with the software called Mohist
Anyone know if there's a problem using spigot-1.18.jar in your plugin?
Is there a fox crouch event?
FoxCrouchOnDeezNutsEvent
Created a backup of my 1.17.1 plugin and then replaced the build path spigot jar with a 1.18 version but it has created a lot of errors
@thorn steppeso your running a spigot/forge server?
I think I found it EntityPoseChangeEvent
these are the old versions of Server expansions https://api.extendedclip.com/expansions/server/versions/
did you try all of these
I would go back one version at a time till it works
the first 3 or 4 may do the trick
if not have you thought of Magma, it has less issues with spigot plugins
yes I know hard to make things work with so many bugs in things
Anyone? I used spigot-1.18.jar in my build path but it has created lots of errors?
For instance it doesn't recognize JavaPlugin?
I have a question, how do I get a reference (if it's even possible) the Executor of the main thread (context: running java console application)?
I'm building a lib and I would like to run some Runnables in the main thread, so I think the solution above is the best way of doing that, but I'm open to other ideas
I'll tell you in an hour that I'm not at home
ok
Never mind this does not seem to work
mixin ๐
In just minevraft or in general?
More details: Basically, I'm making a configuration library that does all the heavy lifting without user intervention (https://github.com/SecretX33/sc-cfg), it already works for Bukkit (minecraft) but I'm looking into making a module for general purpose Java applications as well, and one of the features this library provides is a way to run annotated methods whenever the configuration file is modified, automatically (the code for that is here https://github.com/SecretX33/sc-cfg/tree/main/common/src/main/java/com/github/secretx33/sccfg/storage) using Java WatchService API.
In Bukkit, I can schedule the method runs from the single threaded executor that WatchService uses to the main thread using the own Bukkit API, but for general purpose Java I need another way of getting access of a executor that is able to run things on the main thread, because by default all the annotated methods should run on the "main thread" of the platform, which in console Java is just the main thread, unless specified in the annotation used to mark the method as a "method that should be run when the configuration is reloaded".
I just want to know if that's possible, and if so, how can I get the/a reference for the/an executor of the main thread.
general
I mean the main thread doesn't have an Executor
it's just a Thread
Your issue is gonna end up being synchronization, running it on the main thread is simple enough you have a couple options. Can make some sort of queue
Well jk really one of your only options
fine, but is there a way to run things on the main thread from another thread
the thing is that, for a "main thread" to act as an executor and run tasks dispatched from other threads, it needs to run in a loop, constantly looking for said tasks on a queue
that simply does not apply to every program
so that is not consistently possible, correct?
Yes it is
Your main thread needs to be accepting tho
As she said it would need a loop
Which doesn't make sense in my context
Because those methods are scheduled directly from the single thread that watches the folder for specific file modifications (the configuration files), and those methods are scheduled to either be run asynchronously (using ForkJoinPool), or synchronously (using dark magic)
and by dark magic I mean either the solution that you guys have, or none, so I'll just add a "it's not possible" section is the API documentation
I don't have access to the consumer's code, I'm not the consumer, I'm the the library
Ah I guess just donโt do it sync
I mean it also depends on what you count as "main thread", or rather, on what the consumer considers as main thread
maybe they have their own task scheduling system
I'd advise taking an Executor as "mainThreadTaskDispatcher" or something, whatever
It may or may not fit all solutions.. but hey it's as flexible as you might get it to be 
how can I get a reference of that amazing thing?
makes sense, thanks for sharing your knowledge
let me rephrase
you take as parameter somewhere an Executor that would do the job, and is provided by the client
I see, but I think annotations can't have Executor as parameters, I guess, so all async it'll be
since the method itself is not even invoked by the client's code, I would have to provide the executor myself, which would bring us back to the first issue
I mean there's an annotation processor somewhere which is triggered by the client somehow
right?
Reflections (https://github.com/ronmamo/reflections) doing its dark magic
when the client uses Config.getConfig(Class), it'll trigger the load of all those classes, which will make his stuff get scanned and filtered by the presence of the annotation
I guess I could add another annotation for a method that provides the executor of the main class, but I just can't be arsed
100% agree with that
yes
Is there an easy way to make stackable items un-stackable? I tried some NBT-tags but had no luck
yeah so long as they have different NBT it should be fine
different NFT
don't mind me just right click saving all your NBT tags
lol
Yeah, I have a config file which I load an ItemStack from. There is an option to make it unstackable. So everytime that item generates it should not stack if the option is on. So, what NBT tag shoul I use? Or do I have to use a custom one and generate a randon int or smth?
PDC?
Ahh, ok
d;spigot ItemMeta#getPersistentDataContainer
@NotNull
PersistentDataContainer getPersistentDataContainer()```
Returns a custom tag container capable of storing tags on the object. Note that the tags stored on this container are all stored under their own custom namespace therefore modifying default tags using this PersistentDataHolder is impossible.
the persistent metadata container
Thank you!
np
Well, I got the Spigot 1.18 API down, but now there's a few things that aren't there, like ChatColor, ChatMessageType, and TextComponent
What do we use instead?
Bukkit (which is in Spigot) should have ChatColor package ๐ค
but I know earlier was BungeeCord ChatColor package used for HEX so maybe
isn't bungee api transitive in spigot api?
I figured it out, I was using just the normal "spigot-api-1.18.1-R0.1-SNAPSHOT.jar" when I need to use "spigot-api-1.18.1-R0.1-SNAPSHOT-shaded.jar"
And yes, the bukkit ChatColor was there, but I'm using the Spigot ChatColor
Err you should really be using a build tool like maven or gradle
Why won't intellij let me create java classes and packages ๐ญ
and none of the things are being auto completed
how exactly won't let
error msg or something?
Cannot run program "C:\Users\mavxyz\.jdks\corretto-15.0.2\bin\java.exe" (in directory "C:\Users\mavxyz\AppData\Local\JetBrains\Toolbox\apps\IDEA-U\ch-0\213.5744.223\bin"): CreateProcess error=2, The system cannot find the file specified
I tried using openjdk and it still didnt work
well the InteliJ is trying to use java but Java is not existing in that location
(Java that use in that project)
but I downloaded it through intelij
when you go to C:\Users\mavxyz\.jdks\corretto-15.0.2\bin\ is java.exe there?
yes
try to restart InteliJ then
alright, its indexing the jdk
okay, nice ๐
omg, it worked! thank you so much ๐ญ โค๏ธ
๐
to serialize spigot objects (specifically ItemStack) outside of the spigot config, can I just use #serialize and #deserialize on them? and on the result of that I deserialize the values if it is an instance of ConfigurationSerializable and if so, repeat
since there are so many different types of items
(using gson btw)
fun ConfigurationSerializable.serializeSafely(): Map<String, Any> = serialize().map { (key, obj) ->
if (obj !is ConfigurationSerializable) {
return@map key to obj
}
return@map key to obj.serializeSafely()
}.toMap()
```maybe this could work?
uh
idk about deserializing tho ๐ฅฒ ๐ฅฒ
anyone know what i could do? (serializing bukkit itemstacks)
You're better off making your own methods. (It also won't save NBTTags.)
I couldn't get it to but I was parsing as json.
And what do you mean by that lmao isn't there a static method, deserialize(Map) or smth?
d;paper itemstack#deserialize
@NotNull
public static @NotNull ItemStack deserialize(@NotNull @NotNull Map args)```
Required method for configuration serialization
args - map to deserialize
deserialized item stack
Myes
well i could do it how spigot does it - reflection - wait
i just spent an hour converting the above gist to kotlin ๐ฅฒ ๐ฅฒ ๐ฅฒ so if that doesn't work then idk
wait
does it use reflection?
wait no
yes
yes
it does
POG IT WORKS
well
i used a fork of that
and had to adjust it
but
after 2 hours of changing the code i got it
lol
So basically... I made a private <class>, that imports the class without making the imported class's one void's static. That is fully okay, right? Well... lpb.createMenu(player); doesn't works for some reason. I mean, I am working with GUIs right now, and for some reason, the main menu doesn't opens the profile menu, and if I import each other into both classes (aka Profile is imported into the main menu, and the main menu is imported into the profile, because it has a back button), it just crashes the plugin. It will not be able to run, and I already ran out of ideas of what could possibly make this error. Fun fact: the editor shows no errors.
The private import looks like private LobbyProfileMenu lpb = new LobbyProfileMenu();
The event looks like
@EventHandler
public void onInventoryClick(InventoryClickEvent e) {
InventoryView inv = e.getView();
Player player = (Player) e.getWhoClicked();
if (inv.getTitle().equals("Jรกtรฉkmenรผ")) {
e.setCancelled(true);
int slot = e.getSlot();
if (slot == 45) {
lpb.createMenu(player);
}
if (slot == 48) {
player.sendMessage("this message tells the player that they are already in the lobby, but this one, and the closeInventory one below also works.");
}
if (slot == 50) {
player.closeInventory();
}
}
}
(also, the private import is at the top of the class)
Looking for useful libraries/frameworks?
Here are some which have been deemed useful by the community and are used daily.
-> Menus: https://mf.mattstudios.me/mf-gui/gui
-> Commands: https://mf.mattstudios.me/mf/mf-1/getting-started
-> Messages: https://mf.mattstudios.me/message/mf-msg
-> Config: COMING SOONโข๏ธ
Aaaah damn. I do not understand gradles.
??
Understand what?
Gradles
Sadly not. Gradles are hard to me.
Whats gradles?
These build.gradle files
After almost a decade of people asking for persistent stats, I made an "addon plugin" for MobArena that just collects and writes some basic stats from all sessions into a database. Naturally, people want to see these stats, but the age old problem of exposing the data for arbitrary queries comes up, and some of the requested queries are hyper-specific to one server. I figured the right solution would be to give server owners a way to just write whatever queries they want instead of making me implement - potentially hundreds of - one-offs. Is that a thing in PAPI land? Is there an expansion that allows server owners to write arbitrary queries for a target database?
... or can I not expect to have "server owners writing their own queries" and "positive results" in the same sentence? xD
Yikes
I mean, that was the "failure" of SQL after all. The people it was targeted at didn't actually start using it because it wasn't as "human friendly" as they thought it would be. No offense of course ๐
There's the mysql expansion but idk if it works
Ohhh
But I assume that nothing stops you from executing a query received as argument from a papi placeholder
Just sanitize it or whatever the process is called and I guess you are fine
I would personally make a config where they can define placeholders that are basically queries identifier by an ID.
queries:
kills: SELECT ...```
And then `%mobarena_stats_kills%`
Yeah I thought about that exact approach but from a more general perspective. So not specific to the stats addon.
Could work imo
I think I also dug myself into a bit of a hole with the way I split things up. The stats addon is a separate plugin, and the PAPI expansion is its own thing as well. So to make it work in the current structure, I'd need to expose some sort of querying API in the stats addon that the expansion could use. But I think I'd rather go a bit wider and aim for something more general that others could make use of.
A smal suggestion, if you can make a longer query for showcase, show them this yaml trick
example: >
SELECT .. FROM ..
WHERE .. AND ..
JOIN ...```
Basically that `>` will turn new lines into spaces.
Ah yes! I've used that for some gnarly stuff before. Thanks for the tip ๐
I think it is worth.
This would be perfect for servers that want to add specific things
Yeah, the whole thing sprung up because I added like a "total kills" stat, but then someone wanted "total kills this week", etc.
Plus, sql is easier to learn than java ๐คทโโ๏ธ so they can make their own things pretty quick
Who doesn't want to query every time a placeholder is parsed
Yeah caching would be necessary ๐
Thanks for the input! I'll see what I can find time for when Christmas rolls around ๐
Garb :0
Hi,
I'm trying to save block data (basically just block name) around the player in chunk, 8 blocks up, 8 block down
Let's say player is on Y 63
That means I want to save data of chunk from Y 55 to Y 71
What is best way to do that? (no WorldEdit)
just have a loop and write, those few blocks aren't really that severe
Hey....just want to know whether this thread is still relevant with 1.18
https://bukkit.org/threads/important-information-regarding-cancelling-creature-spawns.147007/
Please ping me when replying๐
So u are saying it should be fixed?
Look at what worldguard does
How would i loop through a config list and do something for each UUID thats in it? i tried the following code but it won't work:
List<String> il = new ArrayList<String>();
ItemStack skullI = new ItemStack(Material.SKULL_ITEM, 1, (short) 3);
SkullMeta im = (SkullMeta) skullI.getItemMeta();
im.setOwner(String.valueOf(Bukkit.getPlayer(uuid)));
im.setLore(il);
im.setDisplayName(Format.chat("&6" + p.getName()));
skullI.setItemMeta(im);
inv.setItem(0, skullI);
}```
Also the for loop is giving this error: https://paste.helpch.at/vevuzobuve.cs
My List looks like this:
203211a5-56e8-47ef-8d7d-07c306ebbd9e: 163974
uuidofplayer2: 25584
uuidofplayer3: 25894
uuidofplayer4: 589584
fixed it, changed the config from uuid: 0 to uuid.amount: 0
So i got some more questions about domains:
- i actually want my own mail domain, is there a site you guys recommend?
- Is buying a site domain on google domains the smartest move?
is particle BARRIER replaced in 1.18?
they are not particles anymore. they're called block markers. so far we have barrier and light block
well
there's a particle called block_marker rather
fun make that work with older versions too :/ Trying get 1.18 but my idea only want use 1.16 as source :/
run gradlew licenseFormat
well the fun part is that you can display any block texture using block marker
will see how that workยดs when I get my idea work as I want ๐ Ether way I need suport for lower versions too.
just use Particles.valueOf and try catch. if it doesnt find Barrier, it means you have to use block marker.
I use Enums#getIfPresent() and that are nice way to solve the null issue ๐ but I use barriers as default if enums are null. Ether way I have to see If I can even get it load 1.18 api it are stuck on 1.16 still lol .
and for build, i click "shadowJar"?
yes
okay
Is creating an Asynchronous task everytime a block is broken bad?
private void runEnchants(BlockBreakEvent e){
Bukkit.getScheduler().runTaskAsynchronously(instance, () -> {
for(EnchantBase enchant : enchantStorage.getEnchants()){
enchant.handleBreak(e);
}
});
}
Like this? Or does anyone have better way?
it's not inherently bad but... what does that do and does it need to be done async? also keep in mind that any attempt at cancelling or modifying the event is futile, as the task will fire one tick later
yeah. what does EnchantBase#handleBreak do? Sounds like it should be done sync otherwise bad stuff might happen
I try hoppers and that was no a good plan (look cursed) ๐

pretty pog socket system that i've made and integrated it into my player auctions plugin for cross server support https://img.olziedev.com/742sVj742tv742_r742_.png
Might also add redis support as well in the future for you redis users as well
Who can explain me this? required: String,List<subcommandinfo>,List<subcommandinfo>,String found: String,List<subcommandinfo>,String reason: actual and formal argument lists differ in length
the method you're trying to use takes in 2 strings and 2 lists while you're giving it 2 strings and one list.
public commandsinfo(String name, List<subcommandinfo> subcommands , List<subcommandinfo> compiler, String usage) this is class for it ๐
How? ๐
i am using two strings and two list ๐
The error literally says whats wrong
Ye but in public commansinfo there is the all statments
what
the method takes a string, two lists and another string
you're passing it a single list
How can it be single list?
Show the code where you're using it
@Command("mightyclass")
public class commands extends CommandBase {
public commands() {
main.commandarray.add(new commandsinfo(
"mightyclass",
List.of(
new subcommandinfo ("help","123","Get command help"),
new subcommandinfo("create","name","create your class")
),
"/mightyclass [subcommand] [compiler]"
)
);
} ```
There's only 1 list there
You have new commandsinfo(String, List, String) there
You need to give it another list
i am giving up ๐
programming isn't for everyone, don't feel bad, there's nothing wrong in giving up
public void onInventoryClick(InventoryClickEvent event) {
Player p = (Player) event.getWhoClicked();
p.sendMessage("2");
Inventory inventory = event.getInventory();
ItemStack clicked = event.getCurrentItem();
if (clicked.getItemMeta().getLore().equals(ChatColor.GREEN + "" + ChatColor.BOLD + "ยงaReinforced Rune")) {
p.sendMessage("1");
if (p.getItemOnCursor().equals(Material.IRON_BOOTS)) {
p.sendMessage("3");
}
}
}}
Why wont it work?```
Youโre better off using redis
If youโre learning networking tho itโs whatever
RabbitMQ ๐
i did mention redis
.
Ik imo shouldโve added redis support before making your own sockets.
You do you tho
yeah, redis pub/sub (I assume that's what you'd use) is quite sophisticated as opposed to your own ducttaped mq
Rabbit these nuts mq plur
๐
hardest question ever asked here
How would you go about creating some algorithm which once a command is ran, it randomly creates a shape like this on the ground?
I know it consists probably of three loops (one for each X Y Z coordinates) but like
How do I have it get a shape like that, without having weird floating blocks?
๐ณ
hey there, when I open an inventory inside of an InventoryClickEvent, the event basically stops working until i relog. any ideas?
the event stops firing?
yeah
๐ค did you try putting a print statement at the very beginning of the method?
hm
what if you close the inventory before opening the inventory?
e.getWhoClicked().closeInventory();
new BukkitRunnable() {
@Override
public void run() {
EnchantInventory enchantInventory = new EnchantInventory(null);
enchantInventory.loadMenu((Player) e.getWhoClicked());
Inventory inventory = enchantInventory.openInventory((Player) e.getWhoClicked()); // Opens the inventory
inventory.setItem(12, item1);
inventory.setItem(10, item2);
inventory.setItem(14, EnchantInventory.BookForEnchant(new Explosive()));
inventory.setItem(15, EnchantInventory.BookForEnchant(new Explosive()));
inventory.setItem(16, EnchantInventory.BookForEnchant(new Explosive()));
cancel();
}.runTaskLater(plugin, 1L);
this is what I'm doing
Someone knows how to hook your plugin with some cron thing?
I want to make a schedules plugin
Noise?
I stole the code for minecraft explosions and I am altering it

works like a charm huehue
have you figured this out?
nope
yeah was just curious since ive previously had this issue before and wanted to see if anyone had helped with a fix yet
Use quartz schedule library
What is on ur Main.class specifically 13th line
can anyone help pls? https://paste.helpch.at/xakavakoqu.sql
String prefix = (plugin.getConfig().getString("Prefix"));
Couls u show the entire class...
So... The issue is you are calling the config even before its getting intialized or saved
o
@night ice https://paste.helpch.at/ijiyoribey.java
I have to do it like that
?
public class Main extends JavaPlugin {
private Plugin plugin;
private String prefix;
@Override
public void onEnable() {
new Gamemode(this);
new Creative(this);
new Survival(this);
new Spectator(this);
new Adventure(this);
new PlayerTeleport(this);
new KBStick(this);
saveDefaultConfig();
prefix = (plugin.getConfig().getString("Prefix"));
System.out.println(Util.chat("Core enabled"));
}
@Override
public void onDisable() {
System.out.println(Util.chat("Core disabled"));
}
}
Here the issue would be like...the prefix would be only be accessble inside the onEnable Method...which might not be ideal most of the times...
try it and let me know
which line is line 25
prefix = (plugin.getConfig().getString("Prefix"));
can anyone help pls? https://paste.helpch.at/xakavakoqu.sql
so put this there instead of plugin
Oo.. My bad...I didn't notice that
what's on Pasters.java line 36
@night ice @dusty frost Very thanks it is working now! โค๏ธ
Also... If u are gonna use the plugin anywhere else.. Its safe to point plugin to the class...
plugin=this;
everything used to work
The error comes from that line... So.. Its better u should ask the dev of the plugin IG
oh yeah I thought that was your plugin lmao
hm
you're in #development after all
Hey, is anyone where good with CSS and HTML, I ran into a problem that my media print rules are getting overwritten and I can't style the print view of the website. I'm out of options :/
@night ice Can u help me with this please
getServer().getPluginManager().registerEvents(new JoinEventVanish(this, this));
this line is giving error
ok
The method registerEvents(Listener, Plugin) in the type PluginManager is not applicable for the arguments (JoinEventVanish)
@night ice
getServer().getPluginManager().registerEvents(new JoinEventVanish(this), this));
the comma
@formal locust .
o
import me.xylo.hgstaffutils.Utils.Util;
import me.xylo.hgstaffutils.commands.gamemode.*;
import me.xylo.hgstaffutils.commands.knockbackstick.KBStick;
import me.xylo.hgstaffutils.commands.randomteleport.*;
import me.xylo.hgstaffutils.commands.vanish.JoinEventVanish;
import me.xylo.hgstaffutils.commands.vanish.VanishCommand;
import java.util.ArrayList;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.java.JavaPlugin;
public class Main extends JavaPlugin {
public ArrayList<Player> vanished = new ArrayList<>();
private Plugin plugin;
private String prefix;
@Override
public void onEnable() {
new VanishCommand(this);
new Gamemode(this);
new Creative(this);
new Survival(this);
new Spectator(this);
new Adventure(this);
new PlayerTeleport(this);
new KBStick(this);
saveDefaultConfig();
prefix = (this.getConfig().getString("Prefix"));
System.out.println(Util.chat("Core enabled"));
}
@Override
public void onDisable() {
System.out.println(Util.chat("Core disabled"));
}
}
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.plugin.Plugin;
import me.xylo.hgstaffutils.Main;
public class JoinEventVanish implements Listener {
Main plugin;
public JoinEventVanish(Main, this) {
this.plugin = plugin2;
}
@EventHandler
public void onJoin(PlayerJoinEvent e) {
Player player = e.getPlayer();
for (int i = 0; i < plugin.vanished.size(); i++) {
player.hidePlayer(plugin, plugin.vanished.get(i));
}
}
}
the code is wrong
you can't assign this there...it will point to the same class..moreover, there is no plugin2
o
this is JoinEvent vanish
public class JoinEventVanish implements Listener {
private final Main plugin;
public JoinEventVanish(Main plugin) {
this.plugin = plugin;
}
@EventHandler
public void onJoin(PlayerJoinEvent e) {
Player player = e.getPlayer();
for (int i = 0; i < plugin.vanished.size(); i++) {
player.hidePlayer(plugin, plugin.vanished.get(i));
}
}
}
hidePlayer and showPlayer is also asking hidePlayer(Player)
but i made it plugin, player
d;spigot player#showplayer
void showPlayer(@NotNull Plugin plugin, @NotNull Player player)```
Allows this player to see a player that was previously hidden. If another another plugin had hidden the player too, then the player will remain hidden until the other plugin calls this method too.
plugin - Plugin that wants to show the player
player - Player to show
Yeah...this is it...the other method is deprecated right?
yeah...it would pass the plugin inside the code...Mostly for encouraging users to use the new method
Yup
Hey a bit of mathematical doubt...
I would like to create a bounding box like this...i have the mid point and radius that needed...so anyknow how to get other 2 points?
radius?
like...the bounding box should have a size right?
what measure do you have exactly?
because radius is probably the most inadequate term for this lmao
I can get the mid point of the rectangle...
you can?
means...i would xD
you can't
i only have the location where the entity will spawn...i want to create a bounding box of where the entity got spawned as the mid point or centre
so you only have the center
yeah
then where does the size come from?
its configurable...
so then it is known
apparently yeah
1. get center
2. get coordinate 1:
i) add "radius" to x component of center
ii) add "radius" to z component of center
3. get coordinate 2:
i) subtract "radius" from x component of center
ii) subtract "radius" from z component of center
4. u have 2 corners, make a bounding box with them```
sorry i'm an asshole
absolutely

