#development
1 messages · Page 103 of 1
Yeah
Thats not what I mean
The number of threads is inversely proportional to the shared time per thread
The more threads you have
Lesser time a single thread would get to execute
Yeah
And switching between threads and processes is also another factor, moving the different values inbetween. So lesser time for a thread would also mean more waiting time for data transfer
Yeah
Yeah
Yeah
Are we talking just concurrency, parallelism or simply asynchronous code?
Yeah

So I'm trying to debug some code with IIJ, if I set a breakpoint where a method is used, it stops the program there, but if I put one inside that method, it doesn't, any idea why? Or do breakpoints work only with your own code
it needs to match the source code, so it might not work if line numbers are different for example
More so the opposite LOL. Make sure your problem is truly solved by going to another thread
A dropped item would be an entity, so PDC
guys
it cannot be unregistered
Failed to unregister expansion: DiscordSRVUtils
even with api it doesnt unregister
the identifier might need to be all lowercase
thx it worked
yes. update to 1.17. ez
nbt api maybe? https://www.spigotmc.org/resources/nbt-api.7939/
I believe you can set nbt tags to entities with that
Hmm, why don't you guys mention that in docs atleast? It took an hour trying to fix it
no idea
yep - use NBTInjector (you'll see it in NBT api wiki)
@regal idol open an issue on papi repo
PersistentDataContainer
A data container persistent across restarts
applies on TileEntitys (blocks that store extra data such as a chest), Entitys (cows, etc), and ItemStacks
(it uses nbt "behind the scenes" iirc)
oh okay
im making a team per player
team = board.registerNewTeam(player.getUniqueId().toString().substring(0,15));
i get no errors but in game the team isn't there
Good day, I've been struggling with this for many days now. I'm trying to include an external library, javacord, in my project, the standard seems to be maven. Now, I've gotten lost in a mess of to shade or not to shade. I've used gradle before and grade shadowJar is very simple and works when I have javacord in main/resources, using mvn package however, I haven't gotten it to work yet, https://paste.helpch.at/ocoyotejan.xml is my POM, my log is https://paste.helpch.at/efokiyucun.coffeescript. File structure: https://imgur.com/a/cZqCt57
no, you don't download the jar itself with gradle and maven
maven and gradle has a section for repositories (URLs where it downloads the jars) and dependencies (because each repository can have multiple libraries)
you put those lines into your pom.xml/build.gradle
(also you need tier 2+ to post images)
for example, heres an (abandoned) discord bot (not using javacord, but it's using gradle) that I made: https://github.com/dkim19375/UniG0
There isn't a resources folder since I didn't need any
For the dependency (since I need to shade in the bot library), I have this https://github.com/dkim19375/UniG0/blob/master/build.gradle#L35 that tells gradle to look for that dependency (JDA = Java Discord API)
then I have this https://github.com/dkim19375/UniG0/blob/master/build.gradle#L27 that tells gradle to look for that dependency in that URL (they use their own repository wheras Javacord uses mavenCentral)
When was Action.COPY_TO_CLIPBOARD added?
a while ago i believe
1.15 or 1.16
even older than that? isn't COPY_TO_CLIPBOARD the same as SUGGEST_COMMAND?
just different naming
aha
I´m not soo good on fields. I get this error [17:05:42 WARN]: java.lang.IllegalArgumentException: Can not set final org.brokenarrow.storage.menus.redone.MenuButton field org.brokenarrow.storage.menus.redone.testMenu.LinkButton to java.lang.Class but has yet not find how to fix it.
your trying to change something with the final keyword
idea say i should be final and I use similar on other class with no problems, but in this case I try access other class instead of same class the field method is run.
code
ugh. it shouldn't be final if you plan on changing it, which sounds like what you're doing
I try with out final and that not work ether.
private void getFieldButton() {
for (Field field : this.clazz.getDeclaredFields()) {
field.setAccessible(true);
if (MenuButton.class.isAssignableFrom(field.getType())) {
try {
MenuButton fielddata = (MenuButton) field.get(this.clazz);
buttons.add(fielddata);
} catch (IllegalAccessException e) {
e.printStackTrace();
}
}
}
}
https://bukkit.org/threads/1-11-the-complete-guide-to-item-nbttags-attributes.411448/ shows how to add nbt tags, should work the same for removing them
It should not try set data in other class (some are final because data is set in constructor and will not change).
I change field.get(this.clazz); and that fix the issue.
Has other problem. I say the field are null, even if it can´t be null.
https://paste.helpch.at/aduraxoqit.http
is say [17:55:12 WARN]: java.lang.NullPointerException: Cannot invoke "org.brokenarrow.storage.menus.redone.MenuButton.getItem()" because "this.LinkButton" is null
I add this to field, from this in other class (call this inside constructor).
private void getFieldButton() {
for (Field field : this.clazz.getDeclaredFields()) {
field.setAccessible(true);
if (MenuButton.class.isAssignableFrom(field.getType())) {
try {
MenuButton fielddata = (MenuButton) field.get(this);
System.out.println("test " + this);
buttons.add(fielddata);
} catch (IllegalAccessException e) {
e.printStackTrace();
}
}
}
}
when i use my command
it says /life <args>
which is what my plugin.yml says
why does it do this
You're returning false in the command method
oh
if (x <= 1 && y == 0) {
sender.sendMessage("§cYou must have more than 1 life and they must have 1 or more lives");
}```
what here is wrong
x is the lives the sender
y is the lives of the receiver
y must be 1 or more
x must be 2 or more
what is wrong with the code i have a seperate class for the timer only the timer does not work in minecraft
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.event.Listener;
import org.bukkit.event.block.Action;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.inventory.EquipmentSlot;
import org.bukkit.plugin.Plugin;
public class RCKlik implements Listener {
private Machine plugin = (Machine) Machine.getPlugin(Machine.class);
public void onClick(PlayerInteractEvent event) {
if (event.getAction() == Action.RIGHT_CLICK_BLOCK) {
if (event.getHand() != EquipmentSlot.HAND) return;
Block block = event.getClickedBlock();
if (block.getType() == Material.PURPLE_GLAZED_TERRACOTTA) {
Player player = event.getPlayer();
(new CountDownTask(this.plugin, player, event.getClickedBlock())).runTaskTimer((Plugin)this.plugin, 0L, 2L);
}
}
}
}```
the right click event class ^^
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.scheduler.BukkitRunnable;
public class CountDownTask extends BukkitRunnable {
private int time;
private int seconds;
private Machine plugin;
private Player player;
private Block c;
public CountDownTask(Machine plugin, Player player, Block b) {
this.plugin = plugin;
this.time = 9;
this.c = b;
this.seconds = 20 - 1;
this.player = player;
}
public void run() {
this.time--;
if (this.time == -1) {
this.time = 9;
this.seconds--;
}
if (this.seconds != -1)
this.player.sendTitle("Huts", this.seconds + "." + this.time, 0, 60, 0);
if (this.seconds == 0 && this.time == 0) {
this.player.sendMessage("Test");
}
}
}
the countdown class ^^
You forgot to annotate the method with @EventHandler
should I put the @EventHandler at the top of the countdown class?
ooo i see
in the click class I dont annotate the @EventHandler
annotate the method with @EventHandler
but then it highlights the @EventHandler in red
not the class
why is eventhandler needed 🤔
i see
.. ?
because they want to handle an event??
public void onClick(PlayerInteractEvent event) {
why you cant just use event without eventhandler annotation
ok but why is it designed like that
its nit possible to register it without it?
.-.
Minecraft server loads all the plugins before starting to enable even a single plugin right?
it's designed like that because it is
how is bukkit gonna know what method is an event listener and what isnt
yes
So in my onEnable method all the plugin show be loaded
loaded yes, not enabled
okay so can I get a list of all the loaded plugin in my onEnable()?
just the name not instance obviously
You can easily
idk maybe check if method use event by checking if parameter (or how is it called) is event by checking if it extends event
I mean, all of them will be loaded by that stage
Just stuff your shit into a listeners list
what
tbh, asking us why is kinda pointless... thats how it works. And also what if you had normal helper methods... how will bukkit know if its a normal event method or not.
wdym
??
any idea
In reality it’s because spigot is dog shit
And there events suck
Ya so where should I get the data?
PluginManager#getPlugins?
I don't think so
????????????????
some plugin won't be enabled when I will use #getPlugins() cause the plugin that will enable after my plugin will be present on that list
do you want a list of loaded plugins or of enabled plugins?
^?
loaded
PluginManager#getPlugins
that's literally what you want
oh
hmm
okay thanks I will try'
That is correct, some may not be enabled, but all will be loaded
Which is what you want
Anyone know of an open source project similar to the ECloud system for storing addons remotely?
I added a cooldown to my code but it doesn't work the message is sent but the event.setCanceld() doesn't work because it still executes
if (event.getAction() == Action.RIGHT_CLICK_BLOCK) {
Player player = event.getPlayer();
if (event.getHand() != EquipmentSlot.HAND) return;
Block block = event.getClickedBlock();
if (block.getType() == Material.PURPLE_GLAZED_TERRACOTTA) {
if(cooldown.containsKey(player.getUniqueId()) && cooldown.get(player.getUniqueId()) > System.currentTimeMillis()){
long tijd = cooldown.get(player.getUniqueId()) - System.currentTimeMillis();
player.sendMessage(ChatColor.RED + "Je zit in een cooldown periode van " + tijd/1000 + " seconden.");
}
else {
cooldown.put(player.getUniqueId(), System.currentTimeMillis() + (10 * 1000));
}
player.updateInventory();
event.setCancelled(true);
(new CountDownTask(this.plugin, player, event.getClickedBlock())).runTaskTimer((Plugin)this.plugin, 0L, 2L);
}
}```
cant you just rely on server time for the timer?
I thought what do you mean but I already did it
can i ask what the cooldown is supposed to prevent?
I have a separate class for the countdown timer in the screen maybe that's the problem
what is the plugin doing?
It does bring a countdown timer in my screen when I right click sand
but with the cooldown the cooldown message is sended but he doesn't cancel the event
hey, how can i read something from file? like deluxemenu has so you create new menu in a config and it reads it
but the event.setCancelled doesn't work thats the whole problem
it doesn't cancel the countdown timer
look at java yaml read, https://www.spigotmc.org/wiki/config-files/
so if i have menus and there is a new menu created how can i read that if i dont know the name of it:
menuthatidontknowthenameof:
otherstuff:```
#general-plugins for deluxemenus help
deluxemenus was a example
One last question. How do I check if a plugin is enabled on bungee?
I can get the loaded plugins
PluginManager#getPlugins?
ya those are loaded plugins
I wanna check if a plugin is enabled
oh I misread the q
if there's anything like Plugin#isEnabled() or PluginManager#isEnabled(String) etc or similar then that would be it
nope
doesn't have that
then it's not a thing on bungee
Ahh
F
than how does bungee handles depends?

it renders the dependency tree before loading and enabling each plugin
once the dependency tree is built it iterates through it, orderly, to load and enable each one
Ahhh dang
that's the same case on any platform as well, fabric, bukkit, sponge, velocity, ...
hmm got it the problem is my extensions can't have something like that cause my plugin don't handle the load and enable thing
Anyone know how I can add a color gradient to a string?
After using
while(matcher.find()){
//Should i use here matcher.group(0) or 1?
}
Can someone explain? 
and whats the difference with matcher.group()
i think that matcher.group() uses the group found by matcher.find() whereas matcher.group(0) finds the first group
(just a guess)

I'm using replaceText method from adventure and it has
component.replaceText(TextReplacementConfig.builder().match(textPattern).replacement((matchResult, builder) -> {
not sure what should i use to get the matched string by regex
Hey guys, I'm working on a plugin rn and it's my first time using my custom api. It has various methods and objects like Timers and an ItemBuilder, just misc stuff that I use to be more efficient. I have shaded my jar, though I'm getting a NoClassDefFoundError error when loading the plugin. FYI, I have an objected called KatCore which extends JavaPlugin and has random methods like "registerCommands", "registerEvents", etc.
Any ideas?
?paste
Paste Services
When asking for help with a config/menu/code issue please use our paste bin:
(we prefer it over pastebin.com)
• HelpChat Paste - How To Use
Are you shading the plugin, or is the api on the server also?
No, I'm shading the plugin. It's a custom api so I don't want other players to have to download it.
full error: https://paste.helpch.at/anavinukes.sql
I'm fairly new to shading though, could that be the issue? I've been researching it but I can't tell if I'm missing anything
I don't remember much about maven, I use Gradle
Ah ok
Any other ideas of why it may be failing? I don't think I did it wrong, but I'm not sure
How are you building it?
Are you doing maven package?
Could this be your problem?
https://howtodoinjava.com/maven/maven-dependency-scopes/#system
Dependencies with system are similar to ones with scope provided.
Try removing that possibly
ok
I'm trying a new method rn, but I'll do that one next
nvm it didn't work
I'll try that
Process terminated 😦
What was the error?
That haha, unfortunately that was all i got
"Proccess terminated"
within Intellij, it wouldn't compile
Also, I tried doing running "shade" plugin in the maven tab and it said this:
Failed to create shaded artifact, project main artifact does not exist.
What does that mean?
Try adding this to your repositories
<repository>
<id>repo</id>
<url>${basedir}/src/libs/KatCore-1.0-SNAPSHOT.jar</url>
</repository>
And keeping what I said before
ok
And removing <systemPath>
And version, bc it marked it as an error
Or would I just mark it as provided like with the spigot import?
Which part?
<version> was marked as an error after i did what you said. I removed it and got process terminated
Could you show which part?
Was it
<dependency>
<groupId>com.katnissali</groupId>
<artifactId>KatCore</artifactId>
<version>1.0</version>
```?
Yes, the version tag
Also, I found this warning: 'dependencies.dependency.systemPath' for com.katnissali:KatCore:jar should not point at files within the project directory, ${basedir}/src/libs/KatCore-1.0-SNAPSHOT.jar will be unresolvable by dependent projects @ line 81, column 25
I found this, look at the answer
https://stackoverflow.com/questions/27636452/how-to-add-external-jar-files-to-maven-shade-plugin?answertab=active#tab-top
Switching to Gradle may be easier lol
Not really sorry, other than adding it to a remote repository
Ok thanks anyway
Someone? (I mean who csn explain how it works exactly and when to use what)
if you have a regex like \d+ and a string aa11bb22cc33 each loop will give you a group of numbers. So matcher.group() will be 11 then 22 and then 33, each of them being an individual match
group(index) is used when you have matching groups.
For example, lets use a derialized location world_name;x;y;z world;1;2;3 and the regex (\w+);(\d+);(\d+);(\d+).
0 (or matcher#group()). world_name;x;y;z world;1;2;3
world_nameworldx1y2z3
@shell moon
If you go to https://regex101.com/ it tells you the index of each group and what value it has
So basically to get the full matched i simply need group() right?
yes
What i have this: world_name;5;6;7 world;1;2;3
That as string
How would i get the first location
Matcher m = pattern.match(string)
while(m.find()) {
m.group() //return world_name,5;6;7 and the second time returns world;1;2;3?
The first time .group(1 2 3 4) would return world_name 5 6 7 respectively?
}
Yessss
Nice
Now the question is whats the difference between matcher and matchresult
As adventure gives matchresult
I guess .group() would return the whole string matched

Maven install is already present, you need to run that command to install the library to your maven local
Sorry, what do you mean? I know maven but I am still fairly novice
Where would I execute that cmd?
In the terminal, or if you're using Intellij there is a button on the maven tab to execute commands
Ok. I did a bit more looking in the mean time and I tried something. It isn't recognizing the new dependency https://paste.helpch.at/osuxoliliy.xml
Oh man I think i figured it out. Not sure yet (nor how i did it) but it might work
I am trying to get a placeholder from another plugin to use it in mine, but I can't find any info online, can someone help me with this?
how can I change the name tag above a player?
I know it has something to do with packets, I just couldnt find any tutorials that worked
you can use the "TAB" plugin
I use it and it works
bump
i think you might be able to use scoreboard? 🤷
I figured it out
I used teams and scoreboards
did it work?
show code :))
yeah, this edits the text above a players head. there should be a folder called api, just use the NameManagerAPI class in there, I modified it a bit for my use, but it should do the job.
not tablist
wait im confused xD
you can make it effect tablist
the player's nametag or a nametag above the player's nametag?
players nametag
» Give the helpers some details
» Ask suitable questions
» Be polite
» Wait
it can do both, but in my case, I only used the players nametag
oh? 👀
I think
How can i use placeholders like %luckperms_primary_group_name% in my plugin?
you use the PlaceholderAPI#setPlaceholders method
i tried:
String playerRank = "%luckperms_primary_group_name%";
playerRank = PlaceholderAPI.setPlaceholders(p, playerRank);
e.setFormat(Format.chat("&8[" + playerRank + "&8] " + p.getName() + "&7: " + ChatColor.RESET + e.getMessage()));``` but got this error https://paste.helpch.at/fitiyocano.cs
oh wait
you need to give it a string format
forgot to download the expansion
or that I guess
ty for helping 🙂
do anyone know a good tutorial online about how to create and use your own api?
Hmm, it’s just a set of classes (usually interfaces) which specifies a behavior, that you can depend on in another module/plugin. The idea is to hide implementation details such that when they change, the api goes mostly unaffected by the change.
yeah, but I don't know how to connect the api with a new plugin I make.. So I don't know how to connect the api via maven with my new plugin
Publish to maven local
is there a tutorial for on youtube or something?
Hmm nope, although there exist many in real life practice references on places like GitHub and such.
There probably exists yt tuts. Just don’t know any.
ah okey
Hey, I'm making a clickable menu with armorstands, I got everything, unless a little detail I want to add: that when your cursor is targetting a item, it gets closer to you
Thanks!
Could someone show me how to publish to maven central? thx
help me
Hi guys I'd like to ask for help, how can I see javadocs and sources in the IDE for the spigot api?
Ah I just found out, right click pom.xml and Maven -> download sources and documentation.
How do i setup shadowjar to my minecraft plugin? Using gradle
Add the plugin
https://imperceptiblethoughts.com/shadow/getting-started/
(if you're using gradle 6, then the ersion is 6.1.0 instead of 7.1.0 iirc)
then gradlew shadowJar/gradle shadowJar or Gradle Button (in sidebar) -> Tasks -> shadow -> shadowJar
thats pretty much it
yugi
yes?
any update to slimjar? 
Im removing the mirror and just pointing directly to central
Oracle is too much of a hassle to deal with
if you want i can help with maven central unless you can figure it out by yourself 🤷
or i can just send u a website that makes the process more clear
dw, I'll let you know if I find any issues, thanks 😄
alr
does someone know to do it on gradle ?
gradle should do it by default
😌
gradle supremacy
I didn't rlly understand that guide so much...
add ```gradle
plugins {
id 'com.github.johnrengelman.shadow' version '7.1.0'
id 'java'
}
I have done that already
then
gradlew shadowJar/gradle shadowJarorGradle Button (in sidebar)->Tasks->shadow->shadowJar
then build/libs/YourPlugin-Version-all.jar
I don't see a YourPlugin-Version-all.jar file at all
did you run the shadowJar task?
Yep
are there any files in build/libs?
yep
Thank you so much
np
lets say i wanted to store a username and password in a database, where would i store the salt,
from the places ive looked they suggest just storing it with the user and pass hash,
username | salt | hash
is this a good idea or would storing it elsewhere be better?
well. the whole idea of salt is for people to not be able to just guess the password by checking the hashes against each other. if you store the salt there, its like you didn't use it at all
not really?
Salts just prevent from checking passwords against a pre-computed hash map
If someone manages to retrieve the hashes + salts they would need to compute every possible password hash + your specific salt just to get your password
And they can't even use it to compare if it's the same as someone else's
yeah yeah. makes sense
Relevant video https://youtu.be/cjdiIKFYeXQ
Hey, I'm having this very strange thing w maven rn. I added a debug line earlier to my custom api which is included in a plugin I'm making. Now, though I removed it, it still prints. I've removed the line, recompiled the plugin, and replaced the file in my new plugin. I have even decompiled the api before adding it to check and there is no debug line. Yet, every time I compile the plugin again and decompile to check, the line is still there! I have no idea where it is getting the old .jar of my api, can someone help? Here's my pom: https://paste.helpch.at/sijufasufu.xml
I have tried everything: restarting my computer, importing the api manually through file explorer while intellij was closed, the file with the debug line doesn't even exist anymore so I have no idea why this is happpening
I’m assuming you need to shade the jar
I am
It is pulling the old version with the deubg line
Even though the file doesn't exist
You need to replace it with the right jar then
I even tried reverting both projects (the api and current plugin) back to the initial commit in github (which was about an hour back) and it still didn't work
If you’re recompiling your api it shouldn’t have your debug line
I did. I compiled my api, checked it with a decompiler to make sure the line was gone, then added it. I compiled my new plugin and checked it w the decompiler, it had the line.
That's what I mean, maven is taking the wrong file but I don't even know what file it is because it's gone.
Code does not lie in that sense. You’re local depending on your api anyways so I’m confused.
Wdym local on my api
KatCore?
Yes, I know it must be getting it from somewhere but I can't figure it out, or maybe maven has it stashed away somewhere
Yes, my api
Just look for it in your external libraries
And if it has a little arrow
Or look in your libs folder
Yep, I did that, it doesn't have the debug line
Try changing group id and artifact :3
Not much I can do tbh. It seems more a simple user error somewhere
Yeah. Wdym, changing it where
In your pom and in your “api”
But do you mean the folder names or in the pom of my api?
ok
The project me.katnissali:PluginManager:1.0-SNAPSHOT (C:\Users\curly\IdeaProjects\PluginManager\pom.xml) has 1 error
[ERROR] 'dependencies.dependency.systemPath' for com.katnissali:KatCore:jar must be omitted. This field may only be specified for a dependency with system scope. @ line 84, column 25
[ERROR]
Delete system path
ok
should i make a repo for it then, bc it's not going to know where to find the file
That’s the point of maven
When you compile something with maven it’ll place it into your .m2 folder
So you can then just depend on it somewhere else. No need to actually have the jar to depend on hand
Ohhh how do I make it place it in the .m2 folder
Maybe that's where its getting the file from
It already is
Sorry, I'm a bit new with maven
If you compiled your api with maven it’s in your .m2
Everytime you compile noe it’ll update for your other projects
I found it! (i think) I found the file in my .m2 folder and decompiled it. low and behold it had the debug msg 😄
Yeah. So I tried recompiling the project and it's not generating a new .jar in my m2 folder
Show your apis pom
And you’re running mvn clean install or package?
Yes package
I occasionally run clean to rule out any other bug causes, but install causes a wierd bug for my plugin
That’s not good
It makes spigot go all haywire and I cant import inventory objects
So I had to import it manually with systemPath
That seemed to work
Definitely some diff under lying problem
If I do it with repo and provided scope it doesn't work
I personally don’t even use maven. Shit sucks tbh
Gradle > all. Which still uses your .m2
Any suggestions?
Wdym, sorry
Every time you run mvn install it should be replacing the jar
As long as you changed something iirc
Or that’s just gradle
Uh I still have that error though
public class KickCommand implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (sender instanceof Player) {
Player p = (Player) sender;
if (p.hasPermission("punishments.kick")) {
if(args.length == 2) {
if (Bukkit.getPlayer(args[0]).isOnline()){
Player a = Bukkit.getPlayer(args[0]);
TextComponent KickMessage = new TextComponent();
KickMessage.setText("You Have been kicked");
a.kick(KickMessage);
} else {
p.sendMessage("Player is not online");
}
'kick(net.kyori.adventure.text.@org.jetbrains.annotations.Nullable Component)' in 'org.bukkit.entity.Player' cannot be applied to '(net.md_5.bungee.api.chat.TextComponent)'
i get this error
You are using the wrong component
Says it in the error 🙂
chief if i knew what was going on i wouldnt be here in the first place
Hey quick question, how should I import my api if I'm not doing it by local jar?
Bc now its not shaded
the api files aren't showing up in the decompiler
what is your group id + artifact for your API?
api is com.katnissali
that doesn't seem right... could you paste your api's pom in here?
How could i make this shorter?
list.add(Material.IRON_ORE);
list.add(Material.GOLD_ORE);
list.add(Material.LAPIS_ORE);
list.add(Material.DIAMOND_ORE);```
loop through the materials and check if the material name contains the word "ore" and if it does, add it to the list
but its only for those specific ores
you could do list.addAll(Arrays.asList(Material.COAL_ORE, Material.IRON_ORE))
or that ^
plugin pom: https://paste.helpch.at/yakubowuva.xml
api pom: https://paste.helpch.at/suxohitoce.xml
so if I do it this way it doesn't shade correctly and I get class not found error, but if I import the api with <systempath> and scope of system it works
it's not included because your api's scope is "provided"
change it to "compile" if you want maven to include the API to your plugin
ok
i think its gonna work 😄
give it a sec though
omg tysm you solved both my problems
you're welcome :)
So i have this hashmap in my main:
public static HashMap<Material, Double> grindCoins = new HashMap<>();
I also add some things in the hashmap in the onEnable:
grindCoins.put(Material.IRON_ORE, 16.70);
grindCoins.put(Material.GOLD_ORE, 18.00);
grindCoins.put(Material.LAPIS_ORE, 20.00);
grindCoins.put(Material.DIAMOND_ORE, 23.50);```
And i try to use this hashmap in a other class but it is null:
```rsGrinding.grindCoins.get(e.getBlock().getType())```
And i wouldnt know why its null, anyone that could help?
oh
public static hashmap 🥶
rsGrinding might be null
is this static abuse?
yes
Is static abuse bad or is it just a coding rule?
well there are no coding rules
but it's bad practice to do so
(and it's bad to have public fields too)
but going back on topic, try printing out System.out.println("is null: " + rsGrinding == null)
How do i get lists & main instances without static abuse?
Found the solution, i am dumb i did set the block to bedrock before checking what block it whas
public final class CoolPlugin extends JavaPlugin {
private Map<Material, Double> grindCoins = new HashMap<>();
@Override
public void onEnable() {
final Other other = new Other(this); // Other(this) = constructor - look below
other.method();
}
public Map<Material, Double> getGrindCoins() {
return grindCoins; // can be generated in IJ using Alt + Insert
}
}
public final class Other {
private final CoolPlugin plugin;
public Other(CoolPlugin plugin) { // a constructor, notice above it's new Other(this), this = CoolPlugin instance
this.plugin = plugin; // asigning it to a field above
}
public void method() {
plugin.getGrindCoins().add(Material.IRON_ORE, 5.0);
}
}
(also known as Dependency Injection since you're "injecting" the CoolPlugin "dependency" to Other)
static abuse is easier 🥲
🥲
btw emily
gtg byeee
imagine not just doing ?di lol
i wanted to give more explanation
incompatible types: java.util.Comparator<java.util.Map.Entry<java.lang.Object,V>> cannot be converted to java.util.Comparator<? super java.util.Map.Entry<java.lang.String,java.lang.Integer>> Need a good place to understand this mess
that's so ugly...
Okay I'm back, wachu need
whats the purpose of getters/setters if you don't modify anything else in the getters
or is it just so that if you do need to change it you don't have to change the rest of the code?
and good habits?
pretty much
alr
Then theres the case of hiding mutability in some cases
Which falls into the same pit ig
Yeah it's so you can do changes in the future to the getter/setter without it being ABI breaking
I mean it's not for that exclusively
A🅱️ I
But it's one of the advantages
😌
The setter also allows validation on the set values
So someone doesnt just go around setting unnatural values to your fields
kotlin 😌
Hot garbage
null is only an issue when misused tbh
the billion dollar mistake
null is only an issue when the null pointer points to it tbh
it would be worse if the null pointer would point to a valid reference
for(String s : plugin.getConfig().getStringList('board.body')){
}``` Long time since i did this, but why does `board.body` return `Too many characters in character literal`
" = String, ' = character
indeed slow
Getting the main instance breaks dip since it’s your highest order class.
Stuff like lists , lower level classes, and shit you can pass through constructors from your main class.
this don't work (Map)this.leaderboard.entrySet().stream().sorted(Entry.comparingByValue().reversed()).collect(Collectors.toMap(Entry::getKey, Entry::getValue, (e1, e2) -> {return e1;}, LinkedHashMap::new));
this does (Map)this.leaderboard.entrySet().stream().sorted(Entry.comparingByValue()).collect(Collectors.toMap(Entry::getKey, Entry::getValue, (e1, e2) -> {return e1;}, LinkedHashMap::new));I need the list to be in reverse?
How would i use .replace() in a arrayList?
you got List::replaceAll
so basically
list.replaceAll(element -> {
return blah;
});
and then if you just want to keep an element, return the argument
Hi! I'm trying to update a plugin that's not working on 1.17.1 and the developer is no longer actively developing the plugin. It works fine on 1.16.5. The plugin in question is called "Alchema" and uses cauldrons to let the player craft different items by just throwing them into the cauldron while it's heated up and filled with water. This exception is generated by the plugin whenever a cauldron is placed in the world, any idea why this is?
at wtf.choco.alchema.cauldron.AlchemicalCauldron.canHeatUp(AlchemicalCauldron.java:312) ~[Alchema-1.1.3_Test.jar:?]
at wtf.choco.alchema.cauldron.AlchemicalCauldron.update(AlchemicalCauldron.java:498) ~[Alchema-1.1.3_Test.jar:?]
at wtf.choco.alchema.cauldron.CauldronUpdateHandler.run(CauldronUpdateHandler.java:86) ~[Alchema-1.1.3_Test.jar:?]
at org.bukkit.craftbukkit.v1_17_R1.scheduler.CraftTask.run(CraftTask.java:101) ~[patched_1.17.1.jar:git-Paper-388]
at org.bukkit.craftbukkit.v1_17_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:483) ~[patched_1.17.1.jar:git-Paper-388]
at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1567) ~[patched_1.17.1.jar:git-Paper-388]
at net.minecraft.server.dedicated.DedicatedServer.tickChildren(DedicatedServer.java:490) ~[patched_1.17.1.jar:git-Paper-388]
at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1483) ~[patched_1.17.1.jar:git-Paper-388]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1282) ~[patched_1.17.1.jar:git-Paper-388]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:319) ~[patched_1.17.1.jar:git-Paper-388]
at java.lang.Thread.run(Thread.java:831) ~[?:?]```
There's also this, if the cauldron is filled with water to the max.
no
» Give the helpers some details
» Ask suitable questions
» Be polite
» Wait
:)
kotlin bad
kotlin bad
Invalidate cache
so true bestie
didnt help 
https://media.discordapp.net/attachments/880044557436325888/914261624683130920/XSQP3ZM.png?width=443&height=154 can someone tell me how do i make a plugin like this
just tell you how to make the entire plugin
oui
List<Entry> builder = new EntryBuilder().build();
for(String s : plugin.getConfig().getStringList("board.body")){
builder.next(s
.replace("[", "")
.replace(", ", "")
.replace("]", ""));
}``` I have been stuck on this for over an hour now, anyone have an idea how i would do this?
do what?
Making it add a line to the scoreboard using .next for every line in the config
yes'nt
goddamnit alr
no one is gonna tell you how to make the entire plugin
^
we're devs, we give vague solutions
i am!
- make plugin
- stonks
We can help with specific things
ok
because the method is unreachable
but why
you returned before or exited app or something
does anyone know how much kotlin likes java 17 
i am fucking stupid
thank you
np
oversaw that lmao
1.6 should work fine
https://media.discordapp.net/attachments/880044557436325888/914274516706947133/unknown.png?width=130&height=17 i was able to show the entire ban count but how would i format it like this? https://media.discordapp.net/attachments/880044557436325888/914274655601307699/XSQP3ZM.png?width=354&height=123 Example: "(staff member name): (their ban count)"
can someone help me with that
player.sendMessage(staff.getName() + ChatColor.GREEN + " Bans: " + banCount);
```?
How can I make a placeholder that uses a player name
%placeholder_[player name]_test%
how would i "staff.getName()"
if you have their ban count then you surely have to have some sort of identifier, either the Player/OfflinePlayer object, the UUID or the player name
im using litebans connected to a mysql and there is a "banned_by_name" column in the mysql how would i get that banned_by_name and get the ban count for that STAFF member and not the entire bans
Just get staff as a player object
how did you get the ban count in the first place?
i got the code from the litebans website https://media.discordapp.net/attachments/880044557436325888/914280969211625472/unknown.png?width=689&height=264
Does it take a name or a uuid?
Please just answer the question without flooding image links
Looks like it takes a uuid, you can use the mojang player api to convert it to a name object, or if they’re online then Bukkit.getPlayer(<uuid>)
is the uuid field a string (varchar) or binary?
string i think
^this sounds like a smarter idea lol
alright i am trying it
alr
.
is this image for this database: #development message
How do i use NMS again?
I did the following things but nms isnt working:
- added mavenCentrak() & mavenlocal()
- changed
'org.spigotmc:spigot-api:1.16.5-R0.1-SNAPSHOT'to'org.spigotmc1.16.5-R0.1-SNAPSHOT' - builded nms using buildtools in a folder on my desktop
?
yah
discord emoji 🥲
in IJ press the build tab and is there an error?
whats the error when building/reloading gradle?
ohw lol its fixed by restarting gradle even tho i already did that twice & i even restarted intellij, ty
you don't need nms for "custom payload" packets btw
i just use the labymod examples
,
Has anyone had this error Cannot invoke "net.minecraft.nbt.NBTBase.getTypeId()" because "element" is null
While loading ItemStack from a config file? It happens when I do ItemStack#getItemMeta() or ItemStack#toString(),
and ItemStack is not null
Nvm I'm dumb
this don't work anymore worked for Java8, using Java16 now this.leaderboard = (Map)this.leaderboard.entrySet().stream().sorted(Entry.comparingByValue().reversed()).collect(Collectors.toMap(Entry::getKey, Entry::getValue, (e1, e2) -> {return e1;}, LinkedHashMap::new));
What's the error?
@dusky harness
nvm
List<Entry> builder = new EntryBuilder().build();
for(String s : plugin.getConfig().getStringList("board.body")){
builder.next(s
.replace("[", "")
.replace(", ", "")
.replace("]", ""));
}``` I have been stuck on this for over an hour now, anyone have an idea how i would do this? The problem is that i'm trying to do .next and add every single piece in `board.body` to the builder which is using ScoreboardLib, does anyone know what would help me solve this issue?
What even is the issue?
Are you getting an error? Is something not working as expected?
In C# how would I make a method that would work on all number types? All I do in that method is add and compare. I can't use IComparable since that only has comparation methods
public void scoreboard(Player plr) {
for (Player player: plr.getServer().getOnlinePlayers()) {
String title = plugin.getConfig().getString("board.title");
title = PlaceholderAPI.setPlaceholders(player, title);
String finalTitle = title;
ArrayList<String> body = new ArrayList<>(plugin.getConfig().getStringList("board.body"));
Scoreboard scoreboard = ScoreboardLib.createScoreboard(player)
.setHandler(new ScoreboardHandler() {
@Override
public String getTitle(Player player) {
return ChatColor.translateAlternateColorCodes('&', finalTitle);
}
@Override
public List<Entry> getEntries(Player player) {
return new EntryBuilder()
.next(body.toString()
.replace("[", "")
.replace(", ", "")
.replace("]", ""))
.build();
}
}).setUpdateInterval(2l);
scoreboard.activate();
}
}``` To be exact, the issue is with getEntries making it add a new line for each line it should add to the scoreboard, this is what i have so far. If that made anymore sense

what's the best way to load all chunks in a world? (that are already generated)
👀
yes dkim? 👀
thats a lot of chunks
not necicarily
nah. ez. just do World#GIveMeAllChunksBczImCool
yes
no
dkim. you can leave if you don't like it
this is ~ 100 chunks, and I plan to iterate over them async
https://paste.helpch.at/rilesoquti
this is my (very old) code that i used to get all spawners in the world and remove them
look in lines 85 - 107
idk if theres another way
¯_(ツ)_/¯
but thats how i did it
(and the command took a reaaaaaaaaaaaaaally long time to execute)
probably because it looped through every block and only used 1 thread
world.loadedchunks
ez
he needs unloaded chunks
^
and to prevent a lot of memory being used i'd also recommend using ChunkSnapshots (which i used in line 107) then unloading the chunk afterwards 🤷 (as you can always load them again if needed)
how do me get data from annotation in class
well actually how I also get the annotation 
reflection
1 sec
baeldung ftw
I'm gonna do it async instead
that's easier
yes, you probably should
or else it'll probably crash the server
🙃
please do
I'm not that smart to find out how to do it in classes 
atleast atm
@Cool(name = "a")
public class Cooled {
}
Cool annotation = Cooled.class.getDeclaredAnnotation(Cool.class)
if (annotation != null) {
System.out.println(annotation.getName());
}
np
isAnnotationPresent smh
ye ik, but I dont need that
It was more of a comment for dkim
it returns null
if it isn't present
iirc
default T getDeclaredAnnotation(Class annotationClass)
throws NullPointerException```
Returns this element's annotation for the specified type if such an annotation is directly present, else null. This method ignores inherited annotations. (Returns null if no annotations are directly present on this element.)
1.8
this element's annotation for the specified annotation type if directly present on this element, else null
NullPointerException - if the given annotation class is null
annotationClass - the Class object corresponding to the annotation type
That's such a confusing docs, does it throw or not lmao
doesn't seem to
(Returns null if no annotations are directly present on this element.)
Yup i was wrong 
Is there an API for DeluxeTags?
anyone know why this happens only happens to one player that I know of https://paste.helpch.at/tewedixozi.bash
Not that I know of, but it would be inside the jar itself.
No idea Ironic, sorry.
what is that icon tho XD
If you want to explain more behind your question, I can tell you if you'll be able to do it or not.
One of our devs just asked that’s all. We want to make a plugin where you trade tags for tags.
But it looks like we’re just gonna make a whole plugin ground up anyway
Thanks though Glare.
Alrighty, sounds good.
.
is contains in list really slow to use?
I use List<Integer> but i get like 500ms and more
do you have a lot of integers in the list?
also List<Integer> isn't the implementation
2
then I highly doubt your 500ms measurement
I only use this, so i not set the implementation
public void setFillSpace(List<Integer> fillSpace) {
this.fillSpace = fillSpace;
}
well
regardless of that
with only 2 elements your list#contains isn't taking 500ms
something else is at fault
Is not much before that some can make this time. but I will add more places to debug it.
https://paste.helpch.at/edalemegev.cs
[09:23:12 INFO]: time timepreff 0
[09:23:12 INFO]: time after run code 0
[09:23:12 INFO]: time in fillSpace 6
[09:23:13 INFO]: timne for outloop534
[09:23:13 INFO]: time in fillSpace beffore 534
[09:23:13 INFO]: time 0
[09:23:13 INFO]: time timepreff 0
[09:23:13 INFO]: time after run code 0
[09:23:13 INFO]: time in fillSpace 534
[09:23:13 INFO]: time in fillSpace beffore 828
[09:23:13 INFO]: time in fillSpace 828
[09:23:13 INFO]: timne for outloop828
[09:23:13 INFO]: timne 828
yeah I can't help you with that chunk of code
but I guarantee you the list isn't at fault
Yeah understand that. But the code work fine on other class i use it before (is something i has done here some make the issue). Yeah the list should not make the issue (has use it on other places and no issues).
more debug msg
https://paste.helpch.at/iqanoluxov.cs
Hm is something inside the second for loop some are the problem.
I think I know the issue. Is when i shall load playerheads (it is way first load are slow). Has to find better way to fix it.
Strange when I debug where I load it is like 0ms when I debug that part.
java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '}' at line 1
28.11 08:55:56 [Server] WARN at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120)
28.11 08:55:56 [Server] WARN at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
28.11 08:55:56 [Server] WARN at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
28.11 08:55:56 [Server] WARN at com.mysql.cj.jdbc.StatementImpl.executeQuery(StatementImpl.java:1200)
28.11 08:55:56 [Server] WARN at litebans.ea.executeQuery(ea.java:115)
28.11 08:55:56 [Server] WARN at litebans.eS.executeQuery(eS.java)
28.11 08:55:56 [Server] WARN at litebans.gl.executeQuery(gl.java:13)
What function should be used in a copy task for an absoute directory?
file always seems to provide an relative* one
oh wait nvm
got it
you should use a proper profiler to look into such things. System.out.println has its own overhead and such code also makes optimizations less effective
profiler? I at least know is not my code some was the issue. Is the head implementation (I have to find better way for this).
https://visualvm.github.io/ for example
look nice 🙂 will try that out later on 🙂
hi, should be sql operations async always or its not needed for smaller stuff
how can i make a leaderboard type placeholder eg. leaderboard_position_1
the IO overhead always exists - so yeah, you should do it async whenever possible
val world = Bukkit.getWorlds().first().checkNull("world")
val tempHandle = world::class.java.getMethod("getHandle").checkNull("tempHandle")
val tempEntity =
tempHandle.invoke(world)::class.java.getMethod("getEntity", UUID::class.java).checkNull("tempEntity")
val entity = world.spawn(Location(world, 0.0, 150.0, 0.0), ArmorStand::class.java).checkNull("entity")
entity.isVisible = false
entity.setGravity(false) // just to be safe idk
val tempBukkitEntity = tempEntity.invoke(
tempHandle.invoke(world).checkNull("tempHandle invoked"), entity.uniqueId
).checkNull("tempEntity invoked")::class.java.getMethod("getBukkitEntity").checkNull("tempBukkitEntity")
```anyone know why this errors out with `tempEntity invoked is null`?
example code using nms (but I'd prefer to use reflection): ```kt
val world = Bukkit.getWorlds().first()
val entity = world.spawn(Location(world, 0.0, 150.0, 0.0), ArmorStand::class.java)
val retrievedEntity = (world as CraftWorld).handle.getEntity(entity.uniqueId)
anyone know why this happens only happens to one player that I know of https://paste.helpch.at/tewedixozi.bash
most likely the entity isn't really added to the world at this point, that might happen in a later state of the tick
hm
not sure why you don't just access the nms entity through CraftEntity
Thats very odd @trail burrow
The values are indeed inversed and are't random but int min and max values
yes it is. looks like a spigot issue not a plugin top me
the cords are where the play logs in
How did you got there
how rewards bot join
via bungee and thats where they logged out
not sure if paper fixes these issues, but it's basically a vanilla problem
Uh no idea, but it is weird
I think it might have something to do with BentoBox
Is there a documentation on modules?
uhh what?
you have to be more specific
Hey, anyone that got a quick thing on how to change the bungeecord message of this:
https://gyazo.com/e17eafd4e0955a6fa2611904234a6876
This pops up when you try to connect to a server thats down.
Nvm did it with WinRAR or ZIP.
https://wiki.vg/Protocol#Block_Change how can I get the Block ID on 1.17?
does someone know how can I use the mojang mapping for 1.17.1 on gradle (I'm mean like "remap" the dependency at the compiling)
https://minecraftitemids.com/ it shows also for 1.17
How can I cancel a Runnable task?
I have a class implementing Runnable, but I have no clue how to stop that runnable
since cancel() doesn't exist
@Override
public void run() {
Thread.currentThread().interrupt();
```?
Like that?
No
how are you starting it?
so it is a bukkit task
Idk it doesn't implement BukkitTask
make it a Consumer<BukkitTask> if you want it to cancel itself; it takes the BukkitTask from which you can call cancel on
A what now
I remember someone mentioning that but I couldn't understand what a consumer task is
Should it implement Consumer<BukkitTask> instead of Runnable?
For this case, yes
What do I override..?
the only method there is to override
What do I do with accept though
Doesn't look like something that runs every X times
neither does a Runnable on its own
i mean at least the Runnable looks like it runs something
accept doesn't sound like it does 😂
it's the fact that you pass it to the bukkit scheduler that calls it periodically
not the name
I don't follow what I should be writing in the method
it's the exact same thing but it takes the BukkitTask itself
you cancel it whenever you want
inside itself
Caused by: FieldAccessException: No field with type int exists in class PacketPlayOutBlockChange.
how do you view nms source code for paper? 😅
Okay but do I write what I had in my run() method then?
Write what I had in my run() method in the accept(BukkitTask task) method?
I don't know how this works
what do you want to do
Run my code once a tick
until..?
Until a mob dies
so you want to cancel the task when the mob dies
Yeah
how do you determine when the mob is dead? in an event listener or what?
Right, so inside the task you check if the mob is dead and if it is, you want to cancel the task
yes
And then task.cancel()?
it's literally
literally the exact same thing
but you get the task itself if you want to cancel it from within
This feels weird but alright I'll give it a try
weird how?
I don't get how task.cancel() will prevent the code in accept() from running
A runnable felt more intuitive as I wrote the code in the run() method, and if I wrote cancel() in there then the code wouldn't run anymore
it cancels the task so the scheduler does not call it anymore
How do I start the task though
with.. the scheduler?
Bukkit.getScheduler().runTaskTimer(plugin, mobTask, 0, 1); cause this gives an error
what does it say
that it cannot resolve the method, one of the parameters is wrong but they shouldn't be
'cause if you did it right, it definitely exists https://papermc.io/javadocs/paper/1.17/org/bukkit/scheduler/BukkitScheduler.html#runTaskTimer(org.bukkit.plugin.Plugin,java.util.function.Consumer,long,long)
I assumed it was the bukkit one
I don't even know where and if that one is ever used
Alright guess it works, thank you
i place an item on slot 19 in a custom chest inventory, it takes the item on the cursor at the time which could be any item and then adds that item to my hashmap
i click slot 49 or i close the inventory and it returns the value of the itemstack thats in that hashmap. the itemstack it returns is always AIR, which from what ive done should never be possible.
im stumped at this point why this is happening
as the method to set the value of this itemstack is called only once and has an if statement checking if its material.air
inside of the if statement starting at line 29 the value is what i expect
everywhere else out of that if statement is just Material.AIR
getcursor was the problem...
public static void dropItem(ItemStack item, Location loc) {
Bukkit.getScheduler().scheduleSyncDelayedTask(ViperUHC.getInstance(), () -> loc.getWorld().dropItemNaturally(loc, item), 1);
}```
can someone explain why this doesn't work?
The itemstack isn't air, and it is being ran
not sure if every material can be dropped
Have tried with various Materials
Also I'm pretty sure everything except Air can be dropped
Hi guys, I want to display MC server data in real time. Let's say chat. Backend is in Go so
- what is best way to send data from Java to Go?
- what is best way to display messages in real time without refreshing site? Websocket?
Exception in thread "main" java.lang.NullPointerException: Cannot invoke "java.nio.file.Path.getFileSystem()" because "path" is null
at java.base/java.nio.file.Files.provider(Files.java:105)
at java.base/java.nio.file.Files.exists(Files.java:2512)
```uhh anyone know why this is happening?
"path" is null
read the docs
:^)
but it does have a parent ;-;
config.yml does not have a parent, something/config.yml has a parent
electric blue sirywell
how else do i fix
what in the fuck
im sorry thats going in the album
super cool I guess
😖
unlucky
Tier 3 is my fav tho
use Path next time
Alongside 6
File 🤮
I go from 3 to 6 directly then
yes
Is there a way to set the servers view distance, while its running?
I think Paper has a world.setNoTickViewDistance() method, but I'm unsure of how well it works while the server is running.
I'd assume it does given that it's a method.
whats the difference between setViewDistance & setNoTickViewDistance?
no tick = you see it but the chunks are not ticked (plants arent growing etc.)
like nothingh is happening in them
ah alright thanks
is ok to make getConnection method (sql connection) static?
probably not, but eh, i do it and really who cares
so based
Hey, I'm working on a plugin management plugin. It has to download plugins from spigot (w a link). I Fixed a 403 error, but now I need to fix a 503 error bc cloud fare is blocking me. I've experimented with different user-agents. Any suggestions?
Afaik no
👍
Idk if it would work, but fyi, you wouldn't need to set the item stack again
Does anyone have a solution for my issue above?
Cloudflare makes working with spigot really annoying
ppm 😌
what is the data type of a Shulker Boxes' Block#getData?
probably some combo of facing and color?
how do I create a shulker box and fill it?
this doesn't work
block.setType(Material.GREEN_SHULKER_BOX);
if (!(block instanceof ShulkerBox)) return;
ShulkerBox box = (ShulkerBox) block;
NamespacedKey key = new NamespacedKey(instance, "spectral");
box.getInventory().addItem(new ItemStack(Material.BOW) {{
ItemMeta meta = getItemMeta();
meta.getPersistentDataContainer().set(key, PersistentDataType.STRING, "true");
meta.displayName(MessageUtils.miniMessage("<gold>Spectral Bow"));
setItemMeta(meta);
}}, new ItemStack(Material.SPECTRAL_ARROW) {{
ItemMeta meta = getItemMeta();
meta.getPersistentDataContainer().set(key, PersistentDataType.STRING, "true");
meta.displayName(MessageUtils.miniMessage("<gold>Spectral Arrow"));
setItemMeta(meta);
}});```
neither does using block.getData()
(the block is set, but nothing else)
huh?
tysm
what type is block? A Block?


