#help-development

1 messages · Page 1284 of 1

main basin
#

1.13 and above

wet breach
#

sigh, another one of those, good luck I suppose

#

no point in trying to support all those except make more work for yourself 😉

chrome beacon
#

yeah

main basin
chrome beacon
#

Write it manually and reload maven

#

and make sure you used the --remapped flag

main basin
#

a tnxs now its working

umbral sable
#

How can I apply the cooldown effect to 1 stack of items, but not others of the same Material/type without having to resort to tricks like using a different material, but texturing it the same in a texturepack?

#

I've tried player.setCoolDown(<ItemStack>, <Length>), but it applies it to all of them

sly topaz
#

isn't cooldown item component based now or am I crazy

chrome beacon
#

There is a component for that, yes

#

It's the same as all the other spigot api versions

#

but with 1.12.2-SNAPSHOT as the version

umbral sable
umbral sable
# umbral sable I've tried `player.setCoolDown(<ItemStack>, <Length>)`, but it applies it to all...

Also, is it applying to items of the same material other than the itemstack itself a bug or intended? It seems to imply the prior in the docs:

void setCooldown(ItemStack item, int ticks) { /* ... */ } // Set a cooldown on the specified item for a certain amount of ticks.
void setCooldown(Material material, int ticks) { /* ... */ } // Set a cooldown on the specified material for a certain amount of ticks.
#

What do you mean by that? If you mean getting the spigot version you have to change the spigot plugin version to smth like this (I think this is a valid package, can't check rn):

  <dependencies>
      <dependency>
          <groupId>org.spigotmc</groupId>
          <artifactId>spigot-api</artifactId>
          <version>1.12.2-SNAPSHOT</version>
          <scope>provided</scope>
      </dependency>
  </dependencies>

If you're using an IDE like IntelliJ IDEA or Eclipse it may install it for you

chrome beacon
#

Yeah they don't really know what they're doing

orchid gazelle
#

Is this the real FBI?

chrome beacon
remote swallow
#

olivo what crimes did you comit

umbral sable
chrome beacon
#

ItzAbood69

pastel nova
#

guys does anyone know a plugin to create cinematic views? play.wynncraft.com uses those but I cant figure out how to

umbral sable
orchid gazelle
#

Can you not arrest me pls?

umbral sable
#

You could probably just copy the camera movement

orchid gazelle
#

I haven't paid my parking ticket today because the fine for the parking space right next to the hotel is lower than what the hotel asks for per day lmao

pastel nova
#

mh i see, so thats smth wynncraft made up themselves

umbral sable
orchid gazelle
#

20€/day for hotel parking space and 18.5€ ticket fine for parking wrongly

#

Lmao

#

Fools

#

The best part is: I didn't even get one

umbral sable
pastel nova
#

no yeah i already looked it on google, but since i didnt find anything close to it, i though maybe people would know some niche plugins

#

ill make that too then i guess

umbral sable
umbral sable
pastel nova
#

ill see, i just need a way to play a cutscenes to all players in the lobby

umbral sable
chrome beacon
#

It is part of the nbt updates

#

you can check the mc wiki

pastel nova
#

oh wait thats 10$

#

no im not paying, ill try to find a free alternative

umbral sable
umbral sable
umbral sable
#

Is this like a genuine bug that I should report since it's triggering for all items despite it being possible to trigger for just one using this new NBT method?

#

Or am I genuinely just missing smth

young knoll
#

Did you apply a cooldown group to the UseCooldownComponent

umbral sable
young knoll
#

I believe that is required

umbral sable
umbral sable
#

Tried using it here: #help-server message, but I wasn't aware that I'd also have to create a group on top of that

umbral sable
umbral sable
young knoll
#

Well presumably if it doesn’t have a group it’ll just apply to all items of the type

#

Idk I haven’t tried it

spiral magnet
#

file creation/loading issue

I am a little stuck, I have my plugin fully working locally, but when I throw it onto a pebblehost server it gives me problems

it is somehow creating an inaccessable file called <pluginName>/players/<playername>.yml instead of creating <playername>.yml inside the <pluginName>/players folder

is this something that anyone already has theories how to solve? I can share code as needed.

umbral sable
#

but it should already have a group for that one sole one

umbral sable
#

it's experimental and while it should work and be supported soon, I'd really rather not

#

especially since there should be a function that does it already

main basin
young knoll
#

I mean if you don’t want to even try setting a cooldown group then ¯_(ツ)_/¯

potent crescent
#

guys what is thus porplem

thorn isle
#

in the absence of a group, the cooldown affects the material as a whole

spiral magnet
# thorn isle how are you creating the file

EchoConfigSection is a configurationSection wrapper

File file = new File(ChatHookPlugin.getPluginInstance().getDataFolder().toString()+"/players/"+player.getName().toString()+".yml");
    EchoConfigSection config = new EchoConfigSection(file);

and then later I save it via config.save()

thorn isle
#

there are several issues with this

#

first, you are assuming the file separator char to be /

#

use File.separator or File.separatorChar

#

it can be different on different systems

spiral magnet
#

ahh, that is probably my solution then

thorn isle
#

toString is also not ideal here

sly topaz
#

or just use Path#resolve instead, or the File constructor with the varargs

spiral magnet
#

I had tried \ and /, didn't event think about generic seperators

thorn isle
#

either use Path ^ or use the File constructor that accepts a parent file and a child path

young knoll
#

The file constructor should replace the / for you

potent crescent
sly topaz
#

that's a horrible paste service

potent crescent
sly topaz
#

I am not sure what your problem is, it says it built the thing successfully

potent crescent
sly topaz
young knoll
#

[INFO] Total time: ١١.١٩٥ s

#

What is that font

sly topaz
#

cosmic sans

sly topaz
potent crescent
young knoll
#

I just copied the text

sly topaz
#

I didn't know discord preserved format like that lol

young knoll
#

I assume they are some wacky Unicode characters

potent crescent
#

The POM for org.apache.maven:maven-plugin-api🫙2.2.1 is invalid, transitive dependencies (if any) will not be available: 1 problem was encountered while building the effective model

trim quest
umbral sable
potent crescent
#

i cant send a screenshot here

sly topaz
undone axleBOT
#

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

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

potent crescent
young knoll
#

U+0661

potent crescent
#

idk why evrey thing is red

#

lol

trim quest
#

you are not showing red area

potent crescent
umbral sable
# young knoll Did you apply a cooldown group to the UseCooldownComponent
        final ItemMeta poppedTotemMeta = poppedTotemItem.getItemMeta();
        final UseCooldownComponent cooldown = poppedTotemMeta.getUseCooldown(); // Not null since it isn't nullable
        cooldown.setCooldownGroup(new NamespacedKey(plugin, "unique-itemcd")); // Not sure if there's a specific way to do it so I'ma assume not
        cooldown.setCooldownSeconds(20.0f);
        poppedTotemMeta.setUseCooldown(cooldown);

        final ItemStack newPoppedTotem = new ItemStack(Material.TOTEM_OF_UNDYING, 1);
        newPoppedTotem.setItemMeta(poppedTotemMeta);
        plugin.getServer().getScheduler().runTaskLater(plugin, () -> {
            player.getInventory().setItem(poppedTotemHand, newPoppedTotem);
            //player.setCooldown(newPoppedTotem, poppedTotemType.getPoppedTotem().POP_EFFECT_DURATION);
        }, 1L);

This doesn't apply it to everything of the same material as you guys said it would, but rather applies it to nothing. This is true with or without setting a group.

trim quest
#

sometimes intellij not refactoring package names after you change their names with "refactor"

#

maybe your problem is about import or package ??? idk

#

this just happened to me

potent crescent
#

so what should i do

trim quest
#

intellij recognize old jar as dependency in this scenario

#

maybe we can see your import statements ?

umbral sable
sly topaz
#

I also have never used it before

#

try with commands first, they're just components

#

if that works, then translate that to whatever API calls you need to make ig

umbral sable
potent crescent
#

now the proplem where in pom. xml or what should i change to be work

trim quest
#

i want to check that if im correct

potent crescent
#

ops

trim quest
#

asd

#

use this

remote swallow
#

?paste use a paste instead

undone axleBOT
potent crescent
chrome beacon
#

Looks like you have the code in the wrong folders

#

needs to be /src/main/java

potent crescent
chrome beacon
#

and /src/main/resources

trim quest
potent crescent
#

i did

trim quest
#

interesting.

potent crescent
#

maybe its gradel?

#

Or does this have nothing to do with it?

trim quest
#

did you move your packages into src/main/java

#

as olivio said

potent crescent
#

yes but thats will do a worngs

#

ill send u the src

#

of plugin

young knoll
#

lol they aren’t using a build tool at all

#

💀

potent crescent
#

I'm trying to make it meaven

#

iv a jar of plugin but another version Does it help me?

trim quest
#

you can still make it work if you move these packages correctly

#

you have to set your dependencies

thorn isle
#

public Integer boundsRadius[] = {0,0,0,0}; // x,y,z, radius

#

into the trash

#

don't bother building it

potent crescent
trim quest
#

you need buildtools first of all

potent crescent
#

i tried to do it but it will be some gray codes

potent crescent
trim quest
#

if they are using spigot-api you dont need buildtools

#

if im correct

#

you have to find

#

im speaking general

#

i didnt observe this project

thorn isle
#

i did and i wish i hadn't

young knoll
#

What is this madness

potent crescent
#

dose jar of plugin helps me for anything

thorn isle
#

it doesn't seem like the author knows about primitive types

potent crescent
#

or not

thorn isle
#

everything looks to be a wrapper

young knoll
#

Maybe they are just too advanced

#

Primitive types? Pfft what do you think I am some sort of caveman

potent crescent
#

@trim quest Can I benefit from the jar file? I'm trying to find the libraries for the plugin but I can't find them.

trim quest
potent crescent
#

I have been trying for 3 months

potent crescent
chrome beacon
#

BuildTools isn't required if you just depend on the api

potent crescent
#

there's just a 2 differents blocks

#

all of plugin

#

evreything good but there's some gray codes make the plugin not. work at game

thorn isle
potent crescent
thorn isle
#

by compiling it and seeing the errors it throws

potent crescent
#

but its not work

trim quest
#

you have to observe code for example he have sqlite, then you have to add sqlite connector for example

thorn isle
#

then you're not missing any classes or libraries

young knoll
#

Spigot has the SQLite driver built in

chrome beacon
#

just get a plugin off spigotmc or smth

#

Why are you even trying to compile that specific one from Github

trim quest
potent crescent
young knoll
#

I believe it also has the MySQL driver built in

thorn isle
#

someone's first plugin from 2016 without any build tool definitely shouldn't be your first pick as your own first project

chrome beacon
#

Why that plugin specifically

thorn isle
#

atp you're better off writing the plugin yourself

potent crescent
trim quest
thorn isle
#

LGTM

potent crescent
chrome beacon
#

"your" plugin

#

yes

potent crescent
#

not. my

trim quest
#

its our now

thorn isle
#

i'm surprised he used an int there

potent crescent
#

alr alr. lol

#

haaha

young knoll
#

I wonder why so much is commented out

#

It’s like they were still working on it but then decided to throw it on GitHub and die

potent crescent
thorn isle
#

the state of affairs for 1.12 servers must be incredibly desperate

main basin
trim quest
# potent crescent no its fine

as vcs2 said you dont need to start someones project, first of all you have to build your java knowledge. Maybe someones project is too advanced to you or he is fallowing bad practices etc etc.

chrome beacon
potent crescent
young knoll
#

I prefer to send videos as text

chrome beacon
#

make sure the dep info is correct

thorn isle
#

you can always pay someone with the time and know how to build it

umbral sable
thorn isle
#

oh yeah item use cooldown and cooldown are two different things

#

i wonder which one this is

#

one of them refers to the attack cooldown that causes you to do less damage per hit unless you let it "charge" back up

#

the other refers to the use cooldown that has a different indicator, for e.g. throwing ender pearls

sly topaz
#

use item cooldown is the thing ender pearls have

#

beat me to it, yeah

thorn isle
#

which one is HumanEntity::setCooldown(ItemStack, int)

potent crescent
#

Why does it say it is usless

young knoll
#

You’d think that would be the one to trigger the component version

#

But I have no idea

trim quest
#

im trying to refactor this plugin for you

thorn isle
#

for example i don't think a slot machine plugin is going to need an Arena class

young knoll
#

You’d have to check the source of CraftHumanEntity to see what it does

thorn isle
#

which is unused, yes

potent crescent
thorn isle
#

because the slot machine plugin doesn't use it

potent crescent
#

<33

umbral sable
umbral sable
thorn isle
#

that doesn't sound right

umbral sable
potent crescent
#

@trim quest do u need a jar of a plugin i have. for a 1.13 and 1.8 to 1.10

umbral sable
#

It would be misleading and tbh a bad function if it weren't

potent crescent
trim quest
#

this plugin is very messy btw 🙂

sly topaz
#

we've all started like that

#

they'll eventally get better at it

trim quest
#

im not gonna refactor it @potent crescent I'll just try to make it work

chrome beacon
potent crescent
chrome beacon
#

no wonder it doesn't resolve

#

it's a ciruclar dependency

potent crescent
#

@trim quest this plugin from 2015

chrome beacon
#

so?

#

There are plugins from 2015 with good code as well

#

also 1.16 did not exist in 2015

#

so it's definitely not

main basin
chrome beacon
chrome beacon
#

time to try it and see

potent crescent
main basin
#

yes thats works tnxs

#

now i need to see to fix my import net.minecraft.network.protocol.game.PacketPlayOutEntityMetadata;

chrome beacon
#

?mappings

undone axleBOT
trim quest
#

@potent crescent k i make it work

#

no error code at least.

#

will share it here

potent crescent
#

omg

#

Impossible, I've been working on it for 3 months and it didn't work.

trim quest
#

its not big deal for normal java dev.

potent crescent
#

did u make it 1.12.2?

trim quest
#

i make it for 1.16.5

potent crescent
#

brro

#

wtff

trim quest
#

as described in github

potent crescent
#

iv one for 1.16

#

iv jar of 1.16 and 1.8 to 1.10

#

1.16~1.13

#

wtf

#

ahh shit

#

can u change it to 1.12.2? its just rename a two blocks @trim quest

trim quest
#

ok

potent crescent
trim quest
#

you are welcome

#

i didnt test it but at least you can keep develop it.

potent crescent
#

tyy ❤️

potent crescent
#

Did I tire you out?

#

im sry

trim quest
#

because its not my code

chrome beacon
potent crescent
#

i

sly topaz
trim quest
#

habits

#

did you fetch @potent crescent

potent crescent
sly topaz
sly topaz
potent crescent
#

Don't rush just a minute

trim quest
#

i wont refactor

potent crescent
#

u can delete it

#

❤️ thank u uhelped me to much

trim quest
#

Spigot developers here, you can get better service from them than me

potent crescent
#

♥♥♥

dense geyser
#

is there a way to check if a listener is registered before registering it?

echo basalt
#

That's a great question

#

what's the use-case?

dense geyser
#

I have a list of listeners that may already be registered, some coming from another one of my packages. When I register the full list, some of them, already being registered, register twice and fire every event twice, was just looking if there was a way I could check if they were registered before registering them lol - cause idk if its better just unregistering them just to be safe before loading them in the full list

#

mmmm hello you 2

nova notch
dense geyser
#

fudged it, this works lmao

if (HandlerList.getRegisteredListeners(plugin).stream().map(RegisteredListener::getListener).anyMatch(v -> v.equals(this))) {
    Bukkit.getLogger().severe("EVENTS ALREADY REGISTERED");
}
buoyant viper
leaden pebble
#

how to make ravager rideable as a horse

warm mica
#

Ask for his consent

young knoll
#

PlayerInteractEntityEvent -> add player as passenger

#

Though you’ll need NMS to make it controllable

sly topaz
#

Then again, a listener accidentally being registered twice sounds like a code smell to me

mellow edge
potent crescent
#

i compile a plugin and evreything is good but in game the plugin is not work how can i know why?

worldly ice
#

?notworking

undone axleBOT
#

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

orchid gazelle
potent crescent
orchid gazelle
#

Does it load?

worldly ice
#

yeah check /plugins

#

and see if your plugin is in there

potent crescent
#

yes

#

and green plugin

potent crescent
orchid gazelle
#

We cannot know what your feature is and what exactly is not working

worldly ice
#

send code

#

?paste

undone axleBOT
potent crescent
potent crescent
worldly ice
#

anything you would think would help us diagnose the issue

worldly ice
potent crescent
potent crescent
worldly ice
#

is there a reason why you have to manually compile it instead of using a precompiled jar?

potent crescent
#

yp im on 1.12.2 and the plugin jar made for 1.8~1.10 and 1.13~1.16

worldly ice
#

so

#

yeah i see now why it doesn't work

#

it wasn't made for 1.12

orchid gazelle
#

💀

potent crescent
potent crescent
#

vut seem code

worldly ice
#

if all you did was recompile for 1.12 without changing any code it will not work

#

it explicitly says that it is not compatible with 1.12, if you need it to be you have to modify the code somewhere to make it compatible

worldly ice
#

are you able to execute the /zslot command?

worldly ice
potent crescent
#

Material.CONCRETE instead of Material.WHITE_CONCRETE
Material.WALL_SIGN instead of Material.SPRUCE_WALL_SIGN

worldly ice
#

is that all?

potent crescent
#

These errors were present.

worldly ice
#

i would also just confirm the plugin works on 1.8 and 1.13 just to make sure it's not an issue with the plugin itself

worldly ice
#

i would ctrl+f any instances of WHITE_CONCRETE and SPRUCE_WALL_SIGN in case it checks any of those as strings or something

#

it shouldn't because if it does that's just bad plugin design but mabye

potent crescent
#

i think there's something i need to change it. but idk where is cz there's no erors

worldly ice
#

depending on what IDE you're using you could either use ctrl+f or ctrl+shift+f to do a project-wide search

#

if you really want to you could grep or ripgrep it

potent crescent
#

anything there is eror?

worldly ice
#

any instances of WHITE_CONCRETE and SPRUCE_WALL_SIGN

potent crescent
worldly ice
#

then i'd just debug specific features until you can get them working

#

there's probably a reason why 1.12 isn't supported

potent crescent
#

can i dm message cz here i can't send a image

worldly ice
#

?img

undone axleBOT
#

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

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

potent crescent
#

5m brb

worldly ice
#

what am i looking at in that image

orchid gazelle
potent crescent
#

red point

worldly ice
#

that's a breakpoint

#

for debugging

potent crescent
#

is it. normally

worldly ice
#

you can disable it it doesn't really matter

#

it only matters when you're running in debug mode

potent crescent
#

ale so how can i find the erors

worldly ice
#

if you're able to compile successfully you don't have any errors

potent crescent
#

so why it's not work in minecraft

#

it dosen't say there's a error

worldly ice
#

again

#

there's likely a reason why it doesn't support 1.12

#

because it's not as simple of a fix as just changing two things

#

i doubt it uses reflection but if it does (and just throws away the errors for some reason) it might be that

#

just debug specific features or methods until you are able to figure out what's causing the issue

potent crescent
#

if its need a more change it should. tell me there's a some erors

#

or?

worldly ice
#

either:

  • there are runtime errors, but the plugin author throws them away (which is really bad design and makes it difficult to debug)
  • there are other compatibility issues like methods not doing what they did in older versions or dependency plugins not working in 1.12
fossil flax
#

Does anyone know why when you teleport a player to a Location with yaw and pitch, after a plugin or server restart the player always faces south?

sly topaz
#

Players should be spawned at the same location and facing they were at when they were kicked

#

You probably have a plugin doing that, make sure to test only with your plug-in on the server

fossil flax
# sly topaz You probably have a plugin doing that, make sure to test only with your plug-in ...

already did, i set the spawn and after i reload the plugin it always make player teleport facing south

World world = instance.getServer().getWorld(instance.getConfigManager().getSavesFile().getString("spawn_teleport.world"));
double posX = instance.getConfigManager().getSavesFile().getDouble("spawn_teleport.x");
double posY = instance.getConfigManager().getSavesFile().getDouble("spawn_teleport.y");
double posZ = instance.getConfigManager().getSavesFile().getDouble("spawn_teleport.z");
float yaw = instance.getConfigManager().getSavesFile().getFloat("spawn_teleport.yaw");
float pitch = instance.getConfigManager().getSavesFile().getFloat("spawn_teleport.pitch");
p.teleport(new Location(world, posX, posY, posZ, yaw, pitch));```
fossil flax
worldly ice
#

what direction should they be facing?

sly topaz
#

Wouldn’t that always teleport one south? It is 0 degree yaw

fossil flax
#

any direction i faced while running the command /setspawn

sly topaz
#

Though it should also make them look straight down to the ground if I got my facing correctly

worldly ice
sly topaz
worldly ice
#

something's wrong with your saving code then

worldly ice
#

yeah because your pitch is 90

#

pitch is up and down rotation, yaw is side to side

fossil flax
#
instance.getConfigManager().getSavesFile().set("spawn_teleport.world", p.getWorld().getName());
instance.getConfigManager().getSavesFile().set("spawn_teleport.x", p.getLocation().getX());
instance.getConfigManager().getSavesFile().set("spawn_teleport.y", p.getLocation().getY());
instance.getConfigManager().getSavesFile().set("spawn_teleport.z", p.getLocation().getZ());
instance.getConfigManager().getSavesFile().set("spawn_teleport.yaw", p.getLocation().getYaw());
instance.getConfigManager().getSavesFile().set("spawn_teleport.pitch", p.getLocation().getPitch());
instance.getConfigManager().saveFile(instance.getConfigManager().getSavesFile(), new File(instance.getDataFolder(), "saves.yml"));
p.sendMessage(Color.Colorize(instance.getConfigManager().getMessageFile().getString("spawn_set")));```
worldly ice
#

try using Player#getYaw and #getPitch

#

also i would cache the player's location because it creates a clone every single time you call getLocation

#

and it also makes the code a little cleaner

sly topaz
#

Also, use constants

fossil flax
#

it saves on the file when i set the spawn but the plugin don't read the yaw and pitch

sly topaz
fossil flax
#

when i do /plugin reload it stopped reading the yaw and pitch when player use /spawn

#

and always face south

worldly ice
#

so somewhere else the config is being overrode?

#

wait /plugin reload is a command?

sly topaz
#

That sounds like you’re resetting the config somewhere, yeah. Config values don’t just get reset

fossil flax
worldly ice
#

oh i see

#

i wouldn't name my root plugin command to just "plugin" but that's besides the point

sly topaz
#

I’d recommend looking at how other setspawn plug-ins work, there’s bunch of them in spigot

fossil flax
worldly ice
#

the same issue happens when you restart the server?

sly topaz
#

We could probably find what the issue is if we could see more of how the config manager works but it’d take forever by looking file by file

worldly ice
#

yeah

sly topaz
#

Either figure it out by looking at other plugins source code or put your source on GitHub so it is more easily navigable

worldly ice
#

ctrl+f "spawn_teleport.yaw" and "spawn_teleport.pitch" and see where you're changing it

fossil flax
# sly topaz We could probably find what the issue is if we could see more of how the config ...

Config manager:

public class ConfigManager {

    private final Main instance;
    private final FileConfiguration configFile;
    private final FileConfiguration messageFile;
    private final FileConfiguration savesFile;

    public ConfigManager(Main instance) {
        this.instance = instance;
        this.configFile = saveConfig("config.yml");
        this.messageFile = saveConfig("message.yml");
        this.savesFile = saveConfig("saves.yml");
    }

    public void saveFile(FileConfiguration configuration, File file) {
        try {
            configuration.save(file);
        } catch (IOException ex) {
            ex.fillInStackTrace();
        }
    }

    private FileConfiguration saveConfig(String configName) {
        File file = new File(instance.getDataFolder(), configName);
        if (!file.exists()) {
            instance.saveResource(configName, false);
        }
        return loadConfig(file);
    }

    public void reloadConfig(FileConfiguration configuration, File file) {
        try {
            configuration.load(file);
        } catch (IOException | InvalidConfigurationException ex) {
            ex.fillInStackTrace();
        }
    }

    public FileConfiguration loadConfig(File file) {
        YamlConfiguration configuration = new YamlConfiguration();
        try {
            configuration.load(file);
        } catch (IOException | InvalidConfigurationException ex) {
            ex.fillInStackTrace();
        }
        return configuration;
    }

    public FileConfiguration getConfigFile() {
        return configFile;
    }
    public FileConfiguration getMessageFile() {
        return messageFile;
    }
    public FileConfiguration getSavesFile() {
        return savesFile;
    }
}```

saves.yml:

> spawn_teleport:
>   world: world
>   x: 235.6768466165851
>   y: 51.0
>   z: 1355.0127248121617
>   yaw: 88.70868
>   pitch: 1.5377898
sly topaz
#

Navigating through code trees posted on discord messages is just painful lol

worldly ice
#

real

sly topaz
#

Here’s a plug-in if you want to take example of it

lilac dagger
#

speaking of always spawn, i should make an update with some fixes

brave harbor
#

is it possible to change the biome of an area after world generation? I have tried using World#setBiome and Block#setBiome thorugh a command, and neither do anything...

sullen marlin
#

did you relog?

#

there's no packet to update the biome on the client

brave harbor
#

oh... let me try

#

yeah no, still not changing

young knoll
#

There definitely is a way to do it live

#

/setbiome does

sullen marlin
sullen marlin
young knoll
#

Maybe it’s /fillbiome

sullen marlin
#

looks like there's a packet to resend the whole chunk now

young knoll
#

Hasn’t there always been

#

Re sending a chunk is basically the same as sending it

brave harbor
sullen marlin
#

*chunk biome

sullen marlin
brave harbor
#

api is 1.21.4R0.1-SNAPSHOT

#

my server is a paper server, but paper is still a fork of spigot... right?

#

or was their split drastic enough to make major methods not work?

sullen marlin
#

could be, who knows

rotund ravine
#

Ask paper for help if ur using paper

#

Spigot if ur using spigot

#

Simple as that

brave harbor
#

alr

dense geyser
sly topaz
#

then again, if you need to unregister events outside of disabling functionality, I feel like there's something wrong out there in that code

buoyant viper
#

looking at NamespacedKey#fromString(String) and NamespacedKey.fromString(String, Plugin) ... if i call fromString("foo:bar", null) (or fromString("foo:bar"), will i get a NamespacedKey whose namespace is foo and key is bar ? a fully formatted key with null default namespace seems to be the only case that isnt documented (however, null is documented to technically end up in the minecraft namespace)

#

im looking on Stash and it looks like it should pan out that way, just wanted to know if anyone knew the answer before i went ahead and tried it

ivory sleet
#

fromString("foo:bar") this 1 will def path bar to the namespace/group foo

#

not sure abt the former one where u pass null as well

buoyant viper
#

fromString(String) just calls fromString(String, (Plugin) null) so it should be the same

ivory sleet
#

ah alr then

ivory sleet
buoyant viper
#

hm

ivory sleet
buoyant viper
#

ye

#

i was really just looking to replace my usage of the constructor NamespacedKey(String, String) so ide would stop yelling at me for @Deprecated

ivory sleet
#

🥲

buoyant viper
#

its for inter-op with a mod and im using its namespace instead of plugin's for registries

buoyant viper
#

although tbh i dont need to really be storing any of it since im just a basic I/O system

buoyant viper
rotund ravine
#

Same, but it’ll stop yelling at u 💪🏻

#

Orrr fork spigot and remove @deprecsted

buoyant viper
#

once i actually get maintainer status for this project im just going to completely gut this class specifically LOL

undone yarrow
#

any idea what the event is called for shulker_bullets (or projectiles in general) being destroyed by lava?

#

I tried entity combusts, doesn't get fired

#

I tried entity killed, dies, damaged, despawns, none of them trigger

undone yarrow
#

nvm Im switching to fireballs

#

nvm fireballs have an impossible to remove fire effect...

#

Anyone know any projectiles that don't slow down over long distances (even when gravity is off)? Snowballs slow down, fireballs don't and neither do shulker bullets, but the latter 2 both have other issues

smoky anchor
#

If you don't want snowballs to ever slow down, simply set their motion every tick

undone yarrow
#

how do I know what velocity I need to give to the snowball though, I don't know their initial velocity after a few ticks?

#

and how do I get every snowball in the server

smoky anchor
#

When a snowball is spawned, store its initial motion into some PDC
Then World#getEntitiesByClass and set their motion based on the PDC value

lost matrix
#

I would store them in a data structure and not fetch them every tick.
What is @undone yarrow trying to do in the first place? 😄

undone yarrow
#

an airstrike with explosive projectiles

#

I ditched snowballs because they slow down and they have some funky knockback mechanics to explosions, so I switched to shulker bullets which don't slow down, but they sometimes magically disappear (no event detects that), and I can't hide them, so I switched to fireballs but they're always on fire, so now I'm back at snowballs...

lost matrix
#

How about you use display entities?

undone yarrow
#

they don't detect collision

#

I put the display entity on the projectile as passenger

lost matrix
#

If the ground doesnt change while they are flying, you can get the block they should explode at very cheap.
Unless you really need dynamic collision detection, in which case a projectile or falling block is viable.

undone yarrow
#

the ground does change

#

that's the main issue with display ents

#

hm a falling block? Maybe. nvm they slow down just like snowballs

bold nebula
#

Im looking for a packet that let rotate player pitch/yaw without locking the player movement and screen, i already tried teleport flags but they always lock the player

#

trying to simulate a smooth recoil

lost matrix
undone yarrow
#

isn't raytracing every tick for multiple entities kinda heavy on performance? (entities can be 100's of blocks away from the nearest block in their facing direction)

lost matrix
lost matrix
bold nebula
lost matrix
echo basalt
#

pretty sure I stole some crazy raytrace code once

#

oh yeah @lost matrix now that my abilities system is done

#

wanna compare approaches?»

lost matrix
echo basalt
#

cool

#

do we like hop in a vc and flex code or just talk about concepts here

thorn isle
#

well, at least the initial kick; if you want to slowly "pull back" the crosshair to where it was before recoil, that's going to be difficult to do smoothly

#

still doable if you do it really slowly but that might just make aiming even more difficult

young knoll
#

Make the recoil apply to the whole body

#

Yeet the player backwards

dark moth
#

my config file doesnt load

#

how do i fix that

smoky anchor
#

?nocode

undone axleBOT
#

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

thorn isle
#

have you tried tossing salt over your shoulder

potent crescent
#

Is there anyone who makes custom plugins? dm me

tall dragon
#

?services

undone axleBOT
zealous snow
potent crescent
chrome beacon
strong sable
#

I can't change plufin icon after uploading??

chrome beacon
#

Enable 2FA

slender elbow
fickle mantle
#

what the best way to drop a Item without them "flying" away?
world.dropItemNaturally lets them fly away (even if i set the Velocity to a Zerovector)
world.spawnEntity doens't allow them to stack

sly topaz
fickle mantle
#

there just seperate item entites, not a stack of them

#

im trying to code a bedwars spawner

sly topaz
fickle mantle
#

yeah

sly topaz
#

dropItem shouldn't add any velocity to them

worldly ice
#

if you're spawning them slightly inside a block they'll erratically get pushed out of it

slender elbow
#

lol, dropItemNaturally doesn't add velocity to the item, and it simply calls dropItem

#

it just adds some random value between -.25 to .25 to the passed location

#

least misleading api method

sly topaz
#

is that so, I would've assumed it duplicated the HumanEntity#dropItem behavior

slender elbow
#

ngl i have no idea what dropItemNaturally is meant to do after seeing this

#

Drops an item at the specified Location with a random offset
yep, okay checks out

#

why is this method needed lmao

sly topaz
#

eh, if people haven't complained till now, it probably means it simulates the behavior well enough for nobody to care lol

#

so apparently this is also how vanilla does it on its dropItem methods

thorn isle
#

that's odd, i use it a lot and it looks like it spawns with a random velocity to me

worldly ingot
#

It's a very old method

#

though with that being said, it's probably still viable API because the details of the offset applied to an item when it drops from a block is a server implementation detail

dawn flower
#

how do i make blast prot not affect wind charges

zealous snow
thorn isle
#

just use transfer packets to dump your players to a limbo/lobby while your proxy is restarting, if you're afraid of losing players because of network-wide restarts

#

unless you have something terrible and dumb on the proxy it should restart in like ~20s anyway

zealous snow
sly topaz
#

wonder if anyone tried to optimize server startup by using things like CDS and custom java runtimes

undone yarrow
sly topaz
zealous snow
sly topaz
#

well, in that case you just got to use good old proxy transfer and partial restarts

zealous snow
sly topaz
#

not a sensible solution really

slender elbow
sly topaz
zealous snow
dawn flower
#

i thought it just gives you velocity

sly topaz
# zealous snow how?

Emily already explained, it is just a way for someone to blow up the proxy accidentally

zealous snow
sly topaz
#

if it does velocity then just push the entity when it hits them I guess

#

you could modify the enchantment itself to not apply to wind charges in some way I bet, just not all that practical to do

dawn flower
#

wind charges are technically explosion knockback

#

is there an event for knockback or something

sly topaz
#

there's the EntityKnockbackEvent, yeah

dawn flower
#

alr

sly topaz
#

there's also the EntityKnockbackByEntityEvent which may be triggered in this case as well

bold nebula
#

Im looking for a packet that let rotate player pitch/yaw without locking the player movement and screen, i already tried teleport flags but they always lock the player

pure dagger
#

but when you dropItemNaturally it spawns in the middle but goes in some directio n

hollow oxide
#

Hi,
how do I add items attribute in 1.21?

it seems like I need an AttributeModifier but it's supposed to be deprecated since 1.21

'AttributeModifier(java.util.UUID, java.lang.String, double, org.bukkit.attribute.AttributeModifier.Operation)' is deprecated since version 1.21 and marked for removal


AttributeModifier damageModifier = new AttributeModifier(
                UUID.randomUUID(),
                "generic.attack_damage",
                5.0,
                AttributeModifier.Operation.ADD_NUMBER);

        meta.addAttributeModifier(Attribute.GENERIC_ATTACK_DAMAGE, damageModifier);

thx

worldly ice
#

i believe the way to do it in modern versions has a NamespacedKey instead of a UUID

#

lemme double check

#

use that constructor instead

hollow oxide
#

yeah thx a lot it was what i was looking for

fluid cypress
#

is there a way to programatically know if a block emits light? without having to manually check the material or something

worldly ingot
#

I believe there's a method on BlockData if I'm remembering correctly

#

If 0, doesn't emit light :p

vagrant stratus
#
[WARNING] The POM for org.eclipse.jgit:org.eclipse.jgit:jar:5.13.2.202306221912-r is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] Error injecting: net.md_5.scriptus.DescribeMojo
java.lang.NoClassDefFoundError: org/eclipse/jgit/errors/RepositoryNotFoundException```

Any ideas? Trying to compile 1.21.6. Made sure I have the latest BuildTools too
sullen marlin
#

Maven version?

vagrant stratus
#

3.9.6

it's what's automatically downloaded

sullen marlin
#

No idea. Delete ~/.m2/repository/org/eclipse

vagrant stratus
#

Different error this time.
Tf

wet breach
thorn isle
#

playstation 3

elfin isle
umbral ridge
#

playstation 1

summer scroll
#

I basically want to change Minecraft's fishing mechanics and I want to make player not confused when fishing. Is there in any way to make a FishingHook never got bite?

summer scroll
unique shuttle
young knoll
#

What version?

unique shuttle
#

lasted 1.21.6

#

CraftBukkit version 4509-Spigot-d5ca3f8-58bf15a (MC: 1.21.6) (Implementing API version 1.21.6-R0.1-SNAPSHOT)

young knoll
#

Don't think it has been reported

#

?jira

undone axleBOT
mortal hare
#

when you create new classes do you usually guys use constructors only for field initialization and put everything else under static factory methods or do you initialize fields with some logic inside the contructor?

worldly ingot
#

Depends

#

You ask a lot of questions where the answer is "depends" KEKW

#

Generally speaking you should keep your constructors relatively clean. Factory methods are useful if you want different preset ways to construct an object that make things more clear with a method name

#

If you don't need that clarity, then the factory methods are just there for syntax sugar, which is fine too. But keep logic out of your constructors where possible

vagrant stratus
#

put all of the logic in the constructor @worldly ingot /s

undone yarrow
#

Is it possible to change the shadow on block displays? See the img, the bottom left face is much darker than the other 2. I'd like for the entire block display entity to be the same brightness everywhere.

hybrid spoke
#

for what do you need a constructor if you have static

mortal hare
hybrid spoke
#

i dont have fields, i only have local variables

mortal hare
#

then you dont need class at all

hybrid spoke
#

correct

worldly ingot
#

sommer just writes in C Kappa

mortal hare
#

program in c

#

pointers assembly manage your memory with malloc() and free()

hybrid spoke
#

my whole plugin is decorated with native

mortal hare
#

my man is masochist

unique shuttle
undone yarrow
#

yeah I already set it to max brightness

#

hm that sucks, so there's no way?

mortal hare
#

probs the nerdiest thing i've ever said

#

tbh

unique shuttle
worldly ingot
#

Well, at least if you're making a mod, you can absolutely change the lighting of an entity lol

#

But yeah you're pretty SOL when it comes to entity lighting from the server

unique shuttle
#

Yep

undone yarrow
#

what about shaders?

#

using a resource pack

#

could that change it for specific blocks?

unique shuttle
#

Does anyone know how I can execute a command or get the entered data? I still don’t know how this Dialog stuff works

unique shuttle
undone yarrow
#

how? lol

#

Never worked with shaders

unique shuttle
worldly ingot
#

So for example, new RunCommandAction("tellraw @a \"$(pro)\"") will be either tellraw @a "test true" or tellraw @a "test false" based on the user's selection

#

Conversely, you can use $(first) to get the value of the first key

mellow edge
#

If dialog system of spigot and paper is different then a wrapper is needed ig

#

right?

worldly ingot
#

It will be. Adventure will make their own

mellow edge
#

yeah, I talked to the guy

#

at their discord

worldly ingot
#

But there's no guarantee that even API added into Spigot since the start of this year will match what's in Paper

#

They don't pull from upstream anymore

mellow edge
#

they said they would for major things

worldly ingot
#

Yeah but what constitutes major. What one developer considers major may not be for then

#

It's a dice roll

mellow edge
#

it's just pain

worldly ingot
#

That's why I stopped making public plugins lol

#

Killed my motivation. Or at least what remained of it

mellow edge
#

so I assume you are making them for a server network

#

for paper I will now need multiple maven modules for any minor change

echo basalt
#

this dialog api looks so awful

ember robin
#

Hello I search an java developper for a custom plugin.
I'm french
For more detail mp discord

worldly ingot
mellow edge
#

I see 👀

worldly ingot
#

It's the last Minecraft job I'll do

mellow edge
#

great

worldly ingot
#

Going out into the real world after this lol. I want out of MC

echo basalt
#

are you happy at hypixel

#

it's a bit more "real" in the sense of it's a huge network

#

but it's still minecraft at the end of the day

worldly ingot
#

Yeah I'm fulfilled right now. Definitely the most real and the best I've been treated in the industry, bar none

#

So I'll stay here as long as I can

mellow edge
#

how long have you been working there?

worldly ingot
#

Nov of 2023, so a little over a year and a half

echo basalt
#

I'd appreciate hypixel a lot more if they hired me :p

#

jokes on me they'll never reply

lilac dagger
#

i wonder if i should try too

#

i think i'm alright at making minigames

unique shuttle
#

Never mind. It does work with commands from other plugins

worldly ingot
#

Yeah anything

#

If the player can run it, it's allowed

#

You don't have to use a command though if you don't want. You can use a custom event, which just sends a packet to the server. You can listen for it using the new event. PlayerCustomClickEvent

#

Of course you can use a command as well, but if you were making a command just to listen for user input, you don't have to do that anymore

unique shuttle
#

Amazing. Thank you very much

hybrid spoke
#

only the ones who try can succeed

worldly ingot
#

That's true. I applied with the assumption I wouldn't make it lol

fickle mantle
#

How can I drop multiple Items without them flying away but still stack?

dropItemNaturally() and setVelocity(new Vector(0,0,0)) doesnt work, since they won't stack

worldly ingot
#

dropItem()

fickle mantle
#

doesn't work either

#

tried it already

mellow edge
#

you want to make them fall right down?

fickle mantle
#

doesn't matter actually

#

just wanna make a simple bedwars spawner tho

#

can't be that difficult xd

mellow edge
#

LOL I have that exact method here

fickle mantle
#

ohhh

#

would you mind helping me? :c that issue is so stupid, it can't be that hard xd

mellow edge
fickle mantle
#

weird

mellow edge
#

now do you mind telling what "isn't working"?

fickle mantle
#

they won't stack

mellow edge
#

do they have same nbt?

fickle mantle
#

i've drop the same itemstack in a scheduler

#

so i think they do

mellow edge
#

show code

#

and do you have any other plugins?

fickle mantle
#

how do you share code in dc?

fickle mantle
#

but they don't block anything like stacking items

#

thats not what i wanted to do sorry haha

mellow edge
#

basically you put three ` on each side of the code

fickle mantle
#
  ItemStack itemStack = new ItemBuilder(Material.GOLD_INGOT)
                                .setDisplayName("§6Gold")
                                .build();
                        Item dropped = Objects.requireNonNull(current.getWorld()).dropItem(current.clone().add(0.05, 1.2, 0.05), itemStack);
                        dropped.setVelocity(dropped.getVelocity().zero());
                        dropped.setItemStack(itemStack);
                        dropped.setVelocity(new Vector(0, 0, 0));
                        dropped.setUnlimitedLifetime(true);```
#

ahhhh thank s

mellow edge
#

put java there

#

nice ;)

fickle mantle
#

thank you :D

#

Oh i set the velocity twice

mellow edge
#

yeah

#

I do new Vector(0, 0, 0)

fickle mantle
#

but i don't think that affects the stacking procesS?

mellow edge
#

but that is certainly not the problem

fickle mantle
#

yeah i suppose

hybrid spoke
#

server settings maybe?

fickle mantle
#

everything else just stacks normally

#

they stack in my inventory tho and also when i Drop them manually as a player

hybrid spoke
#

they only wouldnt stack if they are not the same itemstack

mellow edge
#

what is the ItemBuilder (just wondering)

hybrid spoke
fickle mantle
fickle mantle
hybrid spoke
#

for the dropped item

fickle mantle
#

do you only see 1 line?

thorn isle
#

try simplifying the logic/item creation process until it's just dropItem(new ItemStack(Material.GOLD)) and see which part when removed causes it to behave as expected

#

at face value what you're doing should work

mellow edge
#

what if you try creating an ItemStack using normal method e.g.

ItemStack stack = new ItemStack(Material.BARRIER);
world.dropItem(Location, stack);

thorn isle
#

but since it doesn't, you need to get your hands dirty

#

i.e. fuck with it until it works

#

my first suspect would be your itembuilder, but try it and see

mellow edge
#

yes I agree

hybrid spoke
#

perhaps post it here

mellow edge
#

the only thing that the builder can do is to change some meta/nbt randomly

hybrid spoke
#

but then it wouldn't make sense that he can stack it in his inventory

#

if it's the same item coming from the same builder

fickle mantle
hybrid spoke
#

either way, give it to us so we can debug this through

mellow edge
#

Idk why they wouldn't stack then

hybrid spoke
#

?paste

undone axleBOT
fickle mantle
hybrid spoke
#

si

fickle mantle
fickle mantle
#

not yet

thorn isle
#

try it

mellow edge
#

and make sure to reload/restart the server!!!

fickle mantle
#

haha

#

i have to, its a bedwars plugin

hybrid spoke
#

don't haha on it. my last 5h of debugging was because i forgot to use the other constructor of my object and was wondering why it was still the old logic

#

i. was. in. pain.

fickle mantle
#

it works

#

only thing i changed was to use clone() on that itemstack and remove that second Velocity and the unlimitedlifetime

hybrid spoke
#

could it be the unlimitedlifetime then

fickle mantle
#

possibly

#

i dont know how it would affect the stacking

#

i probably don't wanna know tho xd

#

thanks guys x3

mellow edge
#

.clone is also convenient in a lot of cases you wouldn't thought

fickle mantle
#

never used it before actually

undone yarrow
#

How can I prevent my snowball projectiles from catching fire?

#

I tried the entity combusts event, and tried cancelling it but that didnt work, so I tried setting fire ticks to 0 during the event but that didnt change anything either

worldly ice
#

you could also try setting the duration in the event to 0

thorn isle
#

not sure if that event is even called for projectiles

worldly ice
#

yeah me neither

umbral sable
#

Probably a dumb question, but with getCategory being deprecated would someone be able to provide me an example of what they meant by using tags to identify whether an entity is undead or not?

#

And no, I'd really prefer not to evaluate against a manually created list of undead entities since I'd like it to update with the game and what the game identifies as undead

hybrid spoke
#

scoreboardtag probably? not sure

umbral sable
#

I also tried using namespacedkey to see if that's what they meant, but no

umbral sable
worldly ice
#

get the entity type and see if the tag includes that entity

#

and smite works against all "undead" mobs

umbral sable
#

thought it might've been monsters in general

worldly ice
#

something like Tag.ENTITY_TYPES_SENSITIVE_TO_SMITE.isTagged(entity.getType())

umbral sable
#

Works perfectly

native bramble
chrome beacon
#

Oh no abusing the inventory holder api

#

Anyways the code you sent doesn't seem to be the cause of your issue

#

?gui

native bramble
undone yarrow
#

But changing the fire duration inside the event doesnt change it

#

And neither does cancelling the event

karmic yacht
#

Hey guys I've written a few premium plugins that i sell on another website but I'm thinking of adding and selling them on spigot as well! However, I use an obfuscator (present in the allowed list). I was just wondering what the proper process of adding a new premium obfuscated resource. (I meet all requirements to uploading one)

chrome beacon
kind hatch
sly topaz
native bramble
remote swallow
#

paper has modified it to make holders not as bad to use

hybrid spoke
native bramble
#

im on paper actually, maybe problem in this?

hybrid spoke
#

?whereami

sly topaz
#

if you're on paper it is fine, but that's also a reason to ask for support on their server instead

#

we've recommending you to switch code that is perfectly fine on their platform

native bramble
#

i just dont thought that it can be a problem

hybrid spoke
sly topaz
hybrid spoke
#

i have no users, i'm aware of the inventory copying on update lol

sly topaz
#

the reason it is bad is because getting the holder of inventories which are backed by a block will create block state snapshots, which isn't a free operation. Paper fixed this by making the getHolder method have a boolean as to whether it requires the block state snapshot or not

karmic yacht
hybrid spoke
#

anyways, we're striving away from the original issue

sly topaz
#

so, doing this:

@EventHandler
public void onClick(InventoryOpenEvent event) {
  // this below is bad on spigot because it'll create block state snapshots
  if (event.getInventory().getHolder() instanceof MyCustomHolder holder)
  // meanwhile in Paper, you can get away with it by doing this:
  if (event.getInventory().getHolder(false) instanceof MyCustomHolder holder)
  // however this overload doesn't exist on Spigot so you'd be making your plugin incompatible
}
hybrid spoke
native bramble
hybrid spoke
#

so it's the interaction with the inventory, not that it does not open for them?

native bramble
#

if i op myself all is working

#

i have 0 permissions on plugin

hybrid spoke
#

can you show us the full context please? your interaction event and stuff?

native bramble
#

ok

#

i dont really know what to show u bc its just simple event

#

logger not showing in console if im not op, if im it shows

#

i disabled another PlayerInteractEvent's but no result

hybrid spoke
#

does any other interact event cancel if the player is not op?

#

because the code you provided looks perfectly fine and should work as long as all conditions are met

native bramble
#

problem that event not even triggered

sly topaz
#

do you have worldguard or something

native bramble
#

because logger stays in the first play

sly topaz
#

there might be a region flag disabling interaction

hybrid spoke
#

right, third party plugins could cancel the event from reaching yours

native bramble
#

have only coreprotect, protocollib and skinsrestorer

hybrid spoke
#

or better said cancelling the action

#

what is coreprotect?

sly topaz
#

coreprotect is a rollback plugin, shouldn't be the issue

native bramble
#

i will check another events

sly topaz
#

@native bramble try in a clean server

#

put just your plugin and try it out, that way we can rule out it being other plugins interfering

#

if the log isn't being reached at all, it could also be the listener not being registered, make sure to register it properly

hybrid spoke
#

well, it has to be registered, since he gets the log message, when he is op, as he said

#

so i bet there is some other event preventing the current handler from being reached if he is not op

native bramble
#

lol some other playerinteractevents also not working

#

on new server all works fine

#

what it can be?

sly topaz
#

well, it might just be a plugin interfering then, try putting coreprotect in, with the same config and all and see if that interferes

#

or remove coreprotect from the other server and check, either way works

native bramble
#

working with coreprotect

#

maybe i need to review my plugin, like i have some trash code that brokes the server?

sly topaz
#

well, that I can't know but it is weird that it works fine on a clean server

#

you could check all the player interact event listeners

#
Arrays.stream(PlayerInteractEvent.getHandlerList().getRegisteredListeners())
        .map(listener -> String.format(
            "[%s] %s - %s",
            listener.getPlugin().getName(),
            listener.getListener().getClass().getSimpleName(),
            listener.getPriority().name()
        ))
        .forEach(log -> MyPlugin.logger().info(log));

log this somewhere and check each class

dark moth
#

uhh

#

so guys i making a dropkicking move

#

are we able to change the player pose

#

im gonna use it in the dropkicking

worldly ice
#

depends on what you mean by pose

#

i dont think theres an API way to do it but you can send packets to make the player look like they're sleeping or crawling for example

dark moth
#

sleep pose.

worldly ice
#

you're gonna need NMS or a lib like protocollib or packet events to actually send the packet

#

but index 21 is the pose of the entity, which you can set to 2 for sleeping

thorn isle
#

alternatively, you can use libsdisguises to eliminate any protocol/nms dependency by creating a disguise from the player, setting setSleeping to true, and briefly applying it to the player

#

this is a bit more involved than just sending a packet, but it offloads maintenance to someone else, which is nice

sly topaz
#

if you're gonna use nms, then just use the setPose method on nms.Entity

#

that method hasn't changed in ages so it'd be fine to do it reflectively

#

if you're using paper then there's is an API method for it, Entity#setPose

worldly ice
#

good to know

slender elbow
#

people really need to stop looking at the protocol page when using protocollib

#

but the plugin name doesn't help

sly topaz
nimble sage
#

Does anyone know how to read the data from CustomClickAction from the new dialogs? (does it call an event?)

sullen marlin
#

Yes there's an event

smoky anchor
#

\o Does Minecraft (I guess API) have any limit for downloading a texture ?
I wanna know if I should implement some limiting or if I can just spam the thing
For record, I have all URLs already "downloaded" I would just need to download the textures themselves

smoky anchor
#

well I already have the URL from skulls but I need to download the textures in bulk

#

In my own program for other purposes

mortal vortex
mellow edge
#

Does Bukkit#getVersion work reliably for detecting the NMS versions across paper and most other forks, specifically if they all include the part (MC: 1.x.x), in spigot it seems to work fine.

rotund ravine
smoky anchor
#

nope, specifically only downloading the textures
I know about the profile lookup limit

empty comet
#

Hi;, found a weird bug i'm not sure how to even fix... I'm using the InventoryClickEvent to do gui stuff, and at some point i do player.closeInventory(), to close the gui (logic, right?).

I also got a InventoryCloseEvent that checks if the user forgot an item in the gui, to try and give it back or drop it in the world.

Here's the weird part, i send a debug log once i clicked on the item to close the gui, before i even call the actual player.closeinv..., and for some reason, before i even CALL the player.closeinv, i got another debug log from the InventoryCloseEvent, how??

//InvClickEvent
if(clicked.equals(iu.exitbarrieritem())){
 plugin.getLogger().info("check1");
 p.closeInventory()

//InvCloseEvent
plugin.getLogger().info("check5");

//Console
[Pluginname] check5
[Pluginname] check1

I already tried to delay it using runtask and runTaskLater 1L, same result. Anyone got an idea?

drowsy helm
#

Throw an exception and check out the stack trace, see what is invoking the method

#

It could possibly be something external

empty comet
#

i mean it's really as basic as that, but sure i'll see what a trace can show up, thanks for the idea

echo basalt
#

new Exception().printStackTrace()

#

type shit

empty comet
#

after doing a thread.getStackTrace, all i got is that my InvCloseEvent is indeed called before i even call player.closeInventory

#

InterfaceListener.onInvClose(InterfaceListener.java:262) is called before :
InterfaceListener.onGuiClick(InterfaceListener.java:66)

smoky anchor
#

Smells like you have something else that is closing the gui

empty comet
#

Bukkit.getScheduler().runTask(plugin, () -> p.closeInventory());
it's litterally the only closeInventory i got in the ENTIRE code

#

so i don't think it's that, unfortunately

smoky anchor
#

oh that is interesting, this should run a tick later in that case :D

slender elbow
empty comet
#

i'm gonna start putting getLogger.info after every single line of code, i'm bound to have the good one xd

smoky anchor
#

And if you remove that close inventory call ? :D

empty comet
#

heh, never tried that actually 😄

#

one sec

echo basalt
smoky anchor
#

lmfao
gonna start using that
I had some util method that does this but in a shittier way I think :D

empty comet
#

ok so you were right, something else IS closing the inv

#

only problem is that i don't have a single player.closeinventory in the entire code

smoky anchor
#
  1. is your testing server running any other plugins ?
  2. are you restarting the server when testing the changes ? /reload should not be used!
empty comet
#

holy fuck your right

slender elbow
#

well, if something else is closing the inventory, it will pop up in the thread stack dump

empty comet
#

found it, it was another fucking plugin

#

why tf didn't it show up in the trace??

smoky anchor
#

I feel like player.closeInventory just tells the client to close the inventory and then the client send info about that to client
so the info about who truly closed the inventory may be lost

empty comet
#

yeah but it still would show what plugin called the player.closeinventory in the first place, no?

smoky anchor
#

if the thing works as I described, then no

empty comet
#

well fuck xd

#

yup, it works completely fine now

#

well fuck, if you use a barrier to close your gui's, be sure to check for it AFTER checking it's indeed your own inventory gui xd

fervent cedar
#

I have set up a Minecraft server with 4 different gamemodes:

Each gamemode has its own world with a dedicated spawn point, and I want to keep it that way. However, I want to add multiple worlds under each gamemode. For example, under Skyblock, I have additional worlds like Skymining, Skycombat, Skywoodcutting, Skyfishing, and Skyfarming.

My goal is that when players type the command /spawn in any of these related worlds, they are teleported to the correct spawn point for that gamemode (e.g., the main Skyblock spawn), no matter which of the sub-worlds they are in.

Currently, only Skyblock has multiple worlds set up as sub-worlds, since the server is still under development. The server version is 1.21.4.

I’m looking for a way to configure or use plugins so that /spawn works consistently and directs players to the proper spawn location depending on which gamemode/world group they are in.

slender elbow
#

would be nice to see what that stack trace looked like

empty comet
# slender elbow would be nice to see what that stack trace looked like
[13:58:35] [Server thread/INFO]: [EnchantingEX] [java.base/java.lang.Thread.getStackTrace(Thread.java:2451), EnchantingEX-1.0-SNAPSHOT.jar//fr.infinitystudios.enchantingEX.Listeners.InterfaceListener.onGuiClick(InterfaceListener.java:66), co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:80), org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70), io.papermc.paper.plugin.manager.PaperEventManager.callEvent(PaperEventManager.java:54), io.papermc.paper.plugin.manager.PaperPluginManagerImpl.callEvent(PaperPluginManagerImpl.java:131), org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:628), net.minecraft.server.network.ServerGamePacketListenerImpl.handleContainerClick(ServerGamePacketListenerImpl.java:3208), net.minecraft.network.protocol.game.ServerboundContainerClickPacket.handle(ServerboundContainerClickPacket.java:69), net.minecraft.network.protocol.game.ServerboundContainerClickPacket.handle(ServerboundContainerClickPacket.java:14), net.minecraft.network.protocol.PacketUtils.lambda$ensureRunningOnSameThread$0(PacketUtils.java:29), 
#
net.minecraft.server.TickTask.run(TickTask.java:18), net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:155), net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:24), net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:1448), net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:176), net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:129), net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1428), net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1422), net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:139), net.minecraft.server.MinecraftServer.managedBlock(MinecraftServer.java:1379), net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:1387), net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1264), net.minecraft.server.MinecraftServer.lambda$spin$2(MinecraftServer.java:310), java.base/java.lang.Thread.run(Thread.java:1583)]
#

here, not sure if that's what you want, but that's what i was getting

slender elbow
#

that's not in an inventory close event tho?

empty comet
#

whoops, mb

#

not the good one

slender elbow
#

?paste

undone axleBOT
slender elbow
#

that as well pls

empty comet
#

lol i can't use it, "error adding document"

slender elbow
#

bru

#

or pastebin or anything

empty comet
#

lul

empty comet
slender elbow
#

huh

#

how are you printing the stack trace

empty comet
#

ohoh

#

i was doing a plugin.getlogger on a Thread.currentThread().getStackTrace()

#

Sorry if i messed it up 😅

slender elbow
#

just call Thread.dumpStack() lol

#

anyway, other plugin was interfering, problem is solved

flint coyote
slender elbow
#

there is a container id check at the beginning of the click handler, so at "best" nothing happens, at worst an anticheat will flag you

#

it's entirely possible for this to happen in high-latency situations as well