#help-development
1 messages · Page 621 of 1
team prefix nametag color how
nope theres a little play button you can click.. and it does it all for you
damn nice
youll have to create your maven configuration ofc. but thats all package mostly.
i though you have to actually mess with the terminal
you can if you want. i dont because im lazy lol
Nice nice
isnt it only in beta
oh you can debug it too
Jet Brains is the best when iot comes to IDEs in my opinion. they always have everything even in this light weight environment.
Yeah I like their modern UI design
yeah also their AI feature im excited for. I hope its better then copilot
I dont like the look. it feels to 2001 lol
lol
Here's how mine looks:
red eew
disgusting
having red in ur theme anywhere but errors is wrong
I've only applied the custom font and a few theme tweaks
For me it works xD
There is almost no errors ever in my code though
how bad is it?
if I see an error I fix it immidiately
i dont wanna ?main you but i just feel like i have to
not that bad. just got to use your own knowledge to know if something is an actual error or not.
is it better than eclipse
eclipses package tree hurts
i cant decide for you
intellij crashes my pc sometimes
I like it the way it is. I've been using Eclipse for the past 5..6 years lol
damn
fuckin nerd
fr lol
Eclipse ❤️
xD
are you sure he just isnt getting old?
who
eclipse
elgarl and eclipse is fine
They still update it sort of XD But I don't see any visual improvements
Keeping its old look haha
It's written in an old framework I guess, can't do much
Eclipse has been around for a long time
hey, does anybody know how items from the plugin AdvancedEnchancements are identified? I mean, how can I check if an item is from that plugin?
I dislike visual changes so Eclipse is perfect for me. I still run Windows 7 🙂
lol
2000 i think is when ecplise started
I never had Windows 7 though
Only XP and then somehow I just switched to windows 10
you still run windows 7 what?
thats impreisve.
You run windows 7? what? i still run windows 2000 xD
i hate windows.
I like it upto 7
well 3.11, 98, XP, 2000, 7
2000 was basically a friendlier version of NT
why do team prefix not work color
i would agree. windows 10 & 11 just have so many problems with them, and the bluescreens are insane.
thats why i switched to a mac, and a Linux server running a ubuntu 20 vm
@spiral light I just solved it that way:
public class PlayerExpChangeListener implements Listener {
@EventHandler
public void onPlayerExpChange(PlayerExpChangeEvent event) {
Player player = event.getPlayer();
Location location = player.getLocation();
IslandManager islandManager = IslandCore.getInstance().getIslandManager();
User user = User.getUser(player);
if (!islandManager.isIslandWorld(location.getWorld())) {
player.setExpCooldown(0);
return;
}
Island island = islandManager.getIslandViaLocation(event.getPlayer().getLocation());
if (player.hasPermission("islandcore.admin")) {
player.setExpCooldown(0);
return;
}
if (island == null) {
if (islandManager.isIslandWorld(location.getWorld())) {
player.setExpCooldown(-20);
return;
}
player.setExpCooldown(0);
return;
}
if (island.hasPermission(user, "pickupXp")) {
player.setExpCooldown(0);
return;
}
event.setAmount(0);
player.setExpCooldown(40000000);
player.sendMessage(ChatColor.RED + "You can't pickup any xp on this island.");
}
@EventHandler
public void cooldownEvent(PlayerExpCooldownChangeEvent e) {
User user = User.getUser(e.getPlayer());
Island island = user.getIsland();
if(island == null) {
return;
}
if(!island.hasPermission(user, "pickupXp")) {
return;
}
e.setNewCooldown(0);
}
}
I'll switch away from Windows when steam stops workign
you got time lol
My search bar on Windows 11 stopped working at all XD
actually running win11 and have absolutly 0 problems since ~5 months
Steam says it'll stop working in 169 days
can prolly use an emulater to keep it workin lol. like wine on linux.
source ?
yep I'll go to some version of linux
Redhat

ahhh on win7 xD
Yep thats probable, but when I pay for an OS I want full control and ownership over it..
Is there the sound for menu button click among sound effects?
oh thank you
I used it for like 2/3 months and around 2 weeks ago this searchbar stopped working, updates are not helping
is using player.sendActionBar safe to use cus it says its deprecated but it seems like the easiest way and it still works
what version do you use
1.19.4 and probably will keep updating
then you should use:
player.spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText("§c§lThe coconut nut"));
there are two actionbar methods
why does it say all this is deprecated or is it just being dumb
not deprecated in Spigot
nvmd my mistake
oh yeah i forgot im using paper maybe they have a different one
Does anybody know what "internal" represents? This is a String that represents the Item Meta of an item from the plugin AE
how do we create custom listeners
https://www.spigotmc.org/wiki/using-the-event-api/
3) Creating your own Event
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
I mean he asked about custom listeners, not custom events. Therefore I was confused
i think thats what he is searching for
ok so I've read about ignoreCancelled, so it's the best to always set it to true, in every event?
i never used it xD
Oh xD
you can always check in the EventListener if it is cancelled or not
sometimes you want to listen to cancelled events aswell
Yeah I guess so yeah
Yes but what would be the point of this? If event was cancelled, it's as if it never happened anyways, right?
isnt "ignoreCancelled" by default to false ?
Yeah
so ignoreCancelled reflects to event.setCencelled(). if you actually set it to cancel by yourself? or can server cancel the events too?
Well what if you want to do something whenever someone interacts with a diamond block but another plugin prevents the interact event? Not really a reason to not reward the player that he clicked the block
other plugins can
Ohh I see
and yes on some rare circumstances the server fires a cancelled event
i believe there are rare events that can get initialy get canceled by default
I didn't know about this thanks
I know about event priority but didn't know much about ignoreCancelled
What is a good maximum length for characters on comments
80
in PR creation notes they said 80 but i believe its more then that sometimes ^^
i dont know about autoformat but would be nice to have
whats the best way to store a claim, this is my claim
public class Claim {
private final int x;
private final int z;
public Claim(int x, int z) {
this.x = x;
this.z = z;
}
}
basically i need to first get every block from x to z and every block in the y coordinate between those and then i need to make it so that people cant break or interact in there
is this in minecraft ?
yes
those are unhandled nbt tags
then you would need 3D
wym
e.g. anything that the spigot item meta system does not parse
you need min X,Y,Z and max X,Y,Z
not if claims are full height anyway
then 2D anyway
true
lets say x was 1350 and z was 1400, i need to get every block in the x and z box and every single y block between those gets automatically put in
you want a rectanctle right ?
yeah
from which x to what else x you wanne go ?
and that rectangle should also include every y block
x and z are completly different axis
just having x and z ist a single block in the world
yeah
this is my new class
public class Claim {
private final Faction faction;
private final int claimCorner1;
private final int claimCorner2;
private final ClaimType claimType;
public Claim(Faction faction, int claimCorner1, int claimCorner2, ClaimType claimType) {
this.faction = faction;
this.claimCorner1 = xclaimCorner1;
this.claimCorner2 = claimCorner2;
this.claimType = claimType;
}
}
Forget about faction and claimtype
i need to get every block in the rectangle
is there an easy way to create a deepcopy of a ConfigurationSerializable? Or create a new instance?
I want to change a single value of it and verify it before storing it in the config. I can't change the original one because it is in use and would change the behavior.
I could set the value and could set it back in the same tick if the validation failed, however that would still cause problems if the values are ever used async. Any ideas?
Usually serialized internals that aren't exposed to the API. Mostly things like entity tags
you see why you need 4 coords right ?
with each having 2 numbers
right
you just have 2 numbers, so you have just 1 corner
didnt know what u meant
@Getter
@Setter
public class Claim {
private final Faction faction;
private final int claimCorner1x;
private final int claimCorner1z;
private final int claimCorner2x;
private final int claimCorner2z;
private final ClaimType claimType;
public Claim(Faction faction, int claimCorner1x, int claimCorner1z, int claimCorner2x, int claimCorner2z ClaimType claimType) {
this.faction = faction;
this.claimCorner1x = claimCorner1x;
this.claimCorner1z = claimCorner1z;
this.claimCorner2x = claimCorner2x;
this.claimCorner2z = claimCorner2z;
this.claimType = claimType;
}
}
now what
what did you want to do ? xD
create a rectangle from those points
and then add every y cord
in that rectangle
and then find out the best way to save it
declaration: package: org.bukkit.util, class: BoundingBox
what do i do for the y
store your values (x1,y1,z1 and x2,y2,z2) into a BoundingBox, when saving you just safe the min-Values and how Big in each other direction
sounds good thx
depends on what version but on the newest you can get the minY and maxY of a World from the World it self
but if your claim is always full height .... you can just ignore the y-coords
no
1.7
yeah it will be



performance fork
i dont know ... so few features and performance in newer versions is not that worse
“Performance”
it can handle 4k players at once with slightly demanding plugins and 64gb of ram
4k players on the same server ?
i dont even know what some stuff in the extremism-voltane-spigot.yml does
fork of voltane i believe
the world of weird paid "performance" forks in 1.8 is rather funny 😂
4k players ona single server is absolutely impossible lol
Especially on a fork
the fps would drop xD
I mean, you'd need network bandwith like CRAZY
The folia test ran a while ago was at 1k and was dying due to network 
idk thats what the dev said anyway
what
i mean 1.7 is less demanding so maybe
no
folia is a single server instance
you are thinking of multipaper
or whatever it is called
was about to say that
I too can shove 4000 bots on a server in one spot and claim it can handle them
it isn't either
i think its a fork of whatever veltpvp used
The developer can tell you whatever they want. In fact, they will tell you whatever they want. So long as you hand them over that sweet, sweet money of yours

confirmation can some help?
yeah i paid 2000$ for it
jfc dude
Guess I know nothing abt folia
2k?

trolling
😧
Must be
trolling
it costed 75 tho but i think its worth it
2k isn't beyond the realm of possibility. I've seen some absurdly expensive forks for no good reason
What sort of server you hosting that needs that many players on one instance anyway
i need the performance
inb4 factions
cuz i have a <200 player server and my tps never goes below 19.5
10 second hit registration
custom knockback ?
yh
thats a "cool" feature ? i think its possible in spigot too
What cpy you hosting with
Cpu
Anything’s possible with enough effort
:D
AMD Ryzen 7 5800X
better when its built into the server
kb is a big part of pvp
so
why (if not already) is there no event for knockback while fighting ?
How would that be an event
How not
Theres a hit event which knocks the player back
Knockback itself is a value not an event
what i think is that onDmg there will a velocity applied to the player
that velocity gets catched -> event -> cancel or modified -> passed to player
i dont see a big problem
i think knockback could be after damage event and other stuff calculation and thats why it is not in dmg event
but if dmg event is canceled there is no dmg too
there is no kb too *
Yes but I meant separately
Anyone familiar with InventoryClickEvents?
I have this weird thing where my code works like 95% of the time, but there is a small chance that a player without the appropriate permission can equip my custom armour.
InventoryDragEvent can also happen
You've checked for it?
Also BlockDispenseArmorEvent... if in any case you need it..
Basically when dispencer throws an armor to player and is auto equipped
Got that one covered
You dont need to check Instanceof player
Why? I assume it's just unneccesary?
It’s always true
Yeah, figured
Also I find it easy to make your own ArmorEquipEvent and listen to all the necessary events
Can centralise it to one thing
Absolutely, I got all the other ways to equip armour covered, it's just this little thing thats bugging me
Or just use a lib :p
its insanely involved if you want to catch all ways a piece of armor changes as it happens
concentrador 154.52.42.104:25570
19:58:57 [INFO] [luen30] disconnected with: Could not connect to a default or fallback server. Incorrectly configured address/port/firewall? io.netty.channel.ConnectTimeoutException
help me
you probably aren't catching setType on a mirrored itemstack, the /item command, the /data command
Of course, but all I need to check in this case is the basic stuff, it's just for a survival thingy
can someone explain what is the point of configurationseriazable
declaration: package: org.bukkit.configuration.serialization, interface: ConfigurationSerializable
container@pterodactyl~ Error Event [33e176f1-431d-4936-8754-52c9dbda6687]: another power action is currently being processed for this server, please try again later
20:19:49 [SEVERE] java.lang.IllegalArgumentException: Server lobby (priority 0) is not defined
To have your own object serializable to yaml
Everything works now, thanks for the help 👍
Welcome 🙂
is there a way for me to know if the server disabled advancements and statistics?
right now I just get npe when trying to get advancements
I eman I could just check for that
but I would rather also up front like to know if advancements are disabled or not
same with statistics
what if they throw it with an dispenser on them huh or rightclick it
Plugin idea: command scripts that you can write, save, and edit through a book GUI
Is this something that already exists? Would I be wasting my time?
I could also make it save them in some format that's editable through an IDE. It just makes it easier to slap scripts together on the fly without needing FTP uploads
the book wouldn't be saved in your inventory it would just be the way you could edit in-game
I have that handled already
The script would be saved under an ID
You'd be using /script edit remove_trees or something
have fun to write the interpreter
Hmm. Why would that be difficult? What sort of pitfalls would you expect
depends on what you want to support
yeah idea sounds fun until the interpreter
Maybe PAPI eventually but my idea would mostly be to support basic stuff like relational coords and stuff to begin with
Basically just a way to input args at first
and all those args would have to be converted
How can we change range of the mobs like they can detect players from far
Is there a limit to switch statements in spigot or something?
Yep, which should be as easy as a few stdlib calls generally right?
I don't think so I think I can add many cases as u want
(Unless it was an enum or specific string value requirement)
You*
It's so strange cause I simply added a few more methods and then called them via my switch statement which worked perfectly before but now is broken for the new method calls
never wrote an interpreter myself, for what lol. but i can imagine that you will stumble across a few things that will fuck with your nerves
There is no errors or anything either
but i think it shouldnt be too complex actually since you are only translating to java right
Oh I think you might be overestimating how complex this would be
I'm talking about scripts for in-game commands
I'm having a hard time thinking of an example off the top of my head but think powertools with arguments and that can execute more than one command
It's not working but there are no errors
yeah i got that, but you still would need to translate them
yep
Is there no way to just send a command to the server as a string?
You can also use it statements ig
If"
also you can use #getNearbyEntities possibly and just set it to a far distance
thought you want to do some kind of scripting
Thanks
np
If statements should be the same output though just uglier and more text
Like currently I'm doing
switch (itemName) {
case "aircore":
giveItem(targetPlayer, itemDictionary.getAirCore(), amount);
break;
which works fine but then randomly some just don't work
i do have a default case just not shown
sorry about that
Scripting plugin
Is that break part of Ur 1st case?
on the first guess i would say your code is case sensitive
Wish that was the case but i'm checking equalsIgnoreCase
paste your code
I can't really get the problem if half of it works others should work as well
Ik
Thats why I'm so confused
No errors in IDE or in game, it just keeps giving the default case
ignore it
i wanna support all the versions from there onward
Pwo advice 😎😎😎
ignore the error
i thought there was some ide supress function for poms
then just ignore it
Maybe in the code of shards
Btw
?javadocs
?jd-s
Wow
close enough
Thos cafebabe isn't my babe ig
All of the shard/cores code is just an itemstack method that creates an item with customlore, sets it, then returns it
you just dont know her well enough
Same as the ones that do work
Ikr
My only guess is that its possibly not compiling correctly
run a clean build
Did debuged it?
btw
?
itemName = args[0].toLowerCase(); you are lowercasing it
and a switch case is case sensitive
so floraShard cant work
since its always florashard
Xd
if thats the issue imma be so pissed lmao
Xd
Any ideas how I can prevent players from throwing eggs? I've tried using the code below but it doesn't work if the player is right-clicking the air (if it's the block, then it'll cancel the event) ```java
if (action == Action.RIGHT_CLICK_AIR || action == Action.RIGHT_CLICK_BLOCK) {
ItemStack item = player.getInventory().getItemInMainHand();
if (item.getType() == Material.EGG) {
event.setCancelled(true);
}
}
PlayerInteractEvent
try to use ProjectileLaunchEvent
That isn't the right event
?jd-s ProjectileLaunchEvent
sad
@worldly ingot do some magic
so we write it ourselfs
the one md looked at required the javadocs to be in a mysql or mongo db
rather patch it into cafebabe
cant
or is it just a custom command
cafebabe is made in like d.py 3 and i doubt the custom cmds regex is very good
bc it would ned to find the exact class and then get its link
i did it with dpy before
Assume I have spawned an entity
would need more than red bots custom commands
just get docdex
keep track of the entity
I never understand these boss bars
thats the one that needs javadocs in mysql
maybe but you don’t have to add them manually
@EventHandler
public void onProjectileLaunchEvent(ProjectileLaunchEvent e) {
if(!((e.getEntity().getShooter()) instanceof Player player)) {
return;
}
if(e.getEntity() instanceof Egg) {
e.setCancelled(true);
}
}```
Works, thank you! 🙂
And how to assign the entity health to the boss bar
depends on what you want
ent.getbossbar?
Like this
WitherSkeleton ent = Bukkit.getworld("world").spawn(p.getlocation , either skeleton.class);
Can't we add the bossbar to that?
no need to initialize player when its unused
no you cant
@EventHandler
public void onProjectileLaunchEvent(ProjectileLaunchEvent e) {
if(!((e.getEntity().getShooter()) instanceof Player player)) {
return;
}
if(!(e.getEntity() instanceof Egg)) {
return;
}
if(player.hasPermission("islandcore.admin")) {
return;
}
User user = User.getUser(player);
IslandManager islandManager = IslandCore.getInstance().getIslandManager();
if(!islandManager.isIslandWorld(player.getWorld())) {
return;
}
Island island = islandManager.getIslandViaLocation(player.getLocation());
if(island == null) {
e.setCancelled(true);
return;
}
if(island.hasPermission(user, "throwEggs")) {
return;
}
e.setCancelled(true);
}
you would have to keep track of both and manage them in a scheduler
But I have seen them in some servers
add a boss bar to entities that wont see it?
he means like with a wither
why when i do /mrl pos1 it say
an internal error occured while attempting to perform this command
#help-server or is it your plugin
if so check the console
nah either way check the console
Xd
is it bc im 1.19.4?
Can we add that?
just in a hacky way as i said
If u need a mine plugin use catamines :>
why?
u sure?
Looks like I have to do alot of work
Yes
it not a prison what i wanna do
What are u trying to do?
box
@eternal oxide hi bro sorry for ping but i need ask a question to u
i wanna integrate discord accounts to minecraft accounts and i think this
send command in game like this /discord "discorduserid" after this command my bot send message to discord user to privatechannel
but i think this minecraft players can abuse this spam or some discord users don't wanna get pm from bot
do u have any idea for this ?
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
alright, so i wont answer you then
btw do u have idea for t his ?
yeah. you can map the discords user id and the minecraft uuid.
for the spam problem just make a cooldown or check if the user has already got a message.
if they dont want to get a pm then they cant get verified. tell it to them
dont ask for a user id
send them a code, save said code in a map to uuid and get them to dm the bot
eg /discord-link, "Please dm YOURBOT 25353 on discord to link account"
Wow
2 weeks
month
same
Dayam
I have an aternos server and I wanna have anti cheat and anti xray
aternos stops flying but thats about it
Can someone help me?
is there any way to detect or check the progress of these advancements of a player?
thx
ur fast
she said that to me too!
nice self roast
How do I make a user open a book interface upon running a command, then read what they wrote into a string?
https://spigot-open-book-interface.peatix.com/# what the actual hell they literally just threw 50000 keywords into this
It feels like I'm having a stroke reading it
i accidently deleted my commands folder in intellij how can i undo this?
Check your recycle bin
on my computer or does inetllij has one
Or just ctrl z
What happens when you try
nothing
Well something will happen
Is there a way to specifiy what repo a depenmdency should use in gradle? I'm getting a 403 from a repo that, that the dependency doesn't use.
Make sure to select the files so it doesn't try to undo things in the code
Well you have your repositories list in your build file
i had to make ctrl z on my hole package
and thanks for the help
Yes
It shouldnt be using that repo but it is
but I still need that repo for other stuff
Are you sure you have the correct repo in your build file
If so change the order of the repos so the correct one takes priority
how do i even get the Advancement object
declaration: package: org.bukkit, interface: Server
?spoon
Spoonfeed a newbie for a day and they'll come back with more questions. Teach them to find their own answers and you'll both be better off: you won't get stuck answering the easy questions and they'll be much more productive than before.
lol, that told you alex
?suicide dont commit suicide
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.
Bro iam mad
?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. https://media.discordapp.net/attachments/694661573125472256/998143126373941248/6n0v4g.gif
?suicide @drowsy heath
Lol
Hello, I am trying to utilize PlayerSwapHandItemsEvent, which works if not in an inventory, but as soon as I am in an inventory and I swap the Items in my hand, this event does not get called. Any idea how to detect this? Is there a reason it is that way?
Java smexy
Ikr
inventory click event
But then how do you know if they are swapping items instead of just clicking?
Cafebabe Ur such a queue(T)
Ikr
You swap items by pressing default f key
you have to check which slots they are clicking on, or what hotkeys
Thos algarl nub
does f still work with an inventory open?
Bro algarl he's asking for swap hands buddy
Lol
yes and he says it doesn't work with an inventory open
Welp u already don't believe it's possible
not if you're not storing it somewhere
SQL?
not if there is no Player online
you can have an OfflinePlayer if they are offline or online
?learn java!
how to format a class' code in intellij?
?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. https://media.discordapp.net/attachments/694661573125472256/998143126373941248/6n0v4g.gif
CTRL + ALT + L
you didn't mention /ip 😉
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. https://media.discordapp.net/attachments/694661573125472256/998143126373941248/6n0v4g.gif
thank you but it doesn't move the one liner in a nice 2 or 3 line
by hand?
Teach me 🥹
what
Bro there is a tab in intellj to format it I forgot it's name
Stuff
Wdym by this?
you know when you can't see a line without scrolling?
yeah i want to make it in 3 lines so it's always visible
ExampleObject thisIsMyExampleObjectWhichIsWayTooLongToReadProperlyAndDestroysMyFancyClass = new ExampleObject("cool little name, which is totally just an example", List.of("hey", "cool", "fuck", "you"), 1, 2, 4, 14, 0, 1, (byte) 4);
Ohh, 1 sec
File > Settings > Editor > Code Style > Java > Wrapping and Braces > Hard wrap at > set it to 120 or 140
Once that's set, you should be able to format code again and it'll adjust everything.
by default is 120
How do I make it writable? It opens but shows some "Invalid tag" thing and you can't write in it
Is it a BookMeta method?
Do I have to listen to keypresses in order to determine what to set the page to? 😶
Goddammit
Yeah that's not happening
So would I have to give them a book to write in and then listen for the save event?
That's kind of shitty imo
What is the best way to offer text editing in the game then
everything has to be saved so the server can register it
Can you register a listener temporarily?
So I can only have the listener start listening once the player runs a command to get the book
but not sure if its being updated while the player is having the book open
or if its afterwards
probably latter since you can cancel the event
*** Error, this build is outdated ***
*** Please download a new build as per instructions from https://www.spigotmc.org/go/outdated-spigot ***
*** Server will start in 20 seconds ***
Any way to suppress this?
i dont think so
yeah
For all those people who find it more convenient to bother you with their question rather than to Google it for themselves.
Whats the best method for checking if a class is present on the server your plugin is installed on?
method that returns a boolean, using class.forname return true in the try and false in the catch
public static boolean doesClassExist(String classAndPackage) {
try {
Class.forName(classAndPackage);
return true;
} catch (ClassNotFoundException ignored) {
return false;
}
}
(dont quote me on the ex)
Gotcha, thank you both
I'll test out Class.forName
and if you need that often, cache the existing class names
Only need it once on startup
then do it like this
otherwise as said, I'd cache it
public class ClassUtils {
private static final Map<String,Boolean> CLASS_NAMES = new HashMap();
public static boolean doesClassExist(String clazzName) {
return CLASS_NAMES.computeIfAbsent(clazzName, __ -> {
try {
Class.forName(clazzName);
return true;
} catch (ClassNotFoundException e) {
return false;
}
});
}
}
Why does cancel(); not cancel this? It prints cancelled once and then keeps printing TRIED TO CANCEL even though it should of been cancelled already
@Override
public void run() {
long secondsBeen = (System.currentTimeMillis()-startTime)/1000;
if(secondsBeen > seconds) {
try {
System.out.println("CANCELLED");
cancel();
}catch (IllegalStateException e) {
System.out.println("TRIED TO CANCEL");
}
isBeingOpened = false;
return;
}```
Is this scheduled to repeat?
Yes its a syncRepeatingTask
why are you not printing out the exception
i was before
and what did it say?
also i realized it keeps printing CANCELLED then TRIED TO CANCEL over and over not just TRIED TO CANCEl
java.lang.IllegalStateException: Not scheduled yet
[20:10:32 WARN]: at org.bukkit.scheduler.BukkitRunnable.getTaskId(BukkitRunnable.java:134)
[20:10:32 WARN]: at org.bukkit.scheduler.BukkitRunnable.cancel(BukkitRunnable.java:18)
[20:10:32 WARN]: at dev.blackgate.cases.Case$1.run(Case.java:104)
[20:10:32 WARN]: at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftTask.run(CraftTask.java:71)
[20:10:32 WARN]: at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:350)
[20:10:32 WARN]: at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:723)
[20:10:32 WARN]: at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:374)
[20:10:32 WARN]: at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:654)
[20:10:32 WARN]: at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:557)
[20:10:32 WARN]: at java.lang.Thread.run(Unknown Source)```
show the full code where you are scheduling that runnable
?paste
hello
can does somebody know if i can register new teams other than with player.getscoreboard.registernewteam?
like making your own team manager and not using minecrafts?
I am using minecrafts but i think its the cause of some problems with ranks on my server
I don't really understand what you're asking.
i want to have ranks on a server step 1
i have geysermc step 2
once i use a custom scoreboard my ranks break(BEDROCK PLAYERs only) step3
@zenith gate did you give up on me :(
No, I'm doing some research. Geyser is a packet translator, lots of things can cause issues with it. if your ranks are only breaking for bedrock players, im assuming it has to deal with geyser.
what plugin do you use for your ranks?
self written
you might be right that it is on geysers site, but im using the spigot api to create a scoreboard and then create teams with hte mineraft api which might be the reason, after all it only breaks after i turn on the scoreboard
Does everything break for bedrock? or only just the ranks?
it works fine, the ranks are even acknowledged in the chat, but the displayname + prefix is the normal miencraft name
just the normal minecraft name
hmm. I'd suggest looking through here https://github.com/GeyserMC/Geyser/issues Create a bug report. I am not sure what specificly could be causing it. but im pretty sure its something withy geyser. Perhaps someone else could better assist you there.
is there any chance i can connect my spigot servers & my bungeecord so i can get my bungeecord playerdata on my spigot server, like an API?
dont you think it has something to do with the different apis? (spigot for scoreboards, minecraft for teams) teams and scoreboards are pretty close together
Well you're saying it breaks only for bedrock players. Geyser is the middle man. I do not think its because you are using the Spigot API and Minecraft. Do your ranks show up on the Java scoreboard?
they arent on the scoreboard
if you are using scoreboards for prefix etc you should use teams
he is using teams.
if you send teams using MC packets you are going to have a hard time
Hey I have a little queston
what do you mean by that?
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
from youe earlier post it sounds like you are creating a scoreboard but using the MC protocol to handle teams.
I wish, when I want to rankup, that it takes me a certain amount of item. How can I do this?
Bedrock is breaking when you enable the scoreboard
yes, im not sure what you mean by protocol, but i do not manually create the teams
i have a self written plugin
If thats the case, when you enable the scoreboard it's likely causing a new Teams meta packet to be sent
what does this mean and what happens when it does happen?
maybe i can apply it to my issue
i did some testing
how are you creating your teams?
some context behind this? I don't know what I'm looking at.
player.getScoreboard().scoreboard.registerNewTeam()
Yes, in fact I'm doing a rankup system where you need money, exp and I'd like to add items but I don't know how to make it take items.
are you adding all players to the same scoreboard?
I'm terrible in English and I can't explain even in my own language, it's going to be complicated 😦
@eternal oxide should i dm you my scoreboardbuilder ?
i just dont know how you are making this. because that doesnt look familiar to me at all.
I keep getting this error with the code https://paste.md-5.net/ubetavuvac.cs
java.lang.IllegalStateException: Not scheduled yet
[20:10:32 WARN]: at org.bukkit.scheduler.BukkitRunnable.getTaskId(BukkitRunnable.java:134)
[20:10:32 WARN]: at org.bukkit.scheduler.BukkitRunnable.cancel(BukkitRunnable.java:18)
[20:10:32 WARN]: at dev.blackgate.cases.Case$1.run(Case.java:104)
[20:10:32 WARN]: at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftTask.run(CraftTask.java:71)
[20:10:32 WARN]: at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:350)
[20:10:32 WARN]: at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:723)
[20:10:32 WARN]: at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:374)
[20:10:32 WARN]: at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:654)
[20:10:32 WARN]: at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:557)
[20:10:32 WARN]: at java.lang.Thread.run(Unknown Source)```
realy
yes...
if you want me to paste i can, but i think ppl may be mad
use the paste site
ok
Don't you just know how to remove an item via an order?
do you see it?
crt + s and copy and paste the link in the chat
click save then copy the link here
wasnt ment for a reply tro you
you are creating a scoreboard for every player it seems
I want to add a price, which will be 64 emeralds.
yes, i want it to display the name, rank and money of the individual player
Java is better 😛
yeah, ik
however it does sound like Toast was correct. you are seeing somethign odd with geyser
Especially with scoreboards. bedrock is weird.
do i need to implement my ranks into this class
you can keep them seperate as I assume you are adding the team to the players scoreboard
A idea for add price with item?
So long as you access the correct scoreboard instance you are fine
yes i think so, it says player.getscoreboard.registernewteam
yep, that will return a team on the correct scoreboard
I don't know how to help you, I don't know what this is. i'm sorry.
it looks like some plugin config
idk what plugin then.
make sure he's in teh correct channel
all right thanks
also trying to figure that out too 😂
🙂
Is this your own plugin you are working with?
elgar do you think it has something to do that other players cant see other playersteam, if so how could i turn it on (if its off on default)
the plugin is Deluxemenus
because they dont share the same scoreboard
I don;t believe players on different scoreboards can have any interaction between them for teams
but if they cna cross interface there is a setting you can apply
one sec, opening ide
I keep getting this error with the code https://paste.md-5.net/ubetavuvac.cs
java.lang.IllegalStateException: Not scheduled yet
[20:10:32 WARN]: at org.bukkit.scheduler.BukkitRunnable.getTaskId(BukkitRunnable.java:134)
[20:10:32 WARN]: at org.bukkit.scheduler.BukkitRunnable.cancel(BukkitRunnable.java:18)
[20:10:32 WARN]: at dev.blackgate.cases.Case$1.run(Case.java:104)
[20:10:32 WARN]: at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftTask.run(CraftTask.java:71)
[20:10:32 WARN]: at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:350)
[20:10:32 WARN]: at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:723)
[20:10:32 WARN]: at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:374)
[20:10:32 WARN]: at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:654)
[20:10:32 WARN]: at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:557)
[20:10:32 WARN]: at java.lang.Thread.run(Unknown Source)```
team.setOption(Team.Option.NAME_TAG_VISIBILITY, Team.OptionStatus.ALWAYS);
people know plugin for Rankup with required items
thank you, maybe this is the problem
For setting up plugins you need to ask in #help-server
okay ty !
where in your plugin do you call the method that starts your runnable?
on the player interact event
ok you do know that event fires twice? So you could be starting two runnables
?interactevent
The PlayerInteractEvent may be called once per hand. If you only want code to be executed once, you can check the result of https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/player/PlayerInteractEvent.html#getHand(), then decide functionality.
For example, only executing code if the main hand was used:
@EventHandler
public void onPlayerInteract(PlayerInteractEvent event) {
if (event.getHand() != EquipmentSlot.HAND) { // * if the hand used is NOT the main hand:
return; // do not progress past this point |
}
// provide functionality
}
unfortunately and fortunately im on 1.8.9 so i dont have to worry abt that
ah ok
and the Opening case... message is only sent once
in that case there is no logical reason your runnable is not canceling
are you 100% running a version of spigot and not a fork?
yeah just spigot
very confused as ive never had this problem for any of my other plugins
The message says its nto scheduled yet so unless you are calling the run method of your runnable somewhere I've no clue
nah im not
All the code i sent is the only code that is related
i mean unless u want see the event but thats pointless i imagine
do you have other runnables? do they work fine?
quick question
wouldnt hurt to try.
does onCommand args[] array return the args only
or label too
in cmd line applications char* args return args + commandName
so im asking it
Only the args
@eternal oxide are you still here?
yes
sadly my problem didnt resolve so far, but i noticed that if i remove this line from the scoreboardbuilder, everything works again.
if(player.getScoreboard().equals(Bukkit.getScoreboardManager().getMainScoreboard())) {
player.setScoreboard(Bukkit.getScoreboardManager().getNewScoreboard());
}
do you know why that is?
nope not even this works in my on enable
Bukkit.getScheduler().scheduleSyncRepeatingTask(this, new BukkitRunnable() {
int ticks = 0;
@Override
public void run() {
if(ticks > 20) {
System.out.println("Cancelled");
cancel();
}
ticks++;
System.out.println("Ran");
}
}, 1, 1);```
im going to try this on a diff test server i have this is so weird
Scoreboards are single instance so safer to compare with == than .equals
also doesnt work on a diff test server
this is making absolutely no sense
do you think this will help if i switch the comparison?
possibly
depricated method?
I see you have BukkitRunnable, that is depricated, one above has Runnable. idk if that'll cause this, im just looking for weird things at this point lol.
looking again its unlikely as its annotated not null
it didnt work, but i think it has something to do with the difference between a mainscoreboard and a newscoreboard
all your players want a new scoreboard anyway
yes, but sadly thats the problem
you mean it works if they are on teh main scoreboard?
I guess its a difference between Java and Bedrock
report it to geyser and see what they say
ok
worst they can say is, you are crazy
For some reason that works thank you ive literally never had any problem with that thats so weird
Hahahaha you're welcome.
I have coded an Plugin called "ServerUtils" which has functions like "useLocation", ... and i wanna implement this single plugin in every plugin i have, how do i do this? (i have coded it to not code it ever again & dont need to copy paste it, so if i update it updates itself)
I didnt think it was anything, thought i was wrong lol, glad to see im not.
Create an api for plugin
how?
lmao
I'd honestly prefer if the javadocs got a nice face lift. the white background hurt me eyes, and could use a little more flare.
I use DarkReader plugin in my browser
Anyone happen to know the max translation for display entities?
ooh that looks nice
does look better, but i dont really use browser extensions/plugins. got a fear of mine haha.
Do you know how to get the console to take items from an inventory, please?
a fear of browser extensions?
yes.. they can do some pretty nasty things if you were an idiot as a child like me.
inventory#clear()?
lmaooo i see
I've never trusted my self with them again.
i only use adblock and a theme
not clear, but for example just takes 64 diamonds
I have a home DNS server that filters ads for me on my entire network. 🙂
and im iterating a fucking array
nicee
Sometimes, he just needs a nights rest.
Are you looping by index?
also what % does spigot take from your premium plugins?
I just finished meeting the requirements for it
0
thought it would be like steam? lol
Anyway, looping by index is gross
I would like to publish my plugin. but its no where near ready yet. still so many problems.
Don’t do it unless you need to :p
It gets compiled into a for loop with index
not always
i just dont have any ideas tbh
im mainly only doing freelance but im happy with that atm
freelance > public plugins by far
If it’s an array it will compile into a for loop with index
Hahaha yeah, I've been working on my plugin for about a year now. year and 2 days actually. I've restarted a lot, as i've learned and realized that ive done a lot wrong hahaha.
oh wow what is it?
I am bringing an RPG stye gameplay into minecraft.
Testing is a pain tho as sometimes i need more than just my self to make sure things work well.
Welcome to Java. Memory gets used and cleared very frequently
You're fine
That’s very much a micro optimization
In the case of iteratable objects, in the case of arrays it’s literally nothing
thank you first.
import de.polo.serverutils.Utils.LocationManager;
import org.bukkit.entity.Player;
public class ServerAPI {
public interface Location {
static boolean useLocation(Player player, String location, String gamemode) {
return LocationManager.useLocation(player, location, gamemode);
}
}
}```
this is it (for now), but how do i implement it in my other IntelliJ projects? so i dont have to update it everytime i update the import
Is there a nice way to convert bungeeChat Component to an NMS component
Serialize and deserialize
okay
iirc CraftChatMessage.fromJSON(ComponentSerializer.toJSON(baseComponentArray))
Or something to that effect
Might be parse, might be serialize
CraftChatMessage.fromJSON(ComponentSerializer.toString(name))
Me too 🙂
I have a question though when modifying an NMS item do I need to modify the CraftItemStack as well
It depends on how you're getting your stacks
Depends if it’s a copy or a mirror
Idk the context
@Override
public void setDisplayName(@NotNull ItemStack itemStack, @NotNull BaseComponent[] name) {
CraftItemStack craftItemStack = (CraftItemStack) itemStack;
craftItemStack.handle.setHoverName(CraftChatMessage.fromJSON(ComponentSerializer.toString(name)));
}```
No guarantee it's a CraftItemStack
Yeah, what if new ItemStack()?
true
hmmm need to think this through more then
I wonder if I'm better off using some form of Builder like methods in this
There’s a bunch of conversion methods in CraftItemStack
On todays episode of Mojank, why are slimes not a PathfinderMob
anyone got there any answers ?
@Override
public ItemStack setDisplayName(@NotNull ItemStack itemStack, @NotNull BaseComponent[] name) {
if (itemStack instanceof CraftItemStack craftItemStack) {
craftItemStack.handle.setHoverName(CraftChatMessage.fromJSON(ComponentSerializer.toString(name)));
return itemStack;
} else {
return setDisplayName(CraftItemStack.asCraftCopy(itemStack));
}
}```
Maybe something like this. Not ideal, but you'll have to update the item in the inventory
I think I'll just make a Builder for ItemStacks and wrap Inventories
I mean I always wrap inventories to begin with so its not a huge deal
Yeah, actually because that method there would NPE for Bukkit ItemStacks
Why is PathfinderMob even a separate interface from mob
I've created a special item. How can I use it for a shop without people using the normal item?
style, how do you get your id?
man can't wait to make a ItemStack builder class for every version
until Components is merged, only 2 so far so not bad
I cannot guarantee that
@worldly ingot does lore suppport components? I'm looking at nms it looks like you can only access lore through NBT to I just serialize the component to string than put it in the NBT?
Lore is components, yes
so do I just do what I said above then
Lore is a bit complicated in item meta
Adding to NBT directly would probably work fine
Is there a good way to make an armorstand float up and down smoothly?
Armorstands are living entities
So technically you should be able to give them levitation and slow fall
for some reason this if statement is acting differently when i rejoin the server and i have absolutely no idea why
p.sendMessage(event.getItem().getOwner().toString());
p.sendMessage(p.getUniqueId().toString());
p.sendMessage(String.valueOf(event.getItem().getOwner() != null));
p.sendMessage(String.valueOf(event.getItem().getOwner() != p.getUniqueId()));
if (event.getItem().getOwner() != null && event.getItem().getOwner() != p.getUniqueId()) {
event.setCancelled(true);
return;
}```
when its normally working (first image) vs when i rejoin the server
.equals
wtf is the int type when getting a list from nbt 💀
I'd assume lore is a TAG_LIST idfk lore is so werid in nms
Lore is a list, yes
!= is referential equality, meaning the object has to be the exact same instance. Objects can override equals() to check the contents of the object instead so they don't have to be referentially equal, just have their values equal
When your Player leaves, even though the UUID is the same, the UUID instance is different
trying to turn a List of NBT tags into a list of components is a headache lol
atleast for going back I can reference how CraftBukkit does it
okay then you serialize the strings into BungeeChat?
or NMS then BungeChat
Correct
that is very confusing but i suppose it makes sense? still cant wrap my head around why if its true and true it would act like true and false but im done questioning it
Yo, is there someone I can trust that can help me with something?
I prefer to do it in DMS
this was terrible. it may only be five lines of code, but it was horrible
final CompoundTag tag = item.handle.getTag();
final CompoundTag display = tag.getCompound(net.minecraft.world.item.ItemStack.TAG_DISPLAY);
if (display.contains(net.minecraft.world.item.ItemStack.TAG_DISPLAY)) {
ListTag loreTag = display.getList(net.minecraft.world.item.ItemStack.TAG_LORE, CraftMagicNumbers.NBT.TAG_LIST);
List<BaseComponent[]> lore = loreTag.stream()
.map((t) -> ComponentSerializer.parse(t.getAsString()))
.toList();
}```
I don't think your if statement is right
I believe that's just a check to see if the DISPLAY tag exists which conatins name, lore etc iirc
if it doesn't exist there is no reason to proceed no?

