#development

1 messages · Page 78 of 1

atomic trail
#

Ok so yeah it’s not a plugin

#

Idk what I’m on about

dusty frost
#

oh?

atomic trail
#

It’s used in other plugins

#

To simplify stuff like handling configs etc

#

And chatutil and so on

dusty frost
#

That will be used as a separate jar in each thing?

#

Like, you'll put ValdemarF-Lib.jar or whatever in your Paper backend server and your Velocity server?

atomic trail
#

Not sure if all plugins using the library should shade it or have it at runtime

#

I think have it at runtime

#

Because multiple plugins on each backend server will probably use it

dusty frost
#

Plugins using the library, if the library is a .JAR file included in the plugins folder and loaded as a plugin by the classpath loader, should ABSOLUTELY NOT shade it

#

They should compileOnly it and use it at runtime

atomic trail
#

It won’t be a registered plugin though, that’s not the plan at least, it should work like Configurate basically, other than the fact that Configurate is in the server jar already

#

The default version of Configurate I mean

dusty frost
#

I meann you have to have it loaded by the Bukkit classloader somehow lol

atomic trail
#

Is Configurate also setup as a plugin?

dusty frost
#

No, because it's exported as a library by Paper

atomic trail
#

Ah yeah ofc

dusty frost
#

you don't include the Configurate .jar in your plugins folder lol

atomic trail
#

Yeye lol

#

So I should register the library as a plugin as well?

dusty frost
#

Yes, so that it can be loaded by the Bukkit classloader

#

And optionally like, do other stuff

#

like maybe if you want a global config for the library, or to have it register some listeners or common things

atomic trail
#

Alright yeah, that would make sense, but no server would have the common jar would it?

#

That would just be internal right?

dusty frost
#

uh, I'm not really sure?

#

it depends on what you're doing

#

In the scenario as I understand it, people using your plugins would need like SummitLibs-Bukkit.jar in their plugins folder, plus whatever plugins you make that depend on them

atomic trail
#

Yeah

#

Exactly

#

But not the common module I’d assume

dusty frost
#

ah I see your question now, yeah you'd only have the specific implementation jar in your plugins folder

atomic trail
#

Because it should be shaded in the bukkit module

dusty frost
#

but each specific implementations one would basically just include all the code of the common one

atomic trail
#

Yeah perfect

#

That makes the most sense yeah

#

Thank you for your help! :))

dusty frost
#

absolutely!

daring badger
#

Hello there, I was wondering how I could update the victim's scoreboard inside the if (killer != null) in my onPlayerDeath script. I tried importing the code below into it but it won't work.

        int victimKillStreak = killStreaks.getOrDefault(victimId, 0);
        int limitedVictimKillStreak = Math.min(victimKillStreak, 5);
        ChatColor victimKillStreakColor = getColorForKillStreak(limitedVictimKillStreak);
        String coloredVictimKillStreak = victimKillStreakColor + String.valueOf(limitedVictimKillStreak);
        victim.setPlayerListName(victim.getName() + " " + victimKillStreakColor + "[" + coloredVictimKillStreak + "]" + ChatColor.RESET);
        updatePlayerScoreboard(victim);```


Full  onPlayerDeath script: https://pastebin.com/ZCfYshw8
hazy vale
#

guys how can i disable the plugin name like when i type/warp it says /warp:warp
how can i change whether it shows the name of the plugin or not

hazy vale
#

ofc

worn jasper
worn jasper
#

It's an intended feature. If 2 plugins have the same command, that can be used to differentiate between each other.

hazy vale
#

i know that but i dont need it

worn jasper
hazy vale
#

how do i do that?

worn jasper
# hazy vale how do i do that?

google is your friend, but in short, you would get all the completions, remove those you don't want and set the completer if I recall correctly.

latent ivy
#

^ yea that’s about right

daring badger
lilac portal
#

Can someone help me with getting the minecraft server's ip address without port?

#

So like: 82.3.122.112

#

i need it for an api call

#

The reason why i can't use plugin.getServer().getIp() is because my server is on bungeecord, so i don't have the server-ip set in server.properties

dusky harness
lilac portal
#

in java

#

as a string

dusky harness
#

wdym dynamic?

lilac portal
#

numerical

dusky harness
#

it gets the public numerical ip

#

note that it should run async though

#

or actually even better - get it once and save it in onEnable, no async needed there

lilac portal
#

It works, tysm!

#

By the way, i have the public void inside the onEnable so that shouldn't cause any issues

somber gale
#

Not sure if my logic here is right...
I want to ensure, that the = found is after {{r and that the last } is after it...

        if(target.toLowerCase(Locale.ROOT).startsWith("{{r=") && target.toLowerCase(Locale.ROOT).endsWith("}}")){
            int start = target.indexOf('=');
            int end = target.lastIndexOf('}');
            
            if(start < 3){
                CachedWarnHelper.warn(expansion, "reg-start", raw, "Index of '=' for Regex is invalid. Needs to be at least 3, but got" + start + ".");
                return null;
            }
            
            if(end <= 3 || end < (start + 1)){
                CachedWarnHelper.warn(expansion, "reg-end", raw, "Invalid index of '}'. Expected at least 4, but got " + end + ".");
                return null;
            }
            
            Matcher matcher = Pattern.compile(target.substring(start + 1, end - 1)).matcher(text);
        }
daring badger
#

Hello there, I was wondering how I could fix my onPlayerDeath javascript so that the correct killstreak is displayed over the players head. It keeps telling me there is an Invalid killstreak placeholder for the player but I don't know how to fix it. And my scoreboards aren't updating in real time. Here is my full code.

https://paste.helpch.at/ahovasuqot.java

hoary scarab
craggy zealot
#

Can I get help development for php and web dev here it is related to minecraft kinda

river solstice
#

yes

craggy zealot
#

okay so when I click logIn instead of taking me to userdata.html it just takes me to http://127.0.0.1:5500/LogIn/logIn.html# I dont know if its the php file because when i run it by its self it gives me Username: Password: {"error":"Invalid username or password"} this is my js https://paste.helpch.at/opogopexug.js and this is my php https://paste.helpch.at/sididitare.php i did blur out the info stuff at the top and keep in mind im very new to php and web dev

brittle ginkgo
#

anyone knows how does minecraft authentication works?

#

not packet protocols but like the process to get access token after logging in with microsoft account

warm steppe
#

Why is wait (\d+) seconds not matching wait 5 seconds?

Matcher matcher = getMatcher(task);
int time = Integer.parseInt(matcher.group(1)); // this line
#

java.lang.IllegalStateException: No match found

sterile hinge
#

what does getMatcher do?

warm steppe
#
public Matcher getMatcher(String string) {
    return getPattern().matcher(string);
}
sterile hinge
#

you need to call find I guess

warm steppe
#

oh wow, this did the job

#

thanks man!!

warm steppe
dusty frost
#

me when i use the regex method lol

warm steppe
#

ok now a different question. How can i send a title to a player inside completablefuture#runasync

#

i did tru bukkitscheduler#runtask, but it didnt show the title

spiral prairie
#

Does it work without it?

warm steppe
#

no

spiral prairie
#

Well if it doesn't work within a runnable you can try with packets as a last resort but if that doesn't work your code ain't runnin

warm steppe
#

a nwm, it does work

#

i had the defautl task id as 1, but needed it to be 0

fleet shale
#

is there anyone actually willing to provide insight on my delima here someone helped me with making my first tab complete class for my pluggin and im trying to add more tab complete args to that command for instance right now its /command <tab completed> <arg> <arg> <arg string builder>
i want to add a tab complete list to the second and third <arg> but these ones would be manually set to static elements the first tab complete is made up of a list of config paths for the worldpoints that are in the config i tried to copy the public tabexecute but its giving me some error on not superclass or what have you so any insight on what i could do to achieve this would be great i even tried to reverse engineer the class to see where the tabex is called in the command etc but its not so im at a loss here and dont want to spend hours scraping through forums and jdocs to try to figure this out

this is the class code as of right now http://ycs.canvaswrite.com/resources/uploads/TabEx.java

merry knoll
fleet shale
#

already have that so this wasnt helpful 🙁

merry knoll
#

args - The arguments passed to the command, including final partial argument to be completed

#

just read

fleet shale
#

i do see my error was trying to make a second override but now i have a new issue the matterials list i need to display all and every poissible (including uncraftable) item in the game im only getting ACACIA_BUTTON since its the very first available item alphabetically and its the only tab complete option for all args now http://ycs.canvaswrite.com/resources/uploads/TabEx.java

merry knoll
#

turn all mats into a list then return that

fleet shale
#

i did attempt that but im pretty wure what i did was not right

merry knoll
#

Arrays.asList(Enum.values())

fleet shale
#
String tabString2 = "";
        if (args.length > 1) {
            tabString2 = args[1];
        }
            for (Material items : Material.values()) {
                if(items.getKey().asString().toLowerCase().contains(tabString2.toLowerCase())) {
                    tabComplete.add(String.valueOf(items));
                }
            }
merry knoll
#

or you can just stream it

#

Stream.of(Enum.values()).map(Enum::name).collect(Collectors.toList());

#

either works

#

enum here would be material obviously

#

i would probably cache that list though rather than mapping it over and over on each tab complete request

fleet shale
#

ok that worked for the item list but im still only getting that list as tab complete instead of the pointnames for the first arg

#
// Grab the current text the player is typing, or empty String if none
            String tabString = "";
            if (args.length > 0) {
                tabString = args[0];
            }
            // Go through each point and add values to our list if the player is typing them
            for (String pointName : points.getValues(false).keySet()) {
                if (pointName.toLowerCase().contains(tabString.toLowerCase())) {
                    tabComplete.add(pointName);
                }
            }
        String tabString2 = "";
        if (args.length > 1) {
            tabString2 = args[1];
        }
            for (String items : Stream.of(Material.values()).map(Material::name).collect(Collectors.toList())) {
                if(items.toLowerCase().contains(tabString2.toLowerCase())) {
                    tabComplete.add(String.valueOf(items));
                }
            }

            // Return our list
            return tabComplete;
    }
``` this is just a snippet of the full class so you can see what ive put in so far im sure its something silly and small that ive dine wrong here for the first args tab complete
#

im seeing now the whole list for the tab complete is every item ive added so far but how can i remove a certian section of added elements tot he array when its tab completing to the new arg

merry knoll
#

String tabString = "";
if (args.length > 0) {
tabString = args[0];
}
what is this even

#

args gives you whatever they entered already

#

so, check for size then for arguments themselves

fleet shale
#

its just what was in there from when the first tabexecuter was given to me so i coppied it assuming its required

brittle ginkgo
#

Somehow searching it keeps returning the legacy and I thought new one wasn’t understood yet

fading stag
#

What is the best way for saving an inventory to MySQL and then being able to loading it back in game

hoary scarab
#

Every item to a json string then map by slot number (or include in json string).

fading stag
hoary scarab
#

The only thing I know of built in is ItemStack.serialize() but its for yaml.

hoary scarab
daring badger
#

Hello I was wondering how I would fix the errors in the lore in my script. It displays this error to me in console: "Tag not valid: {display:{Lore:['{"text":"","extra":["Re-roll your Boost to any random number between 1-5"]}'],Name:'{"text":"","extra":["Reroll Book"]}'}}"

    public void onPlayerUse(PlayerInteractEvent event) {
        Player player = event.getPlayer();
        ItemStack item = event.getItem();

        // Check if the player is using a reroll book
        if (item != null && item.getType() == Material.KNOWLEDGE_BOOK) {
            ItemMeta meta = item.getItemMeta();
            if (meta.hasDisplayName() && meta.getDisplayName().equals("Reroll Book")) {
                // Create a list for the lore
                List<String> loreList = new ArrayList<>();
                loreList.add("Re-roll your Boost to any random number between 1-5");

                // Set the lore to the meta
                meta.setLore(loreList);

                // Set the meta to the item
                item.setItemMeta(meta);

                // Update the item in the player's hand
                player.getInventory().setItemInMainHand(item);

                // Remove the reroll book from the player's inventory
                item.setAmount(item.getAmount() - 1);

                // Create a new Random object
                Random rand = new Random();

                // Generate a random killstreak as soon as the reroll book is used
                int killStreak = rand.nextInt(5) + 1;```
sick plinth
#

Does Deluxemenus have a API ?

river solstice
#

its not meant to be used as api

merry knoll
stuck canopy
#

Does EntityDamageEntityEvent run when a player is hit by an arrow shot by another player?

merry knoll
#

yes

merry knoll
#

if arrow get its shooter

proud pebble
plain elk
#

Does anyone know how to make a chest menu in the deluxe menu plugin?

grim oasis
#

If you mean like a personal player vault that a user can store items and later retrieve them though, you can't do that

fleet shale
fleet shale
fleet shale
void orchid
#

@fading stag - Yeah, the repository is private but the gist I'm about to link you should do the job. If you're saving a non-player inventory, I linked you the method directly (named toBase64), otherwise search for the playerInventoryToBase64 method which is at the very top. https://gist.github.com/graywolf336/8153678#file-bukkitserialization-java-L63

Gist

Serialize and deserialize the player's inventory, including armor and content. - BukkitSerialization.java

graceful citrus
azure temple
#

Description: Initializing game
[22:53:17] [Thread-3/INFO]:
[22:53:17] [Thread-3/INFO]: java.lang.RuntimeException: Could not execute entrypoint stage 'client' due to errors, provided by 'auto-miner'!
....
at de.rainix.autominer.client.AutoMinerClient.onInitializeClient(AutoMinerClient.java:24)
[22:53:17] [Thread-3/INFO]: at net.fabricmc.loader.impl.entrypoint.EntrypointUtils.invoke0(EntrypointUtils.java:47)
[22:53:17] [Thread-3/INFO]: ... 7 more
[22:53:17] [Thread-3/INFO]: Caused by: java.lang.ClassNotFoundException: net.minecraft.util.math.Vec3i

line 24: import java.util.Random;

anyone any clue why this occurs and how to fix it?

graceful citrus
#

code?

#

but Caused by: java.lang.ClassNotFoundException: net.minecraft.util.math.Vec3i this line makes me assume

#

you did not include / did not remap

azure temple
#

well it should be included (using gradle btw)

minor summit
#

sounds like you need to remap your jar

azure temple
minor summit
#

suit yourself

frozen fox
#

Hello, I have 2 databases: gitea (as example) and luck perms database. The first one was created by its user itself but the second one was created by postgres user and later transferred to luck perms user, now it looks like this:

 gitea           | gitea           | UTF8     | en_US.UTF-8 | en_US.UTF-8 |
 luckperms_proxy | luckperms_proxy | UTF8     | en_US.UTF-8 | en_US.UTF-8 | luckperms_proxy=CTc/luckperms_proxy

The problem is that if I remove all privileges at luck perms database from luck perms user then it gets unable to interact with that database from its user BUT gitea db hasn't any configured privileges and gitea is able to interact with its database

fleet shale
#

Omg and it wasn’t even the right repository anyway 🤦🏼‍♂️

molten venture
frozen fox
molten venture
# frozen fox Ofc I can but the question is still open: why can't the owner (even if it was re...

In PostgreSQL, the owner of a database does indeed have full privileges to interact with the database. However, these privileges apply to the database itself, not necessarily to all the objects within the database such as tables, views, sequences, etc.

When you reassigned the ownership of the luckperms_proxy database from the postgres user to the luckperms_proxy user, the luckperms_proxy user became the owner of the database, but not necessarily the owner of all the objects within the database. The ownership of these objects would still be with the original owner, i.e., the postgres user.

If you then removed all privileges from the luckperms_proxy user, it would lose its ability to interact with the objects within the luckperms_proxy database, even though it is the owner of the database.

To allow the luckperms_proxy user to interact with the objects within the luckperms_proxy database, you would need to either:

  1. Grant the necessary privileges on the objects within the database to the luckperms_proxy user, or
  2. Reassign the ownership of the objects within the database to the luckperms_proxy user.
frozen fox
minor summit
#

chatgpt looking ahh

atomic trail
#

Configurate question:

I have no clue why, but this (https://paste.helpch.at/kuqoguvuhi.kotlin) throws an exception when trying to referenceTo this simple test class

@ConfigSerializable
public class Test implements LocaleReference {
    @Setting
    @Comment("Whatever")
    private final int num = 2;
}

Error: https://paste.helpch.at/idifogebov.rb

If anyone got an idea it would be a huge help! :))

Important part: java.lang.RuntimeException: com.summitrealms.summitlibs.configurate.serialize.SerializationException: [] of type com.summitrealms.cosmetics.cosmetic.attributes.particles.Test: Unsupported typeio.leangen.geantyref.TypeToken$1@fcaf5bbb

royal hedge
#

idk but relocate gentyref

atomic trail
#

Oh, didn’t know that was required, why?

#

I just use the version from paper or Configurate, forgot where

royal hedge
#

if its inside ur plugin jar it should be relocated

royal hedge
atomic trail
#

I thought it was only if there’s another version at runtime as well

#

For example in the paper jar

royal hedge
#

but because bukkit is so ass class loaders arent isolated

#

so if any other plugin has the same classes youll get conflicts

atomic trail
#

As in 2 libraries at same version

royal hedge
#

like between two plugins?

atomic trail
#

Like if I shade Configurate at exact same version as the one inside the paper jar

#

So both versions are identical, are conflicts then an issue?

royal hedge
#

if its provided by paper you dont even need to shade configurate

atomic trail
#

Yeah bad example

#

But you get the idea?

royal hedge
#

yea

#

ig itll be alr

#

but you cant be sure it doesnt get a breaking update

atomic trail
#

That’s true, so the issue comes if there’s two different versions of same class?

royal hedge
#

yea

atomic trail
#

Gotcha, I don’t think that’s the issue in this case but it might, will try to relocate it tmr

#

Thanks for the help! :))

royal hedge
#

you might have more luck asking in the sponge discord btw

#

oh you did

atomic trail
#

Yeahhhh no response yet tho

neon pewter
#

how do i get SQL Dev without an oracle account Thonk

neon pewter
#

ughhh seem like i will have to give up my personal data to them again

royal hedge
#

and? what are they gonna do with that info

#

worst case china knows ur address

molten venture
torpid raft
#

/tp snowball coords 😏

#

nah im not sure if there is any easy way to do that, you are probably facing a whole bunch of math

#

but maybe you can use a skeleton ai

#

have it target a thing at that block and fire an arrow, then steal the velocity

#

seems scuffed though

grim oasis
#

really wish i did calculus

torpid raft
#

dkim moment

grim oasis
#

you think so if it was done via setting velocity?

#

not teleporting it constantly

dusky harness
torpid raft
#

i think setting velocity would be fine

grim oasis
dusky harness
#

yeah I forgot abt the velocity

#

but thats gonna be some math/physics 😌

grim oasis
#

just calculating it is something I can't do, yeah

dusky harness
#

the math itself shouldn't be difficult, but finding out what values to put it as probably will

torpid raft
#

nah you should be able to extrapolate the values from your input coords / gravity

grim oasis
#

you'd want to check the speed of a normal snowball and use that speed

#

and gravity

#

yeah

#

then the angle is all you need I suppose, but 🤷‍♀️

#

I don't think player velocity works the same because the player is in control, but I'm guessing

dusky harness
torpid raft
#

yeah i think players have air resistance and other stuff to worry about, i dont think projectiles have that

dusky harness
#

actually there is a wiki where they like decompiled the movement code

grim oasis
#

what about not player

dusky harness
#

I hope it's the same

#

🙃

grim oasis
#

oh yeah, gravity

#

idk what i was even looking at

torpid raft
#

😏

grim oasis
#

oh you didn't want a snowball really?

dusky harness
#

oh

grim oasis
#

i think the teleporting zombie might be laggy

dusky harness
#

wait whats the end goal

grim oasis
#

i missed that, yeah

dusky harness
#

to move the player?

grim oasis
#

Are you looking for a straight line? or something more like a snowball throw with an arc

torpid raft
#

is the player the one deciding where they are thrown

#

if so ender pearls are your friend

#

or snowballs ig

dusky harness
#

why on an entity?

grim oasis
#

so in an arc?

dusky harness
#

if the end goal is just to make the player fly to a certain location (on an arc), then honestly the best thing here is probably to just make up your own values and do simple trig

torpid raft
dusky harness
#

or else theres gonna be a lot of effort in finding out what values to put velocity as

torpid raft
#

i dont think so, if you can make a program do the math once it can do it a million times

#

then you just draw a preview in-game of the path

torpid raft
#

and you can just eyeball it and export the values you want from there

dusky harness
#

wait wdym make a program to do that

#

like spawn a million snowballs with different velocities and track each location?

torpid raft
#

no

#

like if you're doing the math to determine the arc, you are no loner limited to just using it to throw a snowball

#

you can do whatever you want with that arc

dusky harness
#

if you don't want it to be laggy, it has to follow minecraft's physics with 1 set velocity at the start

torpid raft
#

like say display particles every 0.n blocks

#

yes

dusky harness
#

even like hypixel does /tp i think

grim oasis
#

except 3d

dusky harness
#

oh i forgot about 3d 🥲 (at least with the /tp method though, you can just treat it as two 2d planes i think)

grim oasis
#

🙂

dusky harness
#

o

#

its also partially random

#

don't know how much that impacts it though, but for large distances it wouldn't really work well if you were to set 1 velocity at the start

grim oasis
#

if it's being calculted then shouldn't matter

#

i think

#

man, i really want to try doing this

dusky harness
grim oasis
#

but I don't think I can

#

lol

#

🤣

#

time to learn

dusky harness
#

without air resistance, it's just these 3 equations (x = position)

grim oasis
#

is that with gravity?

#

constant accelaration down?

dusky harness
grim oasis
dusky harness
grim oasis
#

32 m/s?

dusky harness
dusky harness
grim oasis
#

right...

#

lol

#

some errors tho

#

idk

#

reeddit

#

i would just set a snowball with no velocity and track it's movement

#

figure out gravity ig

#

true

torn heart
#

where can i find the updated map color id's for 1.20.4?

#

or do i have to look through some registry

grave sky
#

hello, i am using Citizens API and Sentinel to create some type of bot and i want to send a message to the player when they kill a NPC i tried using onPlayerDeath but that doesnt seems to be working..

    @EventHandler
    public void onPlayerDeath(PlayerDeathEvent event) {
        Player victim = event.getEntity();
        Player killer = victim.getKiller();
        if (killer != null && CitizensAPI.getNPCRegistry().isNPC(victim)) {
            String npcName = CitizensAPI.getNPCRegistry().getNPC(victim).getName().toLowerCase();
            List<String> deathMessages = new ArrayList<>();
            deathMessages.add(" ");
            deathMessages.add(formatColors("&#794dff&lғʟᴀʀᴇ"));
            deathMessages.add(formatColors("&7You defeated " + npcName + "."));
            deathMessages.add(" ");
            for (String message : deathMessages) {
                killer.sendMessage(message);
            }
        }
    }
hoary scarab
#

Probably need to search those plugins apis for a death event.

fleet shale
#

Have you tried doing a debug to see what the entity type is by returning a message with the event target

#

Probably not going to achieve the desired outcome given the entity is entirely specific to citizens but it could help possibly

sharp hemlock
#

does boundingbox#contains not include the actual border of the box?

river solstice
#

what

hoary scarab
dusky harness
dusky harness
river solstice
craggy zealot
#

so im trying to spawn a client side entity and make it move https://paste.helpch.at/jadeboguwa.java but i keep getting this 30.03 08:57:12 [Disconnect] User [08:57:12 INFO]: Msked has disconnected, reason: Internal Exception: io.netty.handler.codec.EncoderException: java.io.IOException: Can't serialize unregistered packet

minor summit
#

you are subclassing a packet, creating your own type

#

why are you overriding the write method to not send any of the packet info?

proud pebble
#

so use entitydeathevent and cast to humanentity

tranquil edge
#

Hi, does anyone know how to patch the Ancient Debris dupe with Fortune?

#

With some configuration, directly by programming... Something?

#

Since I am a bit inexperienced in programming and it has given me some headaches to correct this... 🤣

shell moon
#

When resetting a world using a world reset plugin (or copying world folder and loading it)

#

world uuid is the same?

craggy zealot
#

I changed it here but still same issue

#
ClientboundMoveEntityPacket movePacket = new ClientboundMoveEntityPacket(spawnPacket.getId(), (short) (x[0] * 32), (short) (y[0] * 32),
                        (short) (z[0] * 32), (byte) location.getPitch(), (byte) location.getYaw(), true, true, true) {
                    @Override
                    public void write(FriendlyByteBuf ignore) {

                    }
                };


                ps.send(movePacket);```
minor summit
#

huh

grave sky
sharp hemlock
#

Why does Team#removeEntry and Team#addEntry kinda lag players client sided for a split second

#

In doing this on leave & join and when loads of people leave at once. My game just stops responding, for some players it’s fine and responds but lag spikes occur. And it’s only on these two methods

hoary scarab
#

What NBT type is display? I thought it would be NBTTagString since its a json string but its not.

minor summit
#

it's a compound tag

#

it holds other tags, like Lore (string (json) list), and Name (string (json))

hoary scarab
#

🤦 literally just figured that out. Thank you though.

bleak arch
#

HI

#

someone knows an Api to create guis more easy?

#

sry for my bad english

spiral prairie
#

Triumph GUI

severe lava
#

Fixed

proud pebble
# severe lava Fixed

what are you expecting and whats the exact placeholder you are trying to test?

robust flower
#

I would like to know if there are any public, available benchmarks comparing using the WorldEdit API vs using NMS directly to set blocks, or if anyone here has already done this comparison and know the answer (how they stack against each other)

I'm curious because I am performing maintenance in a plugin that has to modify a lot of blocks (next to each other, up to 150K blocks), and the current logic is using NMS to do that, but I remembered that WorldEdit has an API to set tons of blocks at once, and I would like to use it instead of NMS if the performance hit is not that big, because that means the plugin won't have to be updated on each major MC update.

#

I know that using WorldEdit API is going to inevitably be slower than NMS, what I wanted to know is if this performance hit was already benchmarked before, so I can make an informed decision faster. I'll benchmark nonetheless, but if you tell me the performance hit is huge I might just skip testing it altogether.

This is how the plugin is currently doing the updates using NMS, if that serves as reference. Since I haven't much experience with NMS, I'm not able to explain the decisions and tradeoffs made by this code snippet.

https://paste.helpch.at/ewugedotoz.typescript

Please ping me if you answer.

hoary scarab
#

I don't know of any publicly posted comparisons, over the years though I've definitely found using nms methods is much faster as you can chose what occurs rather then doing hundreds of updates for setting a few blocks.

#

Also there is a thread posted from 1.14, that still works today, of most of the set block methods and their ranges for performance.

robust flower
minor summit
#

you can disable updates and other side effects when using the WorldEdit API tho

hoary scarab
#

Ah see that's new ^^^

You disable Physics, block updates, light updates, notifiy etc...

small sorrel
#

Hey, I am looking to make a certain chucks a separate instance to the player inside it, if they were mining, users will only be allowed to break certain blocks. and will not effect other instances of that area. does anyone have any advice on how I can move forward wiht this

#

I am using the paper api

tight junco
#

like lets say a collection of players are inside a chunk

#

if player a breaks a block

#

player b, c, d cant see that only player a

worn jasper
#

dev-general vanished so.. just wanted to randomly say that javacord is quite cooler than jda

#

I take that back

dusty frost
#

lol

tepid sequoia
#

quite rapid regrets

neon pewter
#

hmmm, where 5th usage

sterile hinge
#

The last one is both a read and a write, so 2 usages

grave sky
#

how do we detect a respawn anchor death event, OnPlayerDeath doesn't seems to be triggered when a player is killed using Respawn Anchor

sweet gate
#

its not the respawn anchor that kills the player its the explosion, try when a player interracts with a respawn anchor

spiral mural
#

So, how do I remove a packet. I tried sending a packet of 0, but that doesn't really remove the last that was 9. how do I go about remoing the 9 animation?

            container.getIntegers().write(1, animationStage);

            protocolManager.sendServerPacket(player, container);```
spiral prairie
#

Is there a way to change the glow color of players without changing the tab name color?

rugged bane
#

I've got a Minecraft plugin which uses a production URL for api requests. Right now I have to manually change the URL and compile the plugin, which really isn't ideal.

I see that people like Aikar have launch flags like -Dusing.aikars.flags=https://mcflags.emc.gs on boot, if I added my own, how can I check this flag within my plugin?

river solstice
#

ManagementFactory.getRuntimeMXBean()
getInputArguments()

#

I think

hoary scarab
#

I thought it was something in RunTime?

river solstice
#

though most likely not all of then are going to show up

sterile hinge
#

you want to use System.getProperty(...)

rugged bane
#

Ah thanks folks! Yeah, System.getProperty worked a charm

#

I use a local url for testing, and I've been constantly recompiling when it comes to the production plugin. Of course, it's a pain if you ever forget to change them back, or you commit the local name etc

#

Now I've swapped the code to..

String url = System.getProperty("tebex.analytics.url", String.format("https://analytics.tebex.io/api/v%d", API_VERSION));

Using it like so..

-Dtebex.analytics.url=https://tebexanalytics.test/api/v1

This is a lot easier

dusty frost
#

no config.yml?

rugged bane
# dusty frost no config.yml?

Nice idea, I did consider this option - though this is mainly solely for me to test the plugin with.

If I ever need to test a fresh install, it would be a nightmare to set the value each time.

dusty frost
#

I mean surely you'd need to set the launch property each time anyways? lol

#

idk I had a similar thing when I couldn't figure out how to get Velocity configs to work, ended up just hardcoding the secret for a while lol

pulsar ferry
#

System property best, just set it once on your test environment and don't have to worry about it again

rugged bane
#

Yeah I believe this was my main reason for going down this avenue ^ I have a start.sh file and now I just launch the server and it auto uses my local instance instead.

I can delete the config files and launch it, and never have to change or recompile the plugin

dusty frost
#

at this point just go full .env 😌

rugged bane
dusty frost
#

yeah where's the Java dotenv package

#

it's really nice to work with in like every other language lol

warm steppe
rugged bane
#

Would be good for paper to have this

hoary scarab
#

^^^
The "aikar" flags alone are crazy lol

warm steppe
#

so basically with this u can force the plugin users to use aikars flags? sheesh

#

or basically any other flag

#

not like this wasnt possible before but either way

queen plank
#

What value is defining the texture of a skull meta? Say I set it using a GameProfile with a custom textures property, is that data then reflected on SkullMeta#getOwningPlayer? If it's not, which I assume, how do I get it? I can get the PropertyMap of the profile but the textures entry gives me a collection of strings?

ocean raptor
queen plank
ocean raptor
#

ProfileProperty#getValue

#

ah gameprofile

#

is it spigot

queen plank
#

Yup

ocean raptor
#

thats sad

queen plank
queen plank
ocean raptor
#

ah you want to get the data from an existsing skull

#

i thought you were trying to create a skull

#

sorry

queen plank
#

Yeah no, I want to easily be able to serialize the data and want to know what field/data I need to save.

ocean raptor
#

i believe spigot api only gives you the links

#

not the texture itself

queen plank
#

You sure? I can enter a base64 string as a new property to render a texture?

ocean raptor
#

how come

queen plank
#

Where m is the skull meta

ocean raptor
#

ahh thats nms

#

i thought you were sticking to the api

queen plank
#

Yeah no 💀

#

mb

ocean raptor
#

whats the questions exactly

#

what are you trying to achieve expect setting the texture

#

which you already do

queen plank
#

What data do I need to save in order to recreate the skull.

ocean raptor
#

ah

queen plank
#

I assume it is one of the values of a Property under the textures key?

#

Unknown which?

ocean raptor
#

yeah it is

queen plank
#

With no way of telling which?

#

Is it encoded in the base64 somehow?

#

It must be right?

ocean raptor
#

yep, its encoded

#

its basically an json string tho

queen plank
#

I don't know how many values there are, I assume not many. But would it be worth getting the correct value instead of saving them all in an array?

#

Or are there typically like 2 values

#

I just don't want a big array taking up a bunch of space

ocean raptor
#

i believe there is already only one skin in textures

#

but it may also include the cape and model

#

i am not sure tho

queen plank
#

Meh, I'll see how much space it takes up. If it annoys me I'll have to do some base 64 mumbo jumbo.

ocean raptor
#

you should be fine storing the whatever the value you got

queen plank
#

Thank you for your help! :)

ocean raptor
#

np

ocean raptor
queen plank
queen plank
ocean raptor
#

np

lyric gyro
#

yo - having issues with js expansion in papi

#
function worlds() {
    if ( "%player_world%" === "world" ) {
        return "Build World";
    }

    if ( "%player_world%" === "world_the_end") {
        return "Build End";
    }

    if ( "%player_world%" === "world_the_nether") {
        return "Build Nether";
    }

    else {
        return "Null";
    }
}
worlds();
#

not sure why it doesn't work when i do /papi parse me %javascript_worlds%

#

fixed

wary dust
#

Anyone know if theres a way to get the blocks in a sphere region from worldedit without setting them?

#

I've been messing around with it but I cant see a way to get the actual list of affected blocks

sterile hinge
#

create an EllipsoidRegion and iterate throught the blocks in it

wary dust
#

ty

atomic trail
#

I'm running into an issue where the slf4j logger cannot be found in tests, anyone got an idea?

dependencies {
    compileOnly("io.papermc.paper:paper-api:1.19.4-R0.1-SNAPSHOT")

    api("com.summitrealms:configurate-core:4.2.0-SNAPSHOT")
    api("com.summitrealms:configurate-yaml:4.2.0-SNAPSHOT")
    api("com.summitrealms:configurate-gson:4.2.0-SNAPSHOT")

    testImplementation("org.junit.jupiter:junit-jupiter:5.10.2")
}
#

java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory

sharp hemlock
#

this what i use to grab it

bleak arch
#

Hey i have a question

#

How to create a button in chat?

#

Like a message in chat, when a player click "accept" it do something

#

Some API to recommend?

dusky harness
#

Adventure is preferable, but I'm just presenting both options

bleak arch
#

Tnx

dusky harness
west socket
#

Anyone know what the best way to spawn in a packet player that's sitting behind the player in the spawn area and have the skin load is?

#

It seems like about half the time the skin just fails to load since the chunk isnt immediately rendered by the client

glad wadi
#

Hi! I'm kind of new so I might make dumb questiosn lol. I'm using an open source plugin and found a bug which I tried to solve at the .java files. Now I don't have the faintest idea which might be the easiest way to make a .jar file out of all the files (java, yml and even a pom.xml file). Just tried with Eclipse but, when I tried to import the project, it gave a lot of errors because it doesn't recognize anything. My only goal rn is to make a .jar file out of all the plugin files (only edited 1 file with a small validation) so that I can upload it to the server

dusky harness
worn jasper
#

What's that "small validation"

glad wadi
glad wadi
#

Everything is the same except that small if

worn jasper
#

So you never used maven? Is that the issue?

#

Also, what's the OSS project?

violet barn
#

hey, can somone help me compile a decompiled plugin
i've been trying for hours
i managed to decompile it but i cant recompile it

sterile hinge
#

why did you decompile it

spiral prairie
#

^

violet barn
#

im trying to remove it but its hard

sterile hinge
#

why are you using such a plugin

worn jasper
violet barn
#

i need it like in the next 2 hrs

worn jasper
violet barn
#

the developer was bad i checked the plugin for backdoors and found that

#

and i want to remove the class that has the bad stuff in it

#

well i decompiled it and found this class

#

so there isnt any way of recompiling it without the source code?

spiral prairie
#

If there is malware you shouldn't use it

violet barn
#

i want to remove it

#

thats the point

worn jasper
spiral prairie
#

Why am I smelling leaks

worn jasper
#

yup

#

same

violet barn
#

1 sec\

atomic trail
#

What's the correct way of removing an item from a player inventory after inserting it into a gui? It shouldn't move to the gui, just get deleted

ItemStack cursorItem = event.getCursor();    
player.closeInventory(); 
player.getInventory().remove(cursorItem);
#

I've also tried closing after, doesn't work

#

Is the best option just to wait 1 tick?

worn jasper
molten venture
#
ItemStack cursorItem = event.getCursor().clone();
player.closeInventory();
player.getInventory().removeItem(cursorItem);
``` like that
atomic trail
#

Doesn't work sadly

worn jasper
atomic trail
#

I want a gui where players can drag and drop an item into a specific item / slot in the gui. Then close the gui and delete the item

#

A lot happens in between this, but that's the important part

worn jasper
atomic trail
#

It should just not be added back into the players inventory

#

I'm cancelling the event, so it's being added back rn, but wanna override it somehow

molten venture
atomic trail
#

Didn't work, so it's not checking the right items

next temple
#

Can someone fix BetterRTPs’ economy.yml its been bugged for over 2 years and the developers refuse to fix

warm steppe
#

fix it youreself :)

#

maybe its ur fault not plugins

fading stag
wary dust
#

any clue how I can do that

pulsar ferry
sterile hinge
wary dust
#

by using calculateDiff?

#

nws I got it, thanks

atomic trail
#

I need to check if they're taking items out then tho

shrewd knot
#

I am making custom enchantments with spigot and am struggling to figure out how to register the enchantments. Can anyone help me?

river solstice
#

depends on the version

shrewd knot
#

Spigot 1.20.4

warm steppe
river solstice
#

well I dont think its possible to register them anymore

#

you need a different approach such as using PDC

graceful citrus
queen plank
#

I have this code to create a listener using byte buddy. It creates the method properly, it's correctly annoted etc.. But the bar method is not called when the event is fired. I can trigger it manually with Method#invoke and it works fine.

public class Foo {

  public static <E extends Event> void bar(@Nonnull E event) { /* Some code */ }
  
  private void create() {
    Class<? extends Listener> c = new ByteBuddy()
      .subclass(Listener.class)
      .defineMethod("accept", void.class, Visibility.PUBLIC)
      .withParameter(eventClass)
      .intercept(MethodDelegation.to(Foo.class))
      .annotateMethod(AnnotationDescription.Builder.ofType(EventHandler.class).build())
      .make().load(classLoader).getLoaded();
  
    Listener listener = Reflections.getInstance(c);
    Bukkit.getPluginManager().registerEvents(listener, plugin);
  }
}
queen plank
#

Nvm I'm dumb lol

native jay
#

could someone help me out with the deluxe spawners we are using wildstacker but anytime we buy a spawner it all stacks into a pig spawner regardless of spawner placed

wary dust
#
EllipsoidRegion ellipsoidRegion = new EllipsoidRegion(new BlockVector3(0, 150, 0),
                new Vector3(15, 15, 15));

        EllipsoidRegion innerRegion = new EllipsoidRegion(new BlockVector3(0, 150, 0),
                new Vector3(14, 14, 14));

        List<Block> blockVector3List = new ArrayList<>();
        for (BlockVector3 block : ellipsoidRegion) {
            blockVector3List.add(Bukkit.getWorld("world").getBlockAt(block.x(), block.y(), block.z()));
        }

        for (BlockVector3 block : innerRegion) {
            blockVector3List.remove(Bukkit.getWorld("world").getBlockAt(block.x(), block.y(), block.z()));
        }

        for (Block block : blockVector3List) {
            block.setType(Material.BARRIER);
        }
        new BukkitRunnable() {
            int iteration = 0;
            final int blockPerRun = 30;
            @Override
            public void run() {
                if (iteration >= blockVector3List.size()) cancel();
                
                else {
                    for (int i = 0; i< blockPerRun; i++) {
                        blockVector3List.get(iteration).setType(Material.QUARTZ_BLOCK);
                        iteration++;
                    }
                }
            }
        }.runTaskTimer(this, 0, 1);

Can anyone think of a way to rotate the Ellipsoid region so that the first block in the list is not always the north most block?

sterile hinge
#

do you actually want to rotate the ellipsoid or do you just want to change the iteration order?

wary dust
#

so atm it plays a "building" animation but it always builds from the same direction, I am just trying to get my head around how to make it build from another direction

#

I was thinking go a quarter of the way through the list but that wouldnt work

sterile hinge
#

I mean as you only have a sphere you could rotate all the points around the center

wary dust
#

hmmm

#

Okay

wary dust
sterile hinge
#

you can use the AffineTransform class

shrewd knot
merry knoll
shrewd knot
#

Are there any tutorials or anything on making them with the PDC's \

ocean raptor
#

not really

#

but all you need to do is set a custom pdc instead of an enchantment

#

thats it

#

rest is the same

dark garnet
hoary scarab
#

You provide it a restart script.

dusky harness
#

^

dark garnet
#

oh Sadge

dusky harness
#

i forget what file its in

#

spigot.yml?

dark garnet
#

yeah

#

settings.restart-script

#

wanted to make plugin where u could run cmd and then when the server is empty it'd restart

#

ig i could still but then i gotta make a restart script for all my servers 🥱

#

and make sure anyone else that uses plugin has one too

hoary scarab
#

Pretty sure you can pass it a script. Maybe ask n0rska how he does it in ultimate restart

dusky harness
#

i haven't done any googling but theres gotta be a way to
a) know what script was used initially
b) modify restart script (reflection even?)

dusky harness
#

What IDE?

#

it probably forgot your JDK or something

#

on IntelliJ, ctrl alt shift S and then I think it's like Project SDK

#

oh also make sure it compiles too or your build.gradle/pom.xml could be messed up (but not likely)

#

that should be right

#

assuming u installed it earlier

#

not an error but you can alt enter and apply the quick fix

#

and it should work

#

yes
then offlinePlayer.getName()

#

no, you'd do this

#

you would use offlinePlayer.getName() to get the name
it's nearly midnight so I can't really explain everything right now, sorry about that, but I should probably get some sleep 🥲

pastel swallow
#

how would someone listen if a player gets op ?

#
    private void AntiOP(PlayerJoinEvent e) {
        Player player = e.getPlayer();


        if (player.isOp()) {
            player.setOp(false);
            player.sendMessage(CC.translate("&cYour operator permission have been removed, no one is allowed to have OP"));


        }
    }
}```

this is what i have right now, it checks if the player has op on join and then removes it, but im scared somehow they can get op while in game how could someone check for that?
stuck hearth
#

What is zee problem

pastel swallow
#

why u even making a config.yml ?

night ice
pastel swallow
#

and i found a good way

        plugin.getServer().getScheduler().runTaskTimer(plugin, () -> {
            for (Player p : Bukkit.getOnlinePlayers()) {
                if (!config.getOPList("oplist").contains(p.getName()) &&
                        !config.getOPList("oplist").contains(p.getUniqueId().toString()) &&
                        p.isOp()) {
                    p.setOp(false);
                }
            }
        }, 20L, 20L);
    }
#

👍

#

it checks a config if there is no username in it will setop to false

night ice
# pastel swallow what about a malware ? tho

If I am right even the malware needs to somehow execute the command or maybe rewrite ops.json, but rewriting ops.json will need a server restart iirc, (Sorry if I am wrong). even tho checking it every sec might be a bit unnecessary in my opinion

pastel swallow
#

that is true im trying to add as many stuff to prevent it, and the "1 second checking" thing im not sure i might as well make it 1m or 5m, just for performance on high player's count

tight junco
#

i know its very unrelated but can i ask why we're preventing /op

night ice
night ice
stuck hearth
#

decompile...?

#

What is your project structure?

#

How long is it taking?

#

Like to build the jar?

#

That's not too crazy per se, but it is longer than I'd expect from what I assume is a smaller project.

warm steppe
#

maven probably

stuck hearth
#

Maven actually added cache support like a year or two ago, I'd hope it was better than that

stuck hearth
#

uhh ok?

stuck hearth
#

Oh you'll probably have a better time (and more support) with gradle, at least in the MC community

#

Not to say people don't use it, there's a few out there.

ocean raptor
#

jda has nothing to do with minecraft

#

you cannot use its features ingame

#

can you create a plugin that runs a discord bot? yeah

#

but you cannot use it to play songs in minecraft

#

maybe not the only way

#

but definitely the best/most performant way

dark garnet
#

and without knowing the initial startup cmd, it'd be unsafe to just set it as whatever i want (like the default start cmd or whatever)

dusky harness
dark garnet
hoary scarab
dusky harness
dark garnet
#

no way

stuck hearth
#

Plugins like Spark already do this actually

#

Timings does as well

dark garnet
#

huh

#

do what

stuck hearth
#

Get the launch args and display them

dark garnet
#

true nice i can just look at what they do then lol

hoary scarab
#

In the method NBTTagList.add(int, Object) is the integer parameter for position or list type?

hoary scarab
dusky harness
#

it seems to ultimately just go to List#add

hoary scarab
#

I thought so. But if it's a list of multiple object types it seems like the error is saying it's not the right type.

I won't be on PC for a bit.

dusky harness
#

I won't be on PC for a bit.
👌

hoary scarab
#

Caused by: java.lang.UnsupportedOperationException: Trying to add tag of type 6 to list of 3

dusky harness
hoary scarab
#

I thought for NBTTagList you can add all object types not just a single type.

dusky harness
#

doesn't seem like it 🙃
there's a type byte field preventing it

#

and its primitive so non null too

hoary scarab
#

Damn. More work 🤦

dusky harness
#

🥲 🥲

hoary scarab
#

Is there anyway to allow NBTTagList to function the same as List<Object> ?

#

I don't mind rebuilding the list but if I can have all the object in the same list it would be better.

#

Also yes having the same object types fixed it.

dusky harness
#

since mojang has to know how to serialize them

hoary scarab
#

I might be able to but its more work to recheck the object type when being used plus I think the client check for specific NBTTag types.

umbral flame
#

So I setup hotswap hopefully correct, but i got a small unsolvable problemo

#
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ff87137552a, pid=1920, tid=17684
#
# JRE version: OpenJDK Runtime Environment JBR-17.0.10+1-1087.23-jcef (17.0.10+1) (build 17.0.10+1-b1087.23)
# Java VM: OpenJDK 64-Bit Server VM JBR-17.0.10+1-1087.23-jcef (17.0.10+1-b1087.23, mixed mode, tiered, compressed oops, compressed class ptrs, g1 gc, windows-amd64)
# Problematic frame:
# V  [jvm.dll+0x4d552a]
#
# No core dump will be written. Minidumps are not enabled by default on client versions of Windows
#```
#

everytime i try reload classes D:

#

same result

#

idk if this helps

#

?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

umbral flame
#

im out of ideas on how to fix this

#

infact if you findout what's wrong wake me the hell up ill be on my bed

pastel swallow
molten venture
#

lol

hoary scarab
#

Use imgur

neat pierBOT
#
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.

torn heart
#

impossible with regular chest gui's

#

if you provide me with art assets I could work on this in tandem with my custom GUI project

#

nah you can't get click detection on the sides like that

#

you doing this for ur server?

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

forest jay
#

What am I doing wrong with the set entity metadata packet? It says the vector field at 11 is invalid (I am new to packets, I have no clue what I am doing)

        PacketContainer packet = new PacketContainer(PacketType.Play.Server.ENTITY_METADATA);

        packet.getIntegers().write(0, entityId);

        packet.getVectors().write(11, Vector.fromJOML(this.transformationMatrix.getTranslation(new Vector3f())));
        packet.getVectors().write(12, Vector.fromJOML(this.transformationMatrix.getScale(new Vector3f())));

        packet.getChatComponents().write(23, WrappedChatComponent.fromText(this.text));

        packet.getIntegers().write(25, backgroundColor.asRGB());

        packet.getBytes().write(15, (byte) billboard.ordinal());
        packet.getByteArrays().write(27, new byte[] { 0,0, (byte) (showDefaultBackground ? 1 : 0), textAlignment == TextDisplay.TextAlignment.CENTER ? (byte) 0 : textAlignment == TextDisplay.TextAlignment.RIGHT ? (byte) 2 : (byte) 1 });

        ProtocolManager manager = ProtocolLibrary.getProtocolManager();

        for (Player player : players) {
            manager.sendServerPacket(player, packet);
        }
sharp cove
#

Whats the best way to add armorstands like a nametag for a player?

forest jay
shell moon
forest jay
#

I know other plugins that use the same system

shell moon
#

Whats the best way you found to make it work?

forest jay
#

For the portals I just check in a bukkit runnable and remove the text display if needed. For the teleporting I haven't implemented it yet, but I believe you could listen to the teleportation event, as it should get canceled and you can just remove it and send the event again

shell moon
#

hope it works

forest jay
#

so the entities never exist on the server end

#

hence what I was trying to implement above

#

\ I have almost never worked with packets before so I am struggling a bit12

shell moon
#

yeah i know what, but kinda hard to do it haha

lyric gyro
#

Is there a way to check if another placeholderAPI plugins Placeholder equals a certain value?

#

I am using OldCombatMechanics and want my custom anticheat to check which mode their in using their Placeholder Value

sharp cove
#

Or is that to much?

#

But I dont get the code that he wrote, because it has so many classes

shell moon
#

doesnt it use packets?

sharp cove
#

I don't know

sharp cove
# shell moon doesnt it use packets?
    @EventHandler
    public void onPlayerJoin(PlayerJoinEvent event) {
        Player player = event.getPlayer();
        Location location = player.getLocation();
        EntityArmorStand armorStand = new EntityArmorStand(((CraftPlayer) player).getHandle().getWorld(), location.getX(), location.getY(), location.getZ());
        armorStand.setCustomName(new ChatComponentText(ChatColor.GREEN + "Custom Nametag"));
        armorStand.setCustomNameVisible(true);
        armorStand.setInvisible(true);
        ((CraftPlayer) player).getHandle().passengers.add(armorStand);
        PacketPlayOutMount packet = new PacketPlayOutMount(((CraftPlayer) player).getHandle());
        ((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet);
    }

    @EventHandler
    public void onPlayerMove(PlayerMoveEvent event) {
        Player player = event.getPlayer();
        for (Entity passenger : ((CraftPlayer) player).getHandle().passengers) {
            if (passenger instanceof EntityArmorStand) {
                Location location = player.getLocation();
                passenger.setPosition(location.getX(), location.getY(), location.getZ());
                PacketPlayOutEntityTeleport packet = new PacketPlayOutEntityTeleport(passenger);
                ((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet);
                break;
            }
        }
    }

    @EventHandler
    public void onPlayerQuit(PlayerQuitEvent event) {
        Player player = event.getPlayer();
        for (Entity passenger : ((CraftPlayer) player).getHandle().passengers) {
            if (passenger instanceof EntityArmorStand) {
                PacketPlayOutEntityDestroy packet = new PacketPlayOutEntityDestroy(((CraftPlayer) player).getHandle().getId());
                ((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet);
                break;
            }
        }
    }```
#

Maybe this works

shell moon
#

a

#

TAB uses packets to get player movement afaik

sharp cove
#

Alright

#

Never ever used packets tho xD

shell moon
daring gust
#

hey can i somehow separate each placeholder in a new class?

torpid raft
#

I recommend EXACTLY 18,528 x 18,566

stuck hearth
#

Ivan knows

cerulean birch
#

I'm trying to set a block in a world via nms, for that I need to get BlockState given a Bukkit material. before I'd do
material.getId() then net.minecraft.world.level.block.Block.stateById(blockId), but now it doesn't work since modern materials dont return an Id. any solutions?

torpid raft
#

there are so many other things to worry about for lag than map size, just pick a number

#

map size realistically will only impact how much storage space you use

hoary scarab
#

When you realize minecraft worlds are already limited to 30m x 30m

dark garnet
#

non-minecraft question
i wanna make api for a discord bot using mongo and someone that wants to use the api needs to like listen to an event (similar to a minecraft plugin ig)
is there any way to achieve this nicely? only way i thought of requires them to spam my api to check for changes

dusky plinth
#

Web sockets

dark garnet
#

L

dusky plinth
#

Just look them up

#

The mdn article is good

#

They are pretty much like an api, but the server will send events to any listening clients

#

So you don't have to constantly ping for updates, the server will just send updates to the client when they are ready

dark garnet
#

ok yeah thats what i wanted but didnt know it was possible thx

dusky plinth
#

No

#

Np

dark garnet
# dusky plinth Np

wait i dont have to do anything to like allow a client to listen right? anyone can just hook in and listen?

dusky plinth
#

For most applications they first require you to send a message to the server through the socket with an api key or something

#

But this would be something you would implement on the server

dark garnet
#

yeah and then like hand out api keys?

dusky plinth
#

Yeah, like they would for a normal api

dark garnet
#

ok

dark garnet
#

doesnt rly make sense since a key is supposed to be like per-service

hoary scarab
#

You can make your bot collect classes (listeners) and run the methods the same way as spigot. (Using annotations)

dusky plinth
dark garnet
dusky harness
#

btw discord api uses/can use websockets for events

#

just listing a real world example

dark garnet
#

yeah i thought i heard of it somewhere

dusky plinth
#

API keys won't really be necessary unless you want a lot of control and knowledge of what every user is doing

hoary scarab
dark garnet
dusky plinth
#

Just rate limiting the number of connections per client IP per hour may be fine for what you are doing

dark garnet
#

yeah think thats what i did for laser tag's api

#

something called bucket overflow rate limiting 🤷‍♂️

dusky plinth
#

If people are abusing it you can implement api keys

#

But that would also require you to make a system where users create accounts, which you have to store

#

If you aren't already doing this it may be unreasonably over complicated

dark garnet
hoary scarab
#

Well it's a discord bot so don't need to store account data just have them interact through that bot or another 😉

dusky plinth
#

Alright, I'm not too familiar with discord bot development

dark garnet
#

yeah if needed can just have a command to generate/get api key

#

wait nvm

#

discord bot not ran on api server

#

actually sitll possible if i make api endpoint to generate keys but require authorization

#

interesting

dusky plinth
#

I mean you should store the api keys and their corresponding discord accounts in a database somewhere

#

So the discord bot can add to this database when a new user creates an api key

#

And the server can read from this database to check that all incoming web socket connections have a valid api key

neat pierBOT
heavy elbow
#

Is chatchat available yet?

tight junco
#

id like to note you shouldn't be using titles to check inventories

#

anyone could just call a chest "Coin Flip" and it'd act the same

#

although im unsure of what exactly you're doing

unborn ivy
#
  1. have different classes for different stuff example: a class to listen to events, a class for Command Executor, a class for Item building etc
  2. Do not ever use menu titles to check inventories, could use something like an enum combined with a HashMap instead
  3. Keep in mind that HashMap values aren’t that reliable for a coin flipping plugin because player bets will be removed if the server restarts
#

You can solve 3 easily by giving the player their money back in leave event, or in onDisable by having a for loop, but then other players wouldnt be able to take other offline players coin flip games

#

i also have no idea what you’re trying to do with the coin flip plugin anyway, i’ve made one recently and i can help you out a bit

unborn ivy
#

what are you looking for exactly

#

you should have some kind of prototype or template

#

like what kind of inventory you want, what you wanna display on it

#

then you can figure out what to do from there

#

e.g. your coding structure

#

take a look

#

if (inventory != null && inventory.getName().equals("Coin Flip")) {

#

you are checking if the inventory name is Coin Flip

#

so someone could just get a normal chest

#

and call it Coin Flip

#

and then it would execute code

#

you dont want that

#

so like what i said earlier, you can use a HashMap combined with an enum

#
public enum MenuState {
  MAIN_MENU,
  ROLLING_MENU
}
#

something like this

#

then you have another class called PlayerStateManager, create methods like getState#, setState# and deleteState# to make your work easier

#

then to check if a player is actually in the menu, you open the menu somewhere and use the setState# method

tight junco
#

enum isn't the best either to be fully honest

unborn ivy
#

what do you mean

unborn ivy
tight junco
#

InventoryHolder

unborn ivy
#

well if hes using a static inventory he cant do that

#

but if he wants to display info like profit, amount of wins/losses, then sure

#

inventoryholder is the way to go

#

from his code seems like hes using a static inventory

#

or global inventory i should say

tight junco
#

public class X extends InventoryHolder // do whatever
createInventory(this)

new X()

if (!(event.getInventory().getHolder() instanceof X)) return

#

yk

unborn ivy
#

then i just register the click and close events

#

and unregister them when the menu is closed

tight junco
unborn ivy
tight junco
#

but honestly if they're that new to plugin development, frameworks are better until they have a solid grasp on spigot api (and obviously studying how the framework actually functions is important too but)

unborn ivy
#

what does your client want

#

a gambling plugin right

#

o

#

so how is your game going to work

#

you bet $500, guess a random number to win money?

#

ok

#

so whats going to happen when the command runs

#

define your check clearly

tight junco
#

it would be correct, it might get by with different wording but meh

unborn ivy
#

selling stuff to people that give them a gameplay advantage is against the mojang EULA

#

afaik gambling plugins arent

tight junco
#

they updated the guidelines where the server has to be like, friendly to all ages

unborn ivy
#

thats common sense

#

im pretty sure everyone knows that

tight junco
#

so any references to drugs, gambling, violence etc aren't allowed

unborn ivy
#

o

tight junco
#

the server i work for had to remove our "lottery" plugin

unborn ivy
#

im quitting, time to host a SMP server

#

no shit but mojang is mojang

#

they dont play around ever since that tf2 mann co supply stunt back in april fools a long time ago

tight junco
#

here's the exact guideline

#

as far as compliance goes, at a certain point they just send an employee on your server to briefly search the features (check if chances are on crates and looking out for certain things, haven't seen them do an in-depth search though)

unborn ivy
#

time to ban every mojang staff member known to existence

tight junco
#

the account is called MCEnforcement

#

and they'll tell you they're showing up beforehand, or atleast they did for us

#

although that likely won't happen unless your server blows up or you try to put it on the official mc server list

unborn ivy
#

not if i ban that account

tight junco
#

they'll either send a different account or blacklist the server because you banned the account prior

unborn ivy
#

also does anyone know how to send a TextComponent as part of a message e.g. click HERE where only HERE has hover and click actions

stuck hearth
#

No way minecraft can make more minecraft accounts

tight junco
#

depends what text component you're on about

unborn ivy
#

err

#

dont understand what you mean

tight junco
#

kyori/minimessage or vanilla

unborn ivy
#

vanilla

tight junco
#

although i believe there's a component builder somewhere

#

and you'd just have to append a new component with the hover events and such onto the previous component

unborn ivy
#

sounds mind boggling considering im doing all this in AsyncPlayerChatEvent

tight junco
#

correct!!

unborn ivy
#

so after appending all that bs

#

i cant just turn it back into a string to use e.setFormat

#

im basically stuck after that then

tight junco
#

lol probably not

#

it's easier when using kyori (bundled with paper api) by a significant margin because spigots text component system can be really jank

#

most chat plugins to memory will just redo the chat system and overwrite it with their own messages that are individually sent

unborn ivy
tight junco
#

i think it's just operate on event priority HIGHEST or MONITOR with ignoreCancelled and it'll send whatever messages go through whatever other plugins are listening for chat messages

#

but the actual message event itself gets cancelled at the end every time

wind ruin
#

When I ride my lord، the crash automatically becomes a stew or a crash.

minor summit
#

what

jade wave
#

New religion @minor summit

#

Don't worry about it

graceful citrus
#

When I ride my lord، the crash automatically becomes a stew or a crash.

wind hearth
#

I'm looking for a developer to write a mode, PM for more details.

queen plank
#

I have this bit of code to launch an entity in a direction. It works fine when the multiplier is 1, but when I increase it the target becomes really inaccurate. Why is this? In my head multiplying the vector should not affect the angle? Pls ping if you respond :)

Vector vector = /* My vector */;
double multiplier = /* My multiplier */;
entity.setVelocity(vector.multiply(multiplier));
#

I've tested it with Entity.getLocation().getDirection() on myself and sometimes I get launched like 20 degrees of course?

ocean raptor
#

anyone here knows how to use FAWE API properly? I am trying to copy/paste and it takes abnormal amount of time to copy (2 minutes just for 3x3 chunk radius)

#

when using the commands its almost instant

cursive slate
#

Is it simple enough to create a JS placeholder that will return 'true' if the item in a player's hand is a certain ID?

I haven't touched the player side of stuff, only permission checking in existing scripts.

grim oasis
#

Yes, but I would advise using the changeoutput expansion + player expansion

#

should be more efficient than using a js placeholder (since a new javascript engine has to be started every time a js placeholder is called)

#

%changeoutput_equals_input:{player_item_in_hand}_matcher:DIAMOND_SWORD_ifmatch:true_else:false%

#

@cursive slate

cursive slate
#

I wanted it to check against an array of items, and can be either one of those.

I decided to just make a javascript for it.

grim oasis
#

only telling you because of js's inefficiency

worn jasper
#

what's the best way of making dynamic permissions, or checking for them? For instance, homes.X permission defines how many homes I can have.

dusky harness
torpid raft
dusky harness
#

oooh i forgot that existed

stuck hearth
#

Meta is best

unborn ivy
#

anyone with advanced NMS knowledge for 1.12.2 please dm me, got issues to clarify/find out and dont wanna flood the chat here

hoary scarab
#

Just ask your question it might be simple and you don't know it.

unborn ivy
#

im trying to set a pre-defined path for a nms entity to follow infinitely

#

but i have no idea how to start defining that path, and also have no idea how to get the entity to then follow that path

torpid raft
#

maybe something like a list of coordinates, and when the entity is within a certain radius of the next coordinate it is retargeted towards the next in the list

unborn ivy
#

i should also mention that i want to save the defined path into a yml, and when the entity follows its supposed to have its walking animation

torpid raft
unborn ivy
#

then idk

#

i have no idea how to even begin

worn jasper
worn jasper
river solstice
#

ofc find the max, not the first one

minor summit
#

cringe

#

meta permissions on top

hardy atlas
#

hello everyone, i need some help, so i was trying to import papi, using maven. But it doesnt recognise symbol me.clip

#

<dependency>
<groupId>me.clip</groupId>
<artifactId>placeholderapi</artifactId>
<version>2.11.5</version>
<scope>provided</scope> all of the values appear red

#

oh wait wrong channel sorry

worn jasper
#

did you add the repo?

royal hedge
#

thatll fetch all the maven dependencies and sync it up with intellij

stuck hearth
#

Ctrl shift o

robust flower
#

I used to create a single package-info.java file at the project root's src folder in order to have everything annotated with @NotNull by default.

package-info.java

@DefaultQualifier(value = NotNull.class, locations = {TypeUseLocation.PARAMETER, TypeUseLocation.RECEIVER, TypeUseLocation.RETURN, TypeUseLocation.CONSTRUCTOR_RESULT})
package net.countercraft;

import org.checkerframework.framework.qual.DefaultQualifier;
import org.checkerframework.framework.qual.TypeUseLocation;
import org.jetbrains.annotations.NotNull;

build.gradle.kts

dependencies {
  compileOnly("org.checkerframework:checker-qual:3.42.0")
}

I'm trying to use that same setup in another existing Java project, but the IDE is not catching up. RemoteControlledCraft is a simple interface that had its getCraft method annotated with @NotNull, and if I comment it out, Kotlin doesn't pick that the field is non-nullable, even after I've added the package-info.java file.

How could I fix this?

#

And the method doesn't appear annotated as well.

royal hedge
#

ill always recommend jspecify though, its fully supported by both kotlin and intellij and supports the equivalent of what you have, @NullMarked
https://jspecify.org/

minor summit
#

eh, jspecify is overhyped and it's nothing but a draft rn

#

it'll be cool once it's actually out then i'll use it, but considering jetbrains-annotations and checkerqual have many years of adoption in the ecosystem those are the safe options

stuck hearth
forest jay
#

Hello. I am currently building a multi-module gradle project, and here is what the main file looks like: https://paste.helpch.at/afejabaxin.java

I have a module that requires a task called remapping to be done once the jar is formed, which obfuscates the deobfuscated code. (so it will run on a certain system)
However, I am unsure about how to remap the jar and allow it to be shaded into the main module, as it currently is not working and I am not sure what I am doing wrong.

The module needing remapping: https://paste.helpch.at/emaladucov.csharp

royal hedge
#

its the only well-supported set of annotations though

#

that also has a scoped annotation or whatever you wanna call it

minor summit
#

my only gripe with jb-annotations is that they have both type_use and method/field/etc target types

#

but that's generally my go-to

royal hedge
minor summit
#

and jb or jakarta annotations aren't?

#

whatever "well supported" means

royal hedge
#

and i dont think kotlin supports jakarta annotations' nullness annotations

#

i dont think its type use either

minor summit
#

idk what you mean by "scoped annotation"

royal hedge
#

like @NullMarked, @DefaultQualifier, @ParametersAreNonnullByDefault

#

idk what to call it

minor summit
#

sure

royal hedge
#

i mean if u enjoy spamming @NotNull u can do that

stuck hearth
#

Smh, using Java was your first mistake

worn jasper
#

at least its not kotlin

brittle ginkgo
#

yes

spiral prairie
#

Kotlin ftw

wintry swift
#

ArmorStandGUI.java


import org.bukkit.plugin.java.JavaPlugin;

public final class ArmorStandGUI extends JavaPlugin {

    @Override
    public void onEnable() {
        System.out.println("Plugin has started.");
        getServer().getPluginManager().registerEvents(new RightClickEvent(), this);

    }
}```

```RightClickEvent.java```

package org.firstproject.armorstandgui;

import org.bukkit.entity.ArmorStand;
import org.bukkit.entity.Player;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerInteractEvent;
public class RightClickEvent implements Listener {
public void onRightClick(PlayerInteractEvent e){
Player p = e.getPlayer();
p.sendMessage("WASSUP BRO");
System.out.println("INTERACT EVENT DETECTED");
System.out.println("p.getTargetEntity(3)"+p.getTargetEntity(3));
if (p.getTargetEntity(3) instanceof ArmorStand){
System.out.println("p.getTargetEntity(3)2"+p.getTargetEntity(3));
GUI gui = new GUI();
gui.ArmorStandInventory(p, (ArmorStand) p.getTargetEntity(3));
}
}
}```
what am i doing wrong. player interact event is not sending anything no console errors

eager yarrow
hoary scarab
royal spire
#

Guys, u know that saveDefaultConfig(); takes our /resources/config.yml and creates the same file with data in our minecraft plugin Folder.

How can i do a method like that? i want to create multiple .yml files in my "/resources/" and pass their defaults when its needed(not created) instead of doing

getConfig().set("myfile.yml", "Test test test");

for every line i want to add to the default file

#

forget about it, i figure it out hehe

hoary scarab
#

Any reason CraftItemStack.asNMSCopy(ItemStack) isn't keeping the ItemMeta?

minor summit
#

wdym "keeping"?

#

like you set a custom name/lore in the meta and it isn't in the nms item or what?

hoary scarab
minor summit
#

well, that's because that's what the nms itemstack toString does

#
public String toString() {
    int i = this.getCount();
    return i + " " + this.getItem();
}
hoary scarab
minor summit
#

sure..? but why does that matter

#

it doesn't include any of the useful info thonk so why is it relevant

hoary scarab
#

Unless I go through all the item meta from the minecraft itemstack thats the only data available.
I can check later if the item data is in the minecraft itemstack class but was to lazy earlier.

Anyways from itemstack -> minecraft itemstack -> itemstack it loses the ItemMeta

minor summit
#

how are you verifying that? it works fine for me

hoary scarab
#

Giving myself the item before and after

#

So now I'm just reapplying the itemmeta on the returned itemstack.

minor summit
#

idk, it certainly works fine and it's been working for over a decade lol

#

would be nice to see some code

hoary scarab
#

Can't right now. Can send it later.

#
Object minecraft_item = nbt.asMinecraft(item);
nbt.setTag(minecraft_item, tag);
            
item = nbt.asBukkit(minecraft_item);
item.setItemMeta(meta);

Heres all I can send for now.

minor summit
#

this is my code

final var bukkit = new org.bukkit.inventory.ItemStack(Material.IRON_INGOT);
bukkit.editMeta(meta -> meta.displayName(Component.text("stink")));
final var vanilla = CraftItemStack.asNMSCopy(bukkit);
final var bukkit2 = CraftItemStack.asBukkitCopy(vanilla);
final var bukkit3 = CraftItemStack.asCraftMirror(vanilla);
getSLF4JLogger().info("{}\n{}\n{}", bukkit.getItemMeta(), bukkit2.getItemMeta(), bukkit3.getItemMeta());

and this is what it logs

[Paper-Test-Plugin] UNSPECIFIC_META:{meta-type=UNSPECIFIC, display-name="stink"}
UNSPECIFIC_META:{meta-type=UNSPECIFIC, display-name="stink"}
UNSPECIFIC_META:{meta-type=UNSPECIFIC, display-name="stink"}
pulsar ferry
#

Mine

Object nmsItemStack = asNMSCopy(itemStack);
Object itemCompound = getTag(nmsItemStack);

setString(itemCompound, key, value);
setTag(nmsItemStack, itemCompound);

return asBukkitCopy(nmsItemStack);

Also been working for years

hoary scarab
#

Thats why I'm questioning it just stopped working for me.

minor summit
#

i believe this is what the kids nowadays call a skill issue

#

the itemmeta is certainly retained, but i wouldn't be surprised if spigot/minecraft removed foreign tags at some point, i know that's a thing that happens with entities, not itemstacks but who knows

hoary scarab
#

Ill do more debugging later. Weird that its causing an issue now.

hoary scarab
#

Sigh nbt.setTag(minecraft_item, tag);
tag is null so I was essentially erasing the display tag after I set the item meta.

Made sure to copy tags from the minecraft_item onto the new tag.

minor summit
stuck hearth
#

Any decent brig command libs for paper?

sterile hinge
#

cloud

stuck hearth
#

Oh wow this is actually perfect I think, thanks

icy shadow
#

no problem

dusky harness
#

Has kotlin dsl too

#

But it's based on spigot

drowsy edge
#

Is there a way to tell what type of villager a villager is? Like a jungle villager or a desert villager

lean galleon
#

im having flat out errors with my permissions in my server

#

essentialsx is somehow having an interference with everything and customcraftings just disabled itself

torpid raft
#

that's awful, consider undoing whatever you most recently changed

stuck hearth
#

mmm yes

torpid raft
#

also probably better to ask for help about that kinda stuff in #minecraft

lean galleon
torpid raft
#

womp womp

atomic trail
atomic trail
#

Yeahhhh just found that as well, protocollib has 895 open issues tho lol

#

I doubt it'll get fixed soon

atomic trail
#

What do you guys think, Exlll ConfigLib vs Spongepowered Configurate?

stuck hearth
#

I love configurate, never used the other
I also use hocon fwiw

atomic trail
#

Never really why hocon is used, what's better about it?

stuck hearth
#

I started in sponge and it's just the standard there.
I find it more readable + it has comment support whereas configurate I don't think supports yaml comments (yet)

atomic trail
#

Yeah there's a working pr with comment support which I use tho

stuck hearth
#

Oh yeah I remember you

atomic trail
atomic trail
atomic trail
#

But I have made a wrapper so it's not really an issue, it just looks so simple

stuck hearth
minor summit
#

configurate supports inheritance too?

#

although it isn't really configurate that handles that, but the underlying serializer library, but they all support that

pulsar ferry
atomic trail
atomic trail
# pulsar ferry Hocon my beloved

I've got a question for you actually, is it possible to remove the player inventory for a gui? So it only shows the gui I created

pulsar ferry
#

Yes with resource packs

atomic trail
#

Ah, so not with just the api

atomic trail
#

I'm still very new to kotlin, is this like a record in java?

class PetItem(
    private val plugin: EcoPlugin,
    private val pet: Pet
)
#

So it adds those fields through constructor?

worn jasper
#

thought that were data classes

atomic trail
#

Ah gotcha, but what I sent above adds to the constructor and adds the required fields right?

worn jasper
pulsar ferry
#

In Kotlin when you do private val/var you create a "property" which is composed by a field, a getter, and if var a setter

class Test(plugin: EcoPlugin)
// Equivalent to
class Test {
  
  public Test(EcoPlugin plugin) {}
}
// While
class Test(private val plugin: EcoPlugin)
// Equivalent to
class Test {
  
  private final EcoPlugin plugin;

  public Test(EcoPlugin plugin) {
    this.plugin = plugin;
  }

  private EcoPlugin getPlugin() {
    return this.plugin;
  }
}
worn jasper
#

eyo that's quite a cool hack

#

reminds me of lambda type hacks lmao

pulsar ferry
#

"hack"?

worn jasper
#

like, a way to do something quicker

#

I call it hacks xD

pulsar ferry
#

At best "syntax sugar" is what this would be, but still it isn't since it's a different language that works differently, that's why I say equivalent, because it isn't exactly that

worn jasper
#

yeah fair enough

#

although I have never fully understood why everyone hates lambda... I personally don't use but idk

pulsar ferry
pulsar ferry