#help-development
1 messages · Page 406 of 1
there is not one language i learned trough courses, but doing projects im interested in
well, aside from c and cpp for uni
saveDefaultConfig exists on spigot not bungee
You should try hoogling more Petrr
The first line is sortof false
It’s stricly for the root level of the jar.
And a file named
resources folder is java
It does
it will just compile to root dir of jar, that is what resources is used for, bungee doesn't know to handle it ig
iirc bungee doesnt have saveResource
that can be simplified a lot
getDefaultConfig
new File(getDataFolder(), "config.yml" no need for the path or the / which would break on diffeernt file systems
check how this handles configs on bungee https://github.com/mfnalex/BungeeCommandAliases/blob/master/src/main/java/com/jeff_media/bungeecommandaliases/Main.java
no you wont and yes it does work
Bet
anyone know how i stop gradle generating test dirs
which test directory do you even mean?
src/test i assume
U back?
You still have your maven addiction?
do you mean whether still I prefer maven over gradle? If so yes, and that will probably never change
oh god I haven't seen alex in a while
what happened? got too wasted and slept for a week?
Did you rehab?
it works like this: you arrive there with a BAC of 3 permille, then they throw benzodiapecines into your mouth and reduce that dosage every day until you're at 0, then you stay for another few days, then you go home sober again lol
because it works like alcohol on the gaba system
Yeah; i figured. Still quite hefty
I got 20mg diazepam the first two days, then 5mg less every day
I see
plus drugs against erm... whats it called
drugs against humanity
against seizures
wait no that's the wrong thing
Still, doesn’t sort root of the problem.
my root problem is anxiety issues
?paste
There’s so many
i can send the translated doctor's letter, one sec
Sure
I'm trying to Serialize an object that has another object inside of it
Wait is this because of that?
Well
Show me the class
As in
class Ser1 implements ConfigurationSerializable {
private Ser2 ser2;
}
class Ser2 {}
Make other one serializable too
What I did was change Ser2 to serializable
Yes, done that
Added the serialize and deserialize
#general
You sure you didn’t do?
As in
class Ser1 implements ConfigurationSerializable {
private Ser2 ser2;
class Ser2 {}
}
I did it after
rn it's
class Ser1 implements ConfigurationSerializable {
private Ser2 ser2;
}
class Ser2 implements ConfigurationSerializable {
}
In Ser2 i'm storing a
Map<Enum, Integer>
Could that be why?
To me your errors look like it trying to find it, but it’s a subclass and not a seperate class like you are describing
Can i get the top of it too
Package? yes
package me.tomisanhues2.ultrastorage.data;
import me.tomisanhues2.ultrastorage.UltraStorage;
import me.tomisanhues2.ultrastorage.utils.Cases;
import me.tomisanhues2.ultrastorage.utils.UpgradeType;
import org.bukkit.configuration.serialization.ConfigurationSerializable;
import org.jetbrains.annotations.NotNull;
import java.util.HashMap;
import java.util.Map;
UltraChestUpgrade
Fun
I'm kinda confused lol
Well
Remove the jar fully and build it again check the pdc data with some debugging before trying
Again
I can't even get that far
If I place a new chest which will contain that data I get error
you haven't registered your class
ConfigurationSerialization.registerClass(MyClass.class)
................................
did you do that?
it's explained in the javadocs for ConfigurationSertializable
Oh that is required?
Uhhh wait
Wait a second
I never registered my first class
And it was working perfectly
tf
Thought it was just for nicer names
Haven’t used the bukkit serializable system in ages
it says it's required
serializing works without it, but not deserializing
In this example, The first serializable works perfectly for both ser and deser without it
I'll register both ig?
Go for it
haven't used the bukkit serializable system in ages
you should register all your classes that implement ConfigurationSerializable, at least that's what the docs say, and what I always do
True
does somebody know something that prevents drowns from spawning in the world?
?paste
Great
cancel the entityspawnevent
I'm reading through it rn
🤞🏼
Sorry, I just looked a bit around but I still don't realy understand what I did wrong in combination with static. :c
Hi guys, Can someone help me with this error? https://paste.md-5.net/abaquhutus.cs
now pay up
the stupid src/test that always gets made. yes i can delete it but surely there is a way to stop it creating
Can you show object and yaml/json you are trying to deserialize
Maybe not the most usual question, but does anyone have some good ideas for portfolio projects?
c is the Persistent Data Container
why are you implementing this and for serialize method just return same map
because normal maps aren't ConfigurationSerializable
why is there a @Getter in a record?
they are ? spigot serializer just converts object to map with string as an key and object as an value
that is point of serializer
I’m having an issue I have 2 different plugins w maven and plug-in 1 relies on plugin 2 to build and plugin 2 relies on plugin 1 so when I use mvn install it won’t let me because I didn’t install the first one
yeah but look at the other images, i'm using a configurationserializabledatatype which requires a Class that implements ConfigurationSerializable, Map.class doesn't implement that
pretty sure you can't have cyclic dependencies in maven
How do I fix it then?
get rid of that loop somehow
How can I change the default return value of an enum
For example
enum Test {
Test1("path")
}
Can I make Test.Test1 return the path by default?
try using a normal class with some static fields
Meh, .value it is
wdym?
are u still there?
anyone?
whats going on
Is there a way I can change the leave message of a player that gets banned?
if your plugin is doing the banning, kick them first and provide the message, then ban them
Ok but how can I do a custom leave msg when I kick the player?
Is there an API to easily get permissions with the highest weight and some custom value, like prefix.x.y where x is the weight and y is the value? No idea what's the name for them
no I mean this leave message
but then it's always this leave message. I want it so that only when a player is kicked or banned should another leave message appear
Split permission with . and sort it by parsed item with index 1?
Isn't there a disconnect-reason?
and how If I kick the player?
Is there no built in way to do this?
@dry yacht Finally got it working!
Why would there be built in way
Daaaaaamn dude, that looks awesome! Nice job! :DD
Dunno, some plugins use it
yeah but If I want to make a custom leave msg that should appear when I kick a player
That actually looks really cool
Thanks! I think the other problem with something wrong with the angles, but I started over and finally got it working.
Thanks man
No where near done with the animaiton tho
Maybe add a flag to the player in the kick event and then check in the quit event if that flag is active. Maybe I misunderstood your question tho.
how can I add a flag in the kick event?
I'm thinking about rotating like 10 armorstands around it, then stop them at different angles, last but not least make them rotate fast around the chest, and then it chooses a random one.
Gimme a second, I need to check if my idea would work out at all, xD. I don't know the execution order of those events at the top of my head. be right back.
Yo your website man, that kinda cool with the mouse thingy
any1 who knows a good vid to learn how to code npc's in 1.19(.x)?
someone know how to cancell the event (BlockExplodeEvent) for all items in game?
so easy?
thanks 😄
https://paste.md-5.net/apixofikoy.cs
Yeah, that does the trick
i just type it short xd
only in dc tho
encrypt it
and encrypt the encrypted code
and put that into binary
idk
You gotta encrypt it using ROT13 twice, that'll be uncrackable
make sure to use random single letters for var names too
i love u
i dont
ok but how can I now also change the leave message when a player gets banned cause then I use the #kickPlayer method too?
Put them into the set whenever you want to change the message. You could also have a Map<Player, EKickRason> you put into whenever you call kickPlayer, that way you can even differentiate internal reasons.
it's not "stupid", it's there to create your test classes lol
why do you bother about it
is there a collection with o(1) contains or is the best ill get o(n)?
a set ?
well kinda what im planning to use but aint set an interface
HashSet
ill use hashset if i cant get this to work. I'm trying to get a list<string> into a enumset
but i cant find a proper conversion method anywhere
well
i got this far
ItemsList.stream()
.map(Material::getMaterial)
.collect(Collectors.toSet());
but i dont know what to tell the collect method to get an enum set
List.of("STONE", "DIAMOND").stream()
.map(Material::valueOf)
.collect(Collectors.toCollection(() -> EnumSet.noneOf(Material.class)));
matchMaterial is something different
that uses the item ids
presumably preferable
but /shrug
I'd do it like lynx did it
public static <E extends Enum<E>> EnumSet<E> asEnumSet(Class<E> enumClass, List<String> list) {
return list.stream().map(s -> Enum.valueOf(enumClass, s)).collect(Collectors.toCollection(() -> EnumSet.noneOf(enumClass)));
}
and for material, do not use enumsets
I have a problem with my Minecraft Server
Always i try to start it send me this
cant you even then just do map(Enum::valueOf) ?
not for much longer
wouldnt it break in either case then?
Is it possible to make a method for a Bukkitrunnable and use that in a Bukkitrunnable?
today, yes. in the future, no
wdym? ofc you can declare methods in your custom class
is set lookup o(1) too or is it slower?
Yeah, but would I work instantaneously? if i then need to run the same Runnable but with different values?
toSet uses a hashset
k
private <E extends Enum<E>> Set<E> asSetOfEnums(Class<E> enumClass, List<String> list) {
return list
.stream()
.map(s -> Enum.valueOf(enumClass, s))
.collect(Collectors.toCollection(HashSet::new));
}
well it's not guaranteed what it returns, so if they want it to be a HashSet, they should use toCollection
ah thanks. also on a different note, does this only work on class identifiers?
.removeIf(removeSet::contains)
I guess not no, no guarantee about the set type
well the error is weird
it says like 'required: collection, provided: boolean'
nvmind im an idiot
im comparing itemStack to material lol
is there a built in method to get a list of all entity types that are mobs
entityType instanceof Mob?
like directly?
i need the entityTypes tho
i guess you could check if the EntityType .isAlive() and .isSpawnable()
no
I've tried this
EntityType is an enum, it'll never be instanceof anything other than itself and Enum and Object
Arrays.stream(EntityType.values())
.filter(e -> e.getEntityClass() != null)
.filter(e -> Mob.class.isAssignableFrom(e.getEntityClass()))
.collect(Collectors.toList());
EntityType[] allEntityTypes = EntityType.values();
// remove ender dragon and wither
for (EntityType entityType : EXCLUDE_TYPES) {
allEntityTypes[entityType.ordinal()] = null;
}
// resize array
int size = 0;
for (EntityType entityType : allEntityTypes) {
if (entityType != null && !entityType.name().contains("MINECART") && entityType.isAlive()) {
size++;
}
}

this still includes things like fireballs, xp orbs
etc
ty 🙏
since when is getEntityClass() a thing? is that rather new?
it is not xD
I remember I once needed sth like that but there was no such thing. however that might have been like 5 years ago
nah that was like
all the way back
its how it internally does spawning
so like, ever since spawn(Class<? extends Entity>) existed I guess
then I'm probably confusing it with sth else
oh ok
that docs page is so dysfunctional 😭
How can I create a new persistent data container?
via the context of an existing one
Citizens is easiest way I think
read citizens code
I'd just use Citizen's API
yea
I don't know about reading Citizen's code lol
anyone know how to link to a discord room that has a space in the name in a way that makes sense?
I'm having a hard time with it
Can someone help?
How would i add a delay to my for loop. Thread.Sleep does not seem to work. That pauses everything.
?
?scheduling
?scheduling
HA
frick
Is it possible to get effective motd as docs on Bukkit.getMotd() are a bit misleading, its returning motd defined in server.properties, what if some plugin override that ?
Wait im already using a BukkitRunnable and i gotta use a for loop in that. Because i need to repeat the same task but with different values 8 times? how would it be possible to use schedulers for that?
atomic integers
hmm, not sure that i will be able to ping it in real scenario
Not, I rewrote my Config Class so there are no static classes anymore and used DI to pass it ot the other classes. But I still have the same issue... :c
https://paste.md-5.net/ulorofehis.cpp
Yeah your only realistic option is the ServerListPingEvent
Can I put a chicken on a player and tie a leash to it?
I'm pretty sure players can have passengers, so yeah probably
I wrote this, but it didn`t work
she is with a leash. but not on the player's head
can I somehow trigger that event from in the spigot (if that makes sense ? )
just Stream.of(players).map(Player::name).collect(Collectors.toList());
whichever the classes are on Bungee
all you have to do with that code is replace players with whatever bungee provides as the list of players
and Player::name is the class/method to fetch the players name
?jd
so first one is ProxyServer#getPlayers
and second one becomes ProxiedPlayer::getDisplayName
they just refer to methods
yeah, get your server instance
Depending on the person the difference is between static vs non-static
thats because you havn;t got yoru proxy instance
try ProxyServer.getInstance().getPlayers()
?notworking
"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.
?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.
delete ProxyServer#
Was about to write not the second P haha
its for both but we rarely get any bungee questions
It wasn’t meant to say he can’t ask bungee questions, but rather spigot is full of dumb people
ah
What errors does it show if u hover over it
I hope Prixied was a typo
?jd-bc
Stream::of takes an array, no?
ah true
in which case you can just stream straight from teh getPlayers
ProxyServer.getInstance().getPlayers().stream().map(ProxiedPlayer::getDisplayName).collect(Collectors.toList());```
Gl
Stream.of(T...) calling Arrays.stream 💀
vararg
Does PlayerQuitEvent fire before the player leaves?
What could cause the funny jumps? maybe its the amount of packets i send through?
depends what you consider "leaving"
ofc it happens after the player clicks on "Disconnect"
yeah obviously
but it happens before the player left the server "server-side"
ah ok
you still have a valid entity during that event
thanks, thats what I wanted to know
Is there a way with spigot directly to know if a plugin got an update ?
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
Thanks 😅
i have question about scoreboards, i have to create scoreboard for player once when he join and manipulating this one?
Depends of the scoreboard you trying to achieve
Maybe start by trying to actually create a scoreboard
And actually search online before on how to make a scoreboard, there's so many threads, it's pointless to be asking here such thing.
There's many great tutorials that can help you like a bukkit/spigot tutorial thread or YouTube which explain step by step instead of here
does anyone knows whether a packet is being sent (and if so, which one) when i click on an item in the crafting book to display the preview of the items?
I highly doubt it
the thing is that im listening for the recipe request packet from the client (on minestom) and it only gives me a recipe id, which i get the recipe from but if the player is able to craft this recipe, i have to move the items required into the crafting grid to let the player take the result out, but i cant know which variant of a recipe is being used, for example you can craft sticks with oak planks, spruce planks etc so idk which items to place
so i kinda have to know what items are displayed there somehow
lol
recipe request packet?
can't find anything like that in craftbukkit
also fuck you IJ, why is there no regex search for classes
I dislike IJ more and more every day
rSection:
ANCIENT_DEBRIS: "NETHERRACK"
why is this Optional.empty instead of... you know, ANCIENT_DEBRIS?
getConfigurationSection("rSection").getKeys(false).stream().findFirst().toString()
then gets responded to with a 0x2F Place Ghost Recipe
hmm
ye the names are ass
I wonder what the actual packet names are
lemme see
this is the only classes that have "Recipe" in their names in craftbukkit
no, that one doesn't have it
only the regular Search thing
this one
but that's kinda a weird workaround as it e.g. wouldn't show classes from dependencies
it's not possible to use regex in the usual "Search class" thing
the "Shift-Shift" menu doesn't support regex at all
clientbound means "TO the client"
bruh
bound as in destination
not tied to the client 🙂
i mean, its also called outbound and inbound
whats so confusing about clientbound heading to the client
yeah but whether it's outbound or inbound depends on whether you are the server or client 😄
I can see it
me dealing with 3 packet descriptions now
client bound could mean it's bound to the client so comes from the client
however it's not that meaning
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
ServerTellsClientThatANewEntityHasBeenSpawnedPacket
bleh
looks good to me 🙂
anyways, help please?
probably because your actual config.yml doesn't contain it
but only your config included in the .jar contains it
maybe?
i am using getConfig from the jar itself for testing purposes without saveDefaultConfig()
ServerboundPlaceRecipePacket
save the config, and only after that call getConfig(), then check if it works now
I remember that using the "included config only" leads to weird issues like this
unless you set it as default
yeah but the funny thing is that if you do a config like this:
name: mfnalex
and then you just do getConfig().getString("name"), it DOES return "mfnalex" even when not saving the config, and not setting any default values
it's kinda weird
i know that part since getStringList on a config section returns the list
but getkeys fails
brr there both a serverbound place recipe and a clientbound one
yeah it's only ConfigurationSections that behave weird
whyyyyyyyy
no way iwas confused
anyways thanks for the help
np
💀
mojang name be like: ServerBoundPlaceRecipePacket, minestom be like: ClientCraftRecipeRequest \💀
and in spigot it's PacketPlayInAutoRecipe
oh
wrong reply
😄
I hate that you cannot just remove the "replied to" thing
^^
one can only remove the whole message and send it again
😛
so annoying
✅
discord moment
i wonder whether the API could remove the "replied to"
🚫
lets make our own discord
be damned, discord
with blackjack and hookers
yeah
elgarl going wild
How would I get the material type of a clicked item in an inventory?
event.getClickedItem().getMaterial() or smth ig
Like e.g. event.getCurrentItem()....
Tried that, it doesn't exist
getType
Ah thanks
btw world.getType is deprecated but i cannot find a 'modern' version for it?
?jd-s
i read through https://hub.spigotmc.org/javadocs/spigot/org/bukkit/World.html there doesnt seem to be another method that would let me do the same
declaration: package: org.bukkit, interface: World
ok not much here
is it some part of meta
it's not deprecated?
getType() is like getBlock(...).getType()
oooh
getDimension()
sth like that
wait
declaration: package: org.bukkit.generator, interface: WorldInfo
If I wanted to pass a variable to a click listener from a command, how would I be able to do so?
getEnvironment it is
declaration: package: org.bukkit.generator, interface: WorldInfo
pre 1.18 it's part of World, 1.18+ it is part of WorldInfo (which World extends)
what click listener
are you copying me
where you clickin on
Just a click listener for an inventory that I made
some one know how i can edit the combat and the knockback
map lookup id say, idk how your stuff is set up
next time, be faster instead of making me send wrong method names beforehand
I had to get my macbook because it was a chore to do on the phone
Hello, can any plugin dev help me with some questions? I am not able to add spigot 1.19.3 correctly to Eclipse 😦
which macbook you got?
i only know IJ sorry
Eclipse with maven?
are you using maven or gradle?
if you are not using any build tool (although you should use one):
?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
idk some 2017 version i bought at that time for school
ah so intel
I am so mad at my 2017 macbook because it has the butterfly issue
and I only realized that after the warranty was long gone
butterfly?
the keyboard with these ultra slim keys
oh
mine works fine thank god
well i prever like 1mm keys but then again im nothing but a highly functioning sociopath
my 2017 has this issue and I always thought it was my fault for getting tobacco into the keyboard
turned out it wasn't my fault
my friend spilled cola on hers, she got it replaced lol
this is mostly because during a internship i did while at school i had to work with a keyboard that looked and felt like it was from 1980, so ever since i preferred keyboards that react as soon as you so much as touch the key
the keyboard part not the sociopath part btw
i know some of you will get that wrong
Anyone know how I would be able to do this?
nice lol
well I got the m2 now anyway
?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.
with apple care so I can also spill whatever onto it and getting it replaced
?askgoodquestion
It's just a question....
Gonna get an M2 at some point
?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.
?askgodoquestion
Like I don't have code for it that's the point
it's amazing and the battery lasts like 20 hours
😐
?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!
wow
What's a "click listener", what type of variable do you want to pass. How is your setup structured? @safe ibex
You'd need to store the variable in a static field somewhere
Asking about your attempted solution rather than your actual problem
There are other ways of doing it (static manager or whatever) but it all amounts to the same thing
It does not.
isnt that unnecessary here?
I made a click listener for a GUI made with an inventory. I want to pass a variable to the click listener for conditional logic.
How would I attempt that is my question
The only interesting way of doing it is to create the listener on the fly but chances are that is not appropriate
create a Map<UUID,Whatever> that stores your stuff if it's per player
Quite the opposite I'd say
or a Map<Inventory,Whatever> if it's per inventory
i feel like im missing context
Yeah ok I'll do that ig
Yeah that works
if you want to pass a variable why dont you do so during init
unless its primitive its pass by reference
can't quite write a command while having an inv open
because this variable is probably different for every player and/or inventory
Yeah is
So you made one?
So there is code?
Thanks mate 👍
Then it's not just a question.
probably they enter the command BEFORE the inventory is open
np
Wow, your social skills need a tad of a brush up 😉
Yeah - in which case only Map<UUID, Value> is doable
@safe ibex I'd think not haha
But yeah thanks for the map suggestion 👍
Unless you have Map<UUID, Inventory>, Map<Inventory, Value> but that'd catch my attention
I feel like theres a better way to do this lol
boolean isHigh = chunk.getWorld().getEnvironment()== World.Environment.NORMAL;
int a = isHigh ? 320 : 256;
int b = isHigh ? -63 : 0;
I usually keep a Map<UUID,GUIContext> or similar, where GUIContext is just a data class that holds all information I need (e.g. current open GUIType (enum, e.g. MAIN_MENU, etc), and whatever other shit I need
declaration: package: org.bukkit.generator, interface: WorldInfo
well you'd definitely should use world.getMinHeight() and world.getMaxHeight()
and what's "a" or "b"?
that doesn't look that great.
hmm
yeah rather call it maxHeight and minHeight
i always forget if you can put getters in loop heads
looks fine to me.
sure.
or every time
It compares each time.
Ooh ok cool
If you don't modify the result of that getter in some way, I'd advise to cache it in a variable above tho, as I don't see a reason to call a getter over and over again. Especially with large numbers.
JIT probably does it at some point, pray to our lord and saviour
i dont understand why we cant just tell the jvm 'please compile EVERYTHING' and enjoy the speed
Have you used eclipse?
They have some weird feature that allows you to compile even with errors
I hate the plexus eclipse compiler
when i do download sources, isnt it downloaded here?
not sure how IJ does it
if you do it directly via maven: yes
it should be there
you can try to manually run mvn dependency:sources
i did that: "reduce load time and indexing via download sources" thhing
or if you also want javadocs: mvn dependency:sources dependency:resolve -Dclassifier=javadoc
or tell maven to always do it automatically in settings.xml:#
<settings>
<profiles>
<profile>
<id>downloadSources</id>
<properties>
<downloadSources>true</downloadSources>
<downloadJavadocs>true</downloadJavadocs>
</properties>
</profile>
</profiles>
<activeProfiles>
<activeProfile>downloadSources</activeProfile>
</activeProfiles>
</settings>
ok
Hey,
I have a problem with yml files.
I have a custom map object with I want to save in a HashMap in the yml file to access the data with it by its name. my problem is, that after updating one map, my key for the whole maps Map is null.
So I save my maps datas under maps.mapname
After updating a maps data, the keys under map. is null when trying to get them.
Someone before sad it was because of the file in memory getting set to null so I rewrote my whole Config management, but I still have the same issue.
Has anyone any idea why this happenes?
lol
Hi question , if i for some reason decided to use packets to spawn custom armorstand , the best way i can do that is using ProtocolLib bcz it support all minecraft version ?
?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.
It's an easy an reliable way yes.
?notworking
"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.
iam trying to make only the spawn code work but it give me some errors ..
i will send them in a bit
people who use "-SNAPSHOT" as version should be shot
heeheehee
?jd-bc
no clue what the dif even is
what's Ping line 36?
then otherPlayer is null
error :
com.comphenix.protocol.reflect.FieldAccessException: No field with type java.util.UUID exists in class PacketPlayOutSpawnEntity.
at com.comphenix.protocol.reflect.StructureModifier.writeInternal(StructureModifier.java:369) ~[?:?]
at com.comphenix.protocol.reflect.StructureModifier.write(StructureModifier.java:349) ~[?:?]
at dev.skypvp.core.provider.lootbox.SkyPvPLootBoxManagerProvider.spawnArmorStand(SkyPvPLootBoxManagerProvider.java:393) ~[?:?]
code :
ideas? xd
it cannot be not null, otherwise you wouldnt get this error
it definitely is null. print out "otherPlayer" to console
it'll say "null"
I mean, what does the protocollib class look like?
iam using 4.8.0 ..
which MC version?
ok....
in 1.19.3 it definitely has a UUID field
preffebly from 1.8.8 to latest
?paste
i know i know , 1.8.8 is old
I mean, which version does this error come from?
1.8.8
ProtocolLib does NOT mean your stuff works in all versions
es
i know, i will make code for each version
just wana get it work first ..
well then just get rid of protocollib and use the vanilla packets
🤮
Config Manager: https://paste.md-5.net/vorijehelo.cpp
GameMap: https://paste.md-5.net/acijadejaw.cpp
Position: https://paste.md-5.net/nidamugoli.cpp
just decompile that packet in 1.8 and you'll see what fields it needs
i know but i was thinking protocollib fix more problems and make it better?
not really, protocollib makes sending packets way more complicated
i would need to add all spigot version to my plugin
and show me how you are using the config manager
example:
NMS:
MyPacket packet = new MyPacket(someUUID, 1, 2, "mfnalex");
ProtocolLib:
MyPacket packet = new MyPacket();
packet.getUUIDs().set(1, someUUID);
packet.getIntegers().set(1, 1);
packet.getIntegers().set(2, 2);
packet.getStrings().set(1, "mfnalex");
using NMS you can directly see how the packet is constructed. ProtocolLib is just weird messy reflection
tbf sometimes the vanilla packet needs some fancy reflection
Quick command question, cause I don't want to make a custom one if I don't need to... but how do you teleport a player to a different location and world using the /tp command in 1.12.2?
Cause newer versions have /execute as @s in world run tp ~ ~1 ~, but 1.12.2 doesn't have that
i understand what do you mean sir , thank you for explaining , but if i do this , i must add all spigot versions to my project ..
`Wither wither = location.getWorld().spawn(location, Wither.class);
wither.setCustomName(ChatColor.DARK_RED + "Wither" + ChatColor.WHITE + " ( " + ChatColor.GREEN + "4000" + ChatColor.WHITE + " )");
wither.setCustomNameVisible(true);
Attributable witherAt = wither;
AttributeInstance damage = witherAt.getAttribute(Attribute.GENERIC_ATTACK_DAMAGE);
AttributeInstance health = witherAt.getAttribute(Attribute.GENERIC_MAX_HEALTH);
AttributeInstance speed = witherAt.getAttribute(Attribute.GENERIC_MOVEMENT_SPEED);
speed.setBaseValue(10);
health.setBaseValue(4000);
wither.setHealth(4000);
damage.setBaseValue(100);`
yeah maybe, but in general ProtocolLib is just ALWAYS reflection, and when a new field gets added, it compiles fine but fails to work. With NMS it wouldn't compile and one instantly sees where the problem is
people think "ah, protocollib, it will always work" but that's bullshit, one still has to check how the packet works in every version
what have you tried so far
For Example:
LinkedHashMap<String, JumpMap> maps = new LinkedHashMap<>();
if ((LinkedHashMap<String, JumpMap>) mc.getConfigurationSection("jumpMaps") != null)
maps.putAll((LinkedHashMap<String, JumpMap>) mc.getConfigurationSection("jumpMaps"));
maps.put("test", new JumpMap());
mc.set("jumpMaps", maps);
this
I want to see your loads and saves too @torpid blaze
is there a website i can see how to use protocollib for 1.8.8 ?
hey I'm having difficulty resending chunks to the player after changing the biome of loaded chunks (I could just tp them away and then back, but it's kind of jank)
I initialise them in the Main class and from there pass it to all the others.
Just decompile the packet in 1.8
I want to see your full usage of them. I can't decide based on those three classes where your issue lies.
At the moment I only save them on Disable beacuse it is in the memory and I don't need it anywhere else
?paste
?paste
?toothpaste
Main Class: https://paste.md-5.net/isowiyelir.java
TabCompleter: https://paste.md-5.net/halayaquve.cs
checkForOptions
sets your things to an empty map
Hi, guys, I am a little bit stuck with my plugin. Let's say u can create Cases in config.yml, I am using PDC to detect keys and cases and so on. The system will work, when u click lime dye u get 1 random item from case that appears in config. But when clicking Lime Dye to "open the chest", i don't know how to detect which case from config am I opening, any ideas how to detect that?
Here's a screenshot below what custom GUI looks like, Netherite Blocks imitates items, that will be placed there in the future
yea
But before testing I did create a Map using the create command
So it shouldn't be empty anymore
Upload your project to github
ok 😄
I thought you already identify items by PDC?
why not just assign a unique PDC value to every item, then check which one was clicked?
well, u click lime_dye, then item is chosen by random, I need to detect which case is this, so items will be placed correctly, I have PDC on keys to cases, item when placing case, and blockPDC where block is placed.
I don't really understand the issue, I guess
Ye it's very hard to explain my concept
is there anyone who is good with packets that i could speak to
?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!
@rotund ravine
not me atleast
You'd probably need to send the whole chunk again @unique gate
or you can change their view distance to 0 and up again probably
oh the view distance might work
i was trying to do something like this
net.minecraft.server.v1_8_R3.Chunk nmsChunk = ((CraftWorld) world).getHandle().getChunkAt(hippoPlayer.getPlayer().getLocation().getBlockX(), hippoPlayer.getPlayer().getLocation().getBlockZ());
final EntityPlayer ep = ((CraftPlayer) player).getHandle();
ep.playerConnection.sendPacket(new PacketPlayOutMapChunk(nmsChunk, false, 0));```
but i was getting chunk error
Can I somehow get motd from server list ping inside of my plugin aside from manually pinging it (can't really listen for event as motd have to be getted on request)
?pdc
your own server's motd?
@mossy gazelle
?
you mean if motd is controlled by another plugin or just written in yml
and you just want to get current text
you could try to call a ServerListPingEvent and then check the result
Yeah
Brain = Dead
?pdc
InetAddress address = InetAddress.getByName("localhost");
ServerListPingEvent event = new ServerListPingEvent("localhost", address, "dummy motd", 1, 1);
Bukkit.getPluginManager().callEvent(event);
String changedMotd = event.getMotd();
instead of "dummy motd", better use the original motd from the server config
that's from server.properties and afaik there's no bukkit getter
so you gotta use reflections or nms to fetch it
thanks mojang
just do Bukkit.getMotd() for the default one
I'm idiot
you're Illusion
tf is this
no clue but it's not from bukkit, is it?
it is
hi
hm not in 1.19.3
not even an AtomicInteger
you need jree fava lessons?
i need free minestom lessons
hello brush
hello sir
hi , just a question idk why but i can't use this class :
WrapperPlayServerSpawnEntity
i have protocollib added into my plugin
and?
its just not there ..
some more description
because it's not part of ProtocolLib
is it even provided in protocollib
no
or in this specific version you are currently using
it's from PacketWrapper which is dead, more or less

then you should just write one module per NMS version and send the packets directly through NMS
instead of messing with protocollib or outdated wrapper libraries
alright thanks again .. will do
also supporting "all versions" is pretty useless, nobody e.g. uses 1.14.3
just go for 1.8.8, 1.12.2, and 1.16+
all versions inbetween are totally dead
just go for
1.8.8, 1.12.2, and 1.16+1.19.3
FTFY
or be superior and go for latest only
Can i access BlockState in InventoryClickEvent by InventoryHolder, is that even possible ?
the only other versions besides the ones I mentioned is 1.7.X and that's at 0.6%
Sure you can. getClickedInventory().getHolder() gets you an InventoryHolder
InventoryHolder can be a BlockState so you just need to instanceof and cast accordingly
If you're implementing InventoryHolder you're doing it wrong
But that wasn't their question
check if the InventoryHolder is instanceof BlockInventoryHolder, then you can do getBlock().getState()
No reason to
The InventoryHolder itself can be a BlockState
Chest for instance is an InventoryHolder
yeah true
well, sounds great, cause i use shulkerbox as a custom gui and i need PDC from block state, maybe that will solve my issue
I wonder which blocks are BlockInventoryHolder but NOT Container
maybe beacons or some shit
None. All blocks that have persistent inventories are BlockInventoryHolders
I am still waiting for the day when me and alex drop the diss-album against choco
For the record, ShulkerBox is also an InventoryHolder you can cast to
let's rather do an album against oliver, it's called "mmm" and the cover is a screenshot of windows taskmanager
sure
Ye ik that, normal shulkers works as normal, but the one's with PDC will open my GUI when clicked
I feel like that oliver album would be more of a trap thing
more energetic
mmm, microwave, feel his soul die when I ride this wave
olive is the one which god should save
olive's the one that's gon' misbehave
dug his grave, forgot but not forgave
the way this rave is going, standing's quite the brave
slaving to this trade, like lemonade, we're not the same, flags being waived
yeah like the sound you get when you get a bluescreen while some audio is playing
that's probably how most trap songs got created
just something fast
How would I call it?
oliver switches between win10 and win11 more often than I change my bedsheet. and I change those twice a week
First one
didn't I send full code above?
PluginManager#callEvent
i will do it for 1.8.8 , 1.12.2 , 1.13.2, 1.16.5 , 1.18.2 , 1.19.2 or 1.19.3 !
it's a decent solution
1.5.2->1.19+ or no balls
Yeah, and imo docs for Bukkit.getMotd are quite misleading as it's only motd defined in server properties
What else would it be?
It's not really
Well ok its a tiny bit misleading
It says it returns what’s displayed in the server list
Yeah this
"small additions"
>200 files changed
I could feel it was a mac picture but it took me way too long to find out why
btw here's how I'd properly do the "effective motd" stuff:
public final class ServerUtils {
private static final InetAddress LOCALHOST;
static {
InetAddress tmpLocalhost;
try {
tmpLocalhost = InetAddress.getLocalHost();
} catch (final UnknownHostException ignored) {
tmpLocalhost = null;
}
LOCALHOST = tmpLocalhost;
}
/**
* Gets the effective MOTD (after plugins might have changed it)
*
* @return The effective MOTD
*/
public static String getEffectiveMotd() {
if(LOCALHOST == null) {
return Bukkit.getMotd();
}
ServerListPingEvent event = new ServerListPingEvent(LOCALHOST.getHostName(), LOCALHOST, Bukkit.getMotd(), Bukkit.getOnlinePlayers().size(), Bukkit.getMaxPlayers());
Bukkit.getPluginManager().callEvent(event);
return event.getMotd();
}
weird client side decorations
and buttons on left
client side decorations? wdym lol
and traffic light buttons
tbh not sure if client
alex comes home and re-writes everything
but window decorations
no clue what you mean with "client"
well I get my decorations from the server
whats the io domain
the mac font is much more rounded
you dont have the money
jokes on you
same, steaf23.github.io is good enough for me
I CANNOT get this shit centered DAMN
I can actually afford illusion.dev now
it's just that my depressed ass doesn't feel like paying for anything
I usually spend 300$ per week on my basic expenses but this week I spent a whole like 80$
and I'm getting paid tomorrow
did that guy sell it
300$ a week lol
I like to order a lot of food :)
this week I was just like
seems like a lot to me
"fuck it a protein shake for lunch is more than enough"
and paid a whole 1$
I was also gonna order food last night but spent 3 hours staring at my choices and just didn't pick anything
why spigot why
guys i waste too much money on minecraft
125 a month
I've probably burned like 200$ total in minecraft merch
but them minecraft PJs look nice so I don't mind
I haven't played the game for fun for the past like 4 years
i missunderstanded
me trying to figure out packets that dont exist
they're being sent to your imaginary friend
anyone know why is this happening?
Oh damn
people told me to ask it to the forge/fabric users
today is one of those once-in-a-year days where I think about my life choices and why the fuck I decided to make minecraft plugins for a living instead of actually socializing like other high schoolers
socializing 💀
Because you made your hobby a passion
It's not even fun anymore
I spend half my days making microsoft word features so I can render a text box in a map, that goes into an imaginary item-frame that only the player can see
and wondering if I can use the image hash in a way to not send duplicate packets
damn the fabric tutorial actually helps me to implement recipes in minestom 💀
I made my own textbox algo that automatically wraps around
and if it can't wrp around, it scales the text down just a bit
I also tried implementing dithering but it tanked performance 
is this even spigot related 💀
lets go
Actually what if I convert the image data to base64 and keep track of what hashes each player has 🤔
Associate each hash to an ID
yeah, it's beautiful
it looks especially awesome in real life, I got 3456x2234 pixels on just 16 inches
lmao
on screenshots it might look weird in such a high resolution
thats like eye resolution
your screenshot looks fine
like not 100% sharp but what would you expect from such a drastic resize
yeah on 1920x1080 it'll look blurry
hi , so after few tries i got something ,
xd
just testing with packets xd
You never set object 1
what will be the object 1 ?
Idk
great
Welcome to ProtocolLib
thanks
Youd see instantly what it is if youd use the actual nms packet 😄
Hmmm I was trying to find a solution for armorstands (as passenger) falling off players when they submerge in water. I found this in an old post (https://www.spigotmc.org/threads/armorstands-used-for-permanently-visible-mob-name-tags-fall-off-in-water.109947/) with the same issue but don't really know what they mean by it. Do you guys happen to know?
Anyways, I played around with it a bit and it appears that you can workaround the dismounting by adding a buffer entity in between to prevent the interaction of "two living entities will separate if they enter water".

