#development
1 messages · Page 55 of 1
Hello, can anyone tell me why offlineplayer.getName() returns me the uuid please ?
OfflinePlayer author = getServer().getOfflinePlayer(authorUUID);
String authorName = author.getName();
Bukkit.broadcastMessage(authorName);
Has the player ever joined the server?
slot: 41
amount: 2```please help for some reason does not appear in the menu egg summoning viser
not the place. #general-plugins
(this is coding help)
and where to write it?
legit told you
do you see both the getuuid and getname method in offlineplayer interface? if not then it means spigot doesnt encourage you to resolve name directly as it may subject to changes over time and remains undetected until the player joins back
you can try to manually resolve the name via usercache.json(like make your plugin read usercache.json)
after all it kinda makes sense not to have an api method on something uncertain
offlineplayer has getuniqueid and getname
oh my bad, but still it makes sense
it may be a potential spigot bug or you have something miscoded
it returns null in any other cases rather than the uuid itself
but it doesn't return null, it returns the uuid
check usercache.json for the uuid and see what the corresponding name is
also it happens sometimes if you or some plugins mess with nms too much
[{"name":"Idaamo_","uuid":"25f8871e-77c4-4084-9fb3-980221faf152","expiresOn":"2023-08-17 13:38:48 +0000"},
not sure about it then
imma take a quick look at the source code and see what i can find
whats the version
1.8.8
nice!!!
thanks btw
np but im not exactly sure about the cause
its something wrong in the level.dat probably and something messed with either internal classes or the world file
spigot api shows that its not supposed to happen unless something happens in nms internal
you may just add a check to see if uuid is equal to name or uuid is null, fetch directly from usercache.json or sth
i'll use mojang's api, thanks
cool
doesn't work, anyone has an idea with this problem ?
doesnt offlineplayer pull from mojang if they didnt log in before?
is it on offline mode?
Server.getOfflinePlayer(String) might, Server.getOfflinePlayer(UUID) won't
What's the type of authorUUID? is it an actual java.util.UUID or is it a String?
it's a string, btw i saw that under 1.13, even using the getName we get the uuid
...
getOfflinePlayer(String) takes the name
the string is the name
not the uuid
if you want to pass the uuid, pass the UUID
getName isn't returning the uuid, it's returning the name you passed
and what you passed is a name that happens to look like a Uuid
bruh
lessgooo
thank you
that works

https://paste.helpch.at/ofudububik.java
Current Issue: After crafting the Chaos Orb, players have to re-click it in order to gain the positive effect.
What should Happen: Immediately after crafting the Chaos orb they gain the effect as long as its in their inventory, however once it leaves the effect also leaves.
Issue #2: After dropping the Chaos Orb, the player still have the effect
What should happen: After dropping the Chaos Orb, the players positive effect is removed
I've already tried multiple different ways to check the players inventory pls lmk if you have any suggestions 😄
I still haven’t figured it out if anyone can help I’d appreciate it
Im kinda confused on the functionality of the removePermanentPositiveEffects(Player) part
You're
-> getting the players active effects
-> removing all the positive effects the player has from the map player's active effect
-> removing each positive effect left in the map (the ones they dont have)
to be honest for the inventoryclickevent you could probably just do
onClick -> hasActiveAbility -> if no -> getInventoryContents -> hasOrb -> giveEffect
for giveExtraHearts id look into Player#setAttributeModifiers instead of setMaximumHealth (depending on plugin version really)
for the loseHeartsOnRespawn you could probably just do player#setHealth(Math.max(0, newHealth)
with the PlayerRespawnEvent, instead of having an if ladder you could probably just do ```java
if (player.getSpawnLocation() != null && !random.nextBoolean())
return;
// give effects
(i think)
i suggest just rewrite ur own
and decompile bukkit...
many of bukkit methods have one name and do other completely thing
?
Hi, I'm converting minimessage to components and then back to legacy text for PlaceholderAPI, but when I have just <red>, the output string is empty. Anyway I can get it to just output §c? Thanks
Do you use Legacy ComponentSerializer or PlainText?
the former
Then it should work ig
im creating the legacy component serializer, serializing a serialized component from minimessage and it outputs nothing
Like nothing or no colors?
it works if there is content like <red>sd, but not if i just want the color like <red>
It might not work like that, because technically that's {text: "", color: "red"} I guess
Might be worth to ask on the Adventure server
https://paste.helpch.at/ofudububik.java
Current Issue: After crafting the Chaos Orb, players have to re-click it in order to gain the positive effect.
What should Happen: Immediately after crafting the Chaos orb they gain the effect as long as its in their inventory, however once it leaves the effect also leaves.
Issue #2: After dropping the Chaos Orb, the player still have the effect
What should happen: After dropping the Chaos Orb, the players positive effect is removed
I've already tried multiple different ways to check the players inventory pls lmk if you have any suggestions 😄
I posted this yesterday and didn’t get any help. I’m still stuck on it so any advice would be much appreciated 😁
Hey not sure if this is a question for this kinda server but u know how in MC when u hit a mob like a pig or cow it begins running from the player. Is there a way to summon in the entity so that is in a constant state of fleeing or running?
This is 1.12.2 idk if that matters
Should be able to just set the entities last damager. (Might need nms)
d;spigot Damageable#damage
void damage(double amount, @Nullable Entity source)```
Deals the given amount of damage to this entity, from a specified entity.
amount - Amount of damage to deal
source - Entity which to attribute this damage from
I guess you could also constantly call this
Is Damageable in 1.12 though?
Nms?
That's the spigot api
So this allows me to damage the entity but how would I just make it constantly run from the player?
Would I just call the damage thing and make it take 0 health and just keep calling it?
Sorry still a bit confused about how id make this work
In the damage method you can pass an enitity (the source of the damage). so pass in the player
you want it to run from
Oh ok I see
ANd im assuming it would be fairly easy to just make it the player who exectued like a /pig spawn command
So I use that to deal damage and then make the source of the damage the player who executed the command. Will the pig just run forever or does it wear off eventually?
You'll have to test and see
Got it got it
Regardless shouldnt be hard to set a timer to recall the damage thing every x amount of time
Thanks Blitz
did you read any of what i said suggested or
Does anyone know if it is possible to generate 1.8 docs with java 9 and above? I want the doc format with the search bar but somehow I can not run the fucking buildtool with java 17 https://pastes.dev/subZ5ZEFAQ
I've actually build the buildtool with java 8, and now I try to run mvn javadoc:jar with java 17
This is what I've tried
mvn clean javadoc:jar -Dmaven.compiler.executable="C:/Users/dumit/.jdks/temurin-17.0.5/bin/java"
But it fails
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:3.5.0:jar (default-cli) on project spigot-api: MavenReportException: Error while generating Javadoc:
[ERROR] Exit code: 1
[ERROR] javadoc: error - invalid flag: --release
[ERROR] Command line was: cmd.exe /X /C ""C:\Program Files\Eclipse Adoptium\jdk-8.0.352.8-hotspot\jre\..\bin\javadoc.exe" @options @packages"
[ERROR]
[ERROR] Refer to the generated Javadoc files in 'C:\Users\dumit\Desktop\BuildTools\Spigot\Spigot-API\target\apidocs' dir.
[ERROR]```
For some reason it still uses java 8 ..
Edit: welp, looks like I just had to set JAVA_HOME to java 17, I hate maven
well yeah
java isn't the one that generates javadoc
javadoc is the one that generates javadoc
- Both projects have Shadow plugin:
build.gradle.kts```kts
plugins {
id("com.github.johnrengelman.shadow") version "8.1.1" apply false
}
subprojects {
apply(plugin = "com.github.johnrengelman.shadow")
}
- Parent project implements `io.github.freya022:BotCommands`:
*`library/build.gradle.kts`*```kts
dependencies {
implementation("io.github.freya022", "BotCommands", "2.10.2")
}
- Sub-project implements parent project using the
shadowconfiguration:
example-bot/build.gradle.kts```kts
dependencies{
implementation(project(":LazyLibrary", "shadow"))
}
IntelliJ is not recognizing `io.github.freya022:BotCommands`, but Gradle can still build the project: https://venox.is-from.space/2UTXlM2kmf.png *(lost my levels, can't use embed/upload 😢)*
*Add library button doesn't do anything*
Try removing the "shadow" part on implementation(project(":LazyLibrary", "shadow"))
nope, now it wont even build
i have this same setup on another project so i dont understand what i did wrong here
I see, never seen anybody do that before. You're good then
also it works fine for projects that use the library externally (thru jitpack), its literally just the example bot 🙃
don't understand your point
its only not working for the sub-project, external projects dont have the issue
alright, and just to make sure we're on the same page, the subproject is located inside the parent project, right?
yes;
parent: ./library/build.gradle.kts
sub: ./example-bot/build.gradle.kts
Tried referring to the original name instead? library in this case, instead of LazyLibrary
interact event , if holding the event executes every 4 ticks how ever im wondernig some plugins do listen to every tick is this due their itemstack updates which makes the event re execute since ts on dfferent itemstack?
Makes sense 😦
any recommended DI (Dependency Injection) framework?
would be good if you have some example for BukkitAPI 🥺
its a bit annoying to integration test, but https://avaje.io/inject/ is alr
@wheat carbon missed an opportunity
Hello, I'm attempting to make players glow, but only to specific players (i.e. make only your teammates glow). I'm currently using protocolLib packet listeners to attempt this, but the glowing often flickers. Sending fake packets every tick does seem to eliminate the problems, but I feel like this will end up causing way too much lag. I'm wondering if anyone else has attempted this or has any insight on the best way to accomplish this.
Does anyone have spigot javadocs for older versions hosted somewhere? I try to get some data from docs with axios and cloudflare blocks me with a 520 from accessing HelpChat docs https://helpch.at/
Is probably because it detects my code as a bot since I open every class one by one
Can't you try the web archive on the spigot javadocs page?
spigot's maven repo?
The oldest archive appears to be from 1.12.2
I need the docs as a website, not jar
unless I miss something
why?
the javadoc jar contains all the funny html/css/js files
it's quite literally just a zip file
yeah so?
good point, in this case I need to figure out how to use local files xD
yeah
thanks @minor summit
hi
Hello, someone have a tutorial/ecemple for pagnited menu/gui (no library)
you either have to create and open a new inventory or replace the items. creating and opening a new one shouldn't be much more worse so that's what I'd personally recommend
well. I have a short question. If i want to make a plugin in 1.19 and i follow a tutorial for 1.18. will it work? or did the syntax in java changed from 1.18 to 1.19?
cause i've been tryin for 3 days to make a plugin (learning purposes) and it doesn't work, even if i followed every single step from the tutorial.
hello, good afternoon, I'm having a problem with the Placeholder API, the problem apparently lies when the server is restarted, Well I download the expansions normally and then if I want to restart I have to delete the files to start it, because it keeps loading and doesn't do anything leave all day and do nothing at all
I use Magma 1.12.2
magma 
xd
I'm building a pixelmon server for a friend
is this a topic for this channel tho? perhaps you're looking for #placeholder-api ?
Ok I'll go take a look
Guys i want to learn how to code
I want to make my self a simple plugin
which videos do i need to check
yeah me too. freestyling with java at the moment
ah nice, i have a lot of experience in php but i think its a different code langauge
but i need to expirement
yeah me too
python, shell
js
nothing helps tho
look dm
accept my request
when using player#setspectatortarger is there any way to make the user able to look around?
does Player#getHealth() account for absorption?
no
dang, how can i include it?
i use javadocs :/
i just didnt think of checking for such an obvious method
well bukkit/spigot's usually 🤪 soooooo
use paper btw
i use this:
PaperLib.suggestPaper(this, Level.SEVERE);
if (!PaperLib.isPaper()) pluginManager.disablePlugin(this);
i dont wanna require paper cause 20% of my plugins' servers still use spigot
How can I get a list of all vanilla Minecraft structures (so all structure keys under the minecraft namespace)? I'm writing a random events plugin, and I want one event to be placing a random structure on the player. I tried StructureManager.getStructures(), but my understanding of this is that it only lists loaded structures, and could also list structures added by other plugins, which isn't ideal especially since my plugin is intended to be played on a void world where no structures will be loaded
Structure#place(...
I know how to place a Structure, I'm wanting to know how to get a list of all the structures in vanilla Minecraft
getStructures from my understanding gets a list of all available vanilla structures
No. I tested it in a void world and it returns an empty list. Also, in the documentation, is says it only shows registered structured, and that if it isn't there it might be in the Minecraft folder (which would be vanilla structures, suggesting some vanilla structures may not be included)
structures are datapack-driven
there isn't a built-in/hardcoded list that will always be available
I would settle for a list of all structures available in a world. This must exist because I get a list as a tab-completion in structure commands. Besides, from there I could just filter it down to structure's whose key starts with minecraft:
technically, that constitutes the set of always available structures with 0 elements in it 🤓
maybe look through the command class for whatever command that shows you it
it might point towards the list of namespacekeys that is loaded wherever
I would imagine the command would be in net.minecraft.server.commands but I don't seem to see it
Command will either be the prefix or suffix of the class name
Ye I've tried searching for both CommandStructure and StructureCommand already 😕
ig time to find where all the commands are registered and print out the class name of the structure command
From what I can tell, they register themselves. For example, CommandEffect.java has thisjava public static void register(CommandDispatcher<CommandListenerWrapper> commanddispatcher, CommandBuildContext commandbuildcontext) { commanddispatcher.register((LiteralArgumentBuilder) ((LiteralArgumentBuilder) ((LiteralArgumentBuilder) net.minecraft.commands.CommandDispatcher.literal("effect").requires((commandlistenerwrapper) -> { return commandlistenerwrapper.hasPermission(2); })).then(((LiteralArgumentBuilder) net.minecraft.commands.CommandDispatcher.literal("clear").executes((commandcontext) -> { ... }))... }
I've already tried searching stuff like .literal("save") though and even that doesn't come up with anything
Oh 🤦♂️
Well I've found a few classes which import net.minecraft.server.commands.PlaceCommand; but I can't seem to find the PlaceCommand class itself
For me, only 15 classes show under net.minecraft.server.commands, and there's obviously more than 15 commands
where are you looking, lol
I'm searching the BuildTools folder, it's what a couple people recommended cos I find searching the patching system confusing
I've built Spigot 1.19.4 using BuildTools, so as far as I understand everything in Minecraft 1.19.4 should show in there, but clearly not 😕
everything that is patched will be under the regular spigot sources
everything that is untouched is in the work folder
Yep, and I'm just searching the entire BuildTools folder so theoretically I should find it whether it's patched or not
Ooook I see why it didn't now. I've been filtering by **.java, but the unpatched files are .class
Nevermind, still can't find it
just clone paper lol
Found it, was still searching CommandPlace lol
Doesn't that only include patches, though?
you apply patches and it generates sources
I don't know how to apply patches myself though lol, that's why I'm just searching BuildTools
./gradlew applyPatches
Ok that's fair enough... I remember asking elsewhere and they made it seem a lot more complicated
¯_(ツ)_/¯
Well I think I've figured out how it works, but this is gonna require a lot of NMS and I've only ever touched NMS once lol. Oh well, I'll see if I can figure it out from here. Thanks!
so i did everything in hooking into placeholder api, but when I try to import me.clip.placeholderapi.PlaceholderAPI; it says PlaceholderAPI cannot be resolved here is my pom.xml repo and depends:
<repositories>
<repository>
<id>placeholderapi</id>
<url>https://repo.extendedclip.com/content/repositories/placeholderapi/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>me.clip</groupId>
<artifactId>placeholderapi</artifactId>
<version>2.10.9</version>
<scope>provided</scope>
</dependency>
uh, in theory, is it possible to listen for the inventory open event, assuming I open the menu of another plugin, like auction house or something, am I able to listen to the event, scan the items in it, catch whatever info I want from them, cancel the opening of that inventory and open a new one flawlessly?
hmm ok interesting, ty
wait, would I be able to simulate a click on an inventory that is closed? Aka the inventory I don't open, am I able to simulate a click on X slot in it, while not being opened?
NMS question: does anyone know what the method is that controls elastic banding of leashes at the certain range?
Massive note: You need to delay the reopening by a tick
But yes it’s possible
how would I go about simulating it though? Would I have to mess with packets at that point?
Technically if u mess with packets u don't need to delay by a tick and clicks can be simulated
¯_(ツ)_/¯
what if I suck with packets? lmao. Couldn't I in theory call the click event myself? lol
that would also simulate it right?
Maybe u don't need packets at all but I don't know about the 1 tick thing Jerry mentioned so I'm just saying that if you use packets, I am sure it is possible
Without packets, I have no clue
gotta unsuck
why do that, when I can just not? 👀
I need help from somebody experienced.
I am just getting into server plugin development and I have come to two choices:
Learning to develop Spigot plugins, or learning to develop Paper plugins.
From my understanding, Spigot plugins work on Paper, which is the server software I use anyway.
What are the differences between developing with Spigot and Paper?
Do you have an opinion on which is better to learn?
Much appreciated!
paper all the way, on the phone so cant explain why but paper api is A LOT better
learn java first though, if you dont know it yet
well for sure lol
thank you, good to know!
the paper api adds to the spigot api in a couple different ways, adds new events that dont exist in the spigot api, uses components rather then strings in methods where chat or text are involved
tho you are able to use spigot plugins on bukkit pretty much no problem but you cant plugins made with paper features on spigot
fair enough
sounds great tbh
thank you both for all the help! very appreciated
if you look at https://jd.papermc.io/paper/1.20/ everything paper adds usually is under the com.destroystokyo and io.papermc bits
also paper has tooling for using internal classes which is very helpful since theres stuff that are replaced by paper like where chunk section light values are stored
theres a surprising amount of stuff they added, will be sticking to paper api 🙂
if you want to publish your plugins on spigotmc tho you will have to modify your plugin to be compatible with spigot aswell
alright
i didnt really plan on that anyway so i should be okay for the foreseeable future
anyone got experience with visual bukkit?
Visual bukkit?
I believe that's like a visual programming thing for bukkit plugins
Yup
I guess you can think of Scratch but for bukkit
Just learn java at this point
that would definitely take more time
I got scared thinking it was something to do with visual basic lol
its so complicated and these youtube tutorials are terrible and act like you already have 18 years of experience despite the title being "Java for beginners"
Depends on how big of a project you want to do
If you want something simple VB is the way
If you want to write a server core, it will be a disaster
no it doesn't. you either learn java or you don't really... if you meant the spigot api, then sure.
I wanna make like a kind of robots plugin that just collects a currency overtime in a gui
Tbh this one doesn't look that bad https://www.youtube.com/watch?v=eIrMbAQSU34
what the actual fuck
I legit hated scratch, now I hate this more
The main issue with java (and any other language in general) is that it will take a lot of time
Which may not be needed for something simple and achievable with VB
yeah def. not happening with visualbukkit my guy
I mean, it can maybe very maybe happen
but at that point, it will be so badly optimized your server will only handle 20 players
tops
damn okay, i just don't know where to start with java tbh
well, just start.
don't look at anything specific
just start.
i don't know where to start though lmao
taking initiative is always the hardest part about learning something
thank you, much appreciated
why's that. have you tried visual basics?
there are many courses, both on youtube and udemy, etc.
all those work for the basics
visual basics?
imagine skript, but instead of writing english, you put lego pieces together
there you have it

also, have a complaint, switching menus on mcc is laggy, fix it, ty
I mean, skript has to like compile to java at runtime (maybe it does it only on startup, idk). my understanding with visual bukkit is that it will just give you the java code
https://github.com/InventivetalentDev/PluginBlueprint this also exists
Which menus?
although the gifs are low res as fuck lol
like social and party, had a few issues yesterday, forgot to use /bugreport though, but like, trying to switch menus from party to friends, etc. wasn't working at all lol
and skript can be "decent" in performance when you know what you're doing. the problem with script (and with VB for that) is that people don't know what they're doing and they get a sense of confidency
then when I got out of the menu with esc
clicking on the items on my hand didn't work
for like 10s
next time it happens, I will make sure to use /bugreport
Yes that one is absolutely terrible, I believe we have it fixed on dev environment already
ah ok pog
yeah true, but skript at the end is full of spaghetti code lol
and even so, you see people here "learning java" that pretty much fall for the same trap
I've seen better "skript" code than some people's java plugins
that I have seen too lol, but I am speaking about skript itself.
I'm not a fan of skript. but not because it in itself is bad.
Dude we should write a blog post on the first week of release, progression microservices were lagging so fucking much, some statistics were delayed by hours because of it
Ingestion of values was taking 500ms to 1s depending
We managed to lower it to 5ms to 10ms now, absolutely incredible
skript started as a hobby project and evolved to something much much bigger
they scaled it so fast, they didn't have time to clean their foundations
please do
bring back the good old days. when big networks had blogposts explaining their thought processes and optimizations
like hypixel
#devblogs
TLDR, don't ingest unneeded data and batch SQL operations are good
YES PLEASE, I would love to see the behind the scenes of the project tbh
fr... last hypixel devblog: https://hypixel.net/threads/dev-blog-11-optimizing-reports-with-machine-learning.5065246/
Kinda reminds me PHP
Do you guys use any nosql db?
If you consider redis to be nosql db then yes, but that's about it, and it's not used very often
May I ask, why didn't you go with mongo? Seems to be a quite popular choice nowadays
I was not around when that was decided so I am not sure
But if I were to be the one choosing I would still go with Postgres just because I am more used to relational
They probably had reasons for it, but I am not the backend dev so no comments
can someone help
using eclipse btw
anyone know why i'm gettinng this issue when trying to open a gui:
[19:10:48 WARN]: java.lang.ClassCastException: class org.bukkit.inventory.ItemStack cannot be cast to class org.bukkit.Material (org.bukkit.inventory.ItemStack and org.bukkit.Material are in unnamed module of loader java.net.URLClassLoader @722c41f4)
[19:10:48 WARN]: at testgui-0.1.jar//vb.$testgui.PluginMain.lambda$1(PluginMain.java:50)
[19:10:48 WARN]: at testgui-0.1.jar//vb.$testgui.GUIManager.lambda$1(GUIManager.java:29)
You're trying to cast an ItemStack object to a Material object, make sure they are compatible(I believe)
alright
ItemStack#getType gives you Material
alright
i fixed that and now getting this issue:
[19:55:35 WARN]: java.lang.ClassCastException: class java.lang.String cannot be cast to class java.util.List (java.lang.String and java.util.List are in module java.base of loader 'bootstrap')
Dont do unchecked casts, always add an if (variable instanceof Type) before casting variable to Type. This is the same issue as before, you are casting a single String to a List.
Can somebody help me hook into papi via eclipse, I read the docs but it doesnt work it says it doesnt exist
What says what doesn't exist?
Paste Services
When asking for help with a config/menu/code issue please use our paste bin:
(we prefer it over pastebin.com)
• HelpChat Paste - How To Use
You won't be able to upload images here directly to avoid spam, so please use https://imgur.com/upload to upload images/screenshots.
You can also use a screenshot service like gyazo or jinx and post those links here.
import me.clip.placeholderapi.PlaceholderAPI;
yes I read it thats what i was reading
send your pom.xml
ok
in a paste
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>moneygrab</groupId>
<artifactId>moneygrab</artifactId>
<version>0.0.1-SNAPSHOT</version>
<repositories>
<repository>
<id>placeholderapi</id>
<url>https://repo.extendedclip.com/content/repositories/placeholderapi/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>me.clip</groupId>
<artifactId>placeholderapi</artifactId>
<version>2.11.3</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<release>17</release>
</configuration>
</plugin>
</plugins>
</build>
</project>
2.11.3 should be good
my bad
do you know how to register a placeholder by chance
do you have a plugin
im making one
not just an expansion, right?
wym
You're making a full plugin? or just trying to make a placeholder?
making a full plugin, grabs a item from and api for a certain user and I want to have a placeholder so the user can see that item for just them
thanks
registered and working thanks!
nice, no problem 👍
hi, why Relational placeholder didnt works
`
public class ClanPlaceholderExpansion extends PlaceholderExpansion implements Relational {
private final WortexClans plugin;
private final ClanPlayerRepository clanPlayerRepository;
public ClanPlaceholderExpansion(WortexClans plugin, ClanPlayerRepository clanPlayerRepository) {
this.plugin = plugin;
this.clanPlayerRepository = clanPlayerRepository;
}
@Override
public String getAuthor() {
return "redtea";
}
@Override
public String getIdentifier() {
return "wortexclans";
}
@Override
public String getVersion() {
return "1.0.0";
}
@Override
public boolean persist() {
return true; // This is required or else PlaceholderAPI will unregister the Expansion on reload
}
@Override
public String onPlaceholderRequest(Player one, Player two, String identifier) {
if(one == null || two == null)
return "null"; // We require both Players to be online
ClanPlayer rec = clanPlayerRepository.getByPlayer(one);
ClanPlayer other = clanPlayerRepository.getByPlayer(two);
if(identifier.equalsIgnoreCase("clan")) {
if(!other.hasClan()) {
return ChatColor.AQUA.toString() + ChatColor.BOLD + "NEWBIE";
}
Clan otherClan = other.getClanObj();
if(!rec.hasClan()) {
return ChatColor.GRAY.toString() + otherClan.getName();
}
Clan recClan = rec.getClanObj();
if(rec.getClan().equals(other.getClan())) {
return ChatColor.DARK_GREEN.toString() + ChatColor.BOLD + recClan.getName();
} else {
return ChatColor.DARK_RED.toString() + ChatColor.BOLD + recClan.getName();
}
}
return "null";
}
}
`
/parse me %rel_wortexclans_clan%
prints '%rel_wortexclans_clan% '
registering:
if(Bukkit.getPluginManager().getPlugin("PlaceholderAPI") != null) { new ClanPlaceholderExpansion(this, clanPlayerRepository).register(); getLogger().info("Placeholder registered!"); } else getLogger().severe("PlaceholderAPI not fount!");
try debugging (logging if you wish) if it even gets called before the first if
ok, i will try
I'm not sure how relational placeholders are registered
well from the docs it seems to be pretty similar like regular placeholders
no any info about it's registery on github wiki
`
Bukkit.getLogger().info("Player one = " + one);
Bukkit.getLogger().info("Player two = " + two);
if(one == null || two == null)
return "null"; // We require both Players to be online
Bukkit.getLogger().info("No one is null");
`
code
[14:59:45] [TAB Processing Thread/INFO] [Minecraft/]: Player one = CraftPlayer{name=itzRedTea}
[14:59:45] [TAB Processing Thread/INFO] [Minecraft/]: Player two = CraftPlayer{name=itzRedTea}
[14:59:45] [TAB Processing Thread/INFO] [Minecraft/]: No one is null
log
that is very weird indeed.
When i click build project in IntelliJ for my plugin it says its completed the build but doesn't actually update the plugin at-all. Anyone know why?
try with two different accounts
@eager blaze /papi parserel
i tried
oh guys i had outdated tab plugin
Does anyone have a ts project that consist of two/more modules (e.g. backend & frontend) and another module for common types?
I try to make a project with 3 modules backend frontend and shared-types, and I want to import shared-types to the other 2 modules without publishing it somewhere (on npm for example).
I'm kinda lost on this tsconfig file 😵
This is what I've tried
https://i.imgur.com/0tIZFyE.png
// shared-types/src/javadocHistory.ts
export interface ClassMember {
name: string,
parameters: string[]
}```
index.d.ts is just `export * from './src/javadocHistory'`
```json
// shared-types/tsconfig.json
{
"compilerOptions": {
"target": "ES2022",
"module": "commonjs",
"declaration": true,
"outDir": "dist",
"rootDir": "src"
},
"include": ["src"]
}```
```json
// backend/package.json
"dependencies": {
"shared-types": "file:../shared-types"
}```
And when I try `import { ClassMember } from 'shared-types';` I get `Can not find module 'shared-types' or its corresponding type declarations`
What is the standard way to deserialize complex config.yml files? Should I just do it manually, should I use ConfigurationSerializable or should I use another library such as Jackson? All those methods just seem "messy". The structure I have right now (but I will be adding a lot more) is below. I wouldn't want "timer" or "event_preview" to be their own object (e.g: timer.event_preview.scope would just be RandomEventsConfig.eventPreviewScope)
teleport_search_radius: short
timer:
location: RandomEventTimerLocation
event_preview:
in_advance: short
scope: RandomEventScope
defaults: # RandomEventsGameConfig
delay: short
drops_seed: long
display_lore: boolean
require_learning: boolean
share_scope: RandomEventScope
probability_preset: ProbabilityPreset # Found from probability_presets
probability_presets: # Map<String,ProbabilityPreset>
default: # an example key, ProbabilityPreset
eventtype: Map<RandomEventType,Short>
blocks: Map<Material,Short>
items: Map<Material,Short>
entities: Map<EntityType,Short>
effects: Map<PotionEffectType,Short>```
I personally use Configurate because I prefer yaml (public plugins, sadly)
with configurate you need objects, and it is similar to what you have described there
I prefer YAML as well, but Jackson supports YAML and I've used it before (for a non-Minecraft-related project) so if I were to use another library I'd probably go for that one 😛
jackson is bae
I generally don't like libraries which are based so much on annotations and reflection (idrk why, it just seems un-Java-like), but Jackson is definitely very clean so I do quite like it
i mean you can totally make your own de/serializers with jackson
but more often than not it's not needed and you're wasting time on something that is not what you should be spending it on
Ye, but just cos I don't particularly like it, doesn't mean I'm gonna make it 100x more difficult for myself (and make my code a lot less maintainable) just to avoid it
I mean, keeping it maintainable is the whole reason I'm asking what the standard is lol. Cos if most people do it one way, it makes it a lot less maintainable if I choose to do it some other non-standard way
personally i would just use jackson
or configurate but i think you need to shade and relocate your own version of snakeyaml, I believe it uses a different version than the one the server ships
the bukkit config api is very, very barebones
I swear, can you even use it to create complex config objects? I've tried to use ConfigSerializable once or getItemStack and it didn't work lol
I've added what I've tried to do
setting up a js/ts project is killing me 🤣 🤣
Alright, I just assumed it would be the standard way and wouldn't want to use something else if it was, but I'm glad it isn't 😅
When i click build project in IntelliJ for my plugin it says its completed the build but doesn't actually update the plugin at-all. Anyone know why?
I need some BASH help.
I have a few apps and I've created a start.sh script for each. The apps and their start script locations follow this pattern: ~/apps/<app-name>/.
I also have an start.sh script in ~/apps/ and I've made that script run on startup. What that script is meant to do is open a new detached screen, cd into each app's directory and run the start script from there.
This is the current start.sh script:
#!/bin/bash
# Function to create a new detached screen and run a bash script in it
function create_and_run_screen {
screen -dmS $1 bash -c "cd $2 && $3"
}
# Create a new screen and run the Minecraft server startup script in it
create_and_run_screen "minecraft" "~/apps/minecraft/" "start.sh"
This doesn't work though. Mostly because of the cd command. The screen instantly terminates.
The reason I want to cd into the app's directory first is because Minecraft seems to check for the EULA file in the directory that the startup script was ran in.
Anyone know if it is possible to open a new detached screen, cd into a directory inside that screen and than run a bash script in there?
damn
Well, I'm setting up Jackson YAML, but I've just discovered that for some reason PotionEffectType isn't an enum (???) so Jackson can't deserialize it by default. Is there a way to get Jackson to treat it like an Enum or will I need to write my own deserializer for it?
mfs will do literally anything to avoid using Docker
and this is like, a textbook usecase for Docker lol
I need help
There is no time to wait! Ask your question @indigo slate!
What to do if I boost my friends server and get it to level 2 but accidentally left it now it shows server will lose a level in 2 day what can I do I also got kicked from the community booster role please help someone
?not-discord
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.
Not helpful... Also, I don't mind using docker. I don't have time to learn it though. And the truth is I don't really need all of this. I just wanted to have abstract scripts. I ain't running a network here. All I'm running is a test server.
It literally isn't worth for me to learn docker right now
Blitz I will literally sit down and teach you Docker in 15 minutes
and it will be 100x better at what you're trying to do that that
@broken elbow there is a flag for eula btw
Won't help. It runs the entire server in the directory I run the script from
this means it recreates all files and directories there
@dusty frost do you have any idea what i can do here? 😦
I don't disagree. I was just hopign to do this in a few seconds instead.
Id help
But currently not on pc
Dw about it. I'm going to learn Docker. Some day. I don't really care right now. I'll just manually start the server whenever I need it.
backing up the machine and upgrading it right now
yeah do you want to sit in a call soon? i am not joking, it will drastically improve your life
one file
I'm probs just gonna have to do it manually, but I'm curious if anyone has any ideas why it isn't an enum
you should use pnpm if you wanna do a monorepo like that
it'll make it really easy
hell I wanna attend that class
Docker OP fr fr
lol
fr
organizing those types of events here would be pog tbh
like, every 2 weeks or even once per month
have an event where someone will present/teach a class or whatever
about tech
would be quite pog ngl
the ultimate help chat
What is that?
I wanted to keep eveything in a repo because it is a small project
It's a monorepo package manager, basically exactly what npm is but for monorepo stuff so you can set it up so that everything shares really nicely
i honestly don't know a ton ton about it, but i know you use it for a monorepo scenario like this where you want multiple separate projects to share certain dependencies and stuff
Aight I will look into it, thanks Star.
for sure!
what is default kb amount without any modifications?
@dusty frost what is the tool you said I should use instead of create react app?
Vite
npm create vite@latest
Ty
or, even pnpm create vite lol
Vite + Svelte + SvelteKit + Tailwind cough
i need to simulate minecraft snowball knockback anyone can tell me how it modifies player velocity?
Agree
When i click build project in IntelliJ for my plugin it says its completed the build but doesn't actually update the plugin at-all. Anyone know why?
No
tragic, thanks
Scheduler each tick, loop players, store state, check if state changed, call your own event 
Jank always works
i hate it xD
Hm, nearly got it all working with Jackson, but came upon one hurdle which I'm absolutely clueless how to solve. defaults.probability_preset references a ProbabilityPreset which is to be defined in probability_presets so the object needs to be created by probability_presets then referenced by defaults.probability_preset. Anyone with experience with Jackson have any ideas how I could go about solving this?
I've seen a few similar problems where the solution is JsonIdentityInfo, but that only works if the identifying value is a field, so the structure would have to be```yml
probability_presets: # List<ProbabilityPreset>
- name: String
eventtype: Map<RandomEventType,Short>...
instead ofyml
probability_presets: # Map<String,ProbabilityPreset>
default:
eventtype: Map<RandomEventType,Short>
# ...```which isn't ideal (in fact I can't even get it working without getting an UnresolvedForwardReference error)
Maven
bump
ill just fking decompile it
@dusty frost why's this needed for docker?
Do I need docker desktop? Or what should I install on a debian 12 server with no DE?
docker desktop for debian install page
so engine is what I want then?
Oh. I see. I misread the documentation and I thought it said "Engine comes with Desktop" but it said the exact opposite. Thanks BM
There no way it does not update check the plugin path it says it replaces
Also maybe u forgot to make a const between the classes
So they won’t work not matter how many compiles u did if u want u can add me to code together season I’ll tell u exactly what’s the problem and how to fix it
public void h() {
this.S = this.locX;
this.T = this.locY;
this.U = this.locZ;
super.h();
if (this.shake > 0) {
--this.shake;
}
if (this.inGround) {
if (this.world.getType(this.blockX, this.blockY, this.blockZ) == this.inBlockId) {
++this.i;
if (this.i == 1200) {
this.die();
}
return;
}
this.inGround = false;
this.motX *= (double) (this.random.nextFloat() * 0.2F);
this.motY *= (double) (this.random.nextFloat() * 0.2F);
this.motZ *= (double) (this.random.nextFloat() * 0.2F);
this.i = 0;
this.at = 0;
} else {
++this.at;
}
Vec3D vec3d = Vec3D.a(this.locX, this.locY, this.locZ);
Vec3D vec3d1 = Vec3D.a(this.locX + this.motX, this.locY + this.motY, this.locZ + this.motZ);
MovingObjectPosition movingobjectposition = this.world.a(vec3d, vec3d1);
vec3d = Vec3D.a(this.locX, this.locY, this.locZ);
vec3d1 = Vec3D.a(this.locX + this.motX, this.locY + this.motY, this.locZ + this.motZ);
if (movingobjectposition != null) {
vec3d1 = Vec3D.a(movingobjectposition.pos.a, movingobjectposition.pos.b, movingobjectposition.pos.c);
}
so this is what i found so far how ever that math calculation doesnt seem to be what im looking for
MovngObject is an entity
now the problem here is that i dont see where it checks for example if it meta data like punch or something
which makes me assume im not in right place
i went thru snowballentity class
its superclass
and few other classes
anyone can give me the right path or the mc default values of kb because for snowball/eggs im pretty sure its static
maybe ill try to debug it can be easier to return the possible values
ill just get dir of the projectile and see what it applies to an entity on hit
EntitySnowball has onHitEntity which overrides a method defined in IProjectile (EntityProjectile and EntityProjectileThrowable do not override it). It calls super.onHitEntity but EntitySnowball's definition for onHitEntity is blank so this can be safely ignored. It then callls entity.hurt(this.damageSources().thrown(this, this.getOwner()), (float) i); where i is 0 for players (to not deal damage). Now, there are many relevant definitions for Entity.hurt but the only one which calls Entity.knockback is EntityLiving.hurt which calls it with these valuesjava double d0 = entity1.getX() - this.getX(); double d1; for (d1 = entity1.getZ() - this.getZ(); d0 * d0 + d1 * d1 < 1.0E-4D; d1 = (Math.random() - Math.random()) * 0.01D) { d0 = (Math.random() - Math.random()) * 0.01D; } this.knockback(0.4000000059604645D, d0, d1);where entity1 is the snowball. Now I honestly have no idea what that math is doing, but it doesn't call any other functions besides Math.random() and to get positions so I believe this should be what you need. You could either copy that math or you could even just use NMS to call Player.hurt yourself where the DamageSource is from any (might as well just use a Snowball since some other entities such as EntityHuman and EntityWolf have special behaviour) entity (you won't need to actually spawn it) in the opposite direction of where you want the knockback to go and f is 0 (to not deal damage)
hey, does anyone know how I could get an ItemStack from a placed block's material and data?
Just create a new ItemStack with the same Material as the placed block (Block.getType())
what about double slabs? Also, I'm on 1.8, I forgot to mention
Oh so are you meaning the block drops?
Technically double slabs are their own item type iirc
unfortunately, no, it doesn't give me anything if I add the item stack to my inventory
and block drops won't work too because I actually need the block.
I would get diamonds from diamond ores for
I think I have to make special cases for every block, which I don't want to do
Actually, I think on 1.8 it uses damage values for stuff like that. You'll need to set the ItemStack's damage to the same as the block
it's more complicated than that. I'm aware of the damage value but that won't work either for the double slabs
also, I also have to handle the data because of some block's metadata
leaves have two booleans stored in the data value and when I try to turn them into ItemStacks, they end up having wrong damage values
idk maybe I'm complicating things and/or I don't fully understand how things work but I know for sure I'm stuck
You could try java ItemStack itemstack = new ItemStack(block.getType(), 1); itemstack.setItemMeta(block.getData());block.getData() is deprecated but if you're on 1.8 I don't think it should be a problem
Oh sorry ye try itemstack.setData(new MaterialData(block.getType(), block.getData()))
Honestly just assumed Block.getData was a MaterialData lol, strange that you have to convert it yourself
minecraft 1.8 haha
Block.getData returns BlockData though
for 1.8 it doesn't
fair
thanks alot ! god bless u
nw! 😄
yeah that math is no sense math i dont think it was written by human probably the obf made it that way
I only recently figured out how to read NMS myself so thought I should pass it on loll
im familier with the topic how ever i still often get lost
ii assume this is the projectile location correc?
correct*
this.getX(); and etc
it doesn't give me the item at all
For me, the main problem was I didn't understand the naming scheme so it wasn't clear to me what was Spigot, CraftBukkit or NMS
actually I think it does but the damage value is 0
this is the entity being hit (the player). entity1 is the projectile (the snowball)
i see
like the obsf made to the game didnt really help it out just made moding community suffer
double slabs?
just write a quick method to get craftbukkit info of block when intteracting with it
and use it later
not loc but the ID and damage of it
Like if you put a stone slab on top of another stone slab, you don't get a stone block you actually get a "double slab" block, which I thought could be given as an item (at the very least, one of those purple/black ones) but apparently not
those are legacy items
Ye they're using 1.8
Oh lol
they exist actually
what are those legacy leaves?
I play 1.8 client but don't think I've ever tried to develop for 1.8 (I would just use Via if needsbe) so
u probably cant summon them via bukkit api
nah i work only on 1.8 even tough poor API
Bruh, I'm curious why
i work on custom game mode server
also i hate some of new version features and mechanics of movement and etc on client side
and many others do
ofc i can disable and make pvp simillar but movement on clientside isnt changable
But surely you could just use Via to use a more up-to-date server and plugin while only allowing 1.8 clients to connect
texturepack
with 3D Models
hm?
diff java version
dont allow same texturepack to work on those diff versions
so people wont be able to see the guns and custom entities correctly
But if it's 1.8 clients, you could still make the texture pack for 1.8, just make the plugin and run the server on a newer (more safe/secure/performantish) version
i forked spigot and changed alot of things... so what u suggest is run an newer version server and writing everything for 1.8
i have heard of new server software that can use cpu completely
Well, I'm suggesting that you could have done that before developing everything already lol
not single theard which sounds nuts to me like OP
Ye, Folia
diff API ?
It's still in development though
or NMS only
It uses Paper API, which is currently a fork of Spigot/Bukkit but they apparently plan on hard-forking soon
eh i hope they write a completely new API
Same lol
i had a lot of problems for example with SnakeYAML
so i wrote my own file system
i barely use bukkit AP
API in 1.8 it has so many problems
Soo it works? Or were you wanting it to show the correct texture?
i see
place iit now
Oh so you just had to do both lol
it probably doesnt have texturepack in game
both haha
It's so nostalgic seeing that honestly
I mean it's not working
it should
i did something simillar in the past
like 2 years ago
it doesn't
I remember playing on a creative plots server like 6 years ago and that stuff became the currency for skulls cos nobody knew how to get either of them lol
within stoneslabs
u got ID via bukkit API?
it should be fine
just write method now to set block to see if it works
and ofc make sure to apply damage data towards it
I just said I'm already doing that
the block id is okay, the damage isn't
the wood variation is in the item damage/block data
And I'm guessing you are setting the damage right? It's just not applying?
switch (block.getType()) {
case DOUBLE_STEP:
player.getInventory().addItems(new ItemStack(Material.STEP, 2, block.getData()));
break;
...
dont add the same addItems method for each case
(byte)
you can keep a Map<Material, ItemStack> or whatever
i guess it would even better and set like nms compound towards it
and later just on write a check on blockPlaceEvent
because my code works 100% and it used to put different type of spawners
which is simillar goal
block.getData() also has the slab's metadata (placement, either top or bottom) which the ItemStack doesn't handle
yeah so just do what i told ya
do I have to make special cases for every block so I can extract the correct damage?
no
what
u use
nms compunds
to store the data
and no need switch case on place u check if exists
if does u modify the block
smart
😉
???
store on the itmestack the damage byte and type
and on place just change it according to data
what version is this on
1.8
xd
wdym suggeestion?
1.8 is complicated
1.8 is not
alex i code for older versions even
like 1.2.5
pretty sure 90% of devs here wont be able to write a plugin for that version
no guides / wikis
why is this being treated as a flex
nah its not flex its about he saying 1.8 complicated
because it is
nah its not just poor API
Making stuff in 1.8 is a lot more complicated than it is in later versions
means it's complicated
yes
API is good enough trust me
specially for ur goal
just settings a block with an damage it exists

I agree
its not like making custom entity and making custom goals and pathfinder towards it
its complicated no API for it
but what u want to do API is here to help u no need for gibrish nms
i told u what is best to do Aki also suggest it in first place
listen to block place event
that means I wouldn't be able to place the slab in a different position, only in the previous one
and the item icon wouldn't be fixed
check before.
if block != AIR
solved
if not Y1 + and set there and remove 1 item from player inventory
also make it support liquids and other non AIR blocks that allows player to put blocks via it
check what before?
if the block u place isnt AIR if its slab it will return false
so event wll do other nessecary checks
to check if liquid or other scenarios that can happen
and +Y if its an slab or whatt ever
thanks, you are very helpful
<3
@EventHandler
public void OnBlockPlace(BlockPlaceEvent event) {
Block block = event.getBlock();
Location location = block.getLocation();
ItemStack item = event.getPlayer.getItemInHand();
if( check if items is the special slab placer){
if(location.getBlock.getType.toString.contains("SLAB")){
Location newlocation = new Location(insert first location ,y+1,...)
//another check in case or so
if(newlocation.getBlock.getType != AIR){
event.setcancelled(true);
return; // cancel it completely
}
newlocation // set block... and data
update player inventory
...
its what i meant + - if u get lost
oh u need to cancel anyway ig so u can put it after second check
I would recommend it! Gives you a nice little graphical viewer to see logs and stuff. Make sure you use Docker Compose too, it's basically the only way you should be making stuff unless you only want a container for like 1 time
I don't have a UI though. I only connect through ssh
Oh, then I suppose you don't!
If you want a web based one, I have heard good things about Portainer, but imo the cli is pretty solid for Docker
Yeah. I'm just going to stick with cli. My understanding is that Destkop just uses cli in the back either way?
I'll install compose as well then
Yes! Just a graphical frontend
Yeah me neither, but for stuff like looking at logs it's pretty nice
turns out I have it installed
Sweet! Now just get a Docker Compose yml file for the containers you want and bam
Time to learn how that works
when docker crash course event @dusty frost 🥺
Since when does docker desktop support Linux?
Docker Desktop on Linux runs a Virtual Machine (VM) so creates and uses a custom docker context desktop-linux on startup.
This means images and containers deployed on the Linux Docker Engine (before installation) are not available in Docker Desktop for Linux.
Oh god, this is so dumb
Just why
Hey, every time I run a command I set up using ACF (a framework for commands) I get a weird error. Here's the command that throws the error ```java
@Subcommand("%inventory")
@CommandPermission("slimeframe.anyone.inventory")
@Description("Show your relic inventory")
public void showRelicInventory(CommandSender sender) {
if (!(sender instanceof Player p)) return;
RelicInventory relicInventory = relicMan.getRelicInventory(p);
Bukkit.getScheduler().runTask(plugin, relicInventory::open);
}
and here is the error thrown: ```console
[11:45:53 ERROR]: [SlimeFrame] [ACF] Exception in command: slimeframe relics
[11:45:53 ERROR]: [SlimeFrame] [ACF] net.minecraft.server.CancelledPacketHandleException```
Probably some other plugins doing weird stuff
oh rip only saw it now, kinda at an irl event rn
taken
Does anyone know how I can decrease the minimum height requirement for fall damage using spigot api?
I made a custom weapon that has an ability that launches the player into the air and performs an AOE attack upon landing. The fall event is used to check if the player has landed and metadata is used to differentiate between weapons/abilities. However, if the player doesn’t receive fall damage after using the ability, the metadata remains and the ability doesn’t occur until the player receives fall damage from another source
You can use a timer and check if the block underneath the player is solid
instead of using fall event?
You would still use fall event to cancel the damage, you would use the timer to remove the metadata
how would it cancel the damage if it needs to like detect fall damage first
I will note there is LivingEntity#fallDistance
Would I need to add a delay of like a second before using the timer so that it doesnt count that the block underneath the player is solid before the player is actually launched up in the air
Yeah probably
And another delay after detecting landing so the metadata is still there when the fall event is called
alr i'll try that thanks
it works but how can I make it detect if player lands on liquid?
Check block type?
Shouldn't isSolid already account for that?
oh i used isonground
I want to generate an .exe for my Kotlin console application (non-modular) that includes the application .jar and the Java Runtime (17), but seems that I can't do that because I'm too stupid. This is what I've attempted so far:
- Use
org.beryx.runtimeGradle plugin to generate an.exe.- This one didn't work at all, the final program does run, and it does create a Java runtime based on the modules that you specify, but they are placed separated in a folder, where a copy of your application
.jaris located, and the.exeis just a bootstrap for executing the.jarwith the Java Runtime that is located nearby.
- This one didn't work at all, the final program does run, and it does create a Java runtime based on the modules that you specify, but they are placed separated in a folder, where a copy of your application
- Use
edu.sc.seis.launch4jGradle plugin to generate an.exe.- This one kinda worked because it was the closest to the "single file" concept that I was looking for, but the final "binary" does not include the java runtime at all, which means the user still has to install the Java runtime.
I want a solution that can be automated and executed in an CI/CD environment like GitHub Actions, I needn't a GUI-based application to do this conversion to me, hence why a Gradle-based approach would be prefered. What options do I have to perform the conversion of (Java Runtime + Java Console Application) into a single binary file that bootstraps itself with the bundled Java Runtime (that is included inside it)?
You can try jpackage. https://docs.oracle.com/en/java/javase/17/docs/specs/man/jpackage.html
org.beryx.runtime does use jpackage, and the behavior that I observed is what I described, the Java Runtime in a folder, and the application .jar sitting next to it. I also was able to generate a installer with it, but I don't want or need a installer (which btw jpackage is great for those cases). Is jpackage able to create this "embedded binary" that I just described?
no
it either creates an app image which is just the runtime + the modules, with an exe launcher but the jvm runtime is there as it always is; or it creates an installer which just installs the app image in the system
but it does not create a single executable that just runs
So, do you know a way of doing what I described, or that is just not possible?
I'm asking because other Languages like Python can do that, and it's pretty easy btw, why can't java have something like that too? 😢
Hi im creating a kbffa plugin and i want to store the users deaths/kills in placeholders. how can i do this ( i setup the death event already)
I'm sorry. What do you mean by "store death/kills in placeholders"? what placeholders are you talking about? Do you maybe mean to ask "how to add PlaceholderAPI placeholders that display those stats?"?
i mean, it is possible, just not with jpackage
why do you need it as a single executable anyway?
installers are pretty standard stuff
Mainly for portability purposes, I love the concept of single file execution, especially for CLI tools like this one
I mean you can always just have 1 single directory that can be zipped and moved
Just don't save shit to appdata or any other directory. easy
yeah, tons of installable tools, their portable version is usually just a zip file with what the installer installs, so it's in its tiny lil directory
i feel like any other solution to put everything in a single exe is just complicating it, like making a bootstrap in an executable that zips the whole runtime, but then you have another language that needs to be able to do that
alternatively, don't use the jvm?
if it's for a simple CLI app that you want to keep simple then surely you don't really need the whole jvm
alternatively, kotlin/native but I haven't heard good things about it 
yea could always graal it for something simple
the jvm isnt great for cli's anyway bc startup times
There is
Forgot the name tho
Graalvm image something
Although it doesn't work for everything
Idk last time I tried to use it (but failed since it didn't support JavaFX) was a looooong time ago
Well from Google it appears to support it now?
¯_(ツ)_/¯
javafx 💀
I use kotlin now but what would u recommend for Java?
not
Oh 🥲
just use electron or smthn fr fr
or like bindings for gtk or qt
or just make a website fr fr
What are bindings?
Gotta learn html, css 🥲
it will take you 5 minutes
Oh
if you don't know html or css, i'd be very impressed
it's very useful knowledge as a developer of any kind
I know the basics from TheOdinProject (finished the fundamentals part and some after) but then decided to go back to kotlin
¯_(ツ)_/¯
you see, my problem with trying to learn web frontend is my lack of ideas and creativity
for like two years I've been like "I want a nice landing page"
that's not really what I'm saying
I can't picture something nice to build
no ideas
mm
That is 100% me
No
Fisher == Emily
I'm 100% you
That's the first step
👏
Currently getting this
[20:10:09 WARN]: [PlaceholderAPI] There was an issue with loading an expansion.
when loading my expansion, yes, only that line, any way to know what is actually happening? (i mean how to get more info)
are you making an expansion and it's showing that or are you trying to use one?
i made it and tried to test it, but it says that
https://github.com/PlaceholderAPI/PlaceholderAPI/blob/f91b4e3752de1c476494df816170a1f9aef0fd76/src/main/java/me/clip/placeholderapi/expansion/manager/LocalExpansionManager.java#L439-L452 kinda shitty it doesn't print the error;; is the constructor of your expansion public with no args?
its public and doesn't have any args
is the class public too? 
yes it is xD
Paste Services
When asking for help with a config/menu/code issue please use our paste bin:
(we prefer it over pastebin.com)
• HelpChat Paste - How To Use
oh dear

that didnt happen before, just this time lol
i'll try restarting
but is weird, last time i tested it was working
i do the same in all my expansions, so i have no clue what it would be 
idk what i did, but happenst the same lol
is it an expansion in plugins/placeholderapi/expansions? or is it one you register from within a plugin?
no no, its an expansion extending PlaceholderExpansion
@shell moon try to build this, Im not on pc rn to give you a jar https://github.com/PlaceholderAPI/PlaceholderAPI/pull/953
All expansions extend that
What was it?
you will never guess xd
it was:
persist = true

i'm used to use true in all my plugins
but i forgot it had to be false in expansions
Ah yes
If you keep getting the identifier in use error, downgrade to 2.11.2 or build what I sent
i'm sure i won't get more, i checked the whole papi code related to registration
and i figure out that xD
thanks

Np
does anybody have ever tried and achieved to run a jar file in github actions
run?
this is probably the action for java stuff https://github.com/actions/setup-java but why do you want to run it?
i setup the java project in another repo
so thats seems convenient but make things hard for developing this
i achieved to build and upload the artifact
and then downloaded the artifact from that repo
but couldn't achived to run it
so you depend on another project that is hosted on a different repo and you need it for the second project?
it says Error: Could not find or load main class but the same repo same command works perfectly on local
yeah actually
can you not publish the first one to a maven repo first?
i think i can but the second project is just a workspace with files and folders not a java project
i may made a design mistake separating the java project and workspace
but i got so close to make it work
what would you accomplish by running the workspace on gh actions?
the smarter thing to do is to unseparate them, not try to run the jar in actions
so i have a project #1
- java applicaton that merges different packs and some other stuff
and project #2 - just contains resourcepacks and wanted gh actions to run the merger application in here and afterwards use optimizing packs and uploading to drive..
that was the idea behind it
assuming you can clone a repo with gh actions, can you not clone the workspace and instead of building the app, you start the main class?
- clone the repo to a folder, e.g.
workspace - run the main class of the program
- upload the results of the program to drive
maybe i can just clone it temporarily inside the gh actions
fetching updates does not seems convenient
great idea
also, make sure there is an action that lets you upload stuff to drive 🤣
Nice
hey im new to making plugins but i want to make a simple spawner plugin that allows animals like pigs to spawn in water any ideas where i could look to get some help?
how new are you to plugins?
i have made a few i have done other coding before so just some sorce code to help me alonge wouold be great
or just anything that could send me in the right direction
so spoon feeding you? lol
So do you want pigs to spawn in every block of water, or triggered by a spawner being placed and pig egg placed in it?
when a pig spawns, place water 
i think they want to cancel mob spawn on a spawner spawns an animal like a pig if the animal is not in water
Hey, is there a way of catching a string using placeholder API? like catching the message to format at as a placeholder. like <part one> string here <part two> and catch the inside of that by using two strings? I know it's possible, just don't see a clean way of doing it
working on a simple plugin to learn how to make plugins, what is some simple stuff I could add to it?
simple stuff for a simple plugin
what's a simple plugin lmao
One for beginners, not too complex
those look fun
I currently have this just to learn about Adventure ```java
@org.bukkit.event.EventHandler
public void onPlayerJoin(PlayerJoinEvent event) {
Audience audience = adventure().player(event.getPlayer());
String playerName = event.getPlayer().getName();
List<String> customGreetings = this.getConfig().getStringList("welcome-messages");
var mm = MiniMessage.miniMessage();
if (!customGreetings.isEmpty()) {
Random rand = new Random();
String randomGreeting = customGreetings.get(rand.nextInt(customGreetings.size()));
audience.sendMessage(mm.deserialize(randomGreeting.replace("<player>", playerName)));
} else {
Component message = mm.deserialize("<gold>Welcome back to the server, <light_purple>" + Component.text(playerName).content() + "</light_purple>!");
audience.sendMessage(message);
}
event.joinMessage(null);
}```
idk if it's cheating doing the challenges with ChatGPT as a bit of help 😄
eh
chatgpt is expressively designed to be, basically, a bullshit generator
much preferred to ask real people for help
Real people like Tony
GPT4 is actually pretty good 😄
yeah thats what i just said
speak for yourself
also highly depends on what you mean with "hasnt been done before"
i mean something that hasnt been done before
i can do something that hasnt been done before
ChatGPT can do that too
whatever u get what i mean
BM can make the impossible, possible
Does anyone know why I can't load a custom config named "potions.yml"?
File customFile = new File(getDataFolder(), "potions.yml"); FileConfiguration config = YamlConfiguration.loadConfiguration(customFile);
this is the code that i suspect is not working
What does "not working" mean
i mean the potions.yml exists in the jar
i can't use it
if i try to get a list the the list size is 0
That’s not how you load data from the jar
Probably, depends on your goals
do you know what anything means smh
ok, how do I take the potions.yml (default) from the jar and move into the plugin folder in onEnable()?
or should I write in german? xD
saveResource or something like that
I'll look into it. Danke
chatgpt proving the world wrong by making minecraft plugins in python 😎
well people did that for years already
yeah you'd know
Hey! How can I make placeholderapi work with my plugin? I dont need anything players specific, I just want to make ItemsAdder's placeholders work
yes
as emily said gpt or those bots are bullshit generators they will generate non working code with non existing functions , beside writing u simple math or giiving u information from wiki it wont help u alot its basically liike google search that writes u what it finds from different places
i would suggest starting from Java as homework do some simple console apps and math tasks also i would reccomend starting from here https://www.w3schools.com/java/ start by java tutorial later at the same time exprience things using spigot API do simple tasks like a command that adds things to a List (like shopping list) via command and a command that returns a random thing from list , later move forward to Listeners and for example change block on break using if statements or switch case
like those are really simple things but u would learn alot from it
Also make sure you do Java Constructors between classes and regisiter events and commands correctly
have fun
and later u can move to something move advanced like Reletionships and start storing things via Yaml and later even move to an Database .
Wasn't there a test saying GPT can't even answer 90% of questions correctly anymore? I don't keep up with it so IDK if its true or not.
idk what it answers correctly tbh
but it cant do 7grade math
its what i know for sure
which is a simple math
when i was working on 3D math concepts
i asked the gpt to quickly do a 3D Plane calculation
it provoide me some bullshit
that isnt correct even
so not sure it can give u some advice bullshit
or some info from google
only old people think chatGPT is amazng
which are kinda braindead already
ChatGPT is not a calculator
there was some misunderstanding about a paper where they asked GPT4 about prime numbers
math formulas and calculations
are different
you said you asked it to do calculations :)
so im still new to spigots api and trying to wrap my head around some java, but what would be the easiest/best way i can pass material from a config file to be used as an item from itemstack if that makes sense im not sure im asking it right, basically i want to have a configurable item in a config file and to be added into some code and im not sure how i could do that. Im thinking maybe calling it from the config file but im not sure maybe someone can point me in the right way.
if curious im trying to use Cj's code for his resourceGens plugin (https://www.spigotmc.org/resources/resourcegens.27763/)
git (https://github.com/cj89898/ResourceGens)
PS. i prolly could ask him but i dont want to ask so many questions to him specifically lol
Actually that is wrong, the code is actually fully working, it knows how to work with item meta, it knows about materials, it knows about events, and everything else
I have been doing java since 2016…
so just sticks to docs... and also view few opensource plugins... u can also use chatgpt how ever im sure you can get stuck with non existing methods and getting the wrong event upon asking the bot
It literally generated most of this for me ```java
public class ClassCommand extends AbstractCommand {
private final Map<String, Class> classes = new HashMap<>();
public ClassCommand() {
super(2, "Usage: /class [PLAYER] <CLASS>");
// Register classes
classes.put("warrior", player -> new WarriorClass().createInventory(player));
classes.put("archer", player -> new ArcherClass().createInventory(player));
classes.put("miner", player -> new MinerClass().createInventory(player));
classes.put("mage", player -> new MageClass().createInventory(player));
}
@Override
public void run(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args, Player player) {
Class classImplementation = classes.get(args[args.length - 1].toLowerCase(Locale.ROOT));
if (classImplementation == null) {
sender.sendMessage(Component.text("Invalid class!", NamedTextColor.RED));
return;
}
classImplementation.createInventory(player);
}
public interface Class {
void createInventory(Player player);
}
}```
For selecting between different classes (stuff like mages, warriors and etc)
And each clears your inventory and gives you a sorta kit
so i assume u use sperate class for every class and implement createInventory settings player inventory?
appreaciate it
