#help-development

1 messages Β· Page 982 of 1

icy beacon
#

ray tracing is, well, tracing a ray from one point with an angle and seeing where it intersects other objects

#

shouldn't even be a gigabyte

robust pebble
#

nice grammar

icy beacon
#

ty i'm not a native

remote swallow
#

reported

robust pebble
#

πŸ’€

sterile token
robust pebble
proud badge
#

bruh all of this for just modifying 2 lines of code

remote swallow
#

nice vencord

robust pebble
#

not vencord

remote swallow
#

message logger doesnt exist for better discord anymore

#

is it venclient

robust pebble
icy beacon
quaint mantle
#

why TabCompleteEvent not working ?

icy beacon
undone axleBOT
#

"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.

quaint mantle
#

well

#

πŸ˜„

robust pebble
#

anybody know tutorials on how to use offline manager api

icy beacon
#

i'm going back to my geometry homework have fun coding yall

quaint mantle
#

i tried to use tabcompleter and i did this not worked

    @EventHandler
    public void onTab(TabCompleteEvent e) {
        e.getCompletions().clear();
        e.setCancelled(true);
        e.getSender().sendMessage("test");
    }```
proud badge
#

ok I did it, now how do I add it to the project? it doesnt specify

quaint mantle
robust pebble
#

it allows u to manage people who r offline rn

#

in the server

icy beacon
robust pebble
#

but have joined

proud badge
#

ok

quaint mantle
robust pebble
#

yeah

quaint mantle
#

omg

#

thnks for tell me

#

πŸ˜„

robust pebble
#

uh sure

quaint mantle
#

btw this guys don't support offline πŸ˜„

tidal kettle
#

hey i have a problem, i create a world with WorldCreator but when i restart my server, the world folder exist but the server say the world didn't exist. any idea why?

quaint mantle
#

can i create worldgen

#

with this ?

tidal kettle
#

ye

quaint mantle
#

custom structures

#

blocks

#

omg

#

thx

tidal kettle
#

idk

#

lol

icy beacon
robust pebble
tidal kettle
#

i just know you can create world

icy beacon
quaint mantle
#

but

#

i can make world gen

#

or change

#

biome blocks

robust pebble
#

it makes another world kinda like bungeecord

quaint mantle
#

with custom datas ?

#

example can i change river clays to bedrocks ?

robust pebble
#

so u can have multiple minigames

icy beacon
#

you'll need to hook into the bukkit world generation for that and create your own generator or modify an existing one iirc, don't ask me, i've never done it

icy beacon
#

custom blocks are just not possible altogether unless you're doing hacky shit

undone axleBOT
#

It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.

icy beacon
#

?notworking

undone axleBOT
#

"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.

quaint mantle
#

aight

tidal kettle
#

okay wiat

#

?paste

undone axleBOT
robust pebble
#

but thats too much work

#

just download fabric πŸ’€

tidal kettle
#

the error and after the code

icy beacon
#

second of all

#

?whereami

tidal kettle
#

but

#

?paste

undone axleBOT
tidal kettle
#

the code of the creation for the world

sterile token
#

remember that Paper is not maintened by Spigot community

tidal kettle
#

but really i'm sorry but i don't understand why the world folder exist and the server dont detect the world

icy beacon
#

your code is being run on paper software

tidal kettle
#

o

#

i'm so sorry

icy beacon
#

we cannot guarantee that the behavior is identical

tidal kettle
#

i didn't know that...

icy beacon
#

please ask this in the paper discord or run this on spigot

tidal kettle
#

okay i'm very sorry ...

icy beacon
#

dw

icy beacon
lilac vector
#

eh ig

icy beacon
#

an actual custom block will not just hijack legitimate block states

sterile token
#

why dont use custom models data?

lilac vector
#

dont exist on blocks

sterile token
#

oh okay, i dint know sorry

#

why tho?software limitation or tireness

icy beacon
#

idrk

robust pebble
#

just use mods at thsi point

sterile token
lilac vector
sterile token
#

right thanks kebbil

lilac vector
robust pebble
#

but is it worth it

lilac vector
#

yeah

robust pebble
#

aight whatever floats ur boat

icy beacon
robust pebble
#

πŸ’€ u really looked at that

icy beacon
#

was curious about you a bit

#

what's your 333 pb

robust pebble
#

just got back into cubing

#

trying to relearn some of my zbll algs

icy beacon
#

i don't cube much nowadays too bc exams

icy beacon
#

single

robust pebble
#

peak ~20

icy beacon
#

wait you know zbll while solving 20

#

you're gonna be insane

robust pebble
#

like i said I had a dogwater cube

icy beacon
#

i average 13 and pb is 7.71 and i am too lazy to even learn coll

robust pebble
#

and skills

icy beacon
#

i only know like 10-15 cases

robust pebble
#

oh dang

icy beacon
#

during summer i want to wrap it up with coll ngl

#

not that coll

robust pebble
#

i learnt like 2 look at 45

icy beacon
#

anyway i'll proceed with my geometry hw so you have fun

icy beacon
robust pebble
#

lol

hazy parrot
#

Tf are those zbll and coll

#

While I was solving best was 1 look oll and pll

sterile token
#

not related to coding itself but what platforms do you use for personal project managing? Meaning by managing to centralize all the project documentation, tasks tables, flow or usage diagrams, screens in case it has and many other things a project can have. I seen most people use Jira, but i would like to know what alternatives have you used and your opinion if there is no problem

icy beacon
# robust pebble oh i have the same hw too

btw i've developed a mobile app for algorithm learning as a school project so if you want you can download it, the algorithms are updated dynamically (pulled from a db) so you won't need to update the app everytime to fetch new ones, it's inspired by speedcubedb so there's also a rating system. it's called cubinghub and it's on google play store and is also open source

soft spire
#

Can someone help me with this? I'm trying to create a snowman but Snowman.class is giving an error in my IDE ```
package org.timothy.more_mobs.commands;

import org.bukkit.Bukkit;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.entity.Snowman;

import java.util.Objects;
import java.util.logging.Level;
import java.util.logging.Logger;

public class SnowGolem implements CommandExecutor {

public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
    if (!(sender instanceof Player)) return false;
    Player player = (Player)sender;
    Logger logger = Bukkit.getLogger();

    if (args.length == 1) {
        if (Objects.equals(args[0], "snow_golem")) {
            Snowman snowman = player.getWorld().spawnEntity(player.getLocation(), Snowman.class);
        }
    }

    return true;
}

}

alpine urchin
icy beacon
robust pebble
#

u used android studio ?

icy beacon
#

coll allows to bring any oll that has a cross to an edge-swap pll

icy beacon
#

learnt a shit ton of new stuff with this project

sterile token
icy beacon
#

in that regard it is quite intuitive yes

#

i mostly enjoy its tags system

robust pebble
# icy beacon yep

th eonly thing ive been programming lately is just robots πŸ’€

icy beacon
sterile token
#

oh right, i was planning to start using it to manage a "big project" for the momment as personal, but in future maybe has collaborators

#

because i find i do things better if i do all the documentation, tables of tasks, features, etc before coding it. My knowledges works better when i do that strict type of organization

hazy parrot
robust pebble
#

infinity

#

idk like 500

icy beacon
#

i'll be adding it to cubinghub next

warm mica
#

Can anyone explain what benefit components bring, I sincerely don't get it. Literally the same thing as NBT with the only difference that it breaks everything

icy beacon
#

Please ping me if somebody explains

#

Also wanna know tbh

young knoll
#

Also options for data driven stuffs

icy beacon
warm mica
#

It's not even that the parsing is any faster, it still uses NBT for some entries

young knoll
#

It gets saved to nbt

#

But it should all be parsed and held in memory

warm mica
#

Pretty sure it was before that already (maybe not on client idk). And if it wasn't, they could've just used NBT tags as well

warm mica
eternal night
#

well

#

think of it that way, before, whenever an item had to read something from its NBT it had to basically just go through a map-like structure. Think your YamlConfiguration.

#

now it parses it all at the start into nice java representations with proper methods etc.

warm mica
#

I understand, but they could've accomplished the same with NBT. They literally use nbt for some of their tags

eternal night
#

which means it can use these values a lot more efficiently. Which is why you can now have things like max stack size or whatever defined in there

#

Well, they could have stuck with SNBT format but given the entire rest changes you'd still need to adopt it

#

this way it at least errors nicely

warm mica
#

the entire rest changes
You mean the values that the tags themselves represent? They are already breaking them with basically any update

#

I think there are like 3 different tags to display a Display Name between versions 1.8 and 1.20, lol

eternal night
#

Yea, but that was in small increments

#

this would have broken everything anyway

#

even if they stuck to the SNBT format

#

which would have also been annoying for tab completion tbh

#

e.g. now brigadier can tell you if a component value is valid

warm mica
#

The new tab completion is actually cool, but they probably could have accomplished the same with SNBT. I always thought that components were the new SNBT, but they are just wrapping them, and the parts where you still have to use SNBT don't get autocompleted. Ipo they create more confusion than they actually benefit

sterile token
#

So in conclusion mojang did all this mess with different tags just because of 5mb better in cpu, ram and disk?

eternal night
#

Well no

#

As Coll said, this is also terribly important for down the line data driven stuff

#

because now you bind features of items to components instead of their type

sterile token
#

i mean i dont understad the why of all this mess

eternal night
#

e.g. the food properties

#

the concept of "food" is now not bound to the ItemType of food

#

its bound to the food item component

#

doing the same in a NBT map would be absolutely horrible performance and data validation wise

warm mica
#

I mean, that's just the internal part. They could have accomplished the same while sticking to the same format

eternal night
#

Oh, yea I guess

#

frontent wise they could have

#

But like, they have been sticking to their new naming convention for a while

#

a good amount of stuff changed too, just in format

#

if there was a release to move this to a format they like more, it is now OMEGALUL

quartz basalt
#

is it possible to make a textdisplay visible from both sides, not just 1?

warm mica
#

That's what I mean. I'd be cool if they broke them for your given reason, but the new format that still persists of the "old" format is just confusing lol

eternal night
#

Welllll

#

yea

#

With some of the things I 100% agree

#

the command syntax is a bit tricky

warm mica
#

Anyways, I have found a way to convert the legacy NBTs over to the new components. Not sure whether it's worth contributing that as a neat helper method to Spigot

eternal night
#

idk why plugins would care KEKW

warm mica
#

It's pain if you are trying to support versions starting from 1.8.8 (yes I understand you shouldn't)πŸ˜„ I am using this so that I don't have to re-do all configurations for the newer versions

eternal night
#

But why would a plugin be running commands o.O

warm mica
eternal night
#

ah

stoic tapir
#

can someone help me underestand plugins?

warm mica
#

To make the moving as fluent as possible, I am storing the original nbt string within a component (as it's not possible to encode to the legacy nbt format) and re-use it whenever the item gets serialized (e.g. when an update changes the config files). Probably more hassle than it's worth, considering that I doubt many other plugins are going to do that. But it'll at least make the debuggin for me a lot easier, as I jump between versions a lot

vast ledge
stoic tapir
#

plugin developement like:
working with API's
Setting up an project

#

since i can learn java easily

#

i just have problems with API's n stuff

stoic tapir
#

thats not what you want?
then just create another text display rotated 90* On the X Axis

vast ledge
stoic tapir
vast ledge
#

Read there docs

icy beacon
#

their

stoic tapir
#

already read

#

I Gotta use maven or gradle

#

Used maven

#

gave me an error

vast ledge
#
API

Citizens has an extensive API for working with NPCs. Make sure you always are using an up-to-date build of the CitizensAPI to ensure that your plugin works with the latest release of Citizens.

icy beacon
#

what error

stoic tapir
#

gradle is just broken

robust pebble
#

gradle is indeed better

stoic tapir
vast ledge
#

Gradle is better

icy beacon
#

gradle ftw true

#

it speeds up my kotlin compile times so much

vast ledge
icy beacon
#

^

stoic tapir
#

k lemme open up Itel

warm mica
icy beacon
vast ledge
#

wdym?

icy beacon
#

you know twitter x community notes

vast ledge
#

ah

#

those

stoic tapir
#

its still Twitter πŸ€“

vast ledge
stoic tapir
icy beacon
#

it's still garbage

#

tjhat's all i care about

stoic tapir
quartz basalt
#

then only 1 player would constanlty see it

stoic tapir
#

:\

stoic tapir
#

no embed 😭

quartz basalt
#

ok thanks

vast ledge
#

@stoic tapir Got the error for us?

stoic tapir
#

im loadin

#

running package task

#

oh god it works

vast ledge
#

.-.

robust pebble
#

i have created a custom yaml file but i want to write to it

stoic tapir
#

unless

robust pebble
#

like this

Suffix : [Template Plugin]

stoic tapir
#

k nvm i guess it was an internet connection issue

#

thanks

quartz basalt
#
        display.setText(message);
        display.setInterpolationDelay(-1);
        display.setInterpolationDuration(0);
        display.setLineWidth(lineWidth);
        display.setBackgroundColor(backgroundColor);```
its still visible from 1 direction, i didnt include the scale part because i use scale to modify the size of the text display
robust pebble
#

?paste

undone axleBOT
quartz basalt
stiff sonnet
#

which event is called when I'm taking fall damage? I might be wrong but an EntityDamageByBlockEvent doesn't seem to trigger

young knoll
#

EntityDamageEvent

stiff sonnet
#

is tehre a way to easily distinguish that from an entityDamageByEntity event though? I have that one too but they must not both execute from the same type of damage

young knoll
#

Check the cause

teal spear
#

I am having an issue building with Maven against the newest (1.20.5) NMS version. I downloaded Java 21 from Azul, java --version confirms that. I ran buildtools (--rev 1.20.5 --remapped) and it shows up in IntelliJ (IntelliJ IDEA 2023.2.6) just fine. I have a multi-module project (different NMS/java versions per module), and I set the Java version for the latest module to 1.20.5 in Module settings. Nonetheless, when I try to Maven build, it throws hundreds of errors, along the line of "cannot find symbol", "package does not exist" or "cannot access". I am using Apple Silicon btw. Does anyone recognise this/know how to fix this?

stiff sonnet
#

I need the damager

#

and like to avoid having two events do basically the same thing

covert pond
#

?paste

undone axleBOT
acoustic pendant
#

Hey, how can i check if the server is 1.16 or above?
Is this a great way of doing it?

        if (Double.parseDouble(Bukkit.getVersion()) <= 1.16) {
            //code
        }```
covert pond
acoustic pendant
stiff sonnet
#

(there is no plugin variable)

covert pond
#

and take away the (plugin) or replace it with this

acoustic pendant
covert pond
#

alright ill try that

vast ledge
#

Why are you even passing plugin into an event??

acoustic pendant
#

that's true lol

vast ledge
#

Bukkit.getVersion() returns Spigot-1.16-2905

#

or smth

acoustic pendant
#

uuh

#

how can i do it then?

robust pebble
#

customConfig.set(Constants.YAML.SUFFIX_KEY,Constants.DEFAULT_SUFFIX); is this fine for setting up yaml file

covert pond
#

Expected 2 arguments but found 1 i recive that error after replacing plugin with this

young knoll
#
 public static String getServerVersion() {
        String version = Bukkit.getServer().getBukkitVersion();
        if (version.contains("-")) {
            return version.substring(0, version.indexOf('-'));
        }

        return version;
    }
#

Tis what I use, not 100% sure how backwards compatible it is tho

acoustic pendant
vast ledge
#

a number

acoustic pendant
#

i mean yea

young knoll
#

A string

acoustic pendant
#

xd

#

Spigot-1.16-2905

young knoll
#

ie "1.20.4"

acoustic pendant
#

it will return 1.16?

#

I haven't used the substring method so yea

young knoll
#

?tas

undone axleBOT
acoustic pendant
#

okay okay

sage dragon
#

So... How would I check if an item can actually receive damage?


if (!(itemMeta instanceof Damageable damageable))
    return;

System.out.println(itemStack.getType().name() + " is damageable!");

Because this code will ouput STICK is damageable!

young knoll
#

All items are damagable

#

Especially now

#

What version are you on

chrome beacon
#

Damageable#hasMaxDamage

#

ig

young knoll
#

nah just Material#getMaxDamage

#

iirc

chrome beacon
#

but what if the item has the damage component

#

or whatever it is

sage dragon
#

Testing this on 1.20.5, which has the new Component system

sage dragon
young knoll
#

Yeah that one

#

But on 1.20.5 you'll need to check for the custom component

sage dragon
young knoll
#

Looks like you just use damagable and hasDamage

sage dragon
#

Hmmmm, seems like spigot's api only has the FoodComponent so far πŸ˜…

young knoll
#

What about hasMaxDamage

robust pebble
#

?paste

undone axleBOT
sage dragon
robust pebble
#

im getting this error when creating a YAML file

#

custom configuration

#

i followed the page on the forums

chrome beacon
#

The error does say what the issue is

sage dragon
young knoll
#

Should be

#

At least when looking at the implementation

robust pebble
chrome beacon
#

yeah

#

Start by reading it

#

and then give us more information on how you tried to include the file

sage dragon
sage dragon
young knoll
#

It might only apply to items with the custom components

#

Idk how the default damagable items work with it

sage dragon
#

Well, for now, I'll do this:

if (craftedItem.getType().getMaxDurability() <= 0 && !damageable.hasMaxDamage())
     return;
robust pebble
chrome beacon
#

Copy pasting the same question over and over again

#

and then ignoring the response isn't going to help

covert pond
#

?paste

undone axleBOT
covert pond
#

https://paste.md-5.net/mihesonoka.java

im trying to get it where when a player gets hit by the arrow they will get teleported out of the game and have the bow and arrows cleaerd from thier inventory but non of this is working when i go and test it by shooting an arrow in the sky and letting it hit me

robust pebble
#

did u register ur listners

covert pond
#

um

robust pebble
#
this.getServer().getPluginManager().registerEvents(new PlayerJoin(), this);
#

replace PlayerJoin() with ur class name

covert pond
#

alr thanks ill try that

robust pebble
#

put it in onenable

#

in ur main file

#

PaintballEventListener(param a, param b)

#

its better to make getMethods instead of constructors its a whole lot easier for me

#

some people call it getters

covert pond
#

hm ill have to look into that. im still training myself πŸ™‚

robust pebble
#

aight have a good day

alpine urchin
#

good evening 1.20.5 enjoyers

#

are we enjoying the new component code

eternal night
river oracle
#

Idk haven't done the nms yet

#

Finals had me bogged down

#

I'm sure it's great

sullen marlin
sullen marlin
tidal kettle
#

how can i add a list of string in my code like this

sullen marlin
#

config.set("test", <list>)

tidal kettle
#

oo

#

I knew about maps, but not this one. thx πŸ˜„

sullen marlin
#

sorry I misread your code

#

what are you trying to do

quartz basalt
#

im trying to make a textdisplay above a players head that can be seen from all directions

sullen marlin
#

is that setBillboard or whatever?

quartz basalt
#

doesnt that just anchor it where it is?

sullen marlin
#

it makes it turn towards each player

quartz basalt
#

oh

sullen marlin
#

which sounds like what you mean by all directions

quartz basalt
#

probbably ill try it thanks

#

uhhh id assume its billboard.center?

sullen marlin
#

something like that

alpine urchin
#

are the breaking nms changes to component, and etc also in spigot

#

or is it only a paper thing

river oracle
#

What

#

Api didn't break

rigid spire
#

do brewing stands have any API for recipes or something similar?

river oracle
#

I doubt paper just hard forked either

alpine urchin
#

NMS is not API

river oracle
river oracle
#

We didn't retain legacy nms

slender elbow
#

lol

river oracle
#

I get spigots pretty "legacy" but Jesus man

#

Have some faith

alpine urchin
#

Well, in the past spigot retained the old NMS packet class names

#

for whatever reason

river oracle
#

Class names

alpine urchin
#

that's the reason behind the question

slender elbow
#

and the packets that mojang then removed spigot also removed

#

but the class names is a different case

alpine urchin
#

i am talking of class names

#

a class name change is a breaking change also

#

whatever man

slender elbow
#

yes but that wasn't a mojang change

sullen marlin
rigid spire
#

this may be a dumb question, but is there any way to tell a potion has been amplified/upgraded? I see API for org.bukkit.potion.PotionType#isUpgradeable and org.bukkit.potion.PotionType#isExtendable, but I'm not seeing anything along the lines of isUpgraded/isStrong or isExtended/isLong? I know you could infer this from the name of the PotionType, but are there any other indicators? Trying to have some compatibility with older versions that are missing those PotionType entries that have the Long and Strong as part of their name

Hope this question makes sense 🫑

sullen marlin
#

don't think so

#

it was t00thpick1, who I think was mcmmo at the time, who added this API

#

ask him πŸ™‚

#

what are you trying to do?

rigid spire
#

t00thpick1 took a permanent vacation from Minecraft dev last time I checked

#

mostly mcMMO had some logic to increase XP gained if the potion was long/strong

#

was trying to figure out how to do that in a way that'd be compatible with 1.20.5 and versions before it

sullen marlin
#

given there's no association between the different effects aside from name, any implementation would just do startswith(long/strong)

#

for strong ones I think they all have a higher amplifier, but that would deem turtle master as strong

rigid spire
#

I see, so I might need to manually create a table of what their amplifiers are at "normal" levels, and consider anything above that to be strong

sullen marlin
#

I'd probably go the startsWith approach tbh

rigid spire
#

Ah I'm probably misunderstanding something then, would that be a startsWith on the PotionType enum? or some other value?

#

oh wait couldn't I just checked the namespaced key?

sullen marlin
#

yes

quartz basalt
#

is it possible to add offset to a passenger entity? like have an armorstand act as a passenger but 3 blocks above the players head for example?

rigid spire
#

thanks for the help 🫑

eternal night
#

?nms

mellow snow
#

Hello, I create an expansion for Placeholder api for create a custom placeholder to use in TAB. Idk why it doesn't work.
Here's my plugin:

public class CustomPlaceHolder extends JavaPlugin implements Listener {
    private HashMap<String, Boolean> presidentiOnline = new HashMap<>();

    @Override
    public void onEnable() {
        getServer().getPluginManager().registerEvents(this, this);
        new PresidentePlaceholderExpansion().register();
    }

    @EventHandler
    public void onPlayerJoin(PlayerJoinEvent event) {
        Player player = event.getPlayer();
        if (player.hasPermission("group.presidente")) {
            presidentiOnline.put(player.getName(), true);
        }
    }

    @EventHandler
    public void onPlayerQuit(PlayerQuitEvent event) {
        Player player = event.getPlayer();
        if (player.hasPermission("group.presidente")) {
            presidentiOnline.remove(player.getName());
        }
    }

    public int getPresidentiOnlineCount() {
        return (int) presidentiOnline.values().stream().filter(value -> value).count();
    }

    public class PresidentePlaceholderExpansion extends PlaceholderExpansion {

        @Override
        public boolean canRegister(){
            return true;
        }

        @Override
        public String getAuthor(){
            return "mjicio";
        }

        @Override
        public String getIdentifier(){
            return "presidente_count";
        }

        @Override
        public String getVersion(){
            return "1.0.0";
        }

        @Override
        public String onPlaceholderRequest(Player player, String identifier){
            if(identifier.equals("player_presidente_count")){
                return String.valueOf(getPresidentiOnlineCount());
            }
            return null;
        }
    }
}```
remote swallow
#

the placeholder request identifier doesnt hav get identifier removed

mellow snow
teal spear
#

Trying once more as the previous one got buried: I am having an issue building with Maven against the newest (1.20.5) NMS version. I downloaded Java 21 from Azul, java --version confirms that. I ran buildtools (--rev 1.20.5 --remapped) and it shows up in IntelliJ (IntelliJ IDEA 2023.2.6) just fine. I have a multi-module project (different NMS/java versions per module), and I set the Java version for the latest module to 1.20.5 in Module settings. Nonetheless, when I try to Maven build, it throws hundreds of errors, along the line of "cannot find symbol", "package does not exist" or "cannot access". I am using Apple Silicon btw. Does anyone recognise this/know how to fix this?

river oracle
#

I think ur nms broken Jr

#

You gotta update it every version

wise mesa
#

the package changes with every minecraft release

#

idk this might not be your error but

#

you'd have to provide more if that doesn't help

robust pebble
#

I have a command called reloadtp and when I run it via console it says /reloadtp

eternal oxide
#

?nocode

undone axleBOT
#

It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.

robust pebble
#
@Override
    public boolean onCommand(CommandSender commandSender, Command command, String s, String[] strings) {
        if(commandSender.isOp()){
            commandSender.sendMessage(getPrefix()+"Starting reload please stand by...");
            main.reloadConfiguration();
            main.reloadConfig();
            commandSender.sendMessage(getPrefix()+"Reload Successful!");
        }else{
            commandSender.sendMessage(getPrefix()+"You do not have permission to run this command!");
        }
        return true;
    }
#
this.getCommand("tellme").setExecutor(new Say());
        this.getCommand("reloadtp").setExecutor(new Reloadtp());
eternal oxide
#

you don't use / in console commands

robust pebble
#

i dopnt

#

i write

#

reloadtp

#

and it says /reloadtp

eternal oxide
#

you can;t set two executors for the same command

robust pebble
#

theyre diffrent?

eternal oxide
#

oh I see

robust pebble
#
  tellme:
    description: says whatever you tell it to
    usage: /<command> <the thing you want the server to tell you>
  reloadtp:
    description: reloads this plugins configuration (PERMISSIONS --> OP)
    usage: /<command>
#

?paste

undone axleBOT
robust pebble
#

but whenever i do reload I get this

eternal oxide
#

you can not extend JavaPlugin in more than one class

robust pebble
#

only one class extends javaplugin

#

but I do use Main main = new Main();

#

im guessing thats the problem

eternal oxide
#

then you can not do new YourPlugin

robust pebble
#

aight

#

imma make a getter

eternal oxide
#

?di

undone axleBOT
robust pebble
#

aight i did the constructer thingy

#
Main m;
    public Reloadtp(Main main){
        m=main;
    }
#

aight should this work

#

i tried it

#

and it gave me error

eternal oxide
#

it should work, so long as you passed (this)

robust pebble
#

this.getCommand("reloadtp").setExecutor(new Reloadtp(this));

eternal oxide
#

yep

robust pebble
#

imma completly restart the server

#

?paste

undone axleBOT
robust pebble
#

heres my error

eternal oxide
#

you are still using new Main() somewhere

#

main.java line 13

robust pebble
#

aight

#

Wait i cant use Main in my own class?

eternal oxide
#

you can not instance Main

#

There will only ever be one instance of Main and thats created by Spigot

robust pebble
#

oh

#

so I can only use this

eternal oxide
#

yes

#

or the reference you pass using DI

robust pebble
#

interesting

robust pebble
eternal oxide
#

Dependency Injection

robust pebble
#

just call it constructer

eternal oxide
#

You are referring to the Constructor of an Object, the action of passing a dependency is DI

robust pebble
#

oh i c

cold tartan
#

Does anyone have any experience with a PDC not being "persistent". I'm setting a value in a chest's pdc and the value is correct when I check the same instant I set it, but its gone when I check it later

cold tartan
# drowsy helm can we see your code

The reason I didn't give code initially is because I have a PDC manager class, fyi I know PersistentDataType.BOOLEAN exists but I was ruling that out as an issue atm

This prints true: ```java
PersistentDataManager.set("is-rpg-chest", chest, PersistentDataType.STRING, "true");
RPGFeatures.sendConsole(Component.text( PersistentDataManager.get("is-rpg-chest", chest, PersistentDataType.STRING, "false")));


Then a little bit later this prints false:
```java
RPGFeatures.sendConsole(Component.text(PersistentDataManager.get("is-rpg-chest", chest, PersistentDataType.STRING, "false")));
drowsy helm
#

why arent you using NamespacedKey?

cold tartan
#

I am, its managed within the pdc manager

#

oh wait this is very unclear i realized mb

#

lemme give more context

drowsy helm
#

show PersistentDataManager class

cold tartan
#

yueah

#
public class PersistentDataManager {

    public static <T> T get(String id, PersistentDataHolder holder, PersistentDataType<T, T> dataType, T defaultVal) {
        PersistentDataContainer pdc = holder.getPersistentDataContainer();
        NamespacedKey key = NamespacedKeyManager.getKey(id);
        if (!pdc.has(key))
            pdc.set(key, dataType, defaultVal);
        return pdc.get(key, dataType);
    }

    public static <T extends Integer> T get(String id, PersistentDataHolder holder, PersistentDataType<T, T> dataType, T defaultVal) {
        PersistentDataContainer pdc = holder.getPersistentDataContainer();
        NamespacedKey key = NamespacedKeyManager.getKey(id);
        if (!pdc.has(key))
            pdc.set(key, dataType, defaultVal);
        return pdc.get(key, dataType);
    }

    public static <T> boolean has(String id, PersistentDataHolder holder) {
        PersistentDataContainer pdc = holder.getPersistentDataContainer();
        NamespacedKey key = NamespacedKeyManager.getKey(id);
        return pdc.has(key);
    }

    public static <T> void set(String id, PersistentDataHolder holder, PersistentDataType<T, T> dataType, T val) {
        PersistentDataContainer pdc = holder.getPersistentDataContainer();
        NamespacedKey key = NamespacedKeyManager.getKey(id);
        pdc.set(key, dataType, val);
    }
}
#

I can put that in a pastecode thing if its easier to read

worldly ingot
#

Did you update the BlockState after you applied the key to the persistent data container?

#

I believe you need to do that for block states

cold tartan
cold tartan
#

i didnt

drowsy helm
#

yeah sounds like you're not applying it after the fact

cold tartan
#

ok lemme try that ty

drowsy helm
#

don't think this is a good idea either


    public static void initialize(JavaPlugin javaPlugin) {
        plugin = javaPlugin;

        generateKey("is-rpg-chest");
        generateKey("testing-key");
    }
#

unless you are initialising after onEnable?

cold tartan
#

im doing it in onEnable

drowsy helm
#

should be fine then

cold tartan
#

tysm it works now

#

one line lol

#

chest.update();

drowsy helm
#

choco ftw

cold tartan
#

fr

#

ive been helped so much by them

#

i took like 1 year break from plugins so ig im a bit rusty

worthy yarrow
#
@Override
    public void onPacketSending(PacketEvent packetEvent) {
        if (packetEvent.getPacketType() == PacketType.Play.Server.NAMED_SOUND_EFFECT) {
            PacketContainer packet = packetEvent.getPacket();
            Sound soundEffectType = packet.getSoundEffects().read(0);
            
            if (soundEffectType != null && soundEffectType.equals(Sound.ENTITY_WITHER_AMBIENT) || soundEffectType != null && soundEffectType.equals(Sound.ENTITY_WITHER_SPAWN)) {
                if (SuppressorToggleCommand.getInstance().getPlayersToggledWitherSound().contains(packetEvent.getPlayer())) {
                    packetEvent.setCancelled(true);
                }
            }
        }
    }

I know this is incorrect, but how do I figure if the packet sound is that of sounds the wither makes

ivory sleet
#

^ think thats a good starting point

#

not sure what version u're on, but there should be an entity sound event packet or sth

worthy yarrow
#

So I'm not sure where to actually find the sound within the packet being sent

#

I lied I just had to read

ivory sleet
#

πŸ₯²

worthy yarrow
# ivory sleet πŸ₯²
@Override
    public void onPacketSending(PacketEvent packetEvent) {
        if (packetEvent.getPacketType().equals(PacketType.Play.Server.ENTITY_SOUND)) {
            PacketContainer packet = packetEvent.getPacket();
            System.out.println("Listener test");
            for (Sound sound : packet.getSoundEffects().getValues()){

                switch (sound){

                    case ENTITY_WITHER_AMBIENT:
                    case ENTITY_WITHER_SPAWN:
                    case ENTITY_WITHER_BREAK_BLOCK:
                    case ENTITY_WITHER_DEATH:
                    case ENTITY_WITHER_HURT:
                    case ENTITY_WITHER_SHOOT:
                        if (SuppressorToggleCommand.getInstance().getPlayersToggledWitherSound().contains(packetEvent.getPlayer())){
                            packetEvent.setCancelled(true);
                            System.out.println("Wither noise cancelled");
                        }
                        break;

                    default:
                        System.out.println("Not wither sound");
                        break;
                }

            }
        }
    }```

Sigh I still don't get it D: (none of the debugs are printing nor are the sounds getting cancelled)
vital ridge
#

My code throws a "failed to deserialize object" error when I'm trying to print out the location: https://paste.md-5.net/wuzaqamona.cs
Here are my deserialization and serialization methods: https://paste.md-5.net/ekupejapit.js
The error points to #deserialize() line 17 where I'm reading the object. Idk what could be wrong honestly I have a similar class where I use persistentdata with the same serialization methods and it works perfectly.

glad prawn
lilac dagger
#

is your supreme spawner that ^

vital ridge
vital ridge
#

With pretty much the exact same code, I just don't understand why it doesn't work with SupremeSpawnerBlocks

#

SupremeSpawners are associated with itemstacks and SupremeSpawnerBlocks are associated with blocks so thats the difference if you are wondering.

lilac dagger
#

are you using bukkit output stream to serialize?

vital ridge
#

Yep.

#

I'll show the DataType class

lilac dagger
#

supreme data type doesm't seem to implement configuration serializable

#

i'm not sure if persistent tags are serialized

#

plus it has to have a deserialization block

vital ridge
#

But SupremeSpawner implements ConfigurationSerializable

#

Does the SupremeSpawnerPersistentDataType need to implement it aswell?

lilac dagger
#

yes

#

everything you serialize has to be serializable

#

and it also has to have a valid deserialization block

#

i think a Map constructor

#

that's private

pseudo wraith
#

i have a minecraft server on an oracle ubuntu virtual machine
i was trying to install java 22 and when it finished it said "fatal error: connection timed out" and now I cannot access using any ssh software
on oracle cloud it says the vm is running
i need help please

tender shard
#

also have you tried simply rebooting? :p

pseudo wraith
#

I have tried rebooting

#

the online console asks for a login which I do not have

#

let me add an image

#

@tender shard

#

oh I cant

#

well

#
d
Password: 

Login incorrect
minecraft-server login: ubuntu
Password: 

Login incorrect
minecraft-server login: 
#

I did never set a login

#

LOL I ENTERED IT

#

so I can access the online console but I need to access the server using an FTP tool

#

how can I do it?

tender shard
tender shard
#

?img

undone axleBOT
#

Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.

Here's some screenshot utilities that you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org

teal spear
pseudo wraith
#

but I can only login to the vm using the cloud shell

#

not any SSH

teal spear
teal spear
trim lake
#

What speed is used when player is sprinting and jumping? I need to slow down that player. Im setting player movement speed but is not affecting sprinting and jumping. Its affecting only sprinting.

tender shard
tender shard
tender shard
pseudo wraith
#
root@minecraft-server:/home/satorras/server# systemctl status sshd
● ssh.service - OpenBSD Secure Shell server
     Loaded: loaded (/lib/systemd/system/ssh.service; enabled; vendor preset: e>
     Active: active (running) since Mon 2024-04-29 08:02:11 UTC; 24min ago
       Docs: man:sshd(8)
             man:sshd_config(5)
    Process: 804 ExecStartPre=/usr/sbin/sshd -t (code=exited, status=0/SUCCESS)
   Main PID: 846 (sshd)
      Tasks: 3 (limit: 21447)
     Memory: 6.7M
        CPU: 1.211s
     CGroup: /system.slice/ssh.service
             β”œβ”€ 846 "sshd: /usr/sbin/sshd -D [listener] 2 of 10-100 startups"
             β”œβ”€1593 "sshd: [accepted]" "" "" "" ""
             └─1606 "sshd: [accepted]" "" "" "" ""

Apr 29 08:24:12 minecraft-server sshd[1578]: Disconnected from invalid user VM >
Apr 29 08:24:15 minecraft-server sshd[1569]: fatal: Timeout before authenticati>
Apr 29 08:24:49 minecraft-server sshd[1585]: Received disconnect from 110.40.15>
Apr 29 08:24:49 minecraft-server sshd[1585]: Disconnected from authenticating u>
Apr 29 08:25:32 minecraft-server sshd[1596]: Invalid user jenkins from 110.40.1>
Apr 29 08:25:32 minecraft-server sshd[1596]: Received disconnect from 110.40.15>
Apr 29 08:25:32 minecraft-server sshd[1596]: Disconnected from invalid user jen>
Apr 29 08:25:47 minecraft-server sshd[1576]: fatal: Timeout before authenticati>
lines 1-23
tender shard
#

@teal spear TL;DR your project sdk has to be set to the "newest" java version that you need, so 21 in this case

tender shard
pseudo wraith
#

well it says

#

fatal time out before authentication

#

is that good?

#

ufw sounds familiar

#

i think i installed it

tender shard
#

obviously not. Please show the output of the following commands:

ufw status
iptables -L
pseudo wraith
#

okay

#

hey thank you so much for the helpo

tender shard
#

oh and this please:

cat /etc/ssh/sshd_config | grep -i port
tender shard
pseudo wraith
#

i really appreciate this

tender shard
#

that's what I'm here for

pseudo wraith
#
Status: active

To                         Action      From
--                         ------      ----
OpenSSH                    ALLOW       Anywhere                  
25565                      ALLOW       Anywhere                  
OpenSSH (v6)               ALLOW       Anywhere (v6)             
25565 (v6)                 ALLOW       Anywhere (v6)            
#

That's for UFW

tender shard
#

looks good - did you maybe change your SSH port?

pseudo wraith
#

its 22

tender shard
pseudo wraith
#

never changed it afaik hahah

tender shard
#

hmmm

#

mind DMing me the IP?

pseudo wraith
#

ill pastebin the port

#

oops

#

i meant the iptables log

tender shard
#

yep

#

?paste

undone axleBOT
pseudo wraith
tender shard
#

that looks good too

pseudo wraith
#

okay let me check for the port

tender shard
#

okay please try this: try to connect locally to ssh
enter this as root:

ssh localhost

does it ask for username/password?

grim hound
#

I have a field that's a normal class. How can I intercept it's methods' invocation?

tender shard
pseudo wraith
#
#Port 22
#GatewayPorts no
grim hound
#

Can I somehow create a Proxy class of that normal class and replace the field with reflection

grim hound
#

and delegate it to the actual methods if I want to invoke

grim hound
#

so nms class

tender shard
pseudo wraith
tender shard
grim hound
#

but I'll handle that

#

this one, which invokes JoinEvent

pseudo wraith
#

ok

#
yes
Warning: Permanently added 'localhost' (ED25519) to the list of known hosts.
tender shard
# grim hound `placeNewPlayer`

hm okay so the easiest way (imho) is to create a class that extends NMS PlayerList, then find out where it's instance is stored, and replace that using reflection with your own class. Your own class, as it extends PlayerList, will only have to implement that one single method you wanna change

tender shard
pseudo wraith
#

what do I input now?

grim hound
pseudo wraith
#

oh yes

tender shard
pseudo wraith
#
Permission denied (publickey).
tender shard
#

ah! looks like you disabled password auth

grim hound
tender shard
pseudo wraith
#

hmmm i don't recall doing that hahah

tender shard
grim hound
#

I just don't know how

pseudo wraith
#

how do I open that file? sorry I'm really new to all of this, trying my best

grim hound
#

can't I create a proxy class?

tender shard
tender shard
#

wasnt a proxy class my first suggestion? :p

grim hound
#

but everywhere I see list of interfaces

#

and this is a normal class

#

and I've never used Proxy

tender shard
#

you will still have to create one module per NMS version

tender shard
#

because of the stupid obfuscation

grim hound
#

I have a method that gets the class

grim hound
tender shard
#

how else would you know whether you need to override "a" or "b" or "c" or however that method is called?

grim hound
#

I can handle the rest

pseudo wraith
#

im not sure what to do

grim hound
#

gives you the method and args

#

can't I just recognize the method?

tender shard
grim hound
#

anyway gtg

pseudo wraith
#

thank you so much

tender shard
#

(I doubt it though)

pseudo wraith
#
# This is the sshd server system-wide configuration file.  See                  
# sshd_config(5) for more information.

# This sshd was compiled with PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/us>



# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented.  Uncommented options override the
# default value.

Include /etc/ssh/sshd_config.d/*.conf

#Port 22
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::
#HostKey /etc/ssh/ssh_host_ecdsa_key   ^U Paste     ^J Justify   ^/ Go To Line
tender shard
pseudo wraith
#

alright

tender shard
#

alternatively, you can DM me the IP and I'll see how far I'll get in 5 minutes

#

(gotta smoke first kek)

pseudo wraith
#

it says PasswordAuthentication yes

pseudo wraith
#

yo

#

it just fixed itself

#

the ssh works again

#

thanks! Idk what it was that fixed it but I tried now and it works

#

do you know what could have fixed it?

vast ledge
#

Your system, probably

azure dirge
#

Why packet in 1.20.4 not work ? I'm trying send particle packet to player but it did not appear, tested in 1.19.4 and it work fine but in 1.20.4 not work

tender shard
#

yeah you probably got self-banned by fail2ban

#

default is 60 minutes IIRC

undone axleBOT
#

It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.

tender shard
#

TL;DR: You NEVER need to use packets manually to send particles @azure dirge . There's API for that: Player#sendParticle (or spawnParticle), sth like that

#

same exists for World if you want to spawn particles for all players

azure dirge
# tender shard ?nocode
        ParticleParamRedstone param = new ParticleParamRedstone(
                new Vector3f(color.getRed(), color.getGreen(), color.getBlue()), 0.5f);
        PacketPlayOutWorldParticles particlesPacket = new PacketPlayOutWorldParticles(
                param, true,
                (float) location.getX(), (float) location.getY(), (float) location.getZ(),
                0, 0, 0,
                param.f(), 1);
        ((CraftPlayer) player).getHandle().c.a(particlesPacket);

here is my code

tender shard
#

why are you using packets instead of API?

azure dirge
#

because I want it private to specific player

tender shard
#

there's API for that

vast ledge
#

Then player#sendParticle

#

Or smth

tender shard
#

@azure dirge

#

it exists at least since 1.13 or sth

azure dirge
#

does other player see that particle ?

tender shard
#

no

vast ledge
#

No

#

You're send to a specific player, not to the world

tender shard
#

exactly

azure dirge
#

oh

#

i'm gonna try, thank you

pseudo wraith
tender shard
mellow snow
#

pls, can someone help me to fix this code? I don't have any errors but the placeholder doesn't work.


import net.luckperms.api.LuckPerms;
import net.luckperms.api.LuckPermsProvider;
import net.luckperms.api.model.user.User;
import net.luckperms.api.model.user.UserManager;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.event.Listener;
import org.bukkit.plugin.java.JavaPlugin;
import me.clip.placeholderapi.expansion.PlaceholderExpansion;

public class CustomPlaceHolder extends JavaPlugin implements Listener {
    private LuckPerms luckPerms;

    @Override
    public void onEnable() {
        Bukkit.getServer().getPluginManager().registerEvents(this, this);
        luckPerms = LuckPermsProvider.get();
        new GroupCountPlaceholderExpansion().register();
    }

    public int getGroupCount(String groupName) {
        UserManager userManager = luckPerms.getUserManager();
        return (int) Bukkit.getOnlinePlayers().stream()
                .map(Player::getUniqueId)
                .map(userManager::getUser)
                .filter(user -> user != null && user.getPrimaryGroup().equals(groupName))
                .count();
    }

    public class GroupCountPlaceholderExpansion extends PlaceholderExpansion {

        @Override
        public boolean canRegister(){
            return true;
        }

        @Override
        public String getAuthor(){
            return "mjicio";
        }

        @Override
        public String getIdentifier(){
            return "group_count";
        }

        @Override
        public String getVersion(){
            return "1.0.0";
        }

        @Override
        public String onPlaceholderRequest(Player player, String identifier){
            if(identifier.equals("group_count")) {
                return String.valueOf(getGroupCount(identifier));
            }
            return null;
        }
    }
}
tender shard
mellow snow
#

but the placeholder doesn't work

tender shard
#

what's the placeholder you're trying to test? It should be "group_count_group_count" according to your code

azure dirge
#

%group_count_group_count%

mellow snow
tender shard
#

a placeholder works like this:
<identifier>_<the param used in onPlaceholderRequest>

#

so your placeholder would be called %group_count_group_count%

mellow snow
#

ops

#

so, how can I fix it?

tender shard
#

getIdentifer() method is correct

#

but in onPlaceholderRequest, you'll have to adjust your code

azure dirge
mellow snow
#

ok, I'll try

#

something like this?


import net.luckperms.api.LuckPerms;
import net.luckperms.api.LuckPermsProvider;
import net.luckperms.api.model.user.User;
import net.luckperms.api.model.user.UserManager;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.event.Listener;
import org.bukkit.plugin.java.JavaPlugin;
import me.clip.placeholderapi.expansion.PlaceholderExpansion;

public class CustomPlaceHolder extends JavaPlugin implements Listener {
    private LuckPerms luckPerms;

    @Override
    public void onEnable() {
        Bukkit.getServer().getPluginManager().registerEvents(this, this);
        luckPerms = LuckPermsProvider.get();
        new GroupCountPlaceholderExpansion().register();
    }

    public int getGroupCount(String groupName) {
        UserManager userManager = luckPerms.getUserManager();
        return (int) Bukkit.getOnlinePlayers().stream()
                .map(Player::getUniqueId)
                .map(userManager::getUser)
                .filter(user -> user != null && user.getPrimaryGroup().equals(groupName))
                .count();
    }

    public class GroupCountPlaceholderExpansion extends PlaceholderExpansion {

        @Override
        public boolean canRegister(){
            return true;
        }

        @Override
        public String getAuthor(){
            return "mjicio";
        }

        @Override
        public String getIdentifier(){
            return "group_count";
        }

        @Override
        public String getVersion(){
            return "1.0.0";
        }

        @Override
        public String onPlaceholderRequest(Player player, String identifier){
            return String.valueOf(getGroupCount(identifier));
        }
    }
}
azure dirge
#

should be like this

    @Override
    public String onPlaceholderRequest(Player player, String identifier){
        String[] split = identifier.split("_");
        if(split.length == 3) {
            String groupName = split[2];
            return String.valueOf(getGroupCount(groupName));
        }
        return null;
    }
mellow snow
#

ok thanks :D

#

the placeholder doesn't work...

azure dirge
#

group_count_group_count_owner

mellow snow
#

the same

glad prawn
#

lol

mellow snow
#

I don't understand why

trim lake
mellow snow
#

but I think it support placeholder

teal spear
mellow snow
#

The placeholder have to work, the console log the placeholder register: [PlaceholderAPI] Successfully registered internal expansion: group_count

tender shard
tender shard
#

however I'm afk for 10 minutes or so, I gotta upload a few 1.20.5 updates - brb!

trim lake
mellow snow
#

ok

eternal oxide
#

the placeholder would be group_count_owner

teal spear
#

you can do that. if you encounter any

tender shard
mellow snow
eternal oxide
#

Take it out back to end its suffering

azure dirge
#

use onRequest instead

eternal oxide
#

teh identifier that will be passed is "owner"

mellow snow
#
@Override
        public String onPlaceholderRequest(OfflinePlayer player, String identifier){
            return String.valueOf(getGroupCount(identifier));
        }
eternal oxide
#

only "group" gets sent as the identifier

#

be sure you softdepend on placeholder in your plugin.yml

eternal oxide
#

depend is fine too

trim lake
eternal oxide
#

you can;t reliably detect a jumping player, other than via statistics

mellow snow
eternal oxide
#

you could slow their velocity in teh statistic event

mellow snow
#
    private LuckPerms luckPerms;

    @Override
    public void onEnable() {
        Bukkit.getServer().getPluginManager().registerEvents(this, this);
        luckPerms = LuckPermsProvider.get();
        new GroupCountPlaceholderExpansion().register();
    }

    public int getGroupCount(String groupName) {
        UserManager userManager = luckPerms.getUserManager();
        return (int) Bukkit.getOnlinePlayers().stream()
                .map(Player::getUniqueId)
                .map(userManager::getUser)
                .filter(user -> user != null && user.getPrimaryGroup().equals(groupName))
                .count();
    }

    public class GroupCountPlaceholderExpansion extends PlaceholderExpansion implements it.mjicio.rareore.GroupCountPlaceholderExpansion {

        @Override
        public boolean canRegister(){
            return true;
        }

        @Override
        public String getAuthor(){
            return "mjicio";
        }

        @Override
        public String getIdentifier(){
            return "group_count";
        }

        @Override
        public String getVersion(){
            return "1.0.0";
        }

        @Override
        public String onRequest(OfflinePlayer player, String identifier){
            return String.valueOf(getGroupCount(identifier));
        }
    }
}```
eternal oxide
#

you never pass a player to your getGroupCount so where are you getting the user from?

glad prawn
#

uh ig he count how many players has this group.

mellow snow
#

I'M TRYING

eternal oxide
#

ok

mellow snow
#

in the last two days

eternal oxide
#

Your placeholder code looks fine

#

it must be your LP code thats failing

mellow snow
#

Idk how to fix it

trim lake
#

I would still try to print placeholder in chat if its code correct or not.

eternal oxide
#

um one second

remote swallow
#

show how you print it

grim hound
#

does anyone know how I could intercept the method invocation of a certain class object?

#

since it's not an interface

#

I can't use the java Proxy class

eternal oxide
#

correct import me.clip.placeholderapi.expansion.PlaceholderExpansion
your import it.mjicio.rareore.GroupCountPlaceholderExpansion

mellow snow
remote swallow
#

thats not the placeholder

eternal oxide
#

your import is wrong for your placeholder expansion

mellow snow
#

what's wrong?

eternal oxide
#

look at what I posted

#

wrong import

mellow snow
#

How Can I import it right?

eternal oxide
#

use the one I posted

#

me.clip.placeholderapi.expansion.PlaceholderExpansion

#

you are extending yrou own class

#

or implementing

eternal oxide
#

you shoudl be extending me.clip.placeholderapi.expansion.PlaceholderExpansion

#
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
public class GMPlaceholderExpansion extends PlaceholderExpansion {```
mellow snow
trim lake
pseudo wraith
#

How can I update my server to 1.20.5 if I'm running on an ubuntu VM?

trim lake
eternal oxide
#

You haven't had to time to correct yrou code, rebuild and startup a server to test

trim lake
mellow snow
eternal oxide
#

?paste your code in full so we can see

undone axleBOT
mellow snow
eternal oxide
#

well you had the wrong import so let us see it all

#

?paste

undone axleBOT
mellow snow
eternal oxide
#

lastly paste your pom

mellow snow
#

ok

eternal oxide
#

all looks fine. you shoudl be gettign something even if it's only a console error

mellow snow
#

no console error

eternal oxide
#

then you are not putting that jar on your server

#

oh god no plugman

mellow snow
#

bro, I know

#

but it works the same

eternal oxide
#

Don't expect anythign to work if using plugman

mellow snow
#

Ok

#

I try to restart

#

same

#

problem

eternal oxide
#

lastly, is the group in LP owner or is it actually Owner ?

mellow snow
#

owner

eternal oxide
#

then I see no reason for the code you pasted to not work

#

so long as there were no startup errors with LP

mellow snow
#

nop

#

[09:54:47] [Server thread/INFO]: [LuckPerms] Enabling LuckPerms v5.4.122
[09:54:48] [Server thread/INFO]: __
[09:54:48] [Server thread/INFO]: | |) LuckPerms v5.4.122
[09:54:48] [Server thread/INFO]: |
_ | Running on Bukkit - Paper
[09:54:48] [Server thread/INFO]:
[09:54:48] [Server thread/INFO]: [LuckPerms] Loading configuration...
[09:54:48] [Server thread/INFO]: [LuckPerms] Loading storage provider... [MARIADB]
[09:54:48] [Server thread/INFO]: [me.lucko.luckperms.lib.hikari.HikariDataSource] luckperms-hikari - Starting...
[09:54:48] [Server thread/INFO]: [me.lucko.luckperms.lib.hikari.HikariDataSource] luckperms-hikari - Start completed.
[09:54:48] [Server thread/INFO]: [LuckPerms] Loading messaging service... [SQL]
[09:54:48] [Server thread/INFO]: [LuckPerms] Loading internal permission managers...
[09:54:48] [Server thread/INFO]: [LuckPerms] Performing initial data load...
[09:54:49] [Server thread/INFO]: [LuckPerms] Successfully enabled. (took 1262ms)

eternal oxide
#

then your plugin should be working

mellow snow
eternal oxide
#

Try using the normal method to get a LP instance

#

instead of teh static access

mellow snow
#

maybe u can see the error

eternal oxide
#

try without static access to LP

mellow snow
eternal oxide
mellow snow
#

where I have to paste it?

eternal oxide
#

in your onEnable

mellow snow
#

ok

eternal oxide
#

where you set your luckperms variable

mellow snow
eternal oxide
#

almost

#

delete teh luckPerms = LuckPermsProvider.get(); line

mellow snow
#

ok

tired star
#

I'm doing a code that gives a player a rocket as a reward and the rocket should go in off hand. The problem is that setItemInOffHand() method just sets the item in the off hand :D is there an "easier" way to implement this than to loop through player's inventory, get number of existing rockets, add one to that and set them in offHand?

eternal oxide
#

also delete LuckPerms api = and replace with luckPerms =

mellow snow
#

ok

#

he give me an error

eternal oxide
#

lower case L

mellow snow
#

ok

#

I do it

mellow snow
eternal oxide
#

yes

mellow snow
#

ok

eternal oxide
#

?nocode

undone axleBOT
#

It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.

mellow snow
#

doesn't wooork

eternal oxide
#

I see no reason in that code

eternal oxide
#

add @Override annotation to all your Placeholder expansion methods

#

should make no difference, but who knows

#

also add java @Override public boolean persist() { return true; }

mellow snow
eternal oxide
#

ok

mellow snow
#

doesn't work

eternal oxide
#

oh I see why

mellow snow
#

what

eternal oxide
#
    /**
     * The placeholder identifier should go here.
     * <br>This is what tells PlaceholderAPI to call our onRequest 
     * method to obtain a value if a placeholder starts with our 
     * identifier.
     * <br>The identifier has to be lowercase and can't contain _ or %
     *
     * @return The identifier in {@code %<identifier>_<value>%} as String.
     */
    @Override
    public @NotNull String getIdentifier(){
        return "groupmanager";
    }```
#

read the javadoc

#

last line

mellow snow
#

OH

#

fjwaijdoiwaijdajdi

#

OK

#

OK

#

I just want to trash my life

#

rn

#

it works

#

I love u man

#

thanks

eternal oxide
#

np

stiff sonnet
#

how would you show certain players certain scoreboard values? I'm struggling to find concrete info online. I'd e.g. show some players their level and stuff like that

eternal oxide
#

different scoreboards, or packets

stiff sonnet
#

yeah but how either of those

#

I have no idea how to tackle that

#

do you know any projects that use custom scoreboards?

stiff sonnet
#

thanks!

crude fractal
#

does anyone know which version added isGliding() to the player interface?

crude fractal
#

so I guess I would need reflection to access it before 1.12?

crude fractal
#

Any idea how to get the name/field in nms?

grim hound
#
//In CraftLivingEntity
    public boolean isGliding() {
        return this.getHandle().getFlag(7);
    }
//In Entity
    public boolean getFlag(int i) {
        return ((Byte)this.datawatcher.get(W) & 1 << i) != 0;
    }
grim hound
#

get the DataWatcher

crude fractal
grim hound
#

and search for any fields with that type

grim hound
#

that's why

#

you're gonna invoke getHandle

#

and on the returned EntityPlayer class you're gonna find DataWatcher by type

crude fractal
#

how do I even get the CraftLivingEntity instance? I only have the Player interface.

grim hound
#

class

#

Class.forName

crude fractal
#

Yeah but I still need the instance to get the metadata from since those are not static, right?

grim hound
#

only need the class

#

and pass an instance when you get one

#

that literally helps him in no way

crude fractal
#

I need to support all versions.

grim hound
#

use the nms2 method

#

from me

crude fractal
#

1.13+ is fine since Bukkit has a isGliding in those versions, but I'll need the impl for <=1.12

grim hound
crude fractal
grim hound
#

what's the hold up then?

tardy mist
crude fractal
#

I know, I figured there would be a nicer way.

tardy mist
#

Mapping Tools or examining Bytecode

tardy mist
#

Alright

undone axleBOT
crude fractal
#

I know those exists, still not an nice way.

tender shard
#

who pinged me

grim hound
#

so

#

I asked chat gpt on how to solve this with ASM

crude fractal
#

Alright, time for even more cursed reflection.

grim hound
#

gpt said I need to include the jar in the path

#

no idea how to do that

#

for context

#
return super.findClass(name);
#

this is line 65

crude fractal
grim hound
#

@sullen marlin

crude fractal
#

ah didnt know you were allowed to ping him

lilac dagger
#

this seems overengineered

grim hound
lilac dagger
#

hmm

grim hound
lilac dagger
#

are you sure you need a new classloader for this?

grim hound
#

but probably yes

lilac dagger
#

if playerlist is under spigot's class loader then you have to modify that one

#

not sure it's easy tho

grim hound
#

I need to define it with custom bytecode

lilac dagger
#

oh, then yeah, you have to load it with a custom class loader

grim hound
#

buttt

#

this stuff

#

ain't stuffing

grim hound
lilac dagger
#

there's more to doing it than just this

#

you have to process it yourself too

grim hound