#help-development
1 messages · Page 898 of 1
print config.getValues
Why not javafx 😭
it prints null lol
the config isnt saved
to the disk or
on the server
why do i need to reopen the file
it should reload it
how will that help track the issue?
Anyone have a clue of why Translateable components wouldn't be working with Menus???
val title = MenuBuilderImpl.title(type)
menu.title = title
Bukkit.getLogger().info(title.toString())
serverPlayer.sendSystemMessage(menu.title)
menu.checkReachable = false
entity.openInventory(menu.bukkitView)
return menu.bukkitView
when printed out to the player it provides the correct translations, but when opened its in english no matter the language
as you see the player inventory is in spanish, the title set on the server with the translatable component isn't, but its correctly printed out in chat and the console contents are as expected
must be a CB internal issue ig
figured it out, its how CraftBukkit opens inventories without considering translatable components
can't until components are merged
I mean I can fix it in my project
but spigot can't until components are merged
yes
PRing this patch to spigot would just be like PRing it to spigot only to remove it :P
bruh i have no idea why arenas config isnt loaded
i load it in onenable
are you calling .set
how can I fix that when I call .dropItem the item won't go a little bit up and then go to a random direction but instead just drop it directly on the ground?
there is a dropNaturally method
do you save
yea
if i reload config before getting location it works.
thats weird
fixed
found solution
how do i cancel runtasklater from other class?
get the task id
ideally since you plan on being able to cancel it
ok
the alternative
BukkitRunnable?
is to make the task have a condition it checks and from there it would dictate if the code runs in the task or not
how do i get the task id
Just overengineer your stuff
yea i thought that
when you create the task, you can get the id
but its pretty hard in my example
how
put the task in a variable
aham
handy illusion has stuff already made XD
even more so I don't have to type anything out now
scheduler.runTaskTimer(plugin, (bukkitTask -> {
taskId = bukkitTask.getTaskId();
task.accept(bukkitTask);
}), delay, period);
wait wouldnt taskid variable only change after tasktimer executes?
anything that gets scheduled gets an ID
This method passes a Consumer<BukkitTask> to the scheduler
Which the scheduler accepts when it creates the task
although this keeps re-assigning the taskId field
Every time the task ticks
(which barely matters)
overall however, it shows how to get the task id which is what you were wanting 😛
you are making a minigame network?
99% requests: bedwars
interesting, I might be interested in joining it
Rn I'm still working on infrastructure while I can
i dont understand what to put in delay and period
I could provide a dedicated server 🙂
at some point I'd love to have a server or two to test
my task's options?
One's how many ticks until the first iteration runs
The other is how many ticks between iterations
i dont think i understand purpose of this code
?scheduling
Remember: Download sources
i mean do i need to put my task's delay and etc there?
Yeahj
oh i was confused because i was doing runtasklater actaully
Consumer
You can but you won't have context of the task id
Here's how I use mine
https://paste.md-5.net/inutelerin.java
https://paste.md-5.net/vugunuroja.java
wdym context
It will
ok so heres thing i was looking for
me when I get a real job
Rust developers when they make algo 1ns faster
how can I reference a specific line in a spigot link?
so basically like github, where you get to specify the line
resources
I'm asking how
you didn't references a specific line
On Vivaldi at least I have a link in my context menu
Unsure where that would be on Chrome
it doesn't
Then you may not be on a browser that supports it
It's a Chromium feature so you need a Chromium based browser
Hi spigot people!
Im looking for a dev to show or code me a bungee plugin that changes /server (name) to open a custom menu (deluxe menus) instead
doesn't work for brave beta
Might just not support it
Cloudflare 69 redirects:
doesn't work on chrome either
This one specifically probably didn't work because of Markdown formatting btw
https://www.spigotmc.org/resources/alixsystem.109144/field?field=documentation then try here, the last paragraph
I'm trying to reference it with like a *
That one works for me
I promise!
Or at least not those on a browser that doesn't support it 😛
That's kinda your only option though
#:~: wacky syntax
Blame Google
Like it just had a tummy ache
well then if you could just select this
since I don't have it automated
gonna tell other to scroll to it
they were so close to ;~;
choco how did u learn the Bukkit aPi
you dont, Bukkit learns you
huhuhuhuhuh
your sleeping patterns, your habits, your daily routine
Bukkit is always watching
observing
learning
im guessing by using it for 10 years
that too
reallY?!?!?! i asked HOW he learned it
not how long he used it for
he probably learned it by using it
bc i doubt docs were very good back in 2014 a year after release
same thing
back then we learnt it by throwing code at an IDE and waited to see what worked.
Wait you don’t do that anymore?
maven or gradle
maven
did you add the vault dependency
ye
show pom
again, what of it...
yep thats normal
that's normal
you type it without seeing it
doesn't accept any inputs
NOR DOES HE ACCEPT THE HIDDEN INPUT
it accepts input you just dont see it
HE DOESN'T
it does
i don't think su has a gender
HE DOESNT'
system
why are you using su anyway
then wouldn't it tell me right away?
cuz again
if I try to login as root from the start
the server just refuses the connection and tells me to login as opc
root often is not able to be logged into
it has no password
you cannot su to it normally
as you are intended to use sudo -u
for other user
I would to that
or use sudo -i
what distro
uh like 64
i'm sorry?
how can I check this?
thats architecture
oracle cloud instance
did it long ago
don't remember
run cat /etc/os-release
this it what the mc server says at start-up
run this
will do
again that's not distro
the server just needs to shutdown
thats java version and kernel
do you not have screen or tmux
smh oracle linux
can't do much about it now
ah fedora
this is what happens when I try to login as root
the terminal just closes right after saying this
yep
login as opc then
is this a vps
yes because root you cannot login as normally
probably
unless it's a managed OS i don't see why oyu dont get root access
try and connect as root
its normal for root to not be able to logged in as
root@ip
you can either
after I logged in as opc?
set root's password and allow login
or use sudo if you can get it
you should be using ssh or putty, change it from whatever to root
the server's public ip?
how do you connect to it
putty
change the connection info then
I input the private key, ip and configure the keepalives
hold on ill install putty
do I use the server's private ip?
change it to root@publicip
replace it anyway
try opc then
so how do I get root?
opc should have the same access as root
iirc it does yeah
then how do I install like screen and sudo on bash linux?
you should be able to access sudo from opc
how did it just start working
I did not work a few days aback
the sudo
it just said "bash: sudo: command not found"
I did not install anything
to me that looks like whatever you tried to do with sudo failed
it just typed "sudo"
I do also feel sometimes like that
cuz when it works for me I look at ppl who have problems with like like at idiots
until I try to help em, and boom, different situation, won't work
the hell
proceed where
hello, im trying to build spigot from source but got
[ERROR] Failed to execute goal on project spigot: Could not resolve dependencies for project org.spigotmc:spigot:jar:1.20.2-R0.1-SNAPSHOT: The following artifacts could not be resolved: org.spigotmc:minecraft-server:jar:1.20.2-R0.1-SNAPSHOT (absent): Could not find artifact org.spigotmc:minecraft-server:jar:1.20.2-R0.1-SNAPSHOT in minecraft-libraries (https://libraries.minecraft.net/) -> [Help 1]
just downloaded latest build tool and launched it in a new directory and clean maven cache with java -jar BuildTools.jar --rev 1.20.2
im fairly new to java, what can be the cause and where do i get this dependency? thanks!
Is that the full error?
This should be resolved by running BuildTools, as it installs the server jar in your local maven repo.
Did you make sure to install maven on your machine and add it to your PATH
You don't have to
BuildTools downloads maven and uses that
Likewise with git
Hm, i mean IJ comes bundled with a maven environment. So opening and compiling there should work.
Im jsut worried that maven doesnt find its local .m2 folder.
Smile how much for a code review?
( i know its more of a java question than a spigot question but ..) what tool is usually used for monitoring plugin to prevent from things like memory leaks ?
for example how can i check how many instance of a sorten object exist on memory ? so i can make sure there is no reference to that object so it will be collected by gc
a memory profiler like VisualVM, Eclipse MAT, etc
^
and regarding the references, there are techniques to ensure no references to a given object, however before u resort to those, its usually vice to revise ur design rather
as long as you dont leave things in a map list or array you don't need anymore, it's pretty hard to leak with a plugin
I have an obsession with performance and memory leak prevention, and I want to take extra care as my plugin grows. I've checked my code design multiple times, but I'd like to confirm that there are no references to my objects on Lambda expressions or Bukkit Runnables.
thank you for advice
challenge accepted
Well you could just hold a hard world reference in your main class then unload the world
Pretty sure that’ll do it
https://bukkit.org/threads/wip-analysis-of-your-server-jvm-using-visualvm.66536/
is this guide still work ?
I’m gonna say this, and emphasize on this, but the jvm and gc is ridiculously good at figuring out circular references, non reachable hard references and phantom ones, so in general you need not to worry
(im asking this here bc md_5 is the author of this post)
Yes
Pretty sure it works
It can also sometimes be harmful to eagerly clean references up in terms of optimizations
xd thx this resolved the issue… i'm used to building stuff in containers and didn't realize i don't even have maven installed on host machine
lol
I have created an object that includes an armor stand as one of its properties. I have also implemented a feature that removes every reference to the object when the armor stand dies, and this functionality is working as intended. However, I have noticed that for example if I have 20 instances of that object in memory and then reload the server, those 20 instances remain stuck in memory , even though there are no references to them. Is this behavior normal?
is this why so many people hate /reload ?
- You shouldnt hold hard references to live objects like Entities, Chunks, Worlds etc. They always have an indirect reference.
- Reloading is not supported by spigot and you should not put time into making your plugin compatible with a reload.
Also what do you mean by "stuck in memory" did you wait long enough for the GC to clean them up? This can take a while depending on your jvm arguments and how much memory you have allocated
yeh yeh thats fine, i dont wanna make my plugin compatible with reload i just wanted to know if this behavior is normal or not
i waited like 15 minute
I feel like those instances should be gone if you kept them in a Map<K, V> as values, and the keys being the ArmorStands.
But depending on your design, tracing the reference can be tricky.
i dont save those instances on any persistent container
they are all on memory
anyway
thank you
do you guys think this is useless
Yes. You should create a bunch of classes instead of throwing your values raw into a map.
Also: What is all this primitive stuff?
PrimitiveNumber.ofDouble(double) looks reduntant to me as double is already primitive
i needed to make a wrapper cause every element can have their own metadata
For example?
the only reason i did that is cause a lot of serialized forms are essentially key value pairs
public interface PrimitiveElement {
<T> Optional<T> getMetadata(Class<T> var1);
void setMetadata(Class<?> var1, Object var2);
//...
How is this metadata used? Is it serialized as well?
it depends on the serializer
like i could add a Comment metadata
yaml would serialize that
but something like json wouldnt
Hmm
ima rename the yamlconfigservice to yamlserializer
but the plan was something similar to like
bukkit's config sys
for my other non mc plugins
bros writting an essay
I really dont like having maps as configuration structures. I would prefer the config being (de)serialized to instances reflectively.
For example
public static class MessageConfiguration {
@ConfigName("Plugin Prefix")
@Comment({"Some mult line", "comment"})
private String pluginPrefix = "AM";
}
This way i have actual type safety for my configuration, and im not prone to errors which oftern occur when using String keys to retrieve config values.
i made smthing similar to that
I do something similar but I use something more like below
DataField<String> pluginPrefix = new DataField<>("plugin-prefix", "AM");
than cache the method handle :P
prob don't need to cache it tho tbh
Yeah mine looks almost identical to smiles
the one in pineapple does too cuz someone did a little stealing
epiccccc
*I dont have that. Just made it up. My approach is to throw everything into Gson because im lazy.

pft. annotations
I dislike annotations :P
IM WORKING ON IT 
I basically opted for a wrapper, and I like it :D https://github.com/2008Choco/VeinMiner/blob/master/veinminer-bukkit/src/main/java/wtf/choco/veinminer/config/impl/StandardVeinMinerConfiguration.java
interfaced and all that fun stuff. I likey
Gson works but it isn’t yml
Choco sus
If you squint
Lets use .properties for configs
Yeah just idk
You would use xml if you could
no I wouldn't use XML for configs I would use XML for something like a command API or inventory API thouhg
I would also consider Lua for that though
Lua is great as its easy to embed so you can really get some sweet ass stuff with it
Not fast enough!
Lua would actually be super sick for an inventory framework
see choco gets me
iirc some Hypixel Skyblock (players) nerds made some Lua Inventory Framework type shit
Yeah well you two are weird
I should make a scripting system for my plugins at some point
I don't have access to the SkyBlock team stuff, so 👀 I wouldn't know
I can think of many uses for that
Josh while ur here i have questions for you
choco how does your plugin handle config updates
Nothing is held in memory. It just pulls from Plugin#getConfig()
Like let's say you completely remodel the config
what happens to all the old values
oic, not local updates, just over time feature updates
What's oic
I announce them in the update notes and if they don't wanna use them, it'll fall back to defaults
I don't add them
Does ur config thing work like this
Find @ConfigEntry annotations
check if config exists if yes add missing defaults if no skip
Get Type
check if adapter exists
if yes run it if no try and cast to string
use result to call YamlConfig#set
save
load all from config
oh I see
oic = oh i see
ew
Yeah, not really understood the obsession with constantly putting in config values that don't really need to be there tbh
I keep my default config on the description page
If they need them, they can find them 😄
saveDefaults just calls save with replace false
@quaint mantle if you find yourself remodeling a config you are going need to hand map all the values if you change your config a shit ton multiple times you need to rethink your plugin designing the goal is to not change things plan ahead
I mean in general
Bcim making me own
I'm saying if that happens
Wait @worldly ingot how many hypixel devs are there
Like tree fiddy
is it true they got a special team just for fixing bugs
it shouldn't and if it does you are going to have to either A. Don't do anything and require players to update or B. manually map all the old to new values
I guess?
I mean I could be wrong
If it doesn’t find an adapter it just yells at you
Oh
Like
Wait so
Maybe ill add basic serialization
for example this entire config is made without a transafer API or anything if I update I update https://paste.md-5.net/emopoyujej.json
choco is minikloon a Sr dev what role is he actually
I can go count if you want 😅
there's cerus, you, paul, minikloon, plancke, mgrf, relenter, inventive, connor
uh
I'm starting to forget names
Simon
simon is not a dev
Y2K_ is a hypixel dev
Uhhhhh
Max
22 developers, so yeah, I was a bit off lol
fun
Theres probably a steve on there
is minikloon the superviser
every time I see choco talking around I get inspired to apply for like the 19th time
nah I am
but then I remember I'm just gonna get rejected the moment they look at my name on my CV
Inventive is prob supervisor
nah
Get a load of this guy 💀 🙏
Its choco isnt it
minikloon is a goated dev but I don't think he's doing management
he has the passion for development
Like there are 2 paths you can take as an elite dev
y2k is not and I repeat is not the supervisor
Yes he is
you either become a code wizard or you give up development for a more management position
kloon is a code wizard
do you have any proof?
one of my friends is just a code wizzard I don't get that guy he spends way to much time coding lol
What constitutes a wizard
Y2k is one of hypixels elite employees
dude's just years ahead
magic
Listen here you little shit
Woah woah
I know a couple people who are a few years behind
for example @young knoll
who's above minikloon other than simon
simon and kloon are friends irl
Who is this guy 💀
if I ever get management on hypixel it's actually over for the server
yeah
most revolutionary dev of the 21st century
author of Inventory PR
Nah I'm saying like
What I'm about to do to the players
all the opps are gonna vanish
do you even know who you are talking to?
I am the greatest developer ever to spawn on planet erath
Imagine hypixel using /op
Skript
we use luckperms guys
I love /sethome in bedwars!
they don't use Java they use Skript
half their shit is made with command blocks
we actually script with Lua
me and the hypixel team
y2k and his other brain cell
Hypickle
bold of you to assume I have another braincell
I'm still planning my minigame network >:)
Can confirm, CMI is installed on the Hypixel network globally
(for legal reasons, this is a joke)
Ill stand in for a tenth of it
Lets write one together. Bc there arent enough of those out there. 
Do you guys think an industry dev would be a good minecraft dev
I can't tell if you're being serious or not
Can you also confirm the skript usage?
I was talking to frostalf ab it and he offered a dedi
depends what industry
Blizzard employee
janitor 
Depends on the industry. But any software developer who had experience with object oriented languages will probably quickly get quite good in it.
Noonie industry
holy shit I love using JSON5 as my config
ew json
yes
u a little late
@rough ibex we must be related
I mean. Json isnt a configuration format really.
oh have you guys seen apple's config?
I remember joking ab flying developers out to break each other's kneecaps in case of nda breach at hypixel
Why not?
It doesn’t even support comments
Its convenient but probably not a good choice
Well technically
I should amend
they made a config system where you can code with it
Bc its used for mainly persisting data. Yml is for example better suited. One reason are comments.
toml
val thing = config["object"] as? JsonObject ?: throw AssertionError("Item \"object\" must be an object.")
I have seen the light
Throw oom
Idk I've never really thrown an AssertionError before
I just like to be consistent and throw 1 exc type if I can
Considering they convey the same message.
Aren't Error and Exception not the same
yeah they arent
haha
But I make sure my plugin stands out
never throw an error 💀 especially froma plugin
If you are using Gson properly, then you should never see JsonObject, JsonElement, JsonArray etc.
Your workflow should be more like:
Gson gson = ...;
String json = ...;
SomeObj = gson.fromJson(json, SomeObj.class);
Just brick the server
Well, I'm not using GSON
Thread.currentThread().join() to prevent further contamination
Where is "JsonObject" from then?
How else am I gonna stand out
Something goes wrong? Unsafe#putInt(0, 0)
probably some Json5 library since Json5 supports comments
pretend ur a clueless server owner
I use Jankson but the pattern can be adapted to any JSON lib I suppose.
https://paste.md-5.net/oxupilaxuh.cs I use this in production 
Jankson
plus,
Jankson is, for the most part, a drop-in replacement for Gson or Hjson, but can also be used as a preprocessor to fix quirks and strip comments, re-baking it into standard JSON syntax for another parser to consume.
I love the name
It's nice.
"IllegalArgumentException" tf is that prob nothing important
"Error" ima start investigating
class No(message: String) : Exception(message)
now we're cooking
Funny that the only use case scenario I have for it is preventing obscure memory leaks
How long until java blocks us reflecting unsafe
wdym
probably not until they replace it lol
I forget when they plan to do that by
you're telling me that I actually have to fork and fix code
hell naw
just unsafe inject a bunch of proxied classes n fix shit
I could've sworn Records were supposed to be like really safe
most useless change
Like anti reflection safe
nothing is safe from Unsafe
also I doubt Records are anti-reflection
*theUnsafe
They arent
They are already on their way to blocking runtime attaching instrumentation
watch some mf make an API that replaces those calls with classloading a custom .jar built in real time
and they will now recursively serialize nested objects
I mean records are just a fancy class
Wtf is happening with my keyboard
Ok this library looks janky af. Registering an external (de)serializer for something like ItemStack, Location, etc will be horrible.
json5 looks stupid
I mean it is called Jank-son 
You will also get some nice surprises...
guys we can finally stop arguing about which config is best apple released pickl the arguments are over
What does gson do when faced with an interface
Well, I'm not working/planning on serializing
unless their is a type adapter ya
I found it interesting how they have a type adapter for uuid built in
wasted my time making one
Depends on your deserialization strategy. My implementation stores the runtime class together with the object data and deserializes it later on.
You cant really deserialize an interface or an abstract class without storing its runtime implementation.
So it will throw an exception.
hey in ClientboundSetEquipmentPacket for the id of the entity what id is expected there? It feels like it's the ordered list of entities that the player knows about or something because it's not uuid
Isnt it just the int id? The client usually has no idea about the UUID
there's an int id?
Entity#getEntityId() iirc
uh the problem is my entity is purely packets-based
Oh, so you should have an entity id then because you need it to spawn one
Kinda an odd question but what should I do if I face an exception but I also fail to notify the user of the exception (like an exception while alerting an exception)
ClientboundAddEntityPacket clientboundAddEntityPacket = new ClientboundAddEntityPacket(
entityType.getTypeId(),
UUID.randomUUID(),
spawnLocation.getX(),
spawnLocation.getY(),
spawnLocation.getZ(),
spawnLocation.getPitch(),
spawnLocation.getYaw(),
net.minecraft.world.entity.EntityType.ARMOR_STAND,
0,
new Vec3(0,0,0),
0);
hmm is it the first one
there's a few "mystery ints" for me here
No that's its type
that was more of a guess on my end tbh
Oh, my mistake, yeah, it is the id :p
right
You just happen to be giving it the entity type's id as its id
so I should randomize it?
Which uh... shocked it hasn't broken yet
didn't have much time to break considering I barely got it to compile once thus far
I mean you're already directly invoking NMS so you could use the int field in the Entity class
Although iirc it’s protected
how do I do that?
this?
Oh there isn't. That's sad
Yeah that's the one
You'll have to get it reflectively
fantastic, my favorite
Convince choco to PR a visibility change :p
Nah
I don't quite thing the dumb shit I'm doing right now will get thrown into the api but I could be wrong
I think downstream does expose a method to get the next Id
people keep complaining that my models aren't 100% async so I'm just making them entirely artificial so I can send packets in async
There should be a class in Apache Commons to do things more easily. I think it's FieldUtils#getDeclaredField() or something
yeah I've been using this one
Yeah that works fine too
Oof obfuscated names
Don't know what it obfuscates to tbh
That’s why I switched to getting fields by type and index
I mean, I don't actually know if it'll break if you provide some absurdly high number, it's just not technically guaranteed to be unique
what was that really handy place for checking obsfuscated garbage
Technically it’s not unique anyway
d in 1.20.4
I want the d
It will eventually wrap around
Hell yeah you do
private static final Field ATTRIBUTE_FIELD = ReflectionUtils.getField(LivingEntity.class, AttributeMap.class, 0);
private static final Field CRAFT_ATTRIBUTE_FIELD = ReflectionUtils.getField(LivingEntity.class, CraftAttributeMap.class, 0);
No names required :p
fun I have to do this from 1.17 thru to 1.20.4 and it probably won't cover all of them
I mean if you can spawn 4 some-odd billion entities in a single server instance, then I applaud you
That # resets on server restarts lol
I'll give you an atomic long >:(
Oh boy
Nice
also hoping to find a packet that has next to no latency because that is my greatest problem right now
mc keeps interpolating api teleports and it's super slow
Make sure to set the display entities teleport duration
hm does that actually change anything because the problem isn't exactly that they aren't teleporting, it's that they are interpolating too slowly client-side
No idea
Mine were all choppy until I set it to match how often they got teleported
Granted I believe mine only move every 3 ticks
what field is this?
I can test that too, which method?
pretty sure those don't exist under entity
or livingentity
are you thinking about portalcooldown or something?
It’s on Display
wait what
We talking about display entities aren’t we
oooooooooh
ok I got you, I haven't actually started using those yet
I was doing pure packet entities first and then moving to display entities
Ah
actually now you have me wondering if the tighter teleport bounds are a display entity property
and unrelated to packets
do they actually visually teleport faster?
Don’t think so
They just don’t interpolate teleporting by default, while all other entities do afaik
also in reflections I only need to expose a static field once right, no reason to keep doing it every time I access it?
Correct
Same with non static
The results of display entity based models
#verified message
oh that's some bs then
damn
I could've kinda skipped what I'm doing
well too late
I thought I could do some packet trickery to skip the interpolation
big pog moment
Help with figuring out a nice elo equation
int maxEloToGain = 23;
int eloBounce = (int) Math.round(Math.random() * maxEloToGain));
This is what i have so far, it works nicely but I don't know if i can balance it more
tf
ClientboundUpdateMobEffectPacket clientboundUpdateMobEffectPacket = new ClientboundUpdateMobEffectPacket(id, new MobEffectInstance(MobEffects.INVISIBILITY, Integer.MAX_VALUE, 0));
((CraftPlayer) player).getHandle().connection.send(clientboundUpdateMobEffectPacket);
[05:51:07 WARN]: java.lang.NoSuchMethodError: 'void net.minecraft.world.effect.MobEffectList.<init>(net.minecraft.world.effect.MobEffectList, int, int)'
How did that even happen
am I doing something dumb here because the method does exist and it is public
am I tripping?
thats not a method
did you see the screenshot that shows the method?
Yes. That's a constructor not a method
Big difference
...which is how I'm using it?
which part of this isn't a method
that I am doing incorrectly
I mean i've reviewed your code
I dont know.
It looks like when you pass in MobEffects.INVISIBILITY that could be your issue
Your calling a different constructor then the one in image
it isn't, I tried that as a standalone and it works
it ceases to work the moment I try one of the initializers that takes more than one argument
doesn't work
works
Im not familiar with API you are using, I think its Forge?
this one specifically happens to be 1.19.4 but I'm supporting 1.18-1.20
Idk if MobEffect is a class
but MobEffects.INVISIBILITY works
Oh that returns a MobEffect?
and it's the same requirement on every initializer
yeah
like I said the first one works but none of the other ones do
Hmm, do you know what those parameters are even for?
Like what do the two ints mean
Hmm..
What doesnt work?
it throws the error I posted
Ahh right.
which doesn't make sense
it's like I'm not looking at the right api but I know I am
I agree lol
I mean I don't think I'm tripping, even the mappings website sees these
ClientboundUpdateMobEffectPacket(id, new MobEffect(new MobEffectInstance(MobEffects.INVISIBILITY, Integer.MAX_VALUE, 0)));
Try that
From what im reading that would work
that is exactly what I was testing
Try and see, should be good now
now?
compared to the 20 times I already did it?
actually no I take that back because you use mobeffect which is not even a class
Sometimes the best things take over 100+ tries before you get it the way you want, then you realize you can do it better on the 101st try
MobEffect is not a class?
Oh i asked you that before you didnt say anything, my bad
So what class is this mappings reading from?
Where are all of those constructors
rather mobeffect is not instantiable
Lol okay
Its not your code bro
Its definitely your server
U need to use same version in your project as you do on your server.
Thats why you get NoSuchMethod error
The version of Spigot on your server does not contain this method
I have a feeling this is the issue, because I had same problem the other day when I was working with NBT stuff
Instead it was NoClassDefFoundError
I hope i could help, please feel free to bumbard me i wanna help you solve this
so it's definitely not the server software, I just tested on paper and spigot
but there is something really weird I just noticed, MobEffects is decompiling for 19_R3 which is correct but when I try to decompile a MobEffect from that page it decompiles a 18_R1 class, how is that even possible
has anyone ever seen something like this happen?
although when I just do invisibility it works so that shouldn't be the issue
what the hell is up with this
You don't need nms for this
unfortunately the entity only exists in packets so it can be fully async
so unless there's some api feature I am unaware of I do need to figure out how to apply this potion effect the hard way
it's for freeminecraftmodels so that the custom model overlay can be run in async, people keep requesting that feature pretty much every day
any hints?
this one also doesn't work
Idk about packet entity
the general idea is just that an entity can't be async but theoretically you can kinda abstract it away from the game and just send packets
uh... it started working?
Which one is fired on InventoryClickEvent?
kinda, not really but I think that's because i'm doing it on the same tick
Since theres no blocks or airs in here
Nvm, its .getClickType
not .getAction
this is kinda weird, I got it to at least run correctly but the effect is not working
((CraftPlayer) player).getHandle().connection.send(clientboundContainerSetContentPacket);
Bukkit.getScheduler().scheduleSyncDelayedTask(NMSManager.pluginProvider, () -> {
ClientboundUpdateMobEffectPacket clientboundUpdateMobEffectPacket = new ClientboundUpdateMobEffectPacket(
id, new MobEffectInstance(MobEffects.INVISIBILITY, Integer.MAX_VALUE, 1));
Bukkit.getLogger().info("it should be invisible 3");
((CraftPlayer) player).getHandle().connection.send(clientboundUpdateMobEffectPacket);
}, 60);
it runs but it doesn't modify anything, ideas?
Hello, I’m working on a plugin for which I need to get the best type of tool for one specific block. How do I do this? Without checking for all blocks and their tools manually.
So you are trying to get the effectiveness of an ItemStack for a specific Block Material, right?
Including enchantments etc
Ill just assume thats what you want.
Paper has a ItemStack#getDestroySpeed(BlockState) method.
For Spigot you need NMS because it is currently not exposed in the API.
how would i get the JumpVelocityMultiplier of a block
Could you give an example?
well, when you jump on a honey block you jump low, but when you jump on stone you jump normally
What prevents you from checking if a player jumped from a honey block then?
there are more blocks like that probably but honey block is first i think of
and just in case minecraft adds any other blcoks like that
My friend's message looks like this; (muted playername): hi how can I fix this?
I dont know anything about plugin development. theres a plugin i want to use but it isnt up to date. the last version it was updated to was 1.19 and I want to know how much do I have to learn to update that plugin on my own
?services maybe?
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/
What plugin? 🤔
anti farm
Elaborate please
Does his name show up as muted playername
Yeah and in grey instead of the prefix I want
Itll be another plugin doing that
But he can see my message how I want it
Youll have to go through all of them ans figure out which one
Even if I don't have OP
Doesn’t change the fact that it’s a plugin
Youll just have to figure out what is doing it and disable it
Okay
I want to know what the best kind of tool is, but I guess I could check it using this method.
Pretty sure threre was a magic numbers utility for it right?
Well there is no other way than evaluating the break speed for each ItemStack ^^
Ok
it can't be something from his side? Because someone else joined and didn't have that
Could possibly be a modded client thing.
oh I think the effect might actually have been working but this is not how it's supposed to function
I can't use it and I use paper.
What version?
I honestly don't even know where I see which version I use, other than when creating the plugin
In your pom.xml usually (When using maven)
<groupId>io.papermc.paper</groupId>
<artifactId>paper-api</artifactId>
<version>1.20.4-R0.1-SNAPSHOT</version>
<scope>provided</scope>
You mean this?
Yeah
I don't know what I did earlier but now it works perfectly. Thanks for the help
Nothing, i just looked at the wrong ItemStack. The nms ItemStack has the destroy speed exposed. No idea why the api layer has this method on Block.
uh oh how does entitydataaccessor even work
repositories {
mavenCentral()
maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots/")
}
dependencies {
compileOnly("io.papermc.paper:paper-api:1.20.1-R0.1-SNAPSHOT")
annotationProcessor("io.papermc.paper:paper-api:1.20.1-R0.1-SNAPSHOT")
compileOnly("org.bukkit:bukkit:1.20.1-R0.1-SNAPSHOT")
annotationProcessor("org.bukkit:bukkit:1.20.1-R0.1-SNAPSHOT")
}
java {
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
}
Why it doesn't work?
The Error:
Execution failed for task ':compileJava'.
Could not resolve all files for configuration ':compileClasspath'.
Could not find io.papermc.paper:paper-api:1.20.1-R0.1-SNAPSHOT.
Searched in the following locations:
- https://repo.maven.apache.org/maven2/io/papermc/paper/paper-api/1.20.1-R0.1-SNAPSHOT/maven-metadata.xml
- https://repo.maven.apache.org/maven2/io/papermc/paper/paper-api/1.20.1-R0.1-SNAPSHOT/paper-api-1.20.1-R0.1-SNAPSHOT.pom
- https://oss.sonatype.org/content/repositories/snapshots/io/papermc/paper/paper-api/1.20.1-R0.1-SNAPSHOT/maven-metadata.xml
- https://oss.sonatype.org/content/repositories/snapshots/io/papermc/paper/paper-api/1.20.1-R0.1-SNAPSHOT/paper-api-1.20.1-R0.1-SNAPSHOT.pom
- https://hub.spigotmc.org/nexus/content/repositories/snapshots/io/papermc/paper/paper-api/1.20.1-R0.1-SNAPSHOT/maven-metadata.xml
- https://hub.spigotmc.org/nexus/content/repositories/snapshots/io/papermc/paper/paper-api/1.20.1-R0.1-SNAPSHOT/paper-api-1.20.1-R0.1-SNAPSHOT.pom
Required by:
project :
Possible solution:
- Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html
This has been answered already
- You are using the wrong repository
- Neither bukkit nor paper are applicable as annotation processors
- Importing bukkit together with paper is rather useless
So?
repositories {
mavenCentral()
maven("https://oss.sonatype.org/content/repositories/snapshots")
maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots/")
}
dependencies {
testImplementation(platform("org.junit:junit-bom:5.9.1"))
testImplementation("org.junit.jupiter:junit-jupiter")
compileOnly("net.luckperms:api:5.3")
annotationProcessor("net.luckperms:api:5.3")
compileOnly("io.papermc.paper:paper-api:1.20.1-R0.1-SNAPSHOT")
}
java {
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
}
Nope. You are still using the spigot repository but importing paper.
Also luckperms is not an annotationProcessor
What is annotationProcessor("") ?
Its used by your IDE to preprocess compile annotations before compiling.
You should not worry about that.
compileOnly is all you should need for the beginning.
Okay
where should I check for data related to datawatchers?
oh I think I was looking for the entity metadata format
Pls read a setup guide for either spigot or paper.
They both have official guides for setting up a project and compiling it.
Okay Thanks @lost matrix !
mavenCentral()
maven("https://oss.sonatype.org/content/repositories/snapshots")
maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots/")
maven("https://oss.sonatype.org/content/repositories/central")
}
dependencies {
testImplementation(platform("org.junit:junit-bom:5.9.1"))
testImplementation("org.junit.jupiter:junit-jupiter")
compileOnly("net.luckperms:api:5.3")
compileOnly("org.spigotmc:spigot:1.20.1-R0.1-SNAPSHOT")
}
java {
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
}
It works not more
Do you need access to NMS?
What is NMS?
then you dont need that
This is a clear no then.
Use spigot-api instead of spigot
compileOnly("org.spigotmc:spigot:1.20.1-R0.1-SNAPSHOT")
->
compileOnly("org.spigotmc:spigot-api:1.20.4-R0.1-SNAPSHOT")
Probably want to update to 1.20.4 as well
It works.... Thanks 7smile7!
So now my plugin is working but it's causing a big error. Is there some way to post it here?
Can anyone help?
the return value of "org.bukkit.event.player.PlayerInteractEvent.getClickedBlock()" is null
You didn't click on a black whereby it returns null
Yes, that would fix the error
Ok, thanks
You're welcome
?blockpdc
Learn about CustomBlockData here:
https://www.spigotmc.org/threads/custom-block-data-persistentdatacontainer-for-blocks.512422/
?morepdc
You can create custom persistent data types on your own, or use one of the many libraries available which have implemented those which match your needs. Learn about more persistent data types here: https://www.spigotmc.org/threads/more-persistent-data-types-collections-maps-and-arrays-for-pdc.520677/
?pdc
I added this if (!e.getClickedBlock().equals(null)){CODE} but now it's complaining about the return value of event.getClickedBlock being null
Did I check the wrong way?
Oh
you'd be trying to call the .equals method on null
oh
which would lead to a null pointer exception
I'm not fully awake yet I guess
yo guys
How can i sync this
that's a pretty normal situation for real life i guess
i can probably start quest like "Return knife to it's owner" for p2
and when he completes it, i remove the knife quest from p1 with message like "Cancelled BringMeMyKnife since other player passed it"
Just as you described
is that actually a good solution
i avoid collecting the knife if quest wasn't started at all
i just spawn it in random chest on the map when somebody takes the quest
Why wouldnt you let each player have his own quest? Is this a first come, first serve quest that can only be done once?
i'm thinking about making a co-op(2-4) open-world rpg with zero mechanics
just as a test project
World is controlled by server, so every action is displayed for both players
so if one passed the quest like "KILL THIS GIANT MONSTER WHO IS ONLY 1 IN THE WORLD"
second player can't kill him again since it's breaking the world story
Alright. Then why are there two knifes to begin with?
there is only one
What... Let me read your problem again
Why would the knife spawn in the dungeon if the quest didn't start?
it won't
I get it
Don;t spawn it at all. Only spawn it upon opening a chest with the quest active.
hmmmmmmmmmmmmm
Ok. I think i understand the problem.
Solution: Dont let each player have their own quests. Create a group object which holds the quests.
All players are in this group. If one player solves a quest, then everyone has solved it because the quest
is not owned by the players but their group.
easy to add to the chest contents when opened
so second player won't be able to get it at all this way

