#help-development
1 messages · Page 1763 of 1
they use a packet system to send wrong ores to the client
i think that is the most advanced system ngl
thats how every basic anti xray system works
is it possible to make sure every player who joins the server gets teleported to the end or the nether? I was thinking about an idea where the "lobby" is located in another dimension and when you click the npc you get teleported to your logout location in the overworld
wait i thought all anti-xray use the check if players can find the ore fast then ban...?
yup sure is i just checked
lol...
that would be an even more basic anti xray
hmm but maybe they did some more advanced improvements for that
thats more xray detection than anti-xray
Yeah
i would say anti-xray stops it before it happens and xray detection tries to detect it as its happening and stop it
yeah
Could probably use PlayerLoginEvent or the PlayerJoinEvent
that is what anti means in the first place
some do it with light levels or look at how 'lucky' people are getting so like how many stone they mine per diamond they find type thing
but anti-xray has always basically obfuscated blocks to the client pretty sure
xray detection is mostly bullshit
i mean what if i am getting lucky and find 3 diamond ore sources
ore obfuscation can easily be got around by xray'ers by knowing the world seed
and then there is this xray detection
yeah
if you have the world seed you know where the ore is regardless of what packets the server sends your client
have to wait 3 hours to mine my diamonds
but wait, is oreobfuscator even work or even got updated in the past 3 years?
yeah i think maybe you can find the server seed somehow 🍭
it says 1.17 on the spigot page @quaint mantle
oh hmmm ok...
i thought the dev abandoned it
if i remember right they said it was 2012
they start in
i have not used it since like 1.4 or something but im sure it works the same as it did before
its very server resource intensive if i remember correctly tho
not sure if they ever improved the efficiency of it or not
Me who started the argument...
wait is that you?
i only see that guy above say dont generate
so i start it
oh lel
🥲 yes its me
@soft dragon why do you change your discord name every 5 seconds
No im not
I cant change my nickname
and my name is still NotHappyMan
whats the difference between the PlayerChatEvent and the AsyncPlayerChatEvent?
is the normal one not able to catch all the messages?
I have a cannot find main class error
one is sync and other is async
How to fix?
yes
the async one also implements cancellable
I need help
maybe it removes the message then
it just blocks the message i guess
Yes
or application
ok
check if you put the full path to your class
and check if it extends JavaPlugin
Don’t think so
Ok cool
Example?
src // source directory
- main // source set
- java // java source set
- com // actual package start
- example
- test
- Test.java extends JavaPlugin
``` if you have this, the full path will be `com.example.test.Test`
because src/main/java is the source set
and everything after that is your package
just seperate all the package folders by . and then add .<classname>
Thanks
np
maybe consider using intelliji with minecraft development for it
it will create most of the necessary things for you
private static float getPitch(Player player, Location loc){
Double distance = player.getLocation().distance(loc);
int change_pitch_per_blocks = 1;
if(distance>minimum_distance_trigger){
//nothing
}else{
float i = 0;
while((int)ceil(distance) < minimum_distance_trigger){
i++ // the pitch
distance+=change_pitch_per_blocks;
player.sendMessage(Integer.toString((int)i));
if((int)ceil(distance)>minimum_distance_trigger){
return i; //pitch
}
}
}
return 1.0F;
}
``` Anybody know what may be the problem in this func? I'm working on something that plays a noteblock harp sound with a specific pitch representing how far a player is from a particular location. This function returns the specific pitch, but for some reason, it's just giving 2 pitches. One of the pitches is 1.0F
and minimum_distance_trigger is a integer equal to 16
maybe an ore randomizer?
i mean at that point you're talking about randomizing the word generator
from what im reading you are just playing a higher pitch with more distance right? why do you need the whole while loop?
and the first if distance>minimum distance trigger seems wrong? that statement would make sense if it was a max distance trigger
maybe he knows what he wants to do but he dont know what to do it...
i guess
I made a plugin that sets a random spawn point on respawn event. But how would i also set the random spawn when the player first joins the server? I cant find an event for it
PlayerJoinEvent? (Check is first join on player)
does it matter if its their first join if you are resetting it each respawn?
there's a certain range where the pitch would start playing, so if the distance of the player and the location is greater than that specified range, it will not give you the pitch since its over the range...
minimum distance trigger = the required minimum distance for the pitch to start triggering/playing
ah okay minimum to me reads if x < a then dont trigger
so is pitch 1:1 with distance?
i.e 1 block away = pitch 1, etc etc
yup
so why not just return ceil(distance) as pitch?
and then an if statement to check if its in bounds
there's a max pitch right?
I'd assume so
90
the max pitch?
thunk so
hmm ill try this out, thanks!
i didnt realize this at first, i thought the ceil of distance might surpassc the max pitch
thanks, would try
hey, i made my scoreboard refresh every 20 ticks, but the problem is the scoreboard disappear and appear again. code:
new BukkitRunnable(){
@Override
public void run() {
for(Player player : Bukkit.getOnlinePlayers()){
board(player);
}
}
}.runTaskTimer(this, 20, 20);
}```
any fixes?
refreshing online players every second seems kinda over the top
so what should i do?
my hub server is 50gb so i see no problems of refreshing the scoreboard every 20 ticks..
just seems kinda overkill to refresh once a second thats all i was saying if you see a need to do that then whatever
k any fixes for my problem?
what is board();
not super familiar w/ scoreboards but before you edited it you were just creating it ever 20 ticks
you just give us a generic runnable we cant tell anything from it
board is my board...
public void board(Player player) {
yes but can we see the code?
the scoreboard isn't the problem
the problem is the runnable
imma just change it to 4 secs
hes asking to see the code for your method board()
ooh
okie 1 sec
i can't send it
i dont have nitro
-393 words
?paste
maybe try to see how titlemanager reloads without flicking?
other board flicking while titlemanager not
wdym
like instead of having to make a new board each time the method is called, just store it as a variable somewhere instead
orelse that method is going to hog a lot of mem
but that variable isnt going to refresh the scoreboard?
wdym?
yeah
imma try that.
wait uuh
if i used player.setScoreboard(player.getScoreboard()); will it work?
i'll try it 1 sec
just use a hashmap and use HashMap#getOrDefault()
okie
is it possible to teleport the player to the nether or the end on join without showing that nether/end screen
nether/end screen?
well the screen that shows un when loading the new world
didn't work
can we see how you tried it
I very much doubt it, not without a resource pack
im feeling like you dont really know that they need to load the world?
even then i think not
wait i have a question, if i updated 1 score without updating the full scoreboard, will it stop flicking?
well just instead of teleporting to the overworld on join, teleport to the end
load screen
prob
let me find that again
yeah most likely
give it a try im not 100% sure, havent worked with scoreboards in a while
okie 1 sec
yeah this
i hate those suckers
@tardy delta that reply above
wait uuuh how to update per line ; v ;
player.getScoreboard().getScores()?
getscore*
To all using scoreboards, use packet scoreboards. More easy to use, do not flicker in any way and really efficient.
Best Thing you could use for that in my opinion is fastboard https://github.com/MrMicky-FR/FastBoard
hehe
private static final String[] COLOR_CODES = Arrays.stream(ChatColor.values())
.map(Object::toString)
.toArray(String[]::new);
for an Enum use .name() over toString()
That toString doesn't return the name of the enum, it returns the color code e.g. §7, so it's just fine.
no but i think they want to get the color code
^
it would be oddly pointless to just have an array of color codes with no reference
the whole thing is wierd
Yes, I would agree, but thats not the point here.
maybe hes trying to create a rainbow effect or something?
cycling through the colors
in that case it would be a much better method than manually entering everything
Yea sure but the ChatColor enum isn't sorted like rainbow, am I right?
correct
Why it is not working?
if (vaultHook != null) {
format = format.replace("\\{prefix\\}",
vaultHook.getChat().getPlayerPrefix(player));
format = format.replace("\\{suffix\\}",
vaultHook.getChat().getPlayerSuffix(player));
}else {
format = format.replace("\\{prefix\\}", "");
format = format.replace("\\{suffix\\}", "");
}
format = format.replace("\\{player\\}", player.getName());
format = format.replace("\\{message\\}", message);
return format;
Doesn’t look like Java regex
Or well are you trying to do some regex thing?
Then replaceAll would be what you need
Else you probably just want to remove the \\
Yea FastBoard is a really great Framework to do that. https://github.com/MrMicky-FR/FastBoard
no component support ☹️
What do you mean?
Exactly
Oh I see, yea than you have to use Spigots Scoreboard Framework I guess
Have you heard about chat component api
Do you mean kyori adventure or what its called?
minecraft itself has text components
Both work. Adventure is cross platform
net.md_5.bungee.api.TextComponent?
aha
oh
I mean you cant use HoverEvents or so in a scoreboard either way so you want to use the Components to build a String am I right?
so its formatting and text building
What about translatables
kinda like a wrapper for minecrafts text components
Ah okay I get it
Yea than I have no clue if this is even possible with the normal Scoreboard thingy
definetly possible. Teams prefixes/display names/suffixes are components
everything in minecraft is a text component
well all text
everything is sent and received as a component
Okay, I think FastBoard doesn't support this so you have to build a workaround or use the teams thing
doesnt fastboard works using teams
Uhm
interesting resource
we know right
there are only 2 packets
You have to build a workaround which manages the translatables and shit and provides just a string to be inserted in the scoreboard
Fastboard does nothing but converting strings to components in order to send it with packets
Was looking at wiki.vg 🤷♂️
if you use entries only your scoreboard will flicker
That's the packet component not a text component?
Nvm
CHAT_COMPONENT_CLASS = FastReflection.nmsClass("network.chat", "IChatBaseComponent");
net.minecraft.network.chat.IChatBaseComponent
thats what i meant
by minecraft text component
Yeah they exist in vanilla
Ill probably just code my own sb library
when i add this to my main class, the plugin won't enable
wait
let me send error
hikari will not exist at class instantiation
do it in onEnable
what do you mean
if it doesnt exist
as orby said, set it in onEnable
ok wait
and don;t use static
getters
shadowJar ed hikari
what version of Spigot are you using?
good luck
what
im sure he is about to explain why 1.8.8 is bad and you should use 1.17.1 on your test server
I don;t support 1.8
plugin api 1.13
server 1.8.8
I don't even know what this means
but yeah 1.8 hasn't been officially supported for about 5 years now
So you want to use 1.13 blocks in 1.8? haha
so no one can help me ?
im not using blocks
yea I know it was a joke
but you should notice yourself, that server 1.8 and plugin 1.13 won't work
why it worked for me till now
I mean Spigot has backwards compatability but if you're using an 1.8 server you should define the 1.8 api-version too
It will work until you use something that was added in 1.9 - 1.13 lol
Or removed for that matter
im using 1.13 cause particles
and if there is no particle class it will use reflections
is there any ParticleUtil class thing that uses reflections and supports all versions ?
so i could use 1.8 api
Not sure tho but I think EffectLib by slikey does
Let 1.8.8 die
How can I get the message from an AsyncChatEvent. When I use event().message() I only get the component, but how can I get the actually content as a String? Im on 1.17
thats not a Spigot event
omg sorry, i forgot that Im working with paper sorry
PlainComponentSerializer
Thanks
How can I get the item tag (the gray text) from an ItemStack?
And also from custom plugins?
Because I want to get the namespace
Plugins can have items like pluginname:myawesomeitem
You can
Also with mods
Ok so getType().getKey()?
Yes
Thank you!
Plugins can't add new items though, so long as that's clear
Mods can, plugins cannot
(though Bukkit doesn't run on modded servers)
But the problem is that I am working with mods
My friend asked for a Spigot plugin on his modded spigot forge server
Yikes. Good luck
tell your friend that he should move to a proper server software like spong
Ok but he will not listen
so write it to him, then he have to read
You can use p.spawnParticle ( Added 1.9 )
the first i believe
any reason?
because its orange and i like orange 🤤
I mean they're effectively the same thing I'm pretty sure
I don't think it really matters
Yeah, it's mainly just kinda up to whichever one you think looks better 
We do like orange 
I believe so
it should not
they can respawn
There's PlayerRespawnEvent for that
Latter is imo somewhat more concise yet reads better though the trade off is an additional method call as mentioned above
i always trying to avoid the ugly ->
@ivory sleet hello can u help me?
just ask
https://easyupload.io/z09s8o hello can i sent someone who knows good from plugins and tell me what plugin lags my server? the spects of the server is 100% fine but a plugin is the problem
the file is the error file
can someone check and tell me?
?paste
paste it here
how i sent u the link wtf
paste it in the paste thingy, save(on the top right), then send the link into here. it updates when you save
log is probably too big
yep
fair enough
drop file in chat
no thanks
I dont like downloading files from places I dont know
honestly why the log file tho... what plugin are you using?
drop the file in chat. See if it works
If its just a text file upload it to discord. Discord allows us to read .txt files
not on mobile
I'm not on mobile
do u see this server allows to upload shits?
i dont
Verify
verify
ok
!verify
Usage: !verify <forums username>
https://mclo.gs/ use this
Easily paste your Minecraft server logs to share and analyse them.
There is insufficient memory for the Java Runtime Environment to continue.
Also I think you can copy the text paste it in discord and just click upload as txt or what ever.
memory leak
what plugins are you running?
add more memory
welp, then your 4 gigs or whatever wont cut it
cant tell you
i will try different size and i will see if that work
yeah ive been trying to get that too lol
guys my plugins for old setups i have 1.8 when i am updating to java 16 they won't work and when i am back o 8 java it work
lol
what can i do for that?
java 16 I think doesnt work for anything below 1.17
It works for 1.16.5
so there is no way?
all plugins should work for the version your server is on...
Isn't java16 backwards compatible?
wdym ?
possibly, my local 1.16 server told me no tho
just make sure the plugins you have support your server version
Well I use java 8 for my plugins and java 16 for my server with no issues lol so IDK
how?
u have 2 different install javas?
Yes but I'm talking about my plugins specifically. (The ones I made)
He means he builds for 8 but runs 16
^^^
make sure all your plugins support your server 1.16.5
install java 16 when i want to run server 1.17 and then uninstall it and stay with java 8 when i am running 1.16 versions and below?
pretty sure I saw a 1.16.5 mentioned in that log
He wants to update to 1.17 I think
yep
If the plugins don't work on 1.17 contact their authors
but i want also to can run my older setups servers
Keep multiple java installs
why mojang made it like that
And run the server using the direct path to the install
and will it work? did u test it?
yes it will work
oh ok
Not everyone lol
then i saw u from spigot user
I doubt it
I mean I play on some servers as well
can anyone give me example what to put in the .bat
for that
C:\pathtojava\bin\java blah blah
this is my current
@ECHO OFF
SET BINDIR=%~dp0
CD /D "%BINDIR%"
java -noverify -Dfile.encoding=UTF-8 -Xmx8G -Xms8G -jar server.jar
PAUSE
is it good?
replace java with the full path
alr
so its like that
@ECHO OFF
SET BINDIR=%~dp0
CD /D "%BINDIR%"
C:\pathtojava\bin\java blah blah -noverify -Dfile.encoding=UTF-8 -Xmx8G -Xms8G -jar server.jar
PAUSE
not really
then
you need the actual file path to whichever java you want to use
C:\Program Files\AdoptOpenJDK\jdk-16.0.1.9-hotspot\bin\java -noverify -Dfile.encoding=UTF-8 -Xmx8G -Xms8G -jar server.jar would be mine
impossible to give a yes or no
maybe
@eternal oxide
i try it but it give me error in the console
'C:\Program' is not recognized as an internal or external command,
operable program or batch file.
Press any key to continue . . .
and i use this .bat
@ECHO OFF
SET BINDIR=%~dp0
CD /D "%BINDIR%"
C:\Program Files\Java\jre1.8.0_301\bin\java -noverify -Dfile.encoding=UTF-8 -Xmx8G -Xms8G -jar server.jar
PAUSE
How can I make it so the boat a player is in will face the same direction as the player (i.e. make the boat turnable with the mouse, not the A and D keys)
C:\Progra~1\ probably
use "
for the path
"C:\Program Files\Java\jre1.8.0_301\bin\java"
You would have to send steerage packets using teh players direction
[16:49:15 ERROR]: Could not load 'plugins/MoltenSR.jar' in folder 'plugins'
org.bukkit.plugin.InvalidPluginException: Cannot find main class `me.magma.moltensr'
at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:73) ~[patched_1.17.1.jar:git-Paper-338]
at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:153) ~[patched_1.17.1.jar:git-Paper-338]
at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:414) ~[patched_1.17.1.jar:git-Paper-338]
at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:322) ~[patched_1.17.1.jar:git-Paper-338]
at org.bukkit.craftbukkit.v1_17_R1.CraftServer.loadPlugins(CraftServer.java:419) ~[patched_1.17.1.jar:git-Paper-338]
at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:287) ~[patched_1.17.1.jar:git-Paper-338]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1217) ~[patched_1.17.1.jar:git-Paper-338]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:319) ~[patched_1.17.1.jar:git-Paper-338]
at java.lang.Thread.run(Thread.java:831) ~[?:?]
Caused by: java.lang.ClassNotFoundException: me.magma.moltensr
at org.bukkit.plugin.java.PluginClassLoader.loadClass0(PluginClassLoader.java:151) ~[patched_1.17.1.jar:git-Paper-338]
at org.bukkit.plugin.java.PluginClassLoader.loadClass(PluginClassLoader.java:103) ~[patched_1.17.1.jar:git-Paper-338]
at java.lang.ClassLoader.loadClass(ClassLoader.java:519) ~[?:?]
at java.lang.Class.forName0(Native Method) ~[?:?]
at java.lang.Class.forName(Class.java:466) ~[?:?]
at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:71) ~[patched_1.17.1.jar:git-Paper-338]
... 8 more
pls help
InvalidPluginException: Cannot find main class me.magma.moltensr
ik but how to fix?
use the correct path for your main class
can you elaborate? I haven't really worked with packets
Neither have I
oh
that is the files and code
I just know thats how others have done it
ty
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
Player p = (Player) sender;
if (command.getName().equalsIgnoreCase("stats")) {
Inventory inv = Bukkit.createInventory(null, 9, "§aChosse a player");
for (Player players : Bukkit.getOnlinePlayers()) {
ItemStack skull = new ItemStack(Material.SKULL_ITEM, 1, (short) 3);
SkullMeta meta = (SkullMeta) skull.getItemMeta();
meta.setOwningPlayer(p);
meta.setDisplayName("§e§l" + players.getName());
skull.setItemMeta(meta);
inv.addItem(skull);
}
p.openInventory(inv);
}
return false;
}```
Hey, the command works. But how can I find out if an item from this inventory has been clicked?
can you point me to how you've found out others have done it?
You could try the simple method. Not sure if it will work but vehicle.setRotation(player.getDirection().getYaw(), player.getDirection().getPitch()) In the move event for the player.
I'll try but not sure itll work
It shoudl but who knows with minecraft
you may want to maintain a -90 (I think) pitch
k
do we have a good tutorial on permissions here?
if its the exact same error you didn't update your plugin.yml or you didn't update your jar on the server
.
I need some help with mycommand
hi, can someone please tell me how to update 1 line on a scoreboard?
i want to update my rank line every 30 seconds
but i don't know how, so i update the whole scoreboard and it flecker
Heh this color scheme is cool
please elaborate or we cant help
I am
Thats why i didnt spam
Or
Ping anyone
It doesn't work
when did you set it?
wdym
where does yrou code run to set it?
its in my onPlayerMoveEvent method
show your code
Boat vehicle = (Boat) player.getVehicle();
Player player_ = event.getPlayer();
assert vehicle != null;
System.out.println(player_.getLocation().getDirection());
vehicle.setRotation(player_.getLocation().getYaw(), -90);
did you get teh sysout fine?
oih right
you set teh players location. yaw
you need his direction.getYaw()
all you did was set the boats yaw to its current yaw
oh ok
Yeah it's false
but there is no getDirection() method for a player
getLocation().getDirection().getYaw()
Hey, i got a problem with the block populator, if i try to set x/z to 0 or 15, the server just crashes :/ Thats why i use x = 1; x<15 right now ...
world.getPopulators().add(populator);
@Override
public void populate(final World world, final Random random, final Chunk chunk) {
for(int x = 1; x<15; x++)
for(int z = 1; z<15; z++)
for(int y = 1; y<64; y++)
chunk.getBlock(x,y,z).setType(Material.REDSTONE_BLOCK);
}
still doesn't work?
Boat vehicle = (Boat) player.getVehicle();
Player player_ = event.getPlayer();
assert vehicle != null;
vehicle.setRotation(player_.getEyeLocation().getYaw(), -90);
if your code is actually running then it should work
i'll put another print statement there to check
what about this is invalid?
The code is running fine
Read the full error
ok that helps
but the boat isn't turning
i still need help with these, if someone can help me that would be great, thanks
now it says cannot find main class
ooh so the PlayerMoveEvent doesn't get triggered when a player turns their head while in a boat
although I fixed that now it still isnt working
uuh
@eternal oxide how to resolve cannot find main class
hello im trying to use hikaricp and when the plugin enables,
[21:22:11 WARN]: SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
[21:22:11 WARN]: SLF4J: Defaulting to no-operation (NOP) logger implementation
[21:22:11 WARN]: SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
this will be logged in console
how can i fix this ?
i gone to the link it was not helpful
and im using gradle
You need to provide a slf4j implementation at runtime
how to do that
conclure i need help
i will try it
so just add it to dependency ?
Yuh
conclure?
With what?
Show me some code buddy
ok
is this normal ?
bruh i closed it down
Yeah maybe
Btw
You do use shadowJar right?
Such that you shade your dependencies
yes but it was 200kb before it
and there is no log in console about hikaricp
for example lp
logs
what does hikaricp have to do with it all
idk luckperms logged hikari stuff
Ask LuckPerms developers about that
Comclure Wdym
Ok
why is my boat not turning the same direction as the player?
Player player = Bukkit.getPlayer(uuid);
assert player != null;
Boat vehicle = (Boat) player.getVehicle();
assert vehicle != null;
Location location = vehicle.getLocation();
location.setYaw(player.getEyeLocation().getYaw());
vehicle.teleport(location);
you are teleporting it to teh Location after you set its rotation
you reset its heading when you teleport it
you store teh boats location in location, you set its heading, then reset it back to its old location
location contains a directional vector
and then you teleport it resetting the yaw
why does teleporting reset the yaw
location has a direction vector
yes
the direction is pitch and yaw
ok
Because a location contains yaw and pitch, so when you teleport the entity, the pitch and yaw of location overrides whatever pitch and yaw the entity may have had before
you are teleporting it back to its original location after you set the yaw. You wipe out the yaw change
don't teleport
ah
hmm
You could try setting the players direction to his eyeLocation().getDirection()
the boat should follow
hi, i figured out how to make scoreboard teams, but i haven't figure out how to create a scoreboard per player, i guess i need to make a hashmap but im not familiar with it and im new at java developing, so can i get some help pls?
i wanted to make the rank line, but i need to make per player sb..
is there anything else
that has lower size
cause its to big for silencing an error
?java
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
Also, you can just google it
public static Inventory inv = Bukkit.createInventory(null, 9, "§aChosse a player");```
```java
@EventHandler
public void onClick(InventoryClickEvent e) {
if (e.getCurrentItem().getType() == Material.SKULL_ITEM) {
e.setCancelled(true);
if (e.getClickedInventory() == StatsCommand.inv) {
plugin.getServer().getConsoleSender().sendMessage("yeah");
}
}
}```
why does the if function with e.getClickedInventory() doesn`t work?
it work, ty\
yes
1.12.2
in main class
pluginManager.registerEvents(new InventoryClickListener(this), this);
Can someone please explain me, how you can add a file to the classpath with code?
depends on the file, your use case and what needs access to it
i did
and i didn't understand anything
i was searching and trying for the past about 7 hours
"§e§l" + players.getName()
how can i split this string?
substring https://www.baeldung.com/java-substring
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
Is there any can’t find main class errors in here
show your plugin.yml
so wheres the error?
you either didn't rebuild or you failed to upload a new copy to your server
rebuild?
drop your jar in here
ok
thsi is source
this is not a project
it can;t find yoru main class because you've not compiled it
Ah
intellj
Ok
and package
K
that shoudl spam you lots of log text and spit out a jar
Ok
in a target folder
public static final String VERSION = "${project.version}";
```will this work with gradle
ive been working with gradle for like a year now but i still dont understand how it works
only the basics of the basics
why would you hard code the password?
i dont think theres really a way around this
access token or whatever would also be hard coded
otherwise you'd have to ship a resource with the jar
even if you retrieve it from a website, people could just http get it
what is needing to be protected if you are shipping the jar?
I'm not understanding why you are trying to protect anything
are you shipping some database with the plugin?
afaik no
what does afaik mean lmao
google it
as far as I know
as far as I know as far as I know
oh ok
but you can use something like blossom to replace tokens in source files during compilation
(gradle plugin)
afaik means afaik, afaik
You can just replace in the plugin.yml and then get that in code
oh nice
yeah but then it cant be final
Sure it can
In a player death event, if the killer hits them into the void and they die of the void, does the killer still get considered as the killer
or would it be the void
in vanilla the void iirc
Depends how long it takes
rip is there any way I can work around this?
hypixel uses a timer
So does vanilla
oh k
hm alright ig ill use some broadcast statements to see
Im using Vault Economy API, but it seems to not withdraw money from the player. No errors are throwed
https://pastebin.com/YjfPJ4Wp
How do I delete a world from the server? my current code: java Bukkit.unloadWorld(world, false); Bukkit.broadcastMessage("unloading world"); world.getWorldFolder().delete(); Bukkit.broadcastMessage("deleting world"); dont mind the debug broadcasts
unloading a world takes time, and you can not delete the main world
it is not the main world. and how long should I wait ?
its quite a small little map
only 25x25
if you have to delete it, start a repeatign task
keep checking until you manage to delete it
there is no specific time, its completely random
as you also need any file locks to be released
:/ multiverse doesnt have any issue deleteing when i use the delete command, im using basically the same code as the plugin uses so
¯_(ツ)_/¯
I've not looked at the MV source I'd expect it to be doing it async
all MV commands use Runnables
im seeing that right now, i should just loop until its delete, thanks
How can I change the 20/100 that player section of my server to say something like "maintance" I seen minemen do it when they are in maintance mode
I believe you might have to use packets for that
How so?
Im using Vault Economy API, but it seems to not withdraw money from the player. No errors are thrown
https://pastebin.com/YjfPJ4Wp
unsure whether api covers that
do you have a valid economy implementation?
ProtocolLib?
thats not spigot api tho
i copy-pasted the code present in the Vault API's README, in the main class and in the pom.xml
but yeah you could use that for packets
its not in spigot api
Oh I missread
you need something such as EssentialsX installed which provides a valid economy implementation
yes EssentialsX is installed
make sure you plugin load after EssX and Vault
which can be specified by defining those as dependencies in plugin.yml
can I add Essentials as softdepend?
probably yeah
depend:
- WorldBorderAPI
- Vault
softdepend:
- Essentials
if you use EssentialsX specify EssentialsX iirc
Whatever its called when u use /pl command
(case sensitive)
yes i did the /pl command before and it was only Essentials
nothing changed
well share your code, and not only one single method
help i am trying to launch 1.17.1 but it gives my this error i think is the java version i have?
that's the old launcher, microsoft afaik dropped support ages ago for it
anyways
seems like you're using an invalid jvm flag
i need to change this path?
no you install the new launcher or the newest launcher
Hi
it installs appropriate jdks for you
k
I have issues
for some reason, pp is null when it is returned from getProxy().getPlayer() java @EventHandler public void onPlayerJoin(PlayerHandshakeEvent e) { ProxiedPlayer pp = LobbySystem.getInstance().getProxy().getPlayer(e.getConnection().getUniqueId()); }
With my program

what are you using the proxied player for?
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
chances are you can use PendingConnection
also iirc no proxied player instance has been created when that event triggers
thus it returns null
to connect the player to a server, after that, I proceed to do this: ```java
ServerInfo sv = LobbySystem.getInstance().getRandomLobby();
pp.connect(sv);
alright
well, there is ClientConnectEvent, and PlayerHandshakeEvent, in the docs PlayerHandshake is when the users name gets given to the server
I will try those
username != ProxiedPlayer instance
alright, postlogin event worked, but now i am getting this error trying to connect to the server: [15:31:18 ERROR]: [riches_exe|/127.0.0.1:54539] <-> ServerConnector [LOBBY2] - encountered exception: net.md_5.bungee.util.QuietException: Server is online mode!
make the backend server LOBBY2 offline mode
since its going through the bungeecord proxy anyways
that worked
also
I want a item, that you can interact with and open a menu, then have a list of items, the lore being lobby info, and when you click on one it will send you there, is there anyway I can do this without Redis, and just through a bungeecord/spigot plugin?
in java, you cant have a method like that return 2 values, remove the MoltenSR for the command to work
start with learning Java, yes I sound like all the other Java programmers but seriously, it will help you progress further, just give it some actual effort more than a glance, then you can always come back here to ask if your interpretation of something is correct or incorrect
How expensive is adding, removing channel handlers
lol
from netty's pipeline
why would you need redis in the first place
redis doesnt have a suitcase there
its a cache :p
someone else said I would need that last time I asked
so send a message from a spigot plugin to the bungeecord one?
but if you want something more sophisticated, use something which is primarily made to be used as a message broker like kafka or rabbitmq
yeah
You need a player online to use messaging channels
Ty
are you doing this dynamically?
yes
yeah shouldn't be an issue here
What is <identifier>
as there will always be a player online on the lobby if he is going to use the lobby compass
Conclure?
?
Here
Ok
yes, i want to add channel handler to the pipeline whenever code needs to
is it bad to do that
learning java before trying to make plugins 
learning spigot plugins before java 
and instead add it whenever player joins
@twilit wharf?
hmm unsure, I'd ask someone like retrooper who spent quite some time regarding netty and that
but probably not an issue
i just want to save some performance regarding bukkit listeners
which i would anyway need to delete
since im doing packet level stuff
yeah
no clue
i don't want to search a key in the map every time an event fires
ok
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
gg learn basic java and it'll fix all your issues @viscid edge
@viscid edge there might be some free tutorials at code.org or code academy, there might also be some good youtube lessons.
the things you're doing show that you GLANCED over an image or smth and then went "ok, now I can make spigot plugins"
while having 0 idea what you're even doing
Search for a key or get the value from a key?
get the value i meant
this works fine
Map lookups are fast
I mean, very little
they're used only in specific instances
What type of map is it? A normal HashMap?
yes
its not a problem
im just trying to optimize my packet level thingy as much as i can
Hmm yeah well they may be slow
what kind of map do you suggest
I have to get the list of lobbies first, and for that I think I have to use the bungeecord api, which wont work cause it is a spigot server
so normal hashing doesn't work anymore
yeah
i've thought of this before
Isn't an identity map the equivalent of == over .equals
uses System::identityHashCode to compare
when i was developing on CPP
I guess I could use that for my registries
but it guarantees O(1) for things like contains
to use memory addresses as hash instead of object values
Actually no, namespaced keys aren't comparable with ==
that's really sexy
indeed
I dont how to approach this
So many types of maps
is there any plugin that can auto update the plugins that is outdate in the newest versions?
🥲
of course for not wasting my time doing it manuall?
I mean
I have a bungeecord plugin which puts the user into a random lobby on join, now I want a spigot plugin which gives the user a item on join and from there they can open a menu and choose lobby through a item that represents that lobby
who knows to tell me the name of the plugin ?
I think plugins with a /download command aren't the worst
But true auto updaters are risky
hmm I had one on my mind
whitch?
let me look it up
okay, so are you planning on making your plugin bienvirontmental?
okay
you will need one main class for bungeecord
one main class for spigot
then have the plugin.yml refering to the main class for spigot
and the bungee.yml for bungeecord iirc
so...?
ok
be a little patient
what about config, cause spigot and bungeecord have different ways of doing that? two config files?
Pro tip: tired of using slow SFTP servers, having no access to SSH and need to download big capacity files? Look no further than wget plugins on spigot.