#help-development
1 messages Β· Page 897 of 1
calling it once doesnt immediately get rid of the RandomAccessFile of the .jar
ugh
this is indeed needed twice to be able to instantly reload module .jars on windows D:
hmm
Call it in a scheduler to make sure your memory is clean
unfortunate
it's only there when people reload a module .jar without reboot, which they shouldn't do anyway
it's our version of /reload
wouldn't u wna join the thread anyway then?
hopefully the jvm decides to be rude and ignores him
oh yeah for /module reloadjar it should join it, yes
also mfnalex
reloadjar was added later, at first there was only unload and loadfile
u might wna put the thread priority to 10
so it executes faster
or well not executes faster
while (true) {
System.gc()
}
but gets higher prio regarding jvm and os stuff
I dont understand why does it say its always true, it isnt
how does ur enum look
hmm
UUUGH I've been spending like 10 minutes on finding out why relative coordinates aren't working ...
kek
ah I see now
oh alex is there a point in binding it to a var? dont think the compiler would handle that differently?
maybe later π₯²
awwww
two people live again, interesting
it would be 3 if my code wasnt so bad
same
im doing some opengl but i dont want to stream lol
just had to figure out for 2 hours why nothing was being drawn, turned out i needed an f32 instead of a vec3
anyways
I used to print it out earlier
why do you guys only look at the dirty class loading tricks haha
well someone posted it
anyways heres the pr https://github.com/SpigotBasics/basics/pull/135
lets see if it survives ktlint
can you fix ktlint pls π₯² https://github.com/SpigotBasics/basics/actions/runs/7934182634/job/21664645705?pr=135
just run gradlew ktlintFormat
When i go to https://oss.sonatype.org/
I get the '502 Bad Gateway' message, has this always been like this? I have never had this problem shadowing before until today.
Here is the stacktrace:
https://paste.md-5.net/ijavirexud.rb
and here is my build.gradle:
https://paste.md-5.net/ozeduwaxav.cs
Please help me compile my plugin!
voila
Ive compiled my plugin hundreds of times with the set up i have now, never seen this before
This shouldn't be happening
sonatype is prob down
I hope so
yea repo is prolly just down
This happens often?
Where do i specify this?
oh are u using maven?
Gradle
then i dont know :d
but im sure a google search will reveal how to compile offline using gradle
Ahh okay im sure ill figure this out, thanks guys
Just needed to Toggle offline mode, fixed temporaily until sonatype turns back on
ez fix :d
indeed
@tender shard is spigot basics just like essentials but modular?
looks kinda cool
That's the idea
so the idea is that i can pick and choose what i want i guess?
without too much bloat im never going to use
mhm
kinda, yes
yep! It's supposed to work like PlaceholderAPI later on, where you can just do sth like /ecloud download
like /basics downloadmodule spawn or sth
although it includes all the "essential" modules by default, but each one can be disabled / enabled
thats actually rlly cool.
feel free to PR some modules :3
i just might if i find myself without anything to do.
there has never been a single exploit from module downloads π tho I guess you can lock it down enough to not care about third party downloads
ran ktlint btw π
thx
are cursor items bound to inventories?
im guessing they are but that seems so annoying T-T
how could one call the "entity to teleport"? teleportee? sounds weird
The cursor should be owned by a player object, not an inventory
thank u
target, teleportTarget
Depends on your context
target sounds like it'd be the destination
targetEntity, teleported, teleportee, etc.
because atm I set the player's cursor item after they interact with a shop menu and it doesnt display until they exit out of the inventory and open their own lol
It's contextual :p
erm... the name of the argument for the first arg of /tp
I mean target sounds like the destination to me as well
yeah π₯²
As an English speaker, I assure you, it doesn't get conflated with "coords" lol
german issue
vanilla uses "<targets>"
wait u're here!?
o I thought you were afk
and "<destination>" for the coordinates
Call them entity payload
Just came back
Alr lmk if it works tho @sullen canyon
yea
it worked
thanks
I didn't rly do much but np
I just started reading about sql and I'm just wondering how does authentication even work
like I can understand it with an http protocol cause you can have headers
but how does that work for tcp
damn, nice music
lmao ty
Tcp also have header segment BTW
I'd use teleportee yeah
i guess my /tp command works lol
smh i did that once by accident in survival
lmao I found back my baboon
Okay do /locate and then click the command it gives you
Hi guys, I'm trying to customize the server tablist but the pl is not getting a classdef. The issue is that i'm not using that class. im using PacketPlayOutPlayerListHeaderFooter
If it doesn't work, banned
whut
show the full stacktrace
/locate gives you a clickable tp command to go to said thing
/locate just tells me I didnt enter enough arguments
/locate biome forest
/locate structure minecraft:plains_village
you're on 1_8_R3 but try to use 1_8_R1
okay
π₯²
this is? Or you mean on imports
you have to use 1.8.8-R0.1-SNAPSHOT
So I'm running into an issue. i am trying to compile a source code from github for PandeLootPlus to make it work on 1.20.x since they abandoned the project in 1.19...
I'm running into a few issues though, I used buildtools to compile all the versions required in the script and i'm trying to BUILD it in IntelliJ, but i keep running into these issues...
I checked the .m2 files and see this - https://i.imgur.com/fC17n8T.png
But i ran buildtools like this - https://i.imgur.com/dIC219r.png
Here is the errors i'm getting - https://i.imgur.com/NcD7kFS.png
it works but showing the coordinates is broken
Sorry for so many images lol. Just trying to get all the detail in I can xD
xd
Good enough
Essentials also breaks that
the basics /tp is pretty unbreakable. it can take selectors as "to teleport" and as "teleport destination" or take coordinates as destination
im ngl that scared the shit out of me
π₯² yeah me too lol
I'm losing my shit on this stupid intellij crap XD
early return lol
are you literally only checking type by regex?
I asked gpt and it's like an actual persistent connection
It's looking for 1.17.1 remapped but you don't seem to have it
Which I don't understand how I don't, i compiled it in buildtools with the arguments i showed above
i'm using it
can't be, you imported 1.8 classes
what is your POM
ohh i miss read sorry
change the dependency to 1.8.8, and the nyou have to change the imports in your code from 1_8_R1 to 1_8_R3
yeah thanks!
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>net.seyarada</groupId>
<artifactId>pandeloot-parent</artifactId>
<packaging>pom</packaging>
<version>parent</version>
<name>PandeLoot Parent</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>16</maven.compiler.source>
<maven.compiler.target>16</maven.compiler.target>
</properties>
<modules>
<module>API</module>
<module>v1_17</module>
<module>v1_18</module>
<module>v1_18_2</module>
<module>v1_19</module>
<module>v1_19_2</module>
<module>v1_19_3</module>
<module>v1_20</module>
<module>v1_20_2</module>
<module>v1_20_3</module>
<module>Plugin</module>
</modules>
<repositories>
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
<repository>
<id>central</id>
<url>https://repo.maven.apache.org/maven2</url>
</repository>
<repository>
<id>papermc</id>
<url>https://repo.papermc.io/repository/maven-public/</url>
</repository>
</repositories>
</project>
and each version has it's on pom ofcourse.
Here is 1.17's
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>pandeloot-v1_17</artifactId>
<packaging>jar</packaging>
<name>PandeLoot v1_17</name>
<version>v1_17</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>16</maven.compiler.source>
<maven.compiler.target>16</maven.compiler.target>
</properties>
<parent>
<groupId>net.seyarada</groupId>
<artifactId>pandeloot-parent</artifactId>
<version>parent</version>
</parent>
<dependencies>
<!-- Spigot API -->
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.17.1-R0.1-SNAPSHOT</version>
<classifier>shaded</classifier>
<scope>provided</scope>
</dependency>
<!-- Spigot NMS version -->
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.17.1-R0.1-SNAPSHOT</version>
<classifier>remapped-mojang</classifier>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>net.seyarada</groupId>
<artifactId>pandeloot-api</artifactId>
<version>API</version>
<type>jar</type>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>net.md-5</groupId>
<artifactId>specialsource-maven-plugin</artifactId>
<version>1.2.2</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>remap</goal>
</goals>
<id>remap-obf</id>
<configuration>
<srgIn>org.spigotmc:minecraft-server:1.17.1-R0.1-SNAPSHOT:txt:maps-mojang</srgIn>
<reverse>true</reverse>
<remappedDependencies>org.spigotmc:spigot:1.17.1-R0.1-SNAPSHOT:jar:remapped-mojang</remappedDependencies>
<remappedArtifactAttached>true</remappedArtifactAttached>
<remappedClassifierName>remapped-obf</remappedClassifierName>
</configuration>
</execution>
<execution>
<phase>package</phase>
<goals>
<goal>remap</goal>
</goals>
<id>remap-spigot</id>
<configuration>
<inputFile>${project.build.directory}/${project.artifactId}-${project.version}-remapped-obf.jar</inputFile>
<srgIn>org.spigotmc:minecraft-server:1.17.1-R0.1-SNAPSHOT:csrg:maps-spigot</srgIn>
<remappedDependencies>org.spigotmc:spigot:1.17.1-R0.1-SNAPSHOT:jar:remapped-obf</remappedDependencies>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
do I need to change my buildtools build flags? like generate source jars or something?
Other than that, I have not a clue...
you only show a screenshot of 1.20.4 - have you also built 1.17.1 with --remapped ?
File file = new File("regions.yml");
YamlConfiguration yamlConfig = YamlConfiguration.loadConfiguration(file);
if (yamlConfig.getConfigurationSection("trashman") == null)
yamlConfig.createSection("trashman");
yamlConfig.set("trashman." + region.getId(), true);
try {
yamlConfig.save(file);
} catch (IOException e) {
e.printStackTrace();
}
why is nothing happening, the trashman section doesnt even get created
like the file is there but this code doesn't do anything
is there a way of changing a mob's AI in 1.20.1?
like if I want a custom pig to attack a player
Anyone know why Barrel.close() isn't working in this case when the same sequence using Barrel.open() works just fine?
The Chest.close() works.
Thanks.
how do I add nms?
You could intercept EntityTarget events, cancel/modify them to have them target the player.
AI stuff is very limited in Bukkit
does it print an exception? oh and also you don't have to create the section manually
do you want to show the "closing animation" or what do you wanna do?
Since I'm intercepting the events, I have to open and close the container's manually.
I would like their animations to play, yeah.
I can get the barrel to open, but it will not close
i just realised it was creating it in the root dir haha, every time i dont create the section manually, even if its there, the section is null
oh yeah always use new File(getDataFolder(), "myfile")
yep
?nms
Thanks
does anyone know how to get a worldguard ProtectedRegion from its ID?
can u tell me how
why is my age a byte

Not sure why it's different, but making a Bukkit.runnable() for the next tick got it working.
Thanks.
we aren't in 1993 old man and you aren't making a game for a game console that doesn't even have video memory
updated ?nms to also include sth for gradle and a link to the ?switchmappings and multi-module maven tutorial:
https://blog.jeff-media.com/nms-use-mojang-mappings-for-your-spigot-plugins/
If you need to access NMS classes from inside your Spigot plugin, it is a very good idea to use the so called Mojang mappings. Disclaimer: This post is written for 1.20.4. If you use another version, you of course have to replace every occurance of β1.20.4β with the version you actually use. What are...
I am 99.99% certain a code example of exactly this is in their documentation
What about x y and z
bro... lmao
some would say otherwise. One brings you trash the other takes it away
π₯²
Why do you use String.valueOf in a string concatenation
its fancy
π
other then readability it doesn't hurt anything
that whole method gets turned into String.valueOf() anyways
Yes it does. It's repeated 4 times :((
I mean it is implicitly done already
"postman.${region.id}.x${player.location.blockX}"``` π
When you have with a string and add onto it, you don't need String.valueOf
we're not in JavaScript land
In Java, that will be "postman.\{region.getId()}.x"
π
you are correct, but I never said you needed it. I am saying its fine other then readability because the compiler is just going to make all of that a single string.valueof() method
looks a bit cursed at first sight
yes
wtf copilot
i doubt there are gals khoding minecraft plugins in the spigotmc discord server
there actually is plenty
thanks @a
We have @ancient plank
hostage?
Maybe
any suggestions for a class name for this? D:
https://paste.md-5.net/rubaqonuje.cpp
it's currently called TripleContextCoordinate but that is weird
RelativeLocation?
but it's not relative, it can be relative, and it can be relative to two locations (on each "axis")
DynamicPosition
Please help me, I'm relatively new to java coding
hm yeah that's better thx
player x is null
well yeah
but i've tested everything
it should be working
it was working yesterday
try logging the players name
didnt change anything
did you reconnect since too that server
yeah
np
every time i change the code i restart the server
.
i'm doing that now
We're starting a minigame project and we need a manager.
The manager will be responsible for the staff and keep an eye on the moderators, and if there is a need for help in solving the issue, the manager will have to be able to help in solving the issue or problem.
If we talk about payment, then I say at once that for the time being our finances are small and we will invest only in the project, but if the manager will do a great job with his duties will receive a share of money from the profit. π
bruv this is a cooding channel not an blackboard for finding staff
sounds like you're in need of ?services
?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/
and if that doesnt work send the code where you add the player to the Map
ty
try looping through all contents from the map and see if theres acuall values in there
yes try printing the size of the map and then try printing just the player var and the int
What is line 93 at Player manager
@minor junco
can i get a new instance of an object without new or reflection? Or is there a secure way when using reflection that ensure correct parameters?
how would i print the player variable?
just do player.toString()
oh okay
System.out.println(player)
your list contains null values, you'd need to find the root cause for why your list contains null values
wdym with "ensure correct parameters"?
thats what were doing rn
i dont know what the constructor might want to have
at some point you add a null value player to the list. By doing player.toString() you will also get a nullptr exception
its a really generic method that needs to create a wide range of objects sharing one interface
do this:
btw im not the one having the problem thats @shell obsidian
gameManager.playerList.filter(Objects::nonNull).forEach((x, i) -> /* ... */)
if you simply want to fix your nullptr without finding the root cause for when you add null values.
Check your code for whenever you modify the list playerList and print out the values before putting them into that list.
For example if you have a method that does:
gameManager.playerList.add(player);
do
/* + */ System.out.println(player);
/* */ gameManager.playerList.add(player);
this instead.
@shell obsidian
no, that's not possible. What exactly do you want to? Why don't you know which objects you're going to create?
How can I like reset a map? I mean like in skywars when a new game starts
a game map you mean?
@shell obsidian
as in do you mean a section of a world, so you reset the blocks, or do you mean a Map of values
yes but that means the player shouldnt be null
read what I described above please
this one
exactly
print out when you add to the list
at some point you'll add a player to your list, no?
otherwise the list would be empty
this is not what I mean?
okay , i think i found a solution i can just Chat currentChatObject = new ChatObject(); thanks for helping, i was not thinking clearly
oh
can we make a separate thread for your issue?
sure
well go to the definition of .registerPlayers() lol
I am no magician I can't see the definition with no source
alright, is there any other place where you add to this list?
then any of the named player instances must be null, which shouldn't be possible
Hi, I have already asked for help on the mythic mobs forum (without receiving a reply) and also on the spigot forum. Could someone who knows mythic mobs help me out. I have been on this problem for 4 days now and need to move on. Here is the problem:
I have a serious problem, which is wasting a lot of my time. I'm creating a plugin based on mythic mobs. Practically when I click on a block (there is a whole persistent data system) if there is no player present in the region the mob inside, if there is one, is despawned. Controlling the boss is not done in the region, but is done by controlling all the mobs present with that id. Using a mob everything goes perfectly (I have done some debugging in the console), however, using another mob nothing goes, i.e. the mob spawns, but the old one is not despawned. YES the region id is found perfectly, the same for the mob id. Here is the code: https://pastebin.com/24Wq1wKw
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
please just create a thread, it's way easier then to help π
hey does anyone know if these are all the fishes? or are there more?
https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/entity/TropicalFish.Pattern.html
declaration: package: org.bukkit.entity, interface: TropicalFish, enum: Pattern
is it x y z pitch yaw, or x y z yaw pitch?
yaw pitch
look at location class params
yea
lol
x y z yaw pitch
Error that is not an error
Is there any way to load maps from an specific directory?
Im trying but is creating a new world instead of using the ones I want
Let me send the code
yes because it's always going to
Yeah but I mean, it should load when is an existing world no?
Only from the directory used to store worlds.
If you want any specifc directory, then you would first have to manually copy the files content
into the general worlds directory, and then load a world with this folders name.
Template worlds can be achieved by simply packing the worlds into zip or rar files and then unpacking them when needed.
Okey, and for like when finish a game and restart the map (set it with no new block and that stuff) It's done with chucks management?
Or maybe I can like delete the world and load it again?
Can someone help me, i get this error when trying to register an class that my event is in
you must implement Listener
Thats something you need to find out for yourself. There are many ways to achieve resetting a map, and spigots world loading system
can be very hurtful to your servers performance.
Deleting the folder and loading a new world later on is viable.
So I've rebuilt my project, rebuilt all the buildtool jar files and whatnot, still running into this: https://i.imgur.com/jlsxtbh.png
Here is all the versions in my project: https://i.imgur.com/ZrOo9Qv.png
I can't figure out for my life why this is such a friggin hassle..
I believe authlib is now its own project for mojang, disjunct from minecraft
That would fix all of that? Gameprofile, brigadier, etc etc since it's all mojang?
Then some unexperienced plugin developer held hard references to them
Well, you need those as well in your pom
but as you told me the server will go boom, so which can be the best?
How would I go about finding the "new" authlib project(s) if that' the case? I have all of this in my pom already based on the pre-existing project. From my understanding it should be working as is but I'm not 100% as i'm still new to IntelliJ and this whole project compiling system.
?
Its possible to make world loading very light by not keeping the spawn chunks loaded etc. So go for it.
https://mvnrepository.com/artifact/com.mojang/authlib/1.5.25
https://github.com/Mojang/brigadier
By using a search engine π
Can you not load words from an arbitrary file?
?bootstrap
Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or the entire contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.
Please read the release notes for further information: https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-1-release.534760/#post-4305163
never done, but i'll try. Thanks!
I think his problem is specifically for nms no longer containing authlib and brigadier in 1.20
wut?
same thing
I used their API a while back. Let me take a quick look.
Same thing? Meaning specifically 1.18 snapshot you pointed out had all that included in it, therefore the NMS should be able to use that for the libraries and such that it states are missing? As far as authlib and brigadier are concerned?
Why is it called for in GameProfile and Property then?
https://i.imgur.com/SuDB7UV.png
That's in the full script ofcourse but it's specifically 1.17 - 1.20.4
Well, that's all a part of this as it's a loot drop system (Pandeloot) Just trying to compile an updated version of it for 1.20.4 since they abandoned the project in 1.19 lol.
Compare different mappings with this website: https://mappings.cephx.dev
Because authlib and brigadier are still present on runtime. You need to add those to your pom if you want to use them.
No idea how that even works to be honest with you. I'm a true rookie in intellij lol. I only did this JUST to update this single script.
Yes
But you still count
Meh, I give up on it, i'm getting so confused and lost, i'm just gonna find a different script lol. we bought this awhile ago, but they open sourced it when they abandoned it.
I feel like Google could answer this
Someone wanna just build this stupid project for me? I'll even pay at this point lmao
if google can answer it, then why do we need #help-development in the first place? xD
player.spigot().sendMessage
md_5!!
player.spigot().sendMessage(ChatMessageType.ACTION_BAR, message)
if google can answer everything, then why would anyone need #help-development
wsup
thanks!
np
im making a fishing competition plugin
So I'm apparently an idiot with Intellij, I'm just trying to build a proper project for a pre-existing open source code to update it to 1.20.4 (they merged someones pull request for updating it) but they abandoned the project so it has ZERO updates since 1.19. Every time I think i'm close enough to build it and whatnot, 1 thing after the next fails. The guys here are trying to explain it to me, but i'm a damn moron with all of this stuff lol.
Sounds like a simple problem
so it accepts BaseComponent, so how would I make it support colors?
like &6 &e
More than likely honestly. I'm not skilled with this currently though, Have no clue where to start or what i'm doing wrong.
Alright let's go over this in a thread
TextComponent.fromLegacyText(ChatColor.translateAlternateColorCodes('&', message))
I don't expect anything in return, other than to solve your issue
Thread, VC or DM? I can do any of the above.
Up to you
I can do any of the above haha.
its deprecated.. is there an alternative?
Check the depreciation message?
the deprecated message may say what to replace it with
Same, just pick one
Ask google to roll a number or sumn
Gen 2 VC?
ahh
i can see it here yea
so fromLegacy accepts colors or no? the one with 1 parameter
Deprecated. fromLegacy(String, ChatColor) is preferred as it will consolidate all components into a single BaseComponent with extra contents as opposed to an array of components which is non-standard and may result in unexpected behavior.
Yes
ok perfect
It accepts Β§ based colors
yeah thats alright
i need some help, so when i run my server it gives me an error saying the plugin is already initizlized and it came because that i did extends JavaPlugin in my class with my command but when i try changing it to implements commandsender @Override is erroring
oh rigth
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
these are my params
@lost matrix thanks for the advice. Zip worlds and unzip it goes well. Now i need to figure aout to delete/create when starting/ending game!
with a string,
"somestring".replaceAll("someregex", "???")```how would i get the string the regex returns
Exactly like that. replaceAll() returns a String

You want to replace the regex with⦠itself?
oh
String replaced = oldString.replaceAll("regex pattern", "bird or whatever");
wait waht
i want it to return the regex pattern
replace all the things the regex matches with, with the regex
Ah i see what you are trying to do. You want a matcher for that.
o
"foo" and "baz" are common phrases for placeholders or nonsense in programming
hey so im using kotlin with reflect in my plugin and declared the reflect as a library in my plugin.yml
i get this
[10:20:50 INFO]: [SpigotLibraryLoader] [PT] Loaded library Q:\bukkit\libraries\org\jetbrains\kotlin\kotlin-reflect\1.9.20\kotlin-reflect-1.9.20.jar
but still get the error
Caused by: java.lang.ExceptionInInitializerError: Exception kotlin.jvm.KotlinReflectionNotSupportedError: Kotlin reflection implementation is not found at runtime. Make sure you have kotlin-reflect.jar in the classpath [in thread "Server thread"]
Make sure to shade the kotlin reflect library into your plugin
im shading it in
the package exists within my .jar (when viewed from recaf/jdgui)
Show your build file
its open source under
https://github.com/flytegg/plugin-portal/blob/2.x/universal/build.gradle.kts
https://github.com/flytegg/plugin-portal/blob/2.x/bukkit/build.gradle.kts
So you added it to the plugin.yml + you used the shadow plugin to shade it in yourself?
Try adding it to your top level gradle file. Just the classpath dependency scope.
dependencies {
classpath(kotlin("reflect"))
}
In the top level
anyone thath can view this?
?paste
can i just extend armorstand and make a new a entity base of armor stand ? or i need nms for that to work ? how can i make a custom armor stand, whats the best approach (Ping me please)
as i said i wanna make a new type of armorstand
i was thinking of just making my own class and use that armor stand as a property and control that armor stand but if u do that i cant override death event or easily execute something on mob death
i can just Listen for mob death event but that way i have to check for each instance of custom armor stand that i made to check that death event is related to which one of them
Just slap a pdc tag on it
Donβt need to, just check for the pdc tag on death
but isnt overrding the actual death event more performance efficent ?
let say an armor stand dies and I have set up a listener for armor stand death, how can I retrieve the instance of the custom mob object that I created for that particular mob?
you are telling me to put that custom object as a pdc tag on mob itself ?
use https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/entity/EntityDeathEvent.html#getEntity()
declaration: package: org.bukkit.event.entity, class: EntityDeathEvent
and have fun with it
If you need to attach a complex object to it then yeah you probably want a map
If you just want to identify it then a pdc tag is enough
The map is perfect, but my only concern is its performance. Is it going to be alright if it has to go through a giant map to find the object for every small event?
for example something like damage event is going to happen alot
or move event or ...
and lets say we have 200 of that thing on server isnt that going to be problematic ?
if you're using a HashMap it's going to be basically O(1) lookup time
and even if it had to check individually by looping 200 isn't that much
We love maps
a performance problem is probably around hundreds of thousands
if you're gonna do linear time lookup
I think I remember in the past having like a massive map I used to track custom blocks
and the death event thing would be a performance problem if you're killing hundreds of entities a tick π
Still didnβt have issues
basically: don't overthink performance unless you are running into issues
Something something premature optimization
guys
Config updates are a thing, where configs can store the version, but how would that work for something like sql
updaters*
For sql you wouldnt use version instead you would look at the db structure itself
Because mysql supports schemas and its a simple query to check
So why introduce redundancy?
What's a schema
The skeleton structure of the db
what if I have a database five versions behind
Its still different, not sure why it matters how many versions just that you are able to identify what is missing or needs to be added. This can be done with a simple sql file that contains what the db structure should be.
Same sql file can be used to then update the db with the missing stuff or remove stuff no longer needed
This is what makes dbs an advantage over flat file where with flat file you may need to use version values because its faster then parsing the entire file to detect changes.
No
holy shit, i wrote maximum unique prime factorization in the range from [L, R] searching algorithm that outperforms everything that i've seen on the internet
it can find biggest number with the biggest amount of unique prime factors in the range from 1 to 10^7 in a matter of ms
so proud of myself

Ur not Albert Einstein
Not sure what you are saying no to. But ok.
What if version 1 has a column named "Kills"
Version 2 has a column name "All Kills"
Version 3 has a column name "Total Kills"
if I were to update from Version 1 to Version 3
The updater would assume that the column name is "All Kills"
but it's really just "Kills"
Then check for both
don't senselessly change column names
that's the solution you are looking for
sometimes you add more features that add multiple variations of kills
so i guess that's understandable
I mean, you can still have a column named kills
write migrator classes for each version and then migrate from v1 to v2 from v2 to v3
It doesnβt have to be clear what itβs for as long as you know (and document it)
yeah that's what I was planning on doing by storing the version in a config
Wait
that wouldn't even work
not everything could be migrated from configs (for example if feature was removed)
Obviously the structure would be different. Using the updated schema provided you can easily see that the db structure changed. The only thing you need to decide on is how you want to update. My point i was making is having a column for version is unnecessary of its purpose is to tell you that one db is different from another.
And it doesnt really matter by how many versions because db schemas dont care about it as it isnt necessary to update a db incrementally
for migration scripts you can use something like liquibase
it like git
but for databases
you do commits
then you can rollback
but ofc if you're doing public plugin that wouldnt work
since nobody would want to use external tool
to migrate db
I suggest learning more about mysql and sql to better understand how to utilize schemas in the way i am talking about
Try this out
class Test
{
static final int MAXN = 100001;
// stores smallest prime factor for every number
static int spf[] = new int[MAXN];
// Calculating SPF (Smallest Prime Factor) for every
// number till MAXN.
// Time Complexity : O(nloglogn)
static void sieve()
{
spf[1] = 1;
for (int i=2; i<MAXN; i++)
// marking smallest prime factor for every
// number to be itself.
spf[i] = i;
// separately marking spf for every even
// number as 2
for (int i=4; i<MAXN; i+=2)
spf[i] = 2;
for (int i=3; i*i<MAXN; i++)
{
// checking if i is prime
if (spf[i] == i)
{
// marking SPF for all numbers divisible by i
for (int j=i*i; j<MAXN; j+=i)
// marking spf[j] if it is not
// previously marked
if (spf[j]==j)
spf[j] = i;
}
}
}
// A O(log n) function returning primefactorization
// by dividing by smallest prime factor at every step
static Vector<Integer> getFactorization(int x)
{
Vector<Integer> ret = new Vector<>();
while (x != 1)
{
ret.add(spf[x]);
x = x / spf[x];
}
return ret;
}
// Driver method
public static void main(String args[])
{
// precalculating Smallest Prime Factor
sieve();
int x = 12246;
System.out.print("prime factorization for " + x + " : ");
// calling getFactorization function
Vector <Integer> p = getFactorization(x);
for (int i=0; i<p.size(); i++)
System.out.print(p.get(i) + " ");
System.out.println();
}
}
This is SPF in O(log n) in worse case scenario
Abd with that back to work for me

Alr mb
Can anybody tell why my configs.yml's content replaces whenever I set location in the file?
public void set(Player sender) {
Location playerLocation = sender.getLocation();
plugin.getConfig().set("location", playerLocation);
plugin.saveConfig();
}
is there anyone to help me with ProtocolLib?
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
oh okay i'm sorry
so i'm trying to send a custom payload to the client with ProtocolLib.
public static void send(Player player, String key, JsonElement messageContent) {
byte[] bytes = getBytesToSend(key, messageContent.toString());
PacketContainer container = new PacketContainer(PacketType.Play.Client.CUSTOM_PAYLOAD);
ByteBuf buffer = Unpooled.copiedBuffer(bytes);
Object wrappedSerializableBuffer = MinecraftReflection.getPacketDataSerializer(buffer);
container.getModifier().withType(ByteBuf.class).write(0, wrappedSerializableBuffer);
ProtocolLibrary.getProtocolManager().sendServerPacket(player, container);
}
public static byte[] getBytesToSend(String messageKey, String messageContents) {
ByteBuf byteBuf = Unpooled.buffer();
writeString(byteBuf, messageKey);
writeString(byteBuf, messageContents);
byte[] bytes = new byte[byteBuf.readableBytes()];
byteBuf.readBytes(bytes);
byteBuf.release();
return bytes;
}
but i'm getting allways following error when i try to send the packet:
com.comphenix.protocol.reflect.FieldAccessException: Field index 0 is out of bounds for length 0
at com.comphenix.protocol.reflect.FieldAccessException.fromFormat(FieldAccessException.java:49) ~[ProtocolLib.jar:?]
at com.comphenix.protocol.reflect.StructureModifier.write(StructureModifier.java:315) ~[ProtocolLib.jar:?]
at eu.filtastisch.coretest.utils.ProtocolManager.send(ProtocolManager.java:34) ~[CoreTest.jar:?]
at eu.filtastisch.coretest.listener.JoinListener.onJoin(JoinListener.java:15) ~[CoreTest.jar:?]
at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor1.execute(Unknown Source) ~[?:?]
at org.bukkit.plugin.EventExecutor$2.execute(EventExecutor.java:77) ~[paper-api-1.20.4-R0.1-SNAPSHOT.jar:?]
at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:81) ~[paper-api-1.20.4-R0.1-SNAPSHOT.jar:git-Paper-426]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[paper-api-1.20.4-R0.1-SNAPSHOT.jar:?]
at io.papermc.paper.plugin.manager.PaperEventManager.callEvent(PaperEventManager.java:54) ~[paper-1.20.4.jar:git-Paper-426]
at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.callEvent(PaperPluginManagerImpl.java:126) ~[paper-1.20.4.jar:git-Paper-426]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:615) ~[paper-api-1.20.4-R0.1-SNAPSHOT.jar:?]
at net.minecraft.server.players.PlayerList.placeNewPlayer(PlayerList.java:344) ~[paper-1.20.4.jar:git-Paper-426]
Why does the swingMainHand function sometimes work and sometimes doesn't work?
protocollib hasn't updated for 1.20 or is the compatibility just not fully assured
i know, thats what i'm using
JoinListener:15 : ProtocolManager.send(e.getPlayer(), "banner", object);
ProtocolManager:34 : container.getModifier().withType(ByteBuf.class).write(0, wrappedSerializableBuffer);
does anyone happen to know which movement packet would give clients the least amount of interpolated movement?
I have this issue where clients try to smooth movements of teleports too much when just using the api
wdym?
nah its not the array, the problem is inside the write() method from the StructureModifier.class
you know what, I decided to randomly ask google gemini about packets to see how good it could be and I don't regret it one bit
10/10 answer, truly
I hope it didn't call the fbi on me on top of that
Lol
mine doesnt use sieve, and its as fast as sieve (it takes like 100 iterations max to find element up to 10^7 on average, worst case is roughly 1k)
Guys when I try to get into my minecraft server it tells me this:
If you wish to use IP forwarding, please enable it in your BungeeCord config as well!
Can you please help me??
Hello, is it possible to make villagers target zombies ? i think their scare of zombies override the pathfinder, and the pathfinders are not removed when i try to. ``` this.goalSelector.removeAllGoals(goal -> true);
this.targetSelector.removeAllGoals(goal->true);
((CraftWorld) location.getWorld()).getHandle().addFreshEntity(this, CreatureSpawnEvent.SpawnReason.CUSTOM);
Goal goal = new Goal() {
@Override
public boolean canUse() {
return level().getNearestEntity(Zombie.class, TargetingConditions.forCombat(), GameBossVillager.this, GameBossVillager.this.getX(), GameBossVillager.this.getY(), GameBossVillager.this.getZ(), GameBossVillager.this.getBoundingBox().inflate(16.0D)) != null;
}
@Override
public void start() {
LivingEntity zombie = level().getNearestEntity(Zombie.class, TargetingConditions.forCombat(), GameBossVillager.this, GameBossVillager.this.getX(), GameBossVillager.this.getY(), GameBossVillager.this.getZ(), GameBossVillager.this.getBoundingBox().inflate(16.0D));
if (zombie != null) {
setTarget(zombie, EntityTargetEvent.TargetReason.CUSTOM,true);
}
}
};
this.targetSelector.addGoal(0,goal);```
Villagers use the new brain ai rather than goals
oh ok thanks
same error
Caused by: java.lang.ExceptionInInitializerError: Exception kotlin.jvm.KotlinReflectionNotSupportedError: Kotlin reflection implementation is not found at runtime. Make sure you have kotlin-reflect.jar in the classpath [in thread "Server thread"]
show output of the dependencies task
^^
I mean, you overwrite the config
hey
how do you know when the hook falls in water?
is hook an entity you can track?
FISHING event state fires as soon as you right interact with the fishing rod, at the start when you throw the hook
I need to calculate depth at the hook position, need to check the y axis and find the first block from the hook y axis to bottom
yeah what state?
BITE is too late
and FISHING fires too soon
oh wait
HOOK STATE
NICE!
perfect
thanks elgar!
this doesn't even work
only BOBBING is fired when you catch a fish (when you reel in)
anything else never ever even shows up
wait 1sec
what exactly are you trying to do? You can check the entities state at any time
I want to know when the fishing hook falls in the water
UNHOOKED also fires for a fishing hook as soon as you right interact with the fishing rod
BOBBING fires when your fish starts to bite
what about the time when your hook falls in the water?
isInWater() or something like that on a hook entity
the event should fire with a state of FISHING
yea FISHING fires even before the hook is in the water
so I need to detect when the hook falls in the water,
and then notify the player about the water depth, resources... blah blah. I did that part now what I have left is to detect the hook ...
so what I could do. start a scheduler as soon as FISHING is fired and check every 5ms or so if hook entity is in the water
?
then listen for the fishing event to start, then run a task to monitor the hook for a few ticks.
it has methods for isInOpenWater()
once that is true or you get a fishing event that cancels the fishing, or the Hook dies.
stop your task
lol, very wet grass π
that seems broken if true
in that case just check the block teh entity is in
oh
does it stop firing once it lands on teh grass/stone?
that check would return true as teh hook is flying in the air
ok
best you can do then is monitor teh block at teh hooks location
unless if
getCaught() is never null and it secretly gives off the hook location
nope
that worked yea xD
nice
You can make a ticket in JIRA if wanna a improvement
i feel like their queue is too long so i dont even wanna bother with it xD
Make a PR then 
Choco has an open PR for some fishing stuff
you do it!
Maybe heβs interested
hey coll
Hey Lynx
.getBlock could throw an error with asynchronous
were you the hero that implemented EntityKnockback
Yes
okay thanks!
Uhoh
You shouldn't access the world async
Paper team gonna knock at my door any minute
I am booking a flight rn
alrightt
for your fucking final knockback bs
but isnt the world itself async
idk much about that stuff
Does thou not enjoy final knockback
the naming is wild
Yβall had the chance to say something
bruh I have 209 PRs
time to make 210
nerd behavior
Amateur numbers!
fuck
yeah it is
@young knoll update this https://hub.spigotmc.org/stash/projects/SPIGOT/repos/bukkit/pull-requests/960/overview
you can also make a pr to fix this https://hub.spigotmc.org/jira/browse/SPIGOT-7018
guys
how do i do a huge check for a specific "type" of armor
for example: checking all special set
if player wears any special sets
then trigger a ability
whats the blog post about the plugin output (dont use the maven shade plugin)?
If youβre using maven for your Spigot plugins (which you should do), itβs easy to make maven automatically save your pluginβs .jar in your plugins folder. Thereβs two ways of doing this: 1. The lazy way (not recommended) If you only work alone on one computer, you can just directly declare the output location in...
oh
am i tripping or were we able to use a switch on a boolean in the past?
dont think so?
+1 for kotlin then
i mean you just put it in an if statement otherwise
not much of a semantic change apart from that we dont have if expressions
annoying to do this in 7 lines
boolean potentialBase = false;
if (readNumber) {
potentialBase = initialChar == '0';
} else if (currentOrDefault() == '0') {
pos++; // skip over '0'
potentialBase = true;
}```
ah you mean if we were able to do sth like
switch {
case x > 7 -> {}
case y != null -> {}
}
?
i thought switch(readNumber) used to work but i mistook it for smth else
mye
dont we get that soon
yea
we gonna get the when keyword in j23 iirc
which supposedly achieves similar stuff to what kotlin offers
is j23 end of this year or start of next
idk
when conclure is smelly -> sysout("smelly");
coll are you spigot pring or plugining
if anyone manages to do that they need to get locked up
lol yup
@young knoll if you're going to mess with world gen mess with making it async
I mean it kinda is
make it more
smh im gonna rewrite the whole thing in kotlin
only 800 lines of parsing
is that ur math parser
kinda
so when a player catches a fish, how do I know if they have actually picked it up?
do I add a PDC data to the fish?
and then do what.. check for that pdc in ItemPickupEvent ?
nvm that isnt an event
It is
PlayerPickupItemEvent
mhm
Seems fine to me
MUH BITS
How can I make gradle publish run checkstyle? I've seen literally nothing on the web (My query is probably ass)
My guess would be making the publish task depend on the checkstyle task
Assuming both are tasks
hey where are all the fish enums
that's a few but apparently there's 22 in total? here it's only 12 https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/entity/TropicalFish.Pattern.html
I only see 12 on the wiki
wait 1 second
perfect
publish isn't task and neither is checkstyle π₯²
so how can i check which one is which in code?
it is when you add the maven publish plugin π€
from the entity... data?
idk what you mean, I just want to run checkstyle prior to publishing
TropicalFish#getPattern
ohh ty
I mean that publish is a task that exists when you add the maven-publish plugin
im looking for a developer for my mc server and I only pay if you are good
ita: sto cercando un developer per il mio server mc pago solo se siete realmente bravi
?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/
@quaint mantle ^
?
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/
ahh π€ only some of my subprojects have checkstlye, but the subprojects aren't the ones who publish
oh sorry
it says You have insufficient privileges to post here.
don't make a post
go through the offering section
oh ok
these cant be caught with a fishing rod right
you can murder them with a sword
but no you can't catch any fish with a fishing rod in minecraft afaik
that isn't in the games current capabilities unless you are adding it yourself
Well you can hook them like any entity
But fishing rods don't "catch" any entities, they just magically create an item
How can I get a bed block with a location? I'm getting error when casting to Bed
?nocode
Itβs hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.
errors?
π₯² this looks like shit I wonder if there is a better way
tasks.publish {
for (subproject in project.subprojects) {
if (subproject.pluginManager.hasPlugin("pineapplecheckstyle")) {
this.dependsOn(subproject.tasks.getByName("checkstyleMain"))
}
}
}```
1.8
yeah but there is no import like that
anything before latest is a no for me
1.12.2 is like the stone age still
I prefer the latest too
deprecated sais
but there's people who still run old servers ...unfortunately
Getting that bed
I'm doing a bedwars so i thougth it will like givr me if exist or no
you could just check the block type at your location
^
how do you claim that that class is deprecated if it doesnt even exist in your version lol
since bed is set up from 2 parts, you can play around with x and z values
1.8 only has one Bed class and it's this
here's an old thread of mine on protocollib about bed... explained a little there how it works and stuff
did it without packets at the end XD
did you post any new reviews
Nice
with what program do you do it
so since bed cant be placed and exist in just 1 block, its safe enough to just check 1 block where the bed could be
and thats pretty much it
NO xd
seems fair enough to me
That is a VERY wide range
?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/
How could I check if a mob/entity is loaded?
Bukkit.getEntity(uuid) == null (or not)
Or would this work?
no, getChunk() would load the chunk
why do you even have a zombie object if it might be unloaded?
if you already have a maybe-stale reference, use isValid()
I want to have a BukkitTask run every few ticks while the mob is alive or is loaded
No point in running the task if the mob is in an unloaded chunk
either get it by uuid or check isValid
any idea why im getting this error:
Caused by: java.lang.ExceptionInInitializerError: Exception kotlin.jvm.KotlinReflectionNotSupportedError: Kotlin reflection implementation is not found at runtime. Make sure you have kotlin-reflect.jar in the classpath [in thread "Server thread"]
but its getting loaded by spigot
[17:03:40] [Server thread/INFO]: [SpigotLibraryLoader] [PT] Loaded library P:\PT\bukkit\run\libraries\org\jetbrains\kotlin\kotlin-reflect\1.9.20\kotlin-reflect-1.9.20.jar
im shading it into my jar, as i can see by checking the jar under recaf or jd-gui
umm????
oh thanks
it's noted in the javadoc :p
the entire statistics enum is fucked up
sure but it isn't updated at all
It should be registry backed smh my head
any ideas?
Hi guys, someone knows why the title is blinking? https://paste.md-5.net/eqehugahov.java here is the code
Set the fade in duration to 0
thanks
it seems i messed up somewhere early in my project where i initialized git in one of my modules, but now obviously the other modules aren't in my repo. any way i can change the git root directory to its parent director?
project
__core
____.git
____src
__module
____src
might be able to do something with https://github.com/newren/git-filter-repo
but its gonna be quite a fun journey π
uh oh
material.valueOf must work?
what does that even mean
use Material#matchMaterial
valueOf is primitive
and will throw an error if it fails to find an enum entry
There's also Registry.Material.match
itβs just that the plugin cannot get the material through the string using valueOf, thinking that these materials do not exist
but with match this work
yeah but that's on the chopping block
:P
god I wish
Registry#MATERIAL is no more on the chopping block than Material#matchMaterial() is 
why do people hate the material thing? π€
its never bothered me lol
Half of that class is switch statements
If we want to pull per-item or per-block data, we have to do it through UnsafeValues
Or switch and test it
weird you have to do it through unsafevalues
I mean how else would we do it? :p It's a Bukkit type. We can't just pull data from the server
The only ways we can really do that is via Server, ItemFactory, or UnsafeValues
well technically you could
not sure if it would be wise though lol
Yeah. It just makes more sense for it to be an interface and be implemented by a CB like all other interfaces are
Directly wrapping an internal type
How do I move an entitity to a location smoothly over a defined amount of time? e.g. move one block every second
repositories {
mavenCentral()
maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots/")
}
dependencies {
compileOnly("io.papermc.paper:paper-api:1.20.1-R0.1-SNAPSHOT")
annotationProcessor("io.papermc.paper:paper-api:1.20.1-R0.1-SNAPSHOT")
compileOnly("org.bukkit:bukkit:1.20.1-R0.1-SNAPSHOT")
annotationProcessor("org.bukkit:bukkit:1.20.1-R0.1-SNAPSHOT")
}
java {
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
}
Why it doesn't work?
using pathfinder goals
but that requires nms, without nms you just teleport I suppose
what's the best resource for that?
You are using the paper api but the spigot repository
couldn't tell you the best resource to help with that unfortunately
maybe someone else might know of some kind of lib etc
And both bukkit and paper api are not available annotation processors
Ok
Whats the url of the Bukkit?
new spigot update dropped??? They do compile time annotation processing now!!!! π₯³
maven
bukkit has been dead for years
I don't think there is one
Hows that
I'm joking
But if it was real, how would it work
I hate when my wifi dies for a microsecond
One example would be to have @EventHandler annotations generate code on compile time which registers the methods by hand.
ServiceLoaded Listener πͺπ―
this is unfortunate, I got chatgpt to work pretty well with the assistant feature to do plugin support for my plugins but it's just expensive
This wiki page is NOT trying to convince you Gradle is better than Maven.
lol who wrote that?
a maven cope and seether
conclure apparently
is it possible to set a player's head yaw?
Teleporting them to a location which has a yaw should work
okay thanks
EnderCrystal does not extend Hanging, what would be the event for when a player places an end crystal ?
I think itβs the EntityPlaceEvent
Ok thanks
hey
somewhy location is null
im trying to load it from config
it think the world is the problem
do i have to type the command
its loaded with multiversecore
?nocode
Itβs hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.
Is it loaded before you try and read that

