#development

1 messages · Page 55 of 1

sonic nebula
#

i also know u can rewrite the player name but limit is 16 digits which isnt enough for me

#

without using extra entities (like armorstands.)

wind tapir
#

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);

dense drift
#

Has the player ever joined the server?

wind tapir
#

it's me, yes

#

so, do you have an idea why please ?

thin fox
#
    slot: 41
    amount: 2```please help for some reason does not appear in the menu egg summoning viser
dusky harness
#

(this is coding help)

thin fox
#

and where to write it?

worn jasper
edgy lintel
# wind tapir Hello, can anyone tell me why offlineplayer.getName() returns me the uuid please...

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

wind tapir
edgy lintel
#

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

wind tapir
edgy lintel
#

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

wind tapir
edgy lintel
#

not sure about it then

#

imma take a quick look at the source code and see what i can find

#

whats the version

wind tapir
edgy lintel
#

nice!!!

wind tapir
edgy lintel
#

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

edgy lintel
#

cool

wind tapir
merry knoll
#

doesnt offlineplayer pull from mojang if they didnt log in before?

worn jasper
#

is it on offline mode?

minor summit
minor summit
wind tapir
minor summit
#

...

#

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

wind tapir
#

...

#

im gonna test

minor summit
#

and what you passed is a name that happens to look like a Uuid

wind tapir
#

bruh

wind tapir
#

thank you

#

that works

minor summit
small arrow
#

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 😄

small arrow
#

I still haven’t figured it out if anyone can help I’d appreciate it

tight junco
#

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)

sonic nebula
#

and decompile bukkit...

#

many of bukkit methods have one name and do other completely thing

tight junco
#

?

minor summit
#

it's not a bukkit method lmao

#

it's a method from the person above

spiral prairie
#

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

dense drift
#

Do you use Legacy ComponentSerializer or PlainText?

spiral prairie
#

the former

dense drift
#

Then it should work ig

spiral prairie
#

im creating the legacy component serializer, serializing a serialized component from minimessage and it outputs nothing

dense drift
#

Like nothing or no colors?

spiral prairie
#

it works if there is content like <red>sd, but not if i just want the color like <red>

dense drift
#

It might not work like that, because technically that's {text: "", color: "red"} I guess

spiral prairie
#

yea

#

i need that though

dense drift
#

Might be worth to ask on the Adventure server

spiral prairie
#

did already

#

thank you though PES_Heart appreaciate it

small arrow
#

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 😁

sullen creek
#

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

hoary scarab
#

Should be able to just set the entities last damager. (Might need nms)

broken elbow
#

d;spigot Damageable#damage

uneven lanternBOT
#
void damage(double amount, @Nullable Entity source)```
Description:

Deals the given amount of damage to this entity, from a specified entity.

Parameters:

amount - Amount of damage to deal
source - Entity which to attribute this damage from

broken elbow
#

I guess you could also constantly call this

hoary scarab
#

Is Damageable in 1.12 though?

sullen creek
broken elbow
#

That's the spigot api

sullen creek
#

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

broken elbow
#

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

sullen creek
#

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?

broken elbow
#

You'll have to test and see

sullen creek
#

Got it got it

#

Regardless shouldnt be hard to set a timer to recall the damage thing every x amount of time

#

Thanks Blitz

tight junco
dense drift
#

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

dense drift
#

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
minor summit
#

well yeah

#

java isn't the one that generates javadoc

#

javadoc is the one that generates javadoc

muted ruin
#
  • 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 shadow configuration:
    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*
void orchid
muted ruin
#

i have this same setup on another project so i dont understand what i did wrong here

void orchid
#

I see, never seen anybody do that before. You're good then

muted ruin
#

also it works fine for projects that use the library externally (thru jitpack), its literally just the example bot 🙃

void orchid
#

don't understand your point

muted ruin
void orchid
#

alright, and just to make sure we're on the same page, the subproject is located inside the parent project, right?

muted ruin
void orchid
#

Tried referring to the original name instead? library in this case, instead of LazyLibrary

sonic nebula
#

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?

dense drift
vernal quail
#

any recommended DI (Dependency Injection) framework?
would be good if you have some example for BukkitAPI 🥺

river solstice
#

You mean "autowired" stuff?

#

Just DI yourself fingerguns

royal hedge
dense drift
#

@wheat carbon missed an opportunity

thin storm
#

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.

dense drift
#

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

hazy nimbus
minor summit
#

spigot's maven repo?

hazy nimbus
dense drift
#

unless I miss something

minor summit
#

why?

dense drift
#

because that's how I've designed the program and idk how to read a javadoc jar

minor summit
#

the javadoc jar contains all the funny html/css/js files

#

it's quite literally just a zip file

dense drift
#

yeah so?

minor summit
#

so?

#

how is having the files any different than getting them over the web

dense drift
#

good point, in this case I need to figure out how to use local files xD

minor summit
#

at worst, host a local http server that points to the files

dense drift
#

yeah

dense drift
#

thanks @minor summit

minor summit
#

hi

dapper jackal
#

Hello, someone have a tutorial/ecemple for pagnited menu/gui (no library)

broken elbow
#

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

forest sundial
#

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.

lyric gyro
#

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

hazy nimbus
#

magma pepela

lyric gyro
#

xd

lyric gyro
hazy nimbus
#

is this a topic for this channel tho? perhaps you're looking for #placeholder-api ?

lyric gyro
#

Ok I'll go take a look

verbal tree
#

Guys i want to learn how to code

#

I want to make my self a simple plugin

#

which videos do i need to check

forest sundial
#

yeah me too. freestyling with java at the moment

verbal tree
#

but i need to expirement

forest sundial
#

python, shell

#

js

#

nothing helps tho

#

look dm

#

accept my request

wind fern
#

when using player#setspectatortarger is there any way to make the user able to look around?

dark garnet
#

does Player#getHealth() account for absorption?

warm steppe
#

no

dark garnet
#

dang, how can i include it?

warm steppe
dark garnet
#

oh lmao

#

didnt think it'd literally just be that

warm steppe
#

yeah

#

javadocs are good

#

helpchat javadocs are even better

#

just sayin

dark garnet
#

i use javadocs :/
i just didnt think of checking for such an obvious method

warm steppe
#

sounds like a brainfart moment

#

i personally have them pretty often

dark garnet
#

well bukkit/spigot's usually 🤪 soooooo

warm steppe
#

use paper btw

dark garnet
#

i am

#

only for this plugin tho cause i needed pathfinding

warm steppe
#

i use this:

PaperLib.suggestPaper(this, Level.SEVERE);
if (!PaperLib.isPaper()) pluginManager.disablePlugin(this);

dark garnet
#

i dont wanna require paper cause 20% of my plugins' servers still use spigot

tiny dew
#

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

tiny dew
#

I know how to place a Structure, I'm wanting to know how to get a list of all the structures in vanilla Minecraft

proud pebble
tiny dew
#

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)

minor summit
#

structures are datapack-driven

#

there isn't a built-in/hardcoded list that will always be available

tiny dew
#

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:

minor summit
#

technically, that constitutes the set of always available structures with 0 elements in it 🤓

proud pebble
#

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

tiny dew
#

I would imagine the command would be in net.minecraft.server.commands but I don't seem to see it

proud pebble
#

Command will either be the prefix or suffix of the class name

tiny dew
#

Ye I've tried searching for both CommandStructure and StructureCommand already 😕

proud pebble
#

ig time to find where all the commands are registered and print out the class name of the structure command

tiny dew
#

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

minor summit
#

that would be because it's not the structure command

#

it's the /place command

tiny dew
#

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

minor summit
#

where are you looking, lol

tiny dew
#

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 😕

minor summit
#

everything that is patched will be under the regular spigot sources

#

everything that is untouched is in the work folder

tiny dew
#

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

minor summit
#

just clone paper lol

tiny dew
#

Found it, was still searching CommandPlace lol

tiny dew
minor summit
#

you apply patches and it generates sources

tiny dew
#

I don't know how to apply patches myself though lol, that's why I'm just searching BuildTools

minor summit
#

./gradlew applyPatches

tiny dew
#

Ok that's fair enough... I remember asking elsewhere and they made it seem a lot more complicated

minor summit
#

¯_(ツ)_/¯

tiny dew
#

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!

buoyant raft
#

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>
worn jasper
#

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?

warm steppe
#

listen to that event and check if the names are equal

#

and then do whatever u want

worn jasper
#

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?

flint kernel
#

NMS question: does anyone know what the method is that controls elastic banding of leashes at the certain range?

topaz gust
#

But yes it’s possible

worn jasper
dusky harness
#

¯_(ツ)_/¯

worn jasper
#

that would also simulate it right?

dusky harness
#

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

worn jasper
lyric gyro
#

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!

worn jasper
#

learn java first though, if you dont know it yet

lyric gyro
proud pebble
#

tho you are able to use spigot plugins on bukkit pretty much no problem but you cant plugins made with paper features on spigot

lyric gyro
#

thank you both for all the help! very appreciated

proud pebble
#

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

lyric gyro
proud pebble
lyric gyro
#

i didnt really plan on that anyway so i should be okay for the foreseeable future

rare sorrel
#

anyone got experience with visual bukkit?

pulsar ferry
#

Visual bukkit?

broken elbow
#

I believe that's like a visual programming thing for bukkit plugins

hazy nimbus
#

Yup

broken elbow
#

I guess you can think of Scratch but for bukkit

hazy nimbus
#

Just learn java at this point

broken elbow
broken elbow
pulsar ferry
#

I got scared thinking it was something to do with visual basic lol

rare sorrel
hazy nimbus
#

If you want something simple VB is the way

#

If you want to write a server core, it will be a disaster

broken elbow
#

no it doesn't. you either learn java or you don't really... if you meant the spigot api, then sure.

rare sorrel
pulsar ferry
worn jasper
#

I legit hated scratch, now I hate this more

hazy nimbus
#

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

worn jasper
#

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

rare sorrel
worn jasper
#

don't look at anything specific

#

just start.

rare sorrel
#

i don't know where to start though lmao

worn jasper
#

taking initiative is always the hardest part about learning something

rare sorrel
broken elbow
worn jasper
#

there are many courses, both on youtube and udemy, etc.

#

all those work for the basics

worn jasper
broken elbow
#

meant to say visual bukkit

#

matt made me go crazy

worn jasper
#

there you have it

pulsar ferry
worn jasper
broken elbow
#

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

dense drift
dense drift
#

although the gifs are low res as fuck lol

worn jasper
# pulsar ferry Which menus?

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

broken elbow
#

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

worn jasper
#

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

pulsar ferry
worn jasper
#

ah ok pog

worn jasper
broken elbow
broken elbow
worn jasper
broken elbow
#

I'm not a fan of skript. but not because it in itself is bad.

pulsar ferry
#

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

worn jasper
#

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

broken elbow
#

bring back the good old days. when big networks had blogposts explaining their thought processes and optimizations

#

like hypixel

#

#devblogs

worn jasper
#

this explains very well what the issue with skript is

pulsar ferry
#

TLDR, don't ingest unneeded data and batch SQL operations are good

worn jasper
hazy nimbus
pulsar ferry
#

If you consider redis to be nosql db then yes, but that's about it, and it's not used very often

hazy nimbus
pulsar ferry
#

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

buoyant raft
#

using eclipse btw

rare sorrel
#

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)

buoyant raft
#

You're trying to cast an ItemStack object to a Material object, make sure they are compatible(I believe)

rare sorrel
#

alright

dense drift
#

ItemStack#getType gives you Material

rare sorrel
#

alright

rare sorrel
# dense drift ItemStack#getType gives you Material

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')

dense drift
#

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.

dusky harness
#

You probably shouldn't be casting at all

#

Can u show code?

buoyant raft
#

Can somebody help me hook into papi via eclipse, I read the docs but it doesnt work it says it doesnt exist

grim oasis
#

What says what doesn't exist?

buoyant raft
#

the

#

wait

neat pierBOT
#
FAQ Answer:

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

#
FAQ Answer:

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.

buoyant raft
#

import me.clip.placeholderapi.PlaceholderAPI;

grim oasis
#

are you using maven? gradle?

#

neither?

buoyant raft
#

maven

#

i had to get rid of it for now

#

but like

#

how do you do it

buoyant raft
#

yes I read it thats what i was reading

grim oasis
#

send your pom.xml

buoyant raft
#

ok

grim oasis
#

in a paste

buoyant raft
#
<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>
grim oasis
#

have you saved the file you're editing?

#

ctrl+shift+o to organize imports

buoyant raft
#

god damn

#

i put wrong number in version

grim oasis
#

2.11.3 should be good

buoyant raft
#

yes ik but that was old

#

i accidently changed

grim oasis
#

o

#

icic

buoyant raft
#

my bad

grim oasis
#

all g

#

glad it works

#

i was confused

#

😂

#

and i barely know what i'm doin

buoyant raft
grim oasis
#

do you have a plugin

buoyant raft
#

im making one

grim oasis
#

not just an expansion, right?

buoyant raft
#

wym

grim oasis
#

You're making a full plugin? or just trying to make a placeholder?

buoyant raft
#

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

buoyant raft
#

thanks

buoyant raft
grim oasis
#

nice, no problem 👍

eager blaze
#

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!");

river solstice
#

try debugging (logging if you wish) if it even gets called before the first if

eager blaze
#

ok, i will try

river solstice
#

I'm not sure how relational placeholders are registered

#

well from the docs it seems to be pretty similar like regular placeholders

eager blaze
eager blaze
#

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

river solstice
#

that is very weird indeed.

eager blaze
#

simple placeholder works ok

#

relational doesnt work

rare sorrel
#

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?

warm steppe
dense drift
#

@eager blaze /papi parserel

eager blaze
#

oh guys i had outdated tab plugin

dense drift
#

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`
tiny dew
#

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>```
dense drift
#

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

tiny dew
#

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 😛

minor summit
#

jackson is bae

tiny dew
#

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

minor summit
#

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

tiny dew
#

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

minor summit
#

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

dense drift
#

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

dense drift
tiny dew
rare sorrel
#

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?

broken elbow
#

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?

minor summit
#

damn

tiny dew
#

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?

dusty frost
#

and this is like, a textbook usecase for Docker lol

indigo slate
#

I need help

neat pierBOT
#

There is no time to wait! Ask your question @indigo slate!

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

neat pierBOT
#
FAQ Answer:

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.

broken elbow
#

It literally isn't worth for me to learn docker right now

indigo slate
dusty frost
#

and it will be 100x better at what you're trying to do that that

dense drift
#

@broken elbow there is a flag for eula btw

broken elbow
#

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

dense drift
broken elbow
river solstice
#

But currently not on pc

broken elbow
#

backing up the machine and upgrading it right now

dusty frost
#

one file

tiny dew
dusty frost
#

it'll make it really easy

worn jasper
dusty frost
#

Docker OP fr fr

worn jasper
#

make a helpchat event lmao

#

"Learning Docker with Star"

dusty frost
#

lol

worn jasper
#

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

dusty frost
#

the ultimate help chat

worn jasper
#

yeah lmao

#

no but fr, consider it pls lol

dense drift
dusty frost
#

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

dense drift
#

Aight I will look into it, thanks Star.

dusty frost
#

for sure!

sonic nebula
#

what is default kb amount without any modifications?

dense drift
#

@dusty frost what is the tool you said I should use instead of create react app?

sonic nebula
#

like hortz , vert speed

#

and usual vector

dense drift
#

Ty

dusty frost
#

or, even pnpm create vite lol

worn jasper
sonic nebula
spiral prairie
signal grove
#

is there an event for allowFlight being changed?

#

not actual flight itself

rare sorrel
#

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?

signal grove
#

your build configuration needs to be set

#

is it a maven or gradle project

signal grove
#

tragic, thanks

river solstice
#

Scheduler each tick, loop players, store state, check if state changed, call your own event fingerguns

#

Jank always works

signal grove
#

i hate it xD

tiny dew
# tiny dew What is the standard way to deserialize complex config.yml files? Should I just ...

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)

rare sorrel
sonic nebula
#

ill just fking decompile it

broken elbow
#

@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?

icy shadow
#

where are you finding that?

broken elbow
#

docker desktop for debian install page

broken elbow
#

Oh. I see. I misread the documentation and I thought it said "Engine comes with Desktop" but it said the exact opposite. Thanks BM

sonic nebula
#

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

sonic nebula
# sonic nebula ill just fking decompile 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

tiny dew
#

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)

astral rivet
#

hey, does anyone know how I could get an ItemStack from a placed block's material and data?

tiny dew
astral rivet
#

what about double slabs? Also, I'm on 1.8, I forgot to mention

tiny dew
#

Oh so are you meaning the block drops?

#

Technically double slabs are their own item type iirc

astral rivet
#

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

tiny dew
#

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

astral rivet
#

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

tiny dew
#

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

astral rivet
#

I don't think setItemMeta accepts byte but hold on

#

seems it doesn't

tiny dew
#

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

astral rivet
#

minecraft 1.8 haha

dense drift
#

Block.getData returns BlockData though

tiny dew
#

You're thinking of Block.getBlockData

astral rivet
#

for 1.8 it doesn't

dense drift
#

fair

tiny dew
#

nw! 😄

sonic nebula
#

yeah that math is no sense math i dont think it was written by human probably the obf made it that way

tiny dew
#

I only recently figured out how to read NMS myself so thought I should pass it on loll

sonic nebula
#

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

astral rivet
tiny dew
#

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

astral rivet
#

actually I think it does but the damage value is 0

tiny dew
sonic nebula
#

i see

#

like the obsf made to the game didnt really help it out just made moding community suffer

sonic nebula
#

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

tiny dew
#

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

tiny dew
#

Ye they're using 1.8

sonic nebula
#

which dont exist in game its why they are displayed that way

#

im also on 1.8 💀

tiny dew
#

Oh lol

astral rivet
#

they exist actually

sonic nebula
#

what are those legacy leaves?

tiny dew
#

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

sonic nebula
#

u probably cant summon them via bukkit api

sonic nebula
tiny dew
#

Bruh, I'm curious why

sonic nebula
#

how ever spigot api is shit in many ways tooo tbh

#

so nms ftw

sonic nebula
#

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

tiny dew
#

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

sonic nebula
#

with 3D Models

tiny dew
#

hm?

sonic nebula
#

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

tiny dew
#

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

sonic nebula
#

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

tiny dew
#

Well, I'm suggesting that you could have done that before developing everything already lol

sonic nebula
#

not single theard which sounds nuts to me like OP

tiny dew
#

Ye, Folia

sonic nebula
tiny dew
#

It's still in development though

sonic nebula
#

or NMS only

tiny dew
# sonic nebula diff API ?

It uses Paper API, which is currently a fork of Spigot/Bukkit but they apparently plan on hard-forking soon

sonic nebula
#

eh i hope they write a completely new API

tiny dew
#

Same lol

sonic nebula
#

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

astral rivet
#

because I got the damage value from the slab's data

tiny dew
sonic nebula
#

place iit now

tiny dew
sonic nebula
#

it probably doesnt have texturepack in game

astral rivet
tiny dew
#

It's so nostalgic seeing that honestly

astral rivet
#

I mean it's not working

sonic nebula
#

i did something simillar in the past

#

like 2 years ago

astral rivet
#

it doesn't

tiny dew
#

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

sonic nebula
#

within stoneslabs

astral rivet
#

it's supposed to be spruce wood slab

#

but it's oak because the damage is messed up

sonic nebula
#

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

astral rivet
#

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

tiny dew
#

And I'm guessing you are setting the damage right? It's just not applying?

sonic nebula
#

send ur code

#

a snipt

#

do u location.getBlock().setData(?DATA?);

astral rivet
#
switch (block.getType()) {
                case DOUBLE_STEP:
                    player.getInventory().addItems(new ItemStack(Material.STEP, 2, block.getData()));
                    break;
...
merry knoll
#

set the data of the placed block

#

on place

dense drift
#

dont add the same addItems method for each case

sonic nebula
#

(byte)

dense drift
#

you can keep a Map<Material, ItemStack> or whatever

sonic nebula
#

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

astral rivet
#

block.getData() also has the slab's metadata (placement, either top or bottom) which the ItemStack doesn't handle

sonic nebula
#

yeah so just do what i told ya

astral rivet
#

do I have to make special cases for every block so I can extract the correct damage?

sonic nebula
#

no

astral rivet
sonic nebula
#

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

#

😉

astral rivet
#

???

sonic nebula
#

store on the itmestack the damage byte and type

#

and on place just change it according to data

tight junco
#

what version is this on

sonic nebula
#

legacy

#

u too young lad

astral rivet
#

1.8

sonic nebula
#

xd

tight junco
#

ah

#

was wondering why the suggestion was turbo complicated

sonic nebula
astral rivet
#

1.8 is complicated

sonic nebula
#

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

tight junco
#

why is this being treated as a flex

sonic nebula
#

nah its not flex its about he saying 1.8 complicated

astral rivet
#

because it is

sonic nebula
#

nah its not just poor API

tight junco
#

Making stuff in 1.8 is a lot more complicated than it is in later versions

astral rivet
sonic nebula
#

Ori its known

#

the API is easier in newer versions

tight junco
#

yes

sonic nebula
#

specially for ur goal

#

just settings a block with an damage it exists

merry knoll
astral rivet
sonic nebula
#

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

astral rivet
#

and the item icon wouldn't be fixed

sonic nebula
#

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

astral rivet
sonic nebula
#

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

astral rivet
#

thanks, you are very helpful

sonic nebula
#

there many ways to do it from here

#

your welcome alex ❤️

astral rivet
#

<3

sonic nebula
#
@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

dusty frost
broken elbow
dusty frost
#

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

broken elbow
#

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

dusty frost
broken elbow
#

I don't mind the command line

#

I enjoy it

dusty frost
#

Yeah me neither, but for stuff like looking at logs it's pretty nice

broken elbow
#

turns out I have it installed

dusty frost
#

Sweet! Now just get a Docker Compose yml file for the containers you want and bam

broken elbow
#

Time to learn how that works

worn jasper
#

when docker crash course event @dusty frost 🥺

dusty frost
#

could go in like half an hour

#

if y'all are available

hazy nimbus
#

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

boreal drift
#

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```
hazy nimbus
#

Probably some other plugins doing weird stuff

worn jasper
river solstice
zenith fog
#

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

leaden sinew
zenith fog
#

instead of using fall event?

leaden sinew
#

You would still use fall event to cancel the damage, you would use the timer to remove the metadata

zenith fog
#

how would it cancel the damage if it needs to like detect fall damage first

tight junco
#

I will note there is LivingEntity#fallDistance

zenith fog
leaden sinew
#

Yeah probably

#

And another delay after detecting landing so the metadata is still there when the fall event is called

zenith fog
#

alr i'll try that thanks

zenith fog
forest jay
#

Shouldn't isSolid already account for that?

zenith fog
#

oh i used isonground

robust flower
#

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.runtime Gradle 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 .jar is located, and the .exe is just a bootstrap for executing the .jar with the Java Runtime that is located nearby.
  • Use edu.sc.seis.launch4j Gradle 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)?

broken elbow
robust flower
#

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?

minor summit
#

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

robust flower
#

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? 😢

lyric gyro
#

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)

broken elbow
#

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?"?

minor summit
#

why do you need it as a single executable anyway?

#

installers are pretty standard stuff

robust flower
#

Mainly for portability purposes, I love the concept of single file execution, especially for CLI tools like this one

broken elbow
#

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

minor summit
#

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? Shrug 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 pepelaugh

icy shadow
#

yea could always graal it for something simple

#

the jvm isnt great for cli's anyway bc startup times

dusky harness
#

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?

#

¯_(ツ)_/¯

dusty frost
#

javafx 💀

dusky harness
dusty frost
#

not

dusky harness
#

Oh 🥲

dusty frost
#

just use electron or smthn fr fr

#

or like bindings for gtk or qt

#

or just make a website fr fr

dusky harness
dusty frost
#

like java functions that call native code

#

in this case, gtk or qt

dusky harness
dusty frost
#

it will take you 5 minutes

dusky harness
dusty frost
#

if you don't know html or css, i'd be very impressed

#

it's very useful knowledge as a developer of any kind

dusky harness
#

¯_(ツ)_/¯

dusty frost
#

ya defo know web stuff

#

it's kinda huge

minor summit
#

you see, my problem with trying to learn web frontend is my lack of ideas and creativity

dusty frost
#

same honestly

#

that's why ui libraries exist!

minor summit
#

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

dusty frost
#

oh well yeah you just steal layout ideas

#

from other sites

minor summit
#

mm

leaden sinew
minor summit
#

No, that's me actually

#

You are 100% you

leaden sinew
#

No

dusky harness
#

Fisher == Emily

leaden sinew
#

I'm 100% you

minor summit
#

hm

#

okay

#

acceptance

leaden sinew
#

That's the first step

dusky harness
#

👏

shell moon
#

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)

minor summit
#

are you making an expansion and it's showing that or are you trying to use one?

shell moon
#

i made it and tried to test it, but it says that

minor summit
shell moon
#

its public and doesn't have any args

minor summit
#

is the class public too? thonk

shell moon
#

yes it is xD

minor summit
#

send the expansion class i guess? idk lol

#

?paste

neat pierBOT
#
FAQ Answer:

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

shell moon
#

i think something broke

#

never saw this issue before

#

i just ran /papi reload

minor summit
#

oh dear

shell moon
#

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 cat_cry

#

idk what i did, but happenst the same lol

minor summit
#

is it an expansion in plugins/placeholderapi/expansions? or is it one you register from within a plugin?

shell moon
#

no no, its an expansion extending PlaceholderExpansion

dense drift
dense drift
shell moon
#

i found the issue

#

however, i appreciate the intention peepoheart

dense drift
#

What was it?

shell moon
#

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

dense drift
#

Ah yes

#

If you keep getting the identifier in use error, downgrade to 2.11.2 or build what I sent

shell moon
#

i'm sure i won't get more, i checked the whole papi code related to registration

#

and i figure out that xD

#

thanks

dense drift
#

Np

dense drift
#

and stick to one channel.

nimble vale
#

does anybody have ever tried and achieved to run a jar file in github actions

dense drift
#

run?

nimble vale
#

like java -jar as a shell command

#

i know the idea is not ideal

dense drift
nimble vale
#

i setup the java project in another repo

#

so thats seems convenient but make things hard for developing this

river solstice
#

you just wanna build it or actually run it

#

because it won't run on it

nimble vale
#

i achieved to build and upload the artifact

#

and then downloaded the artifact from that repo

#

but couldn't achived to run it

dense drift
#

so you depend on another project that is hosted on a different repo and you need it for the second project?

nimble vale
#

it says Error: Could not find or load main class but the same repo same command works perfectly on local

#

yeah actually

dense drift
#

can you not publish the first one to a maven repo first?

nimble vale
#

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

dense drift
#

what would you accomplish by running the workspace on gh actions?

river solstice
nimble vale
#

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

dense drift
#

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
nimble vale
#

maybe i can just clone it temporarily inside the gh actions

#

fetching updates does not seems convenient

#

great idea

dense drift
#

also, make sure there is an action that lets you upload stuff to drive 🤣

nimble vale
#

yeah i checked that

#

actually there is

nimble vale
#

thanks did it

#

took a while to figure out

dense drift
#

Nice

frigid copper
#

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?

frigid copper
#

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

forest jay
minor summit
#

when a pig spawns, place water sunglasso

nimble vale
#

i think they want to cancel mob spawn on a spawner spawns an animal like a pig if the animal is not in water

spiral mural
#

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

thin tendon
#

working on a simple plugin to learn how to make plugins, what is some simple stuff I could add to it?

worn jasper
#

what's a simple plugin lmao

dusky harness
dusky harness
thin tendon
#

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);
}```
thin tendon
#

idk if it's cheating doing the challenges with ChatGPT as a bit of help 😄

minor summit
#

eh

#

chatgpt is expressively designed to be, basically, a bullshit generator

#

much preferred to ask real people for help

leaden sinew
#

Real people like Tony

thin tendon
tired olive
#

not rly

#

if you ask it to do anything that hasnt been done before it wont be able to

river solstice
#

yes, that's how language models work

#

🥴

tired olive
#

yeah thats what i just said

hazy nimbus
#

I mean, it's also how humans work

#

pretty much

icy shadow
#

speak for yourself

sterile hinge
#

also highly depends on what you mean with "hasnt been done before"

tired olive
icy shadow
#

i can do something that hasnt been done before

sterile hinge
#

ChatGPT can do that too

hazy nimbus
#

That's what I meant

#

ChatGPT composes it's answers from what it has seen before

tired olive
#

whatever u get what i mean

dense drift
#

BM can make the impossible, possible

forest sundial
#

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

sterile hinge
#

What does "not working" mean

forest sundial
#

i mean the potions.yml exists in the jar

forest sundial
#

if i try to get a list the the list size is 0

sterile hinge
#

That’s not how you load data from the jar

forest sundial
#

save it first?

#

then load it?

sterile hinge
#

Probably, depends on your goals

tired olive
forest sundial
#

or should I write in german? xD

sterile hinge
#

saveResource or something like that

forest sundial
#

I'll look into it. Danke

signal grove
sterile hinge
#

well people did that for years already

minor summit
#

yeah you'd know

edgy monolith
#

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

sonic nebula
sonic nebula
# thin tendon GPT4 is actually pretty good 😄

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 .

hoary scarab
#

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.

sonic nebula
#

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

sterile hinge
#

ChatGPT is not a calculator

sterile hinge
sonic nebula
#

are different

sterile hinge
#

you said you asked it to do calculations :)

lusty thunder
#

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

GitHub

Contribute to cj89898/ResourceGens development by creating an account on GitHub.

thin tendon
thin tendon
sonic nebula
thin tendon
#

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);
}

}```

sonic nebula
#

wtf is this

#

Class is a object i asome

#

oh interface

thin tendon
#

For selecting between different classes (stuff like mages, warriors and etc)

#

And each clears your inventory and gives you a sorta kit

sonic nebula
#

so i assume u use sperate class for every class and implement createInventory settings player inventory?