#help-development
1 messages · Page 275 of 1
fair
I mean fully basic java*
oh weird, yeah that why
If you learnt fully basic java first, then everything is simplier*
Yeah, I can see that
Ofc not wondering to make you mad or be rude, jsut telling from my experiences i used to had
Yeah no bro, I completely understand
I'm usually more of a guy who hangs around in the #help-server since I make servers, rather than making plugins
but what pissed me off was that there's no Annihilation plugin that's fully-functional
logically It's not difficult
create 4 teams
make a command which allows player to join team
Check if team is balanced
On server start-up, load random world
etc etc
but yeah, there we have it
What is lobby and cayon just curious
for minigames you could use hypixel’s slime world format to save on load time and space
it’s really good
And what is annihilation=
Minecraft gamemode
Bedwars & KitPvP mixed
there are 4 teams
ohh okay i catch it
usually there's like 5 players in each team
you go to enemy bases and "break their bed" 200 times
to kill them
basically yeah lol
yeah its like a protect the core
mhm
Where you should break the nexus x times to finally kill them
Si
Its the protect the core concept tho
Espanol? Im native spanish speaker tho but so far we cannot speak spanish here
I'm fully british xD
the closest I was able to find was this plugin https://www.spigotmc.org/resources/annihilation-1-6-x-1-19-2.66571/
ohh ok, i see you said "yes" in panish that why
yup
So?
but the source is closed and lack of configs
u speak espanol?
oh ok
No one said its not open source!
You can always decompile the jar, fix decompilations issues, modified it and then re compile it again
I heard there's issues when you decompile jars
You don't always gets the full source, or it's not always accurate
I dont think its allowed but if its for personal usage who would care
yeah ik, also decompilations only works well when the jars are not obfuscated
doubt?
Decompilation isn't perfect but it's good enough to work with
Yeah, also why would you re write a full code where you have the jar and can get it from it
mm
Yup lol
Because that plugin for an experienced dev will take around 1-2-3 weeks but us that we dont really have experience takes more time
yeah in that case you will have to re code it
@Override
public boolean execute(CommandSender sender, String command, String[] args) {
if (args.length < 1 && this.hasPermission(sender, this.permission)) {
this.sendHelp(sender);
return true;
}
BukkitArgument argument = this.getArgument(args[0]);
if (argument == null) {
text.send(sender, "Command.Invalid-Argument", "%prefix%", text.getString("General.Prefix"), "%argument%", args[0]);
return true;
}
if (!this.hasPermission(sender, this.permission) || !this.hasPermission(sender, argument.getPermission())) {
text.send(sender, "Command.Invalid-Permission", "%prefix%", text.getString("General.Prefix"));
return true;
}
argument.execute(sender, command, Arrays.copyOfRange(args, 1, args.length));
return false;
}```
What could be wrong here, because so far its telling me that i dont have permissions to execute the sub command, when i have the permission of the sub command tho
No idea
maybe you don’t have permission for the argument but you do for the root command, or viceversa ?
There’s a logical OR in that if statement
You sure the permission for the command is set correctly?
!this.hasPermission(sender, this.permission) || !this.hasPermission(sender, argument.getPermission()) both of those are returning false, meaning you don't have the main permission or the argument permission. You should also probably check if the sender is of instance Player.
ok, the check of isntance player i do it manually because i havent added a boolean yeath for entity type
CommandSender can have permissions
So i explain what happen
you don’t have at least one of the permissions for either the root or argument command
or your permission check method is, for some reason, returning false incorrectly
My idea is the next:
Args is 0 and dont have command permission => return permission msg
Args is 0 and have command permission => return help msg
Arg is 1 and dont have command or sub command permission => return permission msg
Finally execute the sub command
Yeah problem is caused only using argument permission, having root one is perfect
use a debug message and make sure argument.getPermission() is returning the correct thing.
i would suggest you check if you have the command permission before you check usage to avoid leaking how the command works.
then check for the sub command’s permission after having checked the argument usage
and this to debug it yeah
Sorry for asking this stupid thing but i couldnt find any software which allow you to evaluate conditions with logical operators and give you the truth tables
I already debugg everything and it should be okay, the issue shouldnt be there
try printing if you have the command permission and then another time for the subcommand
Never guess with coding. "should" doesn't mean it is or isn't correct. Triple check it
I wont lie the code on v1 was working perfect, and v2 brokened althought no one touched the command framework
ok, but if check if has or not command permission, then you wont be able to execute the sub command / argument without the root permission that why
right
that’s how it’s working in your code
now try checking in your player permissions if you have both of them
So what do you suggest, knowing what i want to do?
because according to the code you do not have at least one
Im using permisible tho
what do you mean
boolean hasPermission(Permissible permissible, String permission) {
return !permission.isEmpty() && permissible.hasPermission(permission);
}
Why aren't you using the normal player.hasPermission()
Is it the same tho?
Someone explained something about that but i wasnt sure tho
have you checked if you actually have both necessary permissions
An do this: use a debug message and make sure argument.getPermission() is returning the correct thing.
if you say no one touched the code from one code version to the other then that’s the most normal explanation for this malfunction
Why both neccessary? You should be able to run the argument with any of the permission (root or argument one)
yes i did that
well that’s your code’s behavior
And both of the permissions are okay
What do you mean?
it checks if you don’t have permission for the command OR if you don’t have the permission for the subcommand. If either of these conditions are true then it sends you the permission message
I mean the permissions returned via: Command#getPermission() and Argument#getPermission() are the same node setted in luckperms
look at your if statement
So you are trying to say, that my permission check if are wrong
Either that or you are not being clarify
for what you want, yea
!this.hasPermission(sender, this.permission) || !this.hasPermission(sender, argument.getPermission())
You are literally checking that you DON'T have the permission
okay, i would like to you to tell that from start 👍
The ! means you don't have it.
what
I have been saying that from the start
yeah i kno what does the operator
.
boolean input = false;
sout(!input) // true
So if you are getting the message in that if statement, it means you don't have one of the permissions
yes that’s what I’ve been telling him
wrong logger
Why? You must be able to run argument having any of the permission
yea and your if condition does the opposite
if you do not have one permission OR the other, it doesn’t let you run it
just replace the || with a &&
ok
hi i have a problem ":
so if i add break , it will only execute first event for the quest , but other quests will not be execute the event
and if i remove the break; , the quests will be duplicate + 2 example :
i would follow your own advice to the person you told before
Sorry for asking this stupid things but this wouldnt happen if someone intelligent created a program to evaluate conditions using logical operators and give you the truth table
Is not that i havent leant how they works, i know how they works but my brains are not so smart to think the posible rults!!
a truth table for two booleans in a logical OR would be as follows
1 + 1 = 1
1 + 0 = 1
0 + 1 = 1
0 + 0 = 0
since your booleans are negated then that means one of them had to be false for your if statement to fail
you do not need a table for that
Ik BRUH
You dont understand my point
Sorry man you make me raged because you confuse a lot
What do you mean
Eitherway, all you need to do to fix it, is replac || with &&
if i add break : it will only execute the event for only 1 quest at a time , i need to finish the quest , then it will go to next
if i remove brea; : it will duplicate the code twice
i want it to execute all the events at the same time , but no duplicate
[23:28:51 WARN]: [Multiverse-Core] Unable to copy directory
[23:28:51 INFO]: Successfully cloned world
Getting this error
your event calls once for every quest completed doesn’t it
You can get the folder wolrds tho
How so?
There is a getter for it
oh damn
did you read what i said ,-,
Bukkit#getWorldContainer() in newer versions
I'll see
I use # when i explain things via discord, but that in real code should be a dot
Convention like, # represents instance method
Ah, alright
Task failed successfully
wanting to a player/clients brand, ChatGPT says their is a getClientBrand() method to the Player class but considering i can not find that method anywhere in spigot api nor does my IDE know about it so i think it's something ChatGPT came up with as it some times does, so is there a method or easy way to get a client or players brand?
lol
i believe you have entered the realm of quantum mechanics, where something can both fail and not fail at the same time
I haven't added a check to see if it cloned xD
you never know what really happened till you check but this solidifies it's state
getClientBrand does exist (at least, internally), just not sure if its exposed to bukkit api
?jd-s
chatGPT is able to come up with logic
and basic guidance
but it's a bit brainless when it comes to java methods
i forget if its possible, but u might be able to use a plugin channel (MC|Brand is what its known as last i recall) to manually read what the client reports
considering what it's been able to help me with, i'd say it has some decent knowledge of it if a little outdated
alternatively: NMS? idk
so is there any way to get a players client brand through spigot api or do have to use some weird library?
Brand? As in version, client type or?
i belive client type, as i know plugins can detect client brand such as fabric, vanilla, forge and such
i also think there is one for feather but i might be wrong
so this code works fine , the only problem i finish a game of bedwars , it execute the event , but the handleQuestTrigger is being duplicate twice.
i tried to add a break to stop the for loop but that will make only 1 quest at a time , i want all quests execute same time , but no duplicate
this is the code :
If you know the packet you can listen for it with protocollib
it could be the quest is registered twice in your lists of quests or your handleQuestTrigger method completes it twice
Log everything with a logger and that should get you on the path to figuring it out.
Or two quests have the same name
well how i have the quests it is like this :
so some quests will deffently have same event name
i can't
some quests should be diffrent in the value , and name but not in the event name
Oh i get what you mean now
So whenever you complete a quest it’s doing it twice?
SignChangeEvent exists?
really?
i believe so lemme look at javadoc
only when you hit Done
you want for esc aswell?
but wouldn’t esc be the way to get out of wtv you are doing
like canceling it
i think for most cases it’s fine
ah i see
sorry for the wrong info ❤️
You want to know when the player cancels out of it aswell
might be some nms let me look
I can’t find anything, sorry 😦
Why are you doing events like that?
I would make a super event (QuestEvent) and then implementations (for example, QuestCompletedEvent, etc)
Does a sound launched from the playSound method in the bukkit player interface launch a sound that can only be heard by this player or can all players hear it? There is no information about this in the documentation.
If im not wrong sounds are played in a location
Yes absolutely, however, why did you link it to the player? I guess it is only audible to that player otherwise it would be illogical to put it here
I just saw that the packet was only sent to the player, so I have my answer. My bad, I spoke too fast.
Soo, i have a .txt file looking something like this:
Player R4wPanda Said: TESTING SOMETHING1
Player R4wPanda Said: TESTING SOMETHING2
Player R4wPanda Said: TESTING SOMETHING3
Player R4wPanda Said: TESTING SOMETHING4
Player R4wPanda Said: TESTING SOMETHING5```
I wanna convert this file to a string, but for each line break, i wanna add \n so that it automatically goes to a new line.
Im using a library and it wants a string, but since the txt file is more of a list, well not really but it is sorted so each new line is equal to a new message. How would i go about doing something like this ?
Why are you using txt files?
What library is it?
strings have a limit too
For easy logging, basically logging chat logs
This one:
https://github.com/kaimu-kun/hastebin.java
But im using this code:
StringBuilder content = new StringBuilder();
try (BufferedReader br = new BufferedReader(new FileReader(filePath))) {
String line;
while ((line = br.readLine()) != null) {
content.append(line).append("\n");
}
} catch (IOException e) {
e.printStackTrace();
}
String fileContent = content.toString();
System.out.println(fileContent);```
Strings have limit
You will have to design a pagination system tho
In my case i will get the size of messages that a player has and then make pagination calculations
So i would return the byteSize or something like that?
Im not sure i completly understand what you mean with the pagination system
I mean pagination, like get x amount of messages per x page
Strings have a size limit of Integer.MAX_LIMIT (2^31 - 1, other bit is negative flag)
So if player has 3000 messages, you will have 300 pages (10 msg per page)
So yeah the limit is basically 2gb
you'll be fine without a limit but still
if you actually reach that limit, RIP your ram
True
Dont think that would happen, with a timed server shutdown i think i will be fine
Anyways thanks for the enlighment
inlightment
idek
if you use the String Object
If i where you i will keep the msg in yaml, so then you can get the section keys size
And then having that size, just split them doing total lines / messages per page
correct, not sure about stringbuilders
And each String Object would have a limit of 2GB
but they should be fine
unless they are trying to store some novel in a single String or something
stringbuilder seems fine too
in which case might be better to just use a long
extract the binary yourself from the long
or use some kind of compression
I'll stick with the stringbuilder for now, and in case of destruction i'll reffer back to this conversation and beat my head over why i didn't just chose this at first lmao
Does someone know how to make a skyblock grid system or have an idea of how to make it ?
you can use my class Paginator for gui's with pages, messages that needs pages kind of /help <page number>, etc... https://hastebin.com/ulatobixey.cpp
Hastebin is a free web-based pastebin service for storing and sharing text and code snippets with anyone. Get started now.
Hastebin is a free web-based pastebin service for storing and sharing text and code snippets with anyone. Get started now.
How do I disable command logging? The config file doesn't appear to affect it.
I am making a plugin. Someone can pick a thing they want to be. Is there a way I can create a sort of custom value that will be used in future if statements to see what they chose?
Just create a private variable in the class that can be used.
Then if you need to use that variable from another class, just use a public getter/setter for it.
Will this save when the player leaves?
If you code it that way, then it will.
Use PDC and it will
you know you are having a good programming session when you nearly faint three times and still keep going
Is there anyway to set simultaneously damage cause and attacker?
getDamager() and getCause()?
I meaned SET damage cause and attacker of damage
you can set the lastdamager @fierce whale
Only set last damage cause. I am pretty sure there is no method to set damager.
None that I could see in javadocs that is.
Yeah.. There is no method set last damager
I try to cancel general damage of minecraft. and allow only skill damage
But I couldn't find way to do that 😦
EntityDamageByEntityEvent > Get Entity > Get Damage Cause > Check it's not custom > If it isn't cancel event
absoulutely I did it, But it didn't work
?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.
?paste
wdym
a more detailled description of the problem would be very helpful
also why do you prohibit armorstands from getting damaged lol
Yeah uh
I'm trying to clone a worldfile
and move it to the root of the server
spits out this error
It's not
It uses the MV API to load the world in
show full code and/or print out the stacktrace
yep yep
?paste
Screenshots of code don't help. It's better to paste.
Im reading data from a zip file like this:
String result = "";
ZipEntry zipEntry = null;
while ((zipEntry=zis.getNextEntry()) != null){
byte[] buffer = new byte[1024];
int read = 0;
while ((read=zis.read(buffer)) != -1){
result += new String(buffer, StandardCharsets.UTF_8).trim();
}
}
zis.close();
result = result.trim();
result = result.replaceAll("\n","");
But for some reason, the string is not completely read
two things:
Since the existing ones are shit
- Do not use hardcoded "/" letters
- Do not use hardcoded paths
you are trying to copy /plugins/...
That's definitely not the correct path
unless your server is in /
It's not for public-use
It's in a pterodactyl container which hs / as the server root
like C:\ on windows
oh okay. anyway, you should not do that
yep I'm aware, but since only 1 person(me) is using it
I have no need to worry
well it doesn't work right?
so you should at least consider changing it to sth proper
Fair
How would I achieve that exactly
that's however /home/container and not /
ah right
you can use getDataFolder()
File myWorldFile = new File(new File(getDataFolder(), "Worlds"), worldName);
Ah
this also fixes the hardcoded "/" problem
although on linux, hardcoded "/" should work, but you should try to avoid it anyway 😛
Ah alright
If it was a public spigot plugin
I'd be more cautious
but since it's a plugin for myself
¯_(ツ)_/¯
oh and just to confirm
that basically gets the worldfile from
/home/container/plugins/Annihilation/Worlds/WorldName
Is there a way of getting if an entity is targeting another entity?
There's either the
EntityTargetLivingEntityEvent
Or
EntityTargetEvent
They both have a getTarget() method.
And how can I tell when they stop targeting?
When the getTarget() returns null
It would be nice if there was a Entity.getTarget function
LivingEntity and some specific entities have a getTarget() method.
yo, this is such a nice feature, i didn't knew about
It's in the JavaDocs: https://hub.spigotmc.org/javadocs/spigot/index.html
package index
the thing is i don't have the Quests in Classes i have them in yaml file , and i load them from there ..
and create new Quest from there .
i will show you what i mean
gonna post it here since that discord was useless
I've uploaded a WorldFile
named "Canyon"
right here
And I need to import it,
I'm trying to use the MV API but it doesn't seem to work
Would it be worth to just dispatch a command
this is the event that is triggered :
and this is the listeners :
and how i create new Quest from here :
for some unkown reason :
this method is being called twice ..
iam trying to debugging it rn ..
hope i found out the reason
Screenshots of code is horrible. Use a paste service
?paste
How do I make my plugin initialise after a specific plugin?
the plugin I need initialises after
Afaik there is load-after in plugin yml
Maybe you can use depends too
https://paste.md-5.net/fozujafose.javahere here you go
For the time being, I'll just make it so that it executes the command When the server finishes starting
my problem is with this method it trigger twice
me?
no
declaration: package: org.bukkit.entity, interface: Mob
only "Mobs" can have targets
Mobs are basically LivingEntities with AI
e.g. creepers, spiders
so basically just do sth like this
public static boolean hasTarget(Mob mob) {
return mob.getTarget() != null;
}
weird the code works fine now ..
did you maybe just do /reload instead of properly restarting?
if you got a weird problem, then in 99% of cases, a proper restart will fix it
by adding it to the "depends" section in plugin.yml
and did this fix it?
Nope
Right
what's the name of your plugin?
Annihilation
your plugin DOES get enabled AFTER multiverse
so what's the problem exactly?
the order of enabling is correct
it works like this:
- Load Multiverse
- Load Annihilation
- Enable Multiverse
- Enable Annihilation
3 and 4 are switched
huh
Is it possible for me to execute the command when the server finishes starting
instead
You can tell it doesn't work by the Unknown command phrase
well you could simply delay stuff by one tick
but tbh this shouldn't happen in the first place
Hm :|
public class TestPlugin extends JavaPlugin {
@Override
public void onEnable() {
Bukkit.getScheduler().runTaskLater(this, () -> {
// This code will run one second after the server has finished starting up
Bukkit.broadcastMessage("Hello, world!");
}, 20L);
}
}
20L = 20 ticks = 1 second
thanks
I'll test it now
lemme know if this works pls
i will
Ayy it worked
Have you added the PlaceholderAPI into pom.xml
Actually, you probably have
great
it wouldnt have compiled w/o it
yep, that's why I thought he already has
do you have the player extension installed?
PAPI by itself has almost no builtin placeholders
try /papi ecloud download player
or sth like that
Sheesh Jägermeister
/papi reload aswell
yowza
wassup
Guess what I got for christmas
a jägermeister and 200€ in cash
A full bottle of Pfeffi!
are you sure that %player_name% is the correct placeholder name?
nice
when are you trying to use that placeholder?
in custom plugin or if not in which plugin?
Hey, I'm currently developing a Minesweeper game with the following onEnable: https://paste.md-5.net/atugelexuh.java
My problem is that I need to reload/restart the server a second time after installing the plugin so that the events are captured.
maybe you accidentally shaded PAPI into your plugin, so you are using the shaded version which doesn't have any extensions enabled
?paste
"events are captured"?
wdym with that
not called when i login
does it work fine after a proper restart?
If I delete the config and restart the server: nope
there's literally no chance that that's your full pom.xml
I mean you didn't even add spigot as dependency
Maybe, if he uses the dependencies from intellij
alex tf u on about
I compile also with ij because maven does corrupt my zip folder in resources
you HAVE to compile using maven, otherwise your pom.xml is completely useless
huh?
I am trying to though. Maybe you have some better suggestions
it is not useless at all
If you use IntelliJ's File -> Build artifacts thingy, it 100% ignores your pom file
it doesn't ignore it..
you mean the shading part? Yeah obviously it does
please tell me more about how intellij parses a whole pom.xml without using maven
but the dependencies itself no
that's easily expected when your using something called "build artefacts"
@opal wedge Please build your .jar using maven
but it doesnt work :/
The zip file in my resources folder gets corrupted
that's what I said too, then you told me I'm not helping that person
are you a bit drunk or sth
that is probably not the "full error message"
no
he only sent a tiny part of their pom, and then said the he's not even using maven to compile
he clearly isnt shading papi
why are you including a zip file in your resources anyways
yeah that also sounds weird
what's Minesweeper line 163?
until line 19
oh you are talking about the other person
If you think that you are better in helping people, then go ahead please
instead of saying "haha what mfnalex says is bullshit", maybe just utter your alternative suggestions instead
another error
please don't say "another error" but rather send the whole error message please
because "another error" is not a very detailled description 😛
?learntoask
?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!
eeeeeeeeeee not quite that
?askgoodquestion
xd
Okay, if i compile it with maven, the world Minesweeper looks like this:
Then fix it
Okay?
beautiful
Looks messy
cry about it
this emoji is Discord Illegal JAMI
(JOKE OR IRONY )
so compiling with maven DID change sth?
And with IJ compiler:
You a def making an issue of nothing.
me?
i am using .runTaskAsynchronously in one of my plugins whenever a specific block gets placed. now i did some performance testing by similuating 400 of those blocks being placed at the same time and the server ends up crashing (i think because there are to many threads being created) is it possible to somehow delay new thread creation or make async tasks share a thread (and just wait for the stuff that is infront of it) to limit the amount of threads that can get created
?workdistribution
This one is a "prebuild" map, contained in the jar
It shouldn’t make a new thread each time.
well if they run it 400 times, then it does
the default thread pool is not that big lol
if you schedule 400 runnables in one tick, then it does require 400 threads. IIRC the default thread pool has like 10 or 20 threads or sth. definitely not more. rather less
Just use ur own queue systme to distribute in batches i guess.
exactly
im looking at that link now
As you can see from the pictures, yes
well if you only send pictures instead of actual helpful messages, then you are going to have to fix it yourself
Use the api
There are no different messages. The only difference in those cases is the zip contained in the jar.
yeah but that won't send it
The left is with maven, right with ij
you also gotta send it
can you open the included .zip with WinRar?
or does Winrar also complain?
yep
then the file is broken
Do you filter resources?
exclude the zip file from being filtered
mvn clean package
Where do you put it
what
And what do you press
if do "mvn compile" you don't even get a .jar file
Also u need to do package
you are supposed to use mvn package
Exclude zip files from being filtered, i had this issue with schematics
otherwise maven doesnt even create a .jar file
i meant
where?
In your pom
in your pom
yeah
but first of all, do mvn clean package
then check the .jar file in your target/ directory
otherwise maven doesn't even create a .jar file
i meant package
compile does NOT create a .jar file
so you did run mvn package?
yes
I have already done that about 20 times
a minute ago you said that you get the same error when trying to open the original .zip file
Hey guys! So, I am having issues with mob despawning. I am summoning mobs with my command, but if the mobs are far enough away they despawn. I did set persistence to true, so I am unsure how to stop them from despawning
which version do you use?
any console errors?
@opal wedge
Spigot api version or MC version?
both are interesting to know
tell us both
MC 1.19.2. Spigot API 1.13
and you did setPersistent(true) right?
e.setPersistent(true); yes
right so I've created a bossbar, how do I make it visible to players
what entity types are we talking about?
Wither skeletons
hm then it should work. I have no idea, I can't help you. If you set them to persistent on 1.13+, they SHOULD be persistent. unless ofc your world is set to peaceful or sth
yea lol its not peaceful. I've tried putting items in their hands too. Usually if a mob is holding something they don't despawn
with exception to wither skeletons and skeles, if they hold bows or swords respectively they still despawn
myBossBar.addPlayer(somePlayer);
@opal wedge did that work?
ill try
do you have ANY other plugins installed? If so, please try without other players
No plugins. Just the one im working on
and the spigot server is localhost, so no other players
Np
could mobcap have anything to do with it?
wtf
sorry then I have no clue. It should be working fine
What's mobcap
Number of hostile mobs around a player max
what?
I haven't thought about the mobcap
Ohh, It has to be inside a function
Is it not possible to use the Bukkit API to modify the data of Entities created with NMS?
Or am I doing something wrong?
The Entities do spawn for the player, but without data.
The AreaEffectCloud does get spawned as a passenger on the player though...
Here's my current code:
https://paste.ofcode.org/gGLUrrnf7VwVKtFMug8QC5
lmao
The thing is though, if I go to like y = 500 all of them are gone when I get to the ground
you can always use .getBukkitEntity() to get the Bukkit entity
Yes, which is how I'm doing it 🤔
yeah y = 500 is >= the world's build limit
I know it is. I just teleported that high to ensure the mobs were in despawn distance to see if that was the problem
you never add the entity to the world
you only send the packet
you also have to use ServerLevel
.addFreshEntity
or sth like that
you do create the entity object, but you never add it to the actual world
try ServerLevel.addEntity() or sth like that
or addFreshEntity()
both should exist
I don't want to do this, since otherwise it's not possible for the player to switch dimensions or teleport via plugins while having passengers :/
I need it to be client side only
I'm personally using addEntity to spawn the entities. Is there something quirky with that function which could be messing me up?
It's a server limitation, not a client limitation.
The server won't allow players to switch dimensions or teleport via plugins while having passengers
on the bukkit "World" object?
or the NMS "ServerLevel" class?
Its on the bukkit world object
And I kinda don't want to edit every single plugin we have just to make teleportations possible 😅
there is no "addEntity" method on the World class
so it wouldn't even compile
?
(WitherSkeleton)current_location.getWorld().spawnEntity(current_location, EntityType.WITHER_SKELETON);
spawnEntity
yeah
that will do
that's fine if you actually need a bukkit entity later on
yea, oops. Yea its spawn entity not addEntity
I shouldn't be having this despawn issue with spawning the mobs in this way
Listen to player teleport event?
please show your code
the code where you make them persistent
Are you sure modifying the bukkit entity modifies the nms entity?
Doesn't fire if the teleportation is cancelled because of passengers...
Since it's not added to the world
Yes, since it's basically just a Wrapper which just executes the nms methods
You can use the discord code block format to display code or just text in a more pleasing way:
```java
public class MyPlugin extends JavaPlugin {
@Override
public void onEnable() {
}
}```
Becomes:
public class MyPlugin extends JavaPlugin {
@Override
public void onEnable() {
}
}```
I can never get them to work correctly >.>
where "`" is the key to the left of your "backspace" key
^ that's the char
hm that should work fine
then I also don't know
Woo!
Sounds annoying 😅
If everything fails, I guess I have to do that...
Lol its pretty annoying. From everything I can find online I am not doing it wrong :\
Just to test
if you think that this is a spigot bug, you are always free to report in on jira
I think bukkit doesn't actually wrap the nms entity unless it's added to the world
yep
that's why I asked about them adding to the world, ealier
but they did that and it didnt help
Adding it to the world would mean breaking all plugin teleportations and dimension switches, so this is not an option :/
on linux i had to press ` six times to get it three times lol
Hmm. I have something I am going to try real quick. Is there a vanilla command I can issue to set persistence
Why not use protocollib and create the packets yourself?
PROTOCOLLIB?!
protocollib is the wrost thing to ever use
it's the worst API that was ever made
😂😂
reflections 
protocolLib is a bad joke, invented by some insane person who wanted devs to suffer
it was invented as a joke and noone was ever supposed to use it
I'm not very familiar with ProtocolLib, so I'm unsure how powerful it really is.
If it can spawn my entities with the data I want, I will have a look at it, though
I tried to mess with ProtocolLib once. Gave up after 10mins
it is
With no docs
use PacketEvents instead
or, if you are at least a bit smart:
just use the NMS classes
and use maven's modules instead
tf is that ij profiler thing
it'll save you 98% of the headaches you'll have otherwise
it shows me nothing else but internal shit
then you're using it wrong
Headaches is to work with obfuscated methods, because you don't know how to setup the Mojang Mappings stuff correctly 🤔
So, I'll pass on that for now.
Let's try ProtocolLib
if you're still awake in 10 hours, I can explain the profiler to you
EntityPlayer p = ((CraftPlayer) player).getHandle();
p.getProfile().getProperties().get("textures");
it returns empty property map
how to fix
(i think i get it, thats because it is offline server)
the only fun thing that i see is that my char trie is allocating 20 million bytes of int arrays
20 mb lmao
then another 2 million bytes somewhere else
use maven + paper-nms
its easy
Just a bit confused on the math here
lol
lol
I'm trying to make a progress bar for a 60 second countdown
Oh no
internal code
Countdown/total
Ok I modified the nbt data directly in-game and the mob isn't disappearing anymore. Its a spigot bug
So remaining time / 60
I was thinking of that, but I was unsure if it exceeds
actually yeah, it should work
thanks
was a bit confused, that's all
Does anyone know how to the the block a wall sign is placed on?
@sage dragon
I figured it out
You need to spawn the entity
Then send a set metadata packet
Oh, that would make sense 🤔
Waht is this? config-plugins.bin 🤔
Will try that, thanks
Getting this error from my Countdown class
well executor is null
.
Thank you, that worked.
Now I just have one single issue to deal with:
The ArmorStand doesn't like being a passenger
Wdym?
I found another small bug in my code:
If the config has not been created yet, saveDefaultConfig(); creates it. But if then System.out.println(getConfig().getKeys(false)); is executed, the output is: [location_based, games].
However, if I run reloadConfig(); directly after saveDefaultConfig();, the output will return the correct config keys. [language, resource_pack, allow_fly, allow_default_watch, events, location_based, use_default_map, available_games_inventory_lines, games].
The config looks like this: https://paste.md-5.net/usisuzonif.http
Why do I have to run extra reloadConfig(); even though the config was just generated?
It just spawns where the player is standing, but doesn't actually ride the AreaEffectCloud how it's supposed to be
Hey, waht is this? SUS or leggit?
plugin-config.bin
Plugin: CommandTool:
Hide Plugins & Cmd history
.bin? 😅
yeah
Could you link that plugin
I'll take a look
If you see this in your logs, that server is most likely infected. There are other indicators too - the compromised JAR will have inside of it a file called plugin-config.bin. We do have a one-liner for searching for this in your plugin directories, if you're on a Linux system:
& i found this in loot Plugins
detected maleware
@sage dragon there's a set passengers packet
my Windows blocked alle requests
remove PLUGIN or the BIN File
Have you started the server with the plugin installed
i did newinstallation backup on my containers
Yeee, just need to figure out how the class is called, probably PacketPlayOutMount?
2nd local netzwork
Bro I'm going nuts, why does it return false? I've been stuck doing this for couple of hours now
If you haven't run the plugin on the server yet just remove the plugin
See what it takes in the constructor and compare to the wiki link i sent
& Redownload?
otherwise restore from backup or remove and replace all jar files
isnt Spigot mc plugins infected from spigot resources i think?=
"i just download resources from spigot"
If you don't know where it came from remove and replace all jar files
There are cases of infected plugins on spigotmc
Generally avoid small unknown plugins that have been recently uploaded
I'd love to see that .bin file, sounds fun
i check all my Plugins with this file.
I've already found two cases of that malware before in our support server because it likes to break our plugin 😂
Do all of your plugin have it?
give me a minute i check
That malware spreads to all plugin jars
oh wow very fast foundet
.bin files are usually converted from something else to binary so it would be unreadable.
Then you'll need to replace all jars
^
yeah did already
I hope you ran BuildTools to get your Spigot jar
Don't forget the libraries folder
i download the resource directly from paper io server
Gotta delete that and the cache folder if paper is installed
So, it literally contains just 1s and 0s?
Or why isn't it readable? 😅
Love messing around with malware on a second PC, but I don't really have much knowledge :/
i the .bin the maleware or the "PLUGIN/ Software" ?
i can test on my vm, Delete the bin, & restart mc server
/vm/network/cb-1/plugins
CityBuild.jar
plugins\Booster_v8.1.jar
plugins\CommandTool-2.2.0.jar
plugins\FastAsyncWorldEdit-Bukkit-2.5.1-SNAPSHOT-332.jar
plugins\floodgate-spigot.jar
plugins\Geyser-Spigot.jar
plugins\LuckPerms\libs\bytebuddy-1.10.22-remapped.jar
plugins\LuckPerms\libs\bytebuddy-1.10.22.jar
plugins\LuckPerms\libs\h2-driver-2.1.214.jar
plugins\Multiverse-Core-4.3.1.jar
plugins\PlaceholderAPI-2.11.2.jar
plugins\SimpleClans.jar
plugins\TAB.v3.2.1.jar
plugins\UltimateAutoRestart Build 52c.jar
plugins\Vault.jar
plugins\ViaBackwards-4.5.1.jar
plugins\ViaVersion-4.5.1.jar
Probably the .bin file
my infected files on my vm
But still, just reinstall all your plugins AND your server software, and probably your machine, just to be safe 😅
my vm is a test maschine is no problem
Yeah reinstall all jar files on your system
before install network on my main server i test all systems on my vm
Try to figure out where the malware came from
i like connection is localhost the vm cant upgrade or nasted in my system
so stupid skid maleware
The maleware is from skyrage de
skidded mc server german scene
So you didn't download it from spigotmc?
ah wait you're talking about the origin of it
i download my resources from spigot
yeah origin files direclty spigot
are there any up to date NMS packet tutorials?
is there a tool to migrate from spigot mappings to mojang mappings nms?
or do i do it manually
Why is .getLine() deprecated in a SignChangeEvent and what is a good alternative?
1.19.3 Downloads?
Please Link Vault🙂
prolly #getLines()[index]
not there
what version u programming for
1.18.2
ru perhaps using paper api?
yes
ah yes
paper deprecated it because they use components
declaration: package: org.bukkit.event.block, class: SignChangeEvent
they want u to use that
but is it still working with .getLine()?
yea it should work fine
thanks very much

anyone have vault 1.19.3 ?
The latest vault works on 1.19.3
It's not version dependent
Also use #help-server
**C:\Users\k98n0\Downloads\Netzwerk\CityBuild\plugins>findstr /sml /c:"plugin-config.bin"
C:\Users\k98n0\Downloads\Netzwerk\CityBuild\plugins>**
All file clean 🙂
Double check @daring elm
You just run it like a normal server.jar file
i scanned with maleware byets & Defender
Figured out a work around for the problem lol
No Results found
That!
Someone tell him it's legit lol
whats up with some people making literally every variable possible final? does that even matter at all?
- Banned on this server
- I did ask the onwer why used Discord-webhooks.
It's open-source too
186 Reviews, Open-Source
Made by Staff lol
I STILL DONT TRUST IT!!!!
bruh
i want legit proof no resource Feedbacks.
I've used it before
It's a legitimate plugin, but if you still don't trust it, it's fine. It's your server so only use what you trust.
bump
ik, i test this.
mf
at optic_fusion1.antimalware.logging.CustomLogger.error(CustomLogger.jav a:139)
at optic_fusion1.antimalware.scanner.realtime.DirectoryWatcher.lambda$ru n$0(DirectoryWatcher.java:119)
at java.base/java.lang.Iterable.forEach(Iterable.java:75)
at optic_fusion1.antimalware.scanner.realtime.DirectoryWatcher.run(Direc toryWatcher.java:104)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executo rs.java:539)
Ok now?
yk what i love, when something is deprecated and theres 0 info what replaces it lol
whats deprecated
im doing math with chars
does someone know how I can change the gradle version on my IntelliJ Idea
i allocated 2 million ints for a char trie lol
let me see
1 sec
i have intellij open
alright I'm waiting
in SDKs I only have my Java JDK
I wanna change gradle version to 7.3 so I'll be able to develop a IntelliJ Idea Plugin
It also says gradle version in there take a picture if it
Well it says it somewhere