#development

1 messages ยท Page 45 of 1

dense drift
#

Where is PlaceholderExpansion#getPlaceholders overrided?

gloomy tusk
#

oh my bad wait thats only in dev

#

2 seconds

#

ignore the bonus .toSet() call that's because i'm stupid

dense drift
#

what is the map supposed to return?

broken elbow
#

Btw, have you tried to debug to make sure the map actually returns anything?

dense drift
#

because it should be %<identifier>_<arguments>%

gloomy tusk
gloomy tusk
dense drift
#

yeah it expects a valid placeholder

gloomy tusk
#

ohhh

#

thanks gaby

dense drift
#

np

#

lmk if that works

gloomy tusk
#

will do

mental cypress
#

So if it does work, maybe we need to update the GitHub issue to be more-so as a discussion or make it clearer in documentation that it needs to be a fully qualified placeholder?

dense drift
#

I'd go with the second option

gloomy tusk
#

amazing it works thanks

broken elbow
#

Trying to add MySQL support to a program written in Kotlin. Can you guys recommend me a MySQL wrapper for kotlin or java(that still works in kotlin)?

I'm pretty sure I've asked a while ago the same exact question but I can't seem to find it so I don't remember the answers. Never gotten to actually using any of the recommendations given then.

#

Well actually it is a MariaDB database if that makes any difference at all

dense drift
#

you can try jetbrains' exposed

broken elbow
#

๐Ÿ˜ฎ definitely going to give it a try. Thanks a lot!

dense drift
#

np

stuck hearth
#

I've rather liked exposed in the past.
Kmongo is around as a Mongo wrapper as well. (I know you didn't ask)

dusty frost
mental cypress
#

Exposed looks kinda interesting.

dusky harness
#

Does it work with relocation yet?

#

On spigot

#

Although there's the libraries feature on spigot since like 1.17 I think

#

And paper on 1.19.4

stuck hearth
#

Why wouldn't it?

dusky harness
#

there was a github issue opened but idk if it got resolved or not

#

i saw secretx using it though recently so i assume it got fixed or theres a workaround

stuck hearth
#

Oh you can fix that with gradle

dusky harness
stuck hearth
#

Well it's just basically scanning the files looking for matches and then replaces it, very not technical at all, just looks spooky.

Could probably copy paste my code and replace the strings at the top and it would probably work though.

mystic blade
#

I am currently searching for a skilled builder who can help me with a large project that involves creating numerous buildings and structures on a custom map. Does anyone have any recommendations or suggestions on where I could find someone who is experienced in this type of work?

sterile hinge
#

I can tell you that you're definitely in the wrong channel here

mystic blade
#

"Great! Could you please guide me towards the appropriate server?

broken elbow
river solstice
#

What if I wanna talk about character development, is #development the right channel?

#

๐Ÿฆง

dense drift
#

Yes it is not

river solstice
#

๐Ÿซก

dense drift
#

Has anyone contributed to refined-github? I want to make a function that hightlights // todo comments and it is not working ugh
https://github.com/iGabyTM/refined-github/tree/feature/highlight-todo-comments
If I add a console.log outside the init method it is printed, but not the one inside init and I have this warning in console

DevTools failed to load source map: Could not load content for chrome-extension://dehmkhkfkicaaafgjnhpmlocdafjedmh/index.js.map: System error: net::ERR_BLOCKED_BY_CLIENT``` which points to refined github
broken elbow
#

Using Tailwindcss.

I have a div(grid) that contains 2 components: text and image. The text component contains 2 other components: h2 - title and p - description

I want that when a user hovers anywhere on the grid the style of the h2 and p components change. If I use hover: in the h2 and p components, the style will only ever change when I hover over the text and not anywhere over the big component.

#

Oh shit

dusky harness
broken elbow
#

just found out about the group class

shell moon
#

xd

dusky harness
#

oh

#

uh

broken elbow
broken elbow
#

Idk. Did anyone call you?

river solstice
dense drift
#

Lol

dense drift
#

Is there any way to use paper's api for pathfinding on client side entities? I'd say no, but I hope for yes ๐Ÿคฃ

minor summit
#

the server doesn't have api for something that doesn't exist there

dense drift
#

Yeah fair

lapis imp
#

or, just code all the pathfinding again yourself

#

also idk how efficient getting a block at a location in Paper is nowadays

#

last time i tried to do something similar, i literally made a separate data structure to store all blocks in the world separate from minecraft, and keep them synchronized on chunk load and block change, all just to make it faster to get which block it is at a specific x,y,z location

#

and i could only get away with it because it's a minigame server, because it basically doubles ram used for each chunk

minor summit
#

what

#

that is most definitely not what happens lol

#

unless you are creating a ChunkSnapshot, which, you know, by definition is a (very limited) copy of the whole chunk, but even that is very optimised
I read that as "it literally made a separate data structure..":๐Ÿ’€

river solstice
#

re-storing all the blocks ๐Ÿ’€

minor summit
#

but getting a block is.. fast

#

A Block is literally nothing more than a fancy Location, it just keeps xyz and the region

river solstice
#

it should be pretty fast, like a 1 ms at most

#

unless the block is not in the memory? then the overhead of loading the chunk/data from disk adds up, no?

spiral prairie
#

1ms?

#

whered you get that from

icy shadow
dusky harness
#

what if the chunk is unloaded?

#

oh

#

does it just call world methods

icy shadow
#

this is all it does

#

it's "lazy", if you will

#

it doesnt actually do anything until you call a method

dusky harness
#

ic
didn't know that ๐Ÿค”

icy shadow
#

me neither until i checked at 21:39 (GMT + 1)

minor summit
#

Block is literally an immutable Location

#

it's really stupid

pulsar ferry
#

Bukkit's design is amazing

shell moon
#

Best way to remove placed blocks (reference stored in a List/Map) when turning off the server?
If i recall correctly setting block type to air doesnt work onDisable as it gets ignored (i think)
Calling saveWorld in onDisable bugs light (iirc)
Any good way?

dusky harness
#

i think plugins disable before the world

shell moon
#

I remember i tried but it didnt save changes, and calling saveWorld saved the air blocks but bugged light xd

dusky harness
# shell moon I remember i tried but it didnt save changes, and calling saveWorld saved the ai...

https://www.spigotmc.org/threads/when-is-ondisable-called.136009/#post-1442545
according to this guy it is saved last

  • at the end of latest.log, you always see like Saving worlds after plugins are disabled
#

ยฏ_(ใƒ„)_/ยฏ

shell moon
#

I tried, weird, will try again later xd

worn jasper
#

a bit late but what if instead you store that list somewhere and then set blocks on enable? idk lol

river solstice
silent trench
icy shadow
#

Nah itโ€™s just atom one dark lol

strange remnant
dreamy elk
#

If I want to use AdventureComponents/MiniMessages with papi is the only way of doing it to get a string, replace the placeholders and then serialize that using MiniMessages? Doesn't seem like the best solution

stuck hearth
#

Makes sense to me

dusky harness
#

Try Component#replaceText

uneven lanternBOT
#
@@Contract(pure=true) @@NotNull
Component replaceText(@NotNull @NotNull TextReplacementConfigย config)```
Description:

Finds and replaces any text with this or child Components using the provided options.

Since:

4.2.0

Returns:

a modified copy of this component

Parameters:

config - the replacement config

dusky harness
# uneven lantern

(theres also another method that accepts a Consumer<TextReplacementConfig.Builder>)

#

for more help I'd recommend going to kyori discord

stuck hearth
#

They started there

dusky harness
#

crossposting without referencing the other message ๐Ÿ˜

#

they're getting it from the config, so config -> papi -> component is the best approach

warm steppe
haughty bear
#

Hey there, maybe on of you guys can help me!
I have the following pom.xml file and I want to import the PlaceholderAPI:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
   <modelVersion>4.0.0</modelVersion>
   <groupId>net.atrophygames.obscrts</groupId>
   <artifactId>LobbySystem</artifactId>
   <version>1.0-SNAPSHOT</version>
   <properties>
      <maven.compiler.source>8</maven.compiler.source>
      <maven.compiler.target>8</maven.compiler.target>
      <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
   </properties>
   <repositories>
      <repository>
         <id>spigot-repo</id>
         <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
      </repository>
      <repository>
         <repository>
            <id>placeholderapi</id>
            <url>https://repo.extendedclip.com/content/repositories/placeholderapi/</url>
         </repository>
      </repository>
   </repositories>
   <dependencies>
      <dependency>
         <groupId>org.spigotmc</groupId>
         <artifactId>spigot-api</artifactId>
         <version>1.8.8-R0.1-SNAPSHOT</version>
         <scope>provided</scope>
      </dependency>
      <dependency>
         <groupId>me.clip</groupId>
         <artifactId>placeholderapi</artifactId>
         <version>2.11.3</version>
         <scope>provided</scope>
      </dependency>
   </dependencies>
</project>

No matter what Im trying it cant resolve it

river solstice
#

Step 1. Stop using maven
Step 2. Start using gradle
Step 3. Profit

pulsar ferry
haughty bear
dense drift
#
      <repository>
         <id>spigot-repo</id>
         <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
      </repository>
      <repository>
         <repository> <!-- remove this -->
            <id>placeholderapi</id>
            <url>https://repo.extendedclip.com/content/repositories/placeholderapi/</url>
         </repository>
      </repository>```
You got a `<repository>` tag inside another
haughty bear
dense drift
#

np

river solstice
dark garnet
#

hi hi hi, i have a variable of type PlaceholderExpansion (placeholderapi), and i need to set that value with an expansion
then, if papi is installed, that expansion will be registered when the plugin starts. i still want to be able to set the variable tho even if papi isnt installed, but when i try to (and papi isnt installed), the plugin fails to load
ive tried using a supplier but that didnt work, only other thing i can think of is having a getPapiExpansion() method that the person would override to provide their expansion (and then call that method after checking if papi is installed)

dense drift
#

sorry but what

dark garnet
#

yeah i expected that lmao, i suck at explaining ๐Ÿ˜ญ

broken elbow
#

You can't do that. If PlaceholderAPI isn't installed then it won't find the class PlaceholderExpansion so you'll get a NoClassDefFoundError

dark garnet
dense drift
#

Before accessing the variable of type PlaceholderExpansion you can check some boolean flag, like "is papi enabled" and if that is true you proceed to use the expansion variable

stuck hearth
#

Time to make it intuitive

dense drift
#

since the expansion is optional, having to check a flag before supplying a value should not be that much of a problem

#

ยฏ_(ใƒ„)_/ยฏ

dark garnet
dense drift
#

maybe you can get around NoClassDefFoundError with a class that extends PlaceholderExpansion and to extend that class for your expansions instead of PlaceholderExpansion directly

dark garnet
dense drift
#

welp then I guess you have run out of options

broken elbow
#

It would make sense, but Idk which is why I'm asking

dense drift
#

nah as long it is not referenced anywhere you can have missing classes

dark garnet
#

yeah thats what i was gonna try with the getPapiExpansion() thing i mentioned in my original message

#

it's a bit yucky but i dont see another way Sadge

dense drift
#

you can move the getter inside the plugin class and call it only if papi is enabled

#

so instead of doing options.papiExpansion = new Expansion() you override a method that returns the expansion

dark garnet
#

yeah

#

kinda weird how a supplier doesnt work

dense drift
#

it doesn't work because the class doesn't exist

dark garnet
#

but i thought it (the expansion) would only be constructed when Supplier#get() is called

dense drift
#

yeah idk, you probably didn't used it right

dark garnet
#

imma try it with lambda again then try it by writing out entire new supplier thingy and overriding get

icy shadow
#

there shouldnt be a difference between the two

#

to be pretentious, they are isomorphic

minor summit
#

your mother

dark garnet
icy shadow
#

you will disappointed

dark garnet
#

dont say that ๐Ÿ˜ญ

minor summit
#

you will disappointed

icy shadow
#

oops

dark garnet
#

stop!!

minor summit
#

something like () -> new T() would be the same, but T::new will perform classloading shenanigans

dark garnet
#
new Supplier<PlaceholderExpansion>() {
    @Override
    public PlaceholderExpansion get() {
        return new ExamplePlaceholders(ExamplePlugin.this);
    }
};
```it fails cause of the first line which makes a ton more sense now
icy shadow
minor summit
#

yes

icy shadow
#

interesting

#

guess that makes sense

minor summit
#

the first one will create a separate method that calls the function code, the second one simply "points" to the constructor

#

although, yada yada compiler implementation detail

dark garnet
# icy shadow ?

thats instead of just:

() -> new ExamplePlaceholders(this);
icy shadow
#

i dont understand >it fails cause of the first line which makes a ton more sense now

#

why

#

what is the first line

dark garnet
icy shadow
#

oh

#

huh

#

so that's basically exactly what emily was saying lol

#

guess i shouldve scrolled up before confidently saying there's no difference ๐Ÿ™ƒ

dark garnet
icy shadow
#

rude

minor summit
#

have you heard of our lord and saviour Abstraction?

icy shadow
#

^

#

abstract that fella

stuck hearth
#

Abstract face

icy shadow
#

no thank you

stuck hearth
#

\๐Ÿ˜ฆ

icy shadow
#

\๐Ÿ˜ต

minor summit
#

but also, why are you storing an instance of a PlaceholderExpansion? if all you really do with it is basically register into PAPI lol

icy shadow
#

very wise question

dark garnet
minor summit
#

and why not just.. create it on the spot if papi is available and register it?

dark garnet
minor summit
#

?

#

instead of

private Supplier<YourMotherExpansion> expansion = ...;

// later on
if (Bukkit.getPluginManager().isPluginEnabled("PlaceholderAPI")) {
    this.expansion.get().register();
}

just

if (Bukkit.getPluginManager().isPluginEnabled("PlaceholderAPI")) {
    new YourMotherExpansion(this).register();
}
dark garnet
minor summit
#

except that papiExpansionToRegister would be a supplier, no?

dark garnet
minor summit
#

a supplier is a method

dark garnet
minor summit
#

uhu

dark garnet
#

supplier isnt working

minor summit
#

that's exactly what a supplier is

#

it has a method that you need to override

dark garnet
minor summit
#

so a Supplier<Object>?

dark garnet
#

ok

minor summit
#

what

dark garnet
icy shadow
#

๐Ÿ˜–

dark garnet
#

anyone got an example of a configurable recipe in a YML? it should support both shaped and shapeless. too lazy rn to figure it out myself ๐Ÿ™ƒ
not asking anyone to make it for me, just if u know of an existing plugin that has this

this is what i have rn btw:

# The ingredients for the recipe. If you want to disable the recipe, set this to {}
ingredients:
  B: BEACON
  R: REDSTONE
# The shape of the recipe. If you want the recipe to be shapeless, set this to []
shape:
  - " R "
  - "RBR"
  - " R "
```only problem with it is that if `shape` is `[]` (so shapeless), there isnt a way to specify the amount for each ingredient
dark garnet
# dark garnet anyone got an example of a configurable recipe in a YML? it should support both ...

wait would this just work:

# The ingredients for the recipe. If you want to disable the recipe, set this to {}
ingredients:
  B: BEACON
  R: REDSTONE
# Whether or not the recipe doesn't require a specific shape
shapeless: false
# The shape of the recipe (if shapeless is true, it doesn't matter where the ingredients go)
shape:
  - " R "
  - "RBR"
  - " R "
```and then i can just get the amount of each ingredient from the number of items it shows up in `shape`?
stuck hearth
#

I don't see why not, though I think spaces for empty slots might not be ideal necessarily

dark garnet
stuck hearth
#

Empty slots would be necessary, I don't think those should be represented by spaces.

dark garnet
#

what would u suggest? spaces most closely match what the recipe would look like in-game

stuck hearth
#

Probably dashes or underscores. Some symbol.
You're free to go with spaces, I just have a feeling it may lead to confusion.

dark garnet
#

ill add support for dashes & underscores

dusky harness
#

iirc spigot uses spaces in the api

#

so it might be good to leave it for consistency

dark garnet
dusky harness
#

ohh all 3

#

ok

dark garnet
#

maybe not _ tho, cause ppl can use that as an ingredient (but not - cause its an invalid YML key), even tho they probs wont

fading stag
#

Is it a good idea to listen PlayerInteractEvent while creating a GriefPrevention copy?

dense drift
#

why wouldn't be?

fading stag
#

it can be fired twice and it means double message to player

dense drift
#

you can check the hand

#

d;PlayerInteractEvent#getHand

uneven lanternBOT
fading stag
#

yep, that seems logical thanks

#

as far as I can remember it gets fired when someone places or breaks blocks too right?

dense drift
#

idk

#

probably only when you click a block or whatever

fading stag
#

then I will check it, thanks

shell heath
#

Hello! I want try to develop plugin or mode. The basic idea: the concept of energy, mages, spells, and other things appears in the world.

Objects and a character can store energy and use it.

I've never encountered development for Minecraft, can I clarify - can it be done as a plugin, or only as a mod in any case?

I apologize if I wrote in the wrong place.

tight junco
#

depends what the extent of it is

silent trench
tiny crystal
#

Not Work ( placeholder ... )

This is Me Code i need help ...

public class LevelSystemPlaceholder extends PlaceholderExpansion {
    private final LevelSystemMain plugin;

    public LevelSystemPlaceholder(LevelSystemMain plugin) {
        this.plugin = plugin;
    }

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

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

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

    @Override
    public boolean persist() {
        return true; // This is required or else PlaceholderAPI will unregister the Expansion on reload
    }

    @Override
    public @Nullable String onPlaceholderRequest(Player player, @NotNull String params) {
        if (player == null) {
            return "";
        }
        if (params.equalsIgnoreCase("level")) {
            return "[" + LevelSystemDataBase.GetLevel(player) + "]";
        }
        return null;
    }
}
tiny crystal
broken elbow
tiny crystal
tight junco
#

use onRequest method

shell heath
silent trench
stuck hearth
#

If you're using a reasonable api the java docs should suffice rather well

flat seal
#

Im trying to add placeholderapi lore for pinger and it'll just out put exactly (%pinger_players_localhost:25569/%pinger_max_localhost:25569%) %pinger_online_localhost:25569% instead of (0/0) Offline heres my code

        ItemStack item1 = new ItemStack(Material.NETHERITE_SWORD);
        ItemMeta itemMeta1 = item1.getItemMeta();
        itemMeta1.displayName(Component.text("KitPvP")
                .color(NamedTextColor.DARK_BLUE)
                .decorate(TextDecoration.BOLD)
                .decoration(TextDecoration.ITALIC, false));

        List<Component> item1Lore = new ArrayList<>();

        String playerCountPlaceholder = "%pinger_players_localhost:25569%";
        String maxPlayersPlaceholder = "%pinger_max_localhost:25569%";
        String onlinePlayersPlaceholder = "%pinger_online_localhost:25569%";

        String playerCount = PlaceholderAPI.setPlaceholders(null, playerCountPlaceholder);
        String maxPlayers = PlaceholderAPI.setPlaceholders(null, maxPlayersPlaceholder);
        String onlinePlayers = PlaceholderAPI.setPlaceholders(null, onlinePlayersPlaceholder);

        item1Lore.add(Component.text("(" + playerCount + "/" + maxPlayers + ") " + onlinePlayers)
                .color(NamedTextColor.WHITE)
                .decoration(TextDecoration.ITALIC, false));

        item1Lore.add(Component.text("Kits, Duel, Bounties!")
                .color(NamedTextColor.WHITE)
                .decoration(TextDecoration.ITALIC, false));

        addLoreToList(item1Lore);
        itemMeta1.lore(item1Lore);
        AttributeModifier modifier = new AttributeModifier(UUID.randomUUID(), "generic.attackDamage", 0, AttributeModifier.Operation.ADD_NUMBER, EquipmentSlot.HAND);
        itemMeta1.addAttributeModifier(Attribute.GENERIC_ATTACK_DAMAGE, modifier);
        itemMeta1.addItemFlags(ItemFlag.HIDE_ATTRIBUTES);
        item1.setItemMeta(itemMeta1);
        inventory.setItem(29, item1);```
river solstice
#

cursed

flat seal
#

wdym its cursed

dense drift
#

why do you parse the placeholders individually

flat seal
#

so i can add lore in a single line?

minor summit
#

you can have multiple placeholders in a single string

#

PlaceholderAPI.setPlaceholders("(%pinger_players_localhost:25569%/%pinger_max_localhost:25569%) %pinger_online_localhost:25569%")

flat seal
#

Yea but it'll output plain text

#

Even though pinger is already installed

#

Cause I used that for citizens or npc and it works just fine

minor summit
flat seal
#

Yeah I know it's weird

dense drift
#

do the placeholders work if you use them in-game?

#

if not, try to replace localhost with the ip of the server

#

for pterodactyl (docker) it is smth like 172.x.x.x

minor summit
#

papi parse works fine with that so it certainly works

dense drift
#

yeah I know localhost works but not on all setups, and that is the most common issue with the pinger expansion

flat seal
flat seal
dense drift
#

so the same placeholder works somewhere but not in the parse command?

flat seal
#

but with my Server Selector GUI doesnt work

flat seal
dense drift
#

yes

flat seal
#

It does work but with my server selector gui

#

Doenst*

dense drift
#

what if you try --null instead of me?

flat seal
#

It output as 0

dense drift
#

dont cross post @trim hornet

trim hornet
#

Oh sorry

flat seal
# flat seal It output as 0

That what it supposed to output but I don't know why it won't do same argument as PlaceholderAPI.setPlaceholders("(%pinger_players_localhost:25569%/%pinger_max_localhost:25569%) %pinger_online_localhost:25569%")

dense drift
#

do you create the item only once by any chance?

#

or every time the menu is opened

flat seal
spiral prairie
#

you need to pass the player to setPlaceholders

flat seal
#

How can I achieve it?

minor summit
#

i don't think pinger uses the player anyway

spiral prairie
#

idk what they are even trying to do but it looks wrong

flat seal
minor summit
spiral prairie
#

what?

#

you can?

minor summit
#

yes

spiral prairie
#

you just said you can not

minor summit
#

you can not, not you cannot

stuck hearth
#

Could not would probably be more clear

spiral prairie
#

ah yes

stuck hearth
#

One of those dumb English moments

dense drift
spiral prairie
#

but it seems with --null it doesnt work (if i understand correctly)

tight junco
#

Is there any with with kyori / components when using Component#replaceText(Builder.match(Pattern)) it can ignore colours Prayge

minor summit
#

any with with

tight junco
#

i hate it here

minor summit
#

i love you too

flat seal
stuck hearth
dense drift
tight junco
#

yeah

dense drift
#

hmm weird behaviour

tight junco
#

Specifically using rainbows or gradients causes it to not match

minor summit
#

yeah that's not gonna work

stuck hearth
#

I wonder if kyori has a guild

dense drift
tight junco
#

Component#replaceText(builder -> builder.match("\[(item|i)]"));

#

stripping the text colours and adding them back is so jank too

dense drift
#

why dont you use <item> and MM?

tight junco
#

i can

#

actually wait why dont we dont that what

stuck hearth
#

Huh

minor summit
#

Huh

spiral prairie
#

Huh

tight junco
#

yeah too much work

dense drift
#

wdym too much work

spiral prairie
#

wdym too much work

dense drift
#

I thought you want to add a hover to that?

spiral prairie
#

its easy af

shell moon
hard wigeon
#

Is it possible to create blockdata without actually having a placed block?

#

The BlockDisplay setBlock method requires block data

#

but I can only find examples of getting block data, not creating it

mental cypress
#

Yes

#
Material.BROWN_MUSHROOM_BLOCK.createBlockData("[down=false,east=true,north=true,south=false,up=true,west=true]")
hoary scarab
#

Pretty sure CraftMagicNumbers also has a method.

minor summit
#

why'd you use internals for that lol

thorn cape
#

Is there a way to use kyori adventure text 4.13.0 on version 1.19.2? I want to use the ClickEvent.callback() method but the server is saying that method does not exist so I assume that this version of paper does not have the latest adventure api.

dense drift
#

I think you can shade and relocate adventure, but that means you can not use any methods from paper that take/return components

thorn cape
dusky harness
dense drift
#

paper has META-INF/libraries/... and there are all the libraries

thorn cape
dusky harness
dense drift
#

paper 1.19.2 b307 uses adventure 4.11.0

minor summit
#

why not update ๐Ÿคจ

thorn cape
dusky harness
minor summit
#

update the plugins? lol

dusky harness
#

they prob wouldn't go that far to just update to 1.19.4 ยฏ_(ใƒ„)_/ยฏ

thorn cape
#

not every plugin is updated yet ๐Ÿ‘ also been working on the project for 2 months its not as simple as updating a few plugins lol

minor summit
#

I would strongly advise to update at any costs, there is a major crash exploit in โ‰ค1.19.3 (and vanilla 1.19.4 too (and spigot))

dense drift
#

๐Ÿ˜ฎ

dusky harness
#

๐Ÿ˜ฎ

#

is there like a github issue or smth I can link?

minor summit
#

mojang jira issue, hold on

#

LULW it was made private

dusky harness
#

๐Ÿ’€

stuck hearth
#

Emily making shit up ๐Ÿ’€

minor summit
#

i wish

stuck hearth
#

That does sound pretty nuts though, big if true

errant pilot
#

how do i get the time in a timezone?
i have a timezone variable thats set to london's timezone and one thats set to my system, they are different, but i cant figure out how to get boths time.
or well when i get their times it always returns my systems time

#
TimeZone timezone = TimeZone.getTimeZone("Etc/GMT-12");
        TimeZone mine = TimeZone.getDefault();
        System.out.println(timezone.getDisplayName() + " / " + timezone.getID() + " / " + timezone.getRawOffset());
        System.out.println(mine.getDisplayName() + " / " + mine.getID() + " / " + mine.getRawOffset());
        System.out.println(Calendar.getInstance(timezone).getTime().toInstant().toEpochMilli());
        System.out.println(Calendar.getInstance(mine).getTime().toInstant().toEpochMilli());``` it just returns

GMT+12:00 / Etc/GMT-12 / 43200000
Eastern European Standard Time / Europe/Tallinn / 7200000
1683603402617
1683603402617

dusky harness
#

I think I did it a loooong time ago

#

I forget now though

errant pilot
#

i figured it out, used LocalTime and added the timezone offset as seconds to it, didnt use a TimeZone class

stuck canopy
#

how do I stop maven from modifying my resource files coz it looks like its modifying my .schem file

silent trench
#

Use Gradle ๐Ÿค“

dense drift
marsh scaffold
#

does deluxemenus have a wiki for it's API (fully documented)?

broken elbow
marsh scaffold
#

is there any plans for it?

broken elbow
#

yes. but it ain't happening any time soon. the plugin is a mess. the hope is to open source it with the next major release which would allow other people to help us clean it up a bit and start working on an API.

marsh scaffold
#

as I wish to use deluxemenus as a proxy for my GUIs creation while my plugin handles the database storing & sharing to deluxemenus (basically reducing my workload by 3 times)

marsh scaffold
#

I just noticed this is the wrong channel, my apologies

broken elbow
marsh scaffold
silent trench
#

Ghost messages ๐Ÿ‘€

dusk crypt
#

My bad ๐Ÿ˜„ . Already found it ๐Ÿ˜„

silent trench
#

๐Ÿ˜„

minor summit
#

๐Ÿ˜„

river solstice
#

\๐Ÿ˜„

surreal lynx
dense drift
#

If you want to keep that plugin, you only need a small velocity plugin, all the bungee part does is to send the PluginMessages to the other servers

surreal lynx
#

I wonder if it would work with Snap for testing.. time to try it out

#

Nope, but the spigot plugin also needs some updates for NMS anyway, so we'll just update it eventually ๐Ÿ˜„

dark garnet
#

what am i supposed to put for name for an AttributeModifier? just the name of the Attribute its modifying or what?

#

d;AttributeModifier#getName()

uneven lanternBOT
dark garnet
#

i think i figured it out btw ^
just an identifier so that u can have multiple of the same modifier

#

got another question tho, whats the best way to identify an itemstack for use in things like events?
example: i have an itemstack that i give to a player (Item A). whenever the player right-clicks with Item A, X needs to happen. Item A's display properties (name, lore, enchantments, flags, attribute modifiers, material, etc...) r all dynamic, so they cant be used to determine if the item used in the event is Item A. so what can be used?
this is just an example, not actually what i need to do, just something similar

uneven lanternBOT
#
public interface PersistentDataContainer```
PersistentDataContainer has 8 methods.
Description:

This interface represents a map like object, capable of storing custom tags in it.

dusky harness
#

or PDC for short

#

it can go on ItemStacks, entities, chunks, and tile entities (blocks that store extra data such as furnaces, chests, etc)

dark garnet
dusky harness
dark garnet
#

ohhhh

dusky harness
#

sorry I should've specified ๐Ÿฅฒ

#

PDC is cool

dark garnet
dusky harness
#

ah

#

๐Ÿฅฒ

dark garnet
#

i really wanna keep 1.11-1.13 support cause its goofy

dusky harness
#

there's NBTAPI which prob can do it

#

but that requires another api

#

which optimally is added onto the server

#

at least for me since i occasionally ran into nbtapi shading bugs ๐Ÿฅฒ

#

or nms

dark garnet
#

hmmmmmmmmm

dusky harness
#

hmm

#

I'm not completely sure if nbtapi supports custom item nbt

dark garnet
#

i got an idea

dusky harness
#

also um

#

might want to make this 1.8

dark garnet
dusky harness
#

i think

#

or is it 1.11

dark garnet
#

its 1.11

dusky harness
#

oh

#

ok

#

๐Ÿฅฒ

dark garnet
#

it was originally 1.8, but some stuff required 1.11 (and i didnt know how to do reflection)

dark garnet
#

i can set the lore after the "dynamic" one is set

#

only problem is the line number, since i'd want the identifier to be on the last line

dusky harness
#

how are u gonna make a hidden lore tho?
I feel like the safest way would be to make a custom enchantment

#

since that doesn't show (only vanilla enchantments show on lore unless added manually)

dark garnet
dusky harness
#

๐Ÿ’€

#

uhhh

#

i dont remember

dark garnet
#

oh

dusky harness
#

but u can do it

#

theres prob a bunch of wikis

#

on custom enchants

dark garnet
#

time to make my own datastorage system that will adapt based on server version :DDDDDDDDDDDD (sucks to suck for ppl updating from 1.13 to 1.14+ LLLLL)

dark garnet
dusky harness
#

isn't ID supposed to be the same for the enchant?

dark garnet
dusky harness
#

also, that constructor doesn't exist in 1.13

dark garnet
#

:DDDDDDD

dusky harness
#

lol

#

uh

dark garnet
dusky harness
#

Enchantment(int id)

#

turns into NamespacedKey in 1.13

dark garnet
#

spigot actually removed something without deprecating it??!?!?

dusky harness
#

!!!!!!!!!!

dark garnet
#

i dont believe u

#

omg they did

#

they r terrible!!!!!!

dusky harness
#

๐Ÿ’€

dark garnet
#

ok whatever ill just make another exception for 1.13

#

but everything else looks good right?

dusky harness
#

I would make a separate class for Enchantment, then add its own method as I think the ID is supposed to be unique per enchant-type

dark garnet
dusky harness
#

๐Ÿฅด
oh also make sure to load it lazily (don't initialize it right away) because it will throw an error if the method/class is not found

#

actually

#

is this even possible

dusky harness
#

u can't do this with reflection anyways

dark garnet
#

omg barry

#

!?

dusky harness
#

you're making a subclass of Enchantment so you can't use reflection to call a different super constructor

#

new Enchantment(key.hashCode())

#

this part

dusky harness
dark garnet
#

wait i just noticed something

#
ReflectionUtility.persistentDataContainerSet.invoke(ReflectionUtility.namespacedKeyConstructor.newInstance(plugin, key), ReflectionUtility.persistentDataTypeString, value);
#

this is literally doing nothing ๐Ÿ’€

#

the item is nowhere in that

dusky harness
#

๐Ÿฅฒ

#

this is really gonna be an annoying api

#

to develop

#

๐Ÿ’€

dark garnet
#

it was only supposed to be annoying for the person using it ๐Ÿ˜ญ

dusky harness
#

nbtapi is prob the only chance now
I don't think your API should shade in NBTAPI anyways though

#

maybe you could have like an NBTUtility class

#

ยฏ_(ใƒ„)_/ยฏ

#

Idk

dark garnet
#

nbtapi is so stinky tho

dusky harness
#

ยฏ_(ใƒ„)_/ยฏ

#

i gtg now tho

dark garnet
#

i feel like i can do it using reflection

#

im too tired for this, i gtg too lmao

dusky harness
dusky harness
dark garnet
#

est

#

11:30 pm

dusky harness
#

oh same

#

gn

stuck hearth
#

You're 1 hour older than me HAHA

dark garnet
#

๐Ÿฅฑ

stuck hearth
#

one hour closer to death, see you in an hour.

dark garnet
dark garnet
stuck hearth
#

Sure, but I'll see you in an hour

dark garnet
stuck hearth
#

I can see you, you can't see me, sorry. I don't make the rules

unborn ivy
#

which packets are for when a player executes a command ? (trying to cancel a plugin's message when someone sends the plugin command)

#

i would assume PacketType.Play.Client.CLIENT_COMMAND but that doesnt work

#

tried PacketType.Play.Server.COMMANDS too

tired olive
#

Its just chat iirc

unborn ivy
#

ah ok

#

ill try that

#

is there any way to get the clients full command from the packetevent?

#

nvm i found out

errant pilot
#

which uses less resources when using a bukkit scheduler task timer?
having 2 timers, one at lets say 1 second intervals and another at 10 minute intervals
or 1 timer, counting how many times its ran to see when to run the code for 10 minute intervals

#

or even on a grander scale, if i have a list of classes and they have a timer in them, should i just run 1 timer that runs a method in all those classes

versed carbon
#

Hello all ๐Ÿ™‚
I'm currently trying to detect if my item has the flag 'HIDE_ENCHANTS'

    public void EnderEyeHold(PlayerItemHeldEvent event) {
        Player player = event.getPlayer();
        ItemStack itemStack = new ItemStack(Material.ENDER_EYE);
        ItemMeta itemMeta = itemStack.getItemMeta();
        if (player.getInventory().contains(Material.ENDER_EYE)) {
            player.getInventory().addItem(new ItemStack(Material.DIRT));
            if (itemMeta.getItemFlags().equals(ItemFlag.HIDE_ENCHANTS)) {
                player.getInventory().addItem(new ItemStack(Material.STONE));
                //player.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, 100, 1));
            }
        }
    }```
This is what I've written. I've been testing it as I go in game using the temporary dirt and stone feature but it seems to get stuck at the If item flag part. Is anyone able to explain what I'm doing wrong here?
silent trench
#

Only check for contain

stuck canopy
#

List<ItemFlag>#contains?

silent trench
#

โฌ†๏ธ

versed carbon
#

thanks I'll give it a try

#

Just want to make sure you mean like this?

}```
dense drift
#

d;itemmeta#hasitemflag

uneven lanternBOT
#
boolean hasItemFlag(@NotNull ItemFlag flag)```
Description:

Check if the specified flag is present on this item.

Returns:

if it is present

Parameters:

flag - the flag to check

dark garnet
#

@dusky harness itโ€™s possible with java proxies (I think, thatโ€™s what chatgpt and some stackoverflow thing said)!!

fading stag
#

I'm developing a plugin that is like griefprevention, I want my players to be able to add other players to their regions by a command.
I'm saving whitelisted players via their UUID. Is the following code best way to get a uuid of an offline player?

val selectedPlayer = Bukkit.getOfflinePlayer(firstArgument)
val uuid = selectedPlayer.uniqueId.toString()
proud pebble
river solstice
#

selectedPlayer.uniqueId ๐Ÿฅด

proud pebble
#

uniqueId is a method not a variable?

river solstice
#

both

#

but should be private field

fading stag
#

I'm using Kotlin it refactors getters setters automatically

river solstice
#

disgostang

broken elbow
#

spigot (I think) automatically assigns offline players an UUID which is
UUID.nameUUIDFromBytes(("OfflinePlayer:" + name).getBytes(Charsets.UTF_8))

silent trench
tired olive
#

but i like npes

#

(or u could use cf ๐Ÿ˜)

silent trench
#

You can make NPE with Kotlin too ๐Ÿคฃ

tired olive
#

you can but its much harder

#

its explicit

silent trench
#

Yeah, it's much better to check for them ๐Ÿ˜

stuck hearth
proud pebble
dense drift
#

same thing

#

I mean, at some point the server will create the uuid for that player, but that only works for offline mode servers @broken elbow

proud pebble
#

thats what i was trying to say

hoary scarab
#

Anyone know why getClass would be returning class java.lang.Class on an object rather then its actual class?
Ex;java Class<?>[] parameters = new Class<?>[params.length]; for(int i=0; i<params.length; i++) { parameters[i] = params[i].getClass(); getLogger().info("DEBUG (ReflectedClass:Method) >> Param: "+parameters[i].getName()+" : "+params[i]+" : "+params[i].getClass()); } Outputs DEBUG (ReflectedClass:Method) >> Param: java.lang.Class : interface net.minecraft.server.v1_16_R3.Packet : class java.lang.Class

broken elbow
#

When you call the getClass() method on an object in Java, it returns an instance of the java.lang.Class class, which represents the metadata of the object's class. The java.lang.Class class provides various methods to query and manipulate the properties of a class at runtime.

The reason you don't get the actual class object itself is because Java follows the concept of type erasure. This means that, at runtime, the JVM (Java Virtual Machine) does not keep track of the specific type of an object. Instead, it maintains the metadata about the class, which includes information such as the class name, superclass, implemented interfaces, and other details.

hoary scarab
#

Use case is a parameter array for looking up methods.

hoary scarab
icy shadow
hoary scarab
#
public ReflectMethod getMethod(String name, Object...params) {
    Class<?>[] parameters = new Class<?>[params.length];
    for(int i=0; i<params.length; i++) {
        parameters[i] = params[i].getClass();
        getLogger().info("DEBUG (ReflectedClass:Method) >> Param: "+parameters[i].getName()+" : "+params[i]+" : "+params[i].getClass());
    }
    return reflection.getMethod(classReflect, name, parameters);
}

public void runTest(Player p) {
    Class<?> packetClass = reflect.getClassFromCache(PacketClass.PACKET).get();
        
    sendPacketMethod = sendPacketMethod == null ? 
                class_Connection.getMethod("sendPacket", packetClass) : sendPacketMethod;
        
    getLogger().info("DEBUG (SendPacket) >> Send: "+(sendPacketMethod == null));
}

runTest(player) will error because sendPacketMethod is null because params[i].getClass() is not returning net.minecraft.server.v1_16_R3.Packet but instead returning java.lang.Class

#

Also don't worry about 1.16 lol it would be the same for all versions. I'm just currently testing with that.

spiral prairie
#

Uh, why don't you use Packet... params then?

hoary scarab
spiral prairie
#

ok

hoary scarab
#

I'll just make a method that ignores the params check

minor summit
#

You are passing Class packetClass, on which then you do (effectively) packetClass.getClass(), which is, well, Class

hoary scarab
#

I still just made a method to ignore parameter types so all good lol

dense drift
#

Ignore what parameters?

hoary scarab
dense drift
#

Huh

#

Do you mean what Class#getMethod does?

hoary scarab
# dense drift Do you mean what Class#getMethod does?

Similar yes.
My search method is basically```java
public ReflectMethod getMethodByReturnType(Class<?> location, String name, Class<?> type, Class<?>...params) {
loopMethods {
// test name
// test type
// test params (Arrays.equals(Method.getParameterTypes(), params))
return new ReflectMethod(Method);
}
}

dense drift
#

How is getting a method "by return type" supposed to work, isn't like you can have two methods with the same set of parameters but different returns you_what

hoary scarab
dense drift
#

You still can't achieve that

hoary scarab
dense drift
#

Ultimately they will also have a different set of parameters, or number of

hoary scarab
#

The method already works lol

minor summit
#

gaby doesn't understand bytecode, day #1

dense drift
#

๐Ÿ˜ฆ

hoary scarab
#

Its the parameters that caused the issue.

#

Which emily actually clarified what was wrong.

dense drift
minor summit
#

yess

icy shadow
#

yeah itโ€™s just a source level limitation lol

dense drift
#

good to know

minor summit
#

clown

stuck hearth
#

Him honk nose

queen swift
#

yo can someone help me out with ip forwarding

#

with bungee cord btw

dusky harness
warm steppe
#

Whys does this /^(\d{2}).(\d{2}).(\d{2,4})$/g tests true on this 19052012?

#

(javascript)

#

ok i inderdstand now

#

geez my brain sometimes

shell moon
vagrant phoenix
#

hey anyone really good with packets/nms

dusky harness
#

I've used packets but not much nms

vagrant phoenix
vagrant phoenix
#

you would think so..

dusky harness
#

what happens if you try?

vagrant phoenix
#

but it only makes dragon death sound

dusky harness
#

did you set the correct location too?
can u put the code here?

#

hmmm
it says "sound or particle effect" and these aren't particles

#

so you're probably right

vagrant phoenix
#

yea

#

if it wasnt correct location sound wouldnt work either

dusky harness
#

you could use ProtocolLib (if you're not already) to setup a packet listener for most packets (besides movement, ping/pong, etc)
it's what I did sometimes to find out what packet was used in the past

vagrant phoenix
#

it will just send status packet

#

which works but i cant make the dragon invisible

dusky harness
broken elbow
dusky harness
#

oh

#

can u show code?

#

using the world event packet

vagrant phoenix
# dusky harness wdym status packet?

this packet play_server_entity_status (took long to find)
and im kinda using skript (idk if u know what tat is) but if you dont providing the code wont really help

vagrant phoenix
#

soooo

versed carbon
#

How would I go about checking if a player has a unique helmet on whenever PlayerToggleSneakEvent triggers.
This is what I've got so far and it works. Hopefully anyone can point me in the right direction?

    public void onSneakEffect(PlayerToggleSneakEvent playerToggleSneakEvent) {
        Player player = playerToggleSneakEvent.getPlayer();
        if (player.isSneaking()) {
                for (Entity entity : player.getNearbyEntities(10, 256, 10)) {
                     if (entity instanceof Player) {
                         Player livingEntity = (Player) entity;
                         livingEntity.addPotionEffect(new PotionEffect(PotionEffectType.SLOW, 200, 0));
                         livingEntity.addPotionEffect(new PotionEffect(PotionEffectType.SLOW_DIGGING, 200, 0));
                        }
                    }
                }
            }
        }```
warm steppe
#

check if player has a unique helmet

versed carbon
#

yes that's the goal but I'm unsure on how to go about doing that.

#

would doing something like this work? Or is there a way of targeting the helmet slot.

            if (!itemStack.getItemMeta().hasItemFlag(ItemFlag.ITEMFLAG)) {```
dusky harness
# versed carbon would doing something like this work? Or is there a way of targeting the helmet ...

you can use player.getInventory().getHelmet()

then for identifying the unique item, if you're on 1.14+ you can use PDC (PersistentDataContainer)
It's basically persistent data that can be put on some stuff such as ItemStacks
https://www.spigotmc.org/threads/a-guide-to-1-14-persistentdataholder-api.371200/

versed carbon
#

thanks for explaining ๐Ÿ™‚ I'll look into that

dusky harness
#

@dark garnet
PDC is technically on 1.13 btw

#

using the CustomItemTagContainer api

#

i just found out

#

but at this point

#

using 3 different apis for item storage-

dark garnet
#

agreed

dusky harness
#

๐Ÿ’€

dark garnet
dusky harness
#

ok but

#

whos gonna be on 1.13.1 ๐Ÿฅฒ

dark garnet
#

idk but 1.13.1- will just use enchantments

dusky harness
#

cant

#

remember

#

1.13 mc removed IDs

#

and spigot removed its backwards compatibility ๐Ÿ™ƒ

dark garnet
#

ok so 1.13-1.13.1 will use namespaces

dusky harness
#

nono it cant

#

it'd give an error

dark garnet
#

and 1.11-1.12.2 will use ids

dusky harness
#

ya

dark garnet
dusky harness
#

no still cant

dark garnet
#

yes can

dusky harness
#

this time compiler error

#

๐Ÿ™ƒ

dusky harness
#

i have no idea what proxies are but either you'd prob have to use modules or some funky bytecode modifying lib

dark garnet
#
InvocationHandler handler = new InvocationHandler() {
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        if (method.getName().equals("abstractMethod")) {
            System.out.println("Abstract method implementation");
            return null;
        }
        // Handle other method calls
        return null;
    }
};
dusky harness
#

ah

#

hmmm

#

๐Ÿ˜ฎ

#

whats that

dark garnet
#

example that chatgpt gave me lmao

dusky harness
#

uhh

#

but does the constructor count as a proxy method

dark garnet
dusky harness
#

oh it wont work

#

i dont think

#

since interfaces dont have constructors

#

and proxies have to be interfaces

dark garnet
#

To create a sub-class of an abstract class via reflection and override its abstract methods, you can use the java.lang.reflect.Proxy class along with an InvocationHandler to provide the implementation of the abstract methods.
Here is an example of how you can do it:

Assuming you have an abstract class AbstractClass with an abstract method abstractMethod():

Copy code
public abstract class AbstractClass {
    public abstract void abstractMethod();
}```You can use reflection to get the Class object of the abstract class:
```java
Class<?> abstractClass = Class.forName("com.example.AbstractClass");
```You can then create an instance of the InvocationHandler interface, which will provide the implementation of the abstract method. In this example, we will provide a simple implementation that just prints a message:
```java
InvocationHandler handler = new InvocationHandler() {
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        if (method.getName().equals("abstractMethod")) {
            System.out.println("Abstract method implementation");
            return null;
        }
        // Handle other method calls
        return null;
    }
};
```Finally, you can use the Proxy.newProxyInstance() method to create a new instance of a subclass of the abstract class, passing the InvocationHandler as a parameter:
```java
Object subClass = Proxy.newProxyInstance(
        abstractClass.getClassLoader(),
        new Class[] { abstractClass },
        handler
);
```You can then cast the resulting object to the abstract class and call its methods:
```java
AbstractClass subClassAsAbstract = (AbstractClass) subClass;
subClassAsAbstract.abstractMethod(); // Will print "Abstract method implementation"
```This way, you can provide your own implementation for the abstract methods of the reflected abstract class.
tired olive
#

is that chat gpt

dusky harness
#

๐Ÿฅฒ

dark garnet
#

lmao

tired olive
#

yeah ull need asm or smth

minor summit
#

dear god

#

STOP USING chatgpt for this shit

dark garnet
minor summit
#

if you want your code to be wrong and fail, go ahead and be my guest lmao

dark garnet
#

i barely use it. it kept giving me stuff that looked like it would allow for dynamic proxy on constructors with parameters. then i asked it if it was possible and it said no bruh

#

so imma just use lore

dusky harness
dark garnet
dusky harness
dark garnet
dusky harness
#

i wouldn't support those versions

dark garnet
#

that'd be so random tho

dusky harness
#

i mean

#

im not sure if anybody uses 1.13-1.13.1

#

ex there are some plugins that only support the latest of each minor version

minor summit
#

supporting the latest of each major release is understandable, but wanting to support every single release is simply stupid

lethal hollow
#

a

west socket
#

Does anyone know how to properly rotate a passenger armorstand?
If I try rotating the vehicle, the armorstand snaps back into a specific position partial rotation.
If I try rotating the passenger stand its self, it results in only the base rotating
https://youtu.be/P_2r7STJGzU

#

Im starting to suspect there might not be a clean way to do this

west socket
river solstice
#

cool

marble heart
#

babes is there a bukkit event for the first join?

hoary scarab
#

Ah sorry it's Player.hasPlayedBefore()

marble heart
#

hm idk how to set up a discordsrv alert with that but i ll give it a try thanks

hoary scarab
marble heart
#

i dont think it supports such thing :/

#

its in this form

  #- Trigger: PlayerFishEvent
  #  Channel: fish
  #  Conditions:
  #    - state.name() == 'CAUGHT_FISH'
dense drift
#

try #player.hasPlayedBefore() == false

hoary scarab
marble heart
#

ye i ll give it a try thanks ;d

icy shadow
#

skript lookin ass

dense drift
#

and yaml for the file

lyric gyro
#

Hey there! I'd like to learn how to make plugins, would anyone let me know what all I should know? I'm quite aware of Java and I'm familiar with certain syntax's, but anything else? ๐Ÿ˜ฌ

icy shadow
#

if you know java confidently there aint much to it

#

just install spigot with your preferred build tool and get started

lyric gyro
#

@icy shadow Thank you so much!

icy shadow
#

np

ancient wadi
#

Hey guys i am tryna access weapon and armor attributes and change them with my plugin logic(attack damage, attack speed etc), but i am struggling to apply the increased changes. Is there any forbidden minecraft knowledge on how to edit the attributes?(damage, attack speed, armor, toughness)?

ancient wadi
# proud pebble what have you tried so far?

i am using this to get the item's modifiers:

Collection<AttributeModifier> currentModifiers = meta.getAttributeModifiers(attribute);

and this to try to increase them by 5%/level:

updateAttribute(item, Attribute.GENERIC_ATTACK_DAMAGE, newLevel * 0.1, UUID.fromString("26e0d72b-991e-4f4a-b77e-86d15acaae5a"), "Whet Attack Damage");
                updateAttribute(item, Attribute.GENERIC_ATTACK_SPEED, newLevel * 0.05, UUID.fromString("bfdaecf4-4b9c-4d2f-92e0-7e9d27bc09c9"), "Whet Attack Speed");
dusky harness
ancient wadi
dusky harness
#

can you show the full code?

#

including updateAttribute

#

?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

#
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

dusky harness
ancient wadi
dusky harness
#
get meta 1
get meta 2
change meta 2 (doesn't change meta 1)
set meta 2
change meta 1
set meta 1, overriding the changes of meta 2
#

that's basically what you're doing

#

(because getItemMeta returns a copy of the ItemMeta)

ancient wadi
#

Thanks! I will try to fix this right away

lyric gyro
#

Hello. I'm working on building a paintball plugin with different paintball minigames and I'm wondering if anyone would be interested in testing some things out with me tonight. Send me a DM ๐Ÿ˜„ Thank you so much. Any amount of time is appreciated. And afterwards, if you're interested in the project, I'll be looking for server staff too ๐Ÿ˜„

fading stag
#

I'm getting a location from a DB and I'm doing it using async runnables. I have to verify does server have world called x, how can I do it? I can't do it in a async runnable. Should I create a sync runnable in async runnable?

proud pebble
dusky harness
#

since running a new task can take up to 50ms (a tick)

proud pebble
#

you can call the sync task methods async

dusky harness
#

runTask does the same thing as runTaskLater 1 tick

proud pebble
#

id assume caching the locations rather then always querying the db is the best option

ancient wadi
#

@dusky harness Hey, i have ravamped the entirety of my code to use a smithing table. Now it's changing the stats and increasing them properly, but instead of increasing the current stats(attack damage 7 and attack speed 1.6 for diamond sword for example), it completely removes them and adds new ones(+5%damage).
I can't send screenshots here, but i hope you get the picture. Here is the new piece of code:
https://paste.helpch.at/uvakupowuq.java
As you can see in the applyEffects() method, i am indeed removing the existing attributes, but i am trying to put them back in. But i feel like this is where i messed up and i am not reapplying them or doing doing math incorrectly. Can you give me some advice on that method please?

neat pierBOT
golden tangle
#

is there a mod that allows you to log out of a server with a click of a button, i could set a keybind and as soon as i click it, it will automatically make me log out

river solstice
#

what

#

mod?

#

there's likely a plugin where you can attach commands to block interactions and you can just kick the player who clicked it

icy shadow
#

Or just make an AHK for alt f4 lol

river solstice
#

oh I didnt understand the question lol

ancient wadi
#

Hey guys, when i am trying to edit the item's attribute modifiers, they do not change/apply for some reason. Are Attack Damage and Attack Speed(weapon) attribute modifiers in minecraft? Or do i need to use something else to access and edit them?
https://paste.helpch.at/kiyorowigo.java

lyric gyro
#

can't i just use the API as a library ?

#

i don't know how to use gradle or maven

dense drift
ancient wadi
dense drift
#

Yes

dense drift
proud pebble
#

im assuming they want to use the spigotapi but dont know how to use maven or gradle to do so, tbh they should just learn how to use one of them as it makes life so much easier and plugins arent 50mb+

shell moon
#

i still use jar dependency for many

dense drift
#

Using jar dependencies with maven or gradle is different

shell moon
#

wdym

west socket
#

Does anyone know a plugin that can obfuscate player IPs in console

#

I want to give some of my admins console access, but donโ€™t want them seeing player IPs

#

Or a custom server jar that does so

twilit delta
#

jsyk IPs arent detromental

minor summit
proud pebble
#

if you dont trust your admins to see player ips then they shouldnt have console access

dusky harness
#

IPs are also stored by essentials

#

Btw

#

In plain text

west socket
#

Itโ€™s not hard to block all commands that have ip support

west socket
mellow pond
#

even /ip-ban shows ip

#

afaik

proud pebble
#

if you dont trust your admins to not do anything with the ip addressed of other players then hpw can you trust them to have access to your server files

fading stag
#

I'm trying to replace a air with a crop and then make it's age max.

val randomBlock = randomLocation.block
randomBlock.type = type.block
val blockData = randomBlock.blockData
(blockData as? Ageable)?.age = 7
randomBlock.blockData = blockData

I'm doing it like that, it replaces air with block but it doesn't set it's age to 7.
If you don't know Kotlin and can't understand this I can translate it to Java

silent trench
#

I use Scheduler for this ๐Ÿ’ฉ, idk if it's the best solution

fading stag
#

but if I use Scheduler how will I be able to pass randomBlock? (I had issues with using local variables in runnables)

silent trench
#

Yeah, you can, just use it there

#
val randomBlock = randomLocation.block
randomBlock.type = type.block
Bukkit.scheduler.runTaskLater(PLUGIN, Runnable {
    val blockData = randomBlock.blockData
    (blockData as? Ageable)?.age = 7
    randomBlock.blockData = blockData
}, 1)
west socket
silent trench
#

Any error? Or it just didn't change the data?

fading stag
#

just didn't change

silent trench
#

Also, could you change it from null-safe call to asserted call? ๐Ÿ™

fading stag
#

It is very weird, I changed it to asserted call and it still doesn't throw error nor change block

silent trench
#

Does the code even get invoked ๐Ÿ˜ณ

#

Add some random prints for check

fading stag
# silent trench Does the code even get invoked ๐Ÿ˜ณ
[17:49:14 INFO]: world
[17:49:14 INFO]: 624.0
[17:49:14 INFO]: 63.0
[17:49:14 INFO]: 509.0
[17:49:14 INFO]: WHEAT
[17:49:14 INFO]: false
``` as output of
```kt
println(randomBlock.location.world!!.name)
println(randomBlock.location.x)
println(randomBlock.location.y)
println(randomBlock.location.z)
println(randomBlock.type)
println(randomBlock.type == Material.AIR)
silent trench
#

What about printing the age?

fading stag
#

I'm doing it rn

#

I'm stupid
I was importing org.bukkit.entity.Ageable instead of import org.bukkit.block.data.Ageable
sorry for your time

#

and Intellij never said that it is impossible :/

minor summit
#

because as far as it can infer, it isn't impossible

spiral prairie
proud pebble
#

since afaik it returns a copy of the blockdata

silent trench
#

This is Kotlin, so no

proud pebble
#

ohhh i replied to the wrong message

#

well read the wrong one

silent trench
proud pebble
#

i see

dusty frost
#

in essence, it doesn't really matter if they can see IPs or not

spiral prairie
#

ah

stuck canopy
#

Player#isOnGround is deprecated in papermc. Any alternatives?

dusty frost
#

as long as you're not associating it with other personal information lol

spiral prairie
#

yeah heres the issue

dusty frost
#

but for logging purposes and to provide a service (which is what the point of it being in the console is), you're all good

spiral prairie
#

-> ip address with mc username and uuid

dusty frost
#

neither of those are personal information

spiral prairie
#

the ip address is, isnt it?

dusty frost
#

yes, but as i showed above, you can log it easily no problem

#

as it's required to provide a service

#

and that's also just how the internet works

spiral prairie
#

ah yes

#

were you the Windows AD guy?

dusty frost
#

dunno, i know a bit about LDAP though

spiral prairie
#

yeah i lately read more about novell and do you happen to know by any chance how data is stored?

#

like the public directories

dusty frost
#

you're going to need to elaborate more on your question

spiral prairie
#

so im trying to connect via linux to my schools novell zenworks thingy but no luck, is there maybe a novell linux client or

#

odd question i know

dusty frost
#

you're trying to connect to a system management daemon?

spiral prairie
#

probably idk

dusty frost
#

as far as i can tell, zenworks is just a thing for managing patches and stuff on devices

#

you'd just install it on your computer if you wanted it to be controlled by your school or whatever

#

or more likely you wouldn't because it's your computer lol

spiral prairie
#

i just want to access the file server, i think that was somehow nextcloud in novell

dusty frost
#

so you need FTP?

spiral prairie
#

is that ftp though?

dusty frost
#

most file access is

#

unless it's like, super insecure SCP or something lol

spiral prairie
#

hm alright

torpid raft
#

whats wrong with scp D:

dusty frost
#

According to OpenSSH developers in April 2019, SCP is outdated, inflexible and not readily fixed; they recommend the use of more modern protocols like SFTP and rsync for file transfer.[3] As of OpenSSH version 9.0, scp client therefore uses SFTP for file transfers by default instead of the legacy SCP/RCP protocol.[4]

minor summit
#

for vanilla/non-cheat clients it's fine if that's a risk you're willing to take

fading stag
#

# When a command conflicts with another plugin, by default, Essentials will try to force the OTHER plugin to take priority.
# Commands in this list, will tell Essentials to 'not give up' the command to other plugins.
# In this state, which plugin 'wins' appears to be almost random.
#
# If you have two plugin with the same command and you wish to force Essentials to take over, you need an alias.
# To force essentials to take 'god' alias 'god' to 'egod'.
# See https://bukkit.fandom.com/wiki/Commands.yml#aliases for more information.

overridden-commands:
#  - god
#  - info

This is from Essentials config, how can essentials do that? Is there any way to do that in spigot API?

ancient wadi
#

Hey guys, did anyone here work with MMOItems before? I need methods to access their items so i can edit their stats in my plugin. Do you know where i can get those?

somber gale
#

Would you say ~ is a good symbol for a "Equals ignoring case"?
Currently use = which does a equals check and I want to keep that while offering a variant that ignores case...

dense drift
#

~=

#

or = for ignore case and == for equals, like JS' === strict equal (whatever is called)

stuck hearth
#

+1 for ~=

somber gale
#

Would like to keep it at 2 characters... Also want to allow a negated option like !~ for not equals ignoring case... Currently already have != for not equals

tired olive
stuck hearth
#

Lame equals

dense drift
#

The strict equality (===) operator checks whether its two operands are equal, returning a Boolean result. Unlike the equality operator, the strict equality operator always considers operands of different types to be different.

tired olive
#

yeah, straight equals

#

lemme be more clear

#

not gay equals

stuck hearth
#

Might be gay

tired olive
stuck hearth
#

That's the most straight equal sign this side of the Mason Dixon

tired olive
#
assert("1" == 1)
```how is this straight
somber gale
#

One person recommended โ‰ˆ but I feel like that not everyone would know how to get it...

stuck hearth
#

Yeah fuck that

dense drift
#

yeah stick to characters that are on keyboards

tired olive
#

lmao

somber gale
#

What I could do is this:
~= for equals while ignoring case
== for equals while including case
!= for not equals... while ignoring case?

#

Like idk what to use for not equals with(out) case

dense drift
#

why does it matter how long it is?

stuck hearth
#

^

somber gale
#

It would require me to completely rewrite my expression parser again

dense drift
#

2 characters, 3 characters, same shit

somber gale
torpid raft
#

i think !~ would be fine to negate equalsIgnoreCase

#

then != works as expected

dense drift
#

yeah then go with what fits your code structure

stuck hearth
#

Or fancy a rewrite ๐Ÿฅน

icy shadow
#

a whole operator for a fairly niche string operation is a little odd

#

but yeah i guess ~ is fine

#

or do โ‰ˆ if you wanna be cool

tired olive
# dense drift wdym?

i think hes saying an operator just for a single string operation is prob too specific to be an operator

icy shadow
#

^

#

but i suppose this is more of a DSL so maybe it's not that odd

somber gale
#

A user just asked to make the = check case-insensitive

#

But I feel like there are people who want this case-sensitivity in their checks

#

Tho, I could also just make the current equals check case-insensitive and if people complain add this change...

tired olive
#

no thats worse

icy shadow
#

that doesnt seem like a good idea

#

i cant name a single example of where "fuzzy equals as default" has been seen as a good idea in a language

#

== in java, js, php. all borderline useless and confusing to beginners

lyric gyro
#

does anybody here knows how to work with vault and make a fine GUI shop and server economy that would be synced with towny aswell?

proud pebble
lyric gyro
proud pebble
dusky harness
#

Btw this is coding help

proud pebble
#

tho it seems only for getting already registered services, tho id assume its not too difficult to figure out how to register your own

dark garnet
#

does papi support 1.8 (not 1.8.8, just 1.8)? ping if reply
i asked in #general-plugins too (no reply) but its technically related to development so imma just ask here >:)

dense drift
#

no

dark garnet
dense drift
#

yes

dark garnet
#

probably shouldve just asked that

#

ok thanks lmao

dense drift
#

1.8 is missing gson or some parts of it that are used by papi

dark garnet
#

alr
i could use 1.8 if i reflected placeholderapi ๐Ÿ’€

#

wait no

#

then papi just wouldnt be available for 1.8.7 and lower

#

which is useless

dense drift
#

why do you care about 1.8?

dark garnet
dense drift
#

ok..

river solstice
#

you are indeed going low

dark garnet
#

im at 1.11 rn, gonna reflect some actionbar/title stuff to get to 1.8.8

dense drift
#

use adventure

dark garnet
#

๐Ÿคข

dense drift
#

ah that makes sense

dark garnet
#

wait what would adventure do

dense drift
#

ยฏ_(ใƒ„)_/ยฏ

dark garnet
#

thought it was just formatting stuff

#

oh wait yeah that makes sense

#

maybe i should start using adventure, idk

#

ik its better but last time i tried i got confused and gave up, we'll see...

dense drift
#

BukkitAdventure#sender(CommandSender).sendMessage(Component)

dark garnet
#

does this look right?
Class.forName("org.bukkit.attribute.AttributeModifier$Operation")
mainly the $Operation part

dense drift
#

probably, yeah

dusky harness
dark garnet
dusky harness
strange python
#

Could somebody help me with deluxemenu? I want to do a shop which has an item currency (for example emerald, which name is Coin) and I want to run a command and also take the item when buying the item

rancid knot
#

Anyone can help with my issue?:
My main minecraft world that's used in every plugin is named "world" also in server.properties level-name is "world". Me and my team build map on worldpainter created "world_build" with infinite ocean. Whenever i'm trying to remove "world" that's blank and rename "world_build" into "world" the infinite ocean regenerates into normal minecraft world like in survival. How to fix it?
If i change level-name into "world_build" the infinite ocean chunks still regenerates and i cannot use /mvrename world_build world because it says it cannot be done

west socket
#

When you change the level-name to world_build, do all the chunks regenerate, or just the new ones are vanilla?

dusky harness
west socket
#

Sounds like the issue is that multiverse doesnโ€™t know the new name and isnt continuing the chunk generation with the proper generator

proud pebble
#

well afaik the worlds called whatever the level-name is are handled by the server, not by multiverse which means any custom generation is lost

#

the only way to do custom generation is by setting the generator in the bukkit.yml

west socket
#

Probably best to just let the default world exist then

#

And handle player teleportation to the correct world through a plugin or something

#

Thats what I do

dusky harness
#

oh I thought you were asking the question

#

lol

#

I didn't see the message above

#

whoops

random tendon
#

addAttributeModifier(). How.

#

Cannot resolve method 'addAttributeModifier' in 'ItemMeta', but my import is fine, i'm pretty sure?

import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.attribute.AttributeModifier;```
west socket
#

If you are, try File -> Invalidate Caches

#

Thatโ€™s assuming that itโ€™s an import issue and the method actually exists

fading stag
#

What is unrellij lol

west socket
random tendon
#

the api wasn't being imported as a module, just a library

#

god knows how the rest of my imports didn't complain

west socket
#

Ah

proud pebble
dark garnet
astral mauve
dark garnet
proud pebble
#

it happens

stuck hearth
#

That's a Compton classic

wind tapir
#

Hello, when I try to change a player's nametag, there is a NullPointerException, here is the code:


NametagEdit.getApi().setNametag(player, prefix, suffix);

simple, and here is the error:

silent trench
#

๐Ÿ‘€

wind tapir
#

I haven't nitro

#

wait im sending a pastebin

silent trench
#

Caused by: java.lang.ClassNotFoundException: com.nametagedit.plugin.NametagEdit
Depending on how you wanted to use the API, it's not available at runtime

wind tapir
#

what ?

silent trench
#

The API must be either bundled or as another plugin

wind tapir
#

        <dependency>
            <groupId>com.nametagedit</groupId>
            <artifactId>nametagedit</artifactId>
            <version>4.4.16</version>
        </dependency>

silent trench
#

Send build.gradle or pom.xml ||๐Ÿคฎ||

wind tapir
#

bro....

#

i just forgot to put the plugin in the plugins folder

silent trench
#

๐Ÿ˜„

wind tapir
#

okay, now it's working, thanks bro

silent trench
#

np

dark garnet
#
try {
    acceptingNewField.setAccessible(true);
    acceptingNewField.set(null, true);
    acceptingNewField.setAccessible(false);
} catch (final IllegalAccessException e) {
    sendError("set");
    e.printStackTrace();
    return this;
}
Enchantment.registerEnchantment(enchantment);
Enchantment.stopAcceptingRegistrations();
item.addUnsafeEnchantment(enchantment, 1);
```error at `Enchantment.stopAcceptingRegistrations();` because bukkit already built all of the enchantments, so im not sure how i can register my own
dark garnet
hollow stirrup
#

help me [21:28:03 WARN]: [PlaceholderAPI] Plugin PlaceholderAPI v2.11.3 generated an exception whilst handling plugin message

river solstice
#

And this error doesnt say anything

hollow stirrup
#

I send it to you by md?

river solstice
#

What

#

No

hollow stirrup
#

ok

dark garnet
nocturne slate
#

can any people help me on a problem?

dusky harness
neat pierBOT
#
FAQ Answer:
ยป Give the helpers some details
ยป Ask suitable questions
ยป Be polite
ยป Wait

Source

dark garnet
#

im having trouble with using enchantments to store data cause of conflicting enchantment ids/names

#

if 2 items use the same data key name, then it break, cause the enchantment is registered twice :(

#

hurry up dkim omg so slow i hate waiting!!11111!!1!1!!!

dark garnet
# dusky harness what is data key name

i want data to be stored like a Map<String, String>, so the enchantment key (int) is the hashcode of the key string, and the name of the enchantment is the value string

dusky harness
#

shouldn't the value be the whole map

#

and the key is the key