#help-development
1 messages · Page 298 of 1
oke now i dont have errors
how do I access that in the other class now? do i need to create an instance?
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
yes
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
?configs
See this wiki page on how to use custom configuration files: https://www.spigotmc.org/wiki/config-files/
fuck
pog
got to keep up with the features
ive looked at the cc list so many times idk how i never noticed that
I read about how booleans are encoded to integers (shouldn't it be bytes tho?) and how they store true as 1 and false as 0. But thats encoding, when decoding, == 0 is false should still hold, as I've read in OpenJDK's source. Am I missing the catch there?
What equals returns is completely up to the implementation of the object you're calling it on. The default implementation is a memory address comparison (==), so no, this cannot be said that generically.
almost everything in Java is backed by Integer
ints, shorts, chars, bytes and booleans are ints
.equals() does not do a reference equality check, you might be referring to === instead?
where it does both
Yeah, == 0 still holds
But for boolean arrays != 1 should also hold according to the JVMS - but I strongly doubt so
It does by default, because you should override it yourself. How do you think that Java knows what fields of the object to compare? It does not by default just compare all fields, that would not be desired behavior.
More specifically JVMS 19§2.3.4 "The boolean Type"
I doubt that too because it would add a unnecessary limitation and maybe even break some edge cases which rely on the fact that all non-zero numbers evaluate to true. As I've said once, I think this is a legacy "convention" due to the ease of checking a register for all zero bits instead of against the numeric value one.
In my case it is
public boolean equals(Object obj) {
return (this == obj);
}
Not sure why the brackets are there.
It's because for arrays it makes sense to pack the booleans - While oracle doesn't do it doesn't mean that other JVMs don't do it so I think this exists in order to force compliance of that being possible across all JVMs
Yep, that's the default implementation that you should learn about when learning about Java. Of course it is, everything else would be insanity. .equals() is just a convenient interface, but not meant as an automatic equality detector
Oh, others actually do that? I thought java never packs booleans. Now I get what you mean by the catch you were talking about! :)
There is definitely one implementation out there that does it
However it isn't being freely advertised as you can't really sell non-hotspot JVMs if you want to work with Oracle
Eclipse OpenJ9 is a perfect example for that
But I guess that the average programmer won't have control on such a low level anyways. The original question for me was more of a "what happens if you cast an integer to a boolean". In that case, the only sensible thing to do is to accept everything non-zero as true. Of course, if you pack bits, you have no more space for any other values besides zero and one. But you're not going to reinterpret an integer as a byte[], 99% of the time.
In java world you cannot cast ints to booleans in any way I believe
It's only something in JVM world, at which point true and false does not exist (hell boolean only exists in descriptors but not anywhere else)
create an on tab complete method and extend TabExecutor, switch the args.length and then return a StringUtil.copyPartialMatches with the results you want to show
ill paste an example rq
something like that
args.length starts at 1, args[] starts at 0
Tbh, I have no idea, I just remember that the integer value implementation had a booleanValue() method, see: https://paste.md-5.net/edokigexaf.cs
But then again, I have no idea how the JVM works and I just way too often assume things about it that I know of other languages.
ah right, default implementation is that if nothing overrides that is correct. However in regards to Java API, stuff does override that typically
and therefore that caveat is only for custom objects
which is what should be noted
From where the hell did you bring that from the depths of hell?
Not really, I have had countless "professional codebases" which either didn't override that method on some classes at all, or did a bad job at doing to. To just tell people that .equals() checks contents is plain wrong and may cause a lot of headaches, as it's completely depending on what the person who wrote the class decided to implement.
are these professional codebases java api?
Straight out of /Users/blvckbytes/Downloads/jdk-687fd7c7986d/src/share/classes/com/sun/tools/jdi, haha :,D. I literally just grepped around, as I am completely lost in that codebase.
Ah, right, we're talking about the Java-API, I missed that.
Chances are you aint going to be able to use JDI
Whatever JDI even is
it should be noted that sun packages are proprietary and thus JVM specific
IE, openJDK won't have it
Ah, debugging
Eh chances are they have
Well yeah, but as it turns out there is no proprietary code in OpenJDK
there may be some things in the sun packages that were deemed allowed
Or any JDK for that purpose
Yeah, it's probably a bad example. I need to look a bit deeper into it one day. There have to be a few lines of code which definitely decide this question which came up yesterday.
but a lot of stuff under the sun package though is proprietary
Perhaps IBM J9 is propriatary, but it's since been open-sourced
possible maybe, but its also possible for a JDK implementation to just implement something anyways. I just know openJDK is from oracle just open source version
?jdk
The stock JVM is licened under the GPL, so the only thing that can be propriatry is outside it
So the java mission control center (or whatever it is called) is proprietary for example
And thus not present in OpenJDK
nvm
JDK is free again
ever since 17
seems oracle didn't have any luck with that change they did some time ago lmao
That was to be expected
yes, but it took them a while to realize that
What should the Main class look like in the plugins of version spigot 1.18 and higher?
public class PluginName extends JavaPlugin {
@Override
public void onEnable() {
// Startup code
}
@Override
public void onDisable() {
// Disable Code
}
}
I have to import something for "extends JavaPlugin" to work.
if you mean intellij saying that its onEnable and onDisable
Error: "Cannot resolve symbol 'JavaPlugin'"
?google Decimal formatter
Google your question before asking it:
https://www.google.com/
do you have spigot-api in your maven/gradle?
Import it, in IJ alt + enter whilst having your cursor in it
?main
Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or the entire contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.
Please read the release notes for further information: https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-1-release.534760/#post-4305163
Okay, thanks!
How would i make my scoreboard dynamic with my custom enconomies essence and tokens? Would I use a runnnable or hashmap or something? hmm
import org.bukkit.entity.Zombie;
import static org.bukkit.Bukkit.getLogger;
public class Herobrine extends Zombie {
public void spawn() {
getLogger().info("Herobrine has spawned");
}
}```
What am I doing wrong here? Shouldn't the isBaby() method (and all other methods this says are abstract) already be defined in the Zombie class?
No. Your code won't even compile
You're extending a Bukkit interface, which isn't valid
Why? Is there a way to make a class that is an extension of an entity?
I basically want to make it so I spawn the zombie, and can run my own methods on it as well as usual zombie ones
You can't extend an interface
You implement it
You should be extending the vanilla zombie to get the behavior you want
Oh ok, how do I do that?
why do we haveorg.bukkit.util.Consumer if java.util.function.Consumer exists
Bukkit is old
does anyone know a tab completer plugin for 1.8?
Older than the java consumer
Use #help-server
alright il just use the java one, thanks
How do I extend the vanilla zombie?
Just like you extend any class Java
For zombie specifically it's much more complex. You need to do byte code hacks real time and then type 'super duper crazy byte code extends Zombie'
Legit how I feel every time I hear scoreboard or teams
i simply dont deal with scoreboard or teams
my life is great
i also havent dealt with nms or packets yet
I rather deal with packets than scoreboards
nms and packets are fun to play with. I'd hate to make a plugin that depends on them though
What is the name of the vanilla zombie class name though? I couldnt find it
does the bungee.yml has the same syntax as the plugin.yml ?
the nms import for zombie probably
Just use screaming sandals
But i Could add them ? what about permissions ?
okay so its only for name, version and main ?
Have you imported NMS yet?
Its EntityZombie I think
im trying to use worldedit and worldguard but for some reason worldedit does not want to work as dependency in code
it does work as dependency in the pom.xml
do other WorldEdit classes work?
then you are simply using the wrong import
Vector is probably in another package
or it's called Vec3 or something, idk
or it was something in an older version
or a fabric version
im using the bukkit version
but that shouldnt be it
i think wordedit use vec3
yep, the API changed big time between version 6 and 7
tbh i don't even know how i can see that
i can look trough all tabs
or try making a variable
type Vector3 then just see if you get an import option
lmao ur right
that helps thx
BungeCord
Should I use:
ProxyServer.getInstance().getConfigurationAdapter().getServers()
or
ProxyServer.getInstance().getServers()
First option seems to be more accurate as it should show the join able server but has this method a bigger impact on the Server ?
Is it better to get all and check when sending a Player ?
Is there a better way to send a message to all player on a server than iterating over the proxy player list in the Server info ?
Help is there a way to make a function that automatically separate lines if I input a string?
I’m trying to make making lore for items easier
i havent used bungee api but you could probably get a server instance and run broadcastMessage
You can use String#split to split the string in to an array, convert that to a list and use it as lore
Ah I see thx alot
Could find a broadcast message for a special server only for all player connected sadly
Can someone explain me why that code gives me a infinite line instead of a line from point A to point B?
Thread sleep 💀
Whats your recommendation? Im open for tips.
Use run task timer
Thats why i used Threads before, i changed to the BukkitRunnable
or create your own thread
?jd-s It's async-safe?
Doesn't say so, but I'll assume so
hey man, I go remotivated to try to fix my issue. I hope you remember. I activated NMS for my project, how can I have a look at the hit logic? I only know java enough to make minecraft plugins, not much more sadly
It's kind of funny how people start nitpicking on some completely irrelevant implementation decisions rather than helping with the logic problem at hand, xD.
I'd really like to help you, but I kind of have a hard time understanding what you're trying to do, and there are too many undefined functions in that excerpt. Any way you can provide the full picture?
It's kind of funny how people start nitpicking on some completely irrelevant implementation decisions rather than helping with the logic problem at hand, xD.
Hahahah, thats true.
I create that simple example: https://paste.md-5.net/okobazubiq.cpp
Thats suppose to create a line from location to target, but its generates a weird infinite line 🤔
im not too good with vectors xD
how can I read this? Should I need to "plugin.getConfig().getString("books.green[0]")"? Or how?)
yaml.getConfigurationSection("books").getConfigurationSection("green")
something in that way
thanks
for (Map.Entry<String, Object> key : getConfig().getConfigurationSection("books").getConfigurationSection("green").getValues(true).entrySet()) {
Bukkit.broadcastMessage(key.toString());
}
Of course I remember! Well, I don't really know what to tell you, other than that it does require quite a lot of foundational knowledge to jump around in a massive codebase like the minecraft-server and keep a mental model of it's flow of data. It's sad how I myself haven't yet set up a proper environment to navigate through it, because I procrastinate all the time.
I usually use build-tools to build a version, then navigate into it's CraftBukkit folder and use grep -rni '...' src, where ... is what I'm searching for. I searched for new EntityDamageByEntityEvent, to check who creates these events. Then, I saw that it's inside of the src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java, where many events originate. After a bit more digging around, the EntityLiving has a method called damageEntity0(final DamageSource damagesource, float f), which craftbukkit patched to spawn a new event through the event factory when that living entity took damage. I guess this would be the main place to put some "probes into", where one would start tracing this weird behaviour your server produces.
But again, this will take a pretty long time. Have you checked if the event gets fired twice if you get damaged twice already? If it doesn't (like it didn't ever for me), I think that we at least have somewhat of a startingpoint by knowing that. But make sure, really check that.
Do a debug.
thanks a lot! I will experiment a bit on my own with this knowledge and hopefully come to a conclusion
Thanks, I'll take another look at it. I just often times get headaches when looking at other peoples' code and my mind kind of starts closing up, which is why I have a hard time with little excerpts like these, xD. In general, if you want to ask a question in here, try to isolate the logic beforehand into a simple little unit with as little side-effects as possible, so that others can get a hold of what you were thinking when you wrote it. Gonna get back to you in a sec!
Thanks for the tips!!
For making a custom entity, would it be better to make an extension of a vanilla entity, or to make an entirely new class where it has an entity attached to it in an instance variable?
I like the second design
where you delegate
since inheritance is harder to work with as it strongly couples your logic with the already existing base logic
yk
composition over inheritance :3
I really cannot seem to find any issues with the logic you use in your code... You keep track of the distance travelled by covered, and as long as that's smaller than distance, you add space to it every time you add vector to p1, where vector is the directional unit-vector of length space.
Don't quite get what you're trying to do with the outer row loop, but that shouldn't affect anything...
Which is why I think the actual issue has to be with your input parrameters and the way you call that logic.
If you need any help, I'd need to be able to run your exact configuration locally, which in essence means that you'd have to zip up your server directory and send it over as is, xD. Seems like you got a funny build there, as I couldn't even start it last time I tried.
funnily enough, I tried copying my paper.jar over to another folder to test the issue on a server without plugins at all, I couldn't even start it with the same start.bat
but if it works, it works i guess
Can't you just try loading something less "exotic" once and see, if the issue still persists? Like just some simple spigot release of 1.8.8 from any online mirror. I have no idea what all of these forks add/remove from NMS patches, which might cause any additional trouble I'm not even thinking of.
is there a difference between getProxy.foo and ProxyServer.getInstance.foo ?
I tried even less exotic, I opened a lan server for my cracked 2nd account, still the same
and there we go
ye
So how do you test that? Just clicking fast when in combat and checking to see if you get double-damage? I don't know, maybe I'm just too stupid to reproduce it, xDD.
like its the same instance
I put my 2nd account into a hole and started crit-hitting him while clicking fast. Much like in the video i uploaded
but one is through the singleton, and one through the Plugin base class you derive
one is a static the other isn't
so which is the "better" to use
Generally you should go with the normal method and only use the static way when you need it
it doesn't matter ultimately, but for consistency though best to stick with the standards 🙂
so which is the standard ?
As I said, only use static when you need it, like anonymous classes for instance
where to pass something to the class it would need to be static anyways
there's no standard
but singletons are usually avoided in the modern world
since they cause more issues than they solve
(proven in the industry especially)
well when used incorrectly certainly XD
my programming teacher uses singletons 💀
ye
I'm not java enough to understand which is the singleton 😄
on pdc if i were to get an int, if that wasnt set would it return null or 0?
just checked jds, it says null
So in a command if i do not use the singleton i would use an instace of my plungin instead an than use the .getproxy ?
pdc returns you an Integer. Make sure to store it as one and not an int else you'll run into auto unboxing NPEs if the value is not set
ah, so it would just be 0 if not set?
If we're talking about NPEs due to auto unboxing, I'd say you get null if not set, otherwise there would be no reason to differentiate between boxed/unboxed.
ah mk
That’s the point. If you didn’t know, primitives cannot be null, so they will always return something. The wrapper objects have that third state so by default, they are null.
You're accessing books.green, where it seems like books is an actual section, but green is not and returned null, which is why you cannot call getValues(true) on it.
Just remove true?
okey
You don't have the section green in the section books, so you cannot access it. Try having a look at your actual YAML file first, and check if you really write to that section before trying to read from it.
green is not a configuration section, but a list of objects
This is just an unusual format of notating a list. It's JSON equivalent is basically:
green: [{name: ..., cmd: ...}, {name: ..., cmd: ...}, ...]
Usually, you would have a newline right after the - and start at the indent of cmd.
yaml is a superset of json
So...?
Yes, this is a known fact. I was not at all talking about preference tho, I was just trying to provide a more familiar notation to @fallow violet, because they thought that green's value was a map, mapping objects to objects, which is also possible in YAML. It's a list tho, which is formatted in a very unreadable way - but still a list.
do I need to run the ServerInfo.ping() function in a Scheduler for example runAsync or could I just use it directly ?
I am surprised their yaml isn't giving them errors on that indentation
for their list objects
since it should be indented 2 in
I debugged the noDamageTicks variables of all players on the server (just my two accounts), and it seems like the player can still take damage, even if that variable is greater than zero. To be honest, at this point I'm just confused as hell and think that this may be a massive rabbit-hole, xD.
That's valid notation, as there's no ambiguity and the spec allows for multiple ways to notate the exact same thing. One of the many reasons why YAML is a headache.
proxy.getScheduler().runAsync(JoinMeBungee.instance, new Runnable(){
@Override
public void run(){
si.ping(new Callback<ServerPing>() {
@Override
public void done(ServerPing result, Throwable error) {
//my code
}
});
}
});
I wrote this but it feels a bit strange
I don't understand it but I like it 😄
Lambda stuff I guess ?
so I know in client side mods there's the Minecraft class, is there any way to do like EntityPlayer.getMinecraft() just like in forge? but on server side
Every interface which has just a single method can be replaced by an equivalent lambda. This saves time by you not having to create a new anonymous class instance with new.
?nms
it's not "EntityPlayer" but "ServerPlayer" btw
kk
so I'm just browsing through NMS and found some .class files, is it possible to edit those if I wanted to?
?contribute
You can find information about contributing to Spigot at the following links:
https://www.spigotmc.org/wiki/cla/
https://www.spigotmc.org/wiki/guide-contributing-to-spigot/
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/README.md
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/CONTRIBUTING.md
follow the instructions on compiling your own spigot build
what about this 👀
@FunctionalInterface
public interface MyInterface {
void myMethod();
default void myOtherMethod() {
// Code
}
}
a single abstract method :}
smh is that java formatting, those colors and fonts are weird
linux moment
doesnt that match github colors?
ye
looks better than this tho
I'm on linux this is what mine looks like
debian prob has weird defaults
i still dont have nvidia drivers lol
vomit colors
Yeah, what about this? xD
still works as a lamba but has >1 methods
Conceptually, a functional interface has exactly one abstract method. Since default methods have an implementation, they are not abstract. If an interface declares an abstract method overriding one of the public methods of java.lang.Object, that also does not count toward the interface's abstract method count since any implementation of the interface will have an implementation from java.lang.Object or elsewhere.
is that real discord?
does that include all the files by mojang? like not just the ones supplied by buildtools, but every .class file in existence. also please ping me on reply
yes
i dont believe you
its just custom css
you would still need something to parse that
open asar be like
all you have to do is edit the current values within that app you don't have to inject new values
Because you have a default implementation on the other method. I know, my definition wasn't exact, but I dislike the default keyword which is why I made myself forget it's existence, lol
I am trying to protect the blocks from a list from being destroyed by explosions but it seems it does not work.
what am I doing wrong? 🙂
To be fair, there can never be an object with a single method
Hi guys , i have a problem.
When I restart the server , spawn resets ...
How do I get it to save in config?
new discord experiment is adding custom themes
config.save()
o i have missed it , thanks
That's why I talked about an interface specifically in my first answer on this, as the Object base class of course brings it's whole API with it. These interfaces act like a function type, as often times indicated by the FunctionalInterface annotation. Kind of like a function pointer in C. Lambda functions are just syntax sugar, as they are in cpp (I'd assume).
All interfaces are objects
obviously, what else would they be lol
interfaces are classes and classes are objects, yeah
In internal representation, but... what? How? I'm confused about that tbh
Class<Player> playerClazz = Player.class;
interfaces, in bytecode, are just classes that have the "interface" flag set
.class is internal representation in my mind. But the interface itself is just a contract, and when used with a lambda, it only defines a single method. I think that we're basically talking about different levels of abstraction.
at least I think so. geol knows more about bytecode than I do, so maybe he can confirm it, or complain if I am mistaken
every class is an object in java
otherwise reflection wuoldn't work
Yeah, of course, everything's an object in JS too, but I would never think about that when explaining to somebody how lambdas work with interfaces. This is an implementation detail which is not of interest when ig comes to this limited view I was getting at.
well not everyhting is an object in java
for example primitives
that's why you cannot return "null" from an "int" method e.g. lol
Yeah, sure, didn't mean to suggest that. Just drew an anology.
Hey sorry I don't know if I can ask this question here but you know a BungeeCord 1.19.3 npc plugin ? Please
Ok thx
Maybe my views on things just need a little update. I always imagined interfaces as this inert type which have no functionality, where .class is kind of "auto-generated" code and just tells implementers what their function tables have to at least contain. Well.
what does this mean in my plugin
Sir this is spigot
i mean its a plugin issue not paper i would think
recreate the issue on Spigot
idk how it originated in the first place
Thread.sleep?
non of that
Or while (true)?
We need the code probably
Either way, see if you can reproduce the issue in spigot. Otherwise, paper isn't really supported here.
Does not sound like a paper issue
its on a paper server but not using paper api
Or actually, MinecraftServer#stop is getting invoked
doesn't matter
So did you shut down the server?
SpigotMC maintains the Spigot server. If you are using a fork of Spigot (such as Paper, Airplane, Purpur, or other derivative works), you should seek support in the appropriate Discord servers.
ill see what paper support say
Show us the whole stacktrace and then I can help (even if the other fools cannot)
Imma try to help you on paper lmao
Don't - you'll be laughed at if it is what I think it is
let me dive back into the logs i just snapped that real quick while it was there
We need the C - o - d - e
I cannot give you that
Nah, stacktrace is enough here
The "Supressed:" thing is already a good enough clue of the cause
Then we probably cannot help
What do you think it is? Just curious.
Invoking a command while stopping the server
Good idea
Oh
Or likely invoking /stop itself
why am i even in the paper server
Well, I would have been way off then.
Why not?
why would i
Because they are helpful if you have a problem
You also see above that the server is experiencing significant problems with watchdog
im not using their api either
So it is also possible that watchdog killed the server
im only using their fast reload command
Yep watchdog
Oh, that was what I thought about. That they block too long somehow, and the main tick loop obviously doesn't allow that, which is why a watchdog triggered
I was told to post that
To quote md "Sir this is spigot"
?whereami
How many threads do you have ... Jesus
Got flashbacks of the watchdog in freertos of the ESP32, haha
You are running a paper server so ask in the paper discord.
I said i would go paper but was told no
Reproduce the error on a spigot server or ask on paper
So people here won't cry about it ;)
[23:17:21] [Paper Watchdog Thread/ERROR]: AndyisBlocks-1.0.jar//me.justacat.andyisblocks.structure.Structure.<init>(Structure.java:38)
[23:17:21] [Paper Watchdog Thread/ERROR]: AndyisBlocks-1.0.jar//me.justacat.andyisblocks.structure.commands.CopyBuild.onCommand(CopyBuild.java:54)
These two lines of code deadlock
i was told to be here. not of choice
So you won't be kicked/banned
I did go to paper
Is it that hard to substitute paper.jar for spigot.jar and retry? You're likely gonna get the same issue...
AndyisBLocks fucked up in Structure line 38
Thats the same thing
Try running it with -Xmx1G -Xms1G - don't run it with more ram
i once crashed the jvm with worldedit 💀
all threads decided to throw an out of memory after a while
99.8%, yeah
If it crashes the fault is in onCommand, otherwise it is in your constructor
I will not post here anymore of this issue as md is mad
This channel is full of idiots anyways
Stacktraces? What are those? Never heard of em?
Think you should have gotten enough ideas by @geol on what's the issue anyways, you should be able to track it down now using common programming logic.
got banned there? me too
Its not a case of being mad. It's a case of This is support for Spigot not forks. Your issue may have many underlying issues/causes and we won't waste time chasing bugs introduced in forks. Replicate the issue on Spigot and we'll be happy to help
For what?
Did not see your messages there, hmm. Bro, just replace paper.jar with spigot.jar and come again
the issue clearly is their "Structure" clas in line 82
whats the player equivalent on bungee
has nothing to do with paper vs spigot
Don't try to understand
You can't bring senses to the senseless
Look i don't want to talk more abt the issue here as i will get banned. and I kinda need this server
found it, proxied player
the only way to get banned here is to post homophobic or racist messages
It's literally a pure logic issue, yet people love to be butthurt about the detail that the stacktrace contains the forbidden word paper.
That's why minecraft server modding is at the stage and place it's at, lol.
Yes but he is gonna get yelled at when coming here with "paper-issues", so this is just for the future
or advertising
or ignore warnings from md5
Thats what I mean
yeah that's true too
What have i caused
a certain canadian doesnt like advertisers
Funny how you all seem to have no problem refusing to help offline mode servers
nothing, this channel is always just a weird off topic spam
Bungee server
actually...
There aren't that many out there
The rule is if you want support from this server, you use Spigot
erm all big servers are offline mode bc of bungee
I help with offline, if they have a reason to be offline other than piracy
You have been warned, that should be the end of it
I always refuse help straight up for them. Unless bungee is used. Unless bungee is offline too :p not just because of piracy but all the issues it brings for uuids etc..
Uhm... that's not how offline mode should be defined, xDD.
Mate. Do i look like im the one wanting to continue this
did I misundertand sth? all backend servers are always offline mode and have "bungeecord: true" in their spigot.yml
You (plural)
Thats right
I am not sure what md5 is talking about, did I say sth wrong or anything?
Yes, but some people run bungee in offline as well.
i think its the stuff about no paper help and that
ah ok
What matters is that the player connection has to be authenticated against mojangs API. If the proxy already does that, why would the subserver have to be in onlinemode then. You cannot pass without having payed for an account.
yeah sure, bungee handles that
am i correct in saying ProxiedPlayer player = ProxyServer.getInstance().getPlayer(vote.getUsername()); would get me a player if they are online on any of the servers registered on bungee
Dear md5, why is there a problem with it when its clearly a plugin logic issue, not paper issue?
We use the correct security measures to lock the backend servers to only allow traffic through the proxy
@naive bolt show "Structure" line 38 pls
||blocks.put(new Vector(x, y, z), block.getBlockData());||
Because this is the spigotmc community
I already told you why. This is Spigot support. We help anyone USING spigot not a fork
It is mostly a surrounding line
So im not welcomed when I use paper which basicly uses this software?
huh weird. maybe you indeed have to ask on your fork's discord instead, because that code should not kill the server
💪🔨
paper is a fork that changes a lot of stuff internal
correct
Correct
Bruh
what did you expect
I'm safe then xD I don't even own a server an my plugins are all in spigot api currently xD
if person A forks my stuff, and calls it B, then person C comes and has an issue with A's work, why would I have to answer?
I also use paper, but whenever I encounter an issue, I always see whether spigot has this problem too - if yes, I mock people here, otherwise I don't
what could i call a method that gets, something in a database then raises that by one and saves it back to the db
imma go to paper and they will start crying that im using 1.19.2 and not .3 like they always do
I expect people to help with literal spigot issues without crying that the word "paper" appears in a log. But lets just leave that, or else im gonna get banned probably
.getAndIncrement(...)
thats smart
Please leave that now
do you want a gregg
paper causes many issues though. it's normal that we ask you to use spigot if you come here
Mmm grilled egg
md simping for greggs again lol
Never seen that xD
what about nuggets
anyway, paper often has serious buggs. e.g. in paper 323 you couldn't use Player#chat(String) without it throwing exceptions, while it worked on spigot the whole time
so yeah, we cannot help people who use paper
?whereami be like
Continue this conversation at your own peril
Sure it does, but sometimes it is just normal plugin issues
The position is clear

sry. I just wanted to explain the reasons of why ?whereami is a thing
The issue, is that if they are using paper, paper has changed the spigot code, so it's harder to debugg the issues. As It may be paper related. We don't think what they change exactly in the spigot code. So what may work fine on spigot, is completely different in paper.
In other words: the next thing about that topic gets a 🔨
a hammer
a
more like
yes, sometimes. but not always. and that's why people are expected to use spiot when they ask for help on spigot's discord
I mean, you also wouldn't email the debian mail list when you have issues with ubuntu, right?
So next time im asking for help here, I should run the same thing on a spigot server first and then come here?
alex you probably want to stop before md smacs you
exactly
Thats an issue because some things need another software to work
?fork
SpigotMC maintains the Spigot server. If you are using a fork of Spigot (such as Paper, Airplane, Purpur, or other derivative works), you should seek support in the appropriate Discord servers.
I must be still tired. I swear you said "want to shop"
thats happened to me while wide awake
then use the "another software"'s discord
Damn I'd love to continue this discussion but 🔨
I’m confused. Most plugins work just fine on spigot due to the whole compatibility thing paper has with spigot. So testing plugins on both jars should work in most cases.
depends on yoru backend
executeUpdate(...) ?
(Which, in a lot of cases, might not help you if its a small fork)
i got a real question what processing charges do you get on the donations for their to be a $10 minimum?
actually in the statement
as in? like what type of sql?
yes
mysql
yeah but that's not our fault. I mean, if you use spigot, you can ask here. If you use something else, you have to ask somewhere else
If I have a function that uses the paper-api and also needs a paper patched function, it wont work with spigot
paper lib
REPLACE INTO
thanks
I think the main issue is that they very likely have another watchdog implementation at paper.
But again, this was not specific to that, but a general logic issue. Every server would've died, just maybe in another way. Which doesn't affect the solution.
So basicly if I fork spigot and change 1 line of code, im not welcomed here
🤣
How is this still a point of contention
add a comment to the code
people are a little slow of understanding
No if's, no buts, clear as crystal
nobody ever said that. But you cannot expect to use <random fork X> and then expect spigot people to help you
/thread
Maybe because some people are passionate and would have really loved to solve that deadlock/timeout issue and are now hurt because it got stomped into the ground.
In my opinion, thats an unlogical thing but aight
nobody said that
Oh yes they did
no
?fork
SpigotMC maintains the Spigot server. If you are using a fork of Spigot (such as Paper, Airplane, Purpur, or other derivative works), you should seek support in the appropriate Discord servers.
It wasn't stomped. Show it happens on Spigot and we'll help
I found a file located at C:\Users\USERNAME\.m2\repository\org\spigotmc\minecraft-server\1.8.8-SNAPSHOT\minecraft-server-1.8.8-SNAPSHOT.jar, is this the deobfuscated server jar? I noticed that it has more files than the BuildTools output, including the com.mojang libraries, for example
nobody said that you're not welcome here anymore
Yes
no. everything below 1.17 will always be obfuscated
Well spigot deobfuscated
This is not an actual thing, just an imagination what happens if I fork and change 1 thing
It's basically what plugins hook into if they use the spigot api
yeah okay so let's call it "half-way deobfuscated"
Kinda was, don't think the person originally asking this is still in the mood anymore. As am I. I'm out at this point, this conversation is not going anywhere anyways.
Does anyone here know any reasons to use something like packetevents over protocolLib?(I just want to know like what benefits and cons their are to both. Not asking for opinions that X is better than Y just wanting to see what they can do so I can decide what to use).
called it
so is there a way to recompile the decompiled source code? i loaded that up in maven
I fail to see how that is illogical. Just because two things have similarities does not mean they are the same. Spigot has its own set of changes, paper has their set of changes. The only line of similarity is that paper forked off of spigot. Meaning that they changed things. Just because they stated compatibility does not mean they didn’t change things under the hood.
ProtocoilLib is messy and annoying. The api should be used in favour of messing with packets
It will be full of errors that's why only the needed files are added
Lmao
Next person to say a word on the topic gets 🔨
so is there any way to modify the code of the minecraft server.jar? even spigot server.jar but with full access to every .java file
So your saying I should work directly with packets using spigots API ? or what API are you referencing.
Why would you need to?
MCP/Forge. You're not going to need every file though so just add what you need and fix the errors as you go
Yes follow the ?contribute link to see how to build your own jar
then it's no problem ofc. You just have to understand the following: forks like paper change like thousands of lines of code. If now you encounter a bug, this might or might not be caused by those changes. You are supposed to check whether this bug is also present in the "original" spigot .jar. If it is, feel free to report it. If it's not, report it to the fork's devs you are using.
I e.g. have encountered a ton of bugs that were only present in paper, but not in spigot. And I always reported them to Spigot, because I thought "if it's in paper, it's in spigot too", although that's not true. So I accidentally made many people spend their free time to check out something that wasn't their fault. And that's not good
Is there a particular reason you want packets. Because the api can do a lot that the packets can.
With that logic: If I have a jacket and add a jacket pocket to that, thats a whole different jacket
I was told the only way I could make a player completely invisible(including armor) while still having them be damageable was to mess with packets.
Make a thread. I ain’t trying to get banned.
Continued Discussion
well i was hoping to just play around with every library, the com.mojang.authlib stuff intrigued me as i'm thinking about making my own game so i would like to see how mojang did it and do something similar and wanted to play around with that, is it possible to modify those files?
Packets aren't going to allow them to be damaged because the other players client won't hit them
When I'm merely making it appear that they don't have armor using it?
I suppose you could raytrace server side, but that still doesn't need packets
am i correct in saying statement.setInt(1, newInt) and statement.setString(2, uuid.toString) on "REPLACE INTO `simp_votes` (`votes`) VALUES (?) WHERE `uuid` = ?;"
I am using packets only to hide the armor. I use regular invis to make the body invis
If the body is invis the armor won't show
nice the thread was deleted
it starts at 1 yes
Not anytime I've tested it even in latest version
yes
or at least not while using invisiblity potion
stopping the discussion vs moving it to a thread arent the same thing
thankos
Oh you mean potion not full invisible
How else would I make them invisible?
hidePlayer
It would be nice if you could hide armour. Like a getarmor.hide so you can wear amour but have it hide if you only want to show player skins an not cover it. Or only show specific parts or amour
What about hideEntity?
What about sendEquipmentUpdate to remove the armor
hideEntity doesnt hide them from tab iirc
Is that API?
That’s a thing?
declaration: package: org.bukkit.entity, interface: Player
When was that added? That’s a really nice addition.
At least a few years
Pretty sure it's been in there for ages
Tf. Guess I never noticed it.
Check the docs more often :p
md how come donation limit is minimum $10
Because there's overhead and also if you can't spare $10 you probably need the money more
paypal overhead isnt that bad is it
Donating does have its benefits. I've done it. Years ago though haha
i ended up donating to mcm just to change my username
Good for you?
md_5 does sendEquipmentChange persist across server restarts and/or player disconnect/reconnect?
No, it's basically just packets
Hey md. Is there a way to better link the javadocs to the discord commands? Smth like ?jd-s Player#updateInventory() and it return an embed with the description of the method? Also a direct link to the page.
You could make one
is there a mysql thing to check if a string is already set?
or would i have to query all and check each
Someone did do one but it was very intense
Like it required parsing the javadocs into a mongo database and all sorts
cafebabe is python based right?
?info
md_5#0001
This bot is an instance of Red, an open source Discord bot created by Twentysix and improved by many.
Red is backed by a passionate community who contributes and creates content for everyone to enjoy. Join us today and help us improve!
(c) Cog Creators
yes
And java
You can put lots of things behind a single bot
cafebabe is java?
I know there are some bots that do it for certain apps, but surely it doesn’t need to be that complicated. Web requests aren’t that hard.
very d.py outdated
didnt discord.py get ended then revived
Yeah the javadocs already has an index it uses for the search bar
Pft, just create those javadocs on the fly
thats what the shitty ide oracle spat out does
Eclipse does it (and probably any other IDE), so why couldn't we?
@eternal oxide would i be correct in saying if i wanted to check if a mysql collumn already contains an exact string wouldi use SELECT * FROM table WHERE column SOUNDS LIKE MySTring ;
Any dev's down to work with us at beyondpvp?
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
We're getting enough mistreatment around here already
wdym
you can use =
like have different purpose
like without % and i forget the other is like useless iirc
so SELECT * FROM table WHERE column = MySTring;?
Eval? Gradle? Scary. Looks helpful though
eh i only use maven cuz im too lazy to learn gradle
I mean it has like a gradle command and stuff
the best advice ill give you md is dont use kotlin
what i meant is that i can copy paste the pom and i only need to change name and version, ie, a working system
which
i wont change since it works
What about the bot DocDex, that does it already.
Yeah that's the mongo one
I know a couple other discords use it, doesn't look bad. very useful haha
maybe should just write a github wiki on the whole api 🧑🍳 👌
Maybe more reason to invite it here?
delete: Deletes collections from mongo then stops the app. This is used by the updater subproject, once again, you won't need to use this command.
Docs still reference mongo
anyone that mysql's would "SELECT * FROM my_table WHERE categories LIKE ?"; check if it contains value that i would set ? to
or do i use this
here is example of jda butler, looks really cool imo
isnt like used like %something else%
no clue
like a kind of regex
yap
i used to learn that stuff in highschool
i just need to check if my collumn contains a string already
i think theres also _
i dont mysql
Does anyone know how to get all online players? I'm trying to use getOnlinePlayers() but can't seem to figure out how to call it.
if you want exact string use = if you want "regex" like use like
Bukkit.getONlinePLayers
ah kk, thanks
LIKe basically means similar to
can i use = ? to specify the string elsewhere
So it would match anything similar to what you add it
theres also WHERE categories regex "some regex"
how would i specify this ```
"SLECT * FROM simp_votes WHERE uuid = ?;"
that would select all records where the uuid is the exact same as the param
If you spell select correctly 😉
ye
execute would work too but it doesnt returns a resultset iirc
ResultSet rs = statement.exexQuery()
yeah ive got that
if (rs.next()) // found a record
execQuery() is for UPDATE and INSERT etc
wait no
it's execStatement(), isnt it?
tbh no clue
so if thats passes it already exists?
it acts like a cursor that stands before the first record found
next() moves it down and returns if theres something there
if theres a next you can call rs::getString and that stuff
so if it doesnt exist it (rs.next) would return false
yes
ternary operator party
i can just tell you to read the docs
no clue which i would read tbh
How do I use sendEquipmentChange to make the armor appear as air? More specifically what value do I use for the 3rd parameter?
you send the entity, so player, the slot eg chestplate, andt he itemstack you want to display
so air
declaration: package: org.bukkit.entity, interface: Player
According to that you can only use obtainable items which air is not
do it anyway
So new ItemStack(Material.AIR) doesn’t work?
It was complaining that a method call was required
ItemStack.AIR when
never probably
still doesnt say what kind of air 🥺 cave air
.isAir()
nvm I tried it again and it works just fine...
fuck its already 1 am
you better stop lying
quiiiick question I'm a newer developer, why is player health represented as a double? Can't it only be a whole number?
u can take more precise amounts of damage than half hearts
Half hearts etc..
most things just dont do finer than half hearts
example
protection enchantments usually result in non-half-heart numbers
since they're percentages
got it
not flat decreasess
kinda stupid imo, but ty
anyone know of decent bungeecord tab complete examples?
eh just keep in mind 1 heart = 2 hp
Anyone know how to reset whats done by sendEquipmentChange?
(guessing here) call an inventory reset, iirc theres a method for that
sendEquipmentChange fakes a players gear changing
You'd have to just call that method again with whatever is in that player's slot
player.sendEquipmentChange(EquipmentSlot.CHEST, player.getInventory().getItem(EquipmentSlot.CHEST));
or whatever the method sig is. Close to that
Because remember, the server still has the real item
Yeah I'm trying that. I had thought it would either be more complicated or their would be a different way of doing it.
Is their a way for me to create an iron golem that acts like a wolf would?(As in protects the player from things that attack it and attacks what the players attack?)
And if so how?
uhhh
if u do that u need nms tho i believe
you can just check for nearby blocks at a given radius and delete them if they're lava
it looks like it's 6
the diameter would be 12 i suppose
i went in game
the air blocks inside the clay seem to be the shape of the blocks the sponge takes
it also behaves very inconsistently for some reason
I can't find the interface Enemy, even though the docs say it exists. I'm trying to find a way to know if a mob is hostile (aka a monster) but some mobs don't extend Monster, like Phantom, even though they should...
It was added in like the last commit or two
It's very very recent. 1.19.3 only
If you're on .3, update your server
oh darn
well I don't wanna update for now, is there another way or do I have to manually check ?
I mean Enemy consists of Monster + a few other interfaces, so you could instanceof check them all if you'd like
public static boolean isEnemy(Entity entity) {
return entity instanceof Monster || entity instanceof EnderDragon
|| entity instanceof Ghast || entity instanceof Hoglin
|| entity instanceof Phantom || entity instanceof Shulker
|| entity instanceof Slime;
}```
A little ugly, but that's in essence all that Enemy covers
It's very very recent. 1.19.3 only
well I don't wanna update for now, is there another way
If I have created a custom ability and want a way of deactivating it prior to it finishing if an event happens what would the best method of marking the player as having the ability active(To then check for active players). The ability basically is just potion effects and currently I check for them having the permission to run it and the potion effects. I realized that this is a bad method of checking as it can activate at the wrong time. My first thought was to just add a tag to the player but I don't know if that is a good method or not.
Does this also work for for example nms EntityZombies?
Are the abilities persistent or do you wanna lose them at server restart?
These are bukkit interfaces, nms classes will not implement them.
Yeah thats what I thought
So that will not work for custom mobs
If another plugin is using custom monsters, this will be a problem
If its the same plugin with custom monsters, you can just have a master method and then register all your mobs to it
i read custom monsters as something very different to start with
Ehh not that unrealistic that any other plugin uses them
We got something way cooler tho, IMonster.
Sheeesh IMonster
No idea at which versions this is available tho, as I never used it, xD.
Same
Oh, no, that's not how that works. If you only work with the bukkit API and you query the world for entities, bukkit will return you with a wrapper which then again works with it's own interfaces.
Custom monsters = nms
I mean they should last through server restarts but some of them I haven't set up to be that way yet.
Then you got to use some data storage like PDC
Or if you are planning to code a complex PRIVATE system anyways, you can use a database
NMS is the whole foundation, so that's not going against what I said. If you have Plugin A which creates a custom NMS entity and adds it to the world and Plugin B queries the world's entities through bukkit, it will get a bukkit Entity wrapper with it's handle pointing at that custom NMS entity. Bukkit interfaces will work on that wrapper.
Wow I did not know that it would work with that
So if I use getHandle I just get the custom nms entity again
Right exactly! :). Bukkit just has a thousand different hooks and wrappers, but still has to operate on NMS, as that's the true workhorse.
Thats insane
I also didn't know about all of it's inner workings for like the first two years I developed plugins. The basics are the following: You can download an obfuscated server.jar by using mojang's version manifest JSON for each available version there's a client for. In the early days, the team had to manually deobfuscate and create their own mappings, nowadays mojang kindly enough provides them for us. Then, they would go into this codebase and add their custom code (event calls, wrappers, injections, ...) until the whole bukkit API was supported and working. Then they basically run diff and create difference files, which later again can be applied by the user locally, which avoids having to share modified mojang code (illegal, due to licensing).
Bukkit is an API, CraftBukkit is it's patch-style implementation. But at the end of the day, NMS is and always will be the server, as it's immensely complex, huge and cannot be open-sourced due to trademark bs.
It's crazy if you think about what this community is actually pulling off, lol.
Its crazy how much is behind a quite "simple" minecraft plugin
is there any way to modify the code of the minecraft server.jar or even spigot server.jar, but with full access to every .java file
?stash
?contribute you dont need the cla or pr stuff but this tells you waht to do
You can find information about contributing to Spigot at the following links:
https://www.spigotmc.org/wiki/cla/
https://www.spigotmc.org/wiki/guide-contributing-to-spigot/
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/README.md
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/CONTRIBUTING.md
Just goes to show that if a community truly loves a game, it will be modding it, no matter the obstacles ahead.
excuse my lack of knowledge but what is cla and pr
and which of those 4 links XD
pr = pull request
cla is required to contribute to spigot
the 3rd is what you need
might need 4th
CLA is basicly a legal thing so the copyright allows spigot to hold your code or something I think when PRing
(Correct me if im wrong)
?cla
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
that explains it
so the contributing thing will straightup let me compile a server jar. will that require me to actually give the jar to spigot?
Well, BuildTools has to build that stuff from the "OEM" obfuscated server.jar locally, so you could intercept it's stages and add your custom code to it, while having full access.
Don't know how easy this will be, as buildtools seems kind of restrictive (with applying unofficial mappings for example).
no
you can edit your code and use it
i just send the contribute link because it has the docs you need
?stash what you need mainly is stash been as it has spigot code, and https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/README.md
Yeaaaaah, these links are a good start, but oh boy, if you can actually understand the whole chain which pulls this compilation off from only reading that, then I have to take my hat off to you.
Looking into the source of BuildTools is a great hands-on start, but heads up: It's spaghetti-code... lol.
do I need to do these
?dmca is the entire reason the cla & stash exist
An unofficial explanation of the DMCA can be found here: https://www.spigotmc.org/wiki/unofficial-explanation-about-the-dmca/
nah
or is that just if i want to send the final jar to spigot
kk
good cus i dont want to wait 24h
thats just if you want to contribute the code you change to the project
Whats the best way to learn NMS?
?tas
thats pretty much it
legit try and see
just try and make something
it works or doesnt
?nms is a help for getting setup
@echo basalt has a forums post about it that has some useful info, but that does by no means cover most of it
I don't even know how to setup NMS...
.
read that article
i notice this guide uses BuildTools, but i was hoping to use every class in the server jar, not just the ones buildtoolos shows from NMS
you would get remapped mojang from that
and importing spigot gives you every class you need
unless you want to use obsfucated nms stuff
that falls into the category of every class in the server.jar
BuildTools of course has to include every single NMS class, as the final output jar has to be a fully featured minecraft server.
why would you want obsfucated nms
mojang released there obfuscation map, there is no reason to use obfuscated
except im dumb and need every step drawn out for me
or maybe because i should go to sleep soon and im tired
is there any way i can straightup download a zip folder with full deobfuscated decompiled code with a build.bat file (or an equivalent build file)
If you just want to understand the process of obfuscation first of all, you could try the following: download the latest server.jar from https://minecraft.fandom.com/wiki/Java_Edition_1.19.3, as well as it's obfuscation map (for the !server!). Then download enigma deobfuscator, build it and run the swing build (easiest to use). I think that recent versions of server.jar are a bootstrapping type of wrapper which have the real deal inside of META_INF, so you have to unzip the outer jar and extract the inner jar. Open enigma, load the jar as well as the obfuscation map as type proguard, let it run and save the jar. Now you can view deobfuscated NMS code without any other additions and play around with that.
But well, no, due to legal bs.
Yep, it is, if you basically mimic BuildTools behavior on your local machine and skip the final compilation step.
like i want all the nms and mojang classes
I don't know enough about BuildTools, maybe it caches that result somewhere and you could actually get your hands on within the next few minutes. I find it so immensely unstructured and unclear that I avoided thinking about it for the most part.
am i allowed to ping md 5 they were talking earlier to me about this
they happened to bein this channel
idk if we can ping
no
sad
To be completely honest, I think you have to go through this yourself. It takes discipline and time, but you'll learn a ton.
i really want a way to change all the NMS and com.mojang classes to my liking
ill figure it out tmrw
rn im tired
lol
Since I also need a solution soon, I can maybe provide you with some of the utility scripts I'll come up with.
but one big problem is that intellij cant find uses for some of the classes in com.mojang
but obviously theyre used
like duh
If the codebase compiles, the AST and symbol solver in IntelliJ should be able to find declarations, uses, inheritances, etc with ease.
This functionality is pretty basic and should be supported by most IDEs.
i must be using the wrong folder
i decompiled a jar file i found at C:\Users\USERNAME\.m2\repository\org\spigotmc\minecraft-server\1.8.8-SNAPSHOT
and buildtools didnt show all those classes
but now it cant find the uses
cus theres no like pom.xml
and proper project set up
its just a decompiled jar
Yeah, all of this is pretty confusing. I also don't feel like going into the rabbit hole today, but as soon as I understood how to properly work with that myself, I'll let you know.
I still got a huge idea ahead where i need decompiled and at least partially remapped code from 1.8-present, so I need to automate generating patched source anyways.
the code is all on stash, running bt with remapped/mojang profile would add that jar to your maven local
i dont think you can get decompiled & deobsfucated code pre 1.14
💀
You won't recieve much support for 1.8 here
Decompiled always, deobfuscated partially, because the community has worked on mappings to make the patchwork easier.
It's legacy as fuck
well yeah
That's called nostalgia, most people don't get it.
No people still use a super outdated version for strictly pvp
9.9/10 people don't care about nostalgia
Because it was just better, in every way.
You can simulate it using plugins
Not just about pvp, you can easily get the same style of pvp on latest.
But all that clusterfuck of so called "new features".
If you don't like how current plugins do it make your own
I don't actually play minecraft, but thanks for giving me that freedom, lol.
pings me
doesn't link tutorial
does bungee not have a way for me to create items?
Hey Hey Quick question as the PlayerPickupItemEvent doesn't get fired when trying to pickup items but with
an actual full inv. What would be the most efficient way to check when players try to pickup items?
Do I have really to compare the current location of the player and the item which is laying on the ground?
Thanks in advance!
if there inventory is full pretty much, because the item cant even be attempted to be added to their inventory
What are you trying to achieve? Maybe there's a more elegant solution out there, which we can only think about if you share your goal.
Goal is if the inventory is full and he is trying to pick it up its getting stored somewhere else instead, so "picking it up" but not to the player inv @remote swallow @dry yacht
idk if this is possible but you could see if theres a packet to send inventory change, you could have a fake empty slot that could pick items up, except that would only work if 1 type of item was on the floor. or you just listen to move event and check if theres any itemstack entities on the floor where player is
what do you mean by create items
i couldnt create ItemStacks, then i realised i couldnt create inventories without packets so i just made it have a spigot half
Going through all items and calculating the distance squared to a player while having to compare against known pickup suction values would just be a nightmare and pretty wasteful, in my opinion.
Seems like NMS already has a method on EntityItem, which checks if it's being touched by a player. We would only need to instrument that to fire some hook. But well, it's starting to get complicated again, ^-^
Anyways a big thanks for that! 🙂
I'd love to solve that issue tho, it's just that I don't know if I still have the mental capacity left today (pretty late already, xD). There has to be an elegant solution, I'm quite confident about that.
yea think so xD May we can find something as I have something pretty neat in mind about a feature for an upcoming plugin
Kinda bulling me rn haha
I feel you, it sucks to see the solution right ahead but not being able to hold it in your hands because of stupid limitations due to legal bs and the ego of humans. Well, I'm sure we'll be able to hook into this somehow.
Somebody wants to help me doing a call with a fantastic BlockBreakEvent plugin?
👀 😉
What a question, lol. Not quite sure what you mean and what your issues are.
hey guys, i want to create a world with only one pillar per chunk but there is a problem. the structures and the trees are generated after my custom generateNoise function. how can i fix this?
Are you using a ChunkGenerator?
Yup
Chunk coordinate 0 0
what does Bukkit.getOfflinePlayer(String name) return if there is no minecraft player with the username?
null i would guess
is there some way to tell if the player is an actual player?
you could probably attempt to get their uuid
because if a name doesnt associate with an mc account it shouldnt have a uuid
an OfflinePlayer object simply
hi, i'm just messing around and i created a listener that listens for a player join or a chat and sends a message. before all the messages sent by the plugin there's this weird little character. does anyone know what this is or how to get rid of it?
i don't think i have image perms but here's a better screenshot to show the issue
ahhhh okay thank you
i just realized i can hover over it and see that lmao sorry for wasting your time
np lol
@dry yacht I found a solution that works for me. My server is a soup pvp server, and it is usual to reduce the damage by 25% on these types of servers, to make the players able to survive stone sword damage without their fingers falling apart. My method of doing this was by only reducing the damage if it is above 2, which didn't count in these annoying crit-double hits, which happened to interestingly always be 1 heart, and then instantly the normal attack damage after.
I compared it to a fight I did on another soup server, and realized that this also happens there, I just didn't notice before. Instead, the "pre-damage" is only .5 hearts (or .75, if you will). So, I changed my method to only apply *.75 damage when the player has an item that deals above 1 damage in their hand, and when the event Cause is ENTITY_ATTACK. Sure, not a real fix, but my desired behavior anyways.
Some things turn out to be simpler than they appear to be lol
hi
is there a way to cancel all lighting updates when adding or removing blocks with plugins?
hi guys, what can this error say?
that is empty check isnt needed
content is null?
Help? What am I doing wrong
oh, thanks, sorry path was written incorrectly
Specifically from explosions of everything? Cause there's also a BlockChangeEvent or smth similar
All explosions, the blockbreakevent is working but I cannot figure out how to make those blocks from the list invincible to explosions
https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/event/block/BlockExplodeEvent.html#blockList()
You might need to use the blockList() instead of getBlock()
declaration: package: org.bukkit.event.block, class: BlockExplodeEvent
Also a handy thing is, to make early escapes from loops. You can use continue; to skip the step in the foor-loop or break; to just stop the for-loop