#help-development
1 messages ยท Page 659 of 1
https://paste.md-5.net/kibeliwifa.cs
But i'm getting "A fatal error has occured"
Why is that?
The sql says that the user is not even set
post teh full error
its a switch default case
yes but its not set
but the code sets it
plugin.language.setPlayerLanguage(player1, "en");
isnt working
I dont know why.
no, its saying the language for that player is not en or sp
what im saying that it is not set
this is not the uuid
this is my other account
idk why its not set
add some debug to see why. perhaps teh player name adn the language it says it is
line 53 of your Language class
add some damn debug
so what language does it say?
it doesnt say any
it doesnt say anything
but it works for my alt
which doesnt make sense
well your sql in the setPlayerLanguage is invalid
?
you read FROM Players.PlayerData buty write WHERE PlayerData.
ohh
INSERT INTO PlayerData (UUID, Lang, Player_ID, Online) VALUES ('982a8088-af48-4b7e-a06e-3ac2e079cccd', 'en', NULL, '0')
line 24 of Language
yes ik
update is correct, but msot of teh rest is wrong
public void setPlayerLanguage(Player player, String s) { try (Connection connection = plugin.sql.getConnection()) { PreparedStatement insertStatement = connection.prepareStatement("INSERT INTO PlayerData (UUID, Lang, Player_ID, Online) VALUES (?, ?, NULL, '0')"); insertStatement.setString(1, s); insertStatement.setString(2, player.getUniqueId().toString()); insertStatement.executeUpdate(); } catch (SQLException e) { throw new RuntimeException(e); } }
you don;t want to INSERT if data already exists
it doesnt
if (plugin.language.getPlayerLanguage(player1).isEmpty()) {
ill add a new class calld updateLanguage
later
if data is already in sql you don;t want to insert
yes ik
ok
you didn;t listen at all ๐ฆ
I did!
the data is not in mysql
so im just setting it
if I update it it will just return an error
you are also creating your statement inside your try/catch not in the try with resources
try with resources?
try ( resources here) { blah
you only define teh connection there
you should do both connection and statement
but im going to be using it multible times so it will save duplicates
doesn;t matter
i cna make it throw an exception?
in a try with resources you put all your closables in the ().
You don't mind if I ask something real quick?
everythings working thanks ElgarL!
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
Ok then
Does Bukkit/Spigot API support commands with spaces?
In other words, is server capable of recieving full command-line issued by player, not just args so the ' ' characters aren't reduced?
- I issue the command:
/some-command "Many Spaces" - Using
onCommandfromCommandExecutor, I am only able to recreate/some-command "Many Spaces"
Here's my code
@Override
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
String cmdLine = label + " " + String.join(" ", args);
plugin.getLogger().info(cmdLine);
return true;
}
Significant spaces are gone, but I need them.
No but you can use arguments to get the same result
oncommand:
command = hi
if (args.length == 1) {
if (args[0] == "test") { do stuff }
}
the command would be /hi test (args[1...])
Sorry, I don't get it
use arguments to substitude for your command args[0]
why do you want to do this anyway?
because I input json into my command
huh?
you know the vanilla /data command?
yea
/data modify block ~ ~ ~ something set value "2spaces "
Wait for ElgarL to get back I dont understand what youre saying
only the inital command is registered (no spaces)
anything typed after is in the args[] array
best not to use label as that is the command as typed and not the command that was registered. It may be the alias
IKR
What do you want to do with the json?
being able to deliver it to server with all the significant spaces in it.
I know one way to do it but it's ugly.
I just hold writable_book and then run the command and then the command handler looks into my hand and reads book contents
https://paste.md-5.net/kudajikalu.java
@eternal oxide rate this 1/10
then cmd.getName() or whatever it is..
then as you did... if (args.length > 0) String.join
I forgot what cmd.getName() does but I remember that it didn't do the thing for me
lobbyJoin=&e&l{Player} has joined the lobby!
lobbyQuit=&e&l{Player} has left the lobby!
it gets teh registered command name
I guess so
My bad
cmd.getname returns the command that was executed's name
its only useful if you have multible commands in the same class
Thanks, but again, this is not what I need
what do you need?
I'm using Bungeecord how to make warps for players to jump servers?
Being able to receive /a b instead of /a b on my Bukkit server
Bungee has no clue what worlds or Locations are, it only knows servers
you can use plugin messaging channels to send a player between servers
args wil have empty elements for extra spaces
Wait what. I'mma check that
Anyone know a good way to allows players to sleep in the day or play the sleep animation screen to a client? Most of the stuff out there I am seeing is related Protocol Lib using the removed Bed packet.
never expected to be using decorators in spigot
that's up to a plugin to handle it
just considering since you asked in paper help server
String.join passing args and a space delimiter should add in teh correct number of spaces
but here we are
lets see it :P
beautiful
can u tell me a plugin that works? I have tried seragate but it doesnt work
no clue, but server questions belong in #help-server
shit it's 5am
yep
gotta be up at 3pm
well 4:30
I'm up with my doggie. She's old and unwell so I'm chasing her around with kitchen roll to clean up her puddles.
d o g e
sometimes I wonder why I'm about to visit the states to visit like 2 people if I can just fly to the uk and visit half this server
because we have roller coasters
Yeah, but the US its better ๐
clown
like, we have a ride where its on a pendulum
You're wrong
I checked that
and it seats like 50 people in a circle
so?
and it spins as it goes back and forth on the pendulum and then it does a whole turn around the top
We have those here
but for 16 people
I am? it should preserve spaces
it's ran by this family of gypsies that travel around the country and creaks all the time
so you are spinning while upside down while some 150ft in the air XD
this ride also operates at night too ๐
For some reason it doesn't work, ElgarL. Idk if it matters but I am using Forge 1.14.4 client + Optifine. Also my server is Bukkit, not Spigot
you can if you incorporate the spaces into the subcommand
it can;t be trailing spaces. has to have text at the end
they may not be special but its done better ๐
you just have to try to the American ones
pov: you are dedicated:
settings.addEnchantment(Enchantment.DURABILITY, 1);
itemmeta.setDisplayName(plugin.language.getMessageByLanguage(plugin.language.getPlayerLanguage(player), "serverSelector", player));
List<String> list = new ArrayList<>();
list.add(plugin.language.getMessageByLanguage(plugin.language.getPlayerLanguage(player), "serverSelectorOpen", player));
settings.setItemMeta(itemmeta);
return settings;
pov: you don't know oop
spigot is built on top of bukkit, and for all intense and purposes unless you are using some fork spigot is pretty much bukkit
intents*
since no one but spigot is updating bukkit

but yes you are right lol
yeah can't do anything about that till the end of the week
I am not broke, but some things didn't line up like I wanted them to, spending will continue at the end of the week keep within budget
I went gambling on the lottery
๐
I plan to throw down some more on it XD
its over a bil right now
how much did you waste
like $500
but I won some of it back though, so it came out to like $200 wasted
because my homie accidentally threw a water bottle at my face and they brokey
if I win, I will give you a mil
dont you love intellij
I was going to spend more then that, but I decided not to. Also I couldn't pull money out fast enough either to do so
which is probably good
Got the 5am munchies time to make a cheese pizza
Family's asleep with all the doors open
Jesus christ, the way it works is confusing. I was wrong, you were right
hi bro
i will store player's server options
like toggle teleport requests or friend requests
players can always turn this off and on
this one is constantly querying the database, does this cause lag?
High risk high reward
oh yeah, but its worth it sometimes though
as long as you don't spend more then what you will get
are you part of the 99 or 1%
more like the 30% at the moment
no one has won 31 drawings in a row
however a lot of us have won by having some matching numbers including power ball
Wait, no. We both were wrong. It only preserves spaces when I run command via terminal
thats how I got some of my money back ๐
I should probably introduce Alex to American lottery
Y'all got too much moneys
u guys not sleep ?
in new zealand lottery money goes back to the community so in a way its not that bad gambling
Nah
in the US, all proceeds go to Education that isn't given to those who win
Makin pizza rn
yet the education isnt that good is it
well it depends on the lottery
well can u reply my question ?
the one that is at a bil is the mega millions, and that is split between like 6 or 7 states
I should make a DirtyMap collection for database use
only if you running queries on the main thread. As long as you are not, it won't cause lag on the server, but teleport requests could get slightly delayed which is perfectly fine
๐
and it depends. Education is a huge department that encompasses multiple levels of education
How all that money is split up I don't really know as I haven't looked at the ledgers for the various departments etc nor do I really have an interest to really go do that
mainly because I have to schedule a time to go do that
`if (Objects.requireNonNull(event.getItemDrop().getItemStack().getItemMeta()).getDisplayName().equals(Objects.requireNonNull(plugin.items.settings(event.getPlayer()).getItemMeta()).getDisplayName())) {
}`
any better way to do this?
comparing itemmeta doesnt work
?pdc
probably not using requirenonnull when you don't have control over something being null
ty
really wish intellij would stop recommending using that
and some other things
its not that those things are not useful, but they are only useful in certain things and if you don't know what they really do or how it exactly works its best people don't touch it. not even sure why IntelliJ's IDE started recommending the use of these Java API's either
NamespacedKey key = new NamespacedKey(plugin, "settings");
settings.addEnchantment(Enchantment.DURABILITY, 1);
settingsMeta.setDisplayName(plugin.language.getMessageByLanguage(plugin.language.getPlayerLanguage(player), "serverSelector", player));
List<String> list = new ArrayList<>();
list.add(plugin.language.getMessageByLanguage(plugin.language.getPlayerLanguage(player), "serverSelectorOpen", player));
settingsMeta.setLore(list);
settingsMeta.getPersistentDataContainer().set(key, PersistentDataType.DOUBLE, 0.1);
settingsMeta.addItemFlags(ItemFlag.HIDE_ENCHANTS);
settings.setItemMeta(settingsMeta);`
NamespacedKey key = new NamespacedKey(plugin, "settings");
ItemMeta itemMeta = event.getItemDrop().getItemStack().getItemMeta();
PersistentDataContainer container = itemMeta.getPersistentDataContainer();
if (container.has(key, PersistentDataType.DOUBLE)) {
double foundValue = container.get(key, PersistentDataType.DOUBLE);
if (foundValue == 0.1) {
event.setCancelled(true);
}
}```
is this correct though?
so right after the 3 back ticks, type java
and it adds the highlighting
if you didn't already know
Hey so since they removed perminante potion effects, how can I make it that the thing stays 24/7 I tried with health boost but every time it gives the effect again it just resets the HP
the ones at the beginning XD
not at the end lmao
almost there
same line as the back ticks
with no space
ah now we went before the back ticks but still close
Current thing https://sourceb.in/pQy0iAEPcM
ay
it looks correct
only thing I could probably recommend, is learning how to create chain methods to make it look better ๐
ty
could I remove the foundValue as the key is enough
its like having 2 passwords
I only need 1
java.lang.IllegalArgumentException: Specified enchantment cannot be applied to this itemstack
how can I bypass this?
settings.addEnchantment(Enchantment.DURABILITY, 1);
its a netherstar
i just want it to be enchanted
nvm infinite is just -1 duration
declaration: package: org.bukkit.inventory, class: ItemStack
Netherstar of returning. Returns to the user when thrown. Effects are exploding on contact
would be a nice weapon to use when a horde of zombies are after you
welp, time for me to go play some billiards now
some people want me to play ๐
does chatcolor not work for display name? its working fine for tab list but when i do it for display name it sends a "Chain link failed, continuing to next one
java.lang.IllegalStateException: Missing key in ResourceKey" error after i try to send a chat message. i think it was working before i moved the plugin up to 1.20 so not sure why it wont anymore
private final Map<Predicate<InventoryClickEvent>, BiConsumer<PersistentDataContainer, Player>> handlers;
I don't really see the point of a random player
well it has to pick a player
it might not be at random but might be indeterministic, I wouldn't rely on it picking any specific player
In the player interact event, I am checking if the player pressed a sign. How can I check which side the player pressed in terms of Side.FRONT and Side.BACK
y'all haven't seen bungee's code have y'all
It sends the message
through all players
how do i set a display name's color? chat color doesnt work anymore it seems
All players got the message ?
https://www.spigotmc.org/wiki/sending-a-custom-plugin-message-from-bungeecord/ here
When the bungee send message
'player.getServer().getInfo().sendData'
hey so im forking spigot and when i commit and rebuild patches for some reason the default commands or java org bukkit (something like that) isnt saving, working in git fine as i can see but when i build it nothing changes? anyone know what could be the issue
So I'm getting this error:
Could not pass event PlayerInteractEvent to SpleefSign v1.0-SNAPSHOT
org.bukkit.event.EventException: null
...
Caused by: java.lang.ClassCastException: class org.bukkit.craftbukkit.v1_20_R1.block.CraftBlockState cannot be cast to class org.bukkit.block.Sign (org.bukkit.craftbukkit.v1_20_R1.block.CraftBlockState and org.bukkit.block.Sign are in unnamed module of loader java.net.URLClassLoader @6d21714c)
at com.sindn.speelsign.spleefsign.Events.onPlayerClick(Events.java:36) ~[?:?]
at jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:578) ~[?:?]
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[spigot-api-1.20.1-R0.1-SNAPSHOT.jar:?]
My code is:
@EventHandler
public void onPlayerPlace(BlockPlaceEvent event) {
Player player = event.getPlayer();
Block block = event.getBlockPlaced();
Sign sign = (Sign) block.getState();
if(sign.getType() == Material.SPRUCE_SIGN){
Casting a state to Sign?
Did I understand this wrong?
getState
@NotNull
BlockState getState()
Captures the current state of this block. You may then cast that state into any accepted type, such as Furnace or Sign.
here's the one causing the error:
@EventHandler
public void onPlayerClick(PlayerInteractEvent event) {
Player player = event.getPlayer();
Block block = event.getClickedBlock();
if(block == null){return;}
Sign sign = (Sign) block.getState();
My import is import org.bukkit.block.Sign; which I think is correct
yes
yes
Haven't used the InteractEvent yet... your best bet is waiting for someone else. i'm probably also gonna take some time to figure this out
having some casting problems myself rn lmao
One thing tho: the event does actually work fine, but that error is driving me crazy lmao
wait, everything works even though you get that error???
Yea
That's... weird.
@boreal sparrow what error?
.
eh
you can add a check to ensure the clicked block is a Sign before casting it
try this code hold on
import org.bukkit.block.BlockState;
import org.bukkit.block.Sign;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerInteractEvent;
public class yourthinghere implements Listener {
@EventHandler
public void onPlayerClick(PlayerInteractEvent event) {
Player player = event.getPlayer();
Block block = event.getClickedBlock();
if (block == null) {
return;
}
BlockState state = block.getState();
if (!(state instanceof Sign)) {
return;
}
Sign sign = (Sign) state;
}
}```
tell me if it works ๐คทโโ๏ธ
right! i forgot about instanceof lmao
bruh
I'm currently trying out the InventoryGUI guide... I'm a bit confused though. Currently at the step before the first example video
I don't get how the implementation with the subcommand works.
Also do I understand that right? The PersistentDataHolder stores data in items, entities and blocks (such as signs)??
so i can have a random sheep being the most important part of my plugin? lmao
i never knew about GUIs but ill be there soon ๐คทโโ๏ธ
Yes
that's sick as hell
and this data can be anything?
players, inventories, general objects, strings, integers etc?
Yes
gaw damn that's sexy
Has some limitations tho
tell me more
thats all i know bro
hold up
@hybrid turret i know i save ALOT of informations about things ill go dig some up rq
thanks
sorry lol i have like 35 chrome tabs rn anyways https://paste.md-5.net/onoyujijuy.sql
tell me if you don't understand something and ill try finding it out
Thats all i know and ill go now @hybrid turret
new man, thanks
it's like a Magical Chest
yeah
if thats simplier
imma keep trying to serialize inventories for gson lol
ight have a good day just ping me if you need help
will do, thanks :)
Is it possible to use an event to set keepinventory to true when certain mobs kill players? e.getEntity() in PlayerDeathEvent only returns a player or null
if not, is it possible with nms (i just need a pointer in the right direction)
I need help, a player figured out how to crash my server
I cannot figure out how
They died like 100 times
Anytime they join now it goes crazy killing them
Until I get this
?1.8
Too old! (Click the link to get the exact time)
ban them
I understand 1.8 is old ๐ฆ
I don't think it's my code
But they are stuck in a loop of dying
then it's probably your code
?nocode
Itโs hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.
Well - the console isn't pointing me to my code loll
you must be running somethgin when they die
which is triggering itself
again and again
Well - I tied dying on my other test server now im stuck in dying loop
I realy did it now
can't help if you show no code
I am trying to narrow down the code
E
BukkitRunnable really needs to get deprecated
Up!
why?
It's just not pretty compared to the lambdas (So Runnable as well as the Consumer<BukkitTask>)
How can I best translate Material from English into something else?
I donโt think itโs convenient to manually prescribe each material
If it's to display to the client use translatable components
TranslatableComponent component = Component.translatable(Material.DIAMOND_ORE.translationKey()); like that?
thats adventure components but close enough
that is, I can safely use it if I would not be on paper?
Hello everyone. Why does it crash? What's wrong with my code?
arrays start at an index of zero
why are you using packets to equip items?
yeah not touching that.
How to set a style for a component in 1.19.4 NMS?
i hate the ender dragon, it's so badly written
everything is hardcoded
even the node paths
that lead to 0, 0, 0
im using NMS
bukkitrunnable is fine itโs just when it gets implemented inline in an anonymous class itโs horrible
import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.Style;
I want to set the Style to my Component but i cant find any methods related to this
why are you using nms components?
because i have to
Im creating a ChatItem plugin
how you are gonna show ItemStackInfo without NMS?
bungee chat components
my boss told me to do it with NMS
Is it possible to make so you can tab complete args in a command? if i have a command that is /Gamemode and there is /gamemode creative, survival, spectator and adventure, can i do so you can use /gamemode c and when you tab its completing it to creative?
yes
How?
use TabExecutor
ah mb
That is what happens 90% of the time though
Reminds me of this XD
i really need a solution now
why there is getStyle method but no setStyle
just use interactive chat
Im gonna do it with nms
Its a test plugin bro not gonna use it anywhere
I feel like kotlin is going to take java's place soon
so go decompile and remap the server software, then just look at the methods
or go look at the mappings site
?mappings
Compare different mappings with this website: https://mappings.cephx.dev
i tried
but didnt find anything
If you're trying to figure out how to build chat component with nms I suggest you look at /tellraw
My guess is that there is some way to transform the json to java components, that could give you what you need.
I have this functions - https://pastebin.com/DrKSFDHk
And this code where i use this funcs:java if(!PlayerDataHandler.doesPlayerExists(e.getUniqueId())){ PlayerDataHandler.savePlayerData(e.getUniqueId(), DEFAULT_FULLNAME, DEFAULT_CITY) .thenRun(() -> logger.log(Level.SEVERE, () -> "ะะณัะพะบ ะฑัะป ะดะพะฑะฐะฒะปะตะฝ ะฒ " + PlayerDataHandler.getDatabaseName())); }
Cant understand why savePlayerData is not saving data. Connection is valid. I use CompletableFuture not to load the main thread in which the plugin runs.
how i can promote my plugin?
add sysouts to tell if the if is passing and add an .exceptionally to the future and see if its throwing an error
[12:41:45 ERROR]: [plugin.sisska.Player.PlayerSettings.PlayerDataHandler] INSERT INTO player_settings (fullname, city) VALUES (?, ?)
parameters=[*******-*****, *******]
[12:41:45 ERROR]: [Player.PlayerSettings.Gui.ProfileGuiListener] ะะณัะพะบ ะฑัะป ะดะพะฑะฐะฒะปะตะฝ ะฒplayer_data.sqlite```
What i see in console. No errors
i have exceptionally in savePlayerData
Is it problem if i have two connections to different databases?
i just want to apply my Style to a component
it shouldnt
its nms, if they dont need the method they wont add it
๐ญ
Have you tried looking at mentions of the styles parameter(s)
I would help you more, but I don't have nms code at hand
y
only found item#getStyle() method
make it in bungee components first, then convert to nms components
even though there is 0 reason to use them
look what the method returns and look how it could be set
in a constructor or via a builder for example
there is a setStyle method
So where is your problem?
just do this, it's probably gonna be easier for everyone
but its only for MutableComponent objects
maybe i can convert it
@smoky anchor
MutableComponent mutableComponent = component.copy();
you think it would work?
?tas
thanks for the reminder
I don't fucking know
I haven't touch much of nms as of late
?paste
This throws a null pointer at line 6
Idk why thought, player-experiences configuration section exists
bet the error tells you exactly what is null
what version are you coding for
1.8
ah
didnt work
guaranteed your getConfiguration().getConfigurationSection("player-experiences") is returning null then
sysout everything on that line then
as he creates a new PlayerExperience object above line 6 it can only be the section is null
well the PlayerExperience could be wrongly created and getPlayerUUID() could just not work
it could be a very broken class, yes
I think it doesnt read it as a config section from my yml because my yml just contains "player-experiences:"
I mean just find whatโs null
Yeah the configuration section is null
would it be a "suitable" way to keep user data loaded by cafine by every like 5 min just loop over onlineplayers and access the data so it doesnt get removed but does get removed if they log out and dont rejoin?
or what would be the proper way to use caffiene in spigot
figured it out
put it in your coffee instead
Hello there , i have a question so iam trying to make a expired items system , saving it into a mysql with uuid, item , expired_date (long)
is there a better way rather than saving the item name?
shut
we need a caffiene tap
caffiene spigot
@tender shard get on that
use pdc and assign an id to an item maybe?
or just use pdc for the spoilage anyways
oh so i can use NBT API?
?pdc
no just pdc
iam on old version .
oh
so update smh
well either way should be the same idea
yeah i think it will work with nbt?
save the expiration date on the item
ik i should update , but ehh the client want it on 1.8.8
I wanted to make coffee now anyway
then you dont need that databae mess in the first place, atleast not for this feature
i made a shop system for him , so its a timed items shop , when you buy it , it will for example have 1 hour expire date
check for expired items when :
- player join
- player hit another player
- player use item
- player place item
- player consume item
I would link the date to the shop and not the item, but thats an implementation detail
the way you save it in this file would be how you save it in nbt too
alright
there is where iam saving it into the mysql
and giving the item to the player
insert hadouken meme here*
please use guard pattern instead of spagetti
so how are you deleting the item if its expired
?>?
there you go
Why not generate random uuid and assign it to item nbt data if you want ensure that item is unique
ty
if (item == null) return;
early returns
is that how it's called ?
ah ok
de-indentation
oh no, is this your GUI ?
What happens if I place a chest named "Shop"
your shop might then break...
getitem -> getItem
to place shops anywhere
I can make 2 hikari connections in a java project, right?
ik about this
why
is it connecting to 2 different databases
https://github.com/manifold-systems/manifold/issues/469 does anyone else have the issue of NoClassDefFoundError when not shading manifold when using manifold-ext ?
The example pom available at https://github.com/manifold-systems/manifold/tree/master/manifold-core-parent/manifold#maven does not mention that it's required to use the maven-shade-plugin to in...
i just tried to remove the embed on that ๐คฆโโ๏ธ
embeds take up 3/4 of my screen
3/4 ?!
i have two database first one getting player settings
second one getting player infos
half for me
those should be 2 different tables
on the same db
by simply using getConnection() again on the same DataSource
i know ๐
ofc you have to close your connections once you used them
but
FROM table_name
can i do two connect for database ?
why would you do that? hikari handles your connections
yeah alex, not everyone has a giant screen xD
I'm on my laptop with 16 inches
this connection will get closed by try with resources right
boasting
your dms are worse than mine lol
too many fans
sus
63 notifications on PornHub ๐
hes a mod there kek
or a star ๐
not everyone always checks his/her messages
honestly the most annoying thing about pings is that even servers you marked as muted still ping you
If you respond to 1 all 15 want a response, so you keep not responding until you got time
at least the ping does not make a sound then
i cant send the tony sticker
if i have a db, would it be correct to have a Queue<> of data that needs updating in the db
or do i just resave my entire cache
flag things in your cache that change
everything but the keys in my cache can change lol
either queue and flush yoru queue at a set interval or flag each with a boolean
can, but may not
im already gonna need probably like 2 queues for all the different changes, creation, updating
but thats doubled because theres 2 data sets
this is most likely wrong but the i think the concept is the same
might change it to be Pair's instead
can i create an armor (chesplate or ...) which it does not have any damage protection?
Can I add a hyperlink in player.sendMessage() instead of just the link being displayed?
you have to manually do it with components
ClickEvent.Action#OPEN_URL is the action you need
minecraft color encoding not working in 1.20.1
what to do
show ur code
?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.
Chat.color depended
can you please describe your issue in full sentences
ChatColor is deprecated?
yes
you're using deprecated server software / api
yes
what's the correct TextComponent to import?
ChatColor is NOT deprecated
in 1.20.1 in paper deprecated
not work now
?whereami
stop using paper or ask at paper
the md5 bungee one
well i have no idea how, a little more details helps a lot
ah ic
and send it with player.spigot().sendMessage
were paper decrod)
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
no this is not my question xd
^
oh this, do it with attributes
now ^ xd
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/attribute/Attribute.html
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/attribute/AttributeModifier.html
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/inventory/meta/ItemMeta.html
declaration: package: org.bukkit.attribute, enum: Attribute
declaration: package: org.bukkit.attribute, class: AttributeModifier
declaration: package: org.bukkit.inventory.meta, interface: ItemMeta
thanks
got it, thanks
Correct me if I'm wrong, I don't usually use attributes but, would there not be 2 attributes then ?
1 of the base protection and 1 to remove the base protection
in which case, you would have to hide them with ItemFlag
probably
@tender shard will this miss the first collumn and should it be a do while
no, it starts off before the first row
so you always have to call next() at least once
ah
Ha epic is blue
I'm coding a permission/groups plugin, how can I make a permission like plugin.something.* work? The * seems to be something the permission plugin has, not a default spigot thing. I'm using Spigot 1.8.8.
` private int extractNumberFromString(String input) {
// Remove color codes from the input string
String strippedInput = ChatColor.stripColor(input);
// Remove all non-digit characters from the string
String digitsOnly = strippedInput.replaceAll("[^0-9]", "");
// Parse the remaining digits as an integer
int extractedNumber;
extractedNumber = Integer.parseInt(digitsOnly);
return extractedNumber;
}`
this gives me an error in the console
the line with the problem is
extractedNumber = Integer.parseInt(digitsOnly);
does anyone know the issue
?paste the exception
How can I get a random player who won't be the one who used the team?
yes
no idea what you are on about
[^0-9]
^ negates the set
why is it called digitsOnly then
this is a typo of the translator, one moment
which is about right since he only wants numbers as it seems
how can i get a random player who won't be the one who used the command?
right, my bad
that part is correct
you can make a new list with the content of Bukkit.getOnlinePlayers and remove the player which executed the command
^
thx
Just make sure to handle it being empty
then get a random one
what does it do on empty string ?
exception
it dies
So probably just test for empty (or blank) string and handle it somehow
thats why i want him to send the exception
Now If I designed this gens texture in a resource pack and then coded the scoreboard in spigot, how to use the texture in the scoreboard
https://media.discordapp.net/attachments/805384167193051136/1137344729248448552/image.png
create custom font
put that texture into the font as a character
use that character in the scoreboard and change the font
would require components
You can also just replace a character in the default font
Donโt need components for that
I would advise against that tho
It is not the "right" way to do this
BUT it is a possibility
I mean you can just use the unused blocks
not future-proof since 1.20 iirc
?
I think they could update the unicode and thus the unused block would then become used, no ?
E000 to F8FF is specifically designated as a private use area
I have an error when i'm using the command without arguments, how could i catch it?
Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0
Which means Unicode will not designate anything in that section
oh I see, didn't know about that
Check if args.length is 0
don't call args[0] if there is no element there
check first if there are arguments at all
oh ok i got it
args[0] takes the FIRST argument since arrays start at 0, if the length is 0 it'll throw that exception
https://paste.md-5.net/qoketilayu.txt can anyone make sense of this error? one of my users is getting it and i can't reproduce it on the same server software. "type" is null but what does that even refer to and how could i prevent that, all it does is saving/loading itemstacks
will it work?
if(args.length < 1) {
player.sendMessage("ยงcThere is no arguments");
}
add a return true statement after that otherwise its just gonna keep going
looks like a paper / purpur issue
oh yes
ive got the same build as him
it's what i forgot to write.. Thanks
so its out of my control?
ask them to send their config
they're using default configuration because i asked them to clean install the plugin
seems like they have an old version of ItemMeta in their config
it's definitely related to the datafixerupper converting an "old" itemmeta to the current format
that could be true yeah, the configs are made with 1.16.5 item metas
typically that should convert to newer versions just fine
Maybe they have a plugin or something that yeets the dfu
how does the config look like?
hey i found this plugin for structure generation. As I understand it, everything happens through the chankload event?
https://www.spigotmc.org/resources/betterstructures.103241/
Explain more please
its far too big to send but its basically just a collection of custom recipes, so some items with other simple properties
one entry looks like this for example
craft_sharpening_stone:
ingredients:
'0':
==: org.bukkit.inventory.ItemStack
v: 2586
type: STONE
'1':
==: org.bukkit.inventory.ItemStack
v: 2586
type: FLINT
result:
==: org.bukkit.inventory.ItemStack
v: 2586
type: GRAY_DYE
meta:
==: ItemMeta
meta-type: UNSPECIFIC
display-name: '{"extra":[{"italic":false,"color":"light_purple","text":"<lang.material-sharpening-stone>"}],"text":""}'
custom-model-data: 8892300
require_custom_tools: false
use_meta: true
unlocked_for_everyone: true
improve_center_item: false
shapeless: true
tool_id: -1
tool_requirement_type: 0
allow_material_variations: false
There will be 3 features in my 1 plugin, how should I divide them into packages?
What should the naming conventions be?
idk if its a good structure but my plugin, having many features, looks like this
looks correct
i will give
example
for me brb
like i wouldnt make a folder for each feature you got, tends to get messy quick
so try to sort it all in more broad terms
it entirely depends on the features
no
well i need idea for that
if they have no link to combine them they should each be seperate plugins
Package names are written in all lower case to avoid conflict with the names of classes or interfaces.
i wouldnt do it like that either, you're basically doing a triple plugin in 1
this looks like 3 seperate plugins
try to sort your stuff in broader terms
well
like if you got a FriendManager and a ManaManager put those in a managers folder or something
okey i do like this
have you? it only picks the first player from the server's players iterator
maybe I was looking at an old version
then you might have to create a bungee plugin that listens to incoming plugin messages and executes it manually there
unless you're thinking the other way around, sending a message to the bukkit Server from a bukkit plugin,, that'll broadcast the message to all players but that goes upstream, not downstream (and it's in bukkit, not bungee lol)
any idea why this does not work , nothing happens , and the runnable does not even run ..
this is onEnable
Can someone teach me the naming conventions for packages ?
well this is my list
for:
- databases
- commands
- events
- objects
- configs
- and for others
well if i do 1 task per item would not it , be laggy?
i added it in the onEnable so it will only be 1 runnable only running .. or did i got it wrong?
me/vasir/manacore
- storage
- commands
- listeners
- data
- configuration
others
id say
you loop over the inventory contents and then create one runnable per item
so you'll end up with like 45 runnables
ok , that's not what i want
i was hear this
for commands i need do command
that true ?
and for database:
repository
how i can make it only 1 runnable?
wdym
you append Command to the end of the class, and where the fuck did you hear database should be repository
hold on ill show you what i do
someone telled me
i need do command for commands
someone telled me
what is repository package ?
alright
what is handlers ?
am i create package for this ?
wait u create package in package ?
why ur storage package icon different is this plugin ?
by not creating them in a for loop
btw can i add my database methods to storage ?
ok any other way?
loop over the inventory in your runnable, instead of creating one runnable per item
alright bro thanks
and example i have minecraft items and i create this in some class what need i create package for this ?
dude packages don't do anything
because i use a plugin
this is a public plugin, i support different storage types
you don't "need" to create any specific package names, you can call them however you think it's appropriate
so each storage type gets a handler
aight ty
Alright thank you i got it working ^_^ , only 1 problem left to fix its easy
Hi, can anyone give me an instance where I could use abstract classes. I'm having troubles understanding them. Really sorry bout this
sometimes getLastDamageCause doesn't seem to update?
no plural
if its not a package full of databases, commands etc.
aight
also try to be more specific
f.e. what is objects
databases could be everything
configs for what
public abstract class Vehicle {
private int distanceTravelled = 0;
private final int speed;
protected Vehicle(int speed) {
this.speed = speed;
}
public void moveForward() {
distanceTravelled+=speed;
}
public abstract String getName();
}
public class Car extends Vehicle {
private final String brand;
private final String model;
public Car(String brand, String model) {
super(5);
this.brand = brand;
this.model = model;
}
@Override
public String getName() {
return brand + " " + model;
}
}
public class Bicycle extends Vehicle {
protected Bicycle() {
super(1);
}
@Override
public String getName() {
return "Bicycle";
}
}
basically abstract classes are sorta like interfaces except they can have predefined properties and behaviors
kinda
Thank you! But could you expound further please. Like why do you have to use abstract classes here.
yeah e.g. like an LivingEntity - they are abstract because you cannot just create a new "living entity", you can only create new actual existing subtypes of it, e.g. Creeper, Zombie, ...
My understanding for them is still kinda vague.
why you would use an abstract class here as opposed to... what?
Honestly the main difference these days is that abstract classes can have variables
like just an instance?
Since interfaces can now have default methods
you can define methods for them to use, or variables in the parent class
likenot even default methods
Every method in the interface is assumed to be abstract right
"now"? That was possible since like forever
abstract classes can have predefined methods though
mfw default methods
So one way to organize my code is to use abstract classes and have sub classes for it?
default methods are great
public interface NMSHandler {
// This method only needs to be overridden in versions that don't support this through API (1.8)
default void sendActionBar(Player player, String message) {
player.spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(message));
}
// ...
anyway to add the hover text to a print out of an entity, like the entity that gets printed out in death messages?
but for example if you want to have a registry for all the vehicles you want its a bit absurd to make a new mapping for each type of vehicle, like a cars map or a bicycles map or a busses map or whatever. its far more convenient to have a single map for vehicles, which has this abstract vehicle class. of course you could use an interface but in this case, for vehicles, we want this abstract class to have properties
depends
if you only have 1 subclass, its pointless
if you have mutliple yeah
I often overuse stuffs that I newly learned
it doesnt have to be, it allows you to more easily expand upon that code later down the line
You should use abstract classes if you have different subclasses that share the same behaviour
interfaces only define contracts (which methods this class must have) while abstract classes can also implement them
Ohhhhhhhhh
I kinda understand this now
like all vehicles travel, so you want them to share that behavior
also before you get confused of what the super(1) is, the super means superclasss so the abstract vehicle and calling super(params) would call the abstracts constructor
yeah super(1) basically says "call the constructor of Vehicle with 1" so a bicycle has a speed of 1, the car here has a speed of 5
Aight thanks yall
Look modern java is new for minecraft
:p
it was already possible in java 8
idk
The dude I watched on youtube mentioned that too
and sometimes the getDamager is blank
It was Shakespeare
also funny: the javadoc of Material.FIRE
anyway to hook into when the player gets set to spectator mode after they die in hardcore?
oh no wait it wasnt material
it was the javadocs of the Fire blockdata
this one is cursed
Smh why isnโt it FurnaceorDispenser
Hey, I have a question about pluginmessages
To send a bungee message, we do this
player.getServer().getInfo().sendDataMeassage()
And in the plugin to retrieve the message, it looks like this
onPluginMessageReceived(String channel, Player player, byte[] bytes)
{
What does the player parameter correspond to? The same player used to make player.getServer?
does getConfigurationSection("default").getKeys(false) return 1 - 3 as string or i have to put the numbers in ""?
default:
1:
name: "Default 1"
2:
name: "Default 2"
3:
name: "Default 3"
Ikr?!
That will work fine as it is
thanks
But why dont you use a list?
wdym
Do you actually need the 1,2,3 numbers?
its PlayerGameModeChangeEvent
i am fine with both int and String, just wanted to know which one it returns
i thought if i put numbers it will return an empty list because they're not String
it has more values than name, it was an example
ok i just wanted to mention you can also use a map list
people:
- name: mfnalex
age: 28
- name: someone else
age: 17
that way you can get rid of the useless 1,2,3 (In case you don't actually need those numbers but only used them to get a valid yaml)
for some checks which they're using numbers it has to be 1, 2, 3 ...
ok
thanks
just wanted to mention the map list because so many people don't know that it exists lol
same for yaml anchors
is there any way to set the players health to zero but for them to not die?
basically i want spectators health to show as zero on the scoreboard
just set their health value to 0 on the scoreboard
how would i do that? Scoreboard objective is read-only
hmm, didn't know read only scoreboard objectives were a thing
thinking about it, even better would be just to remove the player from the scoreboard tbh
can't you set it to 0.0001 or sth
Depends if the game rounds or ceils
But yeah
You could also just use hidePlayer to remove them entirely from other players
shows as 1
dust touches the player
Player was slain by dust
like in counter strike when you're hit by a flashbang with 1 HP
boom
the father of forrest gump was killed by bananas in the book
Hey a banana can pack a good punch if yeeted
it can hit like a boomerrang prob
terraria's controls are so annoying
Canโt you change em
yeah but inv and settings are always same button
to open the settings menu you need to open the inv
the controls are so annoying, I never managed to play it more than 10 minutes. like, how do you even place down a door
I play on controller sometimes
imo best controls, just that it isn't quite for speedrunning and generally being quick
this does not hide them on scoreboard
updating lore every 1 second , thatcwill create a client bug , how i can get rid of ?
don't update the lore
it's not a bug btw
the item changes, the client shows the animation
well it should be update to show how much time left for each item
i have an idea (show action bar) ..
for the specfic item in hand .
how can you localize entity names eg turn CraftSkeleton into Skeleton?
get their key and use that
entities implement Translatable
so yeah get the translation key and throw it into a translatable component
Do they tho
or the entitytype does
smh I cannot remember my own pull request
yeah @smoky berry what do you need it for
chat
then you're lucky
Choco pr plz
i asked this before but is there any way to get the hover text on entities and players
like the hover text you get in death messages
?jd-bcc
Yes you can use a hover event with Action.SHOW_ENTITY
sweet ty
oh wow it actually works
lol "I want help"
It would be easier for you to just update to 1.19.4
Does 1.19.4 have stuff for that?
Ah
get the owner to update then
Coll did
Updating
You do have to realize that when working with NMS you're on your own most of the time
We're not going to spoon you every step of the way
why not just update and use citizens?

