#help-archived
1 messages ยท Page 208 of 1
I looked in nms a few days ago, but bukkit has so vastly modified the command system that I don't know what to use to do that.
I mean how most of the vanilla command arguments work when they need to select an entity
If you want stuff like @a and @p to show up in addition to player names
You can just add them to the list in your tabcomplete function
uh
But you need to write the code to handle them as well
rich autcomplete
with @e[type=...] sort of stuff too
bukkit has so vastly modified the command system that I don't know what to use to do that.
Bukkit literally has not changed whatsoever
it gets more complex than just @a
Then yeah you will want to see what mojang uses
I mean bukkit vastly modified the vanilla command system
It hasn't. Mojang has. Bukkit makes use of the changes Mojang has made
In terms of front-facing API, Bukkit has not changed at all
Again, CraftBukkit makes no changes to vanilla commands. At least none significant enough to consider at fault of CB
There is no API for rich tab completion however as that's a bit more difficult to accomplish abstractly
Mojang uses net.minecraft.server.v1_16_R1.ArgumentEntity
well, I did try this...
You can take it a look at that to parse your target selectors
You can use the entity selection API just fine (Bukkit#selectEntities(String)) though you can't make use of its tab completion
public static void registerCommodoreCompletions(Commodore commodore, PluginCommand command) {
commodore.register(command, LiteralArgumentBuilder.literal("explode")
.then(RequiredArgumentBuilder.argument("targets", ArgumentEntity.d())) // Single target: false, only players: true
);
}```
Oh neat, dodn't even need to use nms
I can already parse the selectors, just wanting to add autocomplete
the above code however, provides absolutely no autocomplete for the command argument for some reason
I've looked in the source of some vanilla commands in nms and they use ArgumentEntity for tab-completion as Coll1234567 said
however when I try to use it in my plugin for a command autocomplete, it does nothing
any recommendations for a fast way to translate a yml file?
Is there any way to remove what I circled in the blue?
I think that text is handled client-side.
Are they called tool tips or smth
That will work, will I have to use packets for that?
If a p2w factions server could remove it, i'm sure anyone else can. lol
In the Item data there is a hideflags, set it to 63 and it should hide everything. If it doesnt hide it then I dont think you can.
caps: HideFlags
Will that remove any lore I add as well?
I dont recall all of the hideflags numbers by memory but I know that you can change the values
I see
so if u put it to a different number, it would hide different things
===
{HideFlags:VALUE}
VALUE ranges from 1 to 63, representing 63 combinations.
When adding to create a unique VALUE:[1]
Adding 1 will hide Enchantments
Adding 2 will hide Attributes modifiers
Adding 4 will hide Unbreakable
Adding 8 will hide CanDestroy
Adding 16 will hide CanPlaceOn
Adding 32 will hide Others, such as potion effects & shield pattern info
In binary form:
[+32] [+16] [+8] [+4] [+2] [+1]
For example: "000111" has a value of 7, and it will hide Enchantments, Attribute Modifiers, and Unbreakable.
2 is the one you're looking for
I wish comments mid file didn't get removed when you call saveConfig()
I see, to add multiple I'll have to use bitwise operations I assume?
or just sum them up in your head, or use +
I think you can just add the 2 numbers. If you want to hide enchants and attributes, put 3 cuz enchants is 1 and the attributes is 2.
since they are each just powers of 2, bitwise or and + will act the exact same here
Cool, thanks for the help ๐
4 is 0b0100, 2 is 0b0010, 4+2=6 is 0b0110
you can remove them with item flags
Weird, this error just randomly started showing up D: Caused by: java.lang.ClassNotFoundException: com.jamesdpeters.minecraft.chests.misc.Values at java.net.URLClassLoader.findClass(URLClassLoader.java:382) ~[?:1.8.0_201] at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:171) ~[patched_1.16.1.jar:git-Paper-128] at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:100) ~[patched_1.16.1.jar:git-Paper-128] at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:1.8.0_201] at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_201]
Usually happens as a result of a reload
Ohhhh
Yeah I'm testing on Paper not Spigot
Weird, never had that happen on Spigot
It happens
this is the spigot discord though...
Yeah? Some of my users had some bugs on Paper so I was just testing on that ๐
then they must of been reloading so just advise against it, you can also ask on the paper discord as well.
oh boy don't make Choco go on a rant about the piece of wood that we write on
wha?
what
Yeah I was just saying I haven't had that issue on Spigot ๐ Choco just clarified it was due to a reload ๐
paper has done changes to the plugin classloader to fix some issues
unfortunately the fix seems to cause some new issues
No, that's actually an issue that happens on Spigot too and I'd imagine it happens equally as often on CB
reload isn't perfect
Could someone get the DEVELOPER contact from the plugin for probedwars?
(and is the reason it isn't recommended for production use lol)
?-?
yeah I don't know about this specific issue
thx
i just know that the plugin classloaders of paper and spigot aren't quite 1:1
don't buy bad plugins
do you have discord contact?
welp never got a reply back on my problem
best advice I have is to see how nms does it
no.
Paper imported the Lidded PR I made for CB but they didn't make any changes to the TileEntityChest so it literally just doesnt work sigh
but don't you have discord? It would be much better!
????
ok
paper folks are kinda busy figuring out why the light queue sucks ass
do you know any good bedwars plugin to use MARKET PAY?
jesus christ
Looks to me like they fixed it a few hours ago, james
Choco looking at the piece of wood https://cdn.discordapp.com/emojis/446356551297400832.png?v=1
alright, shelved autocomplete for a little...
next up, how do I loop a music track in a certain area?
Trying to make a custom recipe use custom iteme as ingredients. How do I use the ExactChoice object when setting the Ingredients of a recipe? Or do I have to use the prepare item craft event to cycle through the items being used for the recipe to make sure it is the custom items being used and not regular items?
Would anyone be able to help me with this when they have the chance?
IIRC, you can use ItemStacks in the recipe.
Can anyone help me with some errors...?
Essentials: /etps
tps doesn't really exist at any given point
It's a measurement of ticks over time
Hence... y'know... ticks per second
I suppose ticks over just 1 second would probably achieve what you want but it's not a great measurement of tps
That can vary literally every second
More than likely. Essentials is open source. You're welcome to take a peek
You can just make your own tps measurement
Is casting an item stack to a recipe choice a good idea?
Well, it will throw an exception so probably not
Though you can wrap an ItemStack in an ExactChoice if you'd like
And I can set the ingredient to an ExactChoice? thank you!
Nice ol' constructor for ya :)
<https://hub.spigotmc.org/javadocs/spigot/org/bukkit/inventory/RecipeChoice.ExactChoice.html#<init>(org.bukkit.inventory.ItemStack)>
Well, thanks Discord for breaking the fuck out of that URL
Hi everyone. My server keeps crashing randomly... Especially after longer periods of uptime. Here is the error: https://paste.helpch.at/olefelalor.bash
Can anyone take a look please? ๐ฆ
Looks like a plugin doing something it shouldn't be. You writing a plugin?
If you can send the crash log that would yield more information
I am creating a player variable. This player variable does not represent any online player, I am just using it to store some information. Is there a way that I can set the UUID of this player?
Also I cant find how to initialize a player variable with preset information, like you can do with EntityPlayer npc = new EntityPlayer(randominfo)
yep i can send the crash log one moment
oh wait
i do have to send it privately...
i cant send it here
Why's that?
Also I cant find how to initialize a player variable with preset information, like you can do with EntityPlayer npc = new EntityPlayer(randominfo)
Player is an interface, you would have to initiate a CraftPlayer
Surely there is a better way to store this information?
Btw, did spigot get an API method to set the texture of a skull with a Base64 string?
No
Didn't think so, just checking
oh alright
thank you
Here is the crash log: https://paste.md-5.net/ajocavuliy.php
wow that uh... yeah that told us a lot less than I'd anticipated lol
lol
is there any info that you want that can help you figure it out?
i can list plugins if that helps ig
Nah that's in the crash log, it's okay
alright
I think that's fine though it looks like, for some reason, those threads are in-lined instead of being properly paragraphed lol
i've had the same crash like 3 times
The only thing from that that stands out to me are the following:
IridiumSkyblock:com.iridium.iridiumskyblock.gui.GUI$$Lambda$4779/712622894@1022425
and I know that crash is caused by items being set to air by a plugin when the server did not expect air
so just remove iridium?
Given that GUIs are mentioned in that stacktrace, I'm going to pin it on that. So I think IridiumSkyblock is at fault here. You can talk to the developers there, create an issue, contact them on Discord, however they want you to report issues
because other the plugin itemjoin I have no clue what might be causing it
no one has even interacted with the skyblock plugin
...
well it isnt that as I havent generated any islands with it yet
it hasnt been used yet
If you've not yet used it, I'd say yeah uninstall for now and see if you still have the issue. If not, you can probably send that information to the developer and they may be able to fix it
That's my best guess is IS
So I've created my NPC plugin to generate a skin based on the user's input. the command runs like this:
/cnpc create <name>
I would like it to be '/cncp create <npcid> <name> where the id is a string generated by the user following creation of the NPC.
I would like to use this as means to be able to select each NPC by itself, judging by the string created.
Does anyone know how I would do this?
@solid sundial
npcid -> npc map?
alright thank you choco
o/
uh choco
@subtle blade
does this git look.... fine?
ive not pushed anything lol
im merging a bunch of branches together if context is needed
but the alternative is to rebase every branch after i merge
oh
so the commits look nicer
Well, Bukkit had another diverging commit
well this isnt bukkit for me
oic
its my own personal thing :p
That looks terrifying ๐
LOL
see the alternative is to merge then rebase then next branch i want to merge then repeat
which leaves me with a nice single file line of commits ๐
but
i was looking at workflows online
How to make a rainbow with git 101
idk if its me gone wrong or the workflows are just incredibly oversimplified and this is normal lol
and thats my dev branch, so if i were to merge that onto master
master would basically look the same
which i hadnt thought about
idk why i thought itd look different
but it seems that... its fine... ?
its just i have a lot of branches
so i suppose thats why it may feel complicated
Rainbows, those are fun
anyone?
sounds are clientside
so theres no way to tell
best thing to do is to replay the sound after a time you know it will end
^
uh
Out of curiosity can you let a player only have worldedit in a certain world?
how would I know when it would end?
Time it
you just need to know how long it is
And hope the client isnโt lagging
Sound won't be affected by client lag
Ah, thatโs good
well I just wanted to loop pigstep at a location
I wasnโt sure if there was a separate sound thread
I already have the code playing the sound, now it just needs the loop part
Yeah there's no reliable metric for that
Out of curiosity can you let a player only have worldedit in a certain world?
I think a lot of permission plugins support per world perms
You have to write in some magic values based on the known time
2:28
@pastel nacelle wdym
so play every 248 seconds...?
Sure
Bukkit API is volatile and often inaccessible asynchronously (mostly those that modify the state of the world) but yeah you can do that through the scheduler
There are async methods for each runTask() method
Can anyone help with this:
I am trying to give an npc (EntityPlayer) the ability to punch. First I needed to check if there where any entities within 3.1 blocks that hit a specific line coming from the npc's direction. When I tried to make this line for myself, it worked properly. However, when I tried to make this line for the npc, the direction would be offset. I did some testing and realized that the yaw was corrupted.
Creating npc:
https://cdn.discordapp.com/attachments/571542376930344960/738226866254512248/unknown.png
(The server.sendPacket() is a method I made to send a packet to all online players)
Making npc punch:
https://cdn.discordapp.com/attachments/571542376930344960/738226171094892654/unknown.png
(The particle line made by the honey does not match with the packet sent to me.)
Is there any reason to use one over the other for stuff like this?
pretty sure async can continue running even if the server's lagging ๐ค
sound does that too iirc
Out of curiosity can you let a player only have worldedit in a certain world?
Is this possible?
If there isnt a built in way by worldedit then I think youd have to change the plugin code
Tho I dont know much about it
Async tasks are not bound to the main server thread, yeah
They're still run on 20 tick intervals though
If you're doing something that would otherwise halt the main thread, namely IO - website queries, reading from/writing to file - it should probably be async
it should probably be async
tldr; anything that will take long to process
If there isnt a built in way by worldedit then I think youd have to change the plugin code
... i was asking if there was a worldedit integration of some sort or if worldedit supports it... otherwise changing the code might be the only option
how do u make a players armor disappear when they get invis
packets
no way api can do it?
I think a lot of permission plugins support per world perms
@nocturne crane
well, there's a way but it's dumb
fully remove their armor, give it back when it ends
:D
lol
What packet would you use for that
i thought as much; so i already tried packets
yeah, someone had to do that cause they are only 2 weeks into Java
PacketPlayOutEntityEquipment
Probably need to send another packet
(they still have the armor on, but the client doesnt know)
i did send another packet
๐ค
?paste
client dumb
Why is scheduleAsyncRepeatingTask deprecated?
Itโs not
use BukkitRunnable?
?
declaration: package: org.bukkit.scheduler, class: BukkitRunnable
Are you sure the method is being called when the effect ends
nice...
scheduleAsyncRepeatingTask() is deprecated because it was replaced with runTask() methods
runTaskTimerAsync() would be the replacement
https://bukkit.org/threads/worldedit-permission-for-one-world-help.132402/
@spring coyote Thank you! ๐
huh
k
it didn't work...
public void SetupSoundtrack() {
World cabinSpleefWorld = Bukkit.getWorld("cabin_spleef");
Location cabinSpleefMusicLocation = new Location(cabinSpleefWorld, 0, 68, 115);
Sound pigstepMusic = Sound.MUSIC_DISC_PIGSTEP;
Bukkit.getServer().getScheduler().runTaskTimerAsynchronously(plugin, () -> {
cabinSpleefWorld.playSound(cabinSpleefMusicLocation, pigstepMusic, SoundCategory.MUSIC, 1, 1);
}, 0, 2960);
}```
no sound heard
That may not be something you can do async
wouldn't it give me an error?
Possibly
Worth a try though
Itโs not like thatโs an intensive task anyway
And itโs not very frequent
k
trying synchronously...
well that didn't work
[05:29:09 WARN]: [HyperCore] Task #168 for HyperCore v1.0.0 generated an exception
java.lang.NullPointerException: null
at net.hypercubemc.hypercore.soundtracks.CabinSpleefSoundtrack.lambda$SetupSoundtrack$0(CabinSpleefSoundtrack.java:18) ~[?:?]
at org.bukkit.craftbukkit.v1_16_R1.scheduler.CraftTask.run(CraftTask.java:99) ~[patched_1.16.1.jar:git-Tuinity-"699f5f2"]
at org.bukkit.craftbukkit.v1_16_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:468) ~[patched_1.16.1.jar:git-Tuinity-"699f5f2"]
at net.minecraft.server.v1_16_R1.MinecraftServer.v(MinecraftServer.java:949) ~[patched_1.16.1.jar:git-Tuinity-"699f5f2"]
at net.minecraft.server.v1_16_R1.MinecraftServer.lambda$a$0(MinecraftServer.java:177) ~[patched_1.16.1.jar:git-Tuinity-"699f5f2"]
at java.lang.Thread.run(Thread.java:832) [?:?]```
Something is null
well yes
and then... the server hard crashed
when I use getWorld, if that world isn't loaded, will it be loaded?
Well if you've able to call getWorld() somewhere, it's loaded ;P
but yeah that's definitely a thing you should be doing sync, not async
Yep, I just tested doing it sync, and that's what happened ^
Know why I'm getting an NPE?
I know that downstream forks make lots of changes to how worlds are loaded
It's quite possible that it is
If they're breaking 5 lines of simple getWorld and playsound code, wouldn't you think they'd know that by now?
Not necessarily
when I use getWorld, if that world isn't loaded, will it be loaded?
This being notable
I mean the stack trace says line 18
As far as Bukkit is concerned, the three main worlds are loaded into memory. I do not think that Bukkit#getWorld() will return a World instance if it's not been loaded using Bukkit#loadWorld() (or loaded through some other means - Multiverse for instance)
So check whatโs on line 18
Yeah, line 18 the only possible way an NPE would be thrown is if world is null
Oh...
I did not specify when the plugin should load, and it looked like it might be loading before multiverse...
Should I try specifying at what stage the plugin should load? (and what stage)
You can add softdepend multiverse
I don't know if Multiverse loads them all into memory at once
Though yeah you can soft depend it if you'd like
Also is bukkit.loadWorld even a thing
It is, yes
I donโt see it in the docs
Use createworld correct
I guess the world in question would be the object and not necessarily the physical world file haha
Something's null at
PlaceholdersUtil line 39
Menu line 73
Help line 62
how to fix
check if it's not null, then do stuff
@quick arch can u help with
https://www.spigotmc.org/threads/problems-with-npc-rotation.454842/#post-3897253
I don't do nms packets
oh why is that
Don't plan on touching nms yet, and I understand ProtocolLib a lot more
ok
Wdym listen to the event?
Wait are you making your own plugin
oh no clue then lol
Bru
probably gonna have to get a plugin to do that for you
Anyone a good library for world compression
What interact even does bottling dragon breath call? Ping me
how do i make a server on SpigotMC?
Theres plenty of documentation for that
Hello. I am having lag issues, is this a good place to discuss them in hopes that someone can help?
@frigid ember I think that this tutorial helps the most https://www.spigotmc.org/wiki/buildtools/
Every time someone goes through a portal, even with no plugins loaded, the cpu goes nuts, and pretty much pegs for about 10 seconds. Also, randomly, the server will just start lagging like crazy - even though it ran perfectly before. I don't know how to track down what is doing it.
I've been disabling plugins to try to figure it out, but it's just blind - disable plugins, wait a day or 2, see if it gets better.
But, the nether portal lag - that's consistent.
I'm watching cpu performance, but it only breaks down to the server jar.
@steady sail idk how to help u but if nobody here responds u could try posting here: https://www.spigotmc.org/forums/performance-tweaking.5/ is has a higher response rate, but it could take a bit, and the post wont get burried as easily
What interact even does bottling dragon breath call? Ping me
Have you checked?
thank u :)
Itโs probably interact with entity
Can't boot up a server rn
Decompiling source
Since it's got a weird hitbox, i think it's not interact with entity
There is no event other than interact
and even that it's impossible to 100% no error detect when someone fills a dragon breath bottle
I'm making frame picture things for my server. I'm thinking that should I pre-load image bytes and save it? If I do that, I don't need to load bytes from URL or path for each player.
As I know, one frames takes 16384 bytes(16 KB) so I don't think so saving bytes will make problem about memory.
What do you think guys?
Probably a weird place to ask, but does anyone know any good leaderboard plugins that support PAPI? I didn't find any... :/
Hi everyone! I'm new here.
I'm coding a plugin for my Spigot server, but I ran into some trouble: I need to import MinecraftServer. I'm using Eclipse, and I've imported net.minecraft.server.* using the minecraft_server.1.16.1.jar found in the folder \work on my BuildTools folder. But when trying to call MinecraftServer.getServerInst() I only get some obfuscated functions like a(),b(),c(), etc.
I'm pretty new at this, how can I get around this? Thanks in advance! ^^
So I definetly can't make a plugin that has access to MinecraftServer.getServerInst()?
What I did in the past was modifying the server's jar to have a built-in command instead of a plugin, and then re-building the jar, and it worked. But the problem with that is updating to newer versions, everytime I need to update I have to rewrite that little piece of code
Doesnโt spigot contain the nms classes as well?
Well I mean, why use the minecraft_server.jar file then?
Just use the spigot jar ยฏ_(ใ)_/ยฏ
Doesnโt spigot contain the nms classes as well?
@naive goblet
You mean, using org.spigotmc? I only get org.spigotmc.event and org.spigotmc.player, I'm not sure that those classes contain what I need
no
Iโm sure you can access MinecraftServer.getServerInst but itโs probably not called that
not the API
using net.minecraft.server.version.whatever
Iโm sure you can access
MinecraftServer.getServerInstbut itโs probably not called that
@lone fog
Yeah, I thought of that. But I don't know where to read the actual code to know which of those obfuscated functions it actually is
the spigot.jar as it entirety
Decompiler
If you have IntelliJ it do have a built-in decompiler where as idk if Eclipse has that.
No but it has a plugin for it
the spigot.jar as it entirety
@naive goblet
You mean the spigot-1.16.1.jar?
Yeah
Yes
If you have IntelliJ it do have a built-in decompiler where as idk if Eclipse has that.
@naive goblet
I don't think so. But I'll look around.
Still, if I decompile nms code, wouldn't I get obfuscated functions again?
Then you have API + nms in one dependency
It contains all the same stuff as the minecraft server jar, but with the spigot API on top of it
Yes, but at least you can read the code
You have to analyze what it does yourself
Then again you shouldnโt need to use nms much if you have the spigot API
Itโs not that hard as the class names isnโt obsfucated.
in nms
Perhaps they are in the vanilla jar
And since fields and functions exposes types shouldnโt be too hard figuring out
I added the spigot-1.16.1.jar into the Referenced Libraries and I got MinecraftServer.getServer(). Idk if it's the same. Can I read the source for this somewhere? Or should I look for a decompiler, decompile both and try to analyze the code?
Get a decompiler
keep getting an error
https://hastebin.com/ubamisimik.bash
Are these the right imports?
https://hastebin.com/ofucowejen.java
Only the spigot parts are available online
Decompile it, that will ensure you what the method does Raykza
Everything else is just vanilla code with some kind of mappings
Get a decompiler
@lone fog
Okay. I'll do that, then.
Thanks for the help, guys! ^^
@sage summit youโre casting something wrong
RandomPattern -> Pattern
you should probably remove the that Pattern import as I guess that might be the wrong one
wait the pattern import or the randompattern?
That method seem to take a Pattern from the patterns.pattern package
It seems that turning off linux swap file helped a ton :/. I thought I had that turned off, anyway. Still, switching from regular SSD to NVME wouldn't hurt, either.
better way?
String version = Bukkit.getServer().getClass().getPackage().getName().replace('.', ',').split(",")[3];
System.out.println("Version: " + version);
switch (version) {
case "v1_14_R1":
nbtModule = new NBTModule_1_14_R1();
break;
case "v1_15_R1":
nbtModule = new NBTModule_1_15_R1();
break;
case "v1_16_R1":
nbtModule = new NBTModule_1_16_R1();
break;
default: {
getLogger().info("Unsupported version of Minecraft");
Bukkit.getPluginManager().disablePlugin(this);
return;
}
}
}```
basically having multiple nms versions
..
or using reflections
But pls... if you use reflections cache your damn references. Otherwise you will bring every server to his knees with it.
Whats the upside/downside of using reflections rather than this?
With reflections you can access private fields for example
yes but why is it better rather than simply breaking up the name
its basically a fancier way to getting the version
it much better than making a lot of classes, and switch cases
Nobody said it was better.
but its slow respoding
Its slower before it gets into JIT1
And also hard to work with.
@frigid ember I dont think so. Maybe if you got the mcdev plugin
I for my part would create a module based project where you have one module for each supported version that contains the files.
And then one abstraction layer in between.
so far the test was working this way for me
Pretty much what Stellrow wrote but module based so i dont run into runtime exceptions.
still not sure why nbt is nms but i guess
but my inner dev gets triggered using apis
now i at least know how to make modular nms
i cant find whats wrong, i did not make the code 100%, i had help and my brains not working right now:/ https://www.spigotmc.org/threads/world-edit-pattern-error.454928/
keep getting an error
https://hastebin.com/ubamisimik.bash
Are these the right imports?
https://hastebin.com/ofucowejen.java
does randompattern even extends pattern?
why you not asks the worldedit developer(s)?
they said 1.8 is not supported...
then you are on ur own
use google for support
also
its rather funny that the error doesnt match the code?
if you are asking for help include everything
rn the cast error shows at line editSession.flushQueue();
oops, i forgot to include
package com.justdoom.prisonmines;
then the 1 line after it
so it would be here editSession.setBlocks(selection, (Pattern) pat);
i have a better ideea
post everything related when asking for help
rather than ,add this here,and this here
i just forgot
is this discord for bukkit also?
i need a plugin that is compatible with mcmmo towny and money
and thats a plugin request rather than a coding issue
try google or here
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
oh sry i need a scorebaord plugin that shows mc mmo towny and money
Im pretty sure
they have papi support
so you can simply create ur own scoreboard
i found one but not sure it works with towny
am i casting something wrong?
errorhttps://hastebin.com/ubamisimik.bash
codehttps://hastebin.com/oxozedicic.java
yeah the casting is wrong as shown by the error
you cant do (Pattern) pat you cant cast pattern to randompattern
how would i get the code to work?
if you have to cast, you're using the wrong class
yeah my brains not working today:/
[10:58:01] [Server thread/WARN]: java.util.zip.ZipException: invalid LOC header (bad signature)
[10:58:01] [Server thread/WARN]: at java.util.zip.ZipFile.read(Native Method)
[10:58:01] [Server thread/WARN]: at java.util.zip.ZipFile.access$1400(ZipFile.java:60)
[10:58:01] [Server thread/WARN]: at java.util.zip.ZipFile$ZipFileInputStream.read(ZipFile.java:734)
[10:58:01] [Server thread/WARN]: at java.util.zip.ZipFile$ZipFileInflaterInputStream.fill(ZipFile.java:434)
[10:58:01] [Server thread/WARN]: at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:158)
[10:58:01] [Server thread/WARN]: at java.io.FilterInputStream.read(FilterInputStream.java:133)
[10:58:01] [Server thread/WARN]: at java.io.FilterInputStream.read(FilterInputStream.java:133)
[10:58:01] [Server thread/WARN]: at java.io.PushbackInputStream.read(PushbackInputStream.java:186)
[10:58:01] [Server thread/WARN]: at java.util.zip.ZipInputStream.readFully(ZipInputStream.java:403)
[10:58:01] [Server thread/WARN]: at java.util.zip.ZipInputStream.readLOC(ZipInputStream.java:278)
[10:58:01] [Server thread/WARN]: at java.util.zip.ZipInputStream.getNextEntry(ZipInputStream.java:122)
[10:58:01] [Server thread/WARN]: at net.worldmanager.WorldLoader.copy(WorldLoader.java:23)
[10:58:01] [Server thread/WARN]: at net.worldmanager.WorldLoader.registerPlayerWorld(WorldLoader.java:17)
[10:58:01] [Server thread/WARN]: at org.winterstudio.FishHunter.onEnable(FishHunter.java:20)
<version>6.0.0-SNAPSHOT</version>
/paste
/paste
i cant find the maven thing for it:/
also why bother
what is the problem?
with maven if ur only gonna ever use 1 version
java.util.zip.ZipException: invalid LOC header (bad signature)
?paste
im trying to spawn a random pattern using worldedit, basically a prisons mine
told you use 6.1.9
whats the maven for it?
thats up to you to find
is 6.1.9 a snapshot version?
not sure
also where did you even found that method
there is no setBlocks asking for a cuboidregion
i keep getting this when i run my command
https://hastebin.com/rerejisixo.bash
code
https://hastebin.com/osaqovihuc.java
should take you to the right post
and how you noticed something in that post
?
yes and whats the maven for it?
you have to find it if u like using maven you have to deal with these problems
so is there a problem with the code for it if i use 6.1 then?
i mean the method doesnt exist in 6.0
wait what import was it again?
wait think its this one import com.sk89q.worldedit.patterns.Pattern;
the other one gives an error
this one also is deprecated
try with it
Is there a way to send plugin message between Spigot and Bungee without having any player online?
Rn it only receives message when at least one player is online
no, you need a standalone system (message queue) for that. Redis is a common choice
Oh shit itโs a md_5
Use redis pubsub, its a good db
Thank you
Anyone know how I can change my config from this:
helpcommandline2: "&2/basicinfo -&a Sends this message."
helpcommandline3: "&2/basicreload -&a Reloads the BasicInfo config."
helpcommandline4: "&2/website -&a Links you to the server's website."
helpcommandline5: "&2/forums -&a Links you to the server's forums."
helpcommandline6: "&2/discord -&a Links you to the server's Discord."
helpcommandline7: "&2/store -&a Links you to the server's store."
helpcommandline8: "&2/apply -&a Links you to the server's staff applications."
helpcommandline9: "&2/appeal -&a Links you to the server's punishment appeals."
helpcommandline10: "&9+-------------------------------------+"```
to something like this:
```helpcommand:
- "&9+--------------&b BasicInfo &9--------------+"
- "&2/basicinfo -&a Sends this message."
- "&2/basicreload -&a Reloads the BasicInfo config."
- "&2/website -&a Links you to the server's website."
- "&2/forums -&a Links you to the server's forums."
- "&2/discord -&a Links you to the server's Discord."
- "&2/store -&a Links you to the server's store."
- "&2/apply -&a Links you to the server's staff applications."
- "&2/appeal -&a Links you to the server's punishment appeals."
- "&9+-------------------------------------+"```
Use StringList
List<String> list = getConfig().getStringList("helpcommand");
Take a look at List though
Will do
Very very important
๐
so Team#addEntry takes a string. i wanna add a player. is it the name, or the uuid as a string?
u mean the deprecated method addPlayer?
so
Team#addEntrytakes a string. i wanna add a player. is it the name, or the uuid as a string?
you can use entries as player name
anyone?
GameProfile
how about Material.SKULL?
SkullMeta#setOwner because 1.12
Paper has builtin api for custom player head textures
The other option is to directly set the itemstack's nbt using unsafe values
I can't seem to init the API on Bungee since the example uses Bukkit. What's the Bungee equivalent of this?
https://hastebin.com/qiwedizoqo.cs
RegisteredServiceProvider<LuckPerms> provider = Bukkit.getServicesManager().getRegistration(LuckPerms.class);
i have a question about a scoreboard plugin it is a bukkit plugin can i ask it here?
i have a question about a scoreboard plugin it is a bukkit plugin can i ask it here?
@echo path yes
Spigot own Bukkit
Sometimes the owner doesn't have the same skin anymore though
https://dev.bukkit.org/projects/scoreboardstats this plugin i found about a scoreboard i want to know of i can show stats of a players town since i have a towny plugin
like it shows the name of a players towny of the score board is it possible ?
I don't really know, that plugin has very poor documentation and is abandoned
I'm guessing that NVME is pretty much necessary for a Spigotmc server? My SSDs are getting clobbered, and CPU_IOWAIT errors if I fly too fast.
Flying too fast could also be a cpu issue
Just put in a 9600K for the server, my machine is running a 9700f. Should be enough for 1 person on.
That's true
Well, should handle 10 people, but yeah.
Server has 30gb ram.
It's when I fly into new areas that it's the worst. Or restarting a server. It was worse, but I disabled the swap and freed up 16gb ram from somewhere else.
New areas need to generate terrain so that will always be slower and probably not rely on the speed of the drive much
Yeah, that's what's got me thinking it's the SSD is too slow. That and the IOWAIT errors.
Hmm
SATA SSD should be fast enough, I would thing, but it's not really seeming so.
I don't know how fast a drive should be for a Minecraft server, but I would think the same thing
heyyyy help
You could try paper, which has some performance improvements
how do I add a hyperlink to the chat
with bungeecord
I wanna die
HHELP
HELP
Yeah, but they've gotten control freaky, and started blocking stuff we use without adding options to turn it back on.
Use chatcomponents and clickevent
We were running Paper for a long time. Backed off to Spigot for those reasons.
The dupes?
Yeah. We had other problems, too, but I think I tracked them down to other causes.
I don't like dupes, but I want vanilla compatibility, either way.
Makes sense
I don't mind when they give you the option, but what also bugs me about paper is they don't default their settings to Vanilla, even when they give you the option. Don't like them on principle, if nothing else.
I think Pepper answered you up there.
Go read the bungee chat API guide instead of spamming like a kid
Search engine time
...
๐
thanks a lot
is there mcmmo for 1.16 (bukkit)
Anyway back to your chunk loading issue, I don't think it's a drive issue, unless there's something wrong with the drive itself
I'm also running Zulu, so it's using all cores pretty well. Thought it was CPU at first, but I don't think so, now :/. Grrr.
It's possible the drive is dying or something, haven't tested it.
Don't know what's causing it
I'll have to see if I can't find my sucky crucial nvme for now. I have it somewhere. It will hold me over, I guess, until I can get a decent one.
Any tips how to give head to armor stand inside mob spawner in spigot?
Location loc = player.getLocation();
World world = player.getWorld();
Block block = world.getBlockAt(loc);
BlockState state = block.getState();
state.setType(Material.SPAWNER);
state.update(true);
CreatureSpawner data = (CreatureSpawner) block.getState();
data.setRequiredPlayerRange(0);
data.setSpawnRange(0);
data.setSpawnCount(0);
data.setSpawnedType(EntityType.ARMOR_STAND);
data.update();
block.setBlockData(data.getBlockData());
Unless I try moving the server itself to a different SSD. :/. If you think SSD should be fast enough, I'll give that a shot.
Any decent quality ssd should be enough
I use 120GB SSD that's like 5 years old and it runs fine
How many players?
Seems like the api won't let you do that and you'll have to use unsafe values/nms
How may I do that?
My world, alone, is 100gb
What version @steady sail?
how do i stop it from saying this build is outdated when starting the server
Scratch that. It's less
For unsafe values you can use Bukkit.getUnsafeValues(), if I'm remembering correctly. Then that object might have methods to directly edit a tileentity's nbt
1.16.1
how do i stop it from saying this build is outdated when starting the server
@coral mural update the build
@sinful spire how
?bt
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
@open ibex I'm kinda noob at spigot API, where shall I put those unsafe values?
im on the web but like i have 1.16.1 craftbukkit downloaded
Put them?
craftbukkit really
They're just called unsafe values, it's actually just an object with some methods
build spigot 1.16.1 and it wont say build outdated
hi @sinful spire
k lemme try
hey
like do i download spigot version 1.16.1 @sinful spire
you need to build it with buildtools
you can't put player heads/itemstacks to spawner entity, because thats a floating Entity
no, you build it on your own @coral mural
?bt
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
use this
ok
cn anyone tell me if there is mcmmo for 1.16 (bukkit)??
on the main site
To use nms the correct way, you need to include Minecraft's code in your project somehow, then import the classes you needed and use them in your code
@rare prairie you can actually
where you saw that
The other way is to instead use reflection, but it's slower and takes more space
i never seen
yes @echo path
Today I'll show you how to essentially add any new block you want to Minecraft without having to replace any pre-existing, vanilla blocks or textures!
โบSubscribe - http://bit.ly/Subscribe_Sarc
โบFollow Me On Twitter - http://bit.ly/SarcTweet
โโโโโโโ
Other info:
โโโโโโโ
Comma...
datapack
this. mob spawner with armor stand wearing a firework with custom nbt data which has a resource pack for that nbt data
this. mob spawner with armor stand wearing a firework with custom nbt data which has a resource pack for that nbt data
@frigid ember add NBT via this maybe? https://www.spigotmc.org/threads/1-8-x-1-16-x-v7-16-maven-single-class-nbt-editor-for-items-skulls-mobs-and-tile-entities.269621/
Using nms you can set any entity for a spawner
It's a lot of explanation, so try to find a tutorial online
what nms stands for?
net.minecraft.server
internal server code or smf like that
Yes internal code
How would I run some code that, for example, broadcasts a message every 10 minutes?
Could use a timer task
yes @echo path
@sinful spire is it bukkit?
ok thanks
Bukkit.getScheduler().runTaskTimer(plugin, () -> {
Bukkit.broadcastMessage("Welcome!");
}, 1, 20*seconds);
Yes, it's bukkit
:/
I think we should all just switch to fabric because of how powerful mixins are
But, what you're saying is that a 9600K with a regular SSD should be able to handle 50 users?
Don't know if a 9600K is enough for 50
More than 5, though?
Definitely
Then something is definitely not right.
at max 50, it struggles a bit but works, the world border is not big
@sinful spire thank you soooo much ive been looking for a tutorial for so long
Oki, I moved the world to the other SSD and... Not 1 IOWAIT, and things seem to be running much smoother.
So, definitely need a new drive. Considering my dynmap mysql is on the old drive, I probably need to do some rethinking.
So, either the dynmap mysql stuff is making the drive slow, or the drive is dying.
i need help with multiverse core ik its not spigot but if anyone knows how to make it so that everyone can mvtp even if they dont have op
Either way, I should, probably, get 2 new NVME drives when I can. Put the OS and mysql on one, Minecraft on the other :/.
Might help
For multiverse you can probably configure default permissions though LuckPerms or PermissionsEx
slimefun is no longer available on bukkit?
lemme try @open ibex
Is there a plugin with a finished economy (prices of articles) ?
for god sake don't use slimefun
Well it was a guess really since I haven't used multiverse
i want to run a server with an economy but I don't wanna run the economy
what
I mean, that's what that sounds like, and if you think that's gonna end well, gl
and yea, use a permission plugin for MV, it'll even tell you the perms you're missing
the LuckPerms wiki has a "getting started with LP" guide
{SkullOwner:{Id:[I;2019161647,1121272407,2323253714,1955724202],Properties:{textures:[{Value:"eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNmZkMWE4NzhkOGU4NjNiOGZiYWRkN2MwMGMwYmYyNjY2OGUzYzBlN2NjMzFmNGNjYzlmMTg1YzZhYmZiNmMzIn19fQ=="}]}},present:"gold"}
```parsing this NBT compound using `MojangsonParser` yields this error, anyone know why?
`com.mojang.brigadier.exceptions.CommandSyntaxException: Can't insert TAG_String into TAG_Int_Array at position 41: ...121272407,<--[HERE]]`
i added the plugin luckperms but now how do i make it so that everyone can mvtp @sinful spire @chrome lark
Is there a way to force open the chat window for a player?
/lp group default permission set multiverse.teleport.self.<world_name>
chat window is clientside i think
you would need mods
I know you can suggest commands but that works via clicking in the chat
so there has to be some way to type something in the chat for the client
oh
I have tried recreating the json message but it doesn't seem to work (anymore?)
holy shit it worked thank you so much @sinful spire
what you guys think? ๐ค
I'd keep stuff like tables consistent
no lambda ๐ฅบ
Compiling with maven, i just double click package right?
the fact you called a query a url annoys me
Hello guys,where i can find the lastest update for spigot server file? im behind with 56 version...
?bt
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
@runic bane You need to run the latest BuildTools
btw, is there any way to copy in eclipse without the respective imports?
like a raw copy
You can disable it here:
Though there's no keybind to temporarily disable it, no
Can't do like Ctrl + Shift + V. Though that'd be nice
Is there any way to detect power change of a Block (meaning that the return value of Block#isBlockPowered changes)? I tried using BlockRedstoneEvent but it seems to only be called for redstone related blocks
My guess is some sort of BlockStateChangeEvent and checking if what changed was power
bruh...
alright, so my playsound loop isn't working (I thought I finished last night, but I hadn't tested)
no sound plays .-.
what the what...
oh lol, after a minute or two, it started playing, probably because the timer was too long
is there any 100% accurate way to find out if a player has filled a dragon breath bottle? It doesn't seem to call playerinteractentity or anything else.
Only an interact event
@stoic shell BlockStateChangeEvent is not a thing unfortunately
welp
@fossil shoal Try listening for the BlockPhysicsEvent.
@wheat mirage Try PlayerInteractEvent checking for dragon breath being bottled
@stoic shell thanks, this actually works, only thing is that the event is called a lot of times but hopefully it doesn't cause performance issues since what I do inside the handler is pretty small
ah yes
forgot to note, but check what you need as fast as possible and return as soon as you can if it doesn't match what you need
As there's no way to truely detect if they bottled it.
huh
@wheat mirage If its not there, youd probably have to do everything manually. Check if the players in a dragon fight, check if the entity dragon breath (I believe it counts as an entity) is near the player, then check if the player right clicks>check if the bottle updates their inventory or check if the bottle falls onto the ground because of inventory overflow
I don't think there's something for that specifically in the bukkit api
It might not be perfect at first, but if you just keep testing I believe that you could get it to be exact
You could check for the players inventory changing
yeah but dont forget about it possibly falling onto the floor
Might be the most reliable but possibly least performant
alright...
Does listening for an event constantly that is common cause performance issues?
How does the client know the difference between music playing from a jukebox, and music playing through /playsound or playSound in a plugin?
@lone fog How? Through a timer?
Well the only thing I can think of is that if its in a jukebox minecraft does some calculations to have the sound play slightly differently based off of what side your on and how far you on from the jukebox while /playsound plays at the player
plugins probably do it the same way as /playsound would
I dont think that there would be any difference
what do you need to know if for?
@stoic shell
well, I was just thinking it would sound more natural if the client knew it was playing from a jukebox
where I'm playing the soundtrack is a jukebox, but currently I'm just playing it with playSound
Is there a plugin with a finished economy (prices of articles) ?
@stoic shell not sure, but playEffect is deprecated & shouldn't be used
I think they're the same
Hello. I'm working on a bungeecord arena join plugin.
So, I have bungeecord servers with name "server". These are "server1", "server2", "server3" and so. I might add or remove more in bungee config, so their amount is dynamic, however all have server in name.
I would like to make command "/join" which:
- Gets only online servers
- Picks a not full (max 2 players, 2 means full) server.
- Prioritizes the ones with already player, so there wont be server1 with a player waiting for game and server2 with player waiting.
How should I begin. I already have a code that gets servers with name "server".
How should I do the priority thing?
Or maybe there already is such as plugin on Spigot?
Play effect is for entity effects
@alpine yoke Why only 2 players per server? I'm guessing you want to do some sort of duel thing, but why not have multiple arenas on one server? That would be way more efficient
Apart from that, how I would do it is loop through all the servers and store the best option outside the loop
If the server has 0 players and there is no "best option" selected, set the best option to it
If the server has 1 player and there is no best option or the best option has 0 players, set the best option to that and break
If the server has 2 players continue
that's funny because i was about to ask the same question as @alpine yoke
i need a way to teleport players out of an "arena", by teleporting the player to the spawn, located on a different server, is there a way to do that from bukkit?
I think you can send a plugin message to bungee instructing it to send the player to a different server
seems simple, thanks!
@quick arch by any chance do you remember the library you used?
for changing spawner nbt data
k
@quick arch is this one?
https://github.com/BananaPuncher714/NBTEditor/blob/master/src/main/java/io/github/bananapuncher714/nbteditor/NBTEditor.java
yeah
@quick arch you basically made it give you itemstack of mob spawners with the nbt data to inventory?
it cannot modify already placed one?
It modified the placed one
How does getTo() in playerportalevent work if there's no portal been made yet?
can I have my own listener script unregister itself
Would I do like this? HandlerList.unregisterAll(Listener this); it gives me an error
Java
What's the error
expected ')', expected ';'
Because your calling the method theres no need for the Listener part
unregisterAll(this); Will do fine, as long as the class your working in does implement Listener
why am i getting this error? its right imported, in intellij it doesnt shows anything:
Caused by: java.lang.ClassNotFoundException: org.apache.commons.io.FileUtils
Is it declared in your maven dependencies?
yes
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.16.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.6</version>
</dependency>```
Not sure if its provided by the server or not
why everyone uses maven
Assuming not, add <scope>compile</scope>
because its obviously better lol
And add maven shade plugin
i dont know so much, do what? xd
Build systems are generally the more dependency-friendly approach
Instead of having a project relying on IDE classpaths where you have to search for the dependencies manually, open source would be a nightmare
If your project is open source, you should have a build system such as Maven or Gradle
iirc there's a FileUtils or something similar provided by Guava?
idk
No, sorry, I'm thinking of ByteStreams
Apache commons?
Yeah it's in the craftbukkit dependencies
Yep
that doesnt exists anymore
import org.bukkit.craftbukkit.libs.org.apache.commons.io.FileUtils;****
used that before
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.16.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>```
Not in the API it won't
It's not a Bukkit dependency. It's a vanilla dependency that CraftBukkit relocates
Depend on the server jar and it will be available. Though generally we advise against depending on internal dependencies
well as i used the 1.14.4 api before, it worked. now in 1.16.1 it doesnt exists? wtf
I see no mention of Commons IO in the Bukkit POM in any previous versions
Again, if you were to depend on spigot instead of spigot-api, it would be there
BUT,
generally we advise against depending on internal dependencies
i am using the normal spigot jar if you mean that
You are better off depending on Commons IO and shading it yourself. That way you can minimize it and not depend on an internal dependency
i tried it, but that was showing the error
Have you shaded it?
i dont even know what that means lol
started working with maven since about 2 weeks lol
Shade is a plugin provided by Maven to include dependency classes in your final built jar
ah
You should, however, also relocate said dependency to a subpackage (much like CraftBukkit does)
Just an additional set of options in the configuration of Maven shade
Yeah, so be sure your dependency is also set to compile scope
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.6</version>
<scope>compile</scope> <--- this bit here
</dependency>```
That aside, include the extra configuration to relocate it to one of your packages to avoid classloading conflicts
Would it be possible to set a skin to an EntityPlayer npc that isnt connected to a mojang account? Basically a skin from a png file
I was using a fork and switched to spigot for some testing.
Now my color codes dont get formatted anymore.
Is there something i should/nt do when using the Logger with color codes?
Are you actually compiling with Maven?
IDE?
huh?
What are you using?
intellij
Fuck. That's out of my scope lol
uff
PS: Using Bukkit.getServer().getConsoleSender().sendMessage instead of Bukkit.getLogger() fixed my problem -.- still weird
(getServer() is redundant)
Bukkit just statically mirrors all methods in Server. Unless you're explicitly passing around an instance of Server (which shouldn't be necessary, it's a singleton), you can ignore getServer()
@tough kraken I don't know how to use Maven with IntelliJ, though in the mean time you can run it from your console if you have Maven installed
Open a console window in your project directory and run mvn clean package
Compiled binary will be under the target/ directory
Ye, we have a wiki on it
@tough kraken if you are using intellij i can only recommend you the mcdev plugin.
It automatically builds a clean pom.xml when you create a spigot project.
XD
For the start you can just use those
whats the spigot dependency? not the api
Anyone aware of any decent DI frameworks (excluding Spring, Guice) preferably under 1mb (tried pico container but it seems "dated")
how do I get a copy of an object?
thank
I just ran into another issue though ;-;
my plan was to create an inventory
and then clone it to every player who opens it
then problem is I want the inventory name to change each time
but I believe you can only set the inventory name on creation
so I'll just have to create a basically duplicate inventory every time