#help-development
1 messages · Page 987 of 1
I mean its def worth trying
trying a "trendy" language usually provides good experience
usually sure, but I've read through the j8 bible like 3 times and retained nearly nothing D:
j8 bible as in the lang specs?
Let me get the book
I actually don’t remember if this is specifically j8
But it’s just a fat book of java concepts
lol
looks quite ancient
i think the biggest thing w books is to apply it once u learn sth
else u forget it rather quicköy
See that’s the issue is that this book teaches more “from scratch” concepts so to apply it to spigot is a bit more difficult imo, especially since I’ve literally only ever coded with spigot
I started doing spigot dev 4 years ago (granted I really can’t even count them since it was heavily on / off) and at this point I’m pretty mediocre I’d say
i mean in regards to books
what I found really valuable is design patterns, effective java and concurrency in practice for java at least
in case u're a fan of books ^^
I've been a big fan recently, just went through william james vol1-2 psychology
700 pages of monster terminology
I've been using the people around me as psychology experiments, is that bad?
yes
that write function is for when the game is about to send the packet over the network, the packet is serialised into the buffer and then sent over the socket
it doesn't seem like protocollib has anything for boss bars really, but.. why are you using packets? you can just use the api to create and manage your own boss bars?
I'm just taking it from a passive observers pov though
Well, I'm trying to set my own value for ender dragon boss bar, but when I try to use api methods, it resets to the dragon current health. I've read somewhere that using packets will help delete the boss bar. In my case I try to update its value
no keep doing it
Sounds like you'll have to replace the boss bar packet with your own, that being said I'm not sure how concurrency really works with packets so you might need a manager that tells the update functions of the bossbar what the remaining health is
I've just been passive & observant, I've got a tiny pocket book I write notes in haha
hm
I mean protocollib does let you go deeper than the surfacing getCoolThingThatHasSomeWrapper and you can do pretty much anything in that regard, but uhh I've never really used it before
use me for psychological experiments
How so?
in any way needed
Hmm, I just thought, what if I try to send NMS packet to delete this bossbar and show my own, idk if it works but I have to try xd
Currently I've just been going over repressive responses when it comes to agitation / stress / anger
im stressed as fuck
does that work
Ie: Something from long ago causes you to respond in a certain way to different events
relatable
It's hard to do that with people I don't know
more practice for you 😛
im just kidding ofc i barely know anything about psychology (well maybe a bit more than an average person but barely) so i have little to no idea what im talking about
all im saying is id be down to be a subject of some psychological experiment/terror
xd
I have one for you
Well that might come later, like I said I've just been observing
listen to baby shark for 10 minutes
i said psychological terror not actual physical torture
lmao
Have you guys ever heard of chinese water torture?
is it where they drop a droplet of water on an immobile person's forehead every once in a while and it drives them crazy because of the anticipation of the next droplet and lack of any other sense
Yes!
yay
The anticipation is less of the torture however, and more of the fact that something so miniscule can drive you to feel that way
my toxic trait is thinking it wouldn't be torture to me
But it's a mixture of immobility and the fact theres a water droplet every so often
i believe it's also because they do not experience any other tactile sensations while being tortured
& the fact that they can't do anything about it
Well yeah when it's a single drop every time on the same spot
Mixed with immobility is enough to craze most people
Is this to do with my gradle version;
Execution failed for task ':compileJava'.
> error: release version 17 not supported
or were they just pussies
Depends on how long, I'm quite claustrophobic so the immobility is what'd get to me imo
i'd try to fall asleep and if that's not possible i'd try to count the water droplets and/or the interval between them
and think of anecdotes that i know
There's a difference in mind set when you know what the torture is gonna be vs waking up naked and afraid to water droplets on your forehead
because they are rather stupid -> funny
true
I think anyone who willingly involves themselves in "torture" tactics really just want to know what it's "like" but tbf you'll never know until you're in a true torture situation
you are correct
#TimeToThreatenNSA
cia
NSA will just send the cia
Is this due to gradle Cause: error: release version 17 not supported
use toolchains
Maybe with display entities? Idk
no as you can 3rd person
You can change the pumpkin helmet overlay using a resouce pack is all
Doesn't the pumpkin overlay disappear in 3rd person too
probably
yeah it does
nope
Can you 3rd person if force riding an entity?
What
google gradle toolchains
Still same issue
Plus I think there was already a toolchain, I just added another one
def targetJavaVersion = 17
java {
def javaVersion = JavaVersion.toVersion(targetJavaVersion)
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
if (JavaVersion.current() < javaVersion) {
toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion)
}
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}
where are you getting this error exactly?
When I build jar
Well, I managed to hide default ender dragon boss bar and show my own with my own values. My next question is how do I check if there's an ender crystal that currently healing ender dragon?
getBeamTarget() of ender crystal I think?
declaration: package: org.bukkit.entity, interface: EnderCrystal
is it location equals to edrag location?
Wherever it ends I assume
You'll probably have to cache the location of the dragon every second or something
hmm... let's try
?tas my beloved
Anyone know why I get this?
My gradle property; distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
Welp be patient hopefully emily or someone who knows will come back soon
how do I use unobfuscated nms?
?nms
If I use Artifacts for building
don't
I bwlieve you can set an artifact to run maven
whatt
howww
I don't see that option anywhere
no idea I don't use IJ, but i've seen it talked about in here
?help
selfrole Add or remove a selfrole from yourself.
cleanup Base command for deleting messages.
embedset Commands for toggling embeds on or off.
info Shows info about CafeBabe.
licenseinfo Get info about Red's licenses.
mydata Commands which interact with the data CafeBabe has about...
set Commands for changing CafeBabe's settings.
uptime Shows CafeBabe's uptime.
findcog Find which cog a command comes from.
names Show previous usernames, global display names, and server...
userinfo Show information about a member.
listcases List cases for the specified member.
reason Specify a reason for a modlog case.
permissions Command permission management tools.
Nope, I see nothing. Just use teh Maven tab as everyone else does
its much easier to just use maven for everything
?paste your gradle build script
Does anyone know the packets I have to send or the way to disguise an entity as a player?
how can i automatically change config keys in the config when i change it from config.yml? (intellij)
what
like change the stuff you use in code?
you either have using a code based config system or have a key constants class that you can change the value of and refractor its name
I currently have a system that adds a client side entity to all nearby entities. This is ran through a getNearbyEntities call. This works great, however when an entity is spawned in, like a player, sometimes the plugin gets the player through getNearbyEntities before it is spawned in client side, meaning it tries to set the passenger and stuff with an unspawned entity. How can I know when it is spawned client side?
how can i get the block responsible for a block explosion
how do i remove the join message from essentialsX
essentialsX has its own server
what do you mean
What's triggering the getNearbyEntities call
#getBlock() 
getExplodedBlockState() if you want block information
Only just added in 1.20.5 though
If you want to update it in your code editor, you only have to update the version in your pom.xml or build.gradle, whichever.
ant build files?
for upload the pictures am i verify ?
yes
If you're using Ant in 2024, honestly, I applaud the dedication
Is it possible to map different textures to same item in server resourcepack?
ant looks similiar enough to maven, what gives?
can you have multi module projects?
can i hide health bar and hunger bar ? with any method
Resource pack
how to build package direcly into plugin folder
it only allows me to build it into project folder
<profile>
<id>export-to-test-server</id>
<activation>
<os>
<family>windows</family>
</os>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.3.0</version>
<configuration>
<outputDirectory>C:\Users\Fr33styler\Documents\Workplace\Minecraft\Servers\BedwarsNew\plugins\</outputDirectory>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles-->```
smh
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...
wait, what's symlink?
link the blog smh
ty
sorry, i found it in some old github commit
i don't remember the blog
anyway, i'mma check symlink
all you have to do is go onto blog.jeff-media.com and search plugin
i didn't even remember the website name, give me a break 🥲
wait, symlink is amazing
you can just point to your target
thank you md
this is actually amazing
yas
md, you need to share your knowledge with us, i never knew windows came with this
wait, i can do symlink for buildtools jars too
i use a bat that points to the jar right now
hmm
ah wait, i have java 8
does anyone know how to open java > 8 apps by double clicking?
i remember trying it once
it was nice, it had some managing commands in the gui
well what file is the one that opens?
i tried java.exe/javaw.exe
neither worked
and now it looks like this
scroll all the way down
If on windows go to the control panel where the java config panel should be and there might be an option you can check for it
?java17 for me
Install Java 17 at https://adoptium.net/?variant=openjdk17&jvmVariant=hotspot
If you can't find control panel. Just go to run and type control panel
Oh this looks different
Either in java or advanced if not then maybe has to do with the jar being blocked?
That window lets you define default jdk
Well if you want to use some runtime arga possibly
Possible, also double clicking only works for gui apps and the exe for that is javaw
this is gui
You need java 17 it seems. Your system default is 1.8
yeah, i don't know how to change this
You change it in that control panel
Uncheck enabled for 1.8
same
well, it's an ssd
it seems so
i guess i'm stuck to java -jar ing my jdk apps
unless md knows something i don't
actually
i don't even like this
for some reason i thought it had more stuff
Well that is the default java gui window lol
i have my botcreator tool where a dependency was upgraded to a newer java version
that i use in testing
i wish i could just double click it
i guess i can run a bat file
Have you tried changing the association of the file?
That sucks. I am just going to blame windows 11
i remember sometimes in the past i did something in registry
-jar file
or something like that
Well there is path environments you can set but java has moved away from it. Handy to set it though for the command line
Yeah that is the equivalent of running from command line but only shortcuts lets you add args to the target
And have an icon
i can't believe java stopped making jres
1.8 is ancient now
i guess there's forks
It still has jre. Just shaded into the jdk so you dont need to install two java things just the jdk
Or should say its bundled into the jdk installer stuff
i see
Y2K_ is typing...
How would one compile a gradle project to java 17 if I have a module (namely NMS 1.20.6) which requires java 21. Legit no clue where to even start. as soon as I compile I get errors galore
epic tried fucking with toolchains, but that really does no good
hi thats me
tried setting source compatability etc no go for that to
compile the module to java 21 and the rest to java whatever
at least this is how i do it
for maven
yeah idk how to do that with gradle
it seems to not be a big fan of changing required source
works ez pz ty (did it like forever ago but got distracted lol}
nope
I tried doing that it just like yells
that java 21 isn't java 17 something or other
compiles fine without the java 21 module
@eternal night we need ur nerd brain
gradle stuf
multirelease jar?
ah
genuine question tho
idk what we have going on xD
trying to get NMS 1.20.6 to actually compile is what I'm doing. Its fighting my entire project cuz java 21

make it all run java21 ezpz
Epic told me no
sounds like epic's problem then
@remote swallow
I actually need 1.20.4 for a bit longer tho :P
would love to get this working
itis a me problem
1.20.6 isnt stable and i like to stay outdated for like 8 months
It’s a me, Mario
Uhh lemme look in my brain
its a you coll
8 months pepega
Too old! (Click the link to get the exact time)
?1.8
Too old! (Click the link to get the exact time)
8 years and 9 months
wrong
fym wrong
Remember when you just yeeted a server to 1.18.2 and broke everything
wrong
fym
fym
minecraft 1.8 is better then all other mc versions
shut up epic literally desolving pineapple and turning it into apple
the infrastructure is the best
I think apple is already taken
we don't have time to be arguing about brain rot idiotic opinions. I have an actual question :P
calm down
no need to get hostile
whats ur question
why is java 21 bullying me

.
well Java 21 cannot bully you as it isn't a human.
or an animal
or a living thing
you probably can't help since you've been on java 8 for so long you probably haven't actually experienced upgrading java version
correct
i can only count to 8
no higher
but i will assist you
not surprised. You've probably been in your cave so long you haven't experienced the last 9 years
I pitty you
thanks
Compiling a Gradle project with different Java versions for different modules can be a bit tricky. However, you can use the Gradle Toolchains feature to specify the Java version for each module. Here's a step-by-step guide:
-
Ensure you have both Java 17 and Java 21 installed on your machine.
-
In your
build.gradlefile, you need to specify the Java version for the entire project and for the specific module.
Here's an example of how you can set this up:
plugins {
id 'java'
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17) // Default Java version for the project
}
}
project(':moduleThatRequiresJava21') {
java {
toolchain {
languageVersion = JavaLanguageVersion.of(21) // Java version for the specific module
}
}
}
Replace :moduleThatRequiresJava21 with the actual name of your module that requires Java 21.
Please note that as of now, Java 21 is not released yet, and the latest stable version is Java 17. The above example assumes that Java 21 is available. If your module requires a version of Java that is not yet released, you may need to check if there's a mistake in the module's requirements or if there's a way to make it compatible with a currently available version of Java.
boom @river oracle
probably try to disable auto jvm
and then set source and target compatibility?
how do I disable auto jvm
I've already set source and target compat
java { disableAutoTargetJvm() }
you are full of brain dead takes today
please go back under your rock
gradle is over rated, personally it's just not it
dont get why people fan boy it so much
I'd agree if I didn't actually leverage gradle exlusive features
but I do so here we are :(
maven plugins can probably do the same thing
maybe a 6 step max
or I can just add buildSrc for my specific project
id rather spend 4 seconds writing a method than 9 hours making a plugin
lot of cons with using gradle
I now remember why i had you blocked
suddenly
@eternal night immediate explosion https://paste.md-5.net/exaxupotep.rb
?paste
I did the java configuration on root but set the source and target on each sub project specifically
rip
I am off to bed sadly, if you don#t have it fixed I'll have a glance tomorrow
alr I'm rage quitting myself xD
then push your latest ^
done on branch update/1.20.6
bruh
lynx ill remind you at like half 8 uk time
nah
@river oracle
I s2g
I opened the damn link on my phone
where are the braincells at
Wut
Does not want a multi release jar
Does this
The whole point is that you run your toolchain on java 21 but define source and target compat to your lowest
there, enjoy patch
the paper experience
true....
its a bukkit runnable timer (every 10 ticks)
trying to figure out how to deny incoming player interactions until a certain trigger which plays them back all at once
would only be at max a 300 ms gap between the start of the window where interactions get denied and the trigger to play them back, all interactions including entity interactions (kills, damage, etc) need to be traced back to the player that was originally denied the interaction
how can i make somthing in chat clickable
google it, prob already solved on spigot forums or in a youtube tutorial considering how commonly used clickable chat messages are
its suprisingly easy
@river oracle try it
how do i deal damage to an entity with a specified damagecause?
declaration: package: org.bukkit.entity, interface: Damageable
i was looking at bukkit forum posts from like 2016 thinking it didnt exist im smart
well it didn't exist
in 2016
i assumed so
DamageSource is 1.20.4 API
it replaces the primitive DamageCause API which is terrible
in which is much less capable
i'll just switch my project over to 20.4 server this is intended for is updated anyway
ty
Hello, there is a minecraft server that is in 1.8 and I joined it in 1.9.4 and I have the double hand, how could I reproduce that?
If I ask this c because I use the api of a minecraft launcher that makes the pvp 1.9 in 1.7 and my server accepts that this launcher and below please
Your English is too broken to understand
...youre trying to make pvp work like it did pre-1.9 in any version?
Hi I am a owner of a server I use login security plugin how can I find those users password which are registered in my smp by /register I have full-acces to console and all
I'm French and I use google translate :p
Your server is 1.7-1.9?
I don't want my 1.8 spigot to prevent double hands if you're in 1.9
i think youre better off asking in french tbh i have no clue what "double hands" means
second hands
the player's hand that is located at slot 44
oh offhand
yes
its when MC gained two hands (I think) It used to only display 1
Yes, that's it.
OK?
I still have no idea what your question is though
well i dont think you can make that work considering the server is on 1.8 and has no clue what an offhand even is
via version and via backwards plugins
that works?
I believe so
However, a minecraft server running spigot 1.8 does it...
i guess im wrong then
No clue what he's asking
The server was running spigot 1.8
i think they're trying to make a 1.8 server allow players on 1.9+ to use the offhand?
Yes, thank you
thats totally different
Except that I C for 1.8 (I know that in 1.8 I can't run the left hand but in 1.9 yes
Plugin version à 1.9...
Off hand does not exist in 1.8
So yes, but you have to modify the client and server version.
whether this is true or not idk but it sounds like it shouldnt be possible
so i have no clue
The server didn't have any mods
You can not get off hand support in a 1.8 client/server without (heavily) modding both
just update lmao
.getBlock().getPersistentDataContainer();
why isn't it a thing
😔
Because normal blocks don't store any data iirc
be nice to robot, it gives you good things, be mean to robot, its not dying, its hiding to get you in your sleep.
being nice to ai makes it worse
telling gpt "thank you for the misinformation!"
What is the best site to sell my plugins?
There is an API that lets you do this though, its made by alex iirc
https://github.com/mfnalex/CustomBlockData - I think its this
setContents()?
i mean i will save getContents and then set it
in a yaml? in a db?
getContents will return a list of itemstacks
you need to save them accordingly
ill just create list
i dont need it for a long time
so not save but cache
well then yh that works
not with getContents
for that you would probably make a hashmap
with the inventories contents
Hashmap<Integer,Itemstack>
Integer being slot if that isn’t obvious
alternatively you could probably make a copy of the inv but i dont think that would be very resourceful
i would but there is no setInventory as i checked
well as i said you shouldn’t anyways
make a hashmap.
for (int slot : priorInventory.size()){
hashmap.put(int,priorinventory.get(i) -or what ever the method is to get an item)
}
how do i get item's slot
i literally just told you
ypu need to add i++ inside the brackets
int slot = 0; slot < sender.gerInventory.getSize; i++
then slot in the first loop will be 1 wont it be?
no
first increment is done after first iteration
int slot = 0;
for (ItemStack item : senderPlayer.getInventory()) {
senderInvItems.put(slot++, item);
}```
yep
that works too
i wouldve send more code but sucks on phone lol
does that also work on slots that are empty?
iirc yes
why do i need to do that
look at the impl
cause otherwise it wont compile
a for loop needs to have these 3 arguments
ill do some testing
this will work too
its just not the way its done
if you want your code to be readable and comprehensible for others and future you
its best to hold yourself to the standards
at least to some extend
mhm
Anyone know a good way of making a red border effect per player. I want to enhance the experience of low health by making the corners or player screen red. I know this effect is done by manipulating the border, I'm just wondering is per player border already a thing in Spigot or do I have to use packets and send each player their own borders?
spoof packets
wait Player.setWorldBorder exists
setWorldBorder is something completely different
I'm confused now, is there a simpler way of getting the red effect on screen for a player without having to use worldborders?
yeah, packets.
That still uses WorldBorders
Using packets you mean?
Why would it be harder to use the api method
cause you are actually setting a world border
No
instead of sending fake packets
no?
That method is just sending a packet
oh okay lol
Not changing the global world border
then i didnt say anything
Did it change something with the 1.20.5 mappings?
?
that's exactly my thoughts
im walking with someone and he mentioned that, I didn't understand what was he trying to say
talking* lol
Does someone know registry data stuff
https://paste.md-5.net/axifilemib.m cuz I'm having a hard time understanding what I'm doing wrong
is it the chat type being 1 instead of 0?
I have no idea why even this much data needs to be sent
?paste for code walls
plz
use PacketEvents
instead of protocollib?
yes
im on 1.16.5
doesn't matter
also i have no idea how to use packetevents
idk about protocollib
either
but whatever
does it not glitxh on packetevents?
and doesn't break (usually)
I don't know
the glitch appears when you put the armor on by rightclicking
i think its too fast
and thats why it glotches
ill try some stuff and then do that if nothing works
anyone know why this bossbar code isnt working ? All i want right now is for bossbar to be shown when in the borders of a valid chunk that has a kingdom uuid (already taken care of) and remove the bar when the player exits the territory
public class EggBossBar implements Listener {
private final Map<UUID, BossBar> kingdomBossBars;
private final KingdomManager kingdomManager;
public EggBossBar() {
this.kingdomBossBars = new HashMap<>();
this.kingdomManager = KingdomManager.getInstance();
}
@EventHandler
public void onPlayerMove(PlayerMoveEvent event) {
Player player = event.getPlayer();
ChunkCoordinate playerChunkCoord = new ChunkCoordinate(
player.getLocation().getChunk().getX(),
player.getLocation().getChunk().getZ(),
player.getWorld().getUID()
);
UUID kingdomUUID = kingdomManager.getKingdomByChunk(playerChunkCoord);
if (kingdomUUID != null) {
displayOrRefreshBossBar(player, kingdomUUID);
} else {
removeBossBar(player);
}
}
private void displayOrRefreshBossBar(Player player, UUID kingdomUUID) {
BossBar bossBar = kingdomBossBars.get(kingdomUUID);
if (bossBar == null) {
// Create a new boss bar if it doesn't exist
bossBar = Bukkit.createBossBar(
ChatColor.GREEN + "Kingdom Boss Bar",
BarColor.GREEN,
BarStyle.SOLID
);
bossBar.addPlayer(player);
kingdomBossBars.put(kingdomUUID, bossBar);
}
// Customize boss bar properties as needed
bossBar.setVisible(true);
}
private void removeBossBar(Player player) {
for (BossBar bossBar : kingdomBossBars.values()) {
bossBar.removePlayer(player);
bossBar.setVisible(false);
}
}
}
all i want right now is for it to show when player in territory, and disappear when player exits territory
if 5 people send their code walls only one of them will get help, if even
two codew alls in 5 minutes
You are not properly handling all items in this packet. If the list contains more than 1 element, then you are completely missing all the other elements.
how so? im looping thru all the items
You are literally only getting the first item from the list. Nothing else.
oh fuck
should i loop thru packet.getSlotStackPairLists() ?
and thrn check if its an armor piece and remove the enchant
Please split your functionality into multiple classes. Your Listener shouldnt keep track of states like this.
What piece of this code isnt working?
thanks a lot
what does packet.getSlotStackPairLists() return? is it like a pair list of all the items?
List<Pair<EnumWrappers.ItemSlot, ItemStack>>
Just a list of which you already got an element from
so to get the first pair i have to read(0).get(0) right? read the first pair and then get(0) gets the slot
or does get(0) get the pair
read(0) reads the first field of your object via reflections and returns a List<Pair<EnumWrappers.ItemSlot, ItemStack>>
You can then iterate through that (as usual) and put the changed elements in a new List.
After that you write this new List (write(0)) back into the object.
No this will break
That looks more like a java problem than a packets problem
Allocate a variable for the List and iterate it.
lmao i got confused dude ive never worked with packets idk what i should do with the pair lists
ill get back to you in like 5 mins with this
so would this work? i define the list in a variable, loop thru it and remove the enchants. then i write(0, pair)
You are now overwriting the list with a singleton list, for every item. So you will only ever have the last item changed.
Wasap. who knows an API (in Java or Python) with which you can track minecraft servers that have just opened
dude 😭
alr hold up
i didnt write this code originally thats why im unfamiliar with it
That is impossible and illegal. You would have to constantly scan the entire internet for port openings.
There are other more efficient methods, but the fact that this can mainly be used for shady things, makes me not want to tell you those.
so should i create a seperate List of pairs in which i have all the items with removed glints?
and then override the old list with the new list
old list as in not the variable
but the actual list
Last time im posting this. Please read it and try to understand the words in those sentences:
alr man sorry damn
i was just confused
so something like this should work where i iterate thru the items and add them to a new list and then override the old list with this one
by using write(0)
Yeah looks good.
thanks and sorry for the stupid questions
All good
hello i'm making a function to send blocks from a player to another, and to do so i make players get their uuids from a command.
the command and the function works fine for offline/cracked players, but for premium players, neither the uuid from the command and the uuid from mojang server works (offlinePlayer.isOnline() returns false)
if (SupremeSpawnerBlock.isSupremeSpawnerBlock(bAgainst)) {
// LEVELUP SPAWNER
SupremeSpawnerBlock supremeSpawnerBlock = SupremeSpawnerBlock.getSupremeSpawnerBlock(bAgainst);
System.out.println(supremeSpawnerBlock.getLevel());
supremeSpawnerBlock.levelUp();
e.getPlayer().playSound(e.getPlayer().getLocation(), Sound.BLOCK_ANVIL_USE, 1.0f, 1.0f);
e.getItemInHand().setAmount(e.getItemInHand().getAmount() - 1);
((CreatureSpawner)bAgainst.getState()).getPersistentDataContainer().set(SupremeSpawnerBlock.SPAWNER_BLOCK_DATA, new SupremeSpawnerBlockDataType(), supremeSpawnerBlock);
bAgainst.getState().update();
System.out.println(SupremeSpawnerBlock.getSupremeSpawnerBlock(bAgainst).getLevel());
e.setCancelled(true);
return;
}
For some reason this code fails to level up my spawner. I'm setting the persistent data and everything even twice, but it still remains level 1.
Here is my SupremeSpawnerBlock class.
@Override
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
if (sender instanceof Player) {
Player player = (Player) sender;
player.sendMessage(player.getUniqueId().toString());
} else {
sender.sendMessage("This command is player only");
}
return true;
}``` this is the command used to get UUID
if (fromPlayerOffline.isOnline()) {
if (fromPlayer.getInventory().containsAtLeast(item, parseInt(amount))) {
if(hasFreeSpace(material, parseInt(amount), toPlayer)) {
fromPlayer.getInventory().removeItem(item);
toPlayer.getInventory().addItem(item);
fromPlayer.sendMessage(ChatColor.GREEN + "You sent " + amount + " of " + strMaterial.toUpperCase() + " to " + toPlayer.getDisplayName());
toPlayer.sendMessage(ChatColor.GREEN + "You received " + amount + " of " + strMaterial.toUpperCase() + " from " + fromPlayer.getDisplayName());
res.status(Http.Status.OK_200);
res.send("Moved '" + strMaterial + "' '" + amount + "' from " + from + " to " + to);
} else {
res.status(Http.Status.BAD_REQUEST_400);
res.send("Not enough space in inventory");
}
} else {
res.status(Http.Status.BAD_REQUEST_400);
res.send("You don't have enough items");
}
} else if (!fromPlayerOffline.isOnline()) {
res.status(Http.Status.BAD_REQUEST_400);
res.send("ammazzati");
}
and this is the function to send
i have no idea why it doesnt work with premium players
any help would be appreciated 🙂
Every time you call getState() you get a new copy. And if you update on that copy, then you always end up with the original state with nothing changed.
So how could I work around it?
I need to get the state
In order to access the persistentdata
- Offline servers are generally not supported
- You need to show us how you resolve your players. Not much we can read from that code
is it possible to make smooth block moving
i want like 3 million blocks so it cant be entities
Simple: Dont create multiple copies of your BlockState. Just use one.
You mean like this?
display entities?
^
unless somehow 3 million entities wont lag the server (it will)
Moving 3 million blocks in general will lag everything
Do you want to move a chunk or something?
This will always lag either the client or the server. There is no way of achieving this.
good point
is it a block in a minecart?
I'd then need like a collection of states of all the spawners placed?
Its a BlockDisplay entity
what abt 100k blocks
Nope
Look at your code and keep in mind "every time i call getState() it creates a new copy"
I see, but how can I access the state without creating a new copy?
Are you moving groups or single blocks?
If it's a group, consider using fewer displayentities but transforming them to make them look as if it were more blocks
You create 1 copy, modify this copy, and then call update() on that modified copy.
Dont call update() on a completely unrelated copy that wasnt changed in the first place because that doesnt do anything
ah yea, but in old versions you would only be able to accomplish it with a minecart?
This would be possible. But probably about the limit (if you find a really efficient way of handling it)
falling blocks
I'm a master optimizer
I see a greater issue in making players be able to stand on that thing
its just 10k blocks (entities), would that lag the server or players
not including the fact that some blocks will just be 1 BIG block display
Players. The movement can be done on a different thread and with packets.
You have to realize that this would result in a metric ton of packets being sent out to a player
And throttling will result in some parts simply moving later than others because not all packets will be sent at once.
You can throw the idea of using Blocks in the bin. The most efficient way will always be BlockDisplays as they dont require light updates and are optimized in the render pipeline for such shenanigans. Falling blocks and actual blocks will result in quite a few calculations for both client and server (if not done virtually)
Damn, never knew it creates a new copy. Now its working. Thanks. Im wondering why do I have to set the persistentdatacontainer again? If I get the persistentdatacontainer, does it create a new copy of the object aswell?
imagine how many mesh updates it needs to do on the client every single time the world is updated
Like if I use getPersistentDataContainer does it create a new copy of the pdc object?
To send the entire ship from A to B, all you have to do is set the teleport interpolation accordingly, and simply call teleport on each display once.
All the movement in-between will be calculated by the player.
Is there any way to let the item lore use different translation in client?
i want to let work like this
lore:
- 'The Mat is %item.diamondSword.name%'
The Mat is Diamond Sword
There is no method to set a PersistentDataContainer in spigot
yesnt
u can do that directly
but
if you figure out a way to know what user speaks what labgu
lang
you can update it accordingly
translation components exist
wait really?
getPersistentDataContainer#set
yes
you set something IN the pdc there
The common approach from bigger servers would be to let the player choose a language, and then simply translate all text in your packets
according to their selected language.
can TranslatableComponent use on the lore?
That sets a property within the PDC. It doesnt write the PDC back on the object.
I'M SORRY
if i use NMS can i use TranslatableComponent on the lore?
I'll update it to 1.20.5 tonight or tomorrow
hum...
Hi guys
question is i know what language they use
but i don't know how to get the translation key with each material
should i make a map<Mat, translation-key> file manual?
or?
So I’m making a firstseen, how do I store the Date that the player for the first time joined in the config? Here’s the code I made https://paste.md-5.net/apotoweyij.java
Material is Translatable, so you can use Material.WHATEVER.getTranslationKey()
hum...
I guess Material#getBlockTranslationKey() or Material#getItemTranslationKey()
Depending on which you need
Relatively. Like 1.18 or something
oh...
Best you can do is construct it yourself, but worse yet, you're on 1.12 so there's no Material#getKey()
I would use a simple unix timestamp. It counts the milliseconds since 01.01.1970
It can be created by calling
long timestamp = System.currentTimeMillis();
Thanks for this advice
Why since 01.01.1970? Is there a reason behind it? Just curious
We should feed an LLM with a huge context size with the entirety of this discord channel, and then see how good it is with helping others with spigot problems.
The new LLMs will have millions of tokens for their context input. Maybe we would have to do multiple iterations and let it condense the most important parts so that it can have a single context with quality information.
does Spigot support 1.21 data driven enchantments ????
I think this just resulted from unix being created around that time? But dont quote me on that.
I will end you
(In minecraft)
ingame
does paper?
does?
meh

but we have a lot of time till 1.21
yeah? i was sure was short xd
hmmm yeah i hope more custom things
Yea presumably
okay shut up
*in minecraft i suppose
ah, but how would i reidentify the ship once the chunk is unloaded and reloaded or if the server restarts to continue moving?
do i just put a display entity inside of the ship with a custom nbt tag?
I would have a parent entity with a PDC tag
And then all the ship parts as a passenger of said entity
mhm
Tis what I do
I usually have a interaction as the base entity to act as a hitbox
but can entities have like 10k passengers..
yes
dead srs?
mhm
An entity can have unlimited (in theory) passengers

no computer can handle infinity
does that exist?
its just not practilly possible
anyone know a refund or /lastinv plugin that removes the items refunded from the player that has them currently and returns to player that died to a hacker or bug? Can pay lmk server is 1.9+.
wtf
is that a block with passengers
Yes
that looks better than microsoft flight sim
u def cant do a 360 in microsoft flight sim
displayentities are like what, 1.19.4 right?
yes
They aren't vertically rotatable iirc
ah
They aren't rotateable at all
ima just disable anything below 1.19.4
Oh horizontally too?
mhm
anyone know a refund or /lastinv plugin that removes the items refunded from the player that has them currently and returns to player that died to a hacker or bug? Can pay lmk server is 1.9+. please lmk.
Didn't know
They always align to the grid
Don't spam, this is also not a comissions channel
where is one
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/
wait
how long did it take to make that plane in entities...
that seems like a nightmare, i dont want 10k lines of code 😭
well I imagine they wrote some code to convert a building into a display entity thing
otherwise it'd be stupid
like you wanna be able to add vehicles or whatever without adding more random code to the plugin
how so
I can only hope for coll's sake he didnt manually type in every block of that plane
creating a method like that would be abit hard ngl
Colls been working on that system for a while
I can only but guarentee its got an API behind it xD
Yeah it just converts a selection of blocks
should i make it check each neighbour to each block and scale it instead of creating more entities (to enhance performance clientside) but that'd make the server basically seek for help trying to do that
it's going to check for -x, +x, -y, +y, -z, +z for EACH block which is like 6 extra loops
I mean that relies on a 2x2 area of blocks being the same
Also it'll strech the texture
oh
I considered doing that for concrete builds
someone know what's the meaning of this error
The SHA1 checksum of the downloaded server jar does not match the BuildData hash.
sounds like #help-server
how do i give items to players that are dead? for example if someone killed someone1 how do i give item to someone1?
(respawn screen problem)
when dead (in respawn screen) they do not really exist
giving the dead person an item it seems
wait till they respawn id say
no idea why you would give the dead one a reward
trostpreis
someone shoudl make an anti-pvp mode
If you kill someone you get a penalty.
You'd have players tryign to suicide on others
its not reward
Where?
Enchantments in 1.21
Why's that?
They are now registry based
Sure but it still works fine for vanilla enchantments
I think that's really all we can reasonably target with a translatable interface
Ehhhh
what's is supposed to do for a non vanilla one
It'll give a (potentially) non-existent key in the standard format
just like what is the trim material trim pattern ones
Idk it's a deprecate and expose name vibe
If that happens to be a translatable component, nice
If not, oh well
It would give you enchantment.namespace.key
Which seems fine to me
Whether or not datapacks actually abide by that translation format is up to the datapack
I mean, sure I guess given spigot doesn't have components yet, people don't really use it
Maybe more of a paper problem
We probably will end up adding Enchantment$Components#getName() though
Yea
I'll throw it into my PR
I'll update it to 1.20.6 today lol

Fuck the whole .5 and .6 thing is confusing 
Sorry 1.21 is already out
Might be a vibe to get it in while spigot is still experimental
Jk it’s 1.21.5 now
tbh the PR is done, I just need to figure out wtf I'm gonna do with books
i dont understand why my code works 💀
That won't happen probably

I think those legacy strings will only ever be deprecated if Mojang removes the legacy characters
Thems fightin words
Well, issue is with components in the API
no shot
On spigot
Deprecate the deprecated annotation
You'll be in a data loss environment
if mojang removed them, spigot would still support them. spigot already just converts them into components, it isn't using the section char directly
Yeah, they'd probably still be supported, but they could at least more reasonably be deprecated
how does that work
Yes
If spigot removed legacy text I'll cut off all my limbs
That's how confident I am it'll never happen
so i set isStartingIn5Seconds to false in a task but i actually forgot to save the object in my hashmap.
i have move event listener that checks isStartingIn5Seconds and doesnt let player move if its true.
problem is it works without resaving object in hashmap? how
Not even for translatables and shit but iirc current one also emits technically wrong legacy for nested text components
yeah, there's an open issue
Hey everyone lynx volunteered to fix it
On Bungee's GH? Or Spigot's JIRA?
I already opened the issue
On spigot
Ah okay
Hmm… fine you’re off the hook
Idk if it's a regression, iirc bungee converter is better
For now
Spigot ones isn't
can anyone help
Just hasn't moved anywhere because well, there aren't components in the API
tbh, the component PR I think uses Bungee's converter for all of Bukkit's legacy string methods now
Ah nice
It might be better after the fact
Let's hope people are using PDC to identify their shit XD
That's an unrealistic hope
Name/lore identification is so 1.13
But lore is easier /sarcasm
Stop being stupid ypu know full well there is some popular ass plugin using names and lore for comparisson

That's why they're popular 
bungee chat... show item...
need more... context...
you are.... Cute....
FUCK FUCK FUCK
No need to bring that up we just look away and pretend it's okay
bungeecord chat doesn't support show item
I thought you were HR
It does support it it's just shit
Das a conflict of interest
Does it not? Fairly certain it exists and works fine?
show item doesn't use nbt anymore
Ah, right, components
wtf components in components
Components in components in components
Great. Now we need an item component serializer/deserializer in Bungee :(

Probably in the game itself. Doubt it's a 3rd party library
Updating my nms to 1.20.6 is gonna take years.
Not because the code but because of java 21
Compiling this has me on the brink of tearw already
Anything is a third party library with enough CTRL C + V
@eternal night Whatver happened to doing all my gradle for me smh smh
Well no, it should work fine, shouldn't it? You can use ItemMeta#getAsString() which should get you a component string
You can just pass that straight into bungee's hover event, no?
Y2Ks brain has 0 wrinkles today
Or does ItemTag#ofNbt() strictly require JSON?
getAsString specifically says it should not be used as a serializable value, so...
It never has wrinkles


