#help-development
1 messages · Page 530 of 1
rider still exists? I thought it again died
again? when was the first time
in the time between it was announced and was actually released
rider is ass
are you not into ass or what
like you can try to do winforms and it'll just freeze
Vsc hass that?
When's last time you use it
I'm not really familiar with Visual Studio IMHO it sucks ass
I prefer VSC for everything
oh vsc
there's no proper nice c# ide
Hi guys , i have a problem with this event , literally don't work , i can swap this item (&eʟᴀɴᴛᴇʀɴᴀ &6(ᴄᴏsᴍᴇᴛɪᴄᴏ)) . How i can do?
public void onSwapHandItems(PlayerSwapHandItemsEvent event) {
Player player = event.getPlayer();
ItemStack mainHandItem = event.getMainHandItem();
ItemStack offHandItem = event.getOffHandItem();
if (offHandItem != null && offHandItem.hasItemMeta() && mainHandItem != null && mainHandItem.hasItemMeta()) {
ItemMeta offHandItemMeta = offHandItem.getItemMeta();
ItemMeta mainHandItemMeta = mainHandItem.getItemMeta();
if (offHandItemMeta.hasDisplayName() && offHandItemMeta.getDisplayName().equals(ColorUtils.translateColorCodes("&eʟᴀɴᴛᴇʀɴᴀ &6(ᴄᴏsᴍᴇᴛɪᴄᴏ)"))
&& mainHandItemMeta.hasDisplayName() && mainHandItemMeta.getDisplayName().equals(ColorUtils.translateColorCodes("&eʟᴀɴᴛᴇʀɴᴀ &6(ᴄᴏsᴍᴇᴛɪᴄᴏ)"))) {
event.setCancelled(true);
player.updateInventory();
}
}
}```
?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.
are you actually checking the item by its name?
why do you not use a PDC tag instead?
which MC version are you coding for?
1.19.2
that's great, you can use PDC
ye
oh ok
instead of checking "is this item called "...", you can check "does this item have the following PDC tag: ..."
ok thanks but i don't think it's the problem
it is
the issue's your comparison of the name
but you can ofc add a ton of debug statements. inside every if(...) { statement, you can print out sth
for example, like this:
System.out.println("event called");
if(item.hasItemMeta()) {
System.out.println("item has meta");
if(item.getItemMeta().hasDisplayName()) {
System.out.printlnt("item has display name");
etc
then you can check which is the last line that got printed, then you know where the issue is
ok thanks
Can anyone help me with some MySQL shenanigans? I keep getting the generic "access denied" exception when trying to access. I checked the credentials - they are correct - but I'm trying to access the database remotely so I think it may have something to do with access hosts? Any help appreciated
if you get "access denied", the credentials are NOT correct, or the db user simply doesnt have perms for DB you are trying to access
remember, the "host" part is part of the user
for example, you can have a user mfnalex@127.0.0.1 and it'll have access on localhost -> localhost but it won't work if you try to access from "your home pc" -> "your vps"
usually that's the issue
if you want to allow access from anywhere, your user should have % as host
e.g. ' mfnalex'@'%'
are you using mariadb or mysql as server?
I'm really unfamiliar with this but I think it's mysql. Here's a screenshot of the access hosts panel
ah, you got a host panel, ok that's easy then. Yes, please show a screenshot of the users
the "host" part of your user should say "%"
percentage sign
% = all hosts = "from anywhere"
if it says "localhost" or "127.0.0.1" or similar, it cannot work
btw you cannot send pics here because you're not verified. you either need to get verified, or use imgur or similar
!verify
Usage: !verify <forums username>
oki
Does anyone know how to disable the vanilla hotbar in the game? I want to show only the hotbar I added. I'm talking about life, armor and hunger bar.
A resource pack would work
hm what panel is that? same gameserver panel? does not look like phpmyadmin nor webmin or anything
also the "user" is missing the host part
I'm using one to show the hotbar I put in but I can't find a setting to disable vanilla.
Cpanel, lemme give you a full screenshot
Ohhhhhhh, so I'd add an @ at the end of the username? Like terracl2_tcserver@localhost?
yeah that is not helphul unfortunately. Can you SOMEHOW connect to mysql and execute statements? If so, try to enter the statement I highlighted in blue here
it should result in a table like in the screenshot
the Host part might also show Ip addresses instead of localhost, like this
are you using some "minecraft hoster" where you pay like 10$ per month for a normal MC server?
if yes, you should message their support and ask them whether remote connections are even allowed / possible
Yeah, using pebblehost. I'll shoot them a message
ah okay. Yes, maybe check if they got any FAQ on their website. If there's nothing about it there, message their support
Ah dang, I didn't know that
For years I've used pebble and they have, but I've been away from MC for kind of a while
Maybe they changed something internal
Actually found an article on their website about configuring remote hosts for an SQL server. I'm assuming this means they allow remote connections, which makes me think it's something on my end. Still will send them a message though
Apologies for the ping, but if it were the access hosts, would adding the wildcard (%) symbol work? I've added just this symbol and it still rejected my credentials, it could still be something else, but any clarity on this would help greatly
your hosting panel doesn't allow you to do that
mysql users consist of 2 parts:
- the actual username, aka what you can control in the web-panel you showed
- the host part, which is probably limited to "localhost" at the hoser you currently use
as said, you will have to contact your hoster to ask whether external access is possible in the first place
changing your username or sth definitely won't change anything
maybe there's a setting in your panel that says "allow remote connections" or sth
if there's not, chances are small you can access it from anywhere else than the server you booked
Ahhhh I understand. Thank you again :>
I'm woefully unfamiliar with sql databases and how they work haha
the general idea is like e,g,... on windows you say "mfnalex" is a user and he got a password "password123"
but mysql is like:
user is "mfnalex" and he got a password "password123" and he connects from ip address 68.123.182.42
so yeah it just got a third thing which is "where does it come from"
and some hosters simply only allow "from the Mc ip" and not "from everywhere"
some how I got my server reject my from connecting
even though it is my localhost
Try to restart the game & launcher
Either the authentication servers are down (as the message suggests) or your token expired
nothing work
If I try I can login with like a few minuates once
and I can still login other server with ease
Yeah that is my issue hmm
I am not sure how to fix that?
It has to be some form of other interaction causing this?
Hello, I have a weird question
I'm actually storing a List of chunk coordinates. For this, I created a new ChunkCoord object with getX() and getZ() methods. Here is the list example:
List<ChunkCoord> chunks;
But I feel like it can take a long time to check if a chunk is already present. What I actually do:
for(ChunckCoord cc : chunks) {
if(cc.getX() == x && cc.getZ() == z) { return true}
}
return false
Would it be a bad idea to just storing as String ? For example "x;z" ("-5;65")
So now I would just have to check if the string "x;z" is present using the List method and not iterating everything.
Do you think it's a bad idea or do you have any other solution ?
Thanks !
I believe HashSet does not have a linear search and should be faster.
So I suggest somehow using this, unless you need the same object in the list more times or you need the list to be ordered.
So HashSet<ChunkCoord> ?
yes
And do I still need to iterate it ?
also why arent you just using a vector xD
you use the set.contains()
what would be the advantage ?
Aren't they slower then lists due to being thread safe ?
(I am not sure, I have not used vectors ever)
1024x1024 block so 64x64
instead of a chunk coord
4096
Aaah gotcha
Well if he wants to store chunk position then he needs only X and Z
Vectors have Y as well, no ?
true ig
I mean it doesnt really matter, I was just wondering
because I would not go to the effort of making a new class just for 2 numbers
unless you made it a record then its perfectly fine
why not
why yes
its a good practice
I wouldnt personally
to give your values a name
well yes
okay if I were to make it I would either use a vector or I would make a record
like that you can change everything around the value without having to adjust it everywhere
which I guess is a class
a record compiles to the same code that a class does with final fields, all args constructor, and getters
so lol
kek
old man persona: these damn kids are so spoiled these days! shakes fist GET OFF MY LAWN
?
make classes
personal bests
I do have one concern tho, I am not exactly sure how has set works but
He would need one object to compare the objects in the list.
Would it ever return true even if two objects have the same values, I am asking since they are two different objects ?
no they arent its just not very funny imo
yes, because you would overwrite the equals & hashcode methods
I believe I used to solve this by overriding the equals & hashcode method
But I am not sure if that is the solution
which a record does for you 😳
but imma go since im probably too old for this fucking chat
lombok ftw
good luck with your classes
yes
okay boomer
so are you
yes i live in the jvm
so lets just move on
damn why use interface when you can have a class
yeah anyway im just trolling ima go back to watching YT
yes im going back to my retirement
no but for real I think if you want to use your type in a hashmap you need to have an equals method, or a hash method, or use a record, which does the same thing, is just as slow as the rest but you dont have to think about how you wanna write your hash or equals even though its trivial in this case
or use lombok's equalsAndHashCode
true, but I assumed that they didnt need to be mutable for this usecase
i could be wrong tho
Because that's not the purpose of records
i think for that you would just need to add int b to the parameter list and then have a factory that produces the record with b always 5
but meh
sure
but, not with a record
til
The use cases for records are usually very slim
not really
i mean depends in what context you're programming
im a big fan of value objects
How many data classes without dynamically changeable fields do you usually have?
I'd be using them more if I could at least use them for serialization, but i.a. gson isn't able to handle tecords
Ya that's not an effort that's worth it
Okay interesting
I'm trying to make a thing where mobs spawn at a location, and there to be a mob cap, but it isn't working, anyone have an idea why?
what if diff > 1?
interesting stuff this
f.lux
ah yes
never expose collections and dont make them static
with the listener yes
just do it the normal way
just have two events, for openinventory and closeinventory
wdym
myes strlen impl in java
ofc its a hidden jdk class, so many useful stuff in those classes that they hide
Literally what tf are you doing
Am I too smooth brain to understand this ?
Wait are you the guy trying to optimize the pathfinding of mobs ?
could always use jni but i thought why not give this a try
nah that was someone elese
would be a fun thing to do ig, wondering what algorithm they are using
what the actual fuck
you are literally registering a listener for a single method call?
It's a code that my friend made, so please give me advice.
Remind me to never publish the source code for my library and send it here.
:D
or you can just
ask for proper advice instead of hiding the skeletons in your closet
@EventHandler
public void onVehicleHit(VehicleDamageEvent event) {
event.getVehicle().getWorld().playEffect(event.getVehicle().getLocation(), Effect.MOBSPAWNER_FLAMES, 0);
Bukkit.getScheduler().runTaskLater(this, () -> {
event.getVehicle().setVelocity(new Vector(0, 0, 0));
}, 1);
event.setCancelled(true);
}
If a TNT explodes next to this vehicle (while you are in survival) it prevents the vehicle from being destroyed, but the vehicle still moves. I thought my Vector approach would remove the movement the explosion causes.
What could be going wrong?
you could just teleport the vehicle back to its original location
What is the reason behind the one tick delay ?
Could it be that the vehicle moves at the tick the TNT explodes ?
I attempted without the tick delay which did not work, then I thought it might be because the explosion push is one tick later .
I will try the location teleport
btw you can write runTaskLater(this, ()->{}, 1); just like runTask(this, ()->{});
it does not;
somebody else in this chat also went over it earlier and they got the same result.
Explosion damage gets cancelled, knockback remains.
i hate those // CraftBykkit end everywhere
hm
how is the lastDamageCancelled being set ?
it does not look like the VehicleDamageEvent does anything to this
If this code is from the tnt exploding then the entity would get momentum regardless of the outcome of the VehicleDamageEvent.
yeah it's not
genuine spigot bug
VehicleDamageEvent inherits VehicleEvent rather than being an extension of EntityDamageEvent so the variable is never set
so yeah just teleport back on the tick after
@worldly ingot you might want to look into this
oeh so it just so happened to be my logic was not fully at fault here?
just pr it yourself
Not signing cla
not old enough?
I believe you can set the variable yourself
Might have to use some reflection and nms tho
lmao
Do you not want md to fly his kangaroo over
No
Smh
try to manually set the lastDamageCancelled
Might be ugly but should work, just keep an eye on this bug till it is fixed so you can remove it later.
@EventHandler
public void onVehicleHit(VehicleDamageEvent event) {
event.getVehicle().getWorld().playEffect(event.getVehicle().getLocation(), Effect.MOBSPAWNER_FLAMES, 0);
event.getVehicle().getLastDamageCause().setCancelled(true);
Bukkit.getScheduler().runTaskLater(this, () -> {
event.getVehicle().getLastDamageCause().setCancelled(true);
}, 1);
event.setCancelled(true);
}
Like this?
(I am not sure if it should be done with both scheduler and without)
just teleport the entity back and move on
I had tried the teleport as well but that did not bring me luck as the vehicle still was being pushed
this is what I had tried:
@EventHandler
public void onVehicleHit(VehicleDamageEvent event) {
event.getVehicle().getWorld().playEffect(event.getVehicle().getLocation(), Effect.MOBSPAWNER_FLAMES, 0);
Location location = event.getVehicle().getLocation();
Bukkit.getScheduler().runTask(this, () -> {
event.getVehicle().teleport(location);
});
event.setCancelled(true);
}
I can't tell you if this will work
Don't have access to source code rn
ah well I tried that as well it doesn't seem to affect the problem of the vehicle moving sadly
which class is this ?
some parameters
cant you just set the ai to null
EDIT: a nvm its only an entity
nms.Explosion
hmm
I fixed it but for some reason before i join the server the mob cap doesnt do anything
I think the boolean is on nms entity
If you can use NMS then
cast to CraftEntity, set the lastDamageCancelled to true
it should work
probably
don't tell Md tho
why is the zombie wet
pls dont rn i dont need that rn
?paste your full class
i look "vault" plugin
and i saw this
no player data store file
if this plugin didnt store player datas in file
where does it store?
vault is an api
alright
but i was look at other skillpoints plugin
and i don't saw player data file
is there another data storage method?
vault is good, been there for a long time
i just wonder this
.
yes
?pdc
pdc, proprietary files, database
what is this
ah
i just forgot
i understand
mew knows
but i decided to use sql and file
what do u prefer
yml or database ? or database and yml together ?
Flatfile would be terrible in the long run
nah , best to store in the actual item, but others will say otherwise
Unless you set up some kind of mechanism to clean up old data
i understood but can u give me tutorial video or link for do this:
See this wiki page on how to use custom configuration files: https://www.spigotmc.org/wiki/config-files/
if i change money in the sql, yml file will does it change automatically?
What happened to letting user choose? Pdc can ve used for this and the downsides are no different then flat file lol
Its possible it could
But its still an option
So is flat file
No
Pdc is at least serialized
Flat file is not
Anyways there is 2 negatives with flat file.
First is if you decide to use 1 file, it will become super large and therefore will take longer for the program to fetch anything. You could memory map but you only have two options with this. You could load the entire file at once but the amount of memory used is that of the size of the file. Second is only loading part of the file into memory but then anytime something is outside of the memory you incur an expensive unload and load operation. The other option with flat file is to make one file per user. This does fine for a while but this ends up taking up file handles of the system because of simply too many files. So if you want flat file best option is to store it as binary
Yes but the way bukkit implements it and the default jvm is that its not binary serialized
the description needs more keywords imo :D
ive been looking at that like 2 days ago
how can i create an empty arraylist in kotlin D:
emptyList()
if i make a eu proxy and an asia proxy and a na proxy connecting to the same server which runs on eu proxies will the na and as players still get good ping cuz they connected to the proxy?
no
is it not empty by default?
That's not how proxies work
:(
here's a basic example on paint
val players: List<Player>
thanks
emptyList is returning List, not array list
why are you strict typing like that
no need to specify ArrayList unless it specifically must be one
i'm new to Kotlin, i'm confused a lot D:
Yeah also you can just val player = emptyList()
Take a note that list in kotlin are immutable by default
Depends if proxy has good network with your main server then yes otherwise make latency worse.
nice
wdym
like if its closer?
basically
you're adding latency by having a man in the middle
but if the connection between the man in the middle is quite faster than your connection to the target server anyways
then you could have a slight ping boost
guys some bathroom cleaner (I don’t think it’s bleach but like some hydrogen peroxide or whatever, it’s a bottle of spray bathroom cleaner) got onto my hands and I have a paper cut. Will I die
yes
it can cause some nerve damage and I'd suggest washing it off
I washed it with soap and water for like 5 minutes
you're fine
all fun and games until you had scraped hands in 2020
yeah like
according to google you are already dead
hmm how can i register a listener? it was new className() in Java
I’m sorry about that ;-;
know a guy that fell in his bike on the way to the gym
ClassName() iirc
yea thanks
Epic is a Kotlin user now
ClassName()
without new
smh didn't see it was answered lol
sorry
Hydrogen peroxide is anti septic
Ie its good for cleaning cuts and scrapes lol
it’s whatever they in bathroom cleaner with a hydrogen compound
since when are we cleaning bathrooms in #help-development
this place is just as dirty sometimes
my most useful class ever
It's not even a class
choco... interfaces are classes
it compiles to a .class file and the Class class has a method isInterface() 🥲
Oh no
(md is australian, for norther hemisphere, it means "oh yes")
Yeah, nah
that's ma boi
Well
Semantically it’s not a class; or more precise not a concrete type
But effectively is a class still hehe
:/ Java should be like C++ where there is no interface keyword. Just virtual methods
(/s)
but bukkit
Butt bucket
not only semantically
its not a class
Semantically its not a class, but there are aspects when you consider both to be classes
and still its not
Depends
It does
Interface is interface.
wise words
thats the java language specification
you can interpret what you want
an interface is not a class
Yes and implies semantically
How spigot checks if sync method called async?
AsyncCatcher iirc?
Wdym now?
is it spigot or bukkit that catches
If I'm not mistaken, Bukkit doesn't really give a shit. Spigot patches in hard checks
ouchy
Thanks
The JLS strictly speaking is the semantic specification of Java, that is the meaning in regards to Java as in the language. You can say class and mean class file for instance in which one could consider a semantic interface and semantic class to be isomorphic. Now of course you can argue for informality and sloppy use of terms but this is used in enterprise and professionally as well in other places regularly.
Thread.sleep overrated, lets just ask the windows kernel
im pretty sure conclure wants to hit me now
maybe?
marker interfaces are a design flaw!!!11!1
i can directly call exit() on the jvm with this 💀
oh ye it works
jvm exit i mean, not the win32 exit 💀
where can i find a copy of spigot 1.7 source so i can add modifications
?stash
best toString i have no idea what it says
many L
hei you pick up
hmm how do i get the cactus block that was broken when growing by fence?
BlockGrowEvent results AIR as block and source block
im guessing because its within the same tick?
can you change the block contents of a Structure object
if not, can I do it using DefinedStructures?
i've already figued out entities but sadly blocks are more obfuscated
tf am i even doing
shouldnt be talking with the win32 kernel directly
didnt even know that was possible
Yeah I'm seeing that
Since 17
That's great
I'm watching everything I missed since 16 🤣
There are so much stuff
There are so many good proposals for Java 21
Even as now, just discovered Pattern Matching and Vector API, how did I missed that
Haven't checked yet, what are your favorites
And there are a lot of changes in non-lts versions that we can use
Yeah 21 is going to be LTS right?
Yes
i can interact with all dlls that the jvm allows me to
bruh did they realize their main method is bloat or smth?
.db files is sqlite files ?
file extensions dont matter, but probably ye
(forgot that an export is .sql)
It's easier to learn Java if you aren't overloaded with public, class, static, String[] args, etc.
Remember back to your early Java days. Were you ever told "Just ignore the public static void part for now"
are we lowering ourselves to noobies their level now
You can and still should write the full main entry point. But for beginners, or even just for very simple testing, this is extremely convenient
C# has a similar concept called top-level statements
using System;
namespace Application
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World!");
}
}
}```
That whole thing can be compacted down just to this:
Console.WriteLine("Hello, World!");```
feels more intuitive to me to have an explicit entrypoint of the application rather than some random code hanging around
For you, yes
For beginners, it's easier to ease them into Java
Again, you still can and should use public static void main(String[] args) and the works
But for instructional purposes, starting people off to teach them how to write a Hello World program is easier done in 3 lines than it is 6
hey, i've tried using the nms mappings plugin and now i'm getting ClassNotFoundExceptions when i try accessing any class: Caused by: java.lang.ClassNotFoundException: net.minecraft.world.level.Level
have I replaced something i was not supposed to?
Issue
I am trying to get mob spawners to work. I would place a pig spawner and it does not spawn any pigs. Tried Cow and Zombies as well (In their correct environment). None of them are working.
Mobs are normally spawning in my world, just not from spawners.
wrong channel
no its not
are you talking about mob spawners in general or are you coding a plugin that has something to do with spawners
https://www.spigotmc.org/threads/spigot-bungeecord-1-19.559742/ i took the maven plugin from this
am talking about a general spawners error
then this is not the correct channel, this is for plugin development
no its not specifically for plugin development
anyways for passive mobs make sure there is grass and for hostile ones make sure you're not in peaceful
check my message please
it is, #help-server is for this kind of questions
look what i tried
in their envoirment
in their environment doesn't imply that there are grass block around
How are you getting and placing the spawners?
nor that you are not in peaceful mode
laughs in c++ iterators
Sadly yeah it is
the description of the channel clearly says Serious Spigot and BungeeCord programming/development help | Ask development-related questions here, and the scope of your question does not fall under this category
anyways can anyone help me with that^?
do i need to replace anything in <inputFile>${project.build.directory}/${project.artifactId}-${project.version}-remapped-obf.jar</inputFile>?
?nms
How are you building?
Maybe try using the latest version of the maven shade plugin as well. (3.4.1)
mvn clean package
i'll give it a go
import net.minecraft.server.level.ServerLevel; this is the correct import isn't it
also does it matter that my server jar is paper?
Actually I just noticed, what's with the <outputFile> being under the shade plugin? If you want to copy your final jar, you should be using the maven-jar-plugin.
it's to avoid having to copy and paste the jar each time, i remember seeing someone do it 2 years ago and i've never bothered looking for another way to do it
It should be as simple as adding this.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.3.0</version>
<configuration>
<outputDirectory>/my/path</outputDirectory>
</configuration>
</plugin>
Considering it's the shade plugin, probably.
aight lemme try
👆
Oof, alex even covered this exact case.
lmao, time to fix my pom
what u think for sqlite ?
this is what i'm looking for
as if it is saving data to file but has sql features
all databases are a file
this perfect
wait what ?
eventually
where do you think the data is saved? in the gnomes their home?
:SDDDD
okey how can i get mysql data file ?
wait
i can look google for this
C:/ProgramData i believe
if its running locally
bruh am i the only one that always forgets their mongodb cloud password
yes local but i wan't to create database file to plugin folder
with their stupid requirements
uh thats not how it works
you just create a mysql database in the already existing configuration and throw your data in there
not caring about where the data is saved
so i can't do?
how do I remove a string from a string list in a yml file?
get the list, modify it and set it back
Get the list, remove the index, and set it back.
but how do i actually remove it
cant do what
Assign the list to a local list variable and use the methods to remove the string.
ayoo
i can't create db to plugin folder?
but i saw in authme
so this is sqlite ?
probably
ig
ah now if i change the database in config sqlite to mysql
Yes, that is SQLite
can i lost sqlite datas ?
hmm that mongodb cloud ip whitelist sucks, my server runs locally and thereby it needs my homes public ip but that changes everytime 💀
Then import it via the mysql command line.
oh u mean migrate with java not hand?
omg thats good idea
by hand
wut
how can i save datas to two sql ?
but if i change one data in one sql the other sql will change
Not really. Both are technically SQL. You can convert SQLite to MySQL no issue, but not the other way around because SQLite doesn't support the full range of features that MySQL offers.
ah 😦
still no autoincrement iin sqlite :(
or LIMIT commands. 😭
bruh

alright but mysql supports yml file changes ?
example can i change some data in mysql after my yml file datas will change
or if i change datas in yml file my mysql data datas will change ?
???
MySQL and Flat Files are two different forms of storage.
yml and sql are not related nor connected at all
thanks for teach me this sql rules
there are sequences ofc but the syntax is bloat
wut?
lol what how does that even work
how would you store user ids
sqlite literally has autoincrement
^
idk what fourteen is on xD
sqlite> CREATE TABLE users ( id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT );
sqlite> INSERT INTO users (name) VALUES ('lynxplay'),('fourteenbrush');
sqlite> SELECT * FROM users;
1|lynxplay
2|fourteenbrush
sqlite>
What about the LIMIT command? Does that still not work?
limit is implemented in sqlite
Wat? Bro, when? Last time I tried to use it, it told me it didn't exist. 💀

How can set one use of item
could you elaborate on what you mean?
You mean a one time use item?
can i register player uuid to mysql with only onfirstjoinevent ?
Yes?
Yes, durability
there is no onFirstJoinEvent
i am a beginner i just wonder
i thought maybe i was wrong
or can i check first join in playerjoinevent ?
yes
oke thx
Player#hasPlayedBefore
ty
well you can grab the item meta and check if its an instance damageable and then set its durability
another option would just be to clear the slot in the interact event
does \n work when sending a player a message
When you use Player#sendMessage() It does.
It doesn't work if you manually typed it in chat.
thanks
can i break a block and emit particles in code but without any drops?
Yes
You could just set the block to air and then spawn the particles manually
Or remove the drops using an event like ItemSpawnEvent
where can i find the spigot 1.7 server that supports both 1.7 and 1.8 clients source?
got it its BlockDropItemEvent
iirc that isnt an offical version
i highly advise against supporting 1.7
not worth it
🫣
...
get bukkit isnt offical
?paste
you shouldnt be using it
SPIGOT-1.7.10-SNAPSHOT-B1657.JAR
lmao
1.7 is no longer officially available
good luck with that
we dont distribute that anymore
doesnt it have log4shell?
No
where can i find a 1.7 spigot source
1.7 didn't use log4j
you cant
why
it would've been on github, then deleted after the dmca
hey there
are there any events for checking if somehow an item is moved from main hand to off hand?
yes there is
anyone arhcived it maybe
thats for you to find out
ok
some still play 1.7.10 modded
yeah its not for modding
or with ppl you trust
lets be real
if you make a public 1.7 server with no patches it will fail
it will get nuked
Just wondering why you need 1.7
why do you want to run 1.7
to make my minecraft server function
like kacper said, it will literally get nuked
How do i use fonts for guis. Like where does the font go?
im not using mods
it doesnt matter
how is it gonna get "nuked"
ancient exploits
the log4j exploit
not that
thats why im looking for the source
just general dupes / crashes
...
its a heavy task
Ok
you better have a team dedicated to it
Ok
is there a reason you cant run a later version?
I mean, where do you use it in the plugin
Yes
Custom GUIs with fonts usually use the title
BaseComponent#setFont
But we don't have component support for inventories yet
for chat
Do you just type it in the title?
Okay ty
it is?
No
has to be implemented in code
wtf
its atleast had some of the bugs patched
Ok
you are on your own
and you can get the source of 1.8
where
?stash
1.8 branch
no matter if 1.7 or 1.8 you are on your own
Yes, but once where do you put the implementation of the font
How about 1.7
if can i add cooldown to command example 1 day
if i restart my server this cooldown will reset ?
its not on stash
Do i put the font in the title?
ifyou dont save it yeah
Depends on if you save it or not
where is it
no where offical
for this you would probably need to override characters in normal font
idfk
only chat supports truly custom
not my problem
Ok
Nah custom fonts work everywhere
rly?
We just need the component PR first
Yes ive already done all of that and implemented the font into the code etc, i just want to konw where it should actually go so they can see it in the gui
Would it be enough to just send the error to the console?
Or should I print it to a file or something?
I'm confused. What's wrong with e.printStackTrace()?
i don't know printStackTrace and looking 1m
ah i understand
errors message and error code
together ?
Prints the exception, its messages, and its call stack to the standard output
Yeah
alright i will use but
only console log is good or
i need log to file ? to errors ?
Just console is fine
alright ty
no idea? hm
thanks!
can clients respond to ForwardToPlayer bungeecord messages?
Did you use InventoryClickEvent, on click check inventory type, if inventory type is crafting, check contents, if contents contains N items, set output?
Ye that's what I had to do too XD Kinda alot to type out just to make it work, but hey it does what it needs to
earliest ill go for plugin dev is 1.14.4 cause before that it feels a bit silly imo
just use via backwards or whatever and run 1.19.4
except blockhitting might be a problem
earliest version ill dev for is 1.17
Y'all aren't using 1.20 pre-release?
i know you have been made to dev for prior versions
Actually, surprisingly, no. I join teams and they're almost exclusively on the latest version
how many teams are you joining
If they operate on 1.8, hard no. If they operate on 1.12, hard no. If they operate on 1.13... I'll consider it but lean towards no
damn
He currently works for 45 teams
average choco moment
If they operate on 1.13 they get a hard no because who tf runs 1.13
I think I've worked with 5 networks thus far
big wack
1.8 is one of the best versions but has the worst api
i prefer devving for 1.17+ since it has a lot of the newer stuff
better off rewriting the whole minecraft server yourself

than doing 1.8 nms
plus j16
i wrote a kit plugin for 1.8
but 1.14 is still like at least not thaaat old a version
What is the best event to take when it comes to an arrow popping a chorus fruit?
but i still definitely prefer 1.17+ overall
anything before 1.14 is definitely hard pass
Would you be surprised to know that it's 4 years old?
no
either way it contained major features
and not that many massive changes have honestly happened that i know of
most plugins i write for later versions work on 1.14
World height
nms obviously not included
musta not ended up using it then
when did you join chococococo
Join what?
cause most api works back since 1.14
spigot staff
I think it was 6 and a half years ago
wait choco are you the person who complains about obfuscation on spigot forums?
Ha nerd
feel like i recognize ur pfp
ur older than 1.14, nerd
So are you
no he complains about huge signatures on peoples messages
his staffing time
I have like 10k messages on the forums. You've probably seen me somewhere lol
ui meant
Yeah. Open source > obfuscation
he's right
Also, hiding stupid code in plain sight is the best obfuscation
just thought i remembered you from seeing that on old posts lol
Exactly
i hide all my code being 93 different sub libs
choco just doesnt want people to obsfucate so his life is easie
Attempting to obfuscate by hand is the worst obfuscation (I have modded a game in the past where the devs hid field access through Reflection and a Base64 decoder - so I instantly knew which stuff was to be hidden away).
They obfuscated by hand?
i just wish bungee messaging channel documentation was better
its not very good especially for the custom messages (the forward messages)
especially ForwardToPlayer
Well they basically used boilerplate encryption for assets as well as reflection for obtaining the values of "secret" fields
documention gives like no info on what it actually does
bungee messaging channel?
maybe idk
nah for docs it just links to the official docs
ForwardToPlayer has little to no documentation of how it actually works
what channel should a client listen to? how do they reply? how does it tell the server what server to send the reply to?
It just forwards a PMC message from the backend to a certain player
There isn't much to understand
And rarely useful
id assume they use the bungeecord channel but then again what format does the client reply with
can it even reply?
the client doesn;t reply
You'd need to test it out whether bungee forwards PMC messages from client to the backend
well the docs show steps for reading replys
almost like documentation would help
replies from servers not clients, unless they are modded
I mean you are basically never going to use it because the client won't send PMC messages unless they are modded as ElgarL asserted
but what if they are modded
then it all depends on the mod
Then you'd still need to know which channel to listen to
That's up to the mod to document those types of messages
If they even choose to document it. Most don't
Not to mention the fact that you probably would not need to respond on the proxy to begin with. Responding to a message from the client is probably best done on the server on which they're logged onto anyways
ForwardToPlayer really isn't super useful in a majority of situations
Pretty sure it will just be something you are doing wrong
ItemStack.serialize()
give us a map , how we can get a item from that map later on ?
deserialize
declaration: package: org.bukkit.inventory, class: ItemStack
thx
why doesnt the smithing table recipe register??
https://paste.md-5.net/oduximehid.cs
The smithing table recipes are at the bottom
No suitable driver found for root
🤦♂️ i hit capslock and forgot
i got this sql error why ?
Maybe create others database
i changed that but it still doesnt register??
https://paste.md-5.net/udesecifal.cs
you dont have a mysql driver, use something like hikariCP
you are still using capitols in your earlier keys
those work, do those affect it then?
it should throw an error at least
nope
?stash
does paper remove this error?
oh sec
Seems it converts just in case this.namespace = plugin.getName().toLowerCase(Locale.ROOT);
ah. so do you know why its not registering?
Do you have to discover them like you do normal recipes?
player has to be taught them
Unless you have the gamerule set you don't have to discover them
No clue then
Which version?
1.19.4
There was a recent fix pertaining to smithing recipes so update to the latest build if you haven't already
which is the latest?
in on 1.19.4-R0.1-SNAPSHOT
why my plugin size is big ?
my plugin size was 5kb after load mysql be 4000kb
its normal ?
Probably shaded something in that you forgot to exclude.
My plugins are 7mbs 
with sql?
Nothing but shading 2 databse drivers lol
That's fucked. lmao
what is shade sql
I have a library I use that overlays them to make it easier
sorry for my ignorance
Make sure you aren't maven shading
oke
Idk any way to intuitively support my databases without trusting consumers to actually be smart enough to download dependencies
I'd need to make some sort of library feature for myself
That's fair. The only solution to that is to just have it download the libraries, but that would require internet access and a permanent file location.
Yeah I wish libraries feature worked for things not on maven central
Is it even allowed to use the libraries feature in premium plugins given that they must work without an internet connection?
Yeah it is
Apparently it is.
how can i create custom method with spigotapi
exeample i wanna get player level and do this with method
for do this i need get Player.class and return player.getLevel ?

I used my imagination
i dont understand why you would create a "custom method" for this, anyway to get the player level you can do Player#getLevel()
its a void, you cant retunr
i want to add player level to database
^^
Why would you do that
infact
my mmo server levels works with minecraft levels
and i wanna control this from database
in playerstats
money,level,skillpoints
a lil bit inconvenient to use the experience levels
you could create an int e store the level in it, save it in the database if you want and show the level in the scoreboard
yes i know
ty
Hi I asked earlier but didnt get much of a response, but how do I add custom fonts to a gui
Ive added fonts and got it as a text component in the plugin
But where do I put it in the GUI. I dont think components work in GUI titles?
You will need to use NMS to set the title with components
or if you're using Paper they have api methods for creating an inventory with a component name
It appears they're missing a component version of setTitle though
after 1.20
why is this not working?
@EventHandler
public void onEntityDamage(EntityDamageEvent e) {
getLogger().info("event triggerd");
if(e.getEntityType() == EntityType.DROPPED_ITEM) {
getLogger().info("entity is item");
if(e.getCause().equals(EntityType.ENDER_CRYSTAL)) {
getLogger().info("cause checked");
e.setCancelled(true);
getLogger().info("event cancelled");
}
}
}```
