#help-development
1 messages Β· Page 661 of 1
Coll do you know if it would be possible to differentiate between sign text changing because of first open or an edit. I seriously can't think of a reasonable way to do this
https://hub.spigotmc.org/jira/browse/SPIGOT-7412?jql=text ~ "SignChangeEvent"
Based on where the event is called right now the answer is no, this wouldn't be possible to my knowledge
I assume itβs the same packet for both
yeah it is which makes me think that this PR is actually impossible to add
I don't agree with that change for an event to work
yeah I think I'm not going to do this one. Its not reasonably possible
Any good guides on setting up an action bar message for 1.20?
setting up? wdym by this
Is it possible to hide death messages only for certain players
You can remove the standard death message and then send it manually to certain players
Can you set an entity's name to a component?
not without NMS with spigot
pray for the components PR to be merged soon
If I did use nms, would keybind components be formatted as they're supposed to?
What components library are you using
Bungeechat? if so just serialize it into a string using the craft copmonents than you can just serialize it into the NMS component
I imagine keybinds work in entity names
Pretty sure they are just translatable components
Guh I'm struggling to find a graceful way to do this coll π
signs are officially a pain
is there an event for when a player gets /msg-ed
I don't think so you mighbt beable to utilize either AsyncPlayerChatEvent or if that doesn't work PlayerCommandPreProcessEvent since /tell is a command you can just steal their message from the command
?jd-s
yeah looks like you'll have to do what I said above
I'm having trouble figuring out how to spawn a fake player via ProtocolLib. I don't use NMS since I just don't want to bother with porting the plugin for each minor and major version.
The issue at hand is that, while the player info update packet does work (the fake player's name can be tab-completed), the spawn player (i.e. named entity spawn) packet does not do anything.
Most of the time I see people recommend just extending the player entity in NMS but, as I said, I'm trying to avoid NMS.
I am very new to this, so forgive me for my dumb question but how do I check if the item in hand is the custom item it should be? I am trying to develop a plugin in PaperMC
On another note, the text color of the custom item that was set using rgb seems to reset on player rejoining unless I use color coding in the string?
Ask in paper discord spigot isn't paper
okay thank you π
Hey, in order for a plugin message to be sent from the bungee to a spigot server, it must have received a message from that server beforehand, or not necessarily?
I still can't figure out how to specify what player corresponds to in onPluginMessageReceived(String channel, Player player, byte[] bytes)
What player corresponds to (how it is determined) because to send the message I do player.getServer.getInfo.sendmessagedata
So it sends the message to the server and not to the player.
onPluginMessageReceived(String channel, Player player, byte[] bytes)?
hi, i decompiled a bukkit plugin, fixed a bug with it (hopefully), and now i want to recompile it. but im running into an issue; i dont know how to import the dependencies listed in the plugin's code.
very new to all this but any help would be appreciated, i need to import the following:
/* */ import dev.sergiferry.playernpc.api.NPC;
/* */ import dev.sergiferry.playernpc.api.NPCLib;
/* */ import org.bukkit.Bukkit;
/* */ import org.bukkit.ChatColor;
/* */ import org.bukkit.Location;
/* */ import org.bukkit.Material;
/* */ import org.bukkit.entity.ExperienceOrb;
/* */ import org.bukkit.entity.HumanEntity;
/* */ import org.bukkit.entity.Player;
/* */ import org.bukkit.inventory.ItemStack;
/* */ import org.bukkit.plugin.Plugin;
how would i go about this? as of right now i literally only have decompiled .class files to go off of while trying to recompile this plugin.
So i need to pick my player object. Where i chose it ?
The player In
player.getServer().blabla.sendmessage()?
https://www.spigotmc.org/wiki/sending-a-custom-plugin-message-from-bungeecord/ here je just use player here (player.getserver)
im trying to save a bunch of custom recipe types to json files and both have itemstacks as their property, but now i dont understand why one recipe type is saving itemstacks like this(img1) while the other one does it properly like this(img2)
the confusing part is that both use the same itemstack type adapter, how could it be producing the first result to begin with? ItemStack{DIAMOND x 1} is obviously not valid json
one is json one is yml?
the type adapter is a ConfigurableSerializable adapter so it basically converts them to yml format
well the first image looks like you just called ItemStack#toString()
i just dont know how it could produce that ItemStack{DIAMOND x 1} bit because thats breaking it all
i didnt
like i said both use the same adapter
then could you also please provide where you added the adapter? I assume in the Valhalla recipes class
thats an interface so no
and heres the adapter itself
the only difference really between those types of recipes is that the one that goes wrong stores its ingredients like Map<ItemStack, Integer>
sorry, but idk what's the issue.
yeah lol
10 years have passed and i still have vague understanding of java
is it really that hard
should I be worried
no
its one of those things that are impossible to master
but you can still do pretty alright in the meantime
there's just always new things to learn
at some point things will just click and make sense
thats what I have been telling myself anyways /s
But It's okay to forget stuff right
It's human to forget sometimes
i sometimes have to google the most basic stuff
you cant keep everything in your head
nobody can
except autistic people
It's very hard to learn when you have adhd
all the dang time man
honestly intellij is very nice for me because it constantly reminds of you little improvements you can make
lol nah
use your adhd to your advantage
can confirm i never have to google anything ever
πΏ
but uh if anyone has an idea on why this happens please let me know
You said that it happens, when the itemstack is paired with an int in a map.
Why not set the integer value of the map to the count value of the itemstack and serialize it then?
because i need it to work with amounts higher than the allowed stack size
this type of recipe needs to be usable for things like 100 ingots or something
the only thing i can think of is that under the hood its calling toString() for map keys
Make an intermediate item that's like "compressed iron ingots" a 3x3 of 64 ingots and use those in your recipes
probably
Try calling enableComplexMapKeySerialization() on your gson builder
Otherwise keys support primitives/Strings/UUIDs only.
performance maybe
perfect, thank you so much!
lol
if only it were a pixel higher
i'd probably use like a diamond symbol or some other symbol but i couldnt be fucked
grrr yes
also i think its disabled by default because otherwise it would format it as a complex object which takes up a couple more lines
if it would be centralized yes
ik, it pains
eh, I think in this case the <> are a bit too much
looks weird
ye
looks fine
just that the inner text isnt centralized either
it was just a quick and dirty thing I threw together
If only it was possible to reliably center text in MC
"f.e."?
for example
ahh
count spaces
players can have resourcepacks that change font sizes is what I'm mainly talking about
thats their problem
String sql = "SELECT * FROM friendrequests WHERE sender = ?";
try (Connection connection = HikariCP.getConnection(); PreparedStatement statement = connection.prepareStatement(sql)) {
statement.setString(1, sender.getUniqueId().toString());
ResultSet resultSet = statement.executeQuery();
String receiverDb = resultSet.getString("receiver");
if (args[1].equalsIgnoreCase(receiverDb)) {
System.out.println(receiverDb);
}```,
for get variable from db
am i use .next method for resultset ?
and why ?
i can't do only resultSet.getString ?
next increments the cursor
depends, have no idea what you're trying to do
yes
if (args[1].equalsIgnoreCase(receiverDb)) {
System.out.println(receiverDb);
}
what is this supposed to do?
if args1 equals name in database do something
Is it possible to somehow get from TranslationComponent what language is translated into? Well, or get the text that will display to the player
you can get the player's locale using... surprise: Player#getLocale()
the text displayed to the user is not possible to get
it could be anything
also the server doesnt even have the default language packs
how do I use this? My goal is to translate the material into another language, and then from the resulting text, find out what text, and save it to a variable
getLocale only gives you en_US or similar
I see, if I only need to translate into one language, is it best for me to use some kind of translator?
Is it only for materials?
materials and entityType
I have this where you can load the client's translation file ( you gotta upload that to the server from the client's assets) and then it can translate materials, should be easy enough to do it for entitytypes too. https://github.com/JEFF-Media-GbR/JeffLib/blob/master/core/src/main/java/com/jeff_media/jefflib/MaterialUtils.java#L69
it currently still uses a weird way to turn a material name into a translation key but since 1.19.X, there's also getTranslationKey() for both material and entitytypes so you can use that instead of getMinecraftNamespacedName(Material)
Not quite understood, but what file should he insert? Like?:
yeah that's the one
Okay, thanks π
if (args[0].equalsIgnoreCase("accept")) {
String sql = "SELECT * FROM friendrequests WHERE receiver = ?";
try (Connection connection = HikariCP.getConnection(); PreparedStatement statement = connection.prepareStatement(sql)) {
statement.setString(1, sender.getUniqueId().toString());
ResultSet resultSet = statement.executeQuery();
while (resultSet.next()) {
String receiverDb = resultSet.getString("receiver");
String senderDb = resultSet.getString("sender");
if (sender.getUniqueId().toString().equalsIgnoreCase(receiverDb)) {
ProxiedPlayer playerDb = ProxyServer.getInstance().getPlayer(args[1]);
if (senderDb.equalsIgnoreCase(playerDb.getUniqueId().toString())) {
System.out.println("worked");
}
}
}```
i did this
but i have problem
if player is offline
not working
how do i solve this?
i store uuid in database
so for offline ppls need write uuid
Dont use proxied players if you want it to work for offline players...
but i don't wanna this
what can i use ?
for get offline player
Either use mojangs API or create a table String | UUID for last seen names.
Bungeecord has no OfflinePlayer like spigot.
well mojangs api not work for offline servers ? π
Ofc not...
I would not do that
why ?
You will need a Table String | UUID either way because
the user wont input a UUID
in my 1.19 server crystals only do 1 heart damage for some reason
on just spigot?
paper
?whereami
i will check sendername on command after i store senderuuid
is this bad ?
i was show on here
.
paper is build off of spigot
but it's not spigot
yes but we dont know wtf paper is changing, they have a discord too
π
and this would be the wrong channel either way
no but i use paper on another server as well and crystals are fine
did you stand directly ontop of the crystal when you received the damage?
yes
Or a random plugin messing with damage
i tried removing the plugin jars
mm cracked servers
is that a development question?
why i can't add reaction to ur message ?
probably because they blocked you
oof
you see there a question?
?
π¦
Is it safe to upload schematics to the world and also check the place where the structure will be loaded for the presence of a private in an asynchronous thread?
Depends
you can just fetch the chunksnapshot and do your stuff
FAWE supports async pasting but it's also seen as subpar
i have no FAW
just WG
WE
Then you gotta paste sync
well depends
i don't understand am i need uuid in offline server ?
or names is fine ?
hm
for what
if you do the Operations.complete thing it's still blocking
but you can call it in another thread
everything
names can change
i mean non premium minecraft server
cant help with piracy
but in offline server not can change
nah he's running a cracked server
im not
is that a fancy term for "cracked"?
Which is why he can't react to my messages because I block pirates :)
π yes
?paste
good bye
good idea
this is metods what i want use in ASYNC - https://paste.md-5.net/urovizopin.cs
@echo basalt i'm a filthy pirate
icky
clean that link
check - region https://paste.md-5.net/buropayowi.cs
icky that you're loading chunks
who decided that using that format to identify a file was a good idea?
oh wait
are those hex bytes?
you said it
icky is smth i would only expect from alex smh
Exactly. And this is a yucky if anything.
https://paste.md-5.net/eboqoviteg.cs - this schematicLoader
damn smile's bullying me
yikesy
MOOOM
gross of you
i deleted my offline projects
now im not working for offline
can u unblock me ?
sounds like copium
π
https://paste.md-5.net/koboluyuja.cs - spawnStructure mettod , https://paste.md-5.net/ejanoyixut.cs - schematicLoader, https://paste.md-5.net/ebebisamax.cs - checkRegion, https://paste.md-5.net/uqusekibol.cs - this is were i want use async .I can do Async paste?
how do you set an objective to multiple display slots?
you can do this normally in vanilla with commands
If you read the post it's a shady company
unless that's the one other dude
yeah it's the shady dudes
Also 60k/yr for a software engineer is (depending on where you live) an entry level payment. And a low one that is.
True
60k/yr is more than what most docs make here
Earning more than 15k/yr here makes you on the top 10%
o.O
15k/yr is trainee payment
I live in a 3rd world country full of dipshits
Don't we all
With 15k you would end up on the streets here... You cant get a single room for under 1k/month
15k is below minimum wage here
rooms here are like 700/mo
depends
in berlin there is no way you go under 700/month
If you come up to the conclusion that numbers don't add up
15k is not even 8$ per hour
Then you're write
but like saxony its actually cheaper
currently paying 400/mo in a 4 person appartment
Most people make below 4/hr
Well, looks like 90% eat toilet paper if they want a flat then?
No they just live with their parents until they get laid
and then they and their SO eat toilet paper
because you can't afford toilet paper by yourself
let me rephrase it.
I'm an appartment with 3 more people, each have a room and 2 people share a toilet. That's 400/mo.
Not a 4 person appartment just for me XD
Ah that makes sense
Ill stay with my dad until i got my masters. Dont feel like burning my money earlier.
Yeah i kinda get that
got 50$ in savings
?paste
I don't think I'd make it for a month
That's why I like the apprenticeship sysstem in germany.
You try to get a "spot" at a firm and then you work 3mo, study 3mo, alternating, while still getting a "full" pay each month.
You don't get "much", but definitely enough to life.
It's almost impossible to get rich in these days.
just get a job lol
will the logic be sufficiently synchronized if the location is checked for null in the spawn method of the structure
You'll work till you die
Thats what im doing next year
I make plugins for a living
Thing is I just blew like 300 bucks last night on some new glasses
this hobby
lol
doesnt sound like plugins make that much then
wdym for a living
It does
you live by your parents
So?
do you just sell premium plugins or work for people?
I live at their house
Im still in the process of fighting my way into Nvidia. 3rd interview comming up next week 
I don't live with them
so you do it as an extra
how math you can get money lol in this "jobe"
Good luck, hope you the best :D
commissions
freelancing
P much
right
nice
Nothing, I just hope you enjoy the work you do, then do what you like.
Your life, your decisions. Hope you don't overwork yourself and get burnt out from it.
i would love to get overworked
.-.
but i cant get to motivate myself
you dont
who is this person who creates contracts on minecraft servers lol
legit companies
just force your self to
contracts are common in the higher-end servers
buy twitter
easier said then done
Are there really big companies? I canβt perceive minecraft servers as a whole income
Let's just say I've made over 8k in a single month back when crypto was decent
how else did it become number 1 played game
especially if the income comes from donations
Hypixel? Mineplex (rip) or other?
Mine your Mind, FTB, etc.
its just like every other game or service
I want to get into hypixel honestly
each player is a potential customer
but most of my income isn't even from servers
you could live off a 50 player server if done right
I've done that
just like you could live off 50 viewers on twitch
be a business person
I know this old dude that plays marbles all day
sounds like a 1 in a billion
nah you just gotta build a marketing plan around yourself
yes, but people that make such a marketing plan are like 1 in a billion
you just need to know what you're doing
Maybe because we know what we're doing
Been doing this for like 6 years
At least half of my income comes from youtubers
you just need a huge number of players to earn so much on donations
welcome to any free to play market
if i change my username while on the server
do i have to log out of the server to update my name?
probably, you might even need to restart your client completely.
I think its like once a month
^
thanks a lot dude, made such a candy
where do you look for such people tell me)
they look for me
aight ty
how do i draw items with odds taken from config
np!
using rng
popular thing?
sure
its way more than that
prove where
burse
I'm just wondering where more uncles usually sit with their large servers and look for a plugin maker aha)
im a plugin maker
why would I leak the secrets and let competition in
well you have to be a good developer to begin with
lmao
Yeah
I want to disable dying using a boolean. I implemented it using the EntityDamageEvent.
Now I want to have seperate booleans to disable only damage by players or damage by anything BUT void.
How do I get the "but void" part done?
This is what i currently have (please ignore that noDeathPlayer is public without getter lmao):
If you know your shit people will come to you
I'm new, relax
then I assume you have to approach youur first clients yourself and then let them do the rest
At the start yeah
nah you gotta advertise yourself
publish yourself to the others
represent yourself
reach out to clients
do you want them to keep falling forever, or what?
No exact opposite.
Disable any damage EXCEPT void
To prevent the forever falling lol
I donβt think that this is enough for such amounts there is some kind of store site where this person is sitting, Iβm sure
There are multiple discord servers and teams
what are you talking about
Teams take cuts tho
youll have to build it up from nothing
man expects me to get all my projects from a single source
ok don't want to talk at least tell me where to start looking
you gotta network
lol i was blind and missed that somehow, thanks

start by building a portfolio
Is there a shop or something like that?
Nop
Just make a github portfolio
If you search "Spigot skyblock core" my project is in the first page
do spigot servers that want developers even still exist in 2023? lol
I have some github stuff like that minigame tutorial
Aren't like all servers these days on paper?
coding or just mini play
coding
oh i want see
Look for it then
and usually all sorts of tutorials in bukkit api are in githubs? Not for beginners but advanced
?
well then tell me how many years do you need for medium-high skill level
in bukkit api
like 3
individually
weird question
you cant just say i need 3 years to be at this point
But it depends
"how many hours do I need to play piano perfectly"
I'm 2 years old so far
I know people that have been doing it for a year with guidance
I've been coding for 12 years and doing spigot for the past 6
I look up to 7smile7 that has been doing java for like 3 years
i think they have exp for this
nah
Yo illusion, when you're on the topic of the minigame tutorial
Do you think you could expand upon how to work with the player states ?
And mainly how to correctly integrate it into the Game.
Also, how could I contribute to fix some code errors?
Yeah so for states
At least when I last used them
Each player state had a "kit" associated
And a kit is just a representation of items and potions etc
On TNT Tag, for example, the "bomber" was a state
@echo basalt
Goto bed XD
shush
and it becomes boring to do programming for so many years
yep
Anyways this isn't exactly clean because I was pretty underpaid
and the screenshot looks tiny ffs
Damn, your commit history looks alot better than mine XD
You can really see with mine where I have time and when I don't
this is bisnas
bisnes
business
Biznes
i rus
π
translate not worked
Anyways the player states end up looking pretty simple
Another thing is that the player state system on github is meant for multiple states per player while this one is just a single state
But you can easily tweak it to fit what you want
Does that answer your question?
okay, you have experience how did you deal with such a problem of abstract classes when there is a common logic for 2 classes but there is nothing else there is constructor and that's it
public class AthenaTalisman extends Talisman {
public AthenaTalisman(AbstractConfig config, double attack, double speed, JavaPlugin plugin, SchematicManager schematicManager, String fileName) {
super(config, attack, speed,plugin,schematicManager,fileName);
}
public AthenaManager getSettings(){
return (AthenaManager) config;
}
}
generic types
Is EntityDamageEvent.DamageCause.ENTITY_ATTACK the correct DamageCause for being damaged by any Entity including Players? (I know there's an event for that but that isn't viable in this case)
just constructor
No clue what your structure looks like
But what i've been doing lately which is kinda enterprisy is making an interface and an abstract implementation of it
So it could also represent like potion effects, teams, abilities and such.
My understanding from what I saw on github was that I could combine some simple states to create something more complex.
For example: a state that gives a player team (prefix, color...) and another state that makes them "invincible" with potion effects.
Uhh yeah you can make that
Error while importing Spigot Shaded Jar
Think of hypixel's bedwars, where you could apply an "invisible" state when they drink a potion
Ideally you only ever have 1 state managing the player's items
there is an abstract class talisman and there are 2 classes of heirs 1 has its own private method and class 2 has nothing but the logic of the abstract class. Empty class
otherwise things go boom
So what's the point of it
Explain the problem, what you got and what problem you're facing
they have a common logic
oh good
im doing wacky things with the anvil which requires me to set an experience cost to the anvil, without an experience cost the result becomes unclickable. im setting it to 3 and updating the player's inventory, but this is not working specifically on spigot. on purpur/paper this works fine
anything i can do to get around this issue?
Sounds hacky, I don't have an answer
i saw that Player#updateInventory() is marked unstable, could that be it
i hate how hacky anvil mechanics are in general
updateInventory just sends a packet with the player's inventory contents
you'd think that but that method was required to get it to work before, on paper/purpur this is still the case
spigot just decided to stop working
gdi
YamlConfiguration.loadConfiguration(...)
looool delaying the inventory update by 1 tick worked
bastard
stupid silly spigot
lmao
https://stackoverflow.com/questions/76858545/how-to-create-a-transforming-class-loader
yo anyone know the answer to this
Yeah I've done that before
basically how do i avoid this bullshit
You'd run all of your code inside of your class loader
ig but shouldnt there be a way for my custom class loader to just not load it again
if its already defined
public static ClassLoader transformingClassLoader(Predicate<String> namePredicate,
ClassLoader parent,
ClassTransformer transformer) {
return new ClassLoader(parent) {
@Override
public Class<?> loadClass(String name) throws ClassNotFoundException {
Class<?> klass = this.findLoadedClass(name);
if (klass != null) {
return klass;
}
this is what i currently have
I mean, it is too low in the chain. The fact that you have two classloaders responsible for a "shared" class is an issue
shouldnt this prevent my loader from loading it twice
or does this.findLoadedClass only work for classes from this loader
not for parents
oh nvm it does not check parents
Is there a good way to update an itemstack?
Its in an inventory of mine
I'm clicking it and the click is updating some of the inventory itemstack's item metas
And I need to close and open the inventory to see the updated itemmetas
I assume I'd need to get the updated item's and just remove and add them back quickly to see the updated itemmetas?
Though idk how should I do that since I'm doing it all in a for loop which iterates through the inventory's contents
ended up having to do this goofy shit
i think it should update automatically
how do you set an objective to multiple display slots?
can you send part of your current code
im pretty sure bukkit should automatically update the inventory
I'm going to try to run the code, I had a bit different code last time and it didn't, but I used configs and other shit, I'll try it and lyk how it goes.
aight
If you are having issues with inventory updating and its a player inventory you can use this
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/Player.html#updateInventory()
declaration: package: org.bukkit.entity, interface: Player
It's a custom inventory that I've created
With bukkit#createinventory
It should update automatically provided you change the itemstacks actually in the inventory
it's almost like you stole the code from me π₯²
Afaik they are mirrors
i change the itemmeta of theitemstacks
If that counts the same as what you meant
Well if anything you can always close and reopen the inventory to make it update. Or just add an item to a slot and remove it. Really anything to make it send another packet
Just doing setItem over the old item should work
I think what is happening is that fpr whatever reason item meta doesnt count in regards to the server as the inventory changing and thus the packet that is sent for routine update check isnt updating the integer to signify a change appropriately that is the only thing i can think of.
Could be a bug or something overlooked. May be worth making a jira ticket
?jira
Yeah that should work
Since that treats it as being removed and added
Are you including test classes?
it seems like it was an issue with junit
And as for it being loaded you do call newInstance
So i mean if you didnt want to load probably shouldnt call that? Lol
no i want to load it with a class loader
but fucking junit loaded it for no reason
with the app loader
Oh interesting
so now i have to test with public static void main
Well junit will load test classes in the test directory
oh true
ig
because nested classes wont be recognized as nested
lit
it works now

Now if only plugins loaded early enough to intercept most minecraft classes loading
Sadge
That would only be possible with some kind of wrapper
Or maybe some hacky reflection where you reload everything into a custom loader
You can already kinda do that by injecting shit
spigot runs stuff loaded through commodore
and iirc you can inject yourself there
terribly hacky shit
Currently I just runtime attach an agent and then retransform
Is it possible that chunks are loaded so quickly by the player that structures appear often with a chance of 0.00000001?!
ah, right, you inject a custom CraftMagicNumber instance
And then overwrite public byte[] processClass(PluginDescriptionFile pdf, String path, byte[] clazz) {
in there
Does that run for minecraft classes
Ye thatβs what I figured
Just need to move spigots plugin loading to super early in the server startup
Sadly that would break plugins using onLoad and expecting stuff to already exist
I mean, if you ever want to support that
just support mixins
but eh, supporting mixins is a dangerous game
I mean loading before the server thread is spun should be before any classes are loaded
Actually youβd have to go before datapacks are loaded too
Yea but how are you going to modify the already existing classloader ?
Like, that classloader is constructed by the bundler's main method and contains all libraries and the server jar in the versions dir
I mean I already doing some hacky injection into it
It would at least prevent the need to runtime attach
Or well, prevent the need to reload
It would also allow injecting into registries without hacky unfreezing
1.12.2 doesnt have colored panes in the material enum?
1.12 probably uses damage values
help there is an asynchronous method for the appearance of a structure with certain conditions. Everything happens through the chanck load event, but even with a chance of 0.00001, the dungeon appears very often
in all these bullshit versions it's just STAINED_GLASS_PANE with a random number between 0 and 15
:/
The best part is that stained glass panes didn't support the MaterialData API
is there a way to know what number each color is though?
Nope. Gotta do it manually
You can maybe get away with DyeColor but iirc there were some blocks that weren't the same as others
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/DyeColor.html#getWoolData(), but again, don't know if it's 1:1 with glass
it is
alr ty
\o/ You're in luck
getWoolData was already deprecated in 1.8 kek
kid me remembered all the item ids
and hated when commands stopped supporting them
looking back flattening was such a QoL improvement
wool:14
never seen that before
Let me guess your map manager class also looks like this? https://paste.md-5.net/canekumono.cpp
hi , how i can update inventory items for an offline player?
is there a better way to use libraries from jitpack other than shading/shadowing it to jar?
ah no, it's different
i don't have a map manager
52 my beloved
137
122
lol, I have a class specifically for matching dye colors with chatcolors and block colors of all sorts
which I mostly used for team based minigames
how do i make CraftItemEvent understand that i am taking items with a shift, not just 4 pieces?
does anybody know?
simply check if the player has that permission?
player.hasPermission("plugin.something.*")
yea but that would only work for my plugin? Not for others.
Do you know how it's done though?
yes I dev GroupManager
Could you by any chance link me to some resources or explain if you have time?
it depends on what exactly you are doing
you will not get wildcards to work through Player#has without some ass reflection
I see. Is there anywhere that has some info on how that's done? I imagine I have to somehow override the permission check and manually check?
How do you do it then?
look at LP source if you want to do reflection of permissible
Alright, thanks
How to disable the display of nicknames when autocomplete in a chat without a command?
For all commands or just the ones you've created?
Cause you could always just return an empty list if you don't want anything to show up
I just need to be able to tap nicknames in a chat without commands
any suggestions?
idk, have a pdc boolean toggle on the player?
pdc?
?pdc
ah... hm, idk tbh
Yes but since there is no way to get the current conversations a Player is in rn I can't cancel the previous conv directly
So make it possible to get the current conversation ?
I don't think I will be able to answer such a "vague" question sry.
Ok so i'll just store the convs somewhere, ok
I hoped for the conv api to have something useful (like cancel itself when the player executes a command)
Hello, small question, what is the PacketPlayOutEntityDestroy Packet in NMS 1.20.1?
?switchmappings
Thanks
I have a per-player scoreboard in 1.8.8 spigot, however I also want to have custom display name in the nametag position of the player (using teams?).
Is there an efficient way to do that? I don't want to register teams for all per-player scoreboard and assign all players to a team on all scoreboards.
Hypixel for example has per-player scoreboards and also has custom player nametags.
So you want custom names without having to write teh code to do it in Teams?
Nono, I can write the code using teams if that's the correct way, but with per-player scoreboards doesn't that use a lot of resources?
Ranks * Players teams to register.
Players ^ 2 players to assign to teams.
On player join I'd have to edit add the player to a team on all player scoreboards as well
Sorry, Can we make our 1 plugin support multiple versions?
For example, 1.17.x - latest
yes
not sure how "latest" is gonna work for you because in the future some things may not work
but yes, you can support multiple versions in one jar
yeah, just use the lowest version as your api version
if you have nothing special in it it should work right away for any higher version
That means in plugin.yml I'm using api ver 1.17. Like that?
Is there no need to use other supporting files?
Why doesn't this working?
@EventHandler
public void onClick(InventoryClickEvent event) {
if(event.getWhoClicked() instanceof Player){
NMShelpers NMShelper = new NMShelpers();
Player player = (Player) event.getWhoClicked();
ItemStack currentItem = event.getCurrentItem();
int chosedSlot = event.getSlot();
int mainHandSlot = player.getInventory().getHeldItemSlot();
if(!currentItem.getType().isAir() && chosedSlot == mainHandSlot) {
ItemMeta a = currentItem.getItemMeta();
a.setLore(Arrays.asList("ABC", "DEF"));
currentItem.setItemMeta(a);
System.out.println("READY");
}
}
}
The condition is triggered, but the lore of the item does not change
set the current item to yours
How?
event.setcurrentitem
?paste
i think
even this doesn't working
@EventHandler
public void onClick(InventoryClickEvent event) {
if(event.getWhoClicked() instanceof Player){
NMShelpers NMShelper = new NMShelpers();
Player player = (Player) event.getWhoClicked();
ItemStack currentItem = event.getCurrentItem();;
int chosedSlot = event.getSlot();
int mainHandSlot = player.getInventory().getHeldItemSlot();
if(!currentItem.getType().isAir() && chosedSlot == mainHandSlot) {
ItemMeta a = currentItem.getItemMeta();
a.setLore(Arrays.asList("ABC", "DEF"));
currentItem.setItemMeta(a);
event.setCurrentItem(currentItem);
System.out.println("READY");
}
}
}
@EventHandler
public void onClick(InventoryClickEvent event) {
if(event.getWhoClicked() instanceof Player){
Player player = (Player) event.getWhoClicked();
ItemStack currentItem = event.getCurrentItem();;
int chosedSlot = event.getSlot();
int mainHandSlot = player.getInventory().getHeldItemSlot();
if(!currentItem.getType().isAir() && chosedSlot == mainHandSlot) {
ItemStack item = player.getInventory().getItem(chosedSlot);
ItemMeta itemMeta = item.getItemMeta();
itemMeta.setLore(Arrays.asList("A","B"));
item.setItemMeta(itemMeta);
System.out.println("READY");
}
}
}
This too isn't working, condition triggered but the lore of the item didn't change
Try setItem at the end
Still doesn't work
YEAH IT'S TOOOO WEIRD
I didn't have any problems with that last time i did something like this
what packet am I looking for if I want to fake an entity?
Several
Mainly you need the spawn entity packet
And then the entity meta packet to change anything about it
hmmm
It dosent send anything in the console and i dont get a title ingame
@EventHandler
public void onPlayerDamage(EntityDamageByEntityEvent e) {
Entity victim = e.getEntity();
Entity attacker = e.getDamager();
if (e.getCause() == null) return;
if (!(victim instanceof Player && attacker instanceof Player)) return;
Player victimPlayer = (Player) victim;
Player attackerPlayer = (Player) attacker;
ItemStack attackerWeapon = attackerPlayer.getItemInHand();
Material weaponType = attackerWeapon.getType();
if (attackerPlayer.hasPermission("Vagt") && (!(victimPlayer.hasPermission("vagt")))) {
System.out.println("1");
if (weaponType != Material.STICK) return;
System.out.println("2");
if (attackerPlayer.getItemInHand().getItemMeta().getDisplayName().equalsIgnoreCase("Β§aSTICK")) {
System.out.println("3");
if (attackerPlayer.getWorld().getName().equalsIgnoreCase("A")) {
System.out.println("4");
victimPlayer.addPotionEffect(PotionEffectType.BLINDNESS.createEffect(100, 1));
}
}
}
if (attackerPlayer.hasPermission("Vagt") && (!(victimPlayer.hasPermission("vagt")))) { how would this pass, wtf even is this
What do you mean?
as far as I am aware of, permissions are always lowercase and the both are the same permission, but you are checking if one is true and the other is false
Okay it have changed it to this now, and the point is i am checking if the attacker has permission "vagt" and the victim dosent becuase if both have permission vagt i am going to cancel the event, i havent just done that yet i will fix this before im going to the next thing
if (attackerPlayer.hasPermission("vagt") && (!victimPlayer.hasPermission("vagt"))) {
ah, didn't notice they're different players, sorry. But it was weird to have a permission with uppercase and also to have a permission without having the plugin before it, like myplugin.mypermission
Good night chat
Sorry but i dont understand what you mean with having the plugin before with myplugin.mypermission
?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.
No thatβs correct
How do i fix this, it says that it is always true and false
boolean attackerPermission = attackerPlayer.hasPermission("vagt");
boolean victimPermission = victimPlayer.hasPermission("vagt");
if(victimPermission && !attackerPermission){
sender.sendMessage(new TextComponent(ChatColor.of("#FF3600") + "\uE002 Kendine arkadaΕlΔ±k isteΔi gΓΆnderemezsin!")
this is my full code
something wrong ?
wdym
i can't use hex color codes
here?
wut ?
Idk bout hex but ill try to figure it out hol up
^
Also I recommend the component builder
what is this ?
oh wait
i know
quick question, do all events that can possibly (naturally) move items into or out of a player's inventory part of InventoryEvent?
No
well, I think you can get items besides clicking an inventory loll
i mean itemstacks
welp, time to read through all even remomtely related events lol
i want to block specifically tagged items from entering or leaving player inventories
π
alright i know that aint a good idea
that'd work for not picking items up
but not from blocking them from leaving
i really doubt i can tell minecraft 'hey delete itemstack with this uuid'
you can hold a reference of the old inv
different problem, related to project
i need to figure out both
my idea was to just get a list of all events that could move itemstacks and work on those
but i am pretty sure I'm not remembering all ways you could do that
Click, drag, drop, pickup
what about the number keys?
Those are part of click
ah
if i had any hair id be ripping it out rn
only some custom unicode characters decided to just stop working
real
and i have no idea why
java source code doesnt support unicode iirc, maybe thats the issue
i do remember it replacing ascii-8 characters with ?
got my default.json here and the top one doesnt work while the bottom one does
Check client logs for any errors
?
Unable to load font 'minecraft:default' in fonts.json in resourcepack, guess that would be it
but why
Is there anything else
this
Easily broken by a catered bot. Would need to have random test intervals. Also wouldnt this create a snapshot of inventories every time the scheduler runs?
i wish there was more documentation on resource packs because you really cant find anything
Not much I can tell ya other than make sure everything is setup correctly
And that the png is correct
png has a size limit
Does anyone know how to fix this?
Thats a common problem
The error points to that file, but doesnβt seem to say anything about why
And use lower range unicode chars
Use the private block
the pngs are 176x137 which i think is fine
Actually that is in the private block so itβs fine
and they worked like an hour ago as well, its a specific range of menus that just suddenly doesnt work any more
Well you must have changed something
i didnt touch them ever since i got them working so idk
ill check it out later
maybe i just gotta restart my pc or something
Anyone?
whats the issue
It is always true and false
because thats the if statement
So what should i do to prevent it?
@young knoll I'm curious if you know the policy on this for Craftbukkit. Essentially for one of my changes to the code I
need to wrap some NMS code that returns a boolean in an if block how would I comment that for CB example below
Normal Call:
this.nmsMethod(() -> {
// operator
}, boolean);
// rest of logic
Modified Call
if(this.nmsMethod(() -> {
// operator
}, boolean) {
// craft bukkit logic here
}
// rest of logic here
like wonder do I have to wrap the entire if statement in craft bukkit comments or can I do a one liner?
glass
Why dosent it send anything in the console or give me blindness?
boolean attackerPermission = attackerPlayer.hasPermission("vagt");
boolean victimPermission = victimPlayer.hasPermission("vagt");
ItemStack attackerWeapon = attackerPlayer.getItemInHand();
Material weaponType = attackerWeapon.getType();
if (attackerPermission && !victimPermission) {
attackerPlayer.sendMessage("You hit " + victimPlayer.getName());
System.out.println("1");
if (weaponType != Material.STICK) return;
System.out.println("2");
if (attackerPlayer.getItemInHand().getItemMeta().getDisplayName().equalsIgnoreCase("Β§aSTICK")) {
System.out.println("3");
if (attackerPlayer.getWorld().getName().equalsIgnoreCase("A")) {
System.out.println("4");
victimPlayer.addPotionEffect(PotionEffectType.BLINDNESS.createEffect(100, 1));
}
Probably the whole thing
adding proper BlockState support to SignChangeEvent is a real pain in the ass. This event is broken as hell and it seems no one noticed, outside of people not liking the fact it doesn't support color
setPlayerListHeaderFooter(ChatColor.BOLD + "" + ChatColor.of("#7B12ED") + "Welcome to My Server", "Have fun playing!");
How would I make the text both bold and colored, I thought it was this but its not working
Bold after color
oh ok
Also you can remove the + ββ and just toString one of them
So could anyone help me? Please, i don't know what's wrong
@EventHandler
public void onClick(InventoryClickEvent event) {
if(event.getWhoClicked() instanceof Player){
Player player = (Player) event.getWhoClicked();
ItemStack currentItem = event.getCurrentItem();;
int chosedSlot = event.getSlot();
int mainHandSlot = player.getInventory().getHeldItemSlot();
if(!currentItem.getType().isAir() && chosedSlot == mainHandSlot) {
ItemMeta a = currentItem.getItemMeta();
a.setLore(Arrays.asList("ABC", "DEF"));
currentItem.setItemMeta(a);
event.setCurrentItem(currentItem);
System.out.println("READY");
}
}
}
The condition is triggered, but the lore of the item does not change
Yep
@EventHandler
public void onClick(InventoryClickEvent event) {
if(event.getWhoClicked() instanceof Player){
Player player = (Player) event.getWhoClicked();
ItemStack currentItem = event.getCurrentItem();;
int chosedSlot = event.getSlot();
int mainHandSlot = player.getInventory().getHeldItemSlot();
if(!currentItem.getType().isAir() && chosedSlot == mainHandSlot) {
ItemStack item = player.getInventory().getItem(chosedSlot);
ItemMeta itemMeta = item.getItemMeta();
itemMeta.setLore(Arrays.asList("A","B"));
item.setItemMeta(itemMeta);
System.out.println("READY");
}
}
}
@EventHandler
public void onClick(InventoryClickEvent event) {
if(event.getWhoClicked() instanceof Player){
NMShelpers NMShelper = new NMShelpers();
Player player = (Player) event.getWhoClicked();
ItemStack currentItem = event.getCurrentItem();;
int chosedSlot = event.getSlot();
int mainHandSlot = player.getInventory().getHeldItemSlot();
if(!currentItem.getType().isAir() && chosedSlot == mainHandSlot) {
ItemMeta a = currentItem.getItemMeta();
a.setLore(Arrays.asList("ABC", "DEF"));
currentItem.setItemMeta(a);
event.setCurrentItem(currentItem);
System.out.println("READY");
}
}
}
That's what i tried
try doing a player.updateInventory() afterwards
Can someone please help?
well there are no events for that, so not sure how they couldn't work
How do I make 2 lines in the playerlist?
if that is a players name then you can't, unless it is in your own command
PlayerChatTabCompleteEvent
TabCompleteEvent
those are for commands
well one of them is, the other is clearly deprecated with a message saying it no longer works
I need no commands, just hide the players from there or change the nicknames there, my game is concluded on this that no one knows the nicknames
Both of these events do not work
Player#setCustomChatCompletions() should help you.
those events are for your own commands
it doesn't clear the player name completion
those are added by the client
you can hide all other players, and so the client won't suggest any names
They can be removed in commands though? Just pass in an empty array list.
I wonder if you could also prefix each player's game profile name sent to a client with like a legacy color code that's invisible to prevent name matching
how i can do this
in commands, not in regular chat
Sounds like a bug.
no
The client do what it do
In "intellij idea" i use the "Minecraft Development" plugin, but i cannot find the 1.8.8 minecraft version... where do i find that?
you find that in 2015
1.8 is ancient
Why dosent it send anything in the console or give me blindness?
boolean attackerPermission = attackerPlayer.hasPermission("vagt");
boolean victimPermission = victimPlayer.hasPermission("vagt");
ItemStack attackerWeapon = attackerPlayer.getItemInHand();
Material weaponType = attackerWeapon.getType();
if (attackerPermission && !victimPermission) {
attackerPlayer.sendMessage("You hit " + victimPlayer.getName());
System.out.println("1");
if (weaponType != Material.STICK) return;
System.out.println("2");
if (attackerPlayer.getItemInHand().getItemMeta().getDisplayName().equalsIgnoreCase("Β§aSTICK")) {
System.out.println("3");
if (attackerPlayer.getWorld().getName().equalsIgnoreCase("A")) {
System.out.println("4");
victimPlayer.addPotionEffect(PotionEffectType.BLINDNESS.createEffect(100, 1));
}
Yes, i hear that everytime, but i still run my server in 1.8, so i still need to find it
well the intellij plugin does simply not support that version
youll have to find another way
Yes, that is what i am asking for, where do i find that...?
I have no clue sorry
Hmmm, okay, i will keep searching
my item gone missing
Im trying to use placeholder api in my plugin and I copied the things in the github but it says "Cannot resolve method 'warn' in 'Logger'
public void onEnable() {
getServer().getPluginManager().registerEvents(this, this);
if (Bukkit.getPluginManager().getPlugin("PlaceholderAPI") != null) {
/*
* We register the EventListener here, when PlaceholderAPI is installed.
* Since all events are in the main class (this class), we simply use "this"
*/
Bukkit.getPluginManager().registerEvents(this, this);
} else {
/*
* We inform about the fact that PlaceholderAPI isn't installed and then
* disable this plugin to prevent issues.
*/
getLogger().warn("Could not find PlaceholderAPI! This plugin is required.");
Bukkit.getPluginManager().disablePlugin(this);
}
}
ty
[ERROR] Could not load 'plugins/SharedHealth.jar' in folder 'plugins'
org.bukkit.plugin.InvalidPluginException: Abnormal plugin type
at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:83) ~[spigot-api-1.20.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:145) ~[spigot-api-1.20.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:394) ~[spigot-api-1.20.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:301) ~[spigot-api-1.20.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_20_R1.CraftServer.loadPlugins(CraftServer.java:433) ~[spigot-1.20.1-R0.1-SNAPSHOT.jar:3853-Spigot-3bce793-d91e5aa]
at net.minecraft.server.dedicated.DedicatedServer.e(DedicatedServer.java:219) ~[spigot-1.20.1-R0.1-SNAPSHOT.jar:3853-Spigot-3bce793-d91e5aa]
at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:973) ~[spigot-1.20.1-R0.1-SNAPSHOT.jar:3853-Spigot-3bce793-d91e5aa]
at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:304) ~[spigot-1.20.1-R0.1-SNAPSHOT.jar:3853-Spigot-3bce793-d91e5aa]
at java.lang.Thread.run(Thread.java:1589) ~[?:?]
Caused by: java.lang.InstantiationException: sharedhealth.sharedhealth.SharedHealth
at java.lang.Class.newInstance(Class.java:678) ~[?:?]
at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:79) ~[spigot-api-1.20.1-R0.1-SNAPSHOT.jar:?]
... 8 more
Caused by: java.lang.NoSuchMethodException: sharedhealth.sharedhealth.SharedHealth.<init>()
at java.lang.Class.getConstructor0(Class.java:3641) ~[?:?]
at java.lang.Class.newInstance(Class.java:665) ~[?:?]
at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoade-
What i do rong?
Seems like you have a constructor in your main class
I'm trying to add placeholders to the player list and when I add
headerText = PlaceholderAPI.setPlaceholders(event.getPlayer(), headerText);
underneath the strings for the player list lines, the plugin stops working
what?
Check your plugin.yml
that exception doesnt have anything to do with plugin.yml
Oh mb, I forgot to register event
instead of registerEvents(this, this), I typed registerEvents(this, plugin)
Except i was using my main class
so I got a bit confused
but I fixed it now
try{
config.set(path,value);
config.save("config.yml");
} catch (IOException exception) {
exception.printStackTrace();
}
``` Does this save a change to the default config? I'm looking at <https://www.spigotmc.org/wiki/config-files/>
should work, not sure if that is in the correct directory though, I would use:
config.save(new File(getDataFolder(), "config.yml"));
if its config.yml why not JavaPlugin#saveConfig
yeah its just a general example, so yeah for the config that will work
public void crafting(CraftItemEvent event){
Player player = (Player) event.getWhoClicked();
ItemStack itemStack = event.getCurrentItem();
if(itemStack == null){
return;
}
if(DataManager.getPlayerQuest().get(player) != null){
Quest quest = DataManager.getPlayerQuest().get(player);
quest.updateCompleted(QuestType.CRAFT, itemStack.getType().toString(), itemStack.getAmount());
}
}```
How can I find out how many items a player has crafted? (taking into account whether he pressed the shift, etc.)
thanks
hey how i can use async loop metod?
async loop metod?
Scheduler?
to do what
asynck loop stream
async
async stream with loop logic
how repetedTask but async
i try spawn structrure
but i have list
undestood?
new Thread(() -> {
for(Thing thing : myThings) {
// awesome async loop
}
}).start();
i want to run this method in an asynchronous thread CYCLING
- translate
u can read this
thf
Hi hello
Developing plugin for 1.20.1 (Spigot)
How the hell do I get docs in here
I'd really love to see this in IntelliJ
download javadoc jar
idk where the button is tho, somewhere in the maven tab or somethin
might be in the double shift menu
press shift twice, then download sources and documentation
I swear to fuck
I have done that and it did not work before
I-
I apologize for wasting your time
I opened Team class and clicked the button and it just automagically worked
ty anyways XD
it sometimes takes a while or sth, idk lol
ok I'm gonna ask another question about libraries: is it fine if I shaded my lib without relocation? like is it gonna break other plugins that uses the same library?
i kinda missed the jar-in-jar thing from fabric
anyone knows how can i get a list of Player (or OfflinePlayer) from a luckperms group? (luckperms support is very slow to respond unfortunately)
You could probably get a Set of UUIDs with which you could convert to OfflinePlayer with Bukkit#getOfflinePlayer()
that is fine too, the problem is how
Is there something buggy with cancelling chat events with bungeecord api? I have a plugin that cancels the ChatEvent however when the player next sends a message that isn't cancelled they will be kicked for having an unsigned chat
And you can get a Group object rather simply with LuckPerms.getGroupManager().getGroup(groupName);
Very possible. Signed chat messages makes it very difficult to cancel messages
Ah, yikes
If you've installed it properly then you should just be able to refresh your project and it should work fine
i did that
Though there's also a Lombok plugin iirc that makes things a bit nicer
i installed using https://projectlombok.org/p2
thanks
I would try using the downloadable installer then if the plugin repo didn't work
Double click that .jar file and it will try to find your Eclipse instances. If it can't find them, point to it yourself
Would there be another way you would suggest to stop messages from being sent occationally?
Not sure. I've not worked much on proxies enough to know how to resolve it
Does anyone by any chance know?
even if you have 100k players, what you're saying is gonna be a few tens of MB at worst
I would be more interested in your approach to get to that player count in the first place π
easy. everyone who joins has to bring at least 2 friends
they in turn also have to bring 2 friends
etc
pyramid scheme
no you only need ONE player, which can be yourself
and boom you got infinite players
'You know what Toby. When the son of the deposed King of Nigeria e-mails you directly, asking you for help, you help!'
Season 2, Episode 19 'Michael takes the Dunder Mifflin employees ice-skating to celebrate his birthday.
Streaming now on Peacock: https://pck.tv/3mPrdWB
Watch The Office US on Google Play: http://bit.ly/2xYQkLD & iTunes http:...
how to check when a anchor explodes a blockl
?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.
Entityexplodeevent and blockexplodeevent.
why main is null?
For anchor i think is blockexplode event



