#help-development
1 messages · Page 47 of 1
normally its already done
If you’re getting the ConcurrentModificationException then its just you who designed your system poorly Id assume
im not the guy who coded all of this. its a friend of mine and im trying to fix something and also im a beginner so thats why i cant answer
if it helps i can send all the class
Well, if you didnt code it and you can barely code Id actually advice the following
- pay someone to fix it
- get the author to fix it, you can bring them here if they need help
- learn how to code Java first, then move on to something as advanced as maintaining your friend’s projects#
It wasn't even a CME, it was an NPE
i cant do anything from this list
im just trying all by my self
Whats stopping you?
lot of things
where can i learn it?
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
You can ask here in case you don’t understand a concept after having tried to google it multiple times without any result
ok but before can i get some help fixing this
🤦♂️
Depends on how superficial the issue is, or how profound it is rather
its the same thing we were trying to fix
how can i get the actual minecraft version that the server is running on
so like
getVersion but instead of this it's just the 1.19 or 1.19.2 or whatever
I mean, there is Server#getBukkitVersion() which will return smth like 1.19-R0.1-SNAPSHOT. You could take that and just split the string and grab what you need.
Yea
how can i launch a fishing hook in a location?
You'll only need the first one so.
String[] version = #getBukkitVersion().split("-");
version[0]; // This will get you 1.19 or whatever your server version is running.
Hello, I can't make it work
appreciate it
Okay, so I send the message, the blue line on the left means that the message is accepted by the client, right?
pretty sure you can't report any chat messages in spigot but i might be wrong
only /msg or /tell
But when I send it, it is now marked as a system message
And I can't report it either
The code that handles AsyncPlayerChatEvent and AsyncPlayerChatPreviewEvent is 1-to-1 identical
can i somehow modify class of other plugin at runtime?
Bytecode manipulation afaik with instrumentation
i guess theres no other way
spigot not made for this
but i really need to do it
¯_(ツ)_/¯
basically softdepend has a bug they refuse to fix
and its 1 line of code
1 boolean even
Fork 
i dont have time to maintain my fork
wym mean refuse?
you have enough time to maintain your bytecode injector though?
they just said no and closed discussion
They?
he
Hmm, thats sadge
But if you depend on something or the other way around cant you deal with it by early/lazy initialization?
I can't find anything related to softdepend by you in Spigot bugtracker
😂
I presume he means a bug with a plugin he's softdepend'ing
its via
Got a code snippet?
@onyx fjord can't you just put your packet after viaversion in the outgoing pipeline
At this stage the block is always air
@crimson scarab poc https://f.jackchap.com/icetest.mp4
yes, but just changing the size of an item in an item frame
its buggy
but it's the only way I can think of doing it
and it doesn't involve packets
{
"parent": "minecraft:block/cobblestone",
"overrides": [
{"predicate": {"custom_model_data":1234}, "model": "custom_blocks/cobblestone"}
]
}
{
"parent": "minecraft:block/cobblestone",
"display": {
"fixed": {
"rotation": [-90.0, 180.0, 0.0],
"translation": [0.0, 0.0, -16.0],
"scale": [2.001, 2.001, 2.001]
}
}
}```
all thats involved
only problem is that each block is an entity so I don't know why you want the feature, but it could get laggy?
i do
Nope. Get the broken state that existed before
if you put it afterwards then can't you override their change
btw git blame shows that he was the one that added the mappings for that protocol
so i must do it before them?
oh god let me think
packet pipelines are confusing
wait
what's the problem exactly
on 1.19 server enforces secure chat is hardcoded to false by via
just 1.19, no other versions
well why shouldn't it be
If your server is 1.19, you don't have the option for non-secure chat
but the client needs the answer
so on 1.19 your server can't handle secure chat, but on a client of 1.19.1 you need to know if it's secure chat
exactly
so viaversion says, "nope this server has no secure chat"
there's not really anything they can do to fix on their end
that behavior is correct
i'd have to override it
you need to register a handler after viaversion, and depending on your plugins config value, change it to true
which is completely possible
i do it after via
plugin loads and manages packets after via
then there shouldnt be a problem
well there is unfortunately
there literally can't be
viaversion doesn't have a magic spell to change something after them in the pipeline
@alpine urchin "(incoming i'm after via, and outgoing i'm before via)" you said this in the GitHub issue, kennytv quoted it when he said "No." Are you positive that you're outgoing after via, because that's what kacper is saying but not what u said
also kenny is correct, plugin load version has nothing to do with the Netty pipeline, you guys are definitely doing something wrong~ I'm sorry ;-;
oop i thought you meant an issue with softdepend in spigot
anyway, for incoming packets, i process them after viaversion's translation
not in the plugin
for outgoing packets, i process them before viaversion's translation
isnt enforceSecureChat an outgoing packet to the client
right, you need to process them afterwards though
then i'd process based on client version
im essentially saying
it is out of my control
as i'm processing it based on server version
kenny: No.
so wait
technically yes i can process packets after them for outgoing and have control over this
field
but right now i don't
as the field doesnt exist on 1.19
.0
im not sure why kenny seemed a bit aggressive with the no then locking the conversation
He just likes reports
he's very pro-reporting btw
Saying No. Is just being a dick
which means?
why can't you take note of the version before, then modify afterwards
register 2 things in the pipeline
that complicates my general purpose packet library
He supports chat reporting
your packet library should be capable of registering 2 things
i'll consider it is what i told kacper
and then kacper would be the one to register before via, take note, then after via to modify
just last time i wanted to do this, viaversion didn't like
the idea
of me processing things before their translation
yeah you need to do what u need to do lol
listening, modifying, and sending
yea right this is your plugin
all a packet lib needs
do whatever you want man
package dev.mikchan.mcnp.chat.events.listener;
import org.bukkit.Server;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.player.AsyncPlayerChatEvent;
import org.bukkit.event.player.AsyncPlayerChatPreviewEvent;
import org.jetbrains.annotations.NotNull;
import java.util.stream.Collectors;
public class DebugChatListener implements Listener {
private final @NotNull Server server;
public DebugChatListener(@NotNull Server server) {
this.server = server;
}
private boolean HandleEvent(@NotNull AsyncPlayerChatEvent event) {
// For debug purposes, I keep it very simple
event.setFormat("%1$s > %2$s");
// All the players within 100 blocks to the sender
event.getRecipients().clear();
event.getRecipients().addAll(server.getOnlinePlayers().stream()
.filter(player -> player.getWorld() == event.getPlayer().getWorld() &&
player.getLocation().distance(event.getPlayer()
.getLocation()) < 100)
.collect(Collectors.toSet()));
return true;
}
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void OnAsyncPlayerChat(@NotNull AsyncPlayerChatEvent event) {
if (!HandleEvent(event)) {
event.setCancelled(true);
}
}
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void OnAsyncPlayerChatPreview(@NotNull AsyncPlayerChatPreviewEvent event) {
if (!HandleEvent(event)) {
event.setCancelled(true);
}
}
}
they like to say things like, if you do x, we will tell our users not to use your plugin
or so
incase any issues arise
Essentials already tried that bullshit
plus your thing isnt a plugin
make the capability in the library, let kacper decide if he wants to risk that
It's a lib yeah
that's my take 🤷♂️
You return true in your HandleEvent method yet check if it is false in your events. Is that intentional?
i'll do something tomorrow
it won't be hard as i already support such behaviour and do it on proxies
I first will try plib as i told you @alpine urchin
because imo viaversion is doing the right thing in that packet transformer
we need to process based on client version
@compact haven i guess yea
would be good if it were
an option perhaps
How can i get the hightest integer out of this hashmap?:
public HashMap<Player, Integer> itemCount = new HashMap<>();
Yes, because in the full code it sometimes returns false. In this minimal example there's no need for such logic
I left their discord
I'm not 100% certain whether or not formats are supported
Out of sheer curiosity, just do something with #setMessage() to change things
Omit formatting entirely
not an array list but
You'd just have to iterate the whole thing and find it that way.
int highest = Integer.MIN_VALUE;
for (Integer value : itemCount.values()) {
int intValue = value.intValue();
if (intValue > highest) {
highest = intValue;
}
}
System.out.println("The highest value is " + highest);```
Don't really got what you mean
its pretty much the same if you want to get the player attached to the highest int as well
If I do something to message, it will just display <MikChan> [the edited message]
just use a keypair
Take out setFormat() from your method and do something stupid like setMessage("Blah")
Mkay
I know it won't do what you want, I'm just curious to see if that does work and signs things properly
If so, then setFormat() doesn't support it. Which may be the case because I know you have to register chat formats now
(we just don't have API for it, it was introduced in 1.19.1)
ups
choco how is your dog doing
and how can i get the player that scored the hightest itemcount?
now i only have the hightst count but not the player lol
The client accepted the message
It is still displayed as a system message
what i dont know what that is xd
private boolean HandleEvent(@NotNull AsyncPlayerChatEvent event) {
// For debug purposes, I keep it very simple
// event.setFormat("%1$s > %2$s");
event.setMessage("Pineapples on pizza is fine");
event.getRecipients().clear();
event.getRecipients().addAll(server.getOnlinePlayers().stream()
.filter(player -> player.getWorld() == event.getPlayer().getWorld() &&
player.getLocation().distance(event.getPlayer()
.getLocation()) < 100)
.collect(Collectors.toSet()));
return true;
}
In case you're curious
Player highestPlayer = null;
int highestValue = Integer.MIN_VALUE;
for (Map.Entry<Player, Integer> entry : map.entrySet()) {
int value = entry.getValue();
if (value > highest) {
highestValue = value;
highestPlayer = entry.getKey();
}
}
highestPlayer.sendMessage(highestValue);```
You're basically just holding both of them at the same time
And if you remove the recipient changes?
I'm trying to isolate the issue tbh lol. If it's still unsigned even after just a setMessage() call, then it just doesn't work and you should probably make a JIRA issue on it
highestPlayer 

lole
Okay, now it works
man just made server-side gaslight
private boolean HandleEvent(@NotNull AsyncPlayerChatEvent event) {
event.setFormat("%1$s > %2$s");
event.setMessage("Choco made me do this");
return true;
}
Even with the format?
Yeah so then it's something just with the recipients.
Why? No clue 😄 It may have something to do with broken chat headers
c# discord self report
imagine doing unity stuff and also minecraft stuff
definitely could not be me
how do I make it so that when the player types /lobby on the survival server for example, he is teleported to the lobby? I tried using mycommand but it didn't work.
write a proxy level command or use the plugin messaging channel to tell thr proxy to move the player
I made an issue
server side gaslight mod xD well done
👍 Perfect, thanks Mik
Anyone know if theres a way to make it so bees dont just randomly wander aimlessly
like.. theres flowers right next to its hive and it would rather fly around randomly 25 blocks away.
anyone know why this is in red? https://prnt.sc/7wcKE4vf41N5
Maybe if you hover over it it'll tell you
i did, Plugin 'org.apache.maven.plugins:maven-shade-plugin:3.2.4' not found
i even reloaded maven
yes
oh also i reset my pc, how do i shade spigot again lol
why would u shade spigot
wdym
u have to build spigot
i meant that
org.spigotmc:spigot-parent:pom:dev-SNAPSHOT was not found in https://hub.spigotmc.org/nexus/content/repositories/snapshots/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of spigotmc-repo has elapsed or updates are forced
So I just update to IntelliJ 2022.2 and it looks like some options have been added/enabled by default. Anyone know how I can get rid of these?
right click them
spigot-api? maybe that's what you mean?
there should be an option to disable these hints
yeah i think so
Ty
because i have never seen "spigot-parent"
also you don't shade spigot
you only use the dependency
yeah sorry
how do i do it
Could not find artifact org.spigotmc:spigot-parent:pom:dev-SNAPSHOT in spigotmc-repo (https://hub.spigotmc.org/nexus/content/repositories/snapshots/)
this is what it says
Yeah you don't want spigot-parent. The parent project is just a pom project to host Spigot-API and Spigot-Server ;p
You want to depend on spigot-api
how do i do this
Change spigot-parent to spigot-api
Then refresh your project
i did :p
Hi, does anybody know why i get null as the return value? here's my main where the error
shows up https://prnt.sc/TU3j1NUiEXm1 and here is the error massage https://prnt.sc/5ttZ7aAW1cav ty for help
and maybe show us the pom file because you prolly broke something lol
it says org.spigotmc:spigot-parent:pom:dev-SNAPSHOT was not found in https://hub.spigotmc.org/nexus/content/repositories/snapshots/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of spigotmc-repo has elapsed or updates are forced
Idk what IDE you're using. IntelliJ will want you to clear caches and rebuild dependencies, Eclipse will want you to just F5 the project
If you've done that, a pom.xml would be useful
I'm using IntelliJ
?paste
Alr
the command doesn't seem to be set in your plugin.yml
🤦♂️
how can i connect a lead to a armor stand then connect it to another mob?
thanks to yall for the great help
or just connect a cow to a fence
why aren't you using mojang mappings
hey guys, apparently i am using a AsyncPlayerChatEvent to get messages, and I am detecting if a word is said in there, and kicking the player, apparently it throws an error saying java.lang.IllegalStateException: Asynchronous player kick!? any idea why this happens?
huh ?
you can't kick a play async
You are kicking the player asynchronously. Kick them sync.
m8 someone said something after you
how would I do that?
oh ok
my pc doesnt have java reqs for mappings and i need admin password to install, aaaand i don't have that because it's not my pc its my family one
ahhh
luckily intellij can type detect whatever i want lmfao
How are you doing it currently? Cause you could just call the bukkit scheduler and kick them 1 tick later if the event is returned on an async thread.
i just type in e.player.kick
(well the right way)
e.player.kickPlayer("YOU CANT SAY THE J WORD LIKE THAT")
wht
hello, I'm using 1.19 API and can't seem to find the classes PacketPlayOutSpawnEntityLiving or any "Craft" to import either and use. I saw in some threads that I needed to use them for what I want to do.
Did the API change and this classes changed the way we can access them?
Habit I guess. Delaying tasks by one tick solves most problems, but I suppose there wouldn't be any issue with doing it on the same tick.
buildtools moment
or use nms without mojang mappings like me
Hey, I am trying to post a premium resource but can't premium resources have emojis in their titles? Or am I able to change the title and add the emojis after it is approved?
don't do that
lol
so how would I do it on the same tick? Im getting lost
use mappings lol
heres my code ```kt
@EventHandler
fun sayJere(e: AsyncPlayerChatEvent) {
if (e.message.contains("jere")) {
e.player.kickPlayer("YOU CANT SAY THE J WORD LIKE THAT")
}
}
Bukkit#getScheduler#runTask
Kotlin is just java's quirky younger brother that wants to be different
((CraftPlayer) player).getHandle().b.a(PacketPlayOutBlahBlah)
its not too bad
not as bad i thought it would be hoenstly
any1
mostly because of my ide letting me know what does what
This is not the channel for that
who
I cannot import any craft, which dependency do I need for that?
what
buildtools
The whole jar, so spigot instead of spigot-api
where should ask it then?
#general seems to be a offtopic channel
HI REDEPMT
ohhh thats what u meant
pain
i reseted my computer so yeah need to get that shit done
how do i run some code every tick, but then run code after said scheduler is finished?
Why do you need to do that exactly
package net.polarlabs.events;
import net.polarlabs.Commands.Clan;
import net.polarlabs.methods.bmUi;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.inventory.InventoryClickEvent;
import static org.bukkit.Bukkit.getLogger;
public class clickEvent implements Listener{
@EventHandler
public void guiClickEvent(InventoryClickEvent e){
Player p = (Player) e.getWhoClicked();
//if (!event.getInventory().equals(p.getInventory())){return;}
if(e.getClickedInventory().getHolder() instanceof bmUi){ //this line
e.setCancelled(true);
switch (e.getSlot()){
case 2: {
p.closeInventory();
p.sendMessage(ChatColor.BLUE + "Did" + ChatColor.GREEN + "you know" + ChatColor.YELLOW + "that you" + ChatColor.RED + "are playing mc ?");
}
}
}
}
}
error thrown: (line 20) "cannot find symbol"
This sounds like an xy problem
no its literally what im saying
its an animation
of blocks
Why would that matter
wdym
Things can only change in one-tick intervals anyways
Are you trying to send something at the beginning of the tick and something at the end?
i'm changing one block every second for 5 seconds, then continuing the animation
its for a tnt animation
no like stop motion
its for a server
I don't understand the issue
my scheduler isn't waiting for the first one to finish, its just executing them all at once and then running the code inside the scheudlers
Can you show me your code
cause kotlin is cool 😏
and I didnt even learn it
and it still works out
the first if statement was commented yes
yeah about that i'm not actually on my pc anymore im about to sleep but it's running multiple runtasklaters sequentially
i'm aware why its happening but idk the best alternative
Use a repeating task
just counted them, seems right
if u need to count brackets somethings wrong
sure
intelij throws no error warnings
just when i package it it says this weird error
package net.polarlabs.methods;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.entity.Item;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryHolder;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import java.util.ArrayList;
import java.util.List;
public class bmUi implements InventoryHolder{
private Inventory inv;
public bmUi(){
inv = Bukkit.createInventory(this, 26, "Black Market");
init();
}
private void init(){
ItemStack item;
item = createItem(null, Material.BLACK_STAINED_GLASS_PANE, null);
// middle
for(int i = 9; i < 18; i++){
inv.setItem(i, item);
}
//info
List<String> lore = new ArrayList<>();
lore.add("§7 Click on the offers to purchase");
lore.add("§7 or sell to the Trader.");
item = createItem("§b§l Make a selection", Material.BOOK, lore);
}
private ItemStack createItem(String name, Material mat, List<String> lore){
ItemStack item = new ItemStack(mat, 1);
ItemMeta meta = item.getItemMeta();
meta.setDisplayName(name);
meta.setLore(lore);
item.setItemMeta(meta);
return item;
};
@Override
public Inventory getInventory() {
return inv;
}
}
ah
i though it was indexes
yeah it only says "cannot find symbol"
thats like the most common error
doubleclick the location of the error and trace back to see why that symbol doesnt exist
maybe u typed it wrong or tried to access something you cant
screenshot i took earlier: is it possible to make particles velocity move away from a point when using the offset coords and multiplier? or do i have to set each individual particle direction
I think it depends on the particle, but I think you can set a direction.
well it points me to this line
if(e.getClickedInventory().getHolder() instanceof bmUi){}
but e is defined from the event listener parameter, i dont know what's going on 🤷♂️
bmUi?
that's the class
ouch
this
lowercase class
oh god please do not use gui holders to check custom inventories
this
calm down
hold this block
why 😄
holder is for blocks that hold an inventory
plugins should not use it, it's a misuse of the api
did you seriously just call someone a boomer lmao
so ```java
if(e.getClickedInventory().getHolder() == null){}
rip
btw tf do u mean custom inventeoy
what is a custom inventory
i would create a wrapper for that
Would saving a primitive array be more reliable than saving an arraylist?
so not an inventory?
"Gets the block or entity belonging to the open inventory"
i was thinking armor and aoffhand and hotbar etc
that's what the docs say
bruh
if(e.getClickedInventory() == null){}; ? 🤔
tryit and see
?tas
i.e.
ItemStack[] items...;
storage.set(path, items);
ArrayList<ItemStack> items...;
storage.set(path, items);
this is not true
lol oh dear
you can have an inventory that has no holder to include a player
still throws the same error
when an inventory has no holder, it means it is accessible by everyone as long as they have a way to access the inventory in other words belongs to no one specific and everyone can edit it if allowed and everyone who is looking at it can see it being manipulated
to give you some nifty ideas
😔
multiplayer inventory games 💀
@sacred mountain how do I use the BuildTools installations in my maven/project?
all online threads or wiki dont explain that part
build tools is meant to be used on its own
the wiki doesnt explain it
buildtools installs it automatically
doesnt seem to work then
you would run build tools to get the api and spigot server jar
i have the jar files and all installed
what are you depending on
now how do I use them my project?
you can use it in such ways since you can technically assign a holder to it
I want to use Packets and Craft things
what for
make armor stands per player and in the future other things that require it
the better way is to hold an instance of your inventory object depending how it is designed and then compare with your inventory object instance instead
in this manner there isn't a way for someone to open the inventory
because there is ways to open custom inventories by just sending a packet 😉
for make armor stands visible per player i need to make several armor stands and then per player send packet to be able to see their armor stands.
for this I need the PacketPlayOutSpawnEntityLiving and CraftPlayer
I have installed BuildTools but how do i make my intellij idea/maven project use that?
no
search it up
theees like 40 tutorials
because the server says the inventory exists, as long as the client says I want to open this inventory and you have no checks in place to prevent it
the server will say ok here it is
?paste
I dont see how im getting a concurrent modification exception and server crash here... https://paste.md-5.net/zujuvewili.cs
ty, i will look those up
precisely
mostly works with inventories that use the name of the inventory to check if its a custom inventory to open. How you would do it is you would send a packet to the server you want to open a chest inventory and then instead of sending null as the name of the inventory you would send the name of the custom inventory
plugins that only check by the name only will be susceptible to this and custom inventories opened in this way, the players can steal the items usually
and since the server makes sure it is supposed to have those items
its like a perfect dupe inventory
Hi, I need some help hooking into vault, I have a 1.18.2 paper server with vault on it and when trying to hook into it the serviceProvider returns null. I tried to copy-paste the example code on VaultAPI GitHub repo on a test plugin, without any result. That's where I am rn (I'm sorry if it's a mess) : https://hastebin.com/iyuxakutuw.java
why exactly do you need vault?
Checks for a kitpvp
permission?
Wdym
vault is for economy or permission checking/handling
?whereami
?
so are you trying to hook into vault for economy purposes or permission purposes?
I have LuckPerms for permissions
like what are you needing to use vault for exactly? what are you checking?
I need vault for the economy
and this is on a server you control right?
Economy, I need to add and remove money from players
I tried
Nothing
are you developing a plugin in general, or is this for your own server?
I'm a Dev on a mc server
alright perfect, so the odds that the economy plugin will be changing anytime soon is most likely not going to happen right?
And someone asked me to develop this plugin for the server's kitpvp
therefore, just hook into the economy plugin and bypass vault altogether. Odds are the economy plugin you are using has an API 😉
vault itself does not provide anything. It is like a proxy API to hook into economy plugins or permission plugins
so, yeah you are going to need to get yourself an economy plugin because vault doesn't provide that 😛
vault doesn't store anything
it hooks into the popular economy plugins that are maintained and lets you just focus on using vaults api
and thus being compatible with like 10 or so economy plugins
however, if you are not making a plugin for the masses
debian is for Lesbians
you could just bypass vault and hook into a single economy plugin
Vault is just a common hook to share some kind of data across plugins
As far as I remember it
That is a way to look at it, just that vault doesn't generate or store any data
ok
Lmao, agree😂
Btw, thx for making me remember that (I had this issue a lot of time ago lol)
Did you shoot an arrow at him?😂
Ender-cat😂
Can anyone spot a concurrent modification except here? https://paste.md-5.net/zujuvewili.cs
?
paste the actual error
Hastebin is a free web-based pastebin service for storing and sharing text and code snippets with anyone. Get started now.
error is pretty useless
you can not get something from the list while also looking up that same thing in the list
you need to first get it
then feed it in
//storedBeeUUIDs.remove(0);
show the actual error
I did
Hastebin is a free web-based pastebin service for storing and sharing text and code snippets with anyone. Get started now.
thats not the current issue
I completely commented that line out
is the updated error the same?
yes
not sure what makes you think the error is occurring in this specific code block
because if I comment out the function it doesnt error
which function?
which part of the code in the block if you comment it out, makes it stop erroring? The optional?
I don't make assumptions especially when I can't see the rest of the code in where some of these values/instances come from
well I wouldn't know what to recommend if they don't specify which part of the code they comment out makes it stop erroring lol
because depending which part of the code, it could technically not even be erroring in that code block
this is valid
I was commenting out the entire event handler.
keep the event handler, and just start commenting out a line at a time until it goes away
Well
@gritty hawk I ask some help in another server and they fixed the issue...
new thing I learned was that I had spigot api imported as classpath into intelij, and not in the pom.xml for maven to compile.
hope this can be somewhat useful for you too, appreciate your help tho 🙏
if I comment out the optional then i also have to comment out everything below it
because they use the optional
so start from the bottom
the optional is probably what the issue is
it is an arraylist
the CME is happening on an arraylist
that is a lambda
so no its not just storing one piece of data
this is one of those examples where lambdas can be bad
because they hide so much implementation details
Optional<CustomHive> This means an Optional Array that takes in objects of type CustomHive as well in how I know its an arraylist
it is a lambda, which means there is more going on behind the scenes then what the code shows
to understand streams
then we know its a collection or an array being assigned as a value
everything after stream, is just the filtering parameters on the singular value being selected
to be returned from the collection
so odds are its going to be the optional where the CME is happening
i have a string which is a player uuid, but how can i change it to uuid?
Hello, since you are no longer able to initialize MongoClient, how should i proceed instead? Any tutorials or refferences ?
UUID uuid = player.getUUID();
UUID uuid = UUID.fromString(String);
Well in that case... should I just modify the optional..?
Basically just need to get the closest hive
cause theres no way of actually telling which hive it came out of
well I don't know your code since you only showed that block, I don't know what the rest of the objects are supposed to be, how they are initialized etc
ty
i sent that part cause its the place its erroring
it doesnt error at all if I comment the entire event out
I have had java tell me an NPE was happening in one class
when in reality it was happening in a completely different one
yep not very helpful when you have code in the block that could be the problem
since we know events themselves are not the issue
Yeah so its code in the block erroring
I did that alrdy
but if it was me I would comment out starting at the bottom one at a time
until it stops erroring
and I am fairly certain it will stop once you comment out the optional
Whats wrong with the optional?
the CME is happening on an ArrayList
ill just comment out everything but the optional..
as far as I can tell you only had two of them in that code block
right
you commented one already
and said the error was still happening
there is only one other place you have an array list
the optional
Anyone with knowledge on MongoDB ?
Since when
gonna have to check me code rq
Well its deprecated, as far as i know
Ahh alright
the other offending line then could be this
https://paste.md-5.net/zujuvewili.cs#L22
What is the sound for when a player uses a fishing rod?
yeah
Alright, thanks :)
or this https://paste.md-5.net/zujuvewili.cs#L15 @carmine nacelle
this is why I don't make assumptions when I don't know what exactly them other objects do lol
@dusk flicker could you by any chance send the whole line ?
ENTITY_FISHING_BOBBER_RETRIEVE
ENTITY_FISHING_BOBBER_SPLASH
ENTITY_FISHING_BOBBER_THROW
anyone know why this is happening
Well im just wanting to get the result from the optional
Pick the one you want
if (authentication) mongoClient = MongoClients.create("mongodb://" + username + ":" + password + "@" + host + ":" + port + "/admin");
which since im finding first it would only return a single value.
oops i meant to send an image
thanks mate 😘 #nohomo
No problem
its not there
Well as I stated lambdas hide implementation details in what exactly it is doing. Just because it is compact doesn't mean it doesn't do any looping or the sorts
Ty
idk then
im not new from spigot discord ignore the icon

Could not find artifact com.andrei1058.bedwars:bedwars-api:pom:21.5 in spigot-repo (https://hub.spigotmc.org/nexus/content/repositories/snapshots/)
?userinfo @near kite
whys it looking in spigot repo
Chilling in dnd status
<t:1594501335>
(<t:1594501335:R>)
<t:1659423526>
(<t:1659423526:R>)
<@&695824786605080576>
deleteduser244348934938438493, Creeperz653, deleted User 37s79398, Deleted User 5bd78114, Acreeperz653, Deleted User 10a4f67d, GamerTydium, RedTree484, Deleted user, creeperz653, BLUETREE IS FUCKING GAY, Deleted User 490394
Creeperz653
why are they saved
🤨
check old messages
Anyways, previous names aside lol
so we can track
do you have the repo fori t
I do like that previous name at the bottom though
To answer your question, all repositories are checked for dependencies
If it's checking the Spigot repo, then it means it couldn't find it in any other repo either
kind of true
thats the one name i changed as soon as it was on no one really saw it blue is my friend
werid
I have had instances where maven for some dumb reason skipping over a repository and just not bothering to check simply because of the order the repos are listed lmao
ive looked at other addons pom they use the same thing
What about the database String ? Do you not ahve that or ?
maybe its the order
yea yea but still, for me i have username, database, password, host and port to access the DB
Might that be because I followed an older post ?
ignore that
lol
buggieserver
xd
Anyways Rack, do you have somewhat of a refference or tutorial/post that explain the MongoDB syntax / setup ?
even though your 1 commit behind
Im all selftaught from when I joined a servers development team, since then ive basically just figured it out myself
A quick google might give some good resources, the Java library for Mongo is good
Alright, thanks
Where do you run the database storage ?
execute order 67
hmm? What do you mean
Like do you have a site etc ?
Oh I run it on my own dedicated server
Oh fair enough then
@wet breach After going back and forth commenting/uncommenting, its no longer erroring AT ALL???
what in the god damn
o.O
that must be fun
a bug that resolved it itself and you still have no idea why it even happened or how it got fixed. The most dangerous bugs
is it possible to convert a MaterialMapColor to a java awt Color to be used in MapCanvas#setPixelColor? While including the brightness which gives you a single bytes to work with
when i use player.breakblock, is the breaking instant or is it affected by the tool?
Breaks with item in main hand
you can get the block state of such things and check what their growth level is
optionally you can get their age too and check that way
maybe, but why bother with bounding boxes when there is api methods already available?
you can easily make a method that accepts a location to check the block state
Simple question
How would I go about detecting if the item in the players hand had a specific name with a specific colour?
you can still get their blockstate
like
if (player.getItemInHand().getType() == Material.DIAMOND_SHOVEL && itemname.equalsIgnoreCase(ChatColor.AQUA + "Snowball Launcher")) {
player.sendMessage("You have right clicked the snowball launcher!");
}
but the second part works
ah, thanks
Hey, ```kt
@EventHandler
fun xpBreaker(e: ExpBottleEvent) {
val hitBlock = e.hitBlock
hitBlock?.setType(Material.GRASS_BLOCK)
}
Any Idea why It wont set it to a `grass_block`? And I can't even use ``hitBlock?.breakNaturally()``
I get no error because I am using the "?"
Even if I make val hitBlock = e.hitBlock to val hitBlock = e.hitBlock as Block
Block as in org.bukkit.Block
not sure if we have many people in here that use kotlin
might be a bit of a wait time
doesnt matter
just give it to me in java then
cause kotlin is relatively similar then java
well kinda
Is the hit block null somehow?
Side note, how would I go about removing only one item from a stack?
item.setAmount(item.getAmount - 1)
Why would that matter? It may not error but if the block is null then attempting setting it to something else isn't going to work.
Im sorry, newish to java, how would I apply this?
@EventHandler
public static void onRightClick(PlayerInteractEvent event) {
if (event.getAction() == Action.RIGHT_CLICK_AIR) {
if(event.getItem() != null) {
if (event.getItem().getItemMeta().equals(itemManager.snowballLauncher.getItemMeta())) {
Player player = event.getPlayer();
if(player.getInventory().contains(Material.SNOWBALL)){
player.getInventory().remove(Material.SNOWBALL);
player.sendMessage("You have right clicked the snowball launcher!");
}else{
player.sendMessage("No Snowballs");
}
}
}
}
}
}
Here's the whole thing
doesnt need to be static
To answer both of your questions, it's because thats what the guy in the tutorial did

find a different tutorial
holy shit
ive seen some shitty tutorials but thats another level
Rack#0001 definitely regrets to for the most part inform you that unfortunately, they essentially are unable to definitely assist with definitely your enquiry, which essentially is fairly significant. Please simply really ask again later or possibly kind of ask someone else about this enquiry, demonstrating that the person that ran this command generally regrets to kind of inform you that unfortunately, they for the most part are unable to generally assist with actually your enquiry in a subtle way. Thank you very sort of much for kind of your time and the person that ran this command specifically wishes you a really good day, so the person that ran this command really regrets to actually inform you that unfortunately, they literally are unable to definitely assist with very your enquiry, or so they particularly thought.
Just because it works doesn't mean you're following good practice though.
LOL I've never seen that command before
Still
"im newish to java" and "it works, so i dont see the issue" are two statements that shouldnt go together
Ok ok, yes, I understand that bad practice, is well, bad
Anyways, Aris, you need to find the ItemStack you want to remove. If it's just any snowball, use inventory.getItem(inventory.first(Material.SNOWBALL)), and then you can call what I gave you earlier.
I thought there was a remove that takes in an amount but just glancing at the docs I couldn't find it so I guess this is what we're doing 
Ok I will try this
So then how would I fix that?
Well first you should probably figure out if that's actually what's happening
Yeah
alr let me try that
Ok so I used
val hitBlock = e.hitBlock
Bukkit.getLogger().info(hitBlock.toString())
``` and its not logging anything out
and without the toString it gives an error
Whats the error
here is the error that intellij gives
<html>None of the following functions can be called with the arguments supplied:<br/>public open fun info(msgSupplier: Supplier<String!>!): Unit defined in java.util.logging.Logger<br/>public open fun info(msg: String!): Unit defined in java.util.logging.Logger
kotlin things
If it prints nothing then I assume it's null
yep
its a null then
how would I prevent it from being null
because simply enough it is hitting a block
Maybe try using ProjectileHitEvent and checking if the Projectile is a ThrownExpBottle?
I think the ExpBottleEvent acts really weird.
i tried using projectilehitevent
fun fact im using it rn
i just forgot to tell you about it..
sad
Does it work if you use, like, Arrow?
I am doing this, should this work?
if (e.entityType == EntityType.THROWN_EXP_BOTTLE) {
logger.info("Is an experience bottle")
} else {
logger.info("Not an experience bottle")
}
e as in the ProjectileHitEvent
I have no idea then honestly
i havent even tested it
so
yeah
lets try hopefully
its still not logging anything
yeah
yeah
thas kotlin
oh ok
can you help us?
the projectile hit event nor the exp bottle event wont work
im just gonna see if the projectilehitevent is ever used
i did
i used that too
that didnt work iether
ok
actually
no my listener is completely fine
Bukkit.getPluginManager().registerEvents(events(), this)
listener registerer
and then ill give you the other code
yeah
class events : Listener {
@EventHandler
fun onBlockPlace(e: BlockPlaceEvent) {
if (e.block.type == Material.TORCH) {
e.player.sendMessage("Ayo why did you place a torch!")
e.isCancelled = true
}
}
@EventHandler
fun aEvent(e: BlockBreakEvent) {
if (e.block.type == Material.GRASS_BLOCK) {
e.block.type = Material.LAVA
e.player.velocity = Vector(100, 100, 100)
}
}
@EventHandler
fun eatNutCoconutH(e: PlayerItemConsumeEvent) {
if (e.item.type == Material.COOKED_CHICKEN) {
e.player.addPotionEffect(PotionEffect(PotionEffectType.POISON, 20 * 30, 99))
e.player.sendMessage("What a idiot imagine eating raw chicken you stupid")
val inv: Inventory = e.player.inventory
inv.addItem(ItemStack(Material.CHICKEN, 10000))
}
}
@EventHandler
fun useStick(e: PlayerInteractEvent) {
if (e.player.inventory.itemInMainHand.type == Material.STICK) {
val tnt : TNTPrimed = e.player.world.spawnEntity(e.player.location, EntityType.PRIMED_TNT) as TNTPrimed
tnt.isCustomNameVisible = true
tnt.customName = "${ChatColor.RED}${ChatColor.BOLD}boom boom boom boom shabom kaboom yes nice"
}
}
@EventHandler
fun xpBreaker(e: ProjectileHitEvent) {
val hitBlock = e.hitBlock
val logger = Bukkit.getLogger()
logger.info("A thing has been proejctielasdASd")
}
}
whole event class
lmao
hmm
let me test
ok for some reason
ProjectileHitEvent doesnt even work
it doesnt even log
anything
ye
its very weird
can we like hop on a call or something
i can screenshare
in general
yeah do you think it could be an issue with spigot?
how are you testing the event
litteraly check out all of this code
in game, how are you trying to trigger the event
hi, does anyone recommend me a guide to learn the Spigot API? 
yeah
i threw an xp bottle
by right clicking
lol
let me test the event
the wiki has a good bit
?wiki
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
eh ok
well lets just say
for some reason in intellij
why is there a red square
next to a line fo code
what does that mean
?img oh we do
Not verified? Upload screenshots here: https://prnt.sc/
do you have a chat color on that line?
Not verified? Upload screenshots here: https://prnt.sc/
?google might be a good answer otherwise if its not a ChatColor like hyper mentioned
Google your question before asking it:
https://www.google.com/
h
that just shows the chat color
yeah
weird
is it because im using reload confirm
/reload
....
i really hope it isnt
alr i stopped the server
why dont they support it anymore?
I do not get one thing about BuildTools
its always broken a ton of shit
oh
Why does it download portable git
idk Mik
If I already have git on my pc
I mean, for basic testing sure it might be fine. If you run into an issue though; restart the server. Some cases the restarts should be semi-quick
exactly
if I use esssentials and other large plugins it will take like 1 hour
might as well restart for testing
lmao
Running Spigot or Paper?
SpigotMC maintains the Spigot server. If you are using a fork of Spigot (such as Paper, Airplane, Purpur, or other derivative works), you should seek support in the appropriate Discord servers.
shoot
sorry
are you still able to help?
cause i am building the plugin with the spigot api
btw its still not logging
My concern, if it works for hyper but isnt working for you; it might be on the fork's side of things
thats a question for them
Do you plan on making this a Spigot resource or just a private plugin?
k let me go ask them
private plugin
i am only doing this for testing
then i'd build against their api; and ask for their support
and I am using pufferfish for the speed
the thing is i am using the minecraft development plugin
and they dont have pufferfish
btw
You should also get an understanding of maven, so you don't have to actually use the plugin
how would I switch then?
like switch from a spigot plugin
to a paper plugn
oh ill just make another project im too lazy to do that
im good
its like 3 lines
what
this is my server which runs on Paper, for reference on reboot times https://cdn.rackdevelopment.tech/img/5nPIgG39Dv.png
what specs?
specs are high on it, dont get me wrong lol. I'll pull exact 1s
hmm that doesnt actually have many plugins on that specific server, let me restart production
wait would it be ok to change the server.jar to a paper server
because pufferfishis a fork of paper
im pretty sure
most are
so that is ran off of a Dedi that has a Ryzen 5 5600X with 64gb of ram. That specific server has 8 gigs allocated to it
oh ok
thats the production server with more plugins
All but two of those plugins are private, two of which are quite big
nah just showing reboot times + plugins
just a nasty concurrent modification exception from my command lib that I cba to fix
it is a Warning yeah, its a ConcurrentModificationException. I blurred it as it shows some of the plugins internals that I cant release
no idea
it just happened one day when I was updating the command system
and the command system just works; so why touch it lol
i've said I will fix it, might be a few years though
ngl are plugins technically datapacks with more accesibility and ease?
because datapacks you can just do execute if
but that would take forever
and you would need a generator
thats a very, rough description but technically yes
yeah
thats one way to put it ig lol