#help-development
1 messages · Page 280 of 1
Well, nevermind. Redundant information then, lol
Does anyone know the default movement speed of a mob?
wtf github. It's basically not using java at all, more like 95% XML and 4% VTL and 1% java lol
It's an enum that gets information from database
I mean PlayerStat
PlayerStat.KILLS is not a ToIntFunction
so like PlayerStat.KILLS, ELO etc
a toIntFunction is for example Integer.parseInt
basically any method that returns an int
:: is the object reference operator in Java, so yes, only works for getters.
hm nah
I used this site as a reference when I tried to simulate my own physics for entities once: https://minecraft.fandom.com/wiki/Entity#Motion_of_entities
it works with every method reference
Arrays.stream(new String[] { "string1", "string2"}).forEachOrdered(System.out::println);
it works when the parameters match
I left too much room for interpretation in my statement there. I meant it will not work for a direct field reference (as one would often actually love to use), but only as a method reference, which in this specific case had to be a getter. Of course, the method reference basically works on all methods if the method's signature satisfies the functional interface of that parameter.
true
Just sad that it doesn't work for field references, :(.
I mean something like myMethod(MyClass::fieldA), where the method would receive a field reference which it then can call get/set on in combination with an actual instance. Something like the reflect Field, but actually without all the stupid overhead, cause the actual field location is known at compiletime.
ah ye
I mean, maybe the compiler collapses something like Playground.class.getDeclaredField("inv") down to a direct field reference (as IntelliJ also already knows what's going on and suggests string values), but it still hurts my eyes and is not directly a symbol, which is why a field rename would leave this reference unchanged.
it always gets called
threadpool
Yes, it indeed does. No matter how the player left the server, the worst possible situation is that it's called when the socket times out. But for all other cases, it's called, even if a call may seem redundant (PlayerKickEvent). The kick event is just another abstraction on top of the quit event.
I'd appreciate if anyone can help me make this.
List<Integer> toReturn = new ArrayList<>();
for (UUID uuid : getAllUuids()) {
int kills = ProfileManager.getProfile(uuid).getStat(PlayerStat.KILLS);
toReturn.add(kills);
}
return toReturn.size();
}```
My current code which doesn't work.
Basically I'm trying to get team kills and combine them together. Later on I'll divide them by the number of team members and get an average
I don't think you ever will, xDD
why do you keep returning the size() instead of the sum
what exactly is your problem
I don't have sum
oh wait
fck I'm dumb, my bad
lemme try, thanks
how can I get the file from a Plugin object?
I have a problem I cannot seem to think of a way to do. I am saving players inventories in a database so I can sync 2 servers progress and players can keep progress across both of the servers. People have already played on the server and have stuff in their inventories. I was going to do something like this: When they join find their inv and set it to that, in this method, if they don't have an inv, create a blank one for them, when they leave, set the inventory in the database to what their inventory is. Because players already have inventories, it would wipe their inventory if they did this because they would not be in the database so it would create them in the database with a blank inv and set their inventory to that. Does anyone know how I can do this differently so it will save the old players inventories but still save it in the database?
ty!
what file? a file in the data folder, or a file included in the .jar file, or the plugin's .jar file itself, or ... ?
If the player's not in the database, has anything in their inventory, save it to the database immediately and then save again onQuit.
You could probably do something like this. When the player joins, set the database to their current inventory. Then store store some sort of info that lets you know that they have "migrated". Then use the system like you have described.
The .jar itself, what I got was "new File("plugins", event.getPlugin().getDataFolder().getName()).delete();"
hmm yea
parent is new File("plugins") right?
I just cant seem to find a way to check if they are in the database, im using mysql btw
How do you store that? Just correlating UUIDs and then writing the base64 of the whole inv?
Well, if they have played before, but aren't in the database, you can use the lack of information to your advantage.
yep thats exactly how I do it lol
Plugin#getParentFile() isnt showing up as a method
If they're not in the db, save them to the db with what they currently have. That's it, right? Basically just execute your default SELECT statement and check it's number of resulting rows.
get the declared field "file" from javaPlugin.class
That's because #getParentFile() is a method that belongs to the File class.
that one has the file
that just gives the plugins/ folder
oo yea
ty
Oh wait yea it would just give "plugins" I need to get the .jar of the file
here they said they want to get the File object of the actual plugin .jar
The jar itself? I usually use:
new File( plugin.getClass().getProtectionDomain().getCodeSource().getLocation().toURI()).getPath();
I need to get x though, and I cant manually type in the value of x sadly
I mean the /<x>.jar
do not hardcode /
Ik just for reference
You have no way of knowing what the jar is called tho, do you?
So I think that's the only reliable way
What if the user renames it, it just registers as it's plugin.yml name value
Yea this seems to work, thank you all for the help!
No idea where I stole that from, but happy it helped, haha :D
Could also check the plugin.yml I think
Still don't know the jar name.
.
Yea nvm about that plan then
Theres probably an event you can use, ill look for it real quick
yea i want to use it inside of that event
PlayerItemConsumeEvent and then keeping your own state somewhere
I#d rather use the reflection thing. some jdks complain about getProtectionDomain()
What's the reflection way of doing this again real quick? Don't know what you're referencing
How to get a font file from the plugin resource folder? Currently I've got this:
val image = BufferedImage(50, 50, BufferedImage.TYPE_INT_RGB)
val g2d: Graphics2D = image.createGraphics()
val inputStream = plugin.getResource("minecraft-regular.ttf") // When logged it shows sun.net.www.protocol.jar.JarURLConnection$JarURLInputStream@2477dd83
g2d.font = Font.createFont(Font.TRUETYPE_FONT, plugin.getResource("minecraft-regular.ttf")).deriveFont(20F) // Exception happens on this line
This is the exception I get:
https://hastebin.com/wahijupucu.properties
Hastebin is a free web-based pastebin service for storing and sharing text and code snippets with anyone. Get started now.
JavaPlugin is an abstract class, it has a lot of meta-information provided by the bootstrapper (which knows about all of this, of course). So yes, @tender shard 's solution is the ultimate solution. Please use that, @raw sky , as my solution might not be as futureproof.
why should they?
I also wouldn't know why, but why play roulette on your code, xD.
👍 ❤️
If you already got the information stored somewhere.
I actually never took a look into it, how amazing, lol
I'd not trust that field to be there forever tbh
because of the SecurityManager
IntelliJ moment
?
It's a part of the bukkit API, I don't think they would ever do that to us... D:
No Javac release will complain about the possibility of a security manager check
it's a private field, so no.
no, but jre's will throw exceptions when you try to do it
Security manager is slated for removal, remember?
Plus I don't know where the hell the security manager would be set to deny the protection domain
Reflection can also be denied by the security manager
Yeah... You got a pretty valid point over all, gotta admit. But I hope that we do all agree that the only sane way of doing this is to ask the logic which instantiated you. Just sad that this is not a public API, but has to be read using reflection.
So it can't be "well let's just deny everything"
idk, it's definitely sill part of jre 8 and 17
Part of JRE 8 in a normal fashion, but I believe already deprecated for removal in JRE 17.
I've seen it on some distro's default jdks but that was a long time ago
so maybe it's not a problem anymore, idk
i just think the file field will always work because tbh who would rename a field called "file" that holds a file
Vendor JDKs should NEVER be used, ever.
They are the worst of the worst
Might as well use Oracle at that point
I always use the jdk's from debian's packages
Does the linker (ld.so to be exact) go haywire there? Does it support the --release flag for javac? Only used fedora's JDK, but I assume similar issues exist elsewhere
if you tell me the exact command I should run to try it, I can let you know
I at least know that the Ubuntu OpenJDK does not work with libGDX due to that linker issue. So I guess the same applies to debian
Does anybody know whether there's a central registry for container-names anywhere within the minecraft server? Talking about the ITileEntityContainer#getContainerName, which is basically this: https://wiki.vg/Inventory
All I see is 14 impls of this method in IntelliJ, which all return an immediate string value. If I need this value for a custom packet, do I really need to implement a switch-based map on the bukkit inventory type and size?
swear to god ubuntu is never as reliable as its made out to be
ubuntu is literally a fragile debian unstable testing
echo "class Test{}" > Test.java && javac --release 8 Test.java I believe should produce that issue
okay I'll try
looks like it's working fine
it's javac 11.0.16 from debian's default-jre package
Also from javac's perspective? java and javac tend to be mismatched for me
tbh it would surprise me very much if the default debian packages would contain a bug like that
Strange, I am not getting the issue either now. Lemme see if it is a bit more harder to reproduce
Did you resolve this issue? I kinda got sidetracked and totally forgot about the issue, sorry!
They definitely fixed it now that I can work on one of my projects without https://github.com/Starloader-project/slbrachyura/commit/68960e38abfa62c5c654f1379ee120d6d77f8f97. Whatever
The linker issue is still present though
geolykt@fedora Galimulator]$ java -jar jar/galimulator-desktop.jar
Reading: /home/geolykt/.local/share/Steam/steamapps/common/Galimulator/data/sprites
Packing.........
Writing 1024x1024: data/atlases/game.png
Reading: /home/geolykt/.local/share/Steam/steamapps/common/Galimulator/data/sprites/ui
Packing.........
Writing 512x512: data/atlases/game2.png
Inconsistency detected by ld.so: dl-lookup.c: 107: check_match: Assertion `version->filename == NULL || ! _dl_name_match_p (version->filename, map)' failed!
naaah
I got mad at it, and went to fix another plugin
problem of future me
Alrighty, as I'm also interested now I'm going to try that for myself. First going to deobfuscate a minecraft client real quick to hopefully manage to find out if it can even handle multiple teams.
sure sure
but still, how did Mineplex ( for example) managed to do that transparency thing in year like 2016
And with another JDK (OpenJ9 even!) it works
What thing
I think that all big servers have one team per player, which only that player is a member of. I guess that mojang also thought about all of these issues, and made everything possible in that per-player team configuration. I just really have to get back into it, as I didn't write plugins for a long time.
maybeee debian simply fixked it lol
weird, never seen sth like this
I assume the fedora packagers simply got their act together and also included the needed lib/ct.sym file
You only really see this if you are playing games written in java that aren't minecraft
And even then it is apparently only with older libGDX releases (i.e. those from a few years ago)
did you add the bukkit artifact to your pom as well?
do you even use maven?
did you add the bukkit artifact?
<!-- This depends on the Bukkit API, Use this if you need BukkitAdapter -->
<dependency>
<groupId>com.sk89q.worldedit</groupId>
<artifactId>worldedit-bukkit</artifactId>
<version>7.2.9</version>
<scope>provided</scope>
</dependency>
<!-- This doesn't depend on any platform -->
<dependency>
<groupId>com.sk89q.worldedit</groupId>
<artifactId>worldedit-core</artifactId>
<version>7.2.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
you need both
or maybe you only need the bukkit one
they actually don't explain it very well in the wiki
but you definitely need the bukkit one
Most likely only the bukkit one
although I have both but I also exclude everything so eh
yeah I just checked
I only have the bukkit artifact
it already itself depends on core
oh nice I didnt know intelij could also "decopmile" pom files
Eclipse can also do that - so that isn't too advanced
yeah I just didnt know that
never used it before
I always went to my local repo and looked into the files manually
idk why I haven't tried it earlier
What is a Chunk#getKey and can I use that as opposed to storing the cords?
which JDK version do you use
that is a MethodNotFoundException, and no
that method does not exist
none of those exist
otherwise it would be in the javadocs https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Chunk.html
declaration: package: org.bukkit, interface: Chunk
then yu also have to use an ancient worldeit versio nin your pom
Chunk.getChunkKey() does not exist in spigot
period
it's not in the javadocs
Okay, I can now answer the question of multiple teams with certainty. A player can only be a member of one team at a time. Once you add them to another team, they're removed from all other teams. So it has to be possible to disable collision for all others by using NEVER and just being in that team by yourself. Going to get back to you once I implemented an example plugin that patches this in on an existing scoreboard.
it's not in the api
it's not in the CraftChunk code
hm it's been like 5 years that I used world edit 6
maybe I still have sth on github
oh my
thx so much
this helps a lot
imma take a look at it at the morning
I only have some weird reflection code left for WE6, seems like you don't need to adapt in the WE6 api
there is BukkitUtil
what exactly are you trying to do? Usually every worldedit method should either take a bukkit object, or if it doesn't, you can usually get a worldedit object through BukkitUtil
Happy that you appreciate it! :) I actually am a very dedicated problem-solver and not willing to give up on issues like the one you're having so easily. We're gonna make this work, like many servers already did.
e.g. BukkitUtil.toVector(someSpigotVector) or sth
if you could share your pom, I could try to find how it works in WE6 because there's no more docs for it anywhere as it seems
but I'm too lazy to search the old repos etc myself
can I send u friend req?
soo I don't have to look for u for hours
Sure thing!
Helps to not spam the chat here too, and I just don't know how threads work yet, lol
WorldEditPlugin.getSelection(someBukkitPlayer)
WGBukkit.getPlugin()
WE6 sucks big time lol
erm wait sorry
that's WorldGuard not WorldEdit
uugh wait
i have no clue
there's nothing on google for WE6 anymore
probably
you can just get it from the pluginmanager
and cast it
WorldEditPlugin worldEdit = (WorldEditPlugin) Bukkit.getPluginManager().getPlugin("WorldEdit");
yeah this should work fine
np
should i modify a private final field with reflection or create a new object?
i want to modify a string in a packet
Hello, I'm working with the EntityExplodeEvent and I am trying to make it so that when TNT explodes, blocks break but items don't drop. I've been using .setYield() to set it to zero but some things like signs and levers are still dropping. Any ideas if there is a better approach?
@scenic valve what's probably happening is the blocks that those are placed on is being broken
Anyone know if there is a way to know what the new sound Enum is if im porting something to new versions from 1.8
cancel it instead and then just make a new custom explosion there that does no damage
much easier
Ah that's probably right lol, completely didn't think of that
that's not the problem
that's why only items that need to be placed on others are the only thing you're having a problem with
Yep seems to be the case, completely forgot about how that works XD
anyone?
i'd probably use reflection
https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Sound.html here are all the builtin sounds
declaration: package: org.bukkit, enum: Sound
what abt securitymanagers (i know nothing abt them)
Idk what NOTE_PIANO is in 1.18 tho
could that cause an issue on some systems?
i have no clue tbh
yeah maybe
https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Sound.html#BLOCK_NOTE_BLOCK_CHIME
maybe chime? idk
declaration: package: org.bukkit, enum: Sound
@quaint mantle https://minecraft.fandom.com/wiki/Note_Block#Instruments
A note block is a block that emits sounds when attacked, used or powered with redstone. The sound produced can be altered in various ways by using it or putting certain blocks directly above or below it. A note block's sound played repeatedly can be used to direct allays to stay nearby and drop collected items near it.
Hey guys, I'm using PlayerMoveEvent to check if a player moves during a teleport.
And it seems like for some reason when players move their head the "ifs code" is getting a different X, Y or Z.
code is like this:
if (Main.getInstance().teleporting.contains(e.getPlayer())) {
Player p = e.getPlayer();
Location from = e.getFrom();
Location to = e.getTo();
if (from.getX() != to.getX() || from.getY() != to.getY() || from.getZ() != to.getZ()) {
p.sendMessage("§cYour teleport has been cancelled because you moved.");
Main.getInstance().teleporting.remove(p);
}
}```
?main
🥹 so because name is Main, players are changing their coords while moving head and not actually changing coords
If you are not using elses, after the if
You should add a return after the releporting#remove()
Always paste full code
its the full code
the rest of the code is something that has nothing to do with that
Using Main for the name of the main class is poor programming standards and is not following the set minimum coding standards set by oracle
alright but the plugin won't be used by others as a API or downloaded to other servers. It's a project just for me for tests. I truly doubt the name Main is the issue here.
🤔
well they called the entry point "main" themselves
Is this actually true ?
if (Main.getInstance().teleporting.contains(e.getPlayer())) {
Player p = e.getPlayer();
Location from = e.getFrom();
Location to = e.getTo();
print(to);
print(from);
if (from.getX() != to.getX() || from.getY() != to.getY() || from.getZ() != to.getZ()) {
p.sendMessage("§cYour teleport has been cancelled because you moved.");
Main.getInstance().teleporting.remove(p);
}
}
like that
you only some people claim it, others dont
no, print out the variables
sure i can debug it and see whats happening
wtf
what weird sentence did my brain produce
#help-development message Read this, it goes into detail about it
I wanted to say "some people claim it, others dont"
Because afaik in spigot, people complain about main class being called Main because actual Main is spigot, not your plugin
Who knows what you're trying to say 😛
yeah but one could argue that it's the main class of your plugin
i personally dont have any opinion about it
yeah that is true tbh
I do have an opinion about
Player p though
provided link say nothing about oracle convention for naming main class
i'd also never do that
e could also be an entity
or an exception
or a particle effect
or anything else that starts with E
I'd just always use "event"
That I agree with.
i mean we can probably all agree that using "MyPluginNamePlugin" is always a proper class name for the main class
but I also wouldn't care if anyone would just name it "Main"
so i recorded the video and seems like coords change by 0.01
which doesnt make sense
I would beat them into submission until they rename it properly
I don't do that. For example AngelCHest's main class is called AngelChestPlugin because there's a data class called AngelChest
so i recorded the video and seems like coords change by 0.01
and this doesn't make sense.
is there a away to fix this?
Are you trying to make a movement check that ignores yaw and pitch movements?
i want them to teleport after 3 seconds and moving yaw/pitch not cancel it
but cancel if they actually move x,y,z
and seems like when moving yaw/pitch its also moving the z by 0.1
from and to
true
without moving, just moving the head
it seems like this is getting the wrong coords at first
i usually just compare the int coords
like its "lagged"
so they can still teleport when they only moved a tiny bit
Just looking around counts as movement, so you need to compare only x, y, z coords in the move event.
// Player is able to look around with these checks.
if (event.getFrom().getX() != event.getTo().getX() ||
event.getFrom().getY() != event.getTo().getY() ||
event.getFrom().getZ() != event.getTo().getZ()) {
// Do stuff inside.
}
i have that
@kind hatch
Comparing int cords would still cancel in his case look at the number he’s teetering on .99 and after the yaw adjustment it changes
it seems like the playermoveevent is getting the wrong e.getFrom coords at first, if u stop in a coord and then start moving it gets the coords from when you stopped moving forward and not your final landing coords.
is there a way to actually get their "final landing spot" coords and compare correctly this movement?
misspelled here, it's e.getFrom. fixed tho
erm yeah obviously getFrom() is not the target location
it's the location from where the player attempted to move away from
it is getting the wrong coords tho.
even if I stop and then start moving, the e.getFrom() will not return the spot i stopped on
Well, PME only has up to 20 ticks accuracy
Has anybody got some experience with the java.lang.reflect.Proxy? I could use a bit of help with a pretty weird issue I'm facing :/.
what is the issue?
Okay, wait one second please, I need to first validate that I'm not just a moron. I'm trying to proxy a map which I think should get #put calls, but all I get in the proxy are #values and #size. I just got the idea that I'm maybe actually proxying at the wrong place and this map is indeed untouched. I'm going to get back to you soon! thanks! :)
How’s the code looking?
That's what I currently got. Can you spot any mistakes so far?
i have no clue about proxies, I just wanted you to ask the actual issue so maybe somone else is able to answer 😛
wow, that's nice of you, thanks! :). I think I'm about to solve the issue, think I found what's going on. What a frickin hack to begin with, haha
Try changing the getX() location methods to the getBlockX() methods.
wtf proxies are cool
didn't even know they existed
btw do you know abt securitymanagers?
There's not really much magic going on behind the scenes. You basically create a new instance of the specified interface, implement all methods and route straight through to the proxy handler, which then can route back to the vanilla instance, if desired, or intercept in any shape or form. The only thing with the Proxy-Class is that all of this get's compiled at runtime (I think).
Sadly I haven't heard of it yet. What is it all about? Maybe I know what you mean when you explain it further.
it's basically something that prevents you from doing stupid stuff in java
like modifying private final fields
it's not always present though
i think
idk
A, right, it's against people trying to perform dark ass patches like myself, haha
Yeah, I once tripped up on it, but that's about all I know, :/
the code itself looks to be more or less correct
tho havent seen any1 use Proxy like this before x)
Caused by: java.lang.NullPointerException: Cannot invoke "org.bukkit.block.banner.PatternType.getIdentifier()" because the return value of "org.bukkit.block.banner.Pattern.getPattern()" is null
Does anyone know why this method would return null?
Well, then it's about time, xD
Probably because the banner itself is null.
Never seen anybody proxy a collection of any type? D:
yeah or using Unsafe
That would return a null pointer exception when getting the ItemMeta itself though
just seen people use it to facade known abstract types
There is no reason to use nms for scoreboards
are you using paper?
Oh, right, xD. Well, as I've said, this is a pretty big hack, I'm just doing a proof-of-concept type implementation, not necessarily anything production-ready.
Yea
then you should report it to them, it's obviously annotated with NotNull so it should never return null
if it ever does, it's a bug in paper
(or spigot if it happens on spigot too)
have you checked whether it happens in spigot too?
yo @tender shard you on?
oh okay
quick question
if you open your mavenLocal, how many spigot versions you got?
I can't bother running buildtools on 15 different versions
because I have to switch java versions and all
yeah that's why I made this https://github.com/JEFF-Media-GbR/JeffLib/blob/master/run-buildtools.sh
It turns out PatternType.getByIdentifier(String) uses internal identifiers (like glb or cre) for each pattern name rather than the enum name
on my laptop I only got 8 versions
then add them to the varialbe
1.8 will yell if I run it on java 11
but not on java 8
just use java 8 for the legacy stuff and java 17 for the newer versions
then it works for everything from 1.8+

lmfao
trying to use reflection to support 1.8-1.19.3 will make me kms
might end up using protocollib
@humble tulip i finally fixed my scoreboard issues
oo nice
turned out i didnt need packets after all 😒
just drop support for everything below 1.19.3 and allow yourself to be happy
@tender shard hm
but it was a real brain turner
huh what's your output of java --version
weird. anyway, still seems to work lol
if only i knew a player can be in a team per scoreboard and not 1 team in general
woulve saved me 12 hours
the terminal seems to be stuck
LOL
Oh, there are actually other people out there that are insane enough to even think about it? Haha
10.4mb ram, no usage
yikesss
all i gotta do is modify this string
if the thing is still turning, it's running
but mc wants to use an IChatBaseComponent
if buildtools fails, it'll tell you
hidden process I see
this will take a while
I think imma stop it and add 1.12 and all
What exactly are you trying to solve?
it takes about 40 minutes to compile all those versions, unless you already got some
lol i just wanna modify an inventory name so i can support per player language
Because all styles are handled as a component in NMS
You want to intercept the PacketPlayOutOpenWindow?
40 minutes? It takes like 5mins tops to do one version.
What is then?
40 minutes on a good day
creating a new PacketPlayOutOpenWindow is my problem
that's why I said "all those versions"
M.2 NVMe is where it's at.
I wish i could just manually write the packet like in wiki.vg/Protocol
Is ChatComponentText not available at your target version? I didn't check for a long time...
the proper name for IChatBaseComponent is net.minecraft.network.chat.Component
I would benchmark my machine, but I already have all the versions back to 1.13 in my local repo.
and it has a method "literal(String)" to get a component from a string
That sounds very new and fancy, considering the targeted 1.8.8 support
lol
oh well no clue about 1.8
might just use protocollib
Nooooo
that's simply the mojang mapped name for IChatBaseComponent
is there any way to build spigot with nms classes in the jar?
in 1.8.8 it's probably IChatBaseComponent.fromString or sth similar
spigot always has the nms classes in the .jar, otherwise it wouldn't work
yeah I mean how else would it work
?bootstrap
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
i just wanna build all spigot versions and throw them in a libs folder, import them with maven so i can have a project where i can just use to browse nms in any version
why would you throw them into a folder for that o0
1 sec
that kinda defies the purpose of maven
if i build everything with buildtools
you are supposed to just use your local repo
i can just import it?
sure
np
you should however create one module per version
otherwise e.g. if you wanna check out some class, IJ has no clue from which version you want it from
true
?help
selfrole Add or remove a selfrole from yourself.
cleanup Base command for deleting messages.
embedset Commands for toggling embeds on or off.
info Shows info about CafeBabe.
licenseinfo Get info about Red's licenses.
mydata Commands which interact with the data CafeBabe has about...
set Commands for changing CafeBabe's settings.
uptime Shows CafeBabe's uptime.
findcog Find which cog a command comes from.
names Show previous names and nicknames of a member.
userinfo Show information about a member.
listcases List cases for the specified member.
reason Specify a reason for a modlog case.
permissions Command permission management tools.
?embedset
Syntax: ?embedset
This setting determines whether or not to use embeds as a response to a command (for commands that support it).
The default is to use embeds.
The embed settings are checked until the first True/False in this order:
- In guild context:
1. Channel override - ?embedset channel
2. Server command override - ?embedset command server
3. Server override - ?embedset server
4. Global command override - ?embedset command global
5. Global setting -?embedset global
- In DM context:
1. User override - `?embedset user`
2. Global command override - `?embedset command global`
3. Global setting - `?embedset global`
showsettings Show the current embed settings.
user Sets personal embed setting for DMs.
?embedset help-development
Syntax: ?embedset
This setting determines whether or not to use embeds as a response to a command (for commands that support it).
The default is to use embeds.
The embed settings are checked until the first True/False in this order:
- In guild context:
1. Channel override - ?embedset channel
2. Server command override - ?embedset command server
3. Server override - ?embedset server
4. Global command override - ?embedset command global
5. Global setting -?embedset global
- In DM context:
1. User override - `?embedset user`
2. Global command override - `?embedset command global`
3. Global setting - `?embedset global`
showsettings Show the current embed settings.
user Sets personal embed setting for DMs.
?embedset showsettings
Embed settings:
Global default: True
Guild setting: None
Channel setting: None
User setting: None
How can I find my build? (Inteliji)
You mean the version you're running? Help > About
it depends on how you built it. if you built it with regular IJ it's probably in a folder called out. If you used maven, it's probably in target. If you used gradle it's probably in build/libs
ok
Ok my files are now compiled how build in jar?.
Anyone have a basic rundown of how id make a gun? Im talkin the player holds left click down and it keeps shooting for however long they hold the mouse down, shots always reaching the entity being shot at, how far the entity is, if whats being shot at even is some sorta entity etc.
interact event, check if it's a left click, if so, fire off a projectile. use entity raytracing to see what/who they're aiming at
that's pretty much it
perfect, thank you!
the raytracing is exactly what i needed but i need more clarification on the actual shooting if you will: How do i figure out when the player takes their finger off the left click since i want it to continuously shoot
just fire one projectile for every valid interact event; then when they stop left clicking, so to will the interact events stop. thus, the firing will stop
that's exactly how automatic weapons work, anyway
There really isnt a way to detect they are holding the click as that isnt something the client reports
does the arm not continue to swing when held down? or is that only when they hit a block?
Yeah that's what I thought too, my best guess was a unbreakable block is spawned in front of the player so it's always being hit but that brings up a lot of issues too
Closest thing to that is the shootbow event that reports the power of the shot but that only obtainable after they release not while holding it down.
Only for blocks
Oh well, rip
Most gun plugins found a way around this but I genuinely cannot understand some of the code written by the authors
Well you can make assumptions
Like you could reverse it. Instead of firing based on click you could stop firing when they do click again as long as its in their hand
So first click makes it fire and it continues until they click again
That is actually smart but wouldn't yhay cause an infinite loop since there is no reason for it to stop
I assume they have ammo
So stop when they run out
Or when they switch items in hand
Sure but what if they want to stop shooting before running out of ammo
They would click
There is no stop clause, if I click once, it continues shooting, if I click again it stops but then how would I start again without it misfiring
How do I get maybe like an array list of all the messages that have been sent to a player from other players/plugins
Like the message history
I'm gonna look at the source for the gun plugins in a bit
Click again? Not sure what you mean by misfiring lol
Misfiring isnt a thing unless you code it in
Hard to explain on phone sorry, here's what I'm saying:
I start shooting by clicking once, it only stops when I click again but the only way to shoot is to click, so the dilemma is how would I differentiate between a stop shooting click and start shooting click
By keeping track of which click number.
Ah yeah, maybe I change it in the guns nbt or whatever it's called in the latest version
You just put in a list which click. You only have 2 clicks to really track. Click 1 and click 2. So first click is a one. Second is a 2. Or 0 and 1 if you prefer. And alternate the number to keep track
When click event comes in. Look at the number. Update it and perform which ever action
Also make sure they have item in hand as well. If they dont ignore gun action code
I probably wouldnt bother with that as its not something that needs to persist
Unless you want guns to be firing the moment they log in lol. But by default guns shouldnt be firing lol
Anyways. Back to work for me
would it be smart to use the playermovement event to detect when a player reaches a certain zone? Like they just entered between x:100, x:200 and z:100, z:200?
wish there was a way to do that without having an O(n^2) loop
There is it's called using bounding box so you don't see the O(n^2) loop so you aren't depressed
If you want to be clever you could technically use a fun chunk PDC hack I suppose though I'm not sure how much time that really saves you
you still need to loop through:
- All players
- All bounding boxes
So you have an O(n^2) loop
Trying to do an async task and it just isn't working. (No errors just not finishing up)
Any ideas what I'm guffing up here?
2 secs haha
I am so sorry for the potatoes btw on a grand folks pc so need to picture the bugger
It's dog tier I know I usually have so much better pics but yeah, needs must
My lord naming conventions out the window lol
(E)xcelProxy scares me and haunts my dreams
Where can i find the code for the method Plugin#saveResource() ?
Mentally scaring you aside... this code did work before the async. So imbaround 90% sure its how i set it up
I.e. before I tried adding the async
Lmao I'm glad I could help improve ur mental fortitude 😉
pretty sure you can just ctrl + click the method to see the source in IntelliJ
same for Eclipse iirc
But yeah this code when not making the server cry actually gets X days of mining data for a player out of core protect and can put it into a graphical format to help hunt xrayers more easily with CP.
So I'm very very interested to get the bugger working.
The final hurdle is getting this async to work so it doesn't make my poor pc cry lol
*or rather the server lol
Opinions please!
Just use caffeine?
Redis 👀 ❤️
No screw a well-known benchmarked library. I can do it better. /s
Redis cache is really shity tho only allows strings or bytes
my man
print screen??
you can just... use bytes??

Literally can't right now its hurting my soul to throw potatoes out haha
sir, copy and paste?
Protobuf: Am I a joke to you?
I am using readallbytes and I am getting an AccessDeniedException
my code: https://pastebin.com/gu4F9DKB
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
yeah, it is a folder
error: https://pastebin.com/d9QJWw1b
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
What bytes do you think a folder has XD
Spicy bytes
idk, I am trying to give the player a resource pack
or set their resource pack or whatever, and I need to give it a bytes[]
idk, probably, I thought that I could just like do readallbytes and it'd do that or smth
how do I do that
The file parameter should be the name of the resource file found at link provided.
rlly? oh
Not sure why you are trying to pass in your server directory for that
Doesnt help clients lol
one possible parameter was a bytes[] for it
The first is the link to download the resource pack from the bytes are the sha1 hash of the file found there
the "hash" "sha1 hash sum"
Yep. But like way left field wrong though lol
dont call it "Handler", be more specific. what exactly is Cache? i would understand Cache as an actual cache of something, not as a value. why do you store caches by keys? shouldnt Cache also be generic if you can get the cache for an specific type? or what is T? and also why does your handler have a name
- is inheritance the right choice there? will there be many cache handler? cant you have an generic cache handler for your usecase? composition > inheritance
Still trying to figure out composition in java lmao
Hi guys,
When I teleport player to random and unloaded chunk location , server getting so many errors and player is kicked automaticlly.
My code:
https://paste.md-5.net/okeyogosoc.java
Errors:
https://paste.md-5.net/xelenivaxi.md
Tryed to scheduler every 1 second to check loaded or not it doesn't working. By the way it happens when I use command /tp to random position too
sir this is spigot
?whereami
@austere solstice
That was helped a lot of 🙂
so that is not happening because of my code or spigot server right?
youre not running a spigot server
oh sorry, I get it what you meant. It was happens spigot server too. I will send error codes in a minute
I was very embarrassed. Sorry.. 🥲
It's fine. just take note of which discord you're in. SpigotMC discord for Spigot Servers. PaperMC discord for paper servers.
Yeah I get it
Hey, I want to make a starwars plugin, and I made multiple BB-8 (droid) models in Blockbench and I want to put them in Minecraft and animate them. Is this possible with plugins and resource packs, without using optifine?
With paperweight userdev is it possible to use the paperweightDevelopmentBundle excluding paper api?
i'm using it to reobfuscate
Modelengine plugin allows you to do that
but that's paid
you can get a demo
but that only allows you to use like 6 mobs right?
That is more of a question for the author or support for placeholderapi
suggestion: use They are rank, makes it genderless so you don't get random ppl hating at you
Offtopic? Yes very much so. Do I care? No very much no
IntelliJ .jar doesnt appear
wtf am i doin wrong
i created an artifact from module with dependencies and removed the extraction thingy
but my damn jar file doesnt appear?
on build
Sure you are looking in the right place?
Hi... is there a youtube tutorial on how to use the roll dice plugin?
whats the role dice plugin
no one ever used it?
thx I did see that , I am not a coder I am a "user" I dont know much when it comes to coding things, but it looks like a really neat plugin I want to try.
wait what u wanna know? how to use it?
But I am not sure how to use it or make it to work... all I did was install it in my plugins folder on my server
oh okay
Yes please
yes
I did that
and did u start the server?
I did
are there any errors?
when i use the / it gives command to use dice
yes
ingame
yes
no errors
so its working?
yes but how do I use it? sorry for my ingnorence ... I dont know what it should look like...
na everythings good
do I say /diceroll
okay okay so
as you see the commands:
If u want to get a random number from 1 to 69 you write: in chat /roll d<#> 69
i suppose
the number will send to yourself as a message
like a normal chat message
thats why im here c:
guys just a heads up, should've used #help-server
how do you place a bed, as in the top and bottom of it
would anyone know what packet(s) make the player leave the Loading terrain screen because i've tried sending them a position packet but it did not seem to make them leave that
current packets i am sending
1.19.3
i am writing a protocol implementation so this isn't a spigot / bukkit / nms issue
How can I dye an horse Armor? I found people was casting ItemMeta to HorseArmorMeta but propably this is outdated
how do I send a screenshot of the rolldice command? I tried verifying my account it says not find as well.
did I do it wrong
just send it private to me
i dm u
u sure it wasnt a mode or bedrock shit?
its bedrock shit
idk
you color it like leather armor ig
ye
short and quick: can u use 1.19.2 declared plugin in 1.19.2+?
if u are using stuff thats available in both versions
I'm kinda curious, how do plugins that allow people to set "custom commands" make them work as a command on the server at all? like getCommand("customcmd").setExecutor(... that we set on the plugin main class + plugin.yml.
is it with the event PlayerCommandPreprocessEvent or something different?
I think they are using reflection to directly put commands into command map
oh cool
i noticed u can also use reflection to automatically listen to the events
and set the commands
that sounds way better than having to register all of them all the time when making a new one
is there any down side to this?
what event is used in /msg?
How to cancel item drop?
Wait wha?
What the
hell
Does anyone know how to get the speed of a projectile?
is there a way to store data like persistentdatacontainers, but so it doesnt get wiped every time the plugin gets updated?
getVelocity?
file, database
thanks
why do you even need something else than pdc
I wanna store things like level inside a player but when I update the plugin everything gets wiped
yeah, it's dumb
you can store pdc on player
problems?
it resets when I update the plugin
like
when I have a new version
Maybe your NamespaceKey contains plugin version
with fixes and stuff
Does anyone know a way of stopping items from being added to furnaces from the recipe book? I'm wanting to block certain items from being added to the furnace and have blocked everything but the recipe book.
I made a function in the main class that returns itself
could you send it?
how is that related
or just plugin namespace changed
^
package me.wadamka.simpleclans;
import org.bukkit.plugin.java.JavaPlugin;
public final class SimpleClans extends JavaPlugin {
public static SimpleClans pl;
@Override
public void onEnable() {
System.out.println("loaded Clans!");
pl = this;
}
@Override
public void onDisable() {
}
public static SimpleClans getPlugin(){
return pl;
}
}
main class
?
where's your PDC part tho
btw there is getPlugin(Class) method
where you set it and get it
ye, and getProvidingPlugin too
there is?
yes
how can I check if the velocity is slower than the velocity of another entity?
compare them?
"Operator '<=' cannot be applied to 'org.bukkit.util.@org.jetbrains.annotations.NotNull Vector', 'org.bukkit.util.@org.jetbrains.annotations.NotNull Vector'"
Compare the lengths
PlayerDropItemEvent or EntityDropItemEvent.
getVelocity().length() or lengthSquared if you want better performance
how to fix can't resolve setDisplaySlot() method?
yap, java doesn't have operator overload
and than? setCanceled does not work
you're probably not registering the event.
bruh mafs
f
Thanks! The one with the bigger lenght is the faster one right?
@robust light
basically
I figured it out, thanks!
Thank you very much!
tho won't work for normalized vectors, cuz you know, they have length = 1
bukkit devs like crated saveConfig() and getConfig() and reloadConfig() methods for you to use
copypaste sourcecode and change from "config" to what you want
@fluid river U say that to me?
yeah
kk
Files.getArenasInfo().options().copyDefaults(true);
I do it here
@fluid river
does anyone know whats wrong i have no errors but when i try to compile i get these errors
anyone?
How do I create a YouTube head. I have the value of the YouTube Head "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvY2VjZDA0MWY2MjhjMDA1YTY5MGZjNmI4MjM3ZTczMTFiYjdjM2IzYWFjMTA1MzlmZWZlMzk2YTRjN2M3ODNlNyJ9fX0="
@tall citrus
@NotNull
public FileConfiguration getMyConfig() {
if (myFileConfiguration == null) reloadMyConfig();
return myFileConfiguration;
}
public void saveMyConfig() {
try {
myFileConfiguration.save(myConfigFile);
} catch (IOException ex) {}
}
public void saveDefaultMyConfig() {
if (myConfigFile.exists()) saveResource("myconfig.yml", false);
}
public void reloadMyConfig() {
myFileConfiguration = YamlConfiguration.loadConfiguration(myConfigFile);
InputStream defConfigStream = getResource("myconfig.yml");
if (defConfigStream == null) return;
myFileConfiguration.setDefaults(YamlConfiguration.loadConfiguration(new InputStreamReader(defConfigStream, Charsets.UTF_8)));
}```
Thanks
Are you using maven or gradle?
maven
Hi!
How can i add ProtocolLib to a papermc server?
Apparently a plugin that I am using needs protocol lib to work
download and install?
well yes
no configs or other stuff
it's like HEY GUYS HOW DO I INSTALL VIAVERSION
that's literally a library plugin
you don't need to touch it's configs
just restart the server
👍 aigty
How i get the Playertextures
@chrome beacon im using maven
Make sure you didn't add the Spigot jar as a dependency directly in your IDE
What version are you making your plugin for
how is Bukkit.blablabla() going to returna a custom class?
ah right that too
Your class has the same name as the bukkit one
You need to tell Java to use the right one
i took that class from my other multi module project just for testing
this is how my pom looks like if that helps @chrome beacon
1.8.8
Too old! (Click the link to get the exact time)
💀
So you didn't read anything and just copy pasted 💀
people nowadays
society
1.18 nms classes won't exist in 1.19.3
Yeah mb
i only have this problem with newer versions for my 1.12.2 class i dont have that problem
i guess
which one should i use @fluid river
Is it normal that a PlayerInteractEvent doesn't get triggered when a player interacts with an entity? (Yes I know there is also a PlayerInteractEntityEvent) but is there an event that gets triggered unattached if there was an interaction with an entity or not?
@EventHandler aint missing right?
whenever I try building the plugin (using Build artifacts) for a server, it says this...
Can anyone please help? I don't have a lot of experience with plugins
got the dependency as provided?
Is that a question for me or for the other people?
the Event is working when the interaction is not with an entity
this was for you
I think so
thinking is not enough, show your pom
just search for the pom.xml file and show the contents
I don't have a pom.xml file
is this even a maven project?
maven?
using intellij?
It is
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
I'm not using maven
https://www.youtube.com/watch?v=rT-gZeevmZs I'm following this
Ever wanted to know how to make Minecraft plugins for Java edition? In this new series we'll be starting with the basics and eventually diving into the advanced details of plugin development.
I've been developing plugins and running my own servers since 2013, so expect to see step-by-step tutorials with plain English explanations.
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯...
It's with java
oh god mans not using maven
...
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
I'm assuming that I should look up a tutorial that uses maven instead lol
Should I also use buildtools
Yes
can i get a lesson about locks?
Why does is.getItemMeta().setDisplayName("§r§b§lSelect Hub§r"); not works?
what
cuz you are getting a clone
what did you mean?
ItemMeta meta = is.getItemMeta();
meta.setDisplayName("fff");
is.setItemMeta(meta);
you are getting clone of item's meta
not the actual meta
so if you modify it, nothing's gonna change with the actual item's meta
bruh
i guess you know a lot more about sync and async than me
rly
Yes
that doesnt sound mc plugin related
ReentrantLocks are simple, when called on thread x any thread y that tries to lock it has to wait until thread x has unlocked the thread
Oh
afaik mc plugins are usually written in java
kinda like a synchronized block then
Anyway, during the time thread x is locked, it can call the lock method on the lock again without any additional effects
Hence reentrant
Its better
Because it allows fairness
Which is FIFO as opposed to LIFO iirc
And iirc ReentrantLock scales better the more threads
\👀
Well ReentrantLock has a better set of methods also
A CountDownLatch is just a counter, kinda like Semaphore, CyclicBarrier or well Phaser but non reusable
hey guys i have a problem when i check who has containsKey(player) it return null but When I try to send the hash to the player as a message I can see the player in the hash some one help me ?
exposing collections, lets go
plugin coding lessons
the same player not another
And give me 1 reason why I should follow your coding lessons instead of ones on youtube
The problem only occurs with playerjoinevent
the only thing i know is that old player objects cannot be the same as the ones from the join event
cuz you can ask questions
Can i change server motd with plugin?
and i can answer
as the join event gets a new player instance
should be enough
And why are you giving free coding lessons?
cuz why not?
bored mf
Because usually people ask money for lessons
Really stupid
You can find so many resources for free
great way to scam people 
Same as saying school is really stupid because you have to pay for education
i had free schoold here in russia
Not really
i was hoping c++ had the same amount of free online resources but its just dissaponting
tf
anyways, you can just ask for help
maybe says smth about the quality
nothing can go bad
no
There’s no inherent bound concept of paying for education, that’s just if you choose to do so.
schools in russia were always free
cant really compare so idk
since USSR established
hmm
bruh. Or perhaps it says something about society, and how they think education is important. Unlike the US, where you have to pay shitloads of money for a single university agree
and well, we study the same things
dont you agree with that
sounds like a personal issue then
anyways, @undone yarrow , maybe you are just scared to try
I think school and uni should be free lol. But anyways...
you are like 100% not believing me
i'm currently free so i can help you with your project
I think I'll have a look at 1 video before asking for lessons just so I know I actually want to do something with plugins. If it sounds interesting, I'll send you a msg (today) 🙂
Tbr, yes those degrees cost, but the education you get there can usually be absorbed in other ways for less money
Let’s say you study maths, like some theory, logic theory and maybe more advanced set theory, there’s gonna be a lot of ways to get that education without attending to said uni, a book for instance, or some video tutorial etc.
well here in RUS universities cost money
if you haven't passed all three main exams after school on 90+
And yes, a teacher might be helpful for you in order to learn it such that you can ask questions about concepts you don’t understand, however there are ton of people who know about x field that you could also ask, usually you’re not gonna be the first one to study field x.
Yes but usually higher jobs accept real degrees, and so does society. Showing you "online gamedevcourse certificate" is usually not seen as having the same quality. Or saying that you read a book about it.
but if you passed well, you study for free
Depends on in what field
When it comes to programming, I know of many companies that don’t really pay attention to your degree, but it’s not like your degree is an obstacle, just doesn’t substantiate anything really
depends on the country
you definitely didn't just look that up on google
And next time when I'm programming I'll say "I'll go back to programming my plugin with a high-level strongly-typed object-oriented programming language "
i don't remember full name
Well it'd be nicer if C/C++ had something like maven that works in a crossplattform way. But alas "muh natives" and "muh statically linked binaries" kinda prevent that from ever happening
here in russia it's 80/20
And without maven, I'm not gonna touch them
most of the companies do care about bachelor's degree in software engineering
so it's not really easy to find a job without HE
this is cool
bachelor in uni?
i thought university was like master or smth
6 for master
9 for random postgraduate degree
lol
3 years is a bachelor in the uk, then you can do a 4th year for a masters
it's really common that students work in their uni after finishing
integrated masters iirc
obvs depends on the course but most are like that
bruh