#development
1 messages · Page 123 of 1
if (sender instanceof Player player) I don't think this is possible! Correct me if i am wrong
Java 14 pattern matching instanceof
I was on java 16 or 17…so doesn’t it have that tho?
Since event.setJoinMessage is deprecated, what do I use?
d;spigot PlayerJoinEvent#setJoinMessage
public void setJoinMessage(@Nullable String joinMessage)```
Sets the join message to send to all online players
joinMessage - join message. If null, no message will be sent
^
d;paper PlayerJoinEvent#joinMessage(Component)
public void joinMessage(@Nullable Component joinMessage)```
Sets the join message to send to all online players
joinMessage - join message. If null, no message will be sent
just so you know, it shows you right there why it's deprecated
xD
like.. read, lol
Because a string is not a component
Hello sorry for the inconvenience I wanted to know if it is possible to have a hand with deluxemenu
oh sorry
How would I make it work then?
Like using a component
instead of a string
Paper uses adventure https://docs.adventure.kyori.net/text.html, so as a simple example you can do Component.text("your string here instead")
for (UUID uuid : arena.getPlayers()) {
Player player = Bukkit.getPlayer(uuid); if(player.getScoreboardTags().contains("arena1")) { player.getScoreboardTags().remove("arena1");
if (arena.getTeam(player) == Team.BLUE) {
ItemStack dri = Dricane();
dri.setAmount(12); player.getInventory().addItem(dri);
}
return;
} else if(player.getScoreboardTags().contains("arena2")) { player.getScoreboardTags().remove("arena2");
if (arena.getTeam(player) == Team.BLUE) {
ItemStack dri = Dricane();
dri.setAmount(12);
player.getInventory().addItem(dri);
}
return;
}
}
So im trying to make a minigame thing and the players on the winning team get a specific amount of an item but when I ran tests the scoreboard checking was not working whatsoever any ideas?
Are you in IntelliJ? if so, could you please press CTRL + ALT + L in your IDE, and post that code instead? It'd be much cleaner to look at
k
i ran it
for (UUID uuid : arena.getPlayers()) {
Player player = Bukkit.getPlayer(uuid);
if (player.getScoreboardTags().contains("arena1")) {
player.getScoreboardTags().remove("arena1");
if (arena.getTeam(player) == Team.BLUE) {
ItemStack dri = Dricane();
dri.setAmount(6);
player.getInventory().addItem(dri);
}
return;
} else if (player.getScoreboardTags().contains("arena2")) {
player.getScoreboardTags().remove("arena2");
if (arena.getTeam(player) == Team.BLUE) {
ItemStack dri = Dricane();
dri.setAmount(6);
player.getInventory().addItem(dri);
}
return;
}
}
Lol
lol
lol
Lol
lol
lol
lol
I tried updating Statz and I changed Java8 to Java16 and now it runs for a few minutes then crashes server, won't run long enough to get timings report
Have you tried looking through the crash dump? It might provide some useful info
[19:04:07 WARN]: Can't keep up! Is the server overloaded? Running 10754ms or 215 ticks behind
this last crash had no crash report, but logs spit out lots of info and timings report link https://timings.aikar.co/?id=6595cedaa1684ae3b7cfac1bbcd90b93
Aikar's Timings Viewer - View Timings v2 reports from Paper and Sponge
When I run my command twice, it is not sending the "Error! (target) already has a pending appoint request" message and is instead doing this
It's supposed to do this for the first time, however not the second
If they already have a pending appoint request (their name is in the "appointPlayers" list) it should send the error message and stop the command
I recommend debugging. Add some messages that will tell you the target's name, if the list contains it, what the list has, etc.
also I can't see appointPlayers
more code = better
idk how to do that without it being "arrow code"
appointPlayers should instead be a field variable that gets initialized in constructor, then modified later
if (args.length < 1) {
player.sendMessage(ChatColor.translateAlternateColorCodes('&', prefix + " &cIncorrect Usage! &7Use &b/appoint help &7to see correct command usage."));
return true;
}else {
``` you see this @junior shard ?
you don't need the else
because once you return, it stops executing the code
so you can remove the else which will flatten it a bit
and when checking for the permission you could instead check if they don't have permission then return
if(!haspermission){
//send no perm message
return true;
}
//code
like I said, over time if you do this enough it'll be natural
so instead of the else should I just do if (args.length > 1) {
if (args[1] != null) {
if (args[2] != null) {
``` can be combined into `if(args[1] != null && args[2] != null)`
no, just remove it
so it looks like this
the else is useless, because it's already going to do that code no matter what else
and if the condition is met, it returns before it gets to the rest of the code
not dark mode https://i.imgur.com/hnGlaF3.jpeg
so im trying to outline all the chunks around a player in particles in a 3x3 region. this is the code i have.
for(Chunk c : getChunks(chunk , 1)) {
if(Claim.chunkToClaims.get(c) != null && Claim.chunkToClaims.get(c).getOwner().equals(p.getUniqueId())) {
dustOptions = new Particle.DustOptions(Color.fromRGB(0, 255, 0), 1);
} else {
dustOptions = new Particle.DustOptions(Color.fromRGB(255, 0, 0), 1);
}
int minX = c.getX()*16;
int minZ = c.getZ()*16;
for(int i = 0; i < 16; i++) {
int x1 = minX + i;
int z1 = minZ + i;
int x2 = (minX + 15) - i;
int z2 = (minZ + 15) - i;
p.spawnParticle(Particle.REDSTONE, x1, minY, minZ, 120, dustOptions);
p.spawnParticle(Particle.REDSTONE, minX , minY, z1, 120, dustOptions);
p.spawnParticle(Particle.REDSTONE, x2, minY, minZ + 15, 120, dustOptions);
p.spawnParticle(Particle.REDSTONE, minX + 15, minY, z2, 120, dustOptions);
}
}```
this works with one chunk, but not with multiple not sure why. and here is my get chunk method
https://i.imgur.com/DgLLiXL.png
https://i.imgur.com/lt9lKkN.png
```public List<Chunk> getChunks(Chunk centerChunk, int radius){
List<Chunk> chunks = new ArrayList<>();
for (int x = centerChunk.getX()-radius; x < centerChunk.getX() + (1 + radius); x++) {
for (int z = centerChunk.getZ()-radius; z < centerChunk.getZ() + (1 + radius); z++) {
Chunk chunk = centerChunk.getWorld().getChunkAt(x, z);
chunks.add(chunk);
}
}
return chunks;
}```
@grim oasis so in terms of the image you sent; for args[0] == null I would do:
if (!args[0] == null) {
//code for command being ran correctly
}
// Incorrect usage code
?
no, what you have already is good
that picture is part of the ?plsnoarrowcode link
it's 1 of 4 parts
you already have
if(args[0] == null){
//error code
return;
}
// function body code
ah gotcha
function code should always be at the bottom of the if
because if it's inside the if, it starts to make the arrow
y'kno?
further down the line when your function code has another if statement, that would indent it more
Yeah makes sense
Error: https://pastebin.com/MPDbVdxb
ChosenMcAppoint.java: https://pastebin.com/cxyTKugR
Appoint.java: https://pastebin.com/WXgJ6xYU
Any ideas?
It makes no sense to me how all of a sudden... its null
Was working perfectly fine, didn't touch anything in the main class
Hell it is even identical to another plugin I made where I needed to grab the config in another class
and the other plugin loads fine, but it doesnt like this one?
@junior shard always define your "plugin" instance at first in onEnable
it will fix it
No, just don’t have something like that at all
he can add the Plugin instance in the constructor but initialize the static plugin instance at the end of onEnable method is wrong
no static plugin instance is better
Huh
Hello guys, can you recommend lib for Mongo? (Java)
the official one
hard is not a word I'd use to describe the mongo java library
I mean, it uses the same syntax for queries as mongo itself
but yeah, at first it might seem hard
you don't even need to use any queries
https://docs.mongodb.com/drivers/java/sync/current/fundamentals/builders/#using-the-mongodb-shell this - and the next two points
oh right
the basic steps to uploading a maven repository?
bumper
format your code if you want help
nvm i think i figured out why
So how would I do that
literally the same way as you did with LuckPerms
so (new Appoint(this && luckPerms));
Or create an entirely new line
also should I define a static instance outside of the onEnable?
Such as:
public static ChosenMcAppoint getInstance() {
return (ChosenMcAppoint)Bukkit.getPluginManager().getPlugin("plugin");
}
Well
You got JavaPlugin.getPlugin(ChosenMcAppoint.class)
Which is a singleton since Bukkit kinda guards the instance of your plugin
public class ChosenMcAppoint extends JavaPlugin {
private static ChosenMcAppoint plugin;
@Override
public void onEnable() {
plugin = this;
}
public static ChosenMcAppoint getPlugin() {
return plugin;
}
}
@graceful hedge ?
.
as a second parameter
Okay, makes sense
But works 
But works 
:<
lol
so what actually makes it not good
https://paste.helpch.at/wehotejibi.cs
e im trying to make it to where when you win the game it gets all the players on the winning team and gives a specific ammount of an item (for now) to the players but It wont check correctly and I honestly dont know why
why not simply creating your own arena manager
instead of relying on that thing
just wondering
I am having some issues with my code, here is the code: https://paste.helpch.at/ajidigosas.cs
for (Player player : notOnTeam) {
player.performCommand("jointron");
notOnTeam.remove(player);
}```
You can't iterate over a collection and modify it in the same time
remove the notOnTeam.remove call, you already have a notOnTeam.clear() call after that loop
I did that, same error. Now when it repeats, the system.out.println() adds one CraftPlayer{name=riches_exe} each time
Didnt work
just saying, jointron may add the player to the notOnTeam arraylist, which might be causing issues
I did make my own arena manager
hm
ill make a winner thing then ig
anyone know why this code isnt working ingame? ::
package com.omega;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.Action;
import org.bukkit.event.player.PlayerInteractEvent;
public class Move implements Listener {
@EventHandler
public void onInteract(PlayerInteractEvent event) {
Action action = event.getAction();
Player player = event.getPlayer();
Block block = event.getClickedBlock();
if (action.equals(Action.LEFT_CLICK_BLOCK)) {
if (block.getType().equals(Material.EMERALD_BLOCK)) {
if (player.getHealth() != 20.d) {
player.setHealth(20.d);
}
player.sendMessage(ChatColor.GREEN + "You have been healed!");
if (player.getHealth() != 20.d) {
player.setHealth(player.getHealth() + 2);
}
}
}
}
}
you don't use .equals for enums
you use ==
and, did you register the listener in your onEnable?
Class name Move, proceeds to listen to interact event 
because i was gonna make it something else and didnt rename it
i tohught == was only for #
i need help with my world plugin, i have a system where when the player disconnects, it saves their location, then it teleports them to the location when the rejoin, but something must be configured wrong, because it does whta its suppsoed to with the world, but i always get tped to 0,0,0
Main Class: https://paste.helpch.at/sinatuxode.java
YML File:
db0be134-f6ce-4991-a404-0707a576e524:
logoutWorld: world
lougoutX: 99.30000001192093
lougoutY: 82.04516167274306
lougoutZ: 99.30000001192093
Yml Creator:https://paste.helpch.at/ejuyoroxiv.java
?
wdym
oh
its 0,0,0
i think i have the wrong form of parsing?
is it supposed to be double?
cause im using .getDouble()
you know, there is a built in method iirc for serializing/deserializing location
The reason for that is mostly your key for the config would be wrong…since it returns primitive it can’t be null so it returns 0
??
Try using toString() in player.getUniqueId
ok
Rather than calling the object directly
you spelled it wrong
anyone gonna listen to this :/
lougout is supposed to be logout on your quit
you dont have to go through this hassle if you just make the api do it for you
shoot spelling mistake
how
they fixed it
Location is serializable if u use bukkit api’s default configuration
or, dont use it
if world is loaded after you load the config file
you'll get a nice error
which is bad
I don’t use Bukkit’s file system 😝
so, use the bukkit one if you are sure world will be loaded before your load the file
or simply save it your own way
You can always handle the error…tho
Try catch?
if something throws error
it auto loads it
.
= useful
catching error doesnt fix the issue
additionally
why catching when you shouldn't even get errors
well how would I load them then to make it work?
Its always better to catch the error…U could just return the method there saying the world is currently unloaded or so
is like loading a plugin and catching just in case
error shouldnt happen in first place
Bcs…its bukkit 😅
Someone previously mentioned that there were notnull annotated methods which returned null…Thats what bukkit is made of
xD
you use POST WORLD
or something, you can try catching error when loading the file
but well
also iirc u have to soft-depend on Multiverse-Core

can some set me straight on what I'm reading on my goggle search, I want to setup maven repositories for my plugin
I just use jitpack so people can use the API on my plugins
I guess jitpack would be easier?
If your plugin is on github it is
yes I use Github
should i retype the .equals to == ?
yeah
Enums are still objects, they are just constant
Meant to reply to the 2nd message above that one

you can use .equals on an enum, it will just be identical to ==
okay so can anyone tell me what the problem is then?
Have you learned how to use the debugger?
thanks
You can step code line by line to know exactly what it's doing
and even run code while the program is stopped to see what it would do
oh cool
and also edit methods without restarting the server
thanks man
https://paste.helpch.at/ugewoqazus.sql
Anyone know why this just puts the fake player on tab but I can't actually see them?
I can't figure out how to spawn a fake player :((
there are also no errors
not a clue
I’ll show you in a bit, or you can look at my pinned GitHub project
👀
ty
@dusky harness
https://paste.helpch.at/zotehewefo.java
This is how I do it (with ProtocolLib)
// LIST COMMAND
// /appoint list
if (args[0].equalsIgnoreCase("list")) {
for (String key : ChosenMcAppoint.aPlugin().getConfig().getConfigurationSection("Groups").getKeys(false)) {
ConfigurationSection configSection = ChosenMcAppoint.aPlugin().getConfig().getConfigurationSection("Groups." + key);
String permission = ChosenMcAppoint.aPlugin().getConfig().getConfigurationSection("Groups." + key).getString(".permission");
if (sender.hasPermission(permission)) {
sender.sendMessage(ChatColor.translateAlternateColorCodes('&', prefix + " &eList of groups you may appoint as" + "&6 " + key));
List<String> rankList = ChosenMcAppoint.aPlugin().getConfig().getConfigurationSection("Groups." + key).getStringList(".groupNames");
for (int i = 0; i < rankList.size(); i++) {
sender.sendMessage(ChatColor.translateAlternateColorCodes('&', "&e- &7" + rankList.get(i)));
return true;
}
}
}
}
Can anyone tell me why the plugin is not getting the list of strings under "groupNames" and its only getting the first string listed?
this was working before, not sure what I did

imagine putting the return statement before the close bracket of the loop
couldnt be me
can someone help me
i think ?help can fix your issue
?help
» Give the helpers some details
» Ask suitable questions
» Be polite
» Wait
[05:05:14 ERROR]: [PlaceholderAPI] failed to load class files of expansions
java.util.concurrent.CompletionException: java.lang.NoClassDefFoundError: me/blackvein/quests/quests/IQuest
at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315) ~[?:?]
at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320) ~[?:?]
at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1770) ~[?:?]
at java.lang.Thread.run(Thread.java:833) ~[?:?]
Caused by: java.lang.NoClassDefFoundError: me/blackvein/quests/quests/IQuest
at java.lang.Class.getDeclaredMethods0(Native Method) ~[?:?]
at java.lang.Class.privateGetDeclaredMethods(Class.java:3402) ~[?:?]
at java.lang.Class.getDeclaredMethods(Class.java:2504) ~[?:?]
at me.clip.placeholderapi.expansion.manager.LocalExpansionManager.lambda$findExpansionInFile$7(LocalExpansionManager.java:396) ~[PlaceholderAPI-2.11.1 (2).jar:?]
at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768) ~[?:?]
... 1 more
Caused by: java.lang.ClassNotFoundException: me.blackvein.quests.quests.IQuest
at java.net.URLClassLoader.findClass(URLClassLoader.java:445) ~[?:?]
at java.lang.ClassLoader.loadClass(ClassLoader.java:587) ~[?:?]
at java.lang.ClassLoader.loadClass(ClassLoader.java:520) ~[?:?]
at java.lang.Class.getDeclaredMethods0(Native Method) ~[?:?]
at java.lang.Class.privateGetDeclaredMethods(Class.java:3402) ~[?:?]
at java.lang.Class.getDeclaredMethods(Class.java:2504) ~[?:?]
at me.clip.placeholderapi.expansion.manager.LocalExpansionManager.lambda$findExpansionInFile$7(LocalExpansionManager.java:396) ~[PlaceholderAPI-2.11.1 (2).jar:?]
at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768) ~[?:?]
... 1 more
how to fix it?
is that your plugin?
[05:05:14 ERROR]: My life
how to fix it?
yeah
how to fix it?
[05:05:14 ERROR]: [PlaceholderAPI] failed to load class files of expansions
so how ti fix it?
make sure it exists
yeah how?
but im arleady install the plugin
when i use /papi ecloud download quest, its error, but im arleady install quest
its not my plugin
no its not my plugin
(your own plugin)
typo
otherwise use #general-plugins or #general-plugins-2
but its 1:30 am
i dont think someone might reply soon
try asking the dev of that plugin
You still believe the earth is flat
I am making a command where someone request to appoint another player to a rank
When the player receives the request to be appointed to a rank, they run /appoint accept and from there it should set their group.
How can I pull the variable targetrank to the accept command so that when the player runs /appoint accept, it will know what rank they were requested to be appointed to
Hey I was looking around for a way to intercept messages being sent to players but I only found a thread from 2014 does anything know how to do this today? Or would it be more or less the same.
The reason I ask is because I have no knowledge of packets but I know I would need to modify them in order to do this.
I plan to implement a translator for bedrock players on java servers because tellraw messages cannot be read by bedrock afaik
https://bukkit.org/threads/tut-intercept-and-edit-all-messages.98620/
https://github.com/retrooper/packetevents has a wrapper for chat messages
What? Translate? Translate what? Text to different language?
Depends on how the system is supposed to work
Most cases you use hashmap with admin uuid as key and class with steps or data modified as value
Like when you make a arena setup system
Yess hashmaps thank you
forgot bout that
pc
having issues with JitPack, I believe its because my pom file is not complete. for the libraries I'm missing in pom I'm using jars is this my issue?
what is the issue with JitPack?
can't figure out the version I need to use, nothing works, latest and all the versions I have used
takes 20 min to time out on a build on github
I think it has to do with my upstream broke somehow and it stopped updating GitHub
Is this caused by the network blocking the port or what is the issue? https://paste.helpch.at/yoriyoqezi.cs
On version 1.7.10
Cannot get events to work outside of my main class.
Have looked on plenty of forums with no solution seeming to help.
functions that are events work when called from main, I have included my @EventHandler as needed.
Need events to be fired in classes that aren't main.
https://paste.helpch.at/civiletufa.java
Here is basic structure without a lot ommitted to save space. There are ZERO script errors, everything else works fine.
try to register all the listeners in the main class I feel
I personally have never seen them registered inside their own constructor, but maybe it works
oh wait I don't even see you making an instance of them
I didn't include the actual event functions as they are large and not really relevant to it not working
I can if you feel it's needed.
public void onEnable() {
getServer().getPluginManager().registerEvents(this, this);
getServer().getPluginManager().registerEvents(new Menu(this), this);
getServer().getPluginManager().registerEvents(new Listeners(this), this);
}
I see, I'll give it a whirl.
do you ever create a new Menu object or Listeners object on your current code?
this should fix that
(also will probably want to remove the registering from the constructors)
This worked, only issue now is it's double firing, but I may know why already.
Yeah that's what I'm running through rn
Alright, that issue appears to be resolved!
Thank you so much, I've been going at that issue for a good 4 hours.
I'm in a unique circumstances regarding this plugin and have basically had to learn everything over the past couple days
How can I stop the code from progressing in my listener? Similar to how return true; stops the code from continuing with command classes
The same way, return;
just return no true/false
Yeah
I did that earlier and it made the plugin go wack
looking to figure out how to fix my JitPack, need to know if JitPack needs a artifact for it to work'
I need to check if at least 1 chat recipient is within range of the chat sender, how do I do this?
why?
you are already looping all recipients
cant you simply make a boolean foundPlayer = false;
and then update it to true if one is on range
so you get the boolean after the loop?
ye got it ty
coming full circle to mschat
I too was..but apparently he did comment out the bracket just above
Java is all logic
He should try reading its code as a text
To figure out the weird things
how does one block this warning [22:53:02] [Server thread/WARN]: Ironic_8b49 moved too quickly! -2.659403109043197,0.0,12.071595443481812
you can't
in not then how does essx not get this warning during tp
is there a way to get a list of commands from your plugin?
Getting the command map with reflection then you can get all commands
I think you can do plugin.getDescription().getCommands() or something like that
(if they're in the plugin.yml, if you're registering them with a cmd framework or somehow else, gl)
I was about to say that xd
I have tried plugin.getDescription().getCommands() but there was more afterwards, may of asked to much of it, I will test just this
Thanks
since I didn't have the code to my plugin at work I had to make a testing plugin to work on this code of getting commands, it returns lochelp={description=help, usage=/<command>} for each code. can I get just the command name been looking not having much luck it picking the right thing
plugin.getDescription().getCommands() returns a Map<String, Map<String, Object>> where I'm guessing the first String is the command name
yes, I have not work with maps much, I assume I can just grab the first string
So like im getting this error about my config
java.lang.IllegalArgumentException: The embedded resource 'config.yml' cannot be found in plugins\sumo-1.0.jar
at org.bukkit.plugin.java.JavaPlugin.saveResource(JavaPlugin.java:193) ~[spigot-api-1.18.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.JavaPlugin.saveDefaultConfig(JavaPlugin.java:180) ~[spigot-api-1.18.1-R0.1-SNAPSHOT.jar:?]
at com.mystats.managers.ConfigManager.setupConfig(ConfigManager.java:14) ~[?:?]
at com.mystats.sumo.Sumo.onEnable(Sumo.java:21) ~[?:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[spigot-api-1.18.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:342) ~[spigot-api-1.18.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:480) ~[spigot-api-1.18.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_18_R1.CraftServer.enablePlugin(CraftServer.java:521) ~[spigot-1.18.1-R0.1-SNAPSHOT.jar:3442-Spigot-699290c-62d9762]
at org.bukkit.craftbukkit.v1_18_R1.CraftServer.enablePlugins(CraftServer.java:435) ~[spigot-1.18.1-R0.1-SNAPSHOT.jar:3442-Spigot-699290c-62d9762]
at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:612) ~[spigot-1.18.1-R0.1-SNAPSHOT.jar:3442-Spigot-699290c-62d9762]
at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:414) ~[spigot-1.18.1-R0.1-SNAPSHOT.jar:3442-Spigot-699290c-62d9762]
at net.minecraft.server.dedicated.DedicatedServer.e(DedicatedServer.java:262) ~[spigot-1.18.1-R0.1-SNAPSHOT.jar:3442-Spigot-699290c-62d9762]
at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:994) ~[spigot-1.18.1-R0.1-SNAPSHOT.jar:3442-Spigot-699290c-62d9762]```
Ik that the error says its with my 21st line of Sumo class:
```ConfigManager.setupConfig(this);```
which calls ConfigManager:
public class ConfigManager {
private static FileConfiguration config;
public static void setupConfig(Sumo sumo) {
ConfigManager.config = sumo.getConfig();
sumo.saveDefaultConfig();
}
public static int getRequiredPlayers() { return config.getInt("required-players"); }
public static int getCountDownSeconds() { return config.getInt("countdown-seconds"); }
public static Location getLobbySpawn() {
return new Location(
Bukkit.getWorld(config.getString("sumo-lobby.world")),
config.getDouble("sumo-lobby.x"),
config.getDouble("sumo-lobby.y"),
config.getDouble("sumo-lobby.z"),
(float) config.getDouble("sumo-lobby.yaw"),
(float) config.getDouble("sumo-lobby.pitch"));
}
}```
The plugin is 1.18.1 anyone know why this would be happening?
Read the first line
yeah
I know about that the problem is that it is in the resources folder
and it is exactly config.yml
so idk what would be causing that error
is there a way to make certain hostiles ignored when a player tries to sleep and they r nearby?
MobTargetEvent
EntityTargetEvent
getTarget() instance of Player && ((player) target).isSleeping) cancel event
but the player doesnt need to be targeted by the mobs for it to prevent sleep

and heres a video with the zombie not targeting me: https://srnyx-is.super-cool.xyz/java_YIq9QQmhSO.mp4
Anyone know how to do this with the kotlin DSL?
jar {
destinationDirectory.set(file("server/plugins"))
}
The same way, only difference is that it goes inside the tasks block or just tasks.jar {}
Thank you, I have been trying to do that for longer than I should have 😅
If gitHub Desktop is working right when I update it should upload my changes, in my case it don't and then I get message that says can't update, master has no tracked branch.
Hey I was looking around for a way to intercept messages being sent to players but I only found a thread from 2014 does anything know how to do this today? Or would it be more or less the same.
The reason I ask is because I have no knowledge of packets but I know I would need to modify them in order to do this.
I plan to implement a translator for bedrock players on java servers because tellraw messages cannot be read by bedrock afaik
https://bukkit.org/threads/tut-intercept-and-edit-all-messages.98620/```
It was to use in order to catch messages sent to bedrock clients on a java server. So if the message was unsupported by bedrock it would be modified to work.
if you plan to intercept all messages received by players
including action bar, text message, json messages, text in items, etc
you'll have to listen to probably many packets
yes
figured it out
@EventHandler
public void onSleep(PlayerBedEnterEvent event) {
Player player = event.getPlayer();
if (event.getBedEnterResult() == PlayerBedEnterEvent.BedEnterResult.NOT_SAFE) {
event.setUseBed(Event.Result.ALLOW);
}
}```

Hi guys, I'm trying to draw on image in Java. Draw in way that you give program x1, y1 and x2, y2 coordinates and it will fill the square/rectangle w specified color. What way do you recommend?
For loops, cache locations, loops through locations async. (Not async if you need to set blocks)
I mean isnt there library for that?
like you give the lib 2 points, color and it do it for you
ok found it maybe
i will try it tomorrow
in where?
minecraft? swing? javafx?
first, you'd get all the coords into a Set
minecraft: loop through coords and set block
swing: https://stackoverflow.com/a/3325804/14105665
javafx: https://docs.oracle.com/javase/8/javafx/api/javafx/scene/canvas/Canvas.html
¯_(ツ)_/¯
file?
Yeah like image
Mostly just chat 😄
Also quick question do I need to make my own switch statement to get Attributes from keys like generic.attack_damage or is there a way I can just send it through something like Material#matchMaterial (like does a method already exist?)
You have to make your own method
Is there any fix for an unmappable character?
change encoding to UTF-8
it already is
in the IDE
or atleast i think
ight thnx
wll in the error it say sencoding is windows-1252
Where in the IDE could i change it?
not sure have you tried google
It took 3 and a half hours but I finally did it 
||I made a utility for converting a player's inventory to a json string. This include potion effects, enchants, attributes on Potion items themselves, as well as, weapon attributes & other meta data. The system allows you to parse and create JSON strings||
Nice
how would i loop through all the world names in this yml file and lsit them in chat
yml: https://paste.helpch.at/uzituxudav.makefile
@NotNull
Set<String> getKeys(boolean deep)```
Gets a set containing all keys in this section.
If deep is set to true, then this will contain all the keys within any child ConfigurationSections (and their children, etc). These will be in a valid path notation for you to use.
If deep is set to false, then this will contain only the keys of any direct children, and not their own children.
deep - Whether or not to get a deep list, as opposed to a shallow list.
Set of keys contained within this ConfigurationSection.
use getKeys(false)
???
it returns a Set which you can loop through:
for (final String world : getConfig().getKeys(false)) {
Bukkit.broadcastMessage("World: " + world));
}
it only prints:
[15:13:35 INFO]: [Projectmario] [STDOUT] Worldworlds
show code
package me.mountmario.projectmario.worldcreator;
import me.mountmario.projectmario.ProjectMario;
import me.mountmario.projectmario.util.config.DataManager;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.jetbrains.annotations.NotNull;
public class WorldList implements CommandExecutor {
public DataManager data;
@Override
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
this.data = new DataManager(ProjectMario.getPlugin());
for (final String world : data.getConfig().getKeys(false)) {
System.out.println("World" + world);
}
return true;
}
}
ohh oops i messed it up
it's getConfig().getConfigurationSection("worlds").getKeys(false)
since without the getConfigurationSection, you're just getting the base keys
instead of the keys in worlds
When I try to make a stats folder, nothing shows up
Main class (under playerjoin event, line 109): https://paste.helpch.at/ehewasuvop.cpp
Data Creater class: https://paste.helpch.at/dotacibahe.java
YML: https://paste.helpch.at/ulagubebow.makefile
hello?
just gunna tell you that storing player stats like this might be a bad idea as they will change i assume when you equip armor, weapons or tools, accessories/talismans, pets, etc
yea
calculating their stats when they login and setting them in a hashmap of uuid and stat value object might be a better idea.
if you were storing skill xp that would be more appropriate to store.
??????????
from your values that your storing your trying to copy the stats of hypixel skyblock
yes
why are you storing their stats?
um how else do they stay
well atleast from playing hypixel skyblock myself, the stats are calculated when you login and they are updated when you make a change such as equiping armor, switching your hand from item to item, equiping and deequiping pets, etc
then they are stored in a map such as a hashmap
Yea…but not the right way…
Java is an object oriented programming language…u can set up something like a PlayerStat object…serialize it and when player joins deserialise it and cache tht
Java is an Object Oriented language designed by James Gosling in 1995
Lol
https://upload.skyslycer.de/idea64_bSYIcd4UFN.png what will that print
The plugin 'lol
' is a required dependency but was not found on this server! Please restart the server after you have added the missing plugin!
=============================```
or
```=============================
The plugin 'lol' is a required dependency but was not found on this server! Please restart the server after you have added the missing plugin!
=============================```
if I were to guess, I'd say first
tryitandsee :))
(intellij has scratch file btw which lets you run code without making a new project or starting server)
omg yes i remember scratch files
awesome
also i'd recommend running it in Bukkit.getScheduler().runTask if it's not already so that the server owner will prob see it (since thats when the server is started up)
¯_(ツ)_/¯
plugin will disable itself
in my other plugins i had so many people cussing me out for that depend error
and its only PLib
soo
most people will already have it
its mostly for the suckers around there
idek
i've seen so many server owners ask for help bc they dont have plib
the server already tells you what dependency plugins are missing tho
ye but ppl just see a big red blob
and they dont read the plugin page either 🙃
but big red stacktrace
no one wants to read that
especially new server owners
installing plugin
if they can't be bothered to read an error, they won't bother reading your message either
lmao. #general-plugins is filled with that type of stuff
exactly
i have idea
they will. the problem is that it is a stacktrace
and they just assume the plugin is at fault when they see that
and they think that its an error from the plugin
u should use logger and ERROR level so that server owners will see red
but since its not stacktrace
because java stuff
they might read it
right, i currently have warning so ill change that
*SEVERE
Logger#error tho 😦
no
😦
SLF4J 2 🥺
?
ty
Plugin [id: 'io.papermc.paperweight.userdev', version: '1.3.4'] was not found in any of the following sources:
welp
guess gotta move to .kts
did you add the repo to the plugin management repos?
yes
wait no I didnt
stupid
Could not set unknown property 'maven' for repository container of type org.gradle.api.internal.artifacts.dsl.DefaultRepositoryHandler.
pluginManagement {
repositories {
gradlePluginPortal()
maven = "https://papermc.io/repo/repository/maven-public/"
}
}
how is it on groovy DSL? lol
id guess maven { url = "..." } 🤷
my bad
I'm just stupid and forgot how to do it 
I guess that with the paperDevBundle thing and with the other one you dont need to set compileOnly 'io.papermc.paper:paper-api:1.18.1-R0.1-SNAPSHOT' anymore right?
also
Cause: paperweight requires a development bundle to be added to the 'paperweightDevelopmentBundle' configuration, as well as a repository to resolve it from in order to function. Use the paperweightDevBundle extension function to do this easily.
nevermind its loading
it worked ty
probably a dumb question, but:
Is manually serializing an object using JsonObject and adding each needed field as a value, then manually deserializing it (using a static factory method with JsonObject as parameter) faster than using an automatic databinder, such as Jackson's ObjectMapper with annotations or Gson#fromJson()?
I'm assuming yes, but I just want to make sure that data binding doesn't do some weird magic that lets it serialize/deserialize objects faster
yes, but, I'm 99.9% sure you're doing useless micro optimisation
i'm not doing it for optimization, my objects had a weird serialization pattern and i felt like it would just be faster to code it manually than figure out a data-binding solution. I just wanted to make sure that doing it manually didn't de-optimize lol
ty for the help
gson's custom serializers/deserializers are pretty easy to make
probably less effort than whatever manual solution you have in mind
i was using jackson's objectmapper with annotations before, but i have a field that needs to be set when the object is constructed, and it isn't part of the json
is the value based on the values of other fields?
not really
could you not just assign it in code then? like when you declare the field
i have the main object "MainObject" and it has some fields that are "CustomObject"s, each "CustomObject" needs to have "MainObject" as a final field
MainObject has an "id" (long) that I previously just added to the json of every custom object
couldn't you just have
but having the same "id": long repeat several times in each json file, with there being hundreds of files
why?
MainObject is 95% of the time, deserialized from Json
and when it is, CustomObjects are also deserialized from that Json
@JsonProperty("id")
@Getter private final long id;
@JsonProperty("name")
@Getter private String name;
// new company
public Company(long id, String name) {
this.id = id;
this.name = name;
}
// company that existed before, should be deserialized
public Company(@JsonProperty("id") long id,
@JsonProperty("name") String name,) {
this.id = id;
this.name = name;
}
}```
and then there's some CustomObjects as fields as well
because CustomObject is kinda like a child of MainObject
in the company example above, CustomObject would be like a "Bank"
and that bank would need to know the company that owns it for some internal operations
i considered making all of those internal operations go through the Company, but I'd rather just have it as a field just in case
aight, well, yeah, doing it manually shouldn't be any slower
alright lol ty
Hey can someone recommend me a replacement for the bukkit configuration system because I'm at the point where I need more file control and I am inexperienced with java fileIO
the next step is to start mapping your configs to actual objects
having classes that represent your configs instead of interacting with them through glorified maps
that can be achieved via libraries already in spigot, namely gson, or snakeyaml, or even a mix of the two (gson's object mapping abilities + snakeyaml's yaml parsing)
Thanks I'll look into those two. Currently I'm using some random library for json https://github.com/fangyidong/json-simple (or something like that)
yeah no point in using that
JSON is the easiest language in the history of languages to learn
nice pfp bro
This may be true
Hey, could someone help me with scoreboard-nametag stuff (call), I'm super stuck rn.
Ask away, noone gonna bother to get in a call
Could someone help me picking a dedicated server plan?
im on reliablesite.net
HeavyNode can give you 1.50 dollars per gig and a domain compatiable
im looking for a 32-64 gb plan
im on reliablesite and im wondering what the best plan would be for that
ill look into it
i9 9900k 64 gb is $115/mo
I dont think that would be necessary
Intel Xeon E3 1230 V3 64 gb is 39-49 a month
the max isn't always the best
Intel Xeon E3 1230 Rapid Deploy 4 x 3.20 GHz 32GB DDR3 64GB SSD+2TB HD 10m $46/mo
Does that seem plausible?
how many players will 32 gb support?
well that depends on a lot of things
I think it would be find if you have about 100 average players and not 200 plugins
what version?
do not allocate 32gb of ram to a single server please god
unless ur having like 600 players average don't dedicate that much
@molten verge
minecraft servers don't scale vertically enough to use that much ram
you're doing multiple proxies? jesus lol
that works fine
actually probably not
I don't even understand how multiple proxies work
it doesn't very well
well basically one of the games is going to have hundreds of players
minecraft doesn't have a transfer packet, so you're stuck on a single proxy
ok
^
so make the bungee 2 gigs, and spread the 30 gigs thru the rest
Also would 4 cores be enough? 1 for each one?
Of course xD
remember, -Xmx5G is just 5GB for the heap
which one do you think is the best option
?
i don't really know how much i trust reliablesite.net lol
looks like an OVH reseller or somethin
ReliableSite has its own reseller
same
i talked to people and they like reliablesite
If they can't code a website link header right I don't think we can trust their website
so if it looks like an ovh reseller than you can be a reseller of a reseller
They do seem legit
and a lot of people recommended it
obviously, that's the point of a scam to seem legit
well yeah but there are scams that are obviously scams xD
idk I trust pebble, they have amazing support no matter the time zones
I mean it literally just looks like an OVH reseller
their Ryzen 5600x 64GB one is the same as OVH's Game-1-LE server but for like $5 more a month aparently
i dunno, host depends on a lot of things
are you comfortable with a bare metal server with no support?
cause if not, you're gonna want to find someone who is or buy from a mc server host like pebble or something
ReliableSite has support
yeah so does OVH technically
but good luck trying to use it to fix your minecraft server
we already spoke to them like 3 times
@dusty frost you see any good deals on OVH?
I mean, depends on what you're doing
what does VPS hosting mean
I can do that part xD
their i7 is out of stock unfortunately
Virtual Private Server
ik that
I use the Game-1-LE server for my network, 100 player cap, MythicMobs, Magic, MMOItems, ModelEngine
three servers behind a Waterfall, it's been great
a big upgrade from the free Oracle server lol
can i have link
there's a lot of factors that weigh into this stuff
like, how much can you even spend on servers
wait so a VPS is basically where you buy multiple servers as 1 bunch and it connects to your server through a proxy that you can alter where each server of the vps will be allocated?
a VPS is where they run a machine with a hypervisor and make little VMs for you
9900k
ehhhh
for the same price?
i mean, if ya really need that performance, yeah it's probably better
depends on if they can cool it adequately
intel 9th, 10th, and 11th gen run real hot
so good luck staying at 5GHz for long lol
gotcha
thanks
whats better:
well we can either use Intel Xeon E3 1230 V3 32gb for $49 a month
or we can do a ryzen 5600x 64 gb for 99 a month
or we can do an i9 9900k 64gb for 115 a month
Well we need 1 bungee & 3 servers
these 3 servers will be a survival/war like minigames
big worlds? and how many people?
100 and 200 are very different numbers lmao
200 max
if ya have the money, the 5600x won't hurt ya
probably 8GBs per backend server and like 3GB for the proxy would be good
oh and use Velocity if you can
Why not waterfall if I may ask?
Waterfall is just a slightly better BungeeCord, they are constrained by API and design choices made by md5
Velocity is a complete remake of a proxy and supports stuff like BungeeGuard natively, much better piece of software
a bit, yeah
do they have nice docs for developers?
Would recommend using it out of the gate, we're working on migrating right now and it is a pain to move stuff over after the fact
I would say so, I have been loving it
Whatever you do, Docker all the way man
it's unbeatable
Yeah I also love pterodactyl
and the installation process is pretty easy
For the OS
do it in Docker if you can
Ubuntu 20.04?
why?
from OVH or reliablesite?
reliablesite
Stability and no snap, among other reasons
It's close then, cause I don't know how much I trust their cooling ability
hmm ok
and besides, it doesn't matter much if you just put everything in docker, which I strongly recommend
No, they tell you how to set it up on a host system
hey are there any good documentations on how I can turn 1h into 3600 seconds?
I am trying to make a tempban command
Java 17.0.2
Maven build
Spigot 1.18.1 plugin
TimeUnit.HOURS.toSeconds() ?
Hmm how do I setup it on docker then? Never did it
no but like, is there a good way to just parse the 1h which is given to the plugin as a command argument directly into seconds
thanks, I will have a look into that
I don't know if I would do the daemon in docker, but at least the panel proper is super nice to have in Docker as it becomes portable
can read human time
convert it to seconds, hours, whatever
thanks a lot
can see all the time options here: https://github.com/PiggyPiglet/TimeAPI/blob/master/src/main/java/sh/okx/timeapi/TimeAPI.java
Oh hey Pig, you haven't been cooked yet?
can't say I have
can any help me figure out what is causing this error? https://haste.gafert.org/mepivuguhu.md
Have you shaded HikariCP ?
I was given this plugin and my knowledge of SQL is slim
this is the line it has a issue with HikariConfig config = new HikariConfig();
the whole class https://paste.helpch.at/olixuqitac.java
if you mean this, maven-shade-plugin is 3.2.4 and maven-compiler-plugin is 3.8.1
Am I stupid? java.lang.NoSuchMethodError: 'me.mrafonso.libs.kyori.adventure.text.Component org.bukkit.inventory.ItemStack.displayName()'
I try to get a more even distribution of blocks, but a surface becomes completely without blocks.
https://i.imgur.com/YnheTkh.png
https://pastebin.com/rwAeXXBm or link here https://paste.helpch.at/eqorixitez.cs
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
is testing out the code so far and not everything is ready yet.
error: invalid target release: 16.0.1
@night icenot sure what you mean shaded HikariCP?
What would be required to add intergration deluxemenus for using a heads plugin i made? Or how does the process go
ping me when you reply
public void setNameTags(Player player) throws SQLException {
player.setScoreboard(Bukkit.getScoreboardManager().getNewScoreboard());
String[] rank = {"O" };
for (String ranks : rank) {
Team team = player.getScoreboard().registerNewTeam("O");
team.setPrefix("&cOwner");
}
for (Player target : Bukkit.getOnlinePlayers()) {
PlayerDataManager targetData = new PlayerDataManager(ArconixCore, target.getUniqueId());
player.getScoreboard().getTeam(getRankPrefix(targetData.getRank()).substring(2)).addEntry(target.getName());
}
}```
Use https://paste.helpch.at/ for errors, logs and configs. So we don't spam the discord.
If someone could help with this error, that'd be fantastic.
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:310) ~[Arconix.jar:git-Spigot-21fe707-741a1bd]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[Arconix.jar:git-Spigot-21fe707-741a1bd]
at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:502) [Arconix.jar:git-Spigot-21fe707-741a1bd]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:487) [Arconix.jar:git-Spigot-21fe707-741a1bd]
at net.minecraft.server.v1_8_R3.PlayerList.onPlayerJoin(PlayerList.java:298) [Arconix.jar:git-Spigot-21fe707-741a1bd]
at net.minecraft.server.v1_8_R3.PlayerList.a(PlayerList.java:157) [Arconix.jar:git-Spigot-21fe707-741a1bd]
at net.minecraft.server.v1_8_R3.LoginListener.b(LoginListener.java:144) [Arconix.jar:git-Spigot-21fe707-741a1bd]
at net.minecraft.server.v1_8_R3.LoginListener.c(LoginListener.java:54) [Arconix.jar:git-Spigot-21fe707-741a1bd]
at net.minecraft.server.v1_8_R3.NetworkManager.a(NetworkManager.java:231) [Arconix.jar:git-Spigot-21fe707-741a1bd]
at net.minecraft.server.v1_8_R3.ServerConnection.c(ServerConnection.java:148) [Arconix.jar:git-Spigot-21fe707-741a1bd]
at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:814) [Arconix.jar:git-Spigot-21fe707-741a1bd]
at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:374) [Arconix.jar:git-Spigot-21fe707-741a1bd]
at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:654) [Arconix.jar:git-Spigot-21fe707-741a1bd]
at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:557) [Arconix.jar:git-Spigot-21fe707-741a1bd]
at java.lang.Thread.run(Thread.java:833) [?:?]
Caused by: java.lang.IllegalArgumentException: Team name '[Ljava.lang.String;@5e74de87' is longer than the limit of 16 characters
at org.apache.commons.lang.Validate.isTrue(Validate.java:136) ~[Arconix.jar:git-Spigot-21fe707-741a1bd]
at org.bukkit.craftbukkit.v1_8_R3.scoreboard.CraftScoreboard.registerNewTeam(CraftScoreboard.java:139) ~[Arconix.jar:git-Spigot-21fe707-741a1bd]
Pretty self explanatory:
Caused by: java.lang.IllegalArgumentException: Team name '[Ljava.lang.String;@5e74de87' is longer than the limit of 16 characters
Well, I don't see how cause the text is legit one character.
Can you show your code?
public void setNameTags(Player player) throws SQLException {
player.setScoreboard(Bukkit.getScoreboardManager().getNewScoreboard());
String[] rank = {"O"};
for (String ranks : rank) {
Team team = player.getScoreboard().registerNewTeam("O");
team.setPrefix("&cOwner");
}
for (Player target : Bukkit.getOnlinePlayers()) {
PlayerDataManager targetData = new PlayerDataManager(ArconixCore, target.getUniqueId());
player.getScoreboard().getTeam(getRankPrefix(targetData.getRank()).substring(2)).addEntry(target.getName());
}
}
The error line is the Team team = player.getScoreboard().registerNewTeam("O");.
Not sure then
I believe you need to convert the StringArray back to a string
Not 100% sure, but I remember seeing something like this ('[Ljava.lang.String;@5e74de87') when I didn't convert my string arrays
I simplified the code a bit more for just defining one team and adding that player to the team but it still doesn't work with no errors...
public void setNameTags(Player player) throws SQLException {
player.setScoreboard(Bukkit.getScoreboardManager().getNewScoreboard());
Team team = player.getScoreboard().registerNewTeam("O");
team.setPrefix("&cOwner");
player.getScoreboard().getTeam("O").addEntry(player.getName());
}
if I leave Hikari in my build of the jar my plugin works, is this a intellij issue?
no that's what youre supposed to do
just relocate it to avoid conflicts with other plugins
even better, use maven/gradle
Show your pom.xml
My pom.xml https://paste.helpch.at/vafebuyebe.xml
Are you building with maven or are you building with the artifact like you show in the pic?
from artifact since I have 4 plugins I don't have maven info for
That's the problem, if you're using maven you have to build with maven
More specifically with mvn clean package
maybe I am, in Intellij there is nothing says maven build
You have to run this task to build with it
when I do clean package it fails due to the missing maven dependency
guess I will try to find the missing dependency, was like over 20 when I first got plugin
You need to add all dependencies, don't mix build tools, if you have maven stick to only maven
btw you cann just execute mvn clean package in the terminal if not showing in intelij
or whatever command afterwards
I have a button setup to do a clean build, but I will either need to remove plugins from project or find a maven info
JitPack for it to work I need to be able to build my project on GitHub?
yeah you do
guess I will never fix my issue
Do you have the jar of the plugins?
yes, now thats mismatch
You can install it to maven local
mvn install:install-file \
-Dfile=<path-to-file> \
-DgroupId=<group-id> \
-DartifactId=<artifact-id> \
-Dversion=<version> \
-Dpackaging=<packaging> \
-DgeneratePom=true
Then add it to maven
That's not really gonna fix it on the jitpack end of things tho
Yeah well jitpack is always gonna be shit for that (and everything)
shots fired at jitpack 😭
I think GitHub is messed up due to I forgot password and couldn't reset it so I started a new account
That definitely doesn't help
Strongly suggest using a password manager
dashlane has about 1000 codes to get like 50 percent off from youtubers
good deals
Or use Bitwarden
FOSS
oh its free
[DEBUG] Looking up lifecycle mappings for packaging pom from ClassRealm[plexus.core, parent: null]```
How do i add a part onto a string if the boolean is true/false without using a if statement
ive seen it before
it was like something ? "yes" : "no"
blah.append(bool ? "yess" : "noh")
Thank you
Is it possible to change how fast a BukkitRunnable is running (delay) while its running
u can run every tick, then track the last tick it ran
hmmm true, but what if i want it run it faster
well if u run every tick
Currently i have it like running every 30 seconds, and i want it to run after some time every 1 second.
Do i just start from the begging with every 1 second
yes - or create a new task
Ow yeah, i'll just create a new task
that puts the jar into your maven local repo
so you can reference it in other projects if you really need to, for like local API changes and stuff
ok, how would I access it via pom?
I have this, <dependency> <groupId>me.staartvin</groupId> <artifactId>statz</artifactId> <version>1.6.2</version> </dependency> there don't seem to be any errors, but when I run clean build it still don't see this plug
yeah you add that, then you remove whatever repository the real one came from and add maven local as a repo
the issue is there no working repo for 5 of the plugins I'm using
CMI-API says this works but not for me <dependency> <groupId>com.github.Zrips</groupId> <artifactId>CMI-API</artifactId> <version>8.7.8.2</version> <scope>provided</scope> </dependency>
imagine using maven
How would I add an API to a gradle project?
implementation 'org.inventivetalent:bossbarapi:2.4.1'
That doesn't seem to work.
What exactly doesn't work there?
When I try to reference the API, it just doesn't seem to work.
There aren't any references that I could make.
Seems like that version no longer exists in the repo, try 2.4.3-SNAPSHOT
TextComponent textComponent = Component.text(PlaceholderAPI.setBracketPlaceholders(player, send.split("\\{message}")[0]));
TextComponent hoverText = Component.empty();
for (String str : plugin.getConfig().getStringList("hover")) {
str = PlaceholderAPI.setBracketPlaceholders(player, str);
hoverText.append(LEGACY.deserialize(str));
hoverText.append(Component.newline());
}
textComponent.hoverEvent(hoverText);
player.sendMessage(textComponent);
``` what am i missing?
i dont see the hover text
Components are immutable, either use the builder or you have to reassign the component
how to i exclude paths that shouldnt end up in the shaded shadowJar?
Take a look at exclude or excludes on the shadow task, idk which one would be the one
i did, doesnt work
Wdym by "exclude paths" though? ;o
i dont want org.yaml.snakeyaml in my shadow jar
can you help me to fix it? i couldnt find anything useful in the adventure wiki
i mean, what should i do
you can exclude it from the library that uses it @spiral prairie
implementation(lib) {
exclude group: 'org.yaml'
}```
i dont know which one does
run this
gradle dependencies
Is there a way of setting a players location when the player leaves the game during the PlayerQuitEvent?
i did something with builder but it shows on whole message which i dont want to, i want it to show a part of the message
i added exclude("com.google") to every single dependency but it still exists
com.google?
i did
exclude group: 'com.google'
yea
send the script
does gradle dependencies not show you where gson comes from?
help :x
argh
Uh, what does this error mean?
java.lang.RuntimeException: java.lang.NoSuchFieldException: modifiers
wthat you doing
you're doing something very cursed
BossBar bossBar = BossBarAPI.addBar(player, new TextComponent("Hi " + player.getName() + "!"), BossBarAPI.Color.PURPLE, BossBarAPI.Style.NOTCHED_20, 1.0f, 0, 0);
Legit just that one line...
ok then that api is doing something very cursed
Uhh, what do I do...
not much you can do really
make sure you're using the latest version
then either wait for the library author to fix, or use a different library
which spigot version are you running?
adventure 🙂
if it's 1.9+ you don't need that api
well, if he doesn't use paper
its quite overkill to add adventure just for a bossbar
It's 1.8 Spigot.
I know, but anyways xd
or a different api
at least, when I tried to use it didn't work
Are there any good API's for adding your name to tablist or changing your nameplate above your head?
sucks to be a 1.8 user
I've been stuck on bossbar's, tablist names, and nameplates for the longest time.
I don't know
maybe you can try using TAB
i don't remember if it has api
Not sure, but I'm getting this error...
Caused by: java.lang.NullPointerException: Cannot invoke "me.neznamy.tab.api.bossbar.BossBarManager.createBossBar(String, float, me.neznamy.tab.api.bossbar.BarColor, me.neznamy.tab.api.bossbar.BarStyle)" because the return value of "me.neznamy.tab.api.TabAPI.getBossBarManager()" is null
can you send your code?
TabAPI.getInstance().getBossBarManager().createBossBar("TEST", 0.1f, BarColor.PURPLE, BarStyle.NOTCHED_20);
Yup.
Yes.
i cant send images
You won't be able to upload images here directly to avoid spam, so please use https://imgur.com/upload or similar service to upload images/screenshots.
but
DM's?
* Instance can be obtained using {@link me.neznamy.tab.api.TabAPI#getBossBarManager()}.
* This requires the BossBar feature to be enabled in config, otherwise the method will
* return null.
Lemme check.


