#help-development
1 messages · Page 159 of 1
oh i didn't register that bit in my brain either lmaoo
that why i thought sever is either trolling
Because everything was okay and it wanst worker
Lmao i have been 30m trying to realize
why?
haha
But i mean if something is not working and there is no clarify reason you can think the sever is trolling you
right
but dont joke with brains
i make me feel bad because i have an ACV (Stroke)
im dumb i thought it was the same on english
what can i use to check if a locatioon contains an entity
any1 here use Lettuce redis client lib?
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!
is it possible to have a program Publish and Subscribe simultaneously
because it seems i rlly cannot do that...
just like jedis, you gotta subscribe on another thread
as subscribing appears to be blocking
ah really. let me go ahead and try that
why dont they already care about that on the library?
🤔
just tried that but still getting the same error https://paste.md-5.net/avumubebam.sql
ok nvm jedis handles this different
if its rlly not possible to have a program both subscribe and publish that would.... really suck
it kinda is
would mean i need to rewrite it all with a different library
you just need to use different instances
different Connection instances?
connection.sync().subscribe...
connection.async().publish...
for example
with jedis you just get 2 separate instances from the pool
is there an event that detects if an item is clicked into a menu
and how can i check if its an inventory or not
How do I display coordinates on a scoreboard with placeholders?
yes I will help you
tho first and foremost you probably need more than one connection
since listening iirc is blocking
so i need to have 2 RedisClient instances?
na
take a peek at this
(basically I have one for subscribers, and one for publishers)
but you can ofc reuse the client
Is creating multiple classes like this one below affects server performace? public class gui() { public Inventory initialize() { Inventory inv = .........; return inv; } } I'm using them like this openInventory(new gui().initialize())\
i have noticed. i got it working
scarcely
danggg ur a lifesaver
pog pog
thanks alot
rewriting the whole thing wouldve been... painnn
true
tho not needed here
yea i will make some good ways to handle it all now that i know how it works
How do I check whether a certain spot in the world is loaded?
nvm, found it in Chunk
#AskingYourMomToFindSomethingAndImmediatelySeeingIt
How would I loop through a config and get the numbers in order?
for example
player:
- 10
player: - 1235
player: - 0
and get the numbers in order
from lowest to highest or vice versa
you would get all key value pairs, then sort them after the values
public void SoulBoundInventoryClick(InventoryClickEvent event) {
if (event.getWhoClicked() instanceof Player player) {
ItemStack clickedItem = event.getCurrentItem();
if (!(clickedItem == null)) {
if (!(clickedItem.getItemMeta() == null)) {
if (clickedItem.getItemMeta().getLore().contains("SoulBound")) {
event.setCancelled(true);
}
}
}
}
}```
this works but I would like to be able to move it around only in my own inventory
how would i achieve this?
U need to specify the inventory
so check if the inventory is your gui and then do all that stuff
sounds like the solution
that is a newer java thing
yeah its a cool cast
let's you assign a variable to the instanceof thing
yeah, java 16
I'm asking how to find who the owner of that inventory is
i'm not sure how to get to it
you havent given enough information for us to properly help you. what exactly are you trying to do
I'm trying to allow myself to move it around in my inventory but not other menus
e.g. a chest
so you want to basically bind an item to your inventory?
yea, ive done death armorstand placing and more
this is the last
so the only player who can take things out of the gui is the player who died
is what ur saying
you could compare the Player#getInventory() to the event#getClickedInventory()?
thanks
thats exactly it
if that doesnt work send the class with comments
alright
so its easier to understand what ur trying to do
but hopefully that works
what shreb said
I love the spigot java docs, they can tell you basically everything XD
lemme test that rq
literally the point of docs xD
yeah but most devs dont do them properly
^
I like how javadocs are made from the actual commends within the java code so I can just middle-click and read it live on my IDE
I have to force myself to make comments on my methods because I am so sure they are properly named and self explanatory
thats a bonus!

🤨
:3
this is my new script:
public void SoulBoundInventoryClick(InventoryClickEvent event) {
if (event.getWhoClicked() instanceof Player player) {
ItemStack clickedItem = event.getCurrentItem();
if (!(clickedItem == null)) {
if (!(clickedItem.getItemMeta() == null)) {
if (clickedItem.getItemMeta().getLore().contains(soulB)) {
if (!(player.getInventory() == event.getClickedInventory())) {
event.setCancelled(true);
}
}
}
}
}
}```
it works
but when i put it into a container
i cant take it out
it shouldnt even go into a contianer
pyramid of doom
HOLY IF STATEMENTS
exactly pyramid of doom
you havent seen anything 💀
im like yandere dev
Is this wrong?
name: BowPlugin
version: 1.0
author: Sebbe
main: me.sebbe.BowPlugin.Main
api-version: 1.14
In the Yml
hi i know this isnt exactly a spigot question but i thought some people here might be able to help anyway, I'm trying to make Maven deploy my packaged JAR to a remote SFTP server so I added the maven wagon extension:
<extension> <groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ssh</artifactId>
<version>3.5.2</version>
</extension>
and the sftp site:
<distributionManagement>
<repository>
<id>ftp-repository</id>
<url>sftp://REDACTED.net:2022/plugins</url>
</repository>
</distributionManagement>
and the server in settings.xml
<server>
<id>ftp-repository</id>
<username>REDACTED</username>
<password>REDACTED</password>
</server>
but it returns me this error when I hit "deploy":
Algorithm negotiation fail
Can someone explain me, why this is called twice?
public void onClick (PlayerInteractEvent event) {
if (event.getAction() == Action.RIGHT_CLICK_BLOCK) {
if ( event.getHand() == EquipmentSlot.OFF_HAND ) return;
Player player = (Player) event.getPlayer();
ItemStack itemInMainHand = new ItemStack(event.getPlayer().getInventory().getItemInMainHand());
if ( itemInMainHand.getType().equals(Material.WATER_BUCKET) ) {
player.sendMessage(ChatColor.GOLD + "test");
}
}
}```
iirc one for right hand and one for left hand
I google it, and if ( event.getHand() == EquipmentSlot.OFF_HAND ) return; this should prevent that. But its not working.
wdym not working
I get messages, instead of 1. Event is called twice for some reason. I only need event to be called for main hand.
?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.
Your plugin.yml should be in the src/main/resources directory
?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.
how would i fix this error?
java.lang.IllegalArgumentException: Invalid BSON field name _id
coming from
collection.updateOne(Filters.empty(), document);```
Depends on wha tyou want
remplace is for overring the Document on the collection
And update as it mention it update a Document
well, does it matter?
Yes
how so?
Because we have the same in food, the knife and the fork which are for eating but they dont the same función
User user = getUsers().getUser(uuid);
Document document = Document.parse(gson.toJson(user));
getStorage().getUsers().insertOne(document);
i c
xD
Sorry but im on cellphone
And i connected to my machine to test smth
And i had in the xlipboard the code I run
Hahahaha
java.util.UnknownFormatConversionException```
how would i fix this?
e.setFormat(ChatColor.translateAlternateColorCodes('&', "&7" + display_name + " &8» &f" + e.getMessage()));```
this line
nvm
@EventHandler
public void SoulBoundInventoryClick(InventoryClickEvent event) {
if (event.getWhoClicked() instanceof Player player) {
ItemStack clickedItem = event.getCurrentItem();
if (!(clickedItem == null)) { return; }
if (!(clickedItem.getItemMeta() == null)) { return; }
if (!(clickedItem.getItemMeta().getLore() == null)) { return; }
if (clickedItem.getItemMeta().getLore().contains(soulB)) {
if (!(player.getInventory() == event.getClickedInventory())) {
event.setCancelled(true);
}
}
}
}```
i'm trying to make it so I can move it around in my inventory but not in other containers
i can move it around
but can put it in other containers and cant take it out of it
- use pdc not lore to identify the item
- check type instead of matching the inventory
wdym by type?
and have you verified what point it is stopping at?
everything is going through
if(event.getClickedInventory() instanceof PlayerInventory)
and
if (event.getWhoClicked() instanceof Player player) {
this is a useless if statement
how would i sort a tabcompletion?
if i have "s" it'll sort from everything that starts with s
@drowsy helm uh so just an hour ago this was working but now when i do java if (!(clickedItem == null)) { return; } if (!(clickedItem.getItemMeta() == null)) { return; } if (!(clickedItem.getItemMeta().getLore() == null)) { return; }
it gives me java.lang.NullPointerException: Cannot invoke "java.util.List.contains(Object)" because the return value of "org.bukkit.inventory.meta.ItemMeta.getLore()" is null
its because lore is null
there's no lore on the item
theres a check
and yes there is
oh weait
1 sec
im dumb
gimme sec
ok now it says the item is null
how tf do i cast to a chest
var block = e.getClickedBlock();
var hand = e.getPlayer().getItemInHand();
if (hand.getType() != Material.BLAZE_ROD) return;
if (block.getType() == Material.CHEST) {
e.setCancelled(true);
Chest chest = (Chest) block;```
=
java.lang.ClassCastException: class org.bukkit.craftbukkit.v1_19_R1.block.CraftBlock cannot be cast to class org.bukkit.block.Chest (org.bukkit.craftbukkit.v1_19_R1.block.CraftBlock and org.bukkit.block.Chest are in unnamed module of loader java.net.URLClassLoader @504bae78)
You have to cast the BlockState I think
would you ever be able to run something faster than 20 hertz?
why is the service null?
RegisteredServiceProvider<Economy> rsp = getServer().getServicesManager().getRegistration(Economy.class);```
to be exact
Probably because there's no economy provider, i.e. Essentials
Does PlaceholdersAPI automatically detect where a Placeholder is used and update it? For example if I use %player_name% in a gui... Or I have to translate manually?
The gui plugin would handle that, usually with PlaceholderAPI#setPlaceholders(Player, String)
How can i save coords/ID of an armour stand so I can request for it later?
@echo basalt good night sweet prince
If you want them to persist a restart, then file I/O. Otherwise, use something like a HashMap.
when was Class PlayerArmorStandManipulateEvent added? In what MC version?
kinda not really a dev question but I can code so why does this not work?
if I try to connect to it stalls and then shows this error
pressing continue to site does nothing
should I setup something on my server to forward it instead of using godaddy?
just because u can code doesnt mean everything will work out in life
k thanks for the life advice
wanna give me some forwarding advice as well?
just because u can code doesnt mean it shouldnt work
I never said that
yes
I can code so why does this not work?
k you're pissing me off
i'm just trying to help you
how are you helping me?
you're just arguing and saying dumb shit that doesn't help anyone
i appreciate that you think that you're helping, congrats, but maybe next time be a little less argumentative and more constructive and helping
that is DNS forwarding, this works for some clients but not completely for browsers because a browser is still expecting to see the headers for it. The headers will contain more information in regards to security. Second some browsers do accept dns forwarding and the server you have is probably not serving up the certificate in order to be truly secure as well.
also
i just went to discord.neomechanical.com
it works
its urself
is this something that is home hosted?
then clear your dns cache or the browser cache
^
if that isn't it, then its just that the dns that is responsible for your domain
hasn't propagated the info to all the dns servers in the world
and you are just unlucky to have a dns provider that is slow at getting it
well I set it up a month ago
the domain, or the subdomain
well clearing your cache then should most likely fix your issue
or changing dns server
i'll try get a friend to connect
so godaddy is just slow I guess
no one can connect in australia
guess I got to wait 48 hours
yay...
How would i teleport something to the left of the player no matter what their pitch is
Teleport something?
Like an armor stand
I need it always to the left of the player no matter their direction
pitch has nothing to do with left/right anyway lol
pitch is up n down
yaw is left n right
Oops, yaw is what i was thinking. Its 2am xD. But how would i do this?
Im curious
vectors, idk math tbh
Obviously
Looping through values in config and sorting ?
well this is fun, I think I have a memory leak but now that I have a way to analyze the mem dump it's not happening anymore
no, that's a normal 301/302 HTTP redirect
we're going to the moon baby
erm wtf
CraftMerchantRecipe#fromBukkit(MerchantRecipe) doesn't use priceMultiplier, demand, specialPrice from MerchantRecipe, so these things are missing for me...
how would i do this?
wherever the player is looking it'll shoot an armor stand
there's more than one way of doing this
idc what way
i'd rather have a tutorial
on "directions"
so like 2 blocks left of the player
get the player eye direction and spawn an armorstand, then apply a velocity to it
would be always 2 blocks left no matter what their yaw is
Hello, I am unable to purchase this item. => https://www.spigotmc.org/resources/bedwars1058-the-most-modern-bedwars-plugin-bungee-scalable-bungee-legacy-multi-arena-shared.50942/
bro, how do i get a location based of the head rotation?
can we get that in english
"The system is currently not working. Try again later."
It's been 2 days since I got this message.
does paypal work else where
yes
I see that the owner no longer has his paypal on this resource
and what do you think would happen if they dont have their paypal linked, and the resource is marked as inactive and not accepting buys
oh i didn't see this message
is that a development question?
nah but there is no living room for problems of this kind
yes okay I'm going to wait 3 days just for a small question lol
@tender shard and I think that politeness is the least of things
mfn
would you by chance know how to get a location based on the player's head rotation?
wdym?
well noone here in help-dev can tell you why paypal isnt working for you or why a resource is marked as inactive
that's something only staff can help you with
so either ask in general and wait until staff is online, or send an email
help-development is definitely not the right channel
wdym? the rotation is part of the location
a location is X, Y, Z, Pitch, Yaw, and World
oh you need some fancy math for that, sin/cos
@tender shard you are so rude, it's unbelievable
I dont think so
hes correct though
I only told you that this is not the correct channel
lol
yeah I'm so evil
I once went to pet alex and he bit me
unfortunately, my math classes are 10 years ago lol. I'm sure it's just a one-liner but I also have no idea how it works anymore lol
yes in an unpleasant way is without politeness, it's perfect as it is
I didnt mean to be rude, can we stop talking about this now here? this is #help-development and not #general
damn, well thanks anyways. I'll create a spigot forum
yeah you'll definitely get a reply on the forums, that's a good idea
I once asked alex how to rotate an armorstand and he shot my dog
worst part
probably just watched a bit too much kingsmen
I still don't know how to rotate that armostand
btw talking about dogs, my new dog bed arrived today
alex sleeps in a dog bed confirmed
this man shoots my dog then goes on craigslist and buys my dog's bed so he can sleep on it
how messed up is that
with setRotation(float, float) I guess lol
well now I don't need it anymore, I was doing it for my dog
I got a 1.8 meter bed :3
are you a dwarf?
are you a dwarf?
is it like 4cm long
hm last time I checked, I was 185cm
so I guess, no
but I cannot be sure
there's only one way to make sure
I'm going to try to fling you across a gap at a group of orcs
pretty sure they're LARPing in the woods
we just have to make sure to go to the right site or else we'll find the furry LARPers instead
and we might not survive that one
i bet theres a chance alex is german
ive read that a few times on accident but i still dont remember
imagine having a bio
"on accident", yeah yeah... you wanted to creep on me
I like it
but my spigot join date is not correct
I'm here since 2020 or so
I once got banned, and once left myself, then rejoined the same day
?userinfo
yeah, makes sense
?userinfo
it probably doesnt track priors
I mean...
suii
my upstairs neighbors are in a race and they don't even know it
would be frightening if I wrote 128k messages within 2 months lol
the race is will I go insane from their noise before I leave this place
that would mean 1.5 messages per minute for 2 months straight
what would that become if you include sleeping for 8 hours per day
roughly by sending 10 messages in 4 minutes
yeah but remember that you have to do this straight for 2 months without pause
macro go
you have one too lol
yeah, it's a statement on bios
ill make an Orangutan do it
smh
his english wasnt good
he meant he allows it by saying yes
I was also a bit confused
by saying yes to that doesnt it mean he does mind that your stealing it
wait it does
"do you mind ...?" "yes"
that means that he minds it, e.g. he doesnt want it
or is my english stupid
he minds that your taking it
I thought "do you mind" means something like "it annoys me"
probably
I still wonder wtf is wrong with intelliJ's maven tool
why does it only say "null"
and yeah I already tried to invalidate caches etc
Doesnt want to work today
I mean, fair enough, it's saturday
they are fine, thanks
bet you use github light
nope, there I got dark mode
good
gotta enojy those warnings in dark mode
whats your opinion on paid plugin devs putting all of their code on github
would love to know how you managed to make the inv unload and auto shulkers
Invunload is on github
And its a mess
It was one of my first plugins
I wanted to rewrite it, but its working fine sooo
when i started coding i dropped myself in the deep end lol
My most messy code is probably BestTools
just looked at inv unload, your main class is called main lmao
also so many unsorted files
yeah
But i dont see anything wrong in using Main as class name
i guess if theres no reason for other plugins to hook into it i guess its not that bad
yeah
so yeah, it's called Main, but people shouldnt use that, they should use AngelChestPlugin interface to hook into it
do you use your own lib for most things
yes
otherwise it'd be a pain in the ass when a new NMS update gets released
i cba to make my own and why not use a premade one i use jishunacommonlib
quite good for commands
for commands I just stick to ACF
although the documentation is shit
no gradle smh
wdym
you dont give us pre-typed gradle stuff
I think that people who volunarily use gradle are smart enough to "convert" the maven dependency thing into a gradle one 😄
Nexus Repository Manager
nexus can show the correct "thing" for every build system anyway
damn wtf is this
agree
I know how to use it, I still dont like it
like wtf, parameter names BEFORE the type? that suggests that the name is more important than the type
tf
havent even used kotlin but from what ive heard from friends and things on yt its shit
kotlin is unnecressary
could probably agree on that
or stuff like this:
public class Person {
int age;
void setAge(int newAge) {
if(newAge < age) throw new IllegalArgumentException();
age = newAge;
}
}
and now I do this
myPerson.age = 27;
does this now set the field directly, or use the setter?
kotlin's behaviour for this is random
there isn't a way to know whether you access a field, or a method
opinion on lombok
lombok has many useful features and many shitty ones. I mainly use it for @Getter and stuff, but that's basically it
your not welcome here anymore
I'm making a small library which uses nms, but each time when I want to install it to the local repository, I get this error:
cannot access com.mojang.authlib.GameProfile
lombok getters are pretty good
because I rather have a 30 lines class than a 150 lines class
good shit once you know to love it
what java version do you use to compile?
if I was using normal getters my config initialization classes would be 3000+ lines long
Oh 8
I think this is the problem
I wonder why it says "101+ matches"
why is 101 the limit lol
why not "100+ matches" or "127 matches"
they can, if you don't need to support 1.16
minecraft should delete all versions older than the latest stable
there are still many people using java 8 so I still compile for that :/
I think so too
Ok turning the version up to 17 fixed it
md_5 could have fixed this by not releasing a log4j fix for older versions
well I compile with java 17 but for java 8 lol
I wonder how many people have seen this screen
true, but almost everything that java 17 adds in addition to java 8 is just "conventient features" that can easily be done without those
how many people do you get in your dms asking for you to help with easy as fuck things
I mean, sure, java 17 is much better, but it doesn't add anything "really needed" like e.g. try with resources, enums, etc
i remember when someone was like "YOU CODE?" "CAN YOU TEACH ME" when they couldnt even download a plugin off spigot
then recently they came to me asking about skript
had to repeat myself around 5 times before they got the message
so I think I've discovered a pretty funny bug
I have this whole complex structure for my custom scripts
gave me a headache for 4 days
because I had to negotiate with my own designs from 5 years ago
yeah sure, it's quite handy, but you could also just do the old way
if(entity instanceof ArmorStand) {
ArmorStand armorStand = (ArmorStand) entity;
//( do stuff
}
So sure, pattern matching is nice, but it's not needed at all
today I realize, massive memory leak
I spend all morning trying to find which part of the script is bugged
e.g. you can also do this
if(!(entity instanceof ArmorStand armorStand)) return;
armorStand.setWhatEver(...);
now I'm almost certain it's when the boss dies, you know, when nothing is meant to be running lol
that's what I really like
did you hear about the leaked mobvote mobs
Minecraft Live 2022 is in two weeks. And this man is at it again.
https://twitter.com/RogerBadgerman/status/1575600753728950272
Merch: https://phoenixsc.store/
Cape: https://store.badlion.net/shop/PhoenixSC
This channel is powered by Shockbyte server hosting --
Receive a 25%...
I'd rather see GTA 6 finally being released D:
my graphics card is bored all the time, GTA 6 when?!?!
tbh I havent looked at it
also I am pretty sure that rockstar "leaked" it themselves for PR or something lol
would it surprise you if the person leaking this is mojang creating this account and posting it to get people hyped
I mean, noone can confirm or deny it anyway
true
oh ok
watch him get the electric chair
wow more mobs im so excited
bet the really annoying mob will get added
me still waiting for copper golems
they should add skunks
so I can finally find a use for copper
they should finally add booze to MC
yes
a brewing block
apart from fucking lightning rods and funi zoom
add hops, wheat, and water, and you get a beer
add garlic too and you get a disgusting beer
would love to see an end update
they should appeal to the youth and add vapes
lol
I think they should add more structures in the world
its been like 8 versions since we got one
or at least add a new type of generation with more structures
all we have is Villages/With Huts/Shipwrecks/Igloos
fun fact: there are more release versions released after 1.8 than before 1.8, yet some people still use 1.8 because they are a bit weird
oh and woodland mansions I never find those tho lol
they like the pvp for some reason
that's why I said "release versions" 😄
I am a pvp enjoyer
it's because all they can do is spam left-click instead of actually timing their attacks
You received a 1 star rating from Xx_PvPProHD_xX
Why not work on 1.8? F#*& you!!
this happened all the time to me like 4 years ago
thank god it stopped meanwhile
someone just needs to rewrite the 1.8 api to use the 1.19 one so everything works again ggwp
but then 1.8 plugins stop working 🤔
nahh
pvp down the drain
someone should find another really game breaking bug
that applyies to all version
s
then we just force md_5 not to update 1.8
it is like full auto and semi-auto, full auto is just more fun
and any other fork
Im using the remapped version of nms in my api that im making, but when I run the plugin I get the error that It can't fin the nms-classe (because they have the remapped names, but I already reobfuscate them!)
something's wrong I can feel it
?paste
cant help without code
show the full stacktrace
btw you cannot cast a Bukkit Player to a ServerPlayer
ServerPlayer nmsPlayer = (ServerPlayer) ((CraftPlayer)bukkitPlayer).getHandle();
that's how to get a ServerPlayer from a Bukkit Player ^
Ayo can someone recommend a good (free) Discord Bot host?
what bot? a .jar you wrote yourself?
ye
you could just get your free oracle cloud server and run it yourself
that exists? good to know
yep
ty, will check it out!
you did NOT reobfuscate your code
are you using maven?
yes
how did you compile?
I install it in the local repo
how? using mvn install?
yes
?paste your pom
you messed up the remap execution phase
why did you set it to install?
it's supposed to be set to package
Because I dont package
ofc you package
I dont runn it
otherwise there wouldnt be any jar to install
set the <phase> to package
in all <executions>
isnt the normal maven build command mvn clean package
depends, if you also want to install it, you can just do mvn install
or mvn clean install
or mvn clean package install
install automatically includes package
you want to get a Bukkit object, without spawning it?
what do you need it for?
do you have any NMS entity already?
you need to create an NMS entity, then you can just do getBukkitEntity
Entity nmsEntity = new Boat(/* World */null, /* Coordinates */0, 0, 0);
org.bukkit.entity.Entity bukkitEntity = nmsEntity.getBukkitEntity();
this will not spawn it yet
ok well I did find a weird bug but it was with my startup script, somehow
forgot to define how much mem I wanted to allocate, it said it was doing 4gb but it was showing stats for 2gb somehow?
if you wanna spawn it later, you can use ServerLevel#addFreshEntity:
Entity nmsEntity = new Boat(/* World */null, /* Coordinates */0, 0, 0);
org.bukkit.entity.Entity bukkitEntity = nmsEntity.getBukkitEntity();
ServerLevel level = ((CraftWorld)Bukkit.getWorld("world")).getHandle();
level.addFreshEntity(nmsEntity);
So I have this
uuid:
balance: number
and I want to sort through every players balance and get them in order. How would I do this?
in yml
You can use a HashMap<UUID, Double> to read all balances, then sort them by value?
it's in a config
bruh moment
You read the config into a hashmap
Then sort it
Im changing the skin of an Player like this:
ServerPlayer serverPlayer = (((CraftPlayer) player)).getHandle();
GameProfile gameProfile = serverPlayer.getGameProfile();
for (Player p : Bukkit.getOnlinePlayers()){
System.out.println("Sent");
(((CraftPlayer) p)).getHandle().connection.send(new ClientboundPlayerInfoPacket(ClientboundPlayerInfoPacket.Action.REMOVE_PLAYER, serverPlayer));
}
gameProfile.getProperties().removeAll("textures");
Skin skin = skins.get(skinName);
Property property = new Property("textures", skin.getData(), skin.getSignature());
gameProfile.getProperties().put("textures", property);
for (Player p : Bukkit.getOnlinePlayers()){
System.out.println("Sent");
(((CraftPlayer) p)).getHandle().connection.send(new ClientboundPlayerInfoPacket(ClientboundPlayerInfoPacket.Action.ADD_PLAYER, serverPlayer));
}
But the Skin only changes on Tab
you have to send an EntityRemove and EntityAdd packet to all players
oh wait
you did that
nvm
lol
So what can I do ?
read your config into a Map:
Map<UUID, Double> balancesPerPlayer = new HashMap<>();
for(String uuidAsString : getConfig().getKeys(false)) {
UUID uuid = UUID.fromString(uuidAsString);
Double balance = getConfig().getDouble(uuidAsString + ".balance", 0);
balancesPerPlayer.put(uuid, balance);
}
then sort the map by values, see the stackoverflow link I sent above
Can we make mobs with custom animations here or is it modded only?
yeah, either dirty workarounds, or client mods
I managed to make a boss script that uses 2gb of ram when it switches phases wth
Oh.
maybe I shouldn't cache these hundreds of particles lol
To modded I go lol
You'd bw surprised at what armourstand art can do
Yeah but now I'm still sharing this
Because it's stupid pretty
no you're not
no you're not
yes I am
I mean, fuck
reread your message
the one where you said you are looking to modify a mobs model while keeping the old model
I've been trying to make sense of it but I really can't, what do you mean "modifying the model while keeping the old model?" That's the same as "peeling an orange while keeping the skin"
Or... "Killing a sheep whilst keeping it alive"
Ahh that makes more sense
you need to learn the difference between modifying and cloning
IIRC there's this custom entity making concept that fits perfectly into what you wanna do
One sec lemme try to find the article
reflection?
what did you do?
and how did you create the entity without spawning it?
There's a way to do that without reflection
But it uses some pretty obscure nms that I don't have the patience or time to explain lol
Howdy, I'm trying to send a message to the player's action bar in the latest 1.19.2 build but I get this error:
java.lang.NoSuchMethodError: 'org.bukkit.entity.Player$Spigot org.bukkit.entity.Player.spigot()'
When trying to send this:
p.spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(message));
message is just a normal string
looks like you are not using Spigot
rather CraftBukkit or another fork below spigot
the Spigot API is not implemented
upgrade to Spigot
I don't want all the spigot game changes
well thats the only way to use the spigot api
just disable some shit in the config idk
are you using CraftBukkit?! o0
wtf
CraftBukkit isn't meant to be run since like 8 years or so
You could use Bukkit.getOnlinePlayers() to get all the players and Bukkit.getOnlinePlayers().size() just generate a random number and get the player at the generated index. Idk if I'm being clear.
That's what I thought but I wanted to try x) Spigot was a hassle to get it to vanilla like last time I tried
you could of course also send action bar messages with craftbukkit, but that requires NMS
if you want vanilla use vanilla server
Or consider fabric
I want vanilla mechanics with plugins, spigot changes way too much with the performance optimizations, but since I'm jsut playing with a few friends on a self hosted machine, I don't have to worry about performance
I'm really bad at modding and cardboard is still in development
What does spigot actually change anyway
I also wonder
I don't believe spigot does anything big. That's why paper exists
oh my god
x)
I just randomly found the dumbest mem leak
it has nothing to do with my cool scripts, I forgot to do a check to see if a world allows mobs to be spawned as of an update a while ago
seems like it tried to spawn them 7 million times?
Sounds good to me
wait not I didn't, I can see where I took that into account, wth
i am so confused right now. im using java 17. which contains Files#writeString but somehow intellij thinks i am using java 8. but it also knows i am using java 17....
it suggests me to change Files.write(path, gson.toJson(settings).getBytes(StandardCharsets.UTF_8)); this to Files#writeString but when i do so it errors out....
<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
</properties>
ive got this in my pom
so that should do it
ide getting mad
this is also right
as well as the module's language level
since when
ive used it tons before
with 2 parameters...
the third one is optional
as you can see for some weird ass reason its using java 8. even though that has not been set in my project anywhere
Did you try restarting
multiple times
its also worth noting this is happening in a sub module
but the parent module does not contain anything that could overwrite it to use java 8 either
also invalidated caches multiple times
did you maybe also specify a java version in the maven-compiler-plugin?
not using the compiler plugin in the module or the parent module
How can you change the skin of an player in 1.19.1?
i just invalidated again and it just keeps indexing the wrong one
thats so weird man
are you sure that your previous code didnt work? did you try it with two accounts? because you won't be able to change your own skin IIRC
No I didn't
you could try to exit intelliJ, delete the whole .idea folder, then restart it
is ther no way to change your own skin
I dont think there's any way to change your own skin
damn thats scuffed
have you tried spray tan?
declaration: package: org.bukkit.profile, interface: PlayerTextures
My next suggestion was going to be a blood sacrifice
that wouldve done it too prolly
Does that change it for other players to?
what is the difference between
256 bit encryption and 4096 bit RSA encryption
is the "256 bit encryption" we know, called AES 256 bit encryption?
since i heard smth like that
ok I finally discovered the issue, I managed to recursively schedule a task
well you see one is AES one is RSA
presumably because I was halfway into a coma while writing that bit of code
rsa is bae
you generally use AES if you just want to encrypt your data and you use RSA if you want 2 users to be able to access something without anyone else having access
How can I get the player-profile
declaration: package: org.bukkit, interface: OfflinePlayer
How can I get it from an Online-Player?
declaration: package: org.bukkit, interface: OfflinePlayer
(Player extends OfflinePlayer)
I mean with the PlayerTextures
declaration: package: org.bukkit.profile, interface: PlayerProfile
huh I'm pretty surprised, the system I made turned out pretty dang efficient
impossible
&b- Use the following command: &6[command:/town invite <player>]/town invite <player name>[/command]
how would I detect the command inside of the [command] tag's body, and then encapsulate the text inside the tag as a TextComponent? i thought of starting with regex, but i don't know what exactly to do
Hi, do you know how I can modify this code so that it is for custom skull with base 64 plz?
public static ItemStack createItem(Material material, int amount, String displayName, List<String> lore) {
ItemStack itemStack = new ItemStack(material, amount);
ItemMeta itemMeta = itemStack.getItemMeta();
itemMeta.setDisplayName(displayName);
itemMeta.setLore(lore);
itemStack.setItemMeta(itemMeta);
return itemStack;
}
public Player getRandomPlayer() {
Random random = new Random();
List<Player> players = new ArrayList<>(Bukkit.getOnlinePlayers());
return players.get(random.nextInt(players.size()));
}

why is this not static? 😛
why are you initializing randoms
yeah just use ThreadLocalRandom.current()
Thx!
you can change your own skin
you could just regex it like this
\[command:(.*?)\]
match 1 group 1 will be the command
yep, I too was thinking of regex, but after capturing the command I don't know where to go next, when do I detect the body of the tag?
(the green part)
public static void changeSkin(Player player, Property property) {
ServerPlayer nmsPlayer = ((CraftPlayer) player).getHandle();
ServerLevel nmsWorld = nmsPlayer.getLevel();
GameProfile profile = nmsPlayer.getGameProfile();
ServerGamePacketListenerImpl connection = nmsPlayer.connection;
broadcastPacket(new ClientboundPlayerInfoPacket(ClientboundPlayerInfoPacket.Action.REMOVE_PLAYER, nmsPlayer));
// connection.send(new ClientboundPlayerInfoPacket(ClientboundPlayerInfoPacket.Action.REMOVE_PLAYER, nmsPlayer));
PropertyMap properties = profile.getProperties();
properties.removeAll("textures");
properties.put("textures", property);
broadcastPacket(new ClientboundPlayerInfoPacket(ClientboundPlayerInfoPacket.Action.ADD_PLAYER, nmsPlayer));
// connection.send(new ClientboundPlayerInfoPacket(ClientboundPlayerInfoPacket.Action.ADD_PLAYER, nmsPlayer));
connection.send(new ClientboundRespawnPacket(
nmsWorld.dimensionTypeRegistration(),
nmsWorld.dimension(),
BiomeManager.obfuscateSeed(nmsWorld.getSeed()),
nmsPlayer.gameMode.getGameModeForPlayer(),
nmsPlayer.gameMode.getPreviousGameModeForPlayer(),
nmsWorld.isDebug(),
nmsWorld.isFlat(),
true
)
);
}
private static void broadcastPacket(Packet<?> packet) {
for (Player player : Bukkit.getOnlinePlayers()) {
((CraftPlayer) player).getHandle().connection.send(packet);
}
}
it does a tiny flicker on the client but that's a rendering issue
you could give blindness for 10 ticks to solve that
\[command:(.*?)\](.*?)\[\/command\]
match 1 group 1 will be the command, match 1 group 2 will be the "body"
ohh yes i forgot there could be multiple captures 😛
Old system for base64 skulls D:
thanks Alex!
np!
For the property, just pass the authlib textures property
makes no sense to switch unless everyone updated to 1.18+
As they should
but they haven't yet
Well
Make your plugin send their server IP directly to Putin if they are on old versions
still got over 100 servers on 1.16 D:
put an embed zip bomb on your plugin that only triggers if you're on 1.8
Perfect
I just return in onEnable when not on version X or later
Should call it shameMode
it's so ugly, I love it
´why do you use light theme
why do you use dark theme
you're making me physically aggressive
it doesn't illuminate my entire room
Easy on the eyes
dont you have windows? do you live in the basement
I have my blinds all the way down
I dont
then you have tons of light, you could use some contrast
What if you live in the arctic and it’s dark for 6 months
Idk my eyes can handle a monitor with normal brightness
I got monitor on like 20% brightness
Mines on min
I used to use my old monitor at 0%
Still too bright
I really like to tune my monitors with minimal brightness, high contrast and tons of sharpness
then run cleartype
so that text is instantly readable but nothing is too sharp
Is there a way to play a custom sound?
What is "block" plz?
presumably the block at which the skull is that you wanna change ?
Mhm
Amazing
Ow i see thx but i want add skull in my gui so i think i must not use this?
I can now make ZA WARUDO
There’s presumably another method that doesn’t need a block
Yes, i think ItemStack
Can I listen to Event?
Why would you want to
Because why not?
considering the variety of events happening, it'd probably be called about every tick
just use a runnable
why would you do that anyway? https://xyproblem.info
Asking about your attempted solution rather than your actual problem
Way more than every tick
There is good reason why they don't let you listen to it 
Welp
Hum, i have another problème x)
Can you help me?
I wanna cancel all events.
else event.setCancelled(true);
You want that?
Then don't use Spigot 🤡
- Why
If I have a dependency that is written in kotlin is it possible to use that when programming in java?
yep
nice
I'm trying to add com.github.DV8FromTheWorld:JDA:v5.0.0-alpha.20 library to the plugin, but it throws ould not find artifact com.github.DV8FromTheWorld:JDA🫙v5.0.0-alpha.20 in central (https://repo.maven.apache.org/maven2) error on startup, is there any way to add repos of it?
Well then I wanna cancel all cancellable events
i have this piece of code and for some reason password1 returns to be null can someone help me out ?
Some servers have the ability to see the cosmetics of the lunar client or badlion despite the server is in online mode: false
How i can do that? pls help me guys
Lunar has an API
Rather, they have a messaging protocol and a Bukkit API to wrap around said protocol
smells like plugman
How do I insert it into my mc server?
?
It's a plugin. Drag and drop into your plugins folder, then have your plugin use its methods
thanks
intellij docs are really unhelpful, it defaults to gradle 7.3.3 for some reason and i cant find where to change it
Are you using a gradle wrapper by chance?
So I just put it on the real server?
Yes
how to log message without prefix?
ok thanks men
i am, i installed like gradle 7.5 but intellij doesnt agree
You can upgrade the wrapper via command line
./gradlew wrapper --gradle-version 7.5.1
tyty
I don't know if IJ will recognize that. It should. But that will at least upgrade the wrapper you're using
https://pneumonoultramicroscopicsilicovolcanoconiosis.club/uV0jbgrw
Anyone know why my gradle file wont find this?
?
Sorry, maybe I did something wrong but it doesn’t work.
Oh you're asking a completely different question than I thought. I thought you wanted to know what cosmetics a player had equipped via code
my school pc has 50gigs storage and its already half full lol
schools here give you a network drive with 10gb
that you can access with your user across all computers
it's absolute garbage lol
at least the EU-issued school laptops have like a 120gb ssd
lmao last time i saved smth on school pc, the next week it was gone
Also most friendly mobs don’t despawn
savning everything on my laptop now
What is causing this error and how can i fix it?
at me.gurwi.FiftyMagazzino.onEnable(FiftyMagazzino.java:115) ~[?:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:263) ~[patched_1.16.5.jar:git-Paper-794]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:370) ~[patched_1.16.5.jar:git-Paper-794]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:500) ~[patched_1.16.5.jar:git-Paper-794]
at org.bukkit.craftbukkit.v1_16_R3.CraftServer.enablePlugin(CraftServer.java:518) ~[patched_1.16.5.jar:git-Paper-794]
at org.bukkit.craftbukkit.v1_16_R3.CraftServer.enablePlugins(CraftServer.java:432) ~[patched_1.16.5.jar:git-Paper-794]
at net.minecraft.server.v1_16_R3.MinecraftServer.loadWorld(MinecraftServer.java:599) ~[patched_1.16.5.jar:git-Paper-794]
at net.minecraft.server.v1_16_R3.DedicatedServer.init(DedicatedServer.java:298) ~[patched_1.16.5.jar:git-Paper-794]
at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:1074) ~[patched_1.16.5.jar:git-Paper-794]
at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$a$0(MinecraftServer.java:291) ~[patched_1.16.5.jar:git-Paper-794]
at java.lang.Thread.run(Thread.java:829) [?:?]```
what's FiftyMagazzino line 115?
im a idiot i din't register the command
imagine not using a command framework
is there have any api to play music in minecraft with plugin??
World#playSound or Player#playSound
ofc it can only play music included in the resource pack, or builtin sounds
oh
there's also stuff like NoteblockAPI
it's basically like a cheap-ass version of midi files lol
but at least it doesnt require any resource pack
np
for (int i = 0; i < sityvebi.length; i++) {
System.out.println(i);
Player pingedPlayer = Bukkit.getPlayer(sityvebi[i]);
if (!(pingedPlayer == null)) {
pingedPlayer.getWorld().playSound(pingedPlayer.getLocation(), Sound.BLOCK_NOTE_PLING, 1, 2);
}
}```
What am i doing wrong? when i type someone's name only in chat like "GreenedDev" it sends me a sound but if i do "GreenedDev + text" it doesnt
why do you split the message by : instead of by space?
wait
uh
wtf
im dumb
thanks
np 🙂
also use Bukkit.getPlayerExact to get a player on name
I actually think the normal getPlayer is better here
why
e.g. people might just so "yo mfn where you at" and obviously they talk to me
its based on prev stored player names
I always required people to use @ to ping
what
I love how it autocompletes my own repo, since I always forget the url lol
too much cases