#development
1 messages · Page 71 of 1
its not the best solution probably but it works
having to check for the enchantment manually is also kinda a pain
It's just for adding the glow so I would just add unbreaking or something if I can't get it to work.
i add the glow enchant by using protection 0
protection's effect calculation is (4*level)%
so if its level 0 it doesnt boost it
It's not for useable items so it won't affect anything.
fair enough
Is it not possible to give potion effect higher than duration 32767 ticks (2^15-1) looks like a ViaVersion issue
I can't give more than that, using 1.8 (I know, it is outdated, but not my preference)
Question, Im just getting back into making some plugins in my free time. And iv always wondered about this. So is it not static abuse to use singleton to construct an instance of a class and do ThatClass.getInstance()? Or is that fine to use static for something like this? The previous ways iv done this is having a instance in the Main class and refrencing that, but then i have to pass in the main class to every class I want to use it in
if that makes any sense at all..
I mean technically bukkit does this already with JavaPlugin.getPlugin, Bukkit.getPluginManager(), and JavaPlugin.getProvidingPlugin, so I guess in the end it technically doesn't really matter, but I think that it would be considered static abuse, yes
edit: had some other info/explanation here but it kinda doesn't make sense for this case so
for why it's bad, feel free to google that part :))
Dependency Injection
Dependency Injection is a way of providing objects with the objects they need ("dependencies"). This is usually done with a constructor, but can also be done for individual methods
Read more here: https://en.m.wikipedia.org/wiki/Dependency_injection
Dependency Injection in Java:
https://paste.helpch.at/yijawupoju.java
Dependency Injection in Kotlin:
https://paste.helpch.at/esogakutod.kt
Alright thanks, I juse DI for most things I was just curious
static and singleton pattern are mainly an issue due to unit testability
DI allows you to mock modules while testing
It can also be a design issue long term, and you do have powermocks to mock static stuff (though if you actually need powermocks, jokes on you)
hey what is this channel for
⚙️ Development Support - Stay on topic! - Not configuration help - No favourite IDE arguments.
coding help
Is it possible create splash potion with custom duration?
Ye why not
tried using PotionMeta but it just didn't work
Do you mean splash or lingering?
splash
Anyone have a good guide for unit testings?
There are some really good books about it I can give you
But yea ru just aiming to learn how to unit test (like using Junit in java with mockito etc?) or do you want to learn unit tests in the industry as well as test practices such as tdd?
does anyone know an instance where a tameable can be owned by a non entity?
or why does this even require a cast
looking at the docs, an offline player can be an animal tamer
so yeah if the owner is an offline player that wont be an entity
ahh i see, thanks
a player can be an entity but an offline player isnt
Owner can be only player
check the interface wtf
u can cast / manipulate do something tricky
thanks team
yes, but it doesnt mean the owner is online
and since offline player isnt an entity ,thats why its not set as entity
Classic tony
nms party tonight?
every night is nms party night
i assume spawners spawn and seeds grow and are regulated by main thread. if so, is it possible, without folia, to move them to separate thread? even if it involves some sketchy methods
for seeds, you can modify spigot.yml and set the wheat modifier to a negative number
for spawners, you can modify the paper config for the world and set the mob spawner tick rate to -1
if you want to edit it using a plugin, you'd have to modify the server jar or edit the config via reflection
but they are still being ticked on the main thread? Im not looking for a way to disable growing or spawning, just move it to a separate thread. Though my understanding of how it works might be a bit wrong, or if it was possible then it would of probably be already done.
Nothing like that would be possible without heavly modifying the server jar.
You might beable to disable the ticking then make your own threads and run the NMS methods.
ohhh
then yeah you need to modify the server jar
sorry i completely misunderstood/misread lol
on a scale of 1-10, how difficult would it be to modify the paper jar? assuming someone with fairly good java knowledge
all good, I might have not been clear enough of my intention
i think paper gives a guide and so you just edit it and then ij makes a diff file (at least I'm assuming/hoping that the devs aren't manually typing out diffs?)
nono I was digging through the server code and forgot what the intention was 💀 but I can tell you where the code that you probably want is
at least as of paper 1.20.1
net.minecraft.world.level.BaseSpawner line 82 (serverTick)
net.minecraft.world.level.block.CropBlock line 72 (randomTick)
Might just hire someone to do that since I dont have much time to do so lol
🥲
is what i'm trying to do would even do any good in terms of performance?
cuz I assume if it was it probably would have been done already in some shape or form
If you have the source it really shouldn't be that hard just remove the code from the worlds tick method. Then have your own thread running the methods you want multi threaded.
I doubt there would be much benefit, especially considering there is no way to do that without at least breaking plugins
It has... Folia lol
yeah, but folia isnt really an option for me lol
Folia doesn't do specific things off the main thread, it splits the world into multiple regions
Whats your server type?
Gamemode* Skyblock, survival, factions?
Then your server is what folia was made for lol
I mean, just think about how many plugins are written in a way that they support what you're trying to do
hmm. i guess ill try running folia on a testserver and check the damages
oh if this is for your server then you can run spark to see if its actually needed
funnily enough folia if translated letter by letter would sound like folija in my language which means tinfoil
eh, well, been doing a lot of profiling as of lately, found some minor issues but thats about it
Yeah definitely gonna be a challenge finding which plugins support folia since its not even fully supported itself lol.
You could ask @spare marsh though as I see him requesting plugins to be modified for folia alot.
recently upgraded from 5900x to 7950x3d and ddr5 but have only seen a slight degrade in performance
been wondering why is that the case
Bottleneck from your motherboard?
also the server owner insists on running the server on 30gb+ ram, though from what I know it's not ideal, plus I've noticed on grafana that we only use about 14-15 lol
that's definitely too much for G1GC
thats with 180+ players
Survival with a big online playerbase, I can see the need for 30gb.
yeah I will check the jvm flags, I remember tinkering around with it, not sure if they are the most optimal though
more memory can lead to longer GC times though afaik
Don't know the specifics but I think that's what SirYwell meant
yes
Ah true
i think you can view gc times in spark though
GenZGC won't have a problem with that though
depends on which gc you use
uh im not even sure what we are using, since we are renting a DS
g1gc
don't know much about other gcs 🥲
zgc can handle terabytes of heap no issue
oddly enough I can't even check the manufacturer of the RAM, all the ubuntu commands show it as undefined lol
I assumed you upgraded the parts. Yeah might be something you should ask your host about. If you can prove it ofcourse.
I mean 5900x uses AM4 and 7950x3d AM5, so cant be due to using an old MB, though they could have cheaped out on it
could be that it's too new
no decent software support yet, maybe
Depending on the plugin I may or may not lol. All the plugins I have been using have been ported.
although the 7000 series came out in 2022 according to google so that doesnt seem that recent any more
Even if I don’t most plugins have alternatives you can use.
Hello, I was wondering how do I build DeluxeMenus on Ubuntu? I tried ./gradlew build, but it doesn't work? It just says permission denied.
try running chmod +x gradlew
that should give permission
Huh now it says " -bash: ./gradlew: /bin/sh^M: bad interpreter: No such file or directory " despite me cloaning and such. Here is the log ( https://mclo.gs/B0h9zHp )
is this on a Windows pc?
or an actual linux computer
Yes I am on windows, but I am using ubuntu
try doing it without the ubuntu
you'd just run gradlew.bat shadowJar in command prompt after cloning the git repository
then it should be in build/libs/DeluxeMenus-1.41.1-DEV-null.jar
alternatively you can try the solution this solution in ubuntu: https://askubuntu.com/a/305001
but note that you probably need gradlew(.bat) shadowJar
not build
Oh okay. I don't have gradlw on my terminal, so I'd have to install it. In the meanwhile I was wondering if it wasn't possible to build it using Ubuntu? Alternatively, shouldn't intellj work too?
you don't need gradle installed, that's the wonderful thing about gradle 🤩 (since its all in the project files)
and yes intellij and ubuntu should both work
Thanks!
when registering NMS entities
should be matching ID to the entityType or not existing one?
wdym? but these IDs are no longer in the game I thought
im in a very old version and i highly depend on nms. i still depend on it..
😉
ill do trial and error i guess
or you can connect it to the menu by clicking, after which the item will be enchanted?
can someone help me with this build issue so i have a list of canPlaceIn (glass) and target block meaning for example lets say i want to palce a tree the target block would be grass_block 0,1,0 so we would find a grass_block and place the tree 0,1,0 on the grass block but for my senario the target block is air 2,0,0
so what should happen is it should be placed on the right side where the build should be inside the glass 2 blocks on the x axis away from air but it isnt placing there
its not placing at all my other tree and grass block senario works
int randomIndex = random.nextInt(cubeLocations.size());
Location targetLocation = cubeLocations.get(randomIndex);
for (TargetBlock t : targetBlock) {
if (targetLocation.add(t.getX(), t.getY(), t.getZ()).getBlock().getType() == t.getMaterial()) {
if (canPlaceBlocksAtLocation(getUpperBuild(), targetLocation, t)) {
System.out.println("there glass");
int lowestY = getUpperBuild().stream().mapToInt(WorldBlock::getY).min().orElse(0);
if (randomValue <= percentage) {
for (WorldBlock worldBlock : getUpperBuild()) {
int offsetX = worldBlock.getX() - getUpperBuild().get(0).getX() + t.getX();
int offsetY = worldBlock.getY() - lowestY + t.getY();
int offsetZ = worldBlock.getZ() - getUpperBuild().get(0).getZ() + t.getZ();
int targetX = targetLocation.getBlockX() + offsetX;
int targetY = targetLocation.getBlockY() + offsetY;
int targetZ = targetLocation.getBlockZ() + offsetZ;
}```
public boolean canPlaceBlocksAtLocation(List<WorldBlock> worldBlocks, Location location, TargetBlock targetBlock) {
int lowestY = worldBlocks.stream().mapToInt(WorldBlock::getY).min().orElse(0);
for (WorldBlock worldBlock : worldBlocks) {
int offsetX = worldBlock.getX() - worldBlocks.get(0).getX() + targetBlock.getX();
int offsetY = worldBlock.getY() - lowestY + targetBlock.getY();
int offsetZ = worldBlock.getZ() - worldBlocks.get(0).getZ() + targetBlock.getZ();
int targetX = location.getBlockX() + offsetX;
int targetY = location.getBlockY() + offsetY;
int targetZ = location.getBlockZ() + offsetZ;
Location targetLocation = new Location(world, targetX, targetY, targetZ);
if (!canPlaceIn.contains(targetLocation.getBlock().getType())) {
return false;
}
}
return true;
}``` my issue is the the canPlaceBlocksAtLocation
Does constructing an armorstand (or any entity) using new EntityArmorStand(world, x, y, z) cache the object anywhere?
I brought this up before when I was showing how physics aren't applied to these entities but pistons are somehow able to push them.
I looked through all the constructors and super classes and can't find anywhere that it would cache this object so I don't see how a piston is able to move it while everything else is negated.
it's impossible for constructors to perform caching, they always make a brand new object
What is the reason for not being able to change variables in lambda functions?
Is smth like this bad?
Not what I meant.
I'm looking for where the entity is stored after its constructed... but just based off the constructors I'm not seeing anywhere the object is cached (added to a list, map etc...)
So how is a piston getting the entity to push after its constructed?
not bad, but you might as well just use a for loop - also AtomicDouble is a thing
how should I get started, making plugins and stuff
learn java
?learn-java
Online Courses:
Online courses are also great for learning java. Some websites that offer them are:
- Coursera - Free unless you want a certificate
- PluralSight - Great courses from what I've seen. Mostly Paid
- Udemy - Never used them myself but they seem to all or at least most be paid.
My first ever course was one from Coursera. - I can say it was pretty good at introducing me to the programming world as a whole not just java.
Oracle Docs:
Oracle docs can help a lot at learning and understanding java:
- Start with this,
- Breeze through this (skipping stuff that doesn't seem relevant like bitwise operators),
- Hit this.
They're the first three from this larger thing which you should definitely go through overall. But those three should be enough for slightly better understanding of what is happening here without feeling like a huge time sink.
That one is a small part of this larger site wherein "Essential Java Classes" and "Collections" also have good useful stuff
Other services:
Some other cool services that will help you learn java are:
As you can see there are plenty of good ways to learn as long as you're willing to invest the time. Have fun learning!
focus on having a good knowledge of java first, then the spigot stuff will be easy
other way around is very hard
I know a bit of python
how long would it take me to learn?
Read javadocs, open source plugins, tutorials etc...
anywhere from a few days to a few years, depends on the person
thats a good start, though theyre fairly different languages. it might help you get the basics down
Yeah makes sense, it's because the function works like functional programming right? Immutable variables or whatever
that's not the reason why
but kind of
there are 2 good explanations that i like
the first is that it's because java is pass by value, not pass by reference
which is the actual reason why
the second is that suppose you could do something like this, this code would be legal: ```java
void blah() {
int x = 0
Runnable r = () -> {
x = 1;
}
runTaskLater(r, 1000);
}
by the time that `r` runs, the method has finished, and so `x` doesn't exist anymore
it's already been cleaned up
Ohhh yeah well that makes sense, but does lambda work the same way? I thought it would still run in sync with everything else
well no, the whole point of lambdas is to capture a computation that you can run at arbitrary points
how would it sync? would blah() not finish until r runs?
So this wouldn't necessarily get the final amount?
AtomicReference<Double> autosellMoney = new AtomicReference<>((double) 0);
event.getItems().forEach(item -> {
autosellMoney.updateAndGet(v -> /* update blah*/);
});
double finalAutosell = autosellMoney.get();
Just imagine its atomic double
Changing it now lol
sure, in this case it's fine
because you know that forEach will actually run the function every time
but the compiler doesn't
just to be clear, this isn't the actual reason why this isn't allowed
this is
but i think this reason is more intuitive because it shows how even if it was possible it would cause weird behaviour
Oh I thought what you meant was that the code under the foreach function would potentially run after, like it was async
But yeah I just changed to a regular foreach
nah its cuz the lambda might try and change a variable that doesnt exist anymore
maybe this isnt the best explanation since it relies on you knowing about the java memory model a bit
Yeah not sure I understand why lol
Because wouldn't the variable always exist if the code still runs in order from top to bottom?
Or well obviously not but yeah
I don't understand why
it doesn't run in order
you create the lambda without running it, the method finishes, and then the last line jumps back to the lambda body 1000ms later
thats the important bit, the 1000ms
player.addPotionEffect(new PotionEffect(PotionEffectType.ABSORPTION, 300, 0));
Bukkit.broadcastMessage("amount 1: " + player.getAbsorptionAmount());
player.setAbsorptionAmount(20);
Bukkit.broadcastMessage("amount 2: " + player.getAbsorptionAmount());
```worked fine on 1.19.4, but now on 1.20.2 its only giving 2 absorption hearts (4)
did the function of Damageable#setAbsorptionAmount changed between 1.19.4 and 1.20.2?
ping if reply pls
oh were those the versions when they changed/added a bunch of attibute stuff
probably
nice ty
i assume i can just get away with setting the maximum to 20 whenever a player joins
yeah just gonna play around with it, thx
worked btw ^
Hey I'm working on a server and i need developers. If you're interested lmk
I'm working on a plugin and want SQL support. Since I've change some major things I need to rewrite my sql code and need some help with how to do it. Currently I have a proxy that saves in local java.io.File objects or in a MySQL db depending on settings. I realised that this is kinda annoying and would like to just save them all in a db so that I don't need implementation for both Files and SQL. So, is it possible to store the data in a local MySQL file or smth? If so, can someone give me an idea where to start looking, internet is useless and I can't find anything helpful on the topic.
you can use SQLite if you want a local database
Ah perfect! Thank you
Currently learning java using w3schls, finished everything in the tutorial, now will be learning java methods. any tips/ advice?
Keep it simple, there is usually more than one way to solve a problem, your code is fine - you don’t always have to correct yourself after every opinion or programmer meta you hear of :) gl
Also, no lombok 
yes lombok
🦅
stop writing 100s of getters and setters, builders manually, use a single annotation
🦅🦅🇺🇸🇺🇸
use records
Records are suppose to not be edited.
just note that lombok is not java
Does efficiency of code have a big affect on the performance of a plugin?
What are some core things around plugin development, like what is necessary to know to make plugins
Imagine doing it manually
Intellij 😌
Well just like anything if its unoptimized you're gonna notice it.
You shouldn't focus on it now
what should I focus on?
You mentioned you were learning methods next - that's fine
Java seems easy so far, does it increase in difficulty?
Oh that's very good lol
But if you are just learning methods, there's still a bit more to learn
I'd also recommend learning gradle
Its an unofficial build tool used to manage projects (ex if you want to add spigot to your project, you'd tell gradle that) and to actually create the jar file
Another build tool is maven, but gradle is preferred
But depending on your stage, it might be too early to learn gradle (since it won't be necessary)
hello
like?
just lombok it 😎
Idk what your learning path is
.
.
Classes and file managing
bro how can i create dm ?
what command ?
Oh ok
Yeah you want to learn methods (you can skip recursion) and look at classes
Then after that, just Google like "spigot gradle" and probably follow spigot tutorials from there
There's no set path to follow so don't take my words or anyone's too seriously for how to progress
anything else to skip? :D
TextComponent textComponent = Component.text(PlaceholderAPI.setPlaceholders(player, line));
Component component = MiniMessage.miniMessage().deserialize(textComponent.content());;
lore.add(ChatColor.translateAlternateColorCodes('&',LegacyComponentSerializer.legacyAmpersand().serialize(component)));```
i want to implement minimessage support in my config, is it the right way? im going insane
What's the best way to handle open-ended text as variables within placeholders?
For example, example_<text>_var1_var2 where <text> could potentially include underscores, what's the best way to handle that? Quotes?
I haven't used PlaceholderAPI before, so I don't know how other developers tend to do that, but I'd like to keep the syntax consistent
i think you do
Can someone explain how this only prints 1 and nothing else?
PickaxeType type = getPickaxeType(firstJoinPickaxe);
System.out.println("1");
ItemStack pickaxeItem = type.build(prisonPlayer);
System.out.println("2");
PrisonPickaxe pickaxe = new PrisonPickaxe(pickaxeItem, prisonPlayer);
System.out.println("3");
code of build method: https://paste.helpch.at/edatetaton.java
Try surrounding the type.build line with try/catch since it throws an exception
uhh
threads, inner classes, user input, date, linkedlist, iterator, regex
can also skip abstraction since you're probably not going to use that anytime soon
i learnt abstraction in school! so i'll just go over it afterwards. thanks for making this easier for me
oh okay that's good
can someone explain encapsulation ?
a class that exists for variables and methods, like the player class for example is encapsulation
i have no idea what that means
i dont understand the concept behind get and set
and this too
if you had your variables a public then one piece of code could modify it at any time with any value, getters and setters exist so you can put limits on what that value can be and to exit before its changed
inside the class
and are private classes read only? or no read
the class is public, the getter and setter methods are public, but the variables are private
the public class?
private classes cannot be accessed afaik from anywhere, its unlikely you would make a class private unless its an inner class
public class Main {
public static void main(String[] args) {
Person myObj = new Person();
myObj.name = "John";
System.out.println(myObj.name);
}
}
private String name;
// Getter
public String getName() {
return name;
}
// Setter
public void setName(String newName) {
this.name = newName;
}
}
code i find confusing
the get and set are inside of the private class, so what are they doing?
are they moving data (to the main class)? or
in the main() attempting to call myObj.name would throw an error
^
you can't get the values that are private
you can ONLY get the private value from the parent class itself
minus reflection but that's too advanced rn
public static void main(String[] args) {
Person myObj = new Person();
myObj.setName("John");
System.out.println(myObj.getName());
}
}```
```public class Person {
private String name;
// Getter
public String getName() {
return name;
}
// Setter
public void setName(String newName) {
this.name = newName;
}
}
what about this?
that wouldnt error, because those functions/methods are public
so things can be public in a private class
private = only the parent class can access it
protected = only the classes inside the parent PACKAGE can access it
public = every class can access it (theoretically)
nearly all classes you have inside of a project will be public
oh this makes sense, the name variable is private, but since it's in the same class it can access it, so the getter get's the variable and stores it, and sets it to newName which can be accessed by another class
yeah
the method is public therefore that would work. But if the method was private that would throw an error since the main method doesn't have access to it
so you would make another public methodd in the class getting and setting the private method so it can be used by the main class
oh, rad
and non-static variables are stored inside the object whenever you create a class object
static variables are stored inside the class which isn't created everytime you create an object of the class
to my understanding, idk how it works under the hood but ik when to use them 💀
static variables are created when it registers that the class exists
you dont even have to call new for those variables to register
anything i should know about any of this going forward?
if you want to call static variables, then you have to do ClassName.variable
i think i'm gonna call it a day, currently im using w3schools https://www.w3schools.com/java/, i finished the tutorial yesterday, now i'm moving onto Packages / API
or if you are using a getter/setter, they have to be declared as static aswell
i need to familiarise myself more with keywords
hopefully after time my memory an understanding will increase
also be careful about static abuse, here's a link for better understanding: https://stackoverflow.com/questions/11906913/java-static-vs-instance
what's instance?
not sure if you figured it out already but basically, getters and setters allow you to control the data being set and get as Lunaiskey mentioned
But even if you're not doing anything with the data (other than setting and getting), if you didn't have getters/setters but wanted to add them later, you'd have to change all of the code from person.name -> person.getName()/person.setName()
So having getters/setters from the start avoids that
when you call for example, Person person = new Person(), the person variable is now holding an instance of Person
its basically just a copy
what's an alternative, instead of opening the same instance, it opens like a cloned instance basically so that both can have and edit the same value but differently
just make another variable
and looks way better sometimes
https://i.imgur.com/z00fqmT.png
😌 Lunaiskey you should take the java quiz
public static int x = 5;
}
Test t1 = new Test();
Test t2 = new Test();```
would it turn into
public class Test{
public instance int x = 5;
}
Test t1 = new Test();
Test t2 = new Test();
no, you'd just remove the static keyword (public int x = 5;) - note that it should be private though because encapsulation
bruh i cant send images in here
You won't be able to upload images here directly to avoid spam, so please use https://imgur.com/upload or similar service to upload images/screenshots.
ugfhhh
lol
hehehehe
this is static: https://imgur.com/a/mOqveps
(I am using kotlin but same thing)
kotlin is actually awesome
indeed
anyways, @dusky harness , @brazen elm and @proud pebble , nice discussion we've had lol. I'll be going offline now. Thanks for all of your help to broaden my understanding about Java.
lmao
thought it was yaml for a hot second, also for the array i was thinking when you declare the contents of an array like {1,2,3} unless im completely dense and it is [1,2,3]
mixing java and yaml 🥲
If it doesn't matter what type of player I need to use, should I use the onRequest(OfflinePlayer, String) method or the onPlaceholderRequest(Player, String) method?
I dont think it matters too much, personally I'd use the Player one
the first one just calls the second one if you don't override it, so use whichever you need
just note that because of that, the second one won't work if you use the first one
ok github copilot, I didnt need to be reminded
Lmao
might want to take a look into what instances are (and what static is) in the future once you are familiar with the basics
or you can connect it to the menu by clicking, after which the item will be enchanted?
is that the real outspending
a nobody that is following me everywhere
literally more than half the servers im in hes in
Well ur not famous and ur clearly following me if ur here
Hello there, I am trying to hide player x name tag from player y, by sending a armor stand spawn packet to player y, that is attached to player x. I'm stuck on attaching the armor stand as a passenger. I noticed the Mount packet only takes one argument and that confuses me, couldn't really find anything online.
... If you want to hide players from each other you can use Player.hidePlayer(Player)
I want to hide the name tag, my bad
Ah
just want some advice, currently working on a plugin and every friday at 00:00:00, i want the plugin to run a certain method, is there an event i can use ?
I would just run a bukkit scheduler for every second or something and check the time using https://stackoverflow.com/a/26097080/14105665 and https://www.geeksforgeeks.org/localdate-getdayofweek-method-in-java/ (both use LocalDate)
I want the program to check if current time hits midnight, then do something.
I've tried this:
if (DateTime.now() == DateTime.now().withTimeAtStartOfDay()) {
//do stuff
}
The problem is tha...
A Computer Science portal for geeks. It contains well written, well thought and well explained computer science and programming articles, quizzes and practice/competitive programming/company interview Questions.
ah thank you
should i do that for a discord bot too (except not a bukkit scheduler obv...)? been trying to use some library but it just dont work
you can use ScheduledExecutorService
tbh that's probably the best solution for Walter as well, but I didn't feel like doing research 🥲
yeye, i tried using something called Quartz, just never worked
uhh
Quartz is a lib for cronjobs iirc
Anyone got a class that basically makes an item undropable in any way? Like inserted into chest, dropped, everything
Question regarding GitHub and Verified Domains. I've followed the steps to verify a domain and it did verify it but after a while it sent me an email to reverify. This has happened twice now. I can't see this specified anywhere but I've removed the TXT Record after verification. Anyone know if this might be the issue or if this is just normal?
I went ahead and reverified and didn't remove the TXT Record. We'll see if it happens again or not.
Can I somehow get rid of this unchecked cast warning? I know that in java I can't check the generic type, I guess in kotlin I cannot do it either, right?
there's reified but it won't work here, so nope - type erasure 🙃
stupid compiler, doesn't see that I check isSUperclassOf 🥲
Can DeluxeMenus open a menu with a specific color? I'm not exactly sure how, but vanilla core shaders can take a color argument, and that color is specified on the server somehow
hey, how do i differentiate between if something is an inner class, or an outer class
indentation?
Hello, im having troubles accessing the roles in my discord. it says im the server owner but when i click server setting the roles tab does now show up. can anyone help me?
hey, can you send a screenshot of how it looks when you want to quickly invite someone?
Looking for discord support?
HelpChat is a Minecraft plugin and development support server and is not affiliated with discord in any way.
If you require support from discord, we recommend you to visit their official support website at https://support.discord.com
On this website, you can read their FAQs, or open a support ticket if necessary.
it wont let me paste the picture but i added you as a friend
You won't be able to upload images here directly to avoid spam, so please use https://imgur.com/upload or similar service to upload images/screenshots.
as said, this is not a server for discord help.
roger
like i said i added him as a friend and took it offline 🙂 ty
who can help me setup plot system i have all the code i js need help setting it up will pay LMKK
in your YourClass.java
import something.else.thing
public class YourClass { //<== outer/main bit of the class
public int doSomething() {
return (new YourInnerClass()).getVar();
}
public class YourInnerClass {
//inner class, these can be nested classes if
//you wish to do that.
public int variable = 0;
public int getVar() {
return variable;
}
}
}
basically an example
non static inner class !!!
an inner class is always non-static, otherwise it would be a nested class
true
is this possible to do path finder class like this ```java
//not actual code don judge just concpet
if(health > 20) {
if(enemydistance > 5){
Shoot(entity);
} else {
StabInTheHead(entity)
}
} else {
RunAway
}
something like that can i do with custom entity pathfinder goal
like writing on pathfindergoal ofc
and also cast abilites how would u do it by a task or there some sort of priority in entity goals?
like there is i know i have checked the net.minecraft default mobs
i mean vanilla but yeah
it has like goal(intger,jerk around); and etc etc
I have an error in my code from protocollib, and at the bottom of the error, it gives these paramaters:
[17:55:31] [Server thread/ERROR]: Parameters:
net.minecraft.network.protocol.game.PacketPlayOutEntityEquipment@452d894f[
b=99
c=[(MAINHAND, 1 netherite_pickaxe)]
]
hello, i want to store simple integer to acces it throught placeholderapi
What's the best way to handle it? and prevent losing the data on server crash and make it optimized so it doesnt read and lookup every second the data.yml file?
Just load from file on startup and save periodically. @ripe gull
or save on change and keep a cache for papi
can i see somewhere an example of the implementation
ok, i did the w3schools guide, now what do i do to make my java skills the best/learn how to develop in spigot
practice
hold on
alr, msg when your here

piggy is an admin in this server btw
i dont think hes really active recently tho
what api do i use?
how do i even create the plugin thing in intelij?
oh wait oops yeah I forgot to mention that lol
spigot should have a wiki tho
couldn't see it
hold on kinda busy atm ill link more soon
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
look at this url, then these
oh and this
(from this url)
best is paper, but for simplicity, I'd stick to spigot for now
or actually tbh
yeah just stick to spigot for now
what's the difference?
paper has a lot of additions
but also "removes"/unrecommends/deprecates some spigot stuff that you should probably know
"some" is an understatement
I originally wrote "many" but edited it 🥲 because idk how to english that
it deprecates anything that doesnt use adventure 😭
🥲
adventure better tho
i love adventure
such a cool lib
oh if you know adventure already
then
you know this would be a great time to advertise galaxy gradle
ill learn the developmental side too
but for the sake of knowing the behind the scenes
oh right i added adventure support to that i forgot
😮
hey that was stolen inspired by DkimGradle
sorry i had something stuck in my throat
never heard of it 
btw i recommend spigot
as it just widens userbase, but if u need paper-specific stuff then use paper
up to u tbh, a majority of ppl use paper already anyways; https://bstats.org/plugin/bukkit/EssentialsX/858#serverSoftware
GRADLE
yeah paper (sorta) recently made its entirely own plugin registration/loader thingy
oh
paper server
oh right this is first-time sorry
wdym efficient btw?
like,compared to spigot as a server .jar
u can use paper server jar even if u develop with spigot
ex: xyz.srnyx or com.srnyx
does it have to be?
u can just make it up
i used me.dkim19375 then like 2 years later bought dkim19375.me
💀
¯_(ツ)_/¯
yeah thats the only thing u gotta keep in mind
its used to identify ur code
so its best to use something u can acquire later yknow (or already have)
ye true
wish i had used com.srnyx :(
tbh i like xyz more
project name lowercase no space no underscore no dash
no symbol
actually are there supposed to be dashes?
idk i dont use dashes tho
yeah i dont either
what??
btw to recap: https://www.spigotmc.org/wiki/spigot-plugin-development/
do these: https://i.imgur.com/jnGKUYG.png
and you can also try out https://www.spigotmc.org/threads/challenges.235525/#post-2378547 later
0.0.1 for dev builds smh u should know this
oh uh
wait i dont even use group.id i dont think
omg
i just set rootProject.name in settings.gradle.kts
(and not lowercase, ex: LaserTag)
thats supposed to be in settings.gradle.kts
well thats what intellij does so
¯_(ツ)_/¯
SMh
so what the heck is artifact id
public static void loadData() {
FileConfiguration config = YamlConfiguration.loadConfiguration(new File(PlayerGreetRewards.plugin.getDataFolder(), "data.yml"));
for (String key : config.getKeys(false)) {
UUID uuid = UUID.fromString(key);
int greetings = config.getInt(key);
greetData.put(uuid, greetings);
}
}
public static void saveData() {
FileConfiguration config = YamlConfiguration.loadConfiguration(new File(PlayerGreetRewards.plugin.getDataFolder(), "data.yml"));
for (UUID uuid : greetData.keySet()) {
config.set(uuid.toString(), greetData.get(uuid));
}
try {
config.save(new File(PlayerGreetRewards.plugin.getDataFolder(), "data.yml"));
} catch (IOException e) {
e.printStackTrace();
}
}```
is this the correct way of caching my data?
oh, isnt it not needed for spigot plugins? like it dont do anything
ig not but intellij auto adds it so i just have it 🤷
oh lmao
although i don't use intellij project maker for java anymore 😌
should make ur own project generator
i assume greetData is a map?
if so, it looks good, but i usually store/cache the YamlConfiguration too (or whatever YamlConfiguration#loadConfiguration(File) outputs i forget)
hashmap
yeye
u should just be able to save every 5 mins, not have to load
well it uses some templates but it also automatically fetches latest versions, automatically configures based off what you say, etc
tried finding a video but couldn't find :(
but like what language
kotlin
so my loadData() is useless then?
no u run that when plugin starts
(and/or in ur plugin's reload cmd if u have one)
and i have a bunch of templates that it uses
send me the program.
um
well you see
its kinda personalized 🥲
so its closed source
BUT
it could be a fun project to code
WDYM?!
i dont wanna!!!!111!!!11!!!1 i just wanna steal ur code1!1!111!!!!!!
its in kotlin 💀
also its kinda broken rn
the placeholder system isn't working
so?! i can learn kotlin!!
uh
Sooo, now it will be cached for my PlaceholderAPI?
i dont understand
it can be a fun first kotlin project 😃
i want my data to be stored to use it in PlaceholderAPI
imma cry
and i dont want the PlaceholderAPI to look for the user every second in data.yml file, i want it to be cached in map
alr yea if u use ur greetData map to get the data for the placeholder it should be good 👍
okay thanks
so now when i change values, i do it only on the map, and saveData() every like 5 minutes?
this approach is okay?
yes, only risk is if server crashes, data wont be saved (unless it was saved recently yknow)
public class CacheExample {
private final HashMap<UUID, Integer> cache = new HashMap<UUID, Integer>();
public void setGreeting(UUID uuid, int greeting) {
cache.put(uuid, greeting);
// save to file, ideally async idk what you are using as "file"
}
public int getGreeting(UUID uuid) {
return cache.get(uuid);
}
}
or you can do a file save every x amount of changes if these change constantly
so i save to file every time i change the value?
public static void saveData() {
FileConfiguration config = YamlConfiguration.loadConfiguration(new File(PlayerGreetRewards.plugin.getDataFolder(), "data.yml"));
for (UUID uuid : greetData.keySet()) {
config.set(uuid.toString(), greetData.get(uuid));
}
try {
config.save(new File(PlayerGreetRewards.plugin.getDataFolder(), "data.yml"));
} catch (IOException e) {
e.printStackTrace();
}
}```
im using a file data.yml
it depends on how often its changed
rarily
i wrote a plugin to reward players on greeting a new player on chat
and i want to store how many players you have greeted
on change should be fine then, also if you are using ymlconfiguration
cache the instance and use that
what does that mean
one sec
public class CacheExample {
private final HashMap<UUID, Integer> cache = new HashMap<>();
private final Set<UUID> changes = new HashSet<>();
private final FileConfiguration config;
private final int saveDelay;
public CacheExample(YamlConfiguration config, int saveDelay) {
this.config = config;
this.saveDelay = saveDelay;
}
public void setGreeting(UUID uuid, int greeting) {
cache.put(uuid, greeting);
changes.add(uuid);
if(changes.size() >= saveDelay) saveToFile();
}
public int getGreeting(UUID uuid) {
return cache.get(uuid);
}
private void saveToFile() {
try {
for (UUID changed : changes) {
config.set(changed.toString(), cache.get(changed));
}
config.save();
changes.clear();
} catch (IOException e) {
e.printStackTrace();
}
}
}
something like this
you probably have a database running
ideally you would just store there
maybe then sqlite?
if you use it already would work fine
just a basic table
with uuid - smallint
uuid as primary key
which is easier to implement
both are simple but the issue with yml is that
you load all of the file
whenever you do yamlconfiguration
sqlite
so its not exactly scalable if your player count that greet increase
its not like you code anything
just gotta add sqlite jdbc driver
so jar size goes up
uh no?
java has the jdbc driver for one
and two, you still need to add a connection and sql strings
since when jvm has jdbc driver by default
since like ever
huh lemme try
import java.io.File
import java.sql.Connection
import java.sql.DriverManager
import java.sql.SQLException```
prob not the BEST way to do it but idc
and its kotlin so
ya but you need the driver itself no?
not for sqlite
for mysql you do
and you dont need to close the connection in sqlite which is nice
ah, i probably just assumed its not in there
and just added through maven
never tried honestly
all the other databases you need to close the connection everytime
idk i like sqlite but people like other things
@ripe gull a basic example for you
mongodb, mysql, ect
i mean if you are doing relational
you would probably do postgres
instead of mysql regardless
fair enough
i've honestly never touched postgres yet
wanting too
or surrealdb
i wanna try both of them
cuz sqlite doesn't support arrays 😦
if you can use mysql you can use postgres
this is more of a database design smell
yeah 😓
what you can do instead is have another table
yeah that is true but i'd still personally perfer arrays but its whatever
i usually just use another table cuz im lazy to setup another database
since sqlite is automatically setup for ya
mehh
not rlly
yml is slowest of all of them
json MAYBE, but i'd still recommend a database
i mean as long as you aren't writing to the file constantly you should be fine ig
running on a different thread
use a BukkitRunnable or CompletableFuture imo
although a CompletableFuture is a thread pool so
i'd do every 5 minutes and everytime they join / leave
i usually set it up like that
saving every x time is wasteful
could also do a little bonus thing and make it so it doesn't unload from memory until like 5 minutes after the player leaves incase they relog
not rlly imo, just helps if the server does crash
i wouldn't do every minute but
but i get what you're saying
dont write to the file everytime a value changes
do it like every 5 minutes and when they leave / join then you should be fine
you end up editing the whole file regardless i think
unless you do your own yaml handler from scratch
https://paste.helpch.at/yicibopixo.java here use this instead did a small oopsie on the set
with mutable state
i mean when i started learning java i used simplexstorage
it has a batch system and everything you really need
i use it sometimes cuz spigot's api for yaml configuration is actually doodoo
i barely do yml anyway
altho i stopped writing anything minecraft for couple of years now
oh that's fair
mc development has really gotten boring recently
ik other languages just idk what to make in them so i just stuck with java
and decided to learn kotlin like a week ago
kotlin is epic
it has nice syntax imo and has an expanded stdlib from java
kotlin's methods in collections are great, really saves some time. And their kt extentions are epic too
it just doesnt force oop down your throat
and allow you to write functionally if needed
with streams it should be similar
i mean prob i was looking at the sortedByDescending and its just a comparable so
later java versions are really not that bad anymore
unless you are forced to work with j8
yeah
java has improved, especially in 21 with new collections and such
but most of the good things that were announced are in preview
@ripe gull you good now?
and honestly, idk who tf decided to do string templates like they did in java but i really dont like how they did it
virtual threads etc are the main hype
honestly
its like swift and meh
STR."\{firstName} \{lastName}"``` this looks dogwater imo
i'd much rather ${}
yeah those will be nice
ya, the way effectively every new language does it
is the way to go
my only issue with java atm is null safety
Optionals are way too verbose
dont forget to call the saveData() method on server shutdown if you are using the code i sent
erm
anyone know of a better way of doing this?: https://pastes.dev/dyHTqH2cBp
trying to rotate a vector depending on the living entities yaw
that works just wondering how i could improve it
Id vector ur own type
Cuz if it is make it a data class and u can destructure it woth val (vx, ...) = vector or smth lile that
You can simply look that up, but it’s mostly people who are working on the language for decades, and they typically have even more experience in that field. The choices they make aren’t just for fun, they are based on many reasons, trying to get a compromise that integrates well with rhetoric language in general
And "I don’t like the syntax" is like the weakest form of complaint, and it was also discussed and considered, and the decision was made because the facts are in favor of it
still dislike it but not my language really. And swift does the same thing
i moved to kotlin recently anyways so it doesn't really impact me that much
Yeah Kotlin only has basic string interpolation anyway, so that’s not comparable at all
how fix getMaximumAge?
@EventHandler
public void Farm(BlockBreakEvent event) {
World world = Bukkit.getWorld("world");
if (event.getBlock().getWorld() == world) {
Block block = event.getBlock();
Player player = event.getPlayer();
Material cropBlockType = null;
if (block.getType() == Material.WHEAT) {
Inventory inv = player.getInventory();
cropBlockType = Material.WHEAT;
Ageable age = (Ageable) block.getBlockData();
int getMaximumAge = age.getMaximumAge();
}
}
}
age.getMaximumAge
don`t worlk
what part about it doesn't work?
like what's the issue with getMaximumAge?
I think I remember running into this issue awhile ago, im not at my pc so can’t double check, but what you’re after is Material.CROPS not WHEAT
Edit: This was a fix for older versions of MC, in recent versions WHEAT is correct.
did you make sure to import the correct ageable as there is 2
cropBlockType seems redundant
you could get hte world and just check if the name is equal to "world" instead of using getworld and checking if they are equal since afaik its possible that both world objects might not be
No, this variable is so that I can configure the world in which it is spent, so that I don't want to change the entire code.
I know
My version is 1.19 Paper
didn`t work
Can we see your imports as well. And “didn’t work” isn’t all that descriptive, is it producing an error?
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.block.Block;
import org.bukkit.entity.Ageable;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.inventory.Inventory;
It doesn't give an error in IntelIj Ethla, its color is red, as if it doesn't exist
As #development message said, you imported the wrong Ageable, what you're after is import org.bukkit.block.data.Ageable; NOT import org.bukkit.entity.Ageable;
oh thank you 
you can only do thread safe stuff async
helllo
dears
i cant do trial and error from diff reasons
but scoreboard packets once sent it stays till new update? same Tab list?
or u need to update schedulerly or everytick
thanks to the answers.
It stays
so for performance for player side , i would need to send packet only on update correct?
ill think about how to manange performance better thanks Matt.
Sounds like premature optimization, but yes it makes more sense to only send when it needs to update
I've generated jars for this project with BuildTools with the --remapped flag, then loaded them in the individual version directories with mvn install:install-file, but still face an error along the lines of what is below for every NMS version. I have no idea what do, help please.
[ERROR] symbol: class ItemStack
[ERROR] location: class su.nightexpress.ama.nms.v1_20_R3.mob.HoglinMob
[ERROR] /home/shakytimon/IdeaProjects/AdvancedMobArena7.14/V1_20_R3/src/main/java/su/nightexpress/ama/nms/v1_20_R3/mob/HoglinMob.java:[167,37] cannot find symbol
[ERROR] symbol: class Player
[ERROR] location: class su.nightexpress.ama.nms.v1_20_R3.mob.HoglinMob
[ERROR] -> [Help 1]```
fixed this, seems I was using the wrong jars.
found the right ones under Spigot-API
nevermind, that did not help
Is there a way to implement a class on CraftingRecipe or RecipeChoice and have that recipe registered.
I tried implementing upon RecipeChoice but that did not work. There are two RecipeChoice. ExactChoice which allows you to add multiple ItemStacks for detection (assuming it uses ItemStack#isSimilar or ItemStack#equals to detect). MaterialChoice which allows you to add multiple Materials for detection.
I am trying to add a Custom ItemStack detecting system (e.g if I only want to check for the ItemStack's (in the matrix) name or persistentdata, etc). Do I have to create my own recipe manager to check for recipes and their results using PrepareItemCraftEvent
OR is there any better way to do this?
I don't use maven, but I think you should be using the maven dependency
edit: below, plus you can just buy the plugin too :))
when using maven + spigot I'd highly suggest to use mojang maps + the specialsource plugin for remapping https://blog.jeff-media.com/nms-use-mojang-mappings-for-your-spigot-plugins/
If you need to access NMS classes from inside your Spigot plugin, it is a very good idea to use the so called Mojang mappings. Disclaimer: This post is obviously written for 1.18.2. If you use another version, you of course have to replace every occurance of “1.18.2” with the version you actually use. What...
gradle question: I have declared a libs versioncatalog in settings.gradle.kts like this:
dependencyResolutionManagement {
versionCatalogs {
create("libs") {
plugin("shadow", "com.github.johnrengelman.shadow").version("8.1.1")
}
}
}
However I cannot access that in my buildSrc/build.gradle.kts - anyone got any idea?
I however can access "libs" in all other build.gradle.kts files, just not in buildSrc - am I doing sth wrong or sth?
buildSrc is a separate project and currently it doesn't have access to anything from the root project, not even the gradle.properties
You need to declare the version catalog in the buildSrc's gradle.settings.kts
Also you can't make it a plugin if you want it to be accessible in the buildSrc's build.gradle.kts's dependencies block, you'd need to make it a library
oh ok that's sad. I thought I could avoid having to declare things twice using the version catalog, but then it won't work. Well I'll just keep the version hardcoded then, thanks
If you have a version catalog file, then you can get away from declaring it twice then on the buildSrc's settings you can do
versionCatalogs {
register("libs") {
from(files("../gradle/libs.versions.toml"))
}
}
To import the catalog from the file
why register the catalog manually? gradle recognises that one by default
read up
oh yeah that's a good idea. thanks
alrighty that works fine except for in actual scripts in buildSrc/.../kotlin/bla.gradle.kts files. It still cannot find the "libs" thing there, so I currently use this:
dependencies {
api(project.versionCatalogs.named("libs").findLibrary("acf-paper").get())
}
that can't be the correct way I guess?
as you can see, it works in my buildSrc/build.gradle.kts file, but not in actual buildSrc scripts
libs isnt availabke in precompiled scripts theres an issue for it but doesnt look like its gonna get resolved
oh alright, thanks! Then I'll just use my workaround from above, but good to know that there's an issue for it open 👍
I'm adding SQL support for one of my plugins and have found a problem I can't find a good solution to. My plugin allows users to, among other things, edit custom items. I want these items to be saved in the SQL db.
So, say I start my server and it loads all items from the db and I then proceed to edit the item. When the item is edited it of course has to be saved so the changes are pushed to the SQL db. However, right as my changes were saved to the db another server auto-saved all items to the db, and so my work was overwritten? What would be the best way of solving this? I've thought about adding like an "updates" column to the row and compare those, would this be a good way of doing it?
Also, how would I do for other players editing the item? Should I just not update the SQL db if someone else has updated it while I was editing it? That will again ruin my work. Should I just don't care and let it be a problem for the servers owners or should I "lock" the items, and if so what would be the best way of doing so?
Please ping me if you respond :)
Could also save the time it was saved and if it was edited in the last 30 seconds or so take both items and merge the edits from the original.
not trying to avoid buying the plugin, im adding support for a pets plugin
see what mfnalex posted below; I don't have maven experience, but mvn install:install-file doesn't seem like it should be used here
thanks for that article, I used NMS a while ago, and forgot that BuildTools automatically adds it to your .m2 repo. thx!!
np!
install:install-file is basically the manual version - it's used to install arbitrary .jars to the local repo, while the regular mvn install while install whatever the current project has produced. so yeah, you use install-file if you downloaded a random .jar file that you wanna install, and you use mvn install to install whatever your currenct project has "produced"
buildtools simply runs mvn install on the spigot-api and spigot project
Yeah locking the row in the DB would be your best bet imo. Then it eliminates any race conditions. Hard part is actually doing it, depending on how many SQL distributions you support. I know Postgres has some very good row-level locking stuff, iirc MySQL/MariaDB have something that can do that? something like sql SELECT item FROM `items` WHERE id = 3 FOR UPDATE or similar
Well I can’t really merge them. Say the original is a diamond sword with sharpness 1. One player changes it to an iron pickaxe with efficiency 1 and another player changes it to an iron axe with sharpness 1 and unbreaking 1. How do I merge that? I can’t really?
thinkin what's "FOR UPDATE do
I thought about this and how to do it. But I have a few problems. Say a player starts editing the item, and then the server gets shutdown incorrectly and the server does not have time to unlock it again, them what? Do I make the owner unlock them all manually? Is there a good way of reliably locking/unlocking rows like this?
iirc it locks the rows "for update"
then once you do update the rows later it removes the lock
hmm, cool
Some sort of timeout system maybe? Honestly not sure lol
Yeah that’s the problem I keep coming back to lol. My current best idea is having a ”updates” column, then telling a player wanting to save data that ”the item has been updated x amount of times since you started editing, do you really want to undo the previous changes?” or smth?
How’d I do the timeout as well lol? If the server is offline it can’t do it it self. Do I make a new column or table for it?
Could do something like a cache table, then when you're done editing it can check the timestamp of when you started and see if it has been updated since, then give players a "This item has been updated since you started editing, would you like to overwrite?", and if they say yes, you flush the changes to the table
Yeah exactly. That’s where I’m at rn, just think an updates field to show ”it has been updated x amount of times” instead of ”it has been updated” seems nicer
I mean, what's the timeframe on this kind of stuff?
are people editing items for like, hours? how many times is a single item going to be updated while you're editing?
Is this per server? Maybe update the item to the player live.
Not very often I’d imagine. Very rarely I think. Though I will probably get some angry users complaining abt it. Though the major thing is other servers backing up data and replaceing new data. Maybe I can flag the items or compare update timestamps etc?
What do you mean, dont really understand?
Like fetch the new data with each update?
Why would other servers completely erase all item data?
Surely you just touch it once and then that's how it is until the next time someone updates it
I currently have the servers auto saving data. But now that I think abt it I really don’t need that lmao. If I just saves the changes when they are made all is fine lol. Smort
Ig I’ll just compare timestaps and ask users if they wanna make the changes. Seems like the best idea so far?
yea
Oki then, thanks for your help :)
There is a hack you can use to get libs working in the precompiled scripts
On the build.gradle.kts add implementation(files(libs.javaClass.superclass.protectionDomain.codeSource.location)) in the dependencies
Then on the precompiled script you can do val libs = the<LibrariesForLibs>() and libs will be available
interesting, I'll try that, thanks
uughm wdym with "the" at "the<LibrariesForLibs>" part?
It's a gradle function
Yw ;p
only downside is I gotta use the<...> in every script right? I cannot move this into an extension function or sth?
Yeah you have to use it on every script
There might be something you can do about it though, give me a sec let me try something
// Libs.kt
fun Project.libs(): LibrariesForLibs {
return the<LibrariesForLibs>()
}
// Any other buildSrc script
dependencies {
api(libs().acf.paper)
}
Got it to work like this now! Thanks for the idea, works great :3
Yeah, or
val Project.libs: LibrariesForLibs
get() = the<LibrariesForLibs>()
If you want it to stay a property instead of function
yo so
im on deluxemenu
- '[console] give player dirt 1'
this doesnt owrk
and %player% tho
and %player_name% doesnt owrk either
Well 'player' will obv not work
I mean look
- '[console] give %player% dirt 1'
- '[takemoney] 100'
- '[message] &aYou bought 1 &6Dirt Block &afor $100'```
doesnt owrk
Yes i do.
Idk @marble heart will know fr
yes
Player placeholder not working? If you are using a plugin which supports PlaceholderAPI, and the %player% placeholder doesn't work, then change it to %player_name% and download the player expansion.
Commands:
/papi ecloud download player
/papi reload
still doesnt owrk
ohh i need to download it ty
a alr
and yk how to make a heart shop from that?
a heartshop. Like u buy things from ur hearts in that
bro what?
yh?
many servers have it
from lifesteal core
⚙️ Development Support - Stay on topic! - Not configuration help - No favourite IDE arguments.
oof didnt notice where we were
alr???

my favorite ide is intellij idea, far better than everything out there
i like notepad++
Big fan of ms paint
punch cards is my personal favorite
I saw this somewhere I am curious how they did it. Supposedly by manipulating a TextDisplay you can move the text up and down. This was used so that if the entity had a name already, the plugin could shift the text display upwards. the only way I can see this working would be by setting a line width and having an empty character wrap over to the next line, shifting the previous line up, just not sure how to achieve that as the documentation on TextDisplays is terrible.
Does anyone know how to achieve this?
translation transform
something like
display.setTransformationMatrix(new Matrix4f().translation(new Vector3f(xOffset, yOffset, zOffset)));
Mhm, math
thanks!
There a already compiled a jar for the folia branch? I tried compiling it last night but I didn't have any luck. Trying to get my plug in updated for folia
Folia branch of what
papi
Is it possible to change the name above a players head without using GameProfiles or ProtocolLib? I don't have a problem with using NMS but want to avoid using external libraries if possible.
I believe the player's name will still be present right? This looks to just create a new line above the player's name
no, when an entity (even players) has a passenger, their name tag is hidden

is it possible to remove an entity's ai but still allow them to experience gravity?
i saw fundy do it in his latest video: https://www.youtube.com/watch?v=99Hd5Lh69T4&t=1095s
but i assume he didnt use a plugin to do it, so im not sure if its possible with a plugin
🕹 Get a browser that’s literally better at everything: https://operagx.gg/Fundy4 Sponsored by Opera GX!
I Added ACTUAL Human Intelligence to Minecraft...
Heya guys! Fundy here, I just want to take a second and say that this video is some of my proudest work. I am so happy with how it turned out, and I am even more happy that it worked... It's ...
setAware(false) or smth
ah yep, thank you!
how dare you lobotomize them
they're just skeletons >:) https://media.srnyx.com/javaw_9ES0G1NGFQ.png
anyways new question :D
how do i disable the right-click edit thing for specific signs?
just cancel the interact event if its a sign?
yes :)
Believe so
Whats the best way to show countdown timers inside lore of an item that's sat inside a inventory? can't be move etc. Loop the inventory while open?
best way being most efficient and realiable
triump gui clears
nah
they both got their advantages and disadvantages
but for stuff that needs updates it's easier with mine
looks nice, good work sparky 
interesting
whats so interesting 😭
that your lib is easier to update stuff
um so u didnt look and said triumph clears
typical lol player
jk afonso ily
I already knew your lib, just didn't keep in touch xd
also, fair, I am a lol player
❤️
How would I go about adding a entity as a passenger to a horse and not letting the horse immediately eject it? I couldnt find an event for it, would I have to do it through packets?
Just an idea - try to tame it first and/or set the owner
declaration: package: org.bukkit.entity, interface: Tameable
Why doesn't Java like me using Optional<Integer> as a parameter
taking an Optional as method parameter in Java can be a questionable design decision
but, eh, idrc
there also is OptionalInt
bleh
this Brian Goetz guy has no clue what he's talking about!
"while you make a good point, your opinion is not valid"


it still should be tameable by players though, I want it to be a normal horse
well, bad design
optional should be mainly used for returns and ternary operator avoidance lol
(mainly imo)
Poor man's Object?
maybebut not rly
Optional is a monad but not a monad
by definition it is, by behaviour, eh, sometimes
Ideally you shouldnt have optional params
Do method overloading instead
real gamers use AtomicInteger
for no reason at all but
you should use Objects.requireNonNullElse[Get] for that instead
there's no real 'you should use' in this situation
Optional is entirely different use case
well when the API designers have specifically said doing that is 'optional abuse' then there's at least a 'you shouldn't'
@Nullable
private List<MyObj> getObj(...) {
List<MyObj> objects;
...
return objects;
}
private void b(...) {
var obj = getObj(...);
return Struc.builder()
.a(...)
.b(Optional.ofNullable(obj)
.map(List::stream)
.map(stream -> stream.filter(Objects::nonNull))
...
}
idk I prefer using something like this
huh? you prefer that instead of
return Struc.builder()
.a(...)
.b(obj
.stream()
.filter(Objects::nonNull))
...
?
oh wait nvm
but why u got a nullable list
thats an anti pattern
i mean i get when doing nested chaining stuff itll look kinda ugly so i get that, but if its like just Optional.ofNullable(foo.bar()).orElse("") then its a little unnecessary
shit happens
I have a message that runs when the player leaves the server but the placeholders in the message just get replaced with nothing. I assume the player needs to be online for them. specifically with luckperms placeholder. wasnt sure if its something with the plugin i made or placeholderapi
@EventHandler(priority = EventPriority.LOWEST)
public void quitEvent(PlayerQuitEvent event) {
// other code
player.sendMessage(PlaceholderAPI.setPlaceholders(player, message));
}
You may need to preprocess the message when they are online and give it back yourself when you need it aka a map memory storage or something similar.
As them being offline will likely be the issue depends on the placeholder though
thought so, thanks
I have a bunch of ”Component” classes that include multiple ”Parameter” fields each. I need to show this data (component name and description + parameter name and description) on my GitBook wiki. Is there a good way of converting this automatically? If not it will be a nightmare to do by hand, and near impossible to keep up to date and maintain.
Please ping me if you respond :)
there are many ways I guess
one would be annotation processing directly
another would be using a library that understands java and can extract the data you want
@queen plank
The data itself isn’t too hard to extract. The problem I can’t solve is how to get said data to the gitbook wiki. I need to create tables, bold text etc..
you could probably make use of some sort of templating framework
Do you know any that could be of help?
I don't have any experience with a specific template engine, but e.g. https://www.baeldung.com/mustache looks like it could do what you want
Looks useful, thank you!