#help-development
1 messages Ā· Page 1188 of 1
it can be a world, but it can be anything else
it can be a clipboard, or your custom extent
ohh wait
how can i set it to a custom one? it doesnt have a constructor so how would that work?
you extend it
what are you trying to do?
make a cyllinderš
then you don't need a custom extent
what do you need an extent for?
probably for this
uh for a pattern
Pattern pt = new TypeApplyingPattern(ext, (BlockState) Material.STONE.createBlockData().createBlockState());
look at the subclasses of Pattern, you can just pass a BlockState
something like BlockTypes.STONE.defaultBlockState()
what
and generally speaking you can't just cast WorldEdit and Bukkit classes
what what?
it said blockstate
yes
because you can't just cast WorldEdit classes to Bukkit classes and vice versa
BukkitAdapter:
you need to use a WorldEdit BlockState which you create with ^
ok
so
i am
dumb
but the dev is also dumb
me dumb for not realising this, dev dumb for not using already existing methods(and variables)
what dev? what existing methods?
the World edit API dev, and stuff like (Material) data type
my brain is like way to dizzy from this shit gona take a nap XD
its deepfried rn
they literally cannot use the bukkit API in the core worldedit api
lol
why isnt it possible
...
dis me to the developers
/developer
idk if its a solo dev or not
my comprehension is still on a very little scale
but ok, you are kind of ri
don't they have a separate jar for worldedit for bukkit?
pretty sure I recall that being the case
WHY ISNT IT POSSIBLEššš
Making universal jars is kinda meh ngl
not sure then what it isn't possible
reading is hard isn't it
the core api is mutliplatform
there are adapters (FabricAdapter, BukkitAdapter) in each platform api
don't think I have ever used the core api
I mean, if you've ever used the API at all, you have
I just depended on the main jar
you can't use the worldedit API using only the bukkit api
not sure what you mean
the classes and methods operate on their own types
that is not what I mean
I'm talking about the classes the API operates with
worldedit API does not operate with bukkit classes
it operates with worldedit's own types
which are accessible in all modding platforms
then each platform jar has its own adapter
Well WorldEdit's api isn't all that great either
not like they documentated much of anything as well or if it has a documentation it isn't really clear
its a nice tool, just api is probably its biggest downfall of anything however good news you don't need its api
bump š
?paste ur build file
i don't even got a phishing rod
proxmox backup server is the best thing ever invented
hey how can i import NMS with spigot, i tried this but it doesn't work ... : compileOnly 'org.spigotmc: spigot:1.21.1'
?nms
If you're on gradle I reccomend you use Patrick Chloe remapper
uu the site is dead?
@tender shard you doing site maitenance?
He's probably doing maintenence
Basically run buildtools with the remapped flag --rev 1.21.1 --remapped or on the gui options>remapped tick the box. Then look how to use Patrick Chloe remapper
Bad timing maybe ig. Looks like it's still having db errors in my end
If it's still starting it's chill
because db is 105 and web is 101 lol
now my discord bots are down
and the repo will be down in a minute
like this?
Yes
Make sure in gradle you have the weird -R0.1-SNAPSHOT at the end tko
okay i wait for the buildtool and try again
Contribute to patrick-choe/mojang-spigot-remapper development by creating an account on GitHub.
i should make that gradle special source at somepoint
You need to remove your spigot api dependency
and the space at : then add :remapped-mojang to the end
i didn't get any error
thxx
but
no JavaPlugin Anymore?
did your buildtools run complete with no errors
yes
did you run it for 1.21.1
double check it completed successfully
i ran it another time
i think it's okay?
okay work now
idk what i do x)
thx youu
reload gradle
will storing a list of entities (villagers) in a game instance's state cause a memory leak
If you mess it up yes
which are in a non-persistent world
how do I not mess up
When is spiggot 1.21.5 coming out?
once
releases 1.21.5
I have a friend who uses Bedrock and has already updated to 1.21.50, but Java hasn't appeared for me yet.
Bedrock and Java editions are two entierly different games
that's because that's a bedrock version, not a java one
It's because I was using the GeyserMC plugin
But when I enter my friend it says outdated version please update to 1.21
Yes that's because Geyser is out of date
But if there is the latest version, the one that came out yesterday
and you're friend is on Bedrock?
Yes
Could you send the output from /version Geyser
How? I'm sending you the message that I get when trying to log in from Bedrock. I didn't understand the message. I don't speak English.
Run the command /version Geyser in the console or ingame
and send what it tells you
old ass code
why did you reply to a 2 day old message
sometimes I look up my name to reply to messages I missed
It tells me unknown command
Is the docs from Raid#getBadOmenLevel wrong? it says it returns the bad omen level from 0 to 5, but there is no bad omen 0 nor bad omen 6
If you're in console remove the /
Bad omen 5 does exist
Geyser spigot version 2.5.1 snapshot
Is that the exact output
nope, 0 is the first level
and 5 is Bad Omen VI
Yes
u can get fucking plug-in versions with the version command??
yup
How do you convert � format for TextComponent, its only working for &x&r&r&g&g&b&b https://paste.md-5.net/avofuwuteb.cs
you convert it to &x&r&r&g&g&b&b
simple enough
i sent the code
and what does that code output
you're in luck
i showed you a pic of the difference
I have mine open
Before you translate it
private static final Pattern HEX_PATTERN = Pattern.compile("#([a-zA-Z0-9]{6})");
private static String colorValue(String text) {
final var matcher = HEX_PATTERN.matcher(text);
final var hexColored = matcher.replaceAll(result -> "&x" + String.join("&", result.group(1).split("")));
return ChatColor.translateAlternateColorCodes('&', hexColored);
}
``` @wraith delta
that one works :P
it replaces #RRGGBB with this
comes out like this. To rename my item I used � ill send more of the code in a paste one min
don't add the &
if you want the & change the pattern to have one at the start
is there a way to remove that because I use &l too. in combo with #00000, on.. a lot of stuff
private static final Pattern HEX_PATTERN = Pattern.compile("&#([a-zA-Z0-9]{6})");
sent you the edited pattern :P
Looks like you're adding a bit too many x
still didnt work :/ i copied it from https://www.birdflop.com/resources/rgb/ which uses the � format
well, it should work
https://paste.md-5.net/ipozunotot.cs Maybe its the way I used it?
why are you coloring it twice o_O
where?
I use it in chat and in the hover
oh, that just colors the nickname, we dont want to color the chat message
been working on it so much that its messy. it just wont work
can you try to just send a message on join
player.sendMessage(colorValue("&#FF0000RED"))
can you try to type in chat
&#FF0000RED
since you're coloring chat anyways lol
restart or reload
yea i restart
good
can you do this
and also
System.out.println(colorValue("the same name as that sword"));
Looks like the TextComponent constructor doesn't have the magic rgb hack in it
Choco did it with a single hex code, but i need the whole gradient. maybe choco knows?
You can just use MiniMessage and their format
but then id have to rename all of my items wouldnt i
it does
it just needs to be lowercase
make what lowercase
let me get you the source
*Picture in case of phone
anyways it just parses it as a chatcolor, they probably don't have it to not slow down #sendMessage
Youve given me a sendMessage, but i need the color conversion in the TextComponent. where might I make the hex codes convert to lowercase when grabbing the display name
player.spigot().sendMessage(ChatMessageType.CHAT, TextComponent.fromLegacyText(colorValue("&#ff0000this is red text")));
sendMessage | TextComponent from [item] | the msg you gave
don't do + formattedMessage
its the same
https://paste.md-5.net/soqicatuqe.java Here, entire class. if you want to try. ive been restarting a lot testing combos
if the string is hard coded, one could use bukkit's native rgb color code format
#rrggbb = §x§r§r§g§g§b§b
If you are hardcoding a string just use ChatColor.of
hello I don't know if its me the probleme or spigot but when i try to start a new plugin in 1.8.9 it say that and I don't know how to solve it
1.8.8 isn't a valid version and you should be depending against 1.8.9 anyway
try 1.8.9-R0.1-SNAPSHOT
or did the server not have a 1.8.9, I don't remember
if that doesn't work then do the same but with 1.8.8
where can i find it bcs i only see 1.8.8 to 1.9
the server didn't have a 1.8.9 then, I am misremembering
just use 1.8.8-R0.1-SNAPSHOT
I am surprised that hasn't happened yet
but i already put 1.8.8 is there a difference if i put 1.8.8-R0.1-SNAPSHOT either than 1.8.8
1.8.8 is not a valid version for the artifact
spigot has always had the -R0.1-SNAPSHOT part
the version schema is <minecraft version>-<revision>-SNAPSHOT (it's actually a commit ref but nobody cares about that)
there is no "release" version
oh ok thks
though, you should probably use a fork like pandaspigot or something rather than raw spigot for that version, given that it probably has more backported API
but you haven't heard that from me
I don't event know what is pandaspigot but i will try
what is the best way to base multiple items with all their properties? base64?
Base64 is nice in keeping it minimal, but harder to read
You can use NBT serialization, nah?
I want a form that is quick to read and process, it doesn't need to be human-readable
š¤
Then yeah binary would be the best
You can use the api to get it but itās not as ideal as using NMS
you mean CraftItemStack.asNMSCopy(item)?
CraftItemStack.asNMSCopy(item).save(new NBTTagCompound());
CraftItemStack.asBukkitCopy(new ItemStack(nbtCompound));
something like this?
what is NbtIo?
mmm
ill try to use it
thank you so much
i need to install buildtools first
kekew
Can anyone give me some insight? Just making a MOTD plugin, with a config, i hate either having to restasrt my server or login to issue the plugin's reload command. I know with other plugins, it is a bit foolish to have your plugin reload on any write change, because it can lead to corruption. But realistically its just a MOTD plugin. Would it be detrimental to have my plugin reload on any write change to the file? Can plugins even do that?
Run from console?
Yeah, its possible, but i dont always want to do that.
?services @winged compass
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/
wdym?
read the message below
ohhh ty
I mean, I don't particularly see anything wrong with file watchers
just make it a config option that is enabled by default
I also don't see why it'd lead to corruption, if they mess up the config format then you can just rewrite the file to whatever is the default or get the default right out from the jar
that or keeping the old version till the format is fixed
Is that just done like how it normally would be using IO in java, or is there some kind of method in spigot for that?
Normal java methods
Really appreciated @sly topaz
I wish yaml schema validation was more standarized so that one wouldn't have to worry as much about the format tbh
I like to think this is a typo and you meant to name it "JoshLib" but you just went with it
Wait till you find out he was and still is in places coll because he failed to spell cool
Just wait until he finds out his whole username is actually a typo for Joshuna
Itās not
how do you know
It's actually a typo for cock
Or maybe itās chocolate without the late
š
Because choco is never late
Oh because you lov-
Because I love chickens
thats def what you mean
why i cant import spigot dependency?
i mean spigot not spigot-api
i have it on my .m2
but my ide doesnt recognize it
Iām not exactly sure but have you put the mavenLocal() in the repositories?
lol tysm
but wtf
why
i had plugins before with "spigot"
and how do i convert all the items to bytes
i think im not getting it
:kek
I donāt use gradle so not sure
tysm btw
just copy their method in that class
https://github.com/Jishuna/JishLib/blob/4.0/nms/v1_21_R3/src/main/java/me/jishuna/jishlib/nms/v1_21_R3/NMSAdapter.java#L140-L153
these more specifically, which make use of the class they linked
but what if i want a whole inventory
What is the best way to utilize the classes that were enums (OldEnum) but are now interfaces?
For example I'm using API version 1.21.3 and need to support older versions so I used Biome.valueOf(biomeName)
However when I run this on 1.20.4 I get this error
java.lang.IncompatibleClassChangeError: Method 'org.bukkit.block.Biome org.bukkit.block.Biome.valueOf(java.lang.String)' must be Methodref constant```
im using this now š¤
private static final byte ARRAY_SERIALIZATION_VERSION = 1;
public static boolean isEmpty(ItemStack stack) {
return stack.getType().isAir() || amount <= 0;
}
public static ItemStack emptyItem() {
return new ItemStack(Material.AIR, 0);
}
public static byte[] serializeItems(Collection<ItemStack> items) {
try (var baos = new ByteArrayOutputStream();
var dos = new DataOutputStream(baos)) {
dos.writeByte(ARRAY_SERIALIZATION_VERSION);
dos.writeInt(items.size());
for (var item : items) {
if (item == null || isEmpty(item)) {
// Ensure the correct order by including empty/null items
dos.writeInt(0);
continue;
}
var itemBytes = serializeItem(item);
dos.writeInt(itemBytes.length);
dos.write(itemBytes);
}
return baos.toByteArray();
} catch (IOException e) {
throw new RuntimeException("Error while writing itemstack", e);
}
}
public static ItemStack[] deserializeItems(byte[] bytes) {
try (var baos = new ByteArrayInputStream(bytes);
var dos = new DataInputStream(baos)) {
var version = dos.readByte();
if (version != ARRAY_SERIALIZATION_VERSION)
throw new IllegalArgumentException("Unsupported version or bad data: " + version);
var count = dos.readInt();
var items = new ItemStack[count];
for (var i = 0; i < count; i++) {
var length = dos.readInt();
if (length == 0) {
// Empty item, keep entry as empty
items[i] = emptyItem();
continue;
}
var itemBytes = new byte[length];
dos.read(itemBytes);
items[i] = deserializeItem(itemBytes);
}
return items;
} catch (IOException e) {
throw new RuntimeException("Error while reading itemstack", e);
}
}
didn't totally just copy Paper's impl of this
-# just changed the name because it sucks, also <3 var
why are you saving it to a config
if you are targeting older versions, your API version needs to reflect that, no way around it
the server goes out of the way to do legacy support shenanigans so you don't have to, may as well take advantage of that
then again, the registry API has existed for quite a while now (since 1.14), how far back are you targeting?
just to test
Silly question it's always 1.8
1.19, guess I've been doing it wrong
I'd honestly just make two different versions of the plugin at that point
multi-release spigot jars when
most people haven't noticed that the registry api was there until 1.20.6 so you're good lol
well crap that was easy
return Registry.BIOME[NamespacedKey.minecraft(name.lowercase())]
Is there any problem in wiki.vg?
I tried to use protocol lib but site doesn't work š¦
They merged to minecraft's official wiki page
ahha where can I find the wiki page?
wiki.vg, a wiki that documents Minecraft's protocol extensively, was sunset on November 30, 2024. As the announcement posts reads, "The final content will be archived and made available for download in MediaWiki's XML export format under the CC-BY-SA license, along with an archive of images and other media." The sunsetting announcement can be re...
on deserializeItems what is input?
i think i made the serializeItems one
public static byte[] serializeItems(Collection<ItemStack> items) {
try (var baos = new ByteArrayOutputStream();
var dos = new DataOutputStream(baos)) {
dos.writeByte(ARRAY_SERIALIZATION_VERSION);
dos.writeInt(items.size());
for (var item : items) {
if (item == null) {
// Ensure the correct order by including empty/null items
dos.writeInt(0);
continue;
}
var itemBytes = serializeItem((CompoundTag) CraftItemStack.asNMSCopy(item).save(MinecraftServer.getServer().registryAccess()));
dos.writeInt(itemBytes.length);
dos.write(itemBytes);
}
return baos.toByteArray();
} catch (IOException e) {
throw new RuntimeException("Error while writing itemstack", e);
}
}
public static byte[] serializeItem(CompoundTag tag) {
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
try {
net.minecraft.nbt.NbtIo.writeCompressed(tag, outputStream);
} catch (IOException ex) {
throw new RuntimeException(ex);
}
return outputStream.toByteArray();
}
is there a reason you didn't just copy Jishuna's method
I forgot to rename the usage of the var, I fixed it now
How can I use gson to get the url string of this JSONstring? { "timestamp" : 1702007669624, "profileId" : "5e54234d3c864291b8d7321d39a0bd20", "profileName" : "Nagasonic", "signatureRequired" : true, "textures" : { "SKIN" : { "url" : "http://textures.minecraft.net/texture/e4af165698f313809f5e01bdf8863bc19e94aa8b863b936f8d33b59cdc9c57fb" } } }
you could ask chatgpt that question really lol
why do that when SpigGPT exists
actually worked š
hello fellow inttelectuals!
i was looking at a database my plugin makes for data and i saw these other sql features
i was wondering how to create indices in java or how exactly they work
would you have to specify some sort of primary column beforehand
I mean, it isn't so much of a java feature, it is a sql feature
and if you've used a primary key before, then you've already used indexes
String url = JsonParser.parseString(json)
.getAsJsonObject()
.getAsJsonObject("textures")
.getAsJsonObject("SKIN")
.get("url")
.getAsString();
sth like that
is that gson tho
import com.google.gson.JsonParser;
I've never used gson to manually parse json objects, since it is so easy to just create a record for it lol
Nah I did it
record Profile(long timestamp,
String profileId,
String profileName,
boolean signatureRequired,
Textures textures) {}
record Textures(@SerializedName("SKIN") Skin skin) {}
record Skin(String url) {}
var profile = someGsonInstance.fromJson(jsonString, Profile.class);
hm ok i read that it improves performance and stuff, so is that literally just what using a primary key is?
since we're indexing by that
it improves read performance, yes
however it may reduce write performance in certain scenarios, so you have to know your data if you are planning on manually assigning some indexes to your tables
primary keys are a form of unique indexing, there are other forms of indexing as well but usually people will just use a primary key since that's the simplest to understand, you can read up on the CREATE INDEX statement for more information on different types of indexes
ic ic
i want to use methods from jar plugin (it doesnt have api)
what should i do?
you can use a file dependency in maven and gradle
am i update my java version 21 to 23?
š«
The proper approach is to install file it to your local maven repo
SystemPath dependencies are deprecated
Ah yes
compileOnly(files("./spigot.jar")) fr
I love storing the spigot jar in the project directory
true
you can compileOnly a spigot jar, I've done that lol
For an older version?
sure
If you extract it yes you can do what you want
but that's not what your message said š«
true š«
gotta love some provider factories
Hello
I have a problem with buildtools
I selected 1.21 version and it install 1.21.1
Depend on 1.21.1 instead of 1.21
Is there a way to remove temporarily without spectator?
And you should not.
1.21.1 is just a hotfix for server crash
No functional changes at all, in fact 1.21 client can still join 1.21.1 server
Just change your dependency
Not sure what you mean
remove what
oh sorry I missed critical thing š
Is there a way to remove crosshair temporarily without spectator?
You absolutely could
I didn't find any other way on wiki
I saw a server remove crosshair without resource pack
I don't understand how they did it.
What server ?
I could maybe take a look.
You can set the players camera
Without spectator mode it looks really funky though
That works without spectator š ?
I already tried that but crosshair doesn't disappeared in survival mode
if you don't do it properly you can get this...
yes we can do it with nms
crosshair is still there
ebic fail
yes that's what I want to tell
if you don't do it properly
I was just referencing the "looks really funky" part
Umm... Is it allowed to mention the server name?
#1025405608528195685 message that's why I posted it in fabric #epic-fails
This is the current state of this but it uses spectator mode
Note that I'm only sending a gamemode change packet here so we don't have any spectator hotbar or anything
Ahha I got an answer thanks š
You could do that I guess
Note that it can very well lead to undefined behaviourā¢
thank you your my savior š
JEP 484 got added in Java 24 
classfile api goes crazy
link the jep so i can figure out what it is
classfile api
i made it work
tysm
weird interaction i found, please correct me if im misunderstanding
but modifying an item packet (like container contents packet, player inventory packet, slot item change packet) for a player increative mode actually changes the nbt of the item
but not in survival mode
so creative mode inventories are determined purely on packets
in creative mode, the client has complete authority over the items that are in their inventory
so yes, that's normal
iirc the solution to that was to remove the meta from the "real" item and re-add it to the client-sided one
constantly fighting creative
I love creative mode!!!
hey I need your help I need your suggestions. How can I write a /tp command system so that it works between 2 different spigot servers connected to the bungeecord server
Creative mode spawning a command block minecart that runs /stop when activated:
command blocks cannot run op, ban, kick, stop, restart, etc. commands
execute as @p run stop
What if we did that
does not work
aww
well, then there's another way
Repeated command block minecart spawning more repeated command block minecarts that just spawn shittons of pigs

Does anyone knows how to include dependency in the aftifact build in inteliJ idea? I tried implementing "club/minnced/discord/webhook/WebhookClient"
when I tried to use it, it throws this exception java.lang.NoClassDefFoundError but this didnt happened with SQL dependency.
I tried added it to my artifact build but still the issue presist.
[17:20:16 WARN]: Exception in thread "Thread-13" java.lang.NoClassDefFoundError: club/minnced/discord/webhook/WebhookClient
[17:20:16 WARN]: at smpMGR.jar//org.opi.crimeSys.modules.heartbeat.watchPlayers(heartbeat.java:36)
[17:20:16 WARN]: at smpMGR.jar//org.opi.crimeSys.modules.heartbeat.updateFunctions(heartbeat.java:67)
[17:20:16 WARN]: at smpMGR.jar//org.opi.crimeSys.modules.heartbeat.run(heartbeat.java:85)
[17:20:16 WARN]: Caused by: java.lang.ClassNotFoundException: club.minnced.discord.webhook.WebhookClient
[17:20:16 WARN]: at org.bukkit.plugin.java.PluginClassLoader.loadClass0(PluginClassLoader.java:197)
[17:20:16 WARN]: at org.bukkit.plugin.java.PluginClassLoader.loadClass(PluginClassLoader.java:164)
[17:20:16 WARN]: at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526)
[17:20:16 WARN]: ... 3 more
I tried everything on hthe internet but nothing worked or it was in maven
Don't use Artifact you'll need to use maven
Basically code that doesn't exist cannot run so you'll need to include or load the dependency on the server
Gradle works too
Get the shadow plugin for gradle and shade that dependency in to your jar
Make sure to relocate it
I tried but it didnt worked
i would share the shade code in second
plugins {
id 'java'
id("io.github.goooler.shadow") version "8.1.8"
}
group = 'org.opi'
version = '1.0-SNAPSHOT'
repositories {
mavenCentral()
maven {
name = "papermc-repo"
url = "https://repo.papermc.io/repository/maven-public/"
}
maven {
name = "sonatype"
url = "https://oss.sonatype.org/content/groups/public/"
}
}
dependencies {
compileOnly("io.papermc.paper:paper-api:1.21.1-R0.1-SNAPSHOT")
implementation("mysql:mysql-connector-java:8.0.33")
implementation("club.minnced:discord-webhooks:0.8.4")
}
def targetJavaVersion = 21
java {
def javaVersion = JavaVersion.toVersion(targetJavaVersion)
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
if (JavaVersion.current() < javaVersion) {
toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion)
}
}
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible()) {
options.release.set(targetJavaVersion)
}
}
processResources {
def props = [version: version]
inputs.properties props
filteringCharset 'UTF-8'
filesMatching('plugin.yml') {
expand props
}
}
tasks {
shadowJar {
archiveClassifier.set('')
}
build {
dependsOn shadowJar
}
}
```\
I tried to relocate it but it dosent work
tasks {
shadowJar {
dependencies {
include(dependency('club.minnced:discord-webhooks:0.8.4'))
}
}
build {
dependsOn shadowJar
}
}
same issue NoClassDefFoundError
How are you building your jar
you don't need to do that including
first use ./gradlew shadowJar
and then build artifacts
Don't use artifacts
don't build artifatc
use the gradle build task
since you set it to depend on shadow, you don't need to run shadow befor
gradlew build?
just run ./gradlew build
Is there a reason setting end portals with the FAWE API causes them to be invisible until adjacent blocks are updated? Is there a way I can force this update upon players?
I did but where is the generated jar is located?
Sounds like a bug you should ask them about
build/libs/...-all.jar
oh I see thanks, is there something that I can use to it directly generate it to the plugins folder?
there is
you can use a copy task
you can use a copy task
Then that's old
alright
your internet used the copy task
tasks.register("copyJars", Copy.class) {
from(tasks.shadowJar)
into("pathToPluginsDirectory")
}
tasks.assemble {
dependsOn("copyJars")
}
groovy ^
Groovy 
it is weird that the sql lib didnt required to be included in the jar
Spigot includes it for you
spigot bundles some sql stuff ^
the one with -all
btw the copy thing dosent work, I used ./gradlew shadowJar
you can use this and then just ./gradlew build and it will copy it over
shadowJar generates -all, build does not (iirc)
correct
I mean you need to sync gradle too
if you didn't do that
the all is added if you dont remove the classifier
which their build.gradle did
ah
do I need to shadow the spigot too? I am getting same no class def found error but with org/json/JSONException
please don't fucking shade spigot
alright
i got problem, I fixed the json exception by adding it to the shade
but now it is the OkHttpClient
isnt there any command in gradle that would shade all the lib dependencies?
you need to make the assemble task depend on shadow
show your entire current buildscript
right you don't need the shadow dependencies thing
and please don't do this ```groovy
tasks.shadowJar {
doLast {
def jarFile = archiveFile.get().asFile
def destinationDir = file("C:\Users\tomma\Desktop\mcserver\plugins")
if (!destinationDir.exists()) {
destinationDir.mkdirs()
}
copy {
from jarFile
into destinationDir
}
println "Copied ${jarFile.name} to ${destinationDir}"
}
}
but rather the thing I sent
your version didnt worked
and what did not work
this is temp fix I would look to it later
and did you run the task
well I told you to not run that
wait so I just need to remove the task.shadowjar?
and run the one you created instead
wait so use gradlew copyJars?
thanks lot! after I removed the shadow thing it have all the included libs into it
and the copy thing worked, I tought the task would run on the shadowJar

it works now thanks
wait one question? why is the artifacts are considered a bad practice?
that will always try to copy on every single build
what if somebody who does not have that directory wants to build
pretty sure that will just fail
-# not saying hardcoding paths is a good practice
i watched some tutorial and they recomended artifacts, since from that tutorial, I used the artifacts
thanks for the suggestion of using the gradlew
fuck no
intellij should never be used as a build tool
yep, almost every tutorial in the inteliJ idea suggesting the artifacts. I dont know why they do that
did you reload gradle
How can I break a block without dropping the ItemStack? I'm using BlockBreakEvent and trying with block.breakNaturally()
event.canceled = true
and make sure you destroy the block via code
but the block will be still there
ohh
try event.setDropItems(false)
instead of the cancel
just show that on the docs
i'll be using that
in methods
Thanks tomas
now it works well
np
is there a way to call an inventory involved in a transaction that you created, theres top and bottom for player but what about the menu you just created
player.getOpenInventory().??
You mean like an inventory view?
Some method that would call everything in that custom menu
like if you open a crafting grid, call whats in the crafting slots
Is there a way to get when a player enteres a structure on 1.21.1? I do not want to touch packets nor nms.
If I want to save data from ALL players on the server every x time, what would be the best option?
async schedule and sending data to the database and that's it?
It has getTopInventory and getBottomInventory, but isnt that just calling the hotbar and bigger inventory section of the player?
Or does getTopInventory refer to the open GUI
Correct
Bottom inv is the players inventory, the hot bar included in that
Ohhh
Neat, thank you
So something like this
player.getOpenInventory().getTopInventory().getStorageContents();
Would call back a list of ItemStacks in the opened GUI?
This might be easier then i thought lmao
Correct
Ight den, time to mess with menutypes and get this in a much simpler system
doing custom crafting
I did custom crafting last year š«” best of luck
Well since they added menu types, if one of these menus is super simple, it just made custom crafting 10x easier
or i can just ignore certain blocks lol
I mean, for custom crafting 99% of the time all you have to do is register recipes
Ghost blocks called upon crafting cant store names, or descriptions
Its a mojang bug
ghost blocks?
the blocks that show up when you click a recipe for something
In the recipe book?
I donāt think thatās true 1 second
it doesn't seem to be easy if anything, I'm pretty sure you can hack it away since the abstractions aren't closed off or anything but I am unsure of how to go about that given how gigantic the kotlin gradle plugin codebase has gotten
Try it yourself
It wont work. That player head is missing its data, but it shows up fine on the left
best you can do is probably just not use kmp for it, and just use different modules altogether
I am slowly cracking away at the gradle plugin implementation, however it's taking time since I don't fully understand the gradle API either lol
haha yeah the KGP is really odd sometimes
I've had to work with the compiler codebase a bit for some shenanigans and it's been odd
Your calling base items
Inputs, not the output
You can do exact choice
like fr mojang
But Mojang doesnāt really support that
Biggest headache ever
and its such a simple fix for them but they dont want people to customize the game
so we get broken inputs on custom recipes
I mean I still donāt really see the issue
use a player head, its missing its skin
Do people use the recipe book to craft items that much?
then players are confused
On my server with custom recipes yes, I didn't think so either but when I implemented it without the recipe book support there were riots in the streets
Not me, but do understand custom items you would need the custom recipe
It just confuses players heavily cause they think it wont work in all reality it will work
minor visual issue š¤£
frick
Its possible to recreate the pickup animation for a block? I mean, like make the drop move to the block and like clear it then
theres gotta be a simple fix for them only accepting Material instead of ItemStack
for the input
This was as close as I could get it to work, but again no recipe book support for these ):
So thats a nice idea
Too bad its a small grid
Wonder how these new MenuTypes are
Same can be done in a normal 3x3
Oh i know, its just dumb we cant use it on a crafting table...
I did the same thing with my plugin but it was a custom crafting menu
Ill just do what that video shows basically
Ahh I see what u mean, agree
Ya at the time it was the best way I could find to achieve this as well as the custom stack amounts (by default 1 item amount per craft for all items in MC)
Im really big on visual bugs that would confuse the player, so i have to do this in a way that doesnt allow ghost items
Which means, no crafting table with the book
I haven't looked but I wonder if we can hijack the packet that shows the ghost item and replace it š¤
Actually its prob client side
š
Donāt think so
I found this https://www.spigotmc.org/threads/how-to-know-when-a-player-enters-a-structure.449789/, but StructureGenerator doesn't exist in 1.21.1 (I ran build tools and dependency id is spigot)
Wanna know the kicker, i opened a bug for this saying it was a client sided bug of missing data on input crafting items. Ticket got closed saying works as intended
Mojang doesnt intend for custom items
?
They are literally making the groundworks for data-driven items atm lol
Ya I didn't think it was a bug, I figured that was the case lol
d18n goes brr
you can already have custom items, there's no property you can't change with data components now lol
at least not one that matters anyway
I aint heard of that
that's what datapacks are all about
https://github.com/misode/mcmeta/tree/assets/assets/minecraft/items Then what is this?
I said i havent heard of it, not it is completely false
Thanks for the link though
reading rn..
what kind of server is this
Prison, mine
Although the vid is on the development server
Why is org.bukkit.entity.Breeze still marked as experimental / unstable in 1.21+?
Seems like an oversight
hey md, how are you? š

?nms
Not sure what the forge site is but thereās nms
tnx anyway
?mappings
Compare different mappings with this website: https://mappings.dev/
Mayhaps
Why PotionEffectType dose not have valueOf method, how could I check if some string is a proper name of potion type?
ye but in recent version of spigot this method is deprected
the name?
if the name is deprecated you can also use the key
i'm sure the key has a string value as well that you can store
and then you can recreate the key when you convert it back from string
ok thanks
no problem š
Registry
there you go
Specifically Registry.EFFECT
so in method get() as a key of Namespacedkey I should you name of potion effect, and as a namespace "minecraft" or it works some other way?
match()
i made a plugin which im stupid at explaining but when i do /addcratelocation i get this in chat
you return false somewhere
Provide the code for it.
did u register the commandextecutor implementation in the onEnable?
happens to me sometimes when I forget to do that
Really?
yes
when its registered in plugin.yml but not in onEnable it just returns the name of the command
OH right yeah
And then if it's not in plugin.yml u get the generic "command not found"
yes
How can I download spigot mc?
you kinda have to build it
you get buildtools.exe or buildtools.jar and run it, you can get your desired version that way
hey gamers, is 1.21.4 1_21_R3?
@torn shuttle yes
what kind of curse is maven hitting me with now
why is it every single time with maven
brother
ide says none of this works
and yet it installs just fine
have I ever mentioned how much I despise maven
IJ issue not maven
this time yes
oh and incrementing the module version fixed it
of course it did
why wouldn't it
lol
maybe I should've also checked if going to my fridge and setting on fire might've fixed it, makes about as much sense
very likely as its a caching issue
maven multimodule is a pain anyway
fr why can't it inherit the version from the parent pom
you can if you use the <revision> tag
mind showing me an example?
Parent
<artifactId>essentials_suite</artifactId>
<version>${revision}</version>
<packaging>pom</packaging>
<properties>
<revision>1.0.0-SNAPSHOT</revision>``````xml
<parent>
<groupId>com.palmergames</groupId>
<artifactId>essentials_suite</artifactId>
<version>${revision}</version>
</parent>
<artifactId>essentials</artifactId>
<packaging>jar</packaging>```
thx, that works, only IJ doesn't like it, but that's no problem
yeah it sucks ass
hm I think I already tried something like that before but let's try it again I guess
Eclipse is fine with it, but I guess IJ just complains
eclipse W
oh I did this yesterday
You build the first version normally
then add a revision variable to the parent pom
which has the same version you just built
then you edit all poms
and voila intellij and maven are happy
doesn't seem to want to work
Its probably just your chubby fingers
I will end you
yeah it really doesn't want to work
you sure you did revision in properties and not version ?
try adding some text to yoru version so its not just a number
revision
That rings a bell for me
that doesnt matter, it works for me just fine https://github.com/mfnalex/JeffLib/blob/master/pom.xml#L23
same for me
magma show your parent pom
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
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>com.magmaguy</groupId>
<artifactId>EasyMinecraftGoals-manager</artifactId>
<version>1.15.0</version>
<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<!-- This sets the versions of the modules!-->
<revision>1.15.0</revision>
</properties>
<!-- This is the project parent, do not create further artifacts -->
<packaging>pom</packaging>
<modules>
<module>EasyMinecraftGoals/dist</module>
<module>EasyMinecraftGoals/core</module>
<module>EasyMinecraftGoals/v1_19_R3</module>
<module>EasyMinecraftGoals/v1_20_R1</module>
<module>EasyMinecraftGoals/v1_20_R2</module>
<module>EasyMinecraftGoals/v1_20_R3</module>
<module>EasyMinecraftGoals/v1_20_R4</module>
<module>EasyMinecraftGoals/v1_21_R1</module>
<module>EasyMinecraftGoals/v1_21_R2</module>
<module>EasyMinecraftGoals/v1_21_R3</module>
</modules>
<distributionManagement>
<snapshotRepository>
<id>magmaguy-repo-snapshots</id>
<url>https://repo.magmaguy.com/snapshots</url>
</snapshotRepository>
<repository>
<id>magmaguy-repo-snapshots</id>
<name>MagmaGuy's Repository</name>
<url>https://repo.magmaguy.com/releases</url>
</repository>
</distributionManagement>
</project>
this is the parent
yes
^
yep, version has to be dynamic so ${revision}
in parent?
yes
what's the error msg?
always a good plan with IJ
I can't ignore what it says when it's trying to install
ij isn't the brightest candle in oliver193's ass, it compiles just fine but IJ complains anyway
to be fair there's a lot of candles in there
yeah, like... many
no idea then. I'd run mvn clean install -X -U, then copy/paste the whole log and all my pom.xml's into chatgpt lol
oh yeah good point
I'm using 3.9.9 but I am 100% sure that I tried this exact way back in 3.6.3 and it didnt work then
it said sth like "bla bla parent version information cant be dynamic" or sth
what's your mvn -v?
because tbh it looks like your versio nisn't even trying to replace ${revision}with sth and just interprets it as normal string, so maybe your maven is even older?
private void updateInventory() {
if (playerCourse.hasLength() && playerCourse.hasDifficulty()) {
ConsoleManager.message(playerCourse.getLength());
ConsoleManager.message(String.valueOf(playerCourse.getLength() != null));
ConsoleManager.message(playerCourse.getDifficulty());
MenusFile menusFile = MAIN.getMenusFile();
ConfigurationSection itemListSection = menusFile.getSection("my-courses-menu.choose-attributes-menu.item-list");
MenuUtils.printItem(itemListSection.getConfigurationSection("submit-course"), "regular-item:submit-course", inventory);
}
Im not sure why, but when I print out getLength() it prints null, and when I check if its != null it says true. So a code that should run only when course has difficulty and length set still runs.
whatevr I can't be fucked to change this nwo
I have so many things I have to update
Show your player course implementation
public String getDifficulty() {
return difficulty;
}
public void setDifficulty(String difficulty) {
this.difficulty = difficulty;
}
public String getLength() {
return length;
}
public void setLength(String length) {
this.length = length;
}
public boolean hasLength() {
return length != null;
}
public boolean hasDifficulty() {
return difficulty != null;
}
A small inconsistency with the this. keyword
but still
With this implementation the output of:
ConsoleManager.message(playerCourse.getLength());
ConsoleManager.message(String.valueOf(playerCourse.getLength() != null));
ConsoleManager.message(playerCourse.getDifficulty());
Will never be
null
true
null
It has to print non-null values, unless you are using a String that literally says "null"
Btw why is your length a String?
Oh a length is actually a string, you can set your course to be "Extremely-Long"
Its just a visual
Ok, so is there still an issue with the code?
Idk wtf happened
I just restarted my server
and the code started working
I mustve changed something
but Idk what I changed
Classic
A question, I want to make a class where I'll store the player's balance and other important informations, for example
package com.ancho.spigot.utils;
import org.bukkit.entity.Player;
import org.bukkit.permissions.Permission;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
public abstract class CustomPlayer implements Player {
public HashMap<String, Integer> currencies = new HashMap<>();
public String prefix;
public List<Permission> permissions = new ArrayList<>();
}
Would this above be a good idea to use?
Ofc have methods inside where you add the permissions, set the prefix etc..
implements Player
no
What would your approach be then?
You do not need to store permissions yourself, those are handled for you.
The rest I'll let someone else answer
I gave permissions as an example, I know there are other things to use.
I mean, I'd take a look at PDC
Map everything to the players uuid
And have some sort of manager class that stores said map
import org.bukkit.entity.Player;
public class CustomPlayer {
private Player originalPlayer;
String rank;
public CustomPlayer(Player bukkitPlayer, String rank) {
this.originalPlayer = originalPlayer;
}
public Player getBukkitPlayer() {
return originalPlayer;
}
// Custom methods
public int getScore() {
return score;
}
public void setScore(int score) {
this.score = score;
}
public String getRank() {
return rank;
}
public void setRank(String rank) {
this.rank = rank;
}
}```
I wanted to make something like this.
But would it have been smart to make a new instance every time a player joins tho?
In a Map<UUID, CustomPlayer>
Avoid keeping a direct reference to the player
Use the UUID to lookup the player instance when you need it
Iāve wondered if itās worth making a little wrapper around a weak reference for players
Or if I should just Bukkit.getPlayer every time
What event that gets called for the top part of cactus when I break the bottom block of the cactus? I'm trying to make the block to not drop items on ground.
Yes exactly
Sorry, cactus, bamboo, sugar cane, and glow berries, all of them
So then it'd be List<CustomPlayer> , then filter all the players using the UUID, right?
That's wwhat I understood
BlockDropItemEvent
Keep your map but don't store the player reference in custom player
That only fires when a player is involved
oh does it :c
ah there we go
I don't know what you mean by this.
Could you give me like an example as how you'd do it ?
Replace Player with UUID
ohhh
Well, for context I'm developing a Harvester Hoe plugin and I want to handle the drops myself (adding drop multiplier, sell mode). Currently I'm handling it by setting the block to AIR, but that will break AuraSkills functionality where player would earn exp from breaking cactus, sugar cane, bamboo, and glow berries.
Yeah, I think I know the solution, thanks guys!
or does it count the player when just the bottom block of a cactus is broken š¤
uh guess you'll find out
Yeah only count the block that I broke š„²
But it might work if I switch the hoe break function into BlockDropItemEvent instead because it's fired after BlockBreakEvent
Nope didn't work lmao
When that event is called, the block is already disappeared.
Should be there thing is the command worked a few days ago and now it just doesnāt
if you just want to check what the block was the event contains the state
or are you talking about the other cactus blocks above the one you broke
Something changed
do double check
How can something change without touching it :/ thatās confusing
I have moved plugins around on my test server but the code itās self I havenāt touched
I can send the addcratelocation class here and the main class
?paste
Cheers for that I forgot what that command was
Does anyone got the proper 1.21 spigot server.jar file?
Yes the other blocks that got broken because I broke the bottom part, anyways I'm just gonna manually calculate how many exp that player earn from that and give it manually š
1.21 or 1.21.1?
1.21
There is no reason to use that
That would be 1.21.4
I mean 1.21.4 isnāt considered stable yet
Spigot only maintains the latest version
Yea but i can't write plugins on 1.21.4 yet, minecraft development kit needs to update haha
but yeah
AddCrateLocation - https://paste.md-5.net/ofeqoqazeb.java
Main Class - https://paste.md-5.net/lufuvilevo.java
ofc you can
You don't need to wait for MCDev plugin
Just set the dependency version yourself instead of relying on an intellij plugin to do it
Ohh i see
You're never registering the command
Anyways, where can i find the proper server.jar file? ;d
if i never even registered it how come it worked before :/
Just as NedSuspected and we wanted you to double check
i think you have to build it yourself
You registered it before
and for some reason removed that part of the code
ā¤ļø
so if i have "registered it" where i need to put that
got it working thanks
It's usually done in onEnable