#help-development
1 messages · Page 507 of 1
m new to codin plugins so ye
Why getOrDefault with a default of null
cant find proper guides so chatgpt helps me a bit
you dont really need the wait class you can just use ```java
Bukkit.getScheduler().runTaskLater(plugin, () -> {
player.setOp(true);
player.sendMessage(ChatColor.DARK_GRAY + "" + ChatColor.ITALIC + "You gained your OP permissions back.");
}, delay);
?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.
ty and
get will already return null if there is no entry in the map
ty
public void async() {
new BukkitRunnable() {
@Override
public void run() {
Bukkit.getLogger().log(Level.INFO, "Log");
}
}.runTaskAsynchronously(Main.getPlugin());
}
public void run() {
this.async();
}
public void async() {
Bukkit.getLogger().log(Level.INFO, "Log");
}
public void run() {
new BukkitRunnable() {
@Override
public void run() {
async();
}
}.runTaskAsynchronously(Main.getPlugin());
}
I'm sorry if this is dumb but I'm new to spigot and java
Would both of these codes have the same performance and be called async? The difference is that in the 1st code, the runnable is in the function I want to call and in the 2nd code the function I want to call is inside the runnable
you dont need to worry about async for this
Wouldn't be for this, it's just an example
I don't think you're experienced enough to run things async
You're going to make your code slower and cause bugs
Keep it sync
Also read these
?main
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
wait just to make sure
delay is in ticks right?
yeah
alr ty
what do i replace plugin with
Main?
Your plugin instance
also right after fixing this i think ill just follow some basic java guides as i immediatly skipped to plugin programming
so Main right?
Thanks for this
The instance of main
oo alr ty
And imagine database queries or something for which async is better.. What would be the correct use?
that should be async
IO should always be done async
i cant figure out how to get instance of main so ill just follow a java guide for a moment lol
?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.
they are free right?
should be
alr ty
You've already done it before in the code you sent
a hold on
Yeah but are these 2 ways the same? or one is right and other is wrong?
oh yea i forgot about that ty lol
both are fine
though you don't need to create annon classes
Just use the scheduler with a runnable
Okay, thank you
Would looping through every player's inventory 6 times every 2.5 seconds be really taxing on the server?
Im using work distribution for certain things. Is it possible to have multiple? Like if I wanted to generate chunks super slowly, but have one that places blocks quickly?
Sure
How does that work? Is it just two that run at different speeds?
Yep
simple enough
For the searching thru the inventories, could I just do that asynchronously?
technically yes
accessing can be done async
but u may not have an up to date state of the data
Time for createInventorySnapshot to go with createChunkSnapshot
Don’t worry about it
new pr for @worldly ingot to do
So it would be bad to async search thru the inventory for a certain item, delete a specific amount of that item, and replace it with another if the data could be old?
Why do u wna do it async
R u searching millions of inventories?
async does not imply better performance, better speed etc
It's to stop it from pausing a single tick, right?
Its usecase is to do things async, like being able to run stuff whilst files are downloading
Lol no
But doing too much during a single tick can cause tps drop
Which may be a measurement of performance symptom
Hence why instead of searching all inventories every 2.5 seconds you could search 20% of them every 0.5 seconds
Or 2% of them every tick
So what does asynchronous do?
it means code wise
ur code runs non linearly in relation to declaration of flow
but thats a rather advanced definition
Async does not mean faster, it just means you can avoid blocking the main thread for slow (web request) or intensive tasks (calculating all prime numbers…? Idk)
Okay, so I get that.
Doing something async can even be slower as making new threads has overhead
(Some of that is alleviated here because Bukkit uses a thread pool)
So you're saying that searching through inventories is probably not what is causing tps issues? There are other things?
public class PrimeNumbers {
public static void main(String[] args) {
int n = 100; // set the limit of prime numbers to calculate
boolean[] primes = new boolean[n + 1]; // create a boolean array to mark primes
Arrays.fill(primes, true); // initialize all elements as true
primes[0] = false; // 0 is not a prime number
primes[1] = false; // 1 is not a prime number
for (int i = 2; i <= Math.sqrt(n); i++) { // iterate up to the square root of n
if (primes[i]) { // if i is a prime number
for (int j = i * i; j <= n; j += i) { // mark all multiples of i as not prime
primes[j] = false;
}
}
}
System.out.print("Prime numbers from 1 to " + n + ": ");
for (int i = 2; i <= n; i++) { // print all prime numbers
if (primes[i]) {
System.out.print(i + " ");
}
}
}
}
``` prime numbers isnt that bad
Did you write that
will spark tell me where things are going wrong? Or what is going wrong?
Yes
Okay thanks! I'll give it a shot
what do you think
What should I do to detect player is holding mouse?
Yeah
Or if they left click once
Unless they are looking at a block then you could check if they are breaking it
Hello how I can give to my player a sheep spawn egg in my plugin pls
Question from earlier: if I install the Minecraft Development Plugin on intellij, will that get me set up with everything I need?
Just add the item to their inventory?
For the most part, yes. although it can be buggy at times
In modern versions each spawn egg is its own item
On older versions iirc there was SpawnEggMeta
Yes But how I can get the spawn egg
I dont find how to have sheep spawn egg
What version
okay thx
Idk what it was called, SPAWN_EGG maybe
i want to use JDBC sqlite driver, but where do i put the jar file that i downloaded? should it be in the plugin folder?
craftbukkit already include sqlite driver iirc
you dont have to include it by yourself
<version>3.41.0.0</version>
then do i still need Class.forName("org.sqlite.JDBC"); to load it?
yes
ok thank you :)
Won't work
It's also not really outdated, if at all
the bundled one doesn;t have the getBoolean method so doesn;t play well with some things
iirc sqlite driver doesn't really have boolean as an storage type
but more like 0 and 1
Yes. It has only "byte" https://www.sqlite.org/datatype3.html
jump to 2.1
BOOL and BOOLEAN are just synonyms
So as a sanity check so I know im not being too overly critical here.
You ,as a developer, are working in the API of a lands plugin.
You find a method within the Land object called "delete()".
Asuming we live in a sane and reasonable world...
What does it do?
Deletes that land, presumably. Or something contained therein
Wanna know what it does...
inb4 regenerates the land
Nope... wanna try again or do you wanna ask me what it does...
Yeah I'm curious lol
Then ask (its important)
What does the Land#delete() method do?
We love docs
Based on the CF, I can only assume it removes data from SQL as well
The optional player may or may not send them a message
Id like to think so... but then why the ever living hell does it have "LandPlayer" xD
i am using the plugin.yml's library method to download a JNI dependency from maven, but since im loading the native libs from my plugin, i assume the bukkit classloader that loads the dependency cannot see the native library i loaded with the plugin's classloader. is there any way to get bukkit to load a native library?
Some people like to include things in methods that should not be there, like sending messages
Wait hold up... omfg how did i not notice its nullable
It do be
omg this might be it xD
I don't think there is. You should be able to load it via System#load() or #loadLibrary() in your plugin though
Oh you tried that lol
yeah
add it to your libraries section of plugin.yml
the classloader that loads the library is whichever classloader that belongs to the class that makes the call
oh natives
yes
i was hoping maybe bukkit might have a method like Bukkit.load(File nativeLib) or something of that sort...
well yes
I stg this api has been a test of my sanity lmao
the only way i can get it to work rn is to shade(20mb) dependencies into my plugin
and i dont really like that option
I just spent a bunch of time today getting outdated JNI stuff to work
Absolute nightmare
You could try getting at bukkit’s classloader but that’s going to be ugly
there is no method that lets me load the library as bukkit
That might be helpful? @gentle yacht
I’ve never tried to mesh JNI with spigot so I’m not really sure
aight
well the problem lies with the classloader
something tells me you might need to fork spigot
bukkit's classloader can't get classes loaded by the plugin's classloader
The plugin's classloader is created right after downloading the deps
well, there is that, but ideally the simplest solution would be to have bukkit implement a Bukkit.loadNative() and Bukkit.load() method that call System.loadNative() and System.load()
The problem you’re gonna run into is that what you’re doing isn’t particularly common
Lol
maybe, but there's a lot of libraries out there that forces the user to load native libraries
it would be super nice
Kinda jumping in, sorry. I'm trying to summon a block display and set what block it is... I can't really figure it out and would love a pointer in the right direction:
Entity bd = origin.getWorld().spawnEntity(origin, EntityType.BLOCK_DISPLAY);
bd.setBlock(Material.shape.get(i));```
setBlock is in red, it doesn't give me any of the methods for the BlockDisplay documentation.
you need to provide a BlockData, which you can get from a Material
Yeah, Entity is far too abstract for what you want
BlockDisplay bd = origin.getWorld().spawn(origin, BlockDisplay.class, display -> {
display.setBlock(Material.shape.get(i));
});
(unsure what your Material.shape.get(i) is, but it does have to be a BlockData, not a Material. Something to keep in mind as well)
choco is there any way to use the current packet bundle delimiters?
No, and designing API for it is really hard because just exposing something like Player#sendDelimiter() is prone to misuse
Why would it need to
imho, the delimiter packet is something that should be used exclusively for implementation, not in plugins
?xy
Asking about your attempted solution rather than your actual problem
i assumed that the maven libraries in the plugin.yml were loaded by bukkit's classloaders, but since i need to load the native libs from my plugin, the maven libraries can't access the jni methods since ithe native libs are loaded by my plugin's classloader
No, they're loaded by the plugin classloader
Why would you make the assumption that a plugin library is loaded into the system classloader?
well, what if you are modifying multiple entities at once?
Not clear what issue you're facing
i got an unsatisfied link error when using the plugin.yml library loading, but it works fine when i shade it into my jar, so i assumed it might have been that
i am trying to shade com.github.stephengold:Minie:7.5.0 into my plugin, but i need to load libbulletjme.dll/so since it doesn't come with or have any way to load the libraries itself
so in my plugin i call the system.load to load the native libraries in order to use the library
the error in particular is java.lang.UnsatisfiedLinkError: 'int com.jme3.bullet.util.NativeLibrary.countThreads()' at com.jme3.bullet.util.NativeLibrary.countThreads(Native Method) ~[?:?] at com.jme3.bullet.PhysicsSpace.<init>(PhysicsSpace.java:257) ~[?:?] at com.jme3.bullet.PhysicsSpace.<init>(PhysicsSpace.java:227) ~[?:?] at com.aaaaahhhhhhh.bananapuncher714.minietest.MiniePlugin.onEnable(MiniePlugin.java:74) ~[?:?] at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:266) ~[spigot-api-1.19.4-R0.1-SNAPSHOT.jar:?]
which occurs after i load the native libraries
which i assume means that the class cannot find the specified JNI method
im not sure how the PluginClassLoader deals with the LibraryLoader
but i guess the library loader's parent is not the plugin's classloader
aaaaahhhhhh
but how?
Considering plugins dont have a classloader of their own.
At least not typically
im pretty sure every plugin has its own classloader?
No they dont and that is why you get conflicts if you shade something in the same place as what another plugin has or the libs the server has internally
Hence it is recommended when shading something into your plugin you relocate it
no, im fairly certain every plugin has their own classloader
the reason for the conflicts is because whenever the plugin's classloader loads a class, it registers it with the JavaPluginLoader so that other plugin classloaders can access the class
Am I on the right track here?
bd2.setBlock(shape.get(i).getBlock().getBlockData());```
to spawn a display entity and then set it's block
it should, have you tried it to see?
?tas
This caused a problem for me when I was new to programming. My path-to-main was the same for two different plugins. Didn't go well.
A display entity?
Block display in this case
Have you looked at the code for it?
yes
Anyways, as for your unsatisified link error, typically that only happens if you are using natives
Natives need to be on the path before your plugin loads. But if the library is only found out later then this cant happen and therefore the error and also why shading fixed the problem
Plugins have their own classloader but resolve classes across all plugin loaders
Interesting
Thanks for the clarification. On my phone at work so cant really just check source
what's the easiest way to check if the item meta of two itemstacks is the same ignoring durability
and enchantments
Couldn't figure out why but u were right about the nullsble.
Now have a plugin for lands that auto deletes claims over an owner limkt or under under activity time (even if folk glitched around the base plugin)
Legend 😁
block display. New 1.19.4 thing. I figured it out. Just weirdness with abstractness. Needed to use a different spawn method
well also you were casting it to Entity
which it is but Entity doesn't have any of the BlockDisplay specific methods
but choco also wanted you to use the consumer version of spawn
which is better for interfacing with other plugins
er rather not casting the Entity to BlockDisplay
in my plugin.yml for my main command, what doesthe aliases do? commands: simpleserverrestart: description: Main Command usage: /simpleserverrestart aliases: "reload","version" permission: simpleserverrestart
Specific meta or all meta it has?
all meta
except for a couple things
would be nice if there was no except
because then I could just .equals
but alas
You could clone them and clear the stuff you don't care about
Then compare
No other way I can think of
Create custom object that excludes then compare those objects
Oh okay, and how can i make the /simpleserverrestart reload appear, as they dont
ooh that could work
Oh md beat me
unfortunate there is no more efficient way
Aliases are not arguments..
arguments are to add inside your code
if you want to make it pop up while they're typing you'll need to add a tab completer
or use a command framework like ACF or the 1.13 command one
Oh okay thanks!
im using this for like an upgrade system so every couple seconds or so it'll scan player inventories to check if any of their items need """upgrading"""
upgrading referring to like changing the custom attributes we want all items of a type to have
haha command framework go brr
and whats the subcommands inside the commands: do, or what does it do?
its not amazing but I can't think of something better
especially trying to deal with old versions of items in chests
is inventory.forEach slow?
slower than like looping through each item
for i
oh wow thanks so much @worldly ingot I've been a bit spacey today and missed your message. Yep that was exactly it but after digging a ton I found it on my own.
Yea that was the solution in the end.
yes
but try using the consumer version of spawn
it runs the function you pass in setting all of the entity's attributes before running like the spawn entity event
as opposed to running the event before you set all of your settings
Doing that now. It doesn't like my index from my for loop though
hmm let me take a look
there was a suggested fix that worked. I'm not very experienced with consumers. Posting code in a sec
a consumer is really just a lambda
not experienced with lambdas either
for(int i=0; i<shape.size(); i++) {
//Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "summon minecraft:block_display " + origin.getX() + " " + origin.getY() + " " + origin.getZ() + " {block_state:{Name:"+blocks.get(i).getType().toString().toLowerCase()+"},CustomName:'\""+i+"_"+ID+"1\"'}");
shape.get(i).getBlock().setType(Material.AIR);
int finalI = i;
BlockDisplay bd = origin.getWorld().spawn(origin, BlockDisplay.class, display -> {
display.setBlock(blocks.get(finalI).getBlockData());
});
//bd.setBlock(blocks.get(i).getBlockData());
System.out.println(bd.getTransformation().toString());
int x = origin.getBlockX()-blocks.get(i).getX();
//System.out.println("x is " + x);
Transformation trans = new Transformation(new Vector3f(origin.getBlockX()-blocks.get(i).getX(), origin.getBlockY()-blocks.get(i).getY(),origin.getBlockZ()-blocks.get(i).getZ()),bd.getTransformation().getLeftRotation(), bd.getTransformation().getScale(), bd.getTransformation().getRightRotation());
bd.setTransformation(trans);
System.out.println(bd.getTransformation().toString());
}
The goal is just to take the two arraylists, which has the locations and the blocks, and turn it into a bunch of display entities in the same locations visually but all located in a single point.
aha ok yea actually it all works now. I may need to rethink how I'm storing blocks and how I'm replacing them, but whatever
wonderful
does javac compile a foreach loop with an array to a fori loop
is it smart enough to do that
xD was about to say exactly the same thing. I switched it out now, I think I'm keeping my pointers all straight now with replacing blocks.
The goal is to try to get something resembling contraptions in create, using display entities, their transformation animations, and invisible shulkers.
I'm not sure. Beginner programmer here :/
no worries was more asking generally to anyone who knows
But if I'm thinking of the same thing, I'd like to use the index for lots of things anyways so I just figured I wouldn't mess with it
how do I reset the damage of an item
i have the item meta and have casted to damageable
would set damage 0 be a broken item or a brand new item
Enhanced for loop uses foreach internally. A manual counter loop is slightly slower but it is so negligible that it would be considered micro optimizing
That would be considered durability
still faster than functional
ooh
0 is broken
what is damage then
material#getMaxDurability
recently found this code snippet in a project and i was wonder what is it and how could i use it?
i couldnt find anything about baseCommands, or using @ to register commands
Tab completers are amazing and underrated.
and hella picky to code
I don't really have problems with them once I figured it out, just don't put it all in one method and it seems to go fine.
with tons of comments too otherwise you lose yourself
Yeah, got that right.
#commentsSaveLives
but hey at the end of the day you end up with a neat command system
mine's still being worked on but overall decent
I'd share my own snippets but I'm at my brother's house on my phone.
My code's a bit denser-looking though; I tend to only have whitespace between categories. Not sure if it's a good thing or not. But for now, it's kinda signature I guess.
Helps me keep track of where I am
Nice
which is a lot more basic but still does the job
I tend to break up my command executor into methods based on the number of arguments used. Then I call classes for each major subcommand.
Though many of my projects use very few commands, if any.
Oh, interesting
like quite a bit bigge
It's more about the type, I think. A world generator, for instance, may not have many commands.
my entire scripting engine has like 2 commands
37k is a few O.o My only projects that size were standalone stuff. Made an ecosystem game one time, was experimenting with programming DNA. I deleted 16gb of code when I got rid of that project.
1.1mb no shading
No shading?
like no shaded libraries
we just like
made a separate thing for that
to minimize upload times
because some of code on the go
with mobile data
Oh, I used no libraries for that project. Default JDK stuff only.
yea
Tbh though that was a few years ago. If I were more efficient I could have gotten it down to 4gb. I've learned alot since then.
mans writing android
XD Eh, just over-enthusiastic wastes of time really. I wish it was more productive. I had nothing but time.
What's this scripting engine?
animations are scary
So we just do a little model like this
make a little implementation like this
and my code does magic
not only reading the lines and converting them to params and all
but it also learns the syntax and lets you have an in-game editor
that can write valid objectives
Huuuuhhh, interesting
It's gorgeous
and it even writes these lines
the GUI part was the laziest part
I just did like 3 guis in half an hour
or well more like 5 but still
Yeah but you should see my garbage 7-years-old warps gui

Love when left == right
yeah so there was a thing where like
you could do
if {played}={played} then set played to 123
and for some reason the right side was always parsed as a literal while the left side could be a var
and it's basically a way to see if a variable is unset
so that gave me the idea to make checkstyle warnings
but I never really followed through
error: cannot find symbol
if (getItemStackHelper() != null && getItemStackHelper().isStack(value)) {
^
symbol: method getItemStackHelper()
location: class MemorySection
What does this even mean
I'm using the exact same code in other project working perfectly
Hi, im having some problem with this code, it goes out of bounds. https://sourceb.in/rkA32mPjt8 even if the task cancel is called correctly
getItemStackHelper doesn't exist
Well it did
Can you send the error?
Problem was I forgot to add annotationProcessor 'org.projectlombok:lombok:1.18.26'
....
Wdym?
And why do you don't know this? You are the fricking developer from Spigot or not?
?? He helps develop Spigot, yes. That does not mean he has every plugin that's ever been published memorized.

And why would he know all 14000+ plugins
md_5
says something could be a security risk
entitled 16 y/o
How do you not know everything about everything
I love this discord
is these systems possible with mbedwars API and me as 'begginer"
Try it and see
looks difficult
The most difficult part would be item prices
You misunderstanding me: He told that a plugin like this could be a security risk? So there wouldn't be a way to do this`?
Security risk does not mean there wouldn't be a way to do it
There's probably a plugin out there that can do what you want
for example you could whitelist certain placeholders
Why should this be a risk?
Placeholders can expose information you don't want
It could also trigger code that you might not want to run
I added kotlin to my .pom in my maven project
Do I just build it normally?
How can I see that kotlin actually added to my project
I noticed a few jar files were downloaded somewhere in my libary
that means it was downloaded right?
You will also need to shade the kotlin library
How do I do that?
I'd stick with Java for now
i tried adding this
// Get the name of the current class
val className = this::class.java.name
// Unload the current class from the class loader
(classLoader as java.net.URLClassLoader).close()
val cleanClassLoader = java.net.URLClassLoader(arrayOf(java.io.File(".").toURI().toURL()), this::class.java.classLoader)
val loadedClass = cleanClassLoader.loadClass(className)``` But val is undefined and stuff
You don't need to switch Programming language
Im using a kotlin compiler for my maven project
But you are good at teaching though
its a smaller learning curve
You barely know Java
Lol
yeah, but I have good enough reasons to try kotlin
Anyways, ima look up how to shade the libary
I was thinking more of this:
^ this seems really good
if you dont know java before moving to kotlin trying to get help here is going to be quite hard
Considering the majority use java and not kotlin
I'm using the tutorial above, belive it or not you can use both Java and kotlin
In the same file too
I actually just need kotlin for one thing
Well actually a few
But the majority will be written in java
I'll keep my project mostly java
We are aware of this. However in terms of help it will be left to you to translate java to kotlin and since you dont know java very well that makes it harder if you dont understand it
I highly suggest against mixing java and kotlin
I know, but I have to use it for one thing
For what thing
varibles, reloading class's. Things it's much better at than java, anyways, I already compiled it, its not like they'll mix up in the same class, let alone file, turns out
Gl ig
I agree, nothing worse than that
It's just a mess
Spaghetti code
[10:47:30 WARN]: Exception in thread "Thread-9" java.lang.Error: java.util.zip.ZipException: zip END header not found
[10:47:30 WARN]: at PlaceholderAPI-2.11.3 (1).jar//Updater.a(:144)
[10:47:30 WARN]: at java.base/java.lang.Thread.run(Thread.java:833)
[10:47:30 WARN]: Caused by: java.util.zip.ZipException: zip END header not found
How can i fix this? a lot of plugins give this error. I tried to redownload but nothing.
I just need a minor thing to ask for the pom configuration:
https://www.baeldung.com/kotlin/maven-java-project
Do I add both plugins? because I thought they meant that you were to add the last one to your pom
<sourceDir>${project.basedir}/src/main/java</sourceDir>```
Tells you where both libs will run
NVM
Sorry
Looks like you installed malware
If you're in a container it should be fine to delete all jar files (including the libraries folder etc) and then reinstall them
Is there a way to parse like hotbar.0 or armor.head to the correct slot index?
Then you reinstalled the malware
Kotlin cant be better then java unless you are using kotlin jdk. Orherwise it compiles to java bytecode regardless
public void onWaterWalk(PlayerMoveEvent e) {
Location loc = e.getPlayer().getLocation();
if (loc.getBlock().getType() == Material.WATER || loc.getBlock().getType() == Material.STATIONARY_WATER) {
System.out.println(1);
}
}```
this isnt working when im walking in water. any idea why?
https://i.gyazo.com/f892371179f3b3132059adb0b84b289f.png are only 3 plugins fresh installed
malware could be in your server jar file too
ok i will redownload jar server and plugin again
As I said you need to delete all jars
Including the libraries folder
Also the cache folder if you're running Paper
can anyone help
You can always print what getType is
can anyone tell me how can i spawn this particle with 1.12.2 api
particle: breaking redstone block
all you need is a bit of math
imagine you have x0 and y0, x1 and y1, and z0 and z1
then you just loop over those and spawn a particle everywhere
no i just need name of particle
for x = startX, x <= endX, x+= distance
i already know how to
oh
thanks for explaining btw
looks like blockdust or whats it called with REDSTONE as material data
i had problems months ago with material data and switched to 1.16.5 server but i need 1.12.2 now. can you provide me with some examples?
oh I don't know anything about 1.12 code
:(
I started doing minecraft plugins at 1.13
BLOCK_CRACK BLOCK_DUST use MaterialData as input
new MaterialData(Material.REDSTONE_BLOCK)
How ddos attacks bypass anytbot systems? What payload could bypass this type of stuff?
You just spam a bunch of data from hundreds of locations at once
That will overload the server
What’s up. I’m looking for the best way to filter console logs. Specifically stuff like xx issued server command: /. I have tried setting a custom filter for Bukkit.getLogger()/getServer().getLogger(), but even trying to prevent all log records has no effect. Thank you.
Ddos is just data going to your server box. There is nothing you can do if it reaches the box software wise. You need to stop it at the network switch or at the entry for the datacenter. Otherwise you are just screwed. What can help though on the box if the bandwidth being consumed isnt the total bamdwidth you have, you can configure the box to just not respond and not do anything with the packets
But yeah not much hope if the attack reaches your box though except hoping the datacenter sees it and nulls route it
Okay , thx
Does anyone know where I can download a 64 bit version of maven
Exception occurred executing command line.
Cannot run program "C:\Program Files (x86)\apache-maven-3.9.1\bin\mvn" (in directory "C:\Users(censored)\eclipse-workspace\onutillities"): CreateProcess error=193, %1 is not a valid Win32 application
this was wbat i tried to run
Pretty sure you've just configured it wrong and you just need the maven folder
Otherwise you need to reference mvn.cmd or whatever
But tbh that just looks like you're doing something entirely weird
What tutorial told you to do maven like this
mvn.cmd ?
thats a file right
?
Idk look in the folder and see what's there
But if you want maven you should just be importing the project and m2eclipse which is installed by default handles it
yeah mvn.cmd works
run configurations, clean package?
I needed to run clean install because of the -U flag.. until I realized I could have added it to the clean package thing... so I sorted out my issue
Can you access Log4j's appenders from a plugin? Specifically to add a Filter to the existing console logger.
there is no such version, it's just a regular java app
yes
just use getLogger() and whatever you want with it
the appenders and filters are under the spi package, which when used results in a 'no class def found' error (at runtime)
so maybe I'm using the wrong maven dependency?
the "normal" one ive found doesn't include the appenders/filters at all
https://github.com/GoksiOrg/TabbyControl/blob/main/pom.xml#L144-L149 ig this would work
I just read, something changed with log4j at some point and the 'correct' solution appears to be to cast the logger to the "core" variant
which does expose the filters and appenders
so i imagine thats the solution
yeah thats literally what im doing
Hi, im having some problem with this code, it goes out of bounds. https://sourceb.in/rkA32mPjt8 even if the task cancel is called correctly
StackTrace:
[14:36:18 WARN]: [plugin] Task #24 for plugin v1.0-SNAPSHOT generated an exception
java.lang.IndexOutOfBoundsException: Index 24801 out of bounds for length 249
at jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64) ~[?:?]
at jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70) ~[?:?]
at jdk.internal.util.Preconditions.checkIndex(Preconditions.java:266) ~[?:?]
at java.util.Objects.checkIndex(Objects.java:359) ~[?:?]
at java.util.ArrayList.get(ArrayList.java:427) ~[?:?]
at net.rosamei.alixapi.animation.BlendCutscene$1.run(BlendCutscene.java:58) ~[Plugin-1.0-SNAPSHOT.jar:?]
idk if its still the same in 1.12 but i used Effect.STEP_SOUND to create those particles back in 1.8
only problem might be that the sound of the block breaking will also be played
sweet, after removing the other log4j dependency and using the same as tabby's it now works
cool, that is good to hear 👍
a random thought I had, are there any 'template' servers that people use to test their plugins in a more typical environment to check for conflicts and similar problems?
no, personally for my test server I use a normal server, with a core made by me and the plugin, and people can test with op everything
How do I got about initializing the config file the first time the plugin is ran/if config file is deleted?
what?
like how do I put default options in the config
with saveDefaultConfig() it should be done
ok but how do I set what goes in the default config
everytime I try to find it online it just brings me to custom configs
create on the resource folder in your project config.yml and write everything there
oh... it just takes it from that?
yes
lol. thank you very much
no problem
Hello spigot, is it possible to make players own dogs attack the player who owns them
- is it possible to have custom model data for a gui so I can make a chest which looks transparent
And still have the other guis look the old way
https://itemsadder.devs.beer/plugin-usage/adding-content/font-images/placeholders i can answer with this, i don't know if it actualy works
but for scoreboard works just fine
%img_offset_-500% with this
https://sourceb.in/2A0ttlkU5v
Does someone know why if i run the updateBossBar() method it doesnt remove the old bossbar but just creates a new one and eventually i have my screen spammed with bossbars?
(I use 1.19.2)
I mean
for (Player player : Bukkit.getOnlinePlayers()) {
if (bossBar != null) {
bossBar.removePlayer(player);
bossBar = null;
}
}
is pretty wrong if this aims to remove all players from the bossbar
Yeah i tried removeAll and everything, same issue
You then also create a new bossbar per player
What prevents you from just
calling setTitle
That is actually not a bad idea
on the bossbar
Because then it thinks the bossbar doesnt exist
So i dont know what is happening but everytime it creates a new bossbar
But the issue is when i try to remove player from the bossbar it remains in your screen and it creates a new one, so i have many
And the bossbar is already created per player because of the for each
Anyone have any idea?
yes is the get
does the underlying list of getFrames() get mutated?
no, its standard remains that way, im trying moving the check for the frame
java.lang.IndexOutOfBoundsException: Index 249 out of bounds for length 249 in line 6
my question is how is outofbound if is 249 on 249
Java arrays/collections start from 0
The element at index 0 is the first element, the element at index 1 is the second element, and so on
If there are 6 elements in the collection, there can’t be an element with index 6 because that would be the seventh element
oh yea so i should do this.frameIndex - 1 >= animation.getFrames().size()
That’s unnecessarily complicated
Just
this.frameIndex < animation.getFrames().size()
if (!(this.frameIndex < animation.getFrames().size())) cancel(); because i use the method to cancel
if (this.frameIndex >= animation.getFrames().size()) {
cancel();
return;
}
You need that return, it’s missing in your code and that will cause additional problems
ok thanks, for the help
Hello How I started Bungeecord Plugin in 1.19 and What I need?
I know for Spigot 1.19 but IDK for Proxy
You need Bungeecord..?
I want make Plugin in my bungeecord
Right
so make a bungeecord plugin..
If you're using the IntelliJ minecraft development plugin, then you can specify you want to make a bungeecord plugin with that
I use eclipse
Well 🤷 look up how to initialize one.
If I add Bungeecord.jar in my java project and he send me error
Use a build tool like Maven or Gradle
https://paste.md-5.net/uwitafirun.cs
I changed the code to store the bossbar per player, and it still doesnt remove the old one or update the title.
It just creates a new bossbar and leaves the old one there so i have duplicate bossbars.
Does someone know what to do?
Is totalBoost less than 1?
No, but that is not the issue it creates a bossbar when i add boost but it doesnt remove the old bossbar so it creates multiple
Yeah you don't have any code removing the old one?
clearBossBars only clear your map
?
I mean this code is meant to remove a bossbar and remove the bossbar from the list isn't it?
But it only does the second part
It does remove the bossbar
That's not the issue here
They're not calling the method at all (since totalBoost isn't less than 1)
Is there a ShopGUI+ api doc somewhere?
bump
If a player is in a separately loaded world and quits/logs out. How should unloading that world be handled (I want to delete the file)?
Right now I have a listener for a player quit even which unloads the world using Bukkit.getServer().unloadWorld(world, false);
However, the response from that invocation is always false meaning the world does not get unloaded.
What needs to be done differently here?
I removed the less then 1 (It was meant to be a check if it is 0 then dont create a bossbar)
So now it calls the method properly, but it still doesnt remove the old bossbar.
This is my code now: https://paste.md-5.net/lefayoxoyu.cs
How is that a solution
What error are you getting?
Import no find
Use a build system like maven or gradle
This is very tiring, in the defense
I see
If eclipse isn't finding the import, normally it's because the imported file was moved. Can you provide additional information?
Hello I am trying to make my plugin add scalar without deleting the standard attributes
newMeta.addAttributeModifier(Attribute.GENERIC_ARMOR_TOUGHNESS, new AttributeModifier("generic.armourToughness2", upgradeVal, AttributeModifier.Operation.ADD_SCALAR));;
and after that I set meta of the item with new attribute
the newMeta is item.getItemMeta()
upgradeval is 0.075
So how I can just add an scalar without deleting standard values?
This is what I want to accomplish:
- Have a thousand randomly generated "MicroWorlds" (5x5 chunk areas) that can be copy and pasted into a void world.
Is this possible, specifically, the copy and paste part? Is it feasible to have the server do this a bunch? What would be the easiest way to accomplish this?
DM me
Hey, without use of NMS package you must add default attributes as modifiers on the item and then add real modifiers. May be someone here has a better soltuion...
Why would you want to generate then copy? Why not just generate ?
Generating is super expensive, and I will need more than a thousand, or an ability to reset them. Copying solves all three of those issues. (Actually, I dont know if copying is more expensive or not)
Nvm I found that I can .getAmount of modifier
Writing a ChunkPopulator is probably better.
Can i make an update checker before i upload my plugin on spigot? 🤔
Ik it sounds dumb, but i want the first version to already have it, if it isnt possible or is too complex is fine
The mods I added using customplayermodels are conflicting with itemsadder. The model loads correctly when itemsadder is not present, but it gets distorted when itemsadder is loaded.
just make it check as you normally would, when you upload first time it will work, you can just use some mock data in meantime while programming
Like a ChunkGenerator?
Or a block populator?
if I try to unload a world and delete its files but the unload fails, what can I do to make sure the files are deleted as soon as the unload is possible?
The problem only arises when the last player in a world quits and it tries to unload it
Hi! I'm iterating over blocks in a certain area, I don't know their types. I want to print their direction, then change it (I want them to face South, for example). How would I do that?
But to use this method I'd have to cast it into something that implements Directional, like Stairs: ((Stairs)block).setFacing(BlockFace.UP);
But I don't want to have to do that for every type of block that has a face, the block could be a Banner, Bed, Chest, etc.
Figured it out, thanks
Hey, sorry its soo late, i tried this update checker and it seemed to work fine as i put my plugin on a version below the published one, so it was working, but then i putted it in a version greater and it stills sends the message saying a new update is available
most likely its being cached
You could also use BlockData#rotate() if you really wanted to, but depending on what your code looks like you don't need to cast every single time.
is there a way to delete the cache?
sadly not
I think I'll do this:
if (block instanceof Directional directionalBlock) {
directionalBlock.setFacing(BlockFace.UP);
}
welp so you say i just upload it like this and hope for the best? lol
yeah mee too, but i putted as the plugin version 1.0.2 and it still sends the message for a new update
wait, can i pass the .jar for you if the update message appears to you?
} else if(line.contains("[main/INFO]: Connecting to ")) {
for(String domain : targetServers) {
if(line.split(" ")[4].replace(",", "").equalsIgnoreCase(domain)) {
onUC = true;
System.out.println("cnt");
System.out.println(line.split(" ")[0]); //why tf is this null?????
writer.write(format(line.split(" ")[0], Action.CONNECT, "Connected to Server ") + domain.split(".")[1] + domain.split(".")[2] + " \n");
} else {
onUC = false;
}
}
if(!onUC) writer.write(format(line.split(" ")[0], Action.DISCONNECT, "Disconnected from Server" + " \n" ));
}
anybody having an idea why the hell the value is null(see comment)
I mean its not null, its " " or something lol
correct
dude I hast tocall 112 for overbosing on cklonaezepame
what correct lol
its not null
they were extremely friendly, offered help, and stuff, they were not upset at all
wthech is 112?
medical emergency number in Germany
some medical help line?
the german varient of 111 probably
ah
112 os nasoclly 911
112 in medical, 110 is police
uk it's 999 or you can call 911
111 is the non emergancy number
they added 911 becasae one group of people were too silly to know when in a different country your numbers many not work 🙂
in germany 110 polisce. 112 = paremedics
uk 999 is for police fire and ambulance service
uhm? any ideas?
you showed us no code to work with to answer your question
a jumbled mess that you say is not null
that should give a context, what do you need?
anyway tdo riendly prople shpwed up , measures my blood pressure and say "don't worry"
thats the code where it prints " " for some reason, input string is a log-message in the pattern of: "[18:06:40] [main/INFO]: Connecting to [DOMAIN], 25565"
then your string starts with a space
therefore the index 0 should return the date somehow
I ocerdosedl on clonazepame
logs don't have spaces before the date, it must somehow do some garbage to the string
you told it to split on space and your first element is either a space or empty. Your string starts with a space
thats very scuffed
or it's an empty line 🙂
then the condition on this line: if(line.split(" ")[4].replace(",", "").equalsIgnoreCase(domain)) { would not trigger
if its empty, or if the first element is a space
do a .length/size on [0]
aight
it could have more than one element after it splits
gimme a hot minute it has gotta decompress 10 Gigs of Textfiles again
but spaces will be removed if you split on space
so if the first char is a space your first element is going to be empty
Only if there is no content afterwards.
no always, if you split on space
cmon stupid CPU extract faster
uhm things are very very wrong rn
somehow my writer is doing shit
If I have a string of " AABB " and split on spaces, the array length is 2
However, if the string is " AABB C" The length is 5.
yes
Meaning if there is content after the spaces, it will include them. Otherwise, it won't.
the length 2 would be [0] = empty
AABB would be in [1]
trailing would be trimmed
I believe
It seems that is the case.
its still processing
I really gotta work on optimization once its working
uhmm lol
at de.dafeist.unistats.UniStats.processLogs(UniStats.java:124)
at de.dafeist.unistats.UniStats.main(UniStats.java:41)``` there we go
when printing, it shows it. When using it on the next line for the writer, it does not
wait, does line.split overwrite the existing string?
well then idk whats wrong
If you're splitting the entire line at the spaces, you should get an array with 6 elements, 0-5. Try printing the line, splitting to create an array, then printing the number of elements in the array right after.
wait nvm I think I found error 1
How it its called the player tag? (The name above the player entity)
Question from earlier.
This is what I want to accomplish:
- Have a thousand randomly generated "MicroWorlds" (5x5 chunk areas) that can be copy and pasted into a void world.
Is this possible, specifically, the copy and paste part? Is it feasible to have the server do this a bunch? What would be the easiest way to accomplish this?
public static void displayDamage(Entity victim, double damage, boolean crit) {
Location loc = victim.getLocation();
AreaEffectCloud display = (AreaEffectCloud) victim.getWorld().spawnEntity(
new Location(...),
EntityType.AREA_EFFECT_CLOUD
);
display.setParticle(Particle.BLOCK_CRACK, Material.AIR.createBlockData());
display.setRadius(0);
display.setRadiusOnUse(0);
display.setDuration(DELETE_AFTER);
display.setDurationOnUse(0);
String nametag = COMMA_FORMAT.format(damage);
display.setCustomName(nametag);
display.setCustomNameVisible(true);
}
im trying to use an invisible area effect cloud, but by setting the particle to air block crack it still sometimes spawn black particles. any way to fix?
How do I display clickable links in chat?
components
Tried using "TextComponents" but cannot display the message. It just gets displayed as [TextComponent{....}]
Show code
TextComponent message = new TextComponent("Click here to view!");
message.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/viewchest " + p.getDisplayName()));
p.getServer().broadcastMessage(ChatColor.translateAlternateColorCodes('&', "&a" + p.getDisplayName() + " &7has displayed their Ender Chest &3&l[&3" + message + "&3&l]&r"));
Yeah that won't work
YOu're concatenating the message object to your string
You gotta make it all a component
should i convert it to a string?
And send a single component instead of sending a string
So like
TextComponent message = new TextComponent("this nerd is displaying their chest! ").append(clickableComponent).append(new TextComponent(" <- click this");
and send that entire component at once
or use something like minimessage which does all the work for you
Use the component builder for connecting a bunch of stuff
How to detect player holding right click?
there's no easy way
the client sends an interact packet every 4 ticks
or 5 times per second
Wait, there is no .append() method tho
Certain materials send more packets, like for shields and bows
uhh ComponentBuilder
I haven't used components in like 3 years
Even with component builder it does not work
"Lnet.md_5.bungee.api.chat.BaseComponent;@7872525" This is the text that is being displayed in place of the component
Btw i use p.getServer().broadcastMessage() to send the message
getServer().spigot().broadcast
The whole message is gonna have to be in the component?
Yes
Damn it works, thx
Where can i learn the basics for plugin development and java, as i made 2 plugins but with lots of questions and strugles
?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.
selfrole Add or remove a selfrole from yourself.
cleanup Base command for deleting messages.
embedset Commands for toggling embeds on or off.
info Shows info about CafeBabe.
licenseinfo Get info about Red's licenses.
mydata Commands which interact with the data CafeBabe has about...
set Commands for changing CafeBabe's settings.
uptime Shows CafeBabe's uptime.
findcog Find which cog a command comes from.
names Show previous names and nicknames of a member.
userinfo Show information about a member.
listcases List cases for the specified member.
reason Specify a reason for a modlog case.
permissions Command permission management tools.
learning java is better to do first then the wiki can help
Okay, until when should i learn it, as the basics are similar to most programming languages, so like the https://www.codecademy.com/learn/learn-java one i did it without any struggles but was to simple :/
20 ticks = 1 second.
ya
Delay is the time (in ticks) until the task starts (say you want to wait 5 seconds before actually doing the first run) and the period is the time (in ticks) between each run
Yeah, it will wait half a second before running
i wanna check all players online inventory
how many ticks are ok for period?
im thinking about 10
Up to you, honestly. 20 times/second is probably a bit much but it depends on what you want to do
Checking inventory, sure, but why?
it is
Yeah, so if a player has a full armor of chainmail will apply x effects
and that way for other 4 diff types
Then yeah, 10 or 20 ticks is probably fine
te
ye
maybe bc i have a thread.sleep
in the addeffects method
How do I tell when any command was run from any plugin?
lemme try
Yeah, a Thread#sleep() would definitely do that lol
Every command registers on every plugin, idk how to identify that plugin
It will pause the main thread
I tried PlayerCommandPreprocessEvent but that has not sent anything
yeah it's definitely because you have a Thread#sleep kekw
Really
Ty
ye
did you register the event? that should run for anything starting with a / in chat basically
I did
only when the command's executor is from your plugin
true, also
When you say "run from any plugin", are you talking Player#performCommand()?
I thought @weak meteor just said otherwise
its only you have getCommand in the onEnable method
So is PlayerCommandPreprocessEvent the only way?
if you does not have it ig bukkit will not transmit that to the plugin
@strange rain what in the world is your goal
I just joined chat and am not reading whole context, apologies for that
I am making a small little plugin that lets you run a sound when you run a command
IDk
how to make infinite effects?
Just for practice
I got config and everything working beside the command
@worldly ingot can you override the executor of a different plugin's command, then make the custom executor use the old executor?
you does not need to use events
So what do I use?
PotionEffect.INFINITE_DURATION, or you can just pass -1 to the duration
The constant is just the easy readability
For all commands you di
Code: https://github.com/stuyy/spigot-plugin-tutorial
Learn Spigot: https://www.spigotmc.org/wiki/spigot-plugin-development/
Support the Channel:
Become a Member: https://www.youtube.com/ansonthedeveloper/join
Become a Patreon: http://patreon.com/stuyy
Buy me a Coffee: http://ko-fi.com/anson
Donate on Streamlabs: https://streamlabs.com/ansonde...
That explains nothing
like does setExecutor require the invoker's class to be from the plugin that registered the command? and is there a getExecutor?
If its another plugins command you need events
are you positive?
PlayerCommandPreprocessEvent?
if I find out that I can override the CommandExecutor I'll take a hack to you
and yes, that will definitely run CNK. you did something wrong if it didnt
Yeah
But you only want 1 single command, right?
@EventHandler
public void preprocessCommand(PlayerCommandPreprocessEvent e) {
String cmdName = e.getMessage().split(" ")[0].replace("/","").toLowerCase();
System.out.println("ADfkjlaslndgasdjg: "+cmdName);
e.getPlayer().sendMessage(cmdName);
String sound = getConfig().getString("default.sound");
double pitch = getConfig().getDouble("default.pitch");
if (getConfig().contains("specific."+cmdName.toLowerCase())) {
sound = getConfig().getString("specific."+cmdName.toLowerCase()+".sound");
pitch = getConfig().getDouble("specific."+cmdName.toLowerCase()+".pitch");
}
if (sound != "NONE") {
try {
e.getPlayer().playSound(e.getPlayer().getEyeLocation(), Sound.valueOf(sound), 2f, (float) pitch);
} catch(IllegalArgumentException l) {
l.printStackTrace();
}
}
I have listener implmented
Still doesn't run
oh
Just saving you a headache for later
misunderstand
Thanks
And why do you tolowecase an already lowecase string
there's no guarantee they typed the command in lowercase mate
it's called input processing
theres spigot forums on the page
!!!!
Cuz I was using a different every and the cmdName wasn't tolowercase
Just scrap
But it still should work
which it is not
did you register it in the main class
They call tolowercase on cmdname, which had tolowercae on being initiated
oh i see now
im sorry epic
Because we have a forum on the website 😛 But you can open threads if you wanna. It's like a mini forum. Though in this case specifically there's nobody else asking questions that need to be taken to a more focused environment
I am a slow boi
hjoSDfhiasjdfasd
Ty
Do you have any errors in console
epic we just solved it
Oh
Form bad. Long dialogue good
i think i got smth wrong
lol
Which version?
That'd be why. Infinite potion effects were only added in 1.19.4
So you can just use Integer.MAX_VALUE instead
oh
k
Yeah, so the effects i wanna apply for each class like, apply and unapply in a tick or smth like that:
Runnable: https://paste.md-5.net/opumilasuh.cs
addEffects Method: https://paste.md-5.net/subevekaqe.cpp
Runnable caller: https://paste.md-5.net/fudaqedake.cpp
You may need to separate the applying and unapplying by a single tick
Not everything can be done at once in just a single tick
Just some fyi
You would use 2 tasks. The first one applies or unapplies and if the other is needed right after inside that task schedule a delayed task
Fortunately i understood you
Hello, how can I make the panel red?
this.setItem(new ItemStack(Material.STAINED_GLASS_PANE),49, LangConfig.Msg.InventoryItemRemoveBalloon.toString(), null);
oh, you talk spanish?
Not really, just understand it enough though
so you mean do a runnable inside the runnable that checks the armors?
that will apply the effects from getEffects() method in a loop
smth like
for (PotionEffect effect : kit.getEffects()){
new runnable(){
run
player#applyeffect(effect.gettype, -1, 3)}
Nao.getInstance, 120, 2;
or smth like that?
Yes but it should be a task
I dont really have time to go over the layout. Maybe someone else here can. Currently at work 
okay
Question from earlier.
This is what I want to accomplish:
- Have a thousand randomly generated "MicroWorlds" (5x5 chunk areas) that can be copy and pasted into a void world.
Is this possible, specifically, the copy and paste part? Is it feasible to have the server do this a bunch? What would be the easiest way to accomplish this?
Am I doing something wrong or should this filter:
return Arrays.stream(completions.toArray()).map(String::valueOf).filter(
s -> s.toLowerCase().startsWith(args[args.length-1].toLowerCase())).collect(Collectors.toList());
Why are you converting to array only to stream
What are you even doing
StringUtils.copyPartialMatches
kswapd0 is using 100% of my cpu
despite my memory only being halfway utilized
and I just doubled my swap file size
oops wrong channel
When world edit is copy and pasting large amounts of blocks, does it just take the block it copied and place the block in the new location, block by block? Is there an efficient and an inefficient way of doing that?
For clarity, I want to copy and paste chunks in the background while the server is running, so I'm looking to recreate what world edit does with copy and pasting, but with work distribution.
i think i have this bookmarked
hold
blazing fast speeds w/o reinventing the wheel (from that post's discussion)
https://github.com/TheGaming999/BlockChanger
Thank you! I'll look into this tomorrow
however that program seems to not update lighting, as hinted by the todo list
I'd read the forum, albeit it's a tad old
then look at the posts, someone seemingly got it to work on new versions so
Jesus Is Amazing And He Loves You
Yeah the forum's 4 years old, but the github link is for 1.17-1.19
?workdistro can also be used.
Anyone know what the sources of this error could be?
Caused by: java.lang.NoSuchMethodError: 'net.minecraft.world.level.block.state.BlockState net.minecraft.world.level.block.Block.stateById(int)'
The project builds in intellij, but that happens when I try to use net.minecraft.world.level.block.Block.stateById(5)
mappings error
i tried looking at a lot of forums but i cant get it to work, how would you create a fake invisible ender dragon death like in this plugin https://www.spigotmc.org/resources/prodigynightclub.58234/
yeah i tried making it "die" and make it invisible but it didnt work
Hi, i didn't find any solution to this error and im thinking of suppresing the error because as a player you cannot see a difference
https://sourceb.in/NnNsKmUueP
java.lang.IllegalArgumentException: x not finite
at org.bukkit.util.NumberConversions.checkFinite(NumberConversions.java:118) ~[purpur-api-1.19.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.util.Vector.checkFinite(Vector.java:814) ~[purpur-api-1.19.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_19_R1.entity.CraftEntity.setVelocity(CraftEntity.java:465) ~[purpur-1.19.2.jar:git-Purpur-1858]
at net.rosamei.alixapi.animation.utils.MathUtils.corDir(MathUtils.java:13) ~[Plugin-1.0-SNAPSHOT.jar:?]
It basically means that something in that code, is returning a never ending value
It's somewhere in the setVelocity()
yes, i just searched that error, but from the player prospective there's not any problem
You may not see a difference, but it may have performance issues later if left unchecked
Double check the outputs from the math. It could be something is returning a 0, and then getting divided by 0 which can lead to that error
What about rounding the value of the vector?
i want to be sure what to round so i made calculate the Pitch and yaw
and send it if one of the two send an error i will try round them
Okay
I found the problem, at the start of the animation the pitch and yaw are NaN how can fix that?
?img
