#help-development

1 messages Β· Page 2219 of 1

bronze swan
#

that relates to what we were talking about

drowsy helm
#

sure

upper tendon
#

Wait, loading new chunks wouldnt permanently increase ram usage, right?

drowsy helm
#

it they stay loaded ,yes

#

if you're juts generating them no

upper tendon
#

Ok, so unloading old one's would clear ram

drowsy helm
#

yeah it should

upper tendon
drowsy helm
#

bongus

#

lol

upper tendon
#

lol ingore the bonguses

drowsy helm
#
    public ArrayList<Material> getItemList(){
        itemList.clear();
        for(int i = 0; i < itemArray.length; i++){
            itemList.add(itemArray[i]);
        }
        if(nether){
            for(int i = 0; i < netherArray.length; i++){
                itemList.add(netherArray[i]);
            }
        }
        return itemList;
    }

This is a lot of unnecessary read/writes, could really be refactored

public class BingoBoard {

    private Player p;

change that to a UUID

Also at any point are you ever removing from plugin.getPlayerBoards()?

#

otherwise i don't see much that would cause an issue

upper tendon
#

Ok...

#

So the getItemList method would just clutter the CPU though, right?

drowsy helm
#

well itemList doesn't really need to be there at all

#

why not just use Arrays.toList()

upper tendon
#

and I'll change the player to uuid, didn't know that necessarily bad

upper tendon
drowsy helm
upper tendon
#

Aiight

drowsy helm
#

yeah but nothing else really sticks out to me much

upper tendon
drowsy helm
#

nws

upper tendon
#

Wait wait wait, ONE last thing

#

Should reloading the server decrease ram usage back to like the base it would be as if I restarted it?

drowsy helm
#

depending on the plugins

#

but reloading should usually be avoided

upper tendon
#

Oh okay

#

well tysm

drowsy helm
#

player's name can change, uuid doesnt

#

say I'm doing a longterm storage of player data, if the player changes their name the next day, they lose all their data

#

wdym

#

like an offline server?

#

I've got no clue about offline servers

#

i know names can be spoofed

#

i think uuids would still be more secure

quiet ice
#

UUIDs can be spoofed, yes

drowsy helm
#

probably use onLoad instead of onEnable

quiet ice
#

They are just as secure as names

#

Though to spoof a offline mode UUID you'd need to spoof the name

#

Since the UUID is generated from the name

#

Yep

upper tendon
#

Isn't the UUID tied to the minecraft account?

quiet ice
#

The purpose of offline mode is to not tie anything to the mc account

upper tendon
#

Oh yeah offline mode

#

Doh sorry

quaint mantle
#

how does one make an entity move to a location

tender shard
#

if it's an entity that attacks, you can just set their target. Otherwise, or if you only want it to move but not attack anything, use NMS and change their Pathfinder goals

near night
#

can anyone point me in the right direction for making a multi-world plugin Thanks!

tender shard
near night
tender shard
#

tha basics are extremely easy. with Bukkit.createWorld(WorldCreater) you can create new or load existing worlds. Now you can simply save the name of worlds you have created in a yaml, json, whatever file, or database, and simply load them again on the next startup

near night
#

tysm!

tender shard
#

np

#

quick IntelliJ question: Everyone knows this annoying "Might be null" warning in IntelliJ. Obviously this can be safely ignored if you have a default config value set. Does anyone know how to ignore the "might be null" warning ONLY for certain methods (ConfigurationSection#getString())?

quaint mantle
#

remove @smoky tinsel tag from that method in the api

#

wait

#

there is a guy with that name

tender shard
#

funny lol

quaint mantle
#

:)?

tacit drift
#

@smoky tinsel

tender shard
#

no for real, there must be some setting in intellij to exempt that method from inspections

tacit drift
#

press "More Actions"?

tender shard
quaint mantle
#

i suspect that he had done it?

#

yea

tender shard
#

only shows this

quaint mantle
#

cant even see

#

why not use windows + shift + s (if you using win 10)

tender shard
#

im on win 11 and win+shift+s does nothing

quaint mantle
#

imagine using win 11

tender shard
#

I had to...

#

for MS flight sim 2020

tacit drift
#

win 11 good

tender shard
#

win 11 is such a downgrade

quaint mantle
#

hmmm then i dont know what is the shortcut for the snipping tool

tender shard
#

no drag and drop to taskbar. no right click taskbar for task manager. no changing audio device with a simple right click to taskbar. no proper right click menu in explorer. etc etc etc

tacit drift
#

install lightshot, press prntscr

tender shard
#

well but why

#

whats wrong with my screenshot

#

it shows the menu I wanted to show

#

lol

#

on the right

quaint mantle
tacit drift
tender shard
#

the right click menu? yeah it requires twice as many clicks now

tacit drift
#

press on wifi icon, there is volume slider

#

yeah, but it's there at least

tender shard
#

in win 10 it was "right click volume thing" -> you could change it

quaint mantle
#

community survival, does it mean that it is our survival game?

quaint mantle
#

woah cool

tender shard
#

guess I'll have to live with the useless "might be null" warning :<

tacit drift
tender shard
quaint mantle
tender shard
#

lol my list is a bit long

tacit drift
#

Now that I am thinking, are they using their own software to build their own software?

quaint mantle
#

🎫

tender shard
quiet ice
#

Does anyone know whether ConcurrentHashMap bricks itself if the hashcodes of the keys change?

zealous glen
#

I'm gonna look at supporting older versions with my plugin. How annoying is it gonna to be for me to implement player.getWorld().setBlockData() for 1.8->1.18

quiet ice
#

that method call should not be too complicated given that BlockData existed for a while now

tender shard
earnest forum
#

i was on win 11 and it worked for me

tender shard
#

I pressed ctrl shift s

earnest forum
#

lol

near night
#

is there a event for player travel to nether?

tardy delta
#

World change event

#

I would check if the new world equals Bukkit.getWorlds().get(1) which is the nether

near night
#

tysm

west crag
#

how can we give potion effect to spawned entity?

#

like if someone break a block then random entity spawn then that entity should get a random potion effect

#

or how can we change that entity damage and hitpoints?

crimson terrace
crimson terrace
west crag
#

okay...
thanks :)

west crag
#

when someone break a block then random mob spawn even blocks so will it work?

#

means will it throw any exception or not?

crimson terrace
#

I am not sure what you mean.

#

try it and see

earnest forum
west crag
#

okay.. lemme try it out

pearl seal
#

Why when I'm adding potion effect to player in OnRespawn event effect doesn't work?

#

Just doesn't add

crimson terrace
pearl seal
#

Okay

summer scroll
west crag
#
livingEntity.addPotionEffect(PotionEffectType.BLINDNESS);
#

like this?

crimson terrace
#

i think you need a new PotionEffect()

#

lemme pull up my own

earnest forum
#

i think theres a method of the enum

west crag
#

yea

#

there is

#

i will use that to get random potion effect

#
Objects.requireNonNull(event.getPlayer().getLocation().getWorld()).spawnEntity(location, entityType1);
                livingEntity.addPotionEffect(PotionEffectType.BLINDNESS);
pearl seal
west crag
#

like here first its spawning mob then adding potion

#

but dunno its showing me error

#

i tried PotionEffect too

#

umm wait

#

its not working still ;-;

earnest forum
#

?javadoc

earnest forum
#

use this @west crag

#

one of these constructorsd

#

new PotionEffect(...)

west crag
#
Objects.requireNonNull(event.getPlayer().getLocation().getWorld()).spawnEntity(location, entityType);
                if(entityType.isAlive()) {
                    PotionEffectType potionEffectType = PotionEffectType.values()[new Random().nextInt(PotionEffectType.values().length)];
                    livingEntity.addPotionEffect(livingEntity.getPotionEffect(potionEffectType));
                }
#

i did this thing

#

let me try

earnest forum
#

that probably wont do much for you

midnight shore
#

how can i create a timer from an increasing double? I mean something like this [Green--Red----] the green part represents the progress to full and red the remaining

#

i would send this thing in the action bar

tender shard
#

World#getDimension == Dimension.NETHER

pastel juniper
#

I tried to create a custom mob but whenever I try to compile to plugin I get this:

java: cannot access net.minecraft.network.chat.TextComponent
  bad class file: /C:/Users/ANFFG/.m2/repository/org/spigotmc/spigot/1.18.2-R0.1-SNAPSHOT/spigot-1.18.2-R0.1-SNAPSHOT-remapped-mojang.jar!/net/minecraft/network/chat/TextComponent.class
    class file has wrong version 61.0, should be 52.0
    Please remove or make sure it appears in the correct subdirectory of the classpath.
halcyon mica
#

Is there a player look event? It doesn't look like the player move event fires when one only looks around

midnight shore
earnest forum
#

just check if the player's x,y,z positions are still the same

#

if they are then the player only looked around

tender shard
pastel juniper
shy shadow
#

Hey guys, do you think it's possible with spigot to do some kind of event where you somehow get the stronghold structure and relocate it somewhere else ? πŸ€”
I don't know if we can play with structures etc

halcyon mica
tender shard
west crag
#

this is my code
https://pastecord.com/xadibafyle.cs

here when ever someone tried to break a block then random mob spawn and get a potion effect(i dunno if potion effect working or not). and if player use this command /easymode or hardmode then it should send a msg in title about difficulty(i have a method but i cant able to call it because of player parameter) and after this it should run other code

#

i just want to ask that how can i call that sendTitle method?

#

its all about Player parameter ;-;

pastel juniper
west crag
#
    public void sendTitle(Player player) {
        player.getPlayer().sendTitle("\u00A7e DEMO TEXT", null, 0, 60, 0);
    }

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if(command.getName().equalsIgnoreCase("easymode")) {
            sendTitle();
        }
        command_name = command.getName();
        return true;
    }
#

main code

mortal hare
#

does any of you guys use paperweight-userdev and know if its possible to set gradle reobfJar task to force delete previous build?

west crag
mortal hare
west crag
#

then?

mortal hare
#

you add command name to plugin.yml

west crag
#

yea ik

mortal hare
#

then #JavaPlugin.getCommand("commandName").setExecutor(new YourCommand())

#

YourCommand class implements command executor class

covert karma
mortal hare
#

onCommand of YourCommand class will always return the same command label, unless its an alias

covert karma
#

sendTitle(Bukkit.getPlayer((Player)sender))

mortal hare
#

You dont need Bukkit.getPlayer()

covert karma
#

right

mortal hare
#

you literally casted sender to player object

covert karma
#

my bad

#

lol

covert karma
#

just override the onCommand method

mortal hare
#

yes, but that way no tab completion would occur normally unless you override tabcomplete method

covert karma
#

for commandname?

#

string?

#

or wdym

mortal hare
#

oh nvm it would occur

#

but its way cleaner to set command executors

#

or to use command framework

covert karma
#

yea probably

#

but tbh for just a few commands/small plugin i dont really care

tender shard
#

are you registering this executor to 100 different commands?

tender shard
#

well okay

west crag
#

lemme try

torn sedge
#

Hello, I'm not a developer but I have a friend who made me a bossbar plugin that allows me to put Placeholders (coordinates, direction, AureliumSkills...).
One thing it can't do is be able to leave that bar always at the top of the screen and no other boss bar come up and take its place. We know it's possible because I used another plugin before that did that, the main boss bar always stays on top even when arriving in front of the enderdragon or if other plugins display it. I couldn't keep it because it wasn't customizable on each world unlike the one he made for me. Does anyone know what to put in place to force this bar all the way up (in fact there are 2 bars possible per world so ideally know what to do so that these 2 bars do not move from the top of the screen) thank you

covert karma
#

does that not work?

west crag
#

it works

#

but it is easy for me to remember

#

that color code

pearl seal
#

: Exception in thread "AWT-EventQueue-0" java.lang.IllegalStateException: Asynchronous effect add!

west crag
#

xD

covert karma
#

whatever suits you i guess

tender shard
#

the Bukkit API should only be accessed synced

misty current
#

does the event api work if the annotated method is overridden?

tender shard
#

do you have a listener that extends another listener?

covert karma
misty current
#

i have an EnchantBase class that implements listener with a lot of void methods that are empty inside and you can extend EnchantBase to override the void methods to create your own enchant implementations

pearl seal
#

Oh. Idk about this.

#

Thanks

misty current
#

if I were to make these methods event handlers and override them in another class, would it work?

#

without annotating them again in the child class

rare flicker
#

that's actually a really good question

quiet ice
misty current
covert karma
#

i meant just make a test class for that with like one method in it

#

and try it

chrome beacon
#

You could ask Paper

mortal hare
#

annoying how i can't use my test builds without unloading plugin first

#

i use plugman to reload

#

to quick test it

chrome beacon
#

Use Paper userdev to start the server

#

;/

mortal hare
#

that's a time waster too

#

launch a server

#

whenever a test build has been compiled

#

im just too lazy to wait

chrome beacon
#

It takes less than 10 seconds

#

also you can setup hotswapping

quiet ice
#

you could just make that task run sudo rm -rf path/to/jar

mortal hare
#

how can i do that from gradle

#

im not an expert on gradle

green prism
#

Can a permission node be: "Agencies.agency.1"

#

?

chrome beacon
#

Use agencies not Agencies

green prism
#

ah okay

#

thanks olivo

#

u're always the best

#

πŸ™‚

quiet ice
#

Apparently something like "rm -rf path/to/jar".execute()

tardy delta
halcyon mica
#

How can I spawn a entity exactly on the players crosshair?

halcyon mica
#

Not on the termination

covert karma
#

use player.getEyeLocation as starting point and direction

covert karma
halcyon mica
#

raytraceBlocks queues all blocks on the view vector of the player

covert karma
#

oh you mean just right in front of the player?

halcyon mica
#

Yes, exactly 1.5 blocks in front of the player, on the position of their crosshair

#

Spawn a entity

covert karma
#

well just use eye location again

#

then getDirection on it

#

and go 1.5 forward

#

thats it

pearl seal
#
public class SpigotTest extends JavaPlugin
{
    public static SpigotTest Instance;

    @Override
    public void onEnable()
    {
        Instance = this;

        getLogger().info("Spigot test plugin activated");

        getServer().getPluginManager().registerEvents(new PlayerEvents(), this);
    }
}
#

Can't call this class and his static fields in other classes

covert karma
#

should be good

pearl seal
#

Trying to call this class in other package

halcyon mica
pearl seal
#

Nothing work

covert karma
halcyon mica
#

Thank you, very helpful

covert karma
#

normalize the vector and then just multiply it by 1.5

#

then add the location and the vector

#

to get the new location

#

spawn there

vale ember
#

how can i prevent player from placing item in an inventory except for specific slots? when i cancel the InventoryClickEvent the player is still able to do it with shift or with spamming clicks

halcyon mica
#

Thank you

covert karma
vale ember
granite owl
#

ive noticed that sounds like pigstep or hurt sounds are bound to their loc(obviously)

ambient.basalt_ambient.loop(or so) also gets passed by the playSound() method.

HOWEVER, although its providing a location, it stays centered for the player no matter how far he moves away from the initial loc.

now as for my question: how can i use this behavior to my advantage to play music without relying on note block sounds?

covert karma
granite owl
#

like how is it determined which sounds are centered

covert karma
#

increase radius

granite owl
#

thats not neccesseary for the basalt sounds

#

even if u keep its volume at 1.0f

halcyon mica
#

Ok yeah, that is not even remotely correct

granite owl
#

and tp away thousands of blocks

#

u can still hear it just as well

halcyon mica
#
                    Vector dir = e.getPlayer().getEyeLocation().getDirection();
                        dir.normalize().multiply(1.5F);
                        session.get().move(e.getPlayer().getEyeLocation().clone().add(dir), false);
                        return;```
#

So where is the mistake

crude snow
#

Anyway to get a target entity?

halcyon mica
#

Because that is nowhere near the crosshair

#

Or 1.5 blocks again

covert karma
halcyon mica
#

Literally just teleports the entity at the yellow particle to the given position

mellow edge
#

I know sharing ip is not really safe, but is it safe to share ipv4

quiet ice
#

Why do you think that it is safe to share an ipv4?

#

And why do you think that ipv4 is not an ip?

mellow edge
#

ipv4 is not my public ip you can use to conntect to the server

covert karma
#

i assume you are talking about private and public ip

quiet ice
#

ipv4 IS ip (alongside ipv6)

covert karma
#

ipv4 is just the way ip adresses are numbered

brittle lily
#

Hey Guys I have a Timer And I wanna make random time when time under 28. When Time Under 28 .It will pick a random number and fire an event when the timer reaches that second

quiet ice
#

But private ip addresses (so 127.x.x.x and 192.x.x.x) are usually not really dangerous

mellow edge
#

I shared 192.... ip

covert karma
#

thats fine

mellow edge
#

can they get the real ip from it?

covert karma
#

no

mellow edge
#

nice

quiet ice
#

It is the ip address your router assigned to you. It is only valid within your network

covert karma
#

its not gonna change the dir

#

just return

halcyon mica
#

it literally modifies the object and returns itself

covert karma
#

oh ok

#

hm

mellow edge
#

k thanks

covert karma
#

well i just tried this

@EventHandler
    public void onInteract(PlayerInteractEvent event) {
        Vector dir = event.getPlayer().getEyeLocation().getDirection();
        dir = dir.normalize().multiply(1.5F);
        event.getPlayer().getWorld().spawnEntity(event.getPlayer().getEyeLocation().clone().add(dir), EntityType.CHICKEN);
    }
#

and it works

brittle lily
quiet ice
#

That is a statement, not a question

#

Or to be more precise: I cannot guess your issue

brittle lily
chrome beacon
#

nextInt()

mellow edge
quiet ice
#

Math#random

brittle lily
halcyon mica
#

Ok so what are the restrictions for the move event

#

Because even on monitor, it triggers extremely inconsistently

#

If I tab my move key, it only triggers sometimes

#

When I slowly move my camera, it doesn't until I move it a total of like 5 degrees

brittle lily
halcyon mica
#

There is nothing to show for code

#

It's about the event triggering

#

Literally just add a printout to a event handler

covert karma
#

you can make your own player move event kinda if you just schedule a task for every tick and check every players location

#

and if it changed trigger your "event"

halcyon mica
#

That sounds inefficient as all hell

mortal hare
rotund prawn
#

how can i make a local variable for each player with a different value?

mortal hare
#

HashMap

#

Key value pair

covert karma
#

make a Map<Player, YourType>

#

actually

#

use uuid instead of player

mortal hare
#

^^

rotund prawn
#

oh thanks

mortal hare
#

player objects get stale when they get offline

#

using player objects without knowing that will cause memory leaking issues if not handled properly

rotund prawn
#

do those values reset when a player leaves?

mortal hare
#

No

rotund prawn
#

oh

mortal hare
#

you need to delete values

covert karma
#

the player object gets abandoned

mortal hare
#

manually

#

from the map

covert karma
#

if you store the uuid instead you can get the player object back whenever you need

rotund prawn
#

okay thanks

mortal hare
#

still if player leaves the server, its better to delete any data regarding with him

covert karma
#

depends on use case but yeah

halcyon mica
#

So more vector math: I am trying to make a armorstand rotate so that it always faces the player, regardless of each others position, however it always seems to snap to -90 degrees.
So where is the mistake here, assuming that A is the armorstand location and B is the player eye location?`

    public static float getYawToLookAt(Vector a, Vector b) {
        Vector v = b.clone().subtract(a);
        return (float)Math.toDegrees(Math.atan2(v.getZ(), v.getX()));
    }```
covert karma
crude loom
#

?paste

undone axleBOT
crude loom
#

I'm trying to listen for a packet and I'm getting Index parameter is not within [0 - 0)
Here is the code:


        ProtocolManager manager = ProtocolLibrary.getProtocolManager();
        manager.addPacketListener(new PacketAdapter(this,ListenerPriority.NORMAL,PacketType.Play.Server.REL_ENTITY_MOVE) {
            @Override
            public void onPacketSending(PacketEvent event) {
                PacketContainer packet = event.getPacket();

                packet.getShorts().getField(0);
            }
        });

The full error message: https://paste.md-5.net/sofuluciwe.apache
Any idea as to why this is happening ?

eternal night
#

what version are you on ?

crude loom
#

1.8

eternal night
#

in 1.8 those were bytes

#

not shorts

#

and no

#

PDC was added in 1.14

crude loom
#

Oh, where can I find information about packets in 1.8?

eternal night
#

Ehhh

#

The server source ?

crude loom
#

I tried decompiling it but I didn't understand anythingπŸ˜…

eternal night
#

rip

crude loom
#

Like how did you know that it was bytes?

eternal night
#

might help you a bit

#

I remember xD

crude loom
#

oh haha I'll look into the link you sent
Thanks !

#

I've found the source code for this packet, but it has 1 int, 5 bytes and a boolean
How can I check what does each variable stand for?

mighty pier
#

how do make leaderboard with player:stat list

eternal night
#

NMS is not documented

drowsy helm
#

thats the fun of nms you sorta have to guess

crude loom
#

oh wow ok xD

grim ice
#

not fun at all

#

owo

drowsy helm
#

and no one bothers mapping it because it changes each update

eternal night
#

Well if you weren't on a horribly ancient version

#

you could be using mojang mappings to just guess

#

but, 1.8 developers deserve the suffering

#

Are you using mojang mappings ?

#

in which case, that would be just called Allay

#

not EntityAllay

quaint mantle
#

Someone has a good vector tutorial?

eternal night
#

Yea, check for Allay

#

that isn't mojang mappings but spigot iirc also uses mojang mappings for the new mappings

ocean lion
#

Hello, is it easy to implement PermissionsEx API into my plugin?

earnest forum
#

this video is good

quaint mantle
#

Ty

earnest forum
#

its a unity tutorial but it explains the concept well

#

dont expect any examples

grim ice
#

B)

#

(jk)

mortal hare
#

use luckperms

#

afaik it's deprecated plugin

ocean lion
ivory sleet
#

Wat

#

The author of pex even discourages pex from being used

#

Well at least until it has been re-developed

#

LuckPerms is pretty much the permission plugin you ought to use as it is quite horizontally scalable with loads of features

ocean lion
#

I want to use permissionsex but I cant seem to get the dependency in

#

just gives red errors all over

ivory sleet
#

What do you use? Maven or gradle

ocean lion
#

maven

ivory sleet
#

Did you add the repo?

ocean lion
#

Yeah

ivory sleet
#

No clue why it wouldn’t work then shrug

#

Might wanna visit the repo url to see what version is available

ocean lion
#
        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot-api</artifactId>
            <version>1.19-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>ru.tehkode</groupId>
            <artifactId>PermissionsEx</artifactId>
            <version>1.22</version>
        </dependency>
    </dependencies>

    <repository>
        <id>pex-repo</id>
        <url>http://pex-repo.aoeu.xyz</url>
    </repository>
</project>
ivory sleet
#

Wrong one I believe

#

^ official

ocean lion
#

thanks

mortal hare
#

I was strong hater of luckperms back in 2020's but I once i've tried to look for the luckperms wiki and instantly fell in love with Luckperms plugin

ocean lion
#

lp = dog permissionsex = OG

mortal hare
#

why its dog

#

there's really no cons compared to PEX. Maybe complexity

green prism
#

Hello guys, I'm trying to get the player by Name even if he's offline.
The only problem is that this returns null everytime... Can you help me please?

    public static Player getPlayerByName(String name) {
        if(Bukkit.getPlayer(name) != null) {
            return Bukkit.getPlayer(name);
        } else if(Bukkit.getServer().getOfflinePlayer(name).getPlayer() != null) {
            return Bukkit.getServer().getOfflinePlayer(name).getPlayer();
        } else return null;
    }```
eternal oxide
#

There is NEVER a Player for an OfflinePlayer if they are not Online

green prism
ivory sleet
#

If a player is offline, then there’s no guarantee the name will be present

green prism
#

or check if is valid

mortal hare
#

Mojang API

ivory sleet
#

^

eternal oxide
#

OfflinePlayer has his name

mortal hare
#

or usercache.json

eternal oxide
#

If he has played before on your server

green prism
mortal hare
#

use json parser to parse usercache.json and get its name through there if he joined previously, i bet there's an api method for this

ivory sleet
#

But it might hang the server as it’s blocking

green prism
eternal oxide
#

Yes. Still check his name != null

ivory sleet
#

Altho it presupposes you know the name already

#

So there’s no point

green prism
ivory sleet
#

Exists?

mortal hare
green prism
ivory sleet
#

By definition there exists an offline player for every uuid

#

So it will create an offline player no matter what

eternal oxide
#

yes, if you get by name and the returned OfflinePlayer has the same name he has been on your server.

#

I think if you get a nonexistant OfflinePlayer by name the returned OfflinePlayer object will have a null name.

green prism
ivory sleet
#

Then just use getOfflinePlayer(name)

#

And perhaps do it async

eternal oxide
#

you are supposed to be adding them by UUID not name

green prism
ivory sleet
#

yes

eternal oxide
#

Your SQL is all setup to use UUID

mortal hare
green prism
eternal oxide
#

no

ivory sleet
#

No

eternal oxide
#

You use teh name to get an OfflinePlayer, then check teh name is valid, and use teh UUID from OfflinePlayer

ivory sleet
#

You take the argument, you invoke getOfflinePlayer(name) (async) and then you invoke OfflinePlayer::getUniqueId

#

And store the uuid if needed or whatever

green prism
eternal oxide
#

yes, unless they don;t exist

ivory sleet
#

Yes

green prism
#

wOW

ivory sleet
#

The only occasion where it would not return any string is if the player has never joined the server and you used getOfflinePlayer(uniqueId)

#

Because getOfflinePlayer(name) might be blocking

eternal oxide
#

^

green prism
#

cool!!! thanks!

ivory sleet
#

Since it might have to make a call to mojang to retrieve the uuid by name

#

Ye

green prism
# eternal oxide ^

elgar should put you among the creators of the plug-in directly for your ahaha help, thanks

green prism
ivory sleet
#

OfflinePlayer objects will always have uuids accessible

hybrid spoke
#

the other way around nor?

green prism
#

wow! that's really absofantastic

hybrid spoke
#

how would it fetch an UUID if the name couldnt be associated with a player

ivory sleet
#

well, getOfflinePlayer(uuid) creates an OfflinePlayer given the uuid and stores it in a weak hm, getOfflinePlayer(name) might make a call to mojang in order get the uuid by name and then it stores it to the hm by key (uuid) (hence why it may also be blocking)

hybrid spoke
#

yes, so it depends on the method you are using. there is a potential chance to just have one of the 2 values available

ivory sleet
#

Indeed

green prism
#

@ivory sleet

    public static boolean isPlayer(String name) {
        return Bukkit.getOfflinePlayer(name).getName() != null;
    }```
ivory sleet
#

No that will always return true

hybrid spoke
#

in this case you want to check the uuid

green prism
#

by using OfflinePlayer

ivory sleet
#

An OfflinePlayer exists for every uuid

#

But if you get it through name, the server will make sure one exists still (by getting the uuid thru mojang conceivably)

green prism
ivory sleet
#

Cracked players cannot join anyway

#

Since you use online mode I hope

hybrid spoke
#

we dont support piracy here

green prism
cyan iris
#

hi guys

hybrid spoke
cyan iris
#

i need help plzzz

hybrid spoke
#

?ask

undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!

cyan iris
#

ok

#

why i cant propectis my server like online mode or ....

#

.

#

i must send a ss

green prism
# hybrid spoke you dont have to. online mode only

Are you telling me that a plug-in like FactionsUUID or similar famous should do favor to this? I’m asking a simple question, I would find it in cash or similar. There are millions of reasons, the server can be disconnected, offline...

cyan iris
#

but i cnt do it here

rotund prawn
#

i cant get hashmaps working, when i try to store a value it, the entire server crashes

undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!

hybrid spoke
rotund prawn
#

if (!ferro31.main.challange.challange.containsKey(player.getUniqueId())) {
ferro31.main.challange.challange.put(player.getUniqueId(), 0);
player.sendMessage(ferro31.main.challange.challange.get(player.getUniqueId()).toString());
}

green prism
rotund prawn
#

its just integers

green prism
#

wtf is this code

#

that's cool

cyan iris
#

hi were can i share my issu

warm light
#

Which version have the sound CHEST_OPEN for open enderchest?

hybrid spoke
cyan iris
#

so why NOONE CARE ABOUT ME

hybrid spoke
umbral olive
hybrid spoke
#

we also would need an error

rotund prawn
#

i cant acces the variable in my main class

cyan iris
#

u see none CARE

rotund prawn
#

there's no error its just crashes

#

that's the wierd about it

hybrid spoke
#

if there is a crash, there also is an error

rotund prawn
#

where?

hybrid spoke
#

logs

cyan iris
hybrid spoke
#

hmmm

#

lets see

#

?ask

undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!

warm light
rotund prawn
#

its just ends there

cyan iris
hybrid spoke
warm light
hybrid spoke
green prism
#

How to translate an OfflinePlayer to an OnlinePlayer? (Player instance)

warm light
#

and I want to know all the version

subtle folio
hybrid spoke
green prism
#

np

hybrid spoke
#

otherwise just use the UUID to get the players instance

green prism
#

thanks!

warm light
green prism
rotund prawn
#

i tried somethign and it now works

warm light
#

I just want to know all versions that have CHEST_OPEN sound

cyan iris
#

HI Why I cant Propectis My sevrer

#

:I

#

||No One Care||

subtle folio
hybrid spoke
#

well there you would have to look through the Sound enum for the specific version

hybrid spoke
subtle folio
#

and bombed my dms

dark harness
#

How can i add Bukkit to 1.19 to use craftplayer?

eternal oxide
#

Run BuildTools and depend on spigot not spigot-api

crude loom
#

I'm coding a plugin that will make a road in the path of a thrown egg
I'm trying to listen to an entity move packet in order to track the blocks the egg has gone through altough I cannot find the right packet for that
What would be the right packet to use? (I'm using ProtocolLib)

warm light
#
new BukkitRunnable() {
  @Override
  public void run() {
    //Code here
  }
}.runTaskAsynchronously(PluginInstance());

It will create a new thread right?

#

will it close auto after doting the task?

eternal oxide
#

yes

earnest forum
#

yes it will run after 1 tick

#

so the next tick

dark harness
#

How can i get Players Ping in 1.19?

tender shard
ivory sleet
#

As it is using a cached thread pool

#

Since creating platform threads generally aren’t the cheapest things to do

#

But you probably don’t need to worry

warm light
#

Will it freeze the main thread if the plugin edits a yml file continuously?

#

Like in every sec

tender shard
#

if you do it on the main thread, yes

#

if you don't, no

#

but

#

why the hell would you have to edit a yaml file every second

warm light
#

umm, I am making a custom chest plugin which save data in yml. so if there are many players and they tried to save items on the chest, it will lag

ivory sleet
dark harness
tender shard
eternal oxide
warm light
#

I have added 2 way. in db and yml.
so if anyone choose yml

eternal oxide
#

What data are you saving?

tender shard
warm light
eternal oxide
#

If its specific to that chest

halcyon mica
#

So for rendering items in the world?

#

Could I make a invisible item frame rise a freely positionable armorstand?

#

Could that work, or will the frame break?

tender shard
#

do you want to show a "dropped" item?

halcyon mica
#

No, a static item

tender shard
#

you can make an itemframe "fixed" by using ItemFrame#setFixed

#

When true it's not possible to destroy/move the frame (e.g. by damage, interaction, pistons, or missing supporting blocks), rotate the item or place/remove items.

halcyon mica
#

Excellent

subtle folio
#

the armor stand should be able to hold the item without need of an item frame..

halcyon mica
#

Yeah, but positioning will be a nightmare

#

Because, so render the a block at a consistent size, you'd need to have it be a held item rather than the helmet slot

#

Which introduces all sorts of issues with alignments and offsets to have it stay centered

subtle folio
#

not true entirely..

halcyon mica
#

Elaborate

subtle folio
#

you can put an item on a armorstand’s head and it won’t change the size ?

halcyon mica
#

Blocks will

subtle folio
#

ohh blocks

halcyon mica
#

Blocks will be rendered differently in the helmet slot

subtle folio
#

it’ll be their item form Β―_(ツ)_/Β―

halcyon mica
#

No?

#

It will be a full-sized block, inflated by quite a bit

subtle folio
#

in my past experience it’s the item form of it ..

#

unless it’s changed since 1.8 i don’t think so

halcyon mica
#

Blocks do not have a "item form"

subtle folio
#

every itemstack has a item form

#

drop said block and that’s it’s item form

tender shard
#

sad block :<

halcyon mica
#

Yes, but a block model overrides the gui and armorstand display properties differently

subtle folio
#

weird Β―_(ツ)_/Β―

halcyon mica
#

Here is what a block looks like, rendered in the helmet slot

#

Well, regardless

#

Next question!

#

How do I add a second entity as a passenger to a nms entity

#

And what extra packets will need to be sent to have the client receive the fake entities

warm light
#

Is it possible to create a thread onEnable?

tender shard
#

of course, why not?

warm light
#

onLoad?

glass mauve
#

these are just methods in Java

tender shard
#

are you talking about a thread or using the scheduler?

warm light
#

Using scheduler

#

bukkit runnable

tardy delta
#

you cant run a task when the plugin isnt enabled yet

warm light
#

oh

#

thanks

tardy delta
#

so it wouldnt work in onload iirc

tender shard
#

you will need to have the plugin enabled to use the scheduler

#

this gets called in every method of the CraftScheduler

covert karma
#

is there a basic guide / quickstart for how to make a library plugin?

eternal oxide
#

You make a Library when you NEED a library

#

generally they are not plugins

covert karma
#

that doesnt really help me

#

could you just answer the question?

#

not sure what you wanna say

tender shard
#

you do it like every other plugin too

#

a plugin.yml with a main class

eternal oxide
#

Not really. Do you want a library or a Plugin

tender shard
#

and that's it

eternal oxide
#

If a Plugin then you are talking about a PLugin API

tardy delta
#

you can just make a library and shade it into ya plugin

halcyon mica
#

So, more NMS questions

#
        ArmorStand builder = ArmorStandBuilder.nametagArmorStand(new TextComponent("test"), loc);
        ItemFrame frame = EntityType.ITEM_FRAME.create(((CraftWorld)loc.getWorld()).getHandle());
        frame.setInvisible(true);
        frame.setInvulnerable(true);
        frame.setItem(CraftItemStack.asNMSCopy(item), false);
        builder.getBukkitEntity().addPassenger(frame.getBukkitEntity());```
I am creating the entity like this
#

And spawning it like this as a fake entitiy:

#
        PacketUtils.send(p, stand.getAddEntityPacket());
        PacketUtils.send(p, new ClientboundSetEntityDataPacket(stand.getId(), stand.getEntityData(), true));
        List<Pair<EquipmentSlot, ItemStack>> stacks = Lists.newArrayList();
        for(EquipmentSlot s : EquipmentSlot.values())
            if(stand.hasItemInSlot(s))
                stacks.add(new Pair<>(s, stand.getItemBySlot(s)));
        if(!stacks.isEmpty())
            PacketUtils.send(p, new ClientboundSetEquipmentPacket(stand.getId(), stacks));
        if(!stand.getPassengers().isEmpty())
            PacketUtils.send(p, new ClientboundSetPassengersPacket(stand));```
#

However, the riding entity is not shown, or even present

#

So, what am I doing wrong?

#

(The armorstand is present, however)

covert karma
tall dragon
#

if the api is small just make an interface that you implement

covert karma
#

how do i set it up so that i can even access that interface in the first place

tender shard
meager trout
#

hi,
how to remove attack heart particle ?

eternal oxide
halcyon mica
#

Oh, I see

#

The passengers packet only references entity ids

#

So I need to send a fake entity of the frame to the player first

covert karma
#

idk how to do that in maven tho

#

i used to do it using default java project

tender shard
covert karma
#

how do i add a jar file as maven dependency

subtle folio
#

WHaT

#

its so easy

tender shard
#

it's also slow as hell and uses weird build numbers

tall dragon
tender shard
#

and how would it even work with spigot as dependency instead of spigot-api?

subtle folio
tender shard
#

idk I rather use nexus

eternal oxide
covert karma
#

hm i guess i can google that anyway thanks for the help

tender shard
#

you install it instead

#

"adding a .jar" is actually what maven is trying to avoid

#

and why it exists

eternal oxide
#

search "maven install 3rd party jar"

subtle folio
halcyon mica
#

OH NO

#

This would have been the perfect solution

#

But item frame entities are block grid aligned

#

Can I bypass this somehow

tender shard
#

why dont you just spawn an item

halcyon mica
#

Because, again, it is supposed to be static

tender shard
#

no idea what you mean with "static"

earnest forum
#

not moving

halcyon mica
#

Non-moving

earnest forum
#

i guess

subtle folio
earnest forum
#

you can modify the velocity of a dropped item right

halcyon mica
#

Velocity refers to the movement

#

Not the animation

tall dragon
#

why not let an armorstand hold the item?

halcyon mica
#

The entity renderer of a item entity can't be modified with properties iirc

tall dragon
#

i havent been reading the convo so idk if thats possible

halcyon mica
tall dragon
#

well, use Mathfts

#

πŸ˜„

halcyon mica
#

Easier said than done

tall dragon
#

yep

halcyon mica
#

Besides, my icon system is not really designed to individually move armor stand parts

#

So, back to the actual question

#

Can I bypass the snapping to the block grid

rain echo
#

Hi! Yesterday I asked for help with my menus, and some good souls tried to help me and I thank them very much, but because of my noob English, I didn't explained properly, so I didn't managed to get the answer that fixs my problem, after A LOT of research, errors, problems, ways, I tried another way, without using a Menu Manager or Menu interface, etc.
The idea behind my problem is that I'm trying to make a class that creates a menu for each 'ID' from my custom config automatically. So I ended with this code: https://paste.md-5.net/onesituwef.java
The code works, but I want to know if this is the correct and optimal way to this. Thanks πŸ₯Ί

green prism
#
    public static Player getPlayerByName(String name) {
        return Bukkit.getOfflinePlayer(name).getPlayer();
    }```


Seems return null, any idea?
tender shard
#

the player is not online

tall dragon
#

player you're looking for has not been on the server

#

ah wait

#

nvm

#

what alex said ^

green prism
rain echo
tender shard
green prism
#

There's a method .getPlayer() inside the OfflinePlayer class

tender shard
#

yes

green prism
#

Idk

#

ah

tender shard
#

you cannot get a player object from offline palyers that are not online

tall dragon
#

which only returns the player if hes online

eternal oxide
#

which ONLY returns a Player IF the Player is Online

green prism
#

thanks x2 to everyone ahah

#

How can I check if the returned object (Bukkit.getOfflinePlayer(name).getUniqueID()) is from a valid player? OfflinePlayer class always returns an object.

tall dragon
#

just call OfflinePlayer#isOnline()

tall dragon
#

if he is it will return a uuid, player

pastel juniper
#

This is the code of a custom mob I created

public class DiamondChicken extends Chicken implements CommandExecutor {

    public DiamondChicken(Location loc){
        super(EntityType.CHICKEN, ((CraftWorld) loc.getBlock()).getHandle());

        this.setPos(loc.getX(), loc.getY(), loc.getZ());

        this.setCanPickUpLoot(true);
        this.setAggressive(true);
        this.setCustomNameVisible(true);
        this.setCustomName(new TextComponent(ChatColor.GREEN + "Test"));
    }

    @Override
    public void registerGoals(){
        this.goalSelector.addGoal(0, new AvoidEntityGoal<>(this, Skeleton.class, 6f, 1d, 1.2d));
        this.goalSelector.addGoal(1, new LookAtPlayerGoal(this, ServerPlayer.class, 8.0F));
        this.goalSelector.addGoal(2, new NearestAttackableTargetGoal<>(this, ServerPlayer.class, true, false));
    }

    @Override
    public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
        if (!(sender instanceof Player)) {
            sender.sendMessage("Only players can use that command!");
            return true;
        }
        Player player = (Player) sender;

        ServerLevel wrld = ((CraftWorld) player.getWorld()).getHandle();
        DiamondChicken entity = new DiamondChicken(player.getLocation());

        wrld.tryAddFreshEntityWithPassengers(entity);
        return false;
    }
}

And this is the error I get when I compile

java: cannot access java.util.stream.Stream
  class file for java.util.stream.Stream not foun
green prism
# tall dragon just call OfflinePlayer#isOnline()

Maybe I do even better explaining myself maybe even better from the beginning. I’m doing a plug-in that allows adding players to an agency. I want to make sure that the "boss" of the agency can fire or hire employees REGARDLESS of whether they are online or not.

Employee are stored as UUID
(And the command usage is: /agency hire/fire [PlayerName]

covert karma
tardy delta
#

Bukkit.getOfflinePlayer(name).getUniqueId()

#

assuming they have played before so nullcheck that

left swift
#

Is there any way to register my own block? I mean I can do it now like minecraft:my_block but that block exist only on the server side (not client) so player can't see that block and interact with it. I'd like to register my own block where the model is already exiting minecraft block, is it possible?

green prism
tardy delta
#

i forgot if the getOfflinePlayer is nullable

green prism
#
Player probablyRealPlayer = Bukkit.getOfflinePlayer(name);
UUID probablyUuid = probablyRealPlayer.getUniqueId();

if(!probablyRealPlayer.hasPlayerBefore) {
   //DO STUFFS
}```
#

no?

tall dragon
#

probably better off checking if the uuid is null or not

tardy delta
#

ah yes yes hasPlayedBefore

green prism
tall dragon
#

UUID

tardy delta
#

the thing is that i've looked to the whole sourcecode and i didnt see code for a webrequest anywhere lol

vast raven
#

ItemMeta meta = event.getItemDrop().getItemStack().getItemMeta(); meta.setDisplayName("Β§6Β§lTaser Β§eΒ«" + (getCurrentAmmo(event.getItemDrop().getItemStack()) + 1) + "Β»Κ€"); event.getItemDrop().getItemStack().setItemMeta(meta);

#

No errors, but the names doesn't change.

rain echo
eternal oxide
#

getOfflinePlayer(name) will always return a result. However teh generated UUID will be an offline UUID if the player is invalid. You can compare this to see if the object is valid

tardy delta
#

what am i doing lol, downloading a dotnet sdk for linux lmao

green prism
quaint mantle
#

How to get the entity that a player is looking, i tried something with rayTraceEntities but can’t be done

eternal oxide
#

no

chrome beacon
quaint mantle
green prism
chrome beacon
chrome beacon
#

Yes it's possible

#

but it's more work than it's worth

left swift
grim ice
#

so why do u need to nullcheck that lol

tardy delta
#

i said nvm after that

left swift
#

no

grim ice
#

then struggle

#

u can maybe make it with resource packs

#

and armorstands and other shit

subtle folio
#

Hello friends, I have a super hard time wrapping my head around System.currentTimeMillis() can someone explain to me like im 5 how to check if 60s has passed using this?

humble tulip
#

60000

grim ice
#

just to somehow mimic the functionality that u can easily achieve with forge

humble tulip
#

Is 60 seconds

subtle folio
chrome beacon
#

60s is 60000 miliseconds
add 60000 to currentTime and then compare that later

rare flicker
#

just multiply by 1000

tardy delta
#

store the System.currentimemillis to some variable and then compare it back after some time with the current system.currenmillis

humble tulip
#

So let's say u do past = currentMillis

subtle folio
humble tulip
#

Then now u do timeElapsed = currentMillis - past

rare flicker
#

if past + 60 * 1000 >= currentMillis

humble tulip
#

If timeElapsed is more than 60000

subtle folio
#

ohhh

humble tulip
#

It's more than 60 seconds

subtle folio
#

is it based on when the program was first run?

tardy delta
#

TimeUnit.MILLIS.toSeconds smh

grim ice
#

yes

humble tulip
#

No

rare flicker
#

its based on your computer

tardy delta
#

its based on the epoch time

humble tulip
#

Nanotime depends on runtime

#

Millis is system time

subtle folio
#

okay okay got it

#

thank you all ❀️

grim ice
#

its epoch

rare flicker
#

πŸ–€

grim ice
#

This method returns the difference, measured in milliseconds, between the current time and midnight, January 1, 1970 UTC

left swift
# chrome beacon Yes it's possible

so how? I tried to register mappings and it works, but without model

        Block model = Blocks.REDSTONE_BLOCK;
        Block block = Registry.BLOCK.registerMapping(Registry.BLOCK.getId(model),
                ResourceKey.create(Registry.BLOCK_REGISTRY, new ResourceLocation("minecraft", "x")),
                new Block(BlockBehaviour.Properties.copy(model)), Lifecycle.stable()).value();```
grim ice
#

you will have to modify the client in some way though

#

since it wouldnt know how to render that block

left swift
#

so I want to use existing minecraft block model

#

e.g. Redstone block

rare flicker
#

wait, you're telling me plugins have the capabilities of adding blocks

#

damn

grim ice
#

u can probably use resource packs

rare flicker
#

learn new things every day

grim ice
#

maybe

#

probably not though

#

im sort of sure u cant

grim ice
#

at that point just use forge mods

rare flicker
#

whether you can or you should are two different things x)

grim ice
#

sure do it if u wanna waste ur time

#

since u can do that in forge in a few minutes

#

its one of the most easy shit in forge

left swift
#

I think you can register ur block. I mean I have achieved it with custom entities πŸ™‚

grim ice
#

u can use hybrids maybe

grim ice
#

ur just copying another entity

#

and modifying it

left swift
#

I mean registration

grim ice
#

so you made a whole new entity?

main dew
#

How I can disable create end portal?

left swift
left swift
grim ice
#

in your code

main dew
left swift
grim ice
#

and you gave it a custom texture?

left swift
grim ice
#

also isnt that a forge class??

#

it actually is tho

chrome beacon
left swift
subtle folio
chrome beacon
#

The block registry is locked quite early in the loading process you may need to patch the server jar directly

grim ice
#

its spelled interpreter but ok

subtle folio
grim ice
#

i need an idea

#

to code

subtle folio
#

gambling

left swift
chrome beacon
#

Yes

left swift
#

so I already fixed it

left swift
# chrome beacon Yes

The block is registered normally, but the problem is that it doesn't have a model to be displayed to the client. Have I track packets and replace it with my model block or is there any other way to set default model to the vanilla block?

chrome beacon
#

You will have to replace it in the packet

#

as far as I'm aware

true perch
#

As a result of a server crash, there doesn't quite seem to be enough time to send hundreds of SQL updates to the database in time, which leads to data loss. So during the event of a crash I came up with the idea to store the data to local files instead, which would occur within milliseconds. The local files would then be read and applied to the SQL Database upon the next server startup.
Feedback on this idea would be great!

eternal oxide
#

A server crash halts all code execution, unless you are running your own process. You don;t have time to save to SQL, you will not have time to dump to file

formal bear
#

So I'm importing variables from config, then loading listeners, how to reload them? if I reload config it only reloads itself, listeners are registered already with old data, can someone explain it how to make it work?

eternal oxide
#

in the listener you can getHandlers().unregister(this)

formal bear
#

What about commands? (setExecutor)

left swift
quaint mantle
#

how can i use like a "text" aspect with in functions?

Example:

public void randomFunction(*Idk what to put here...*){
  // Code here
}
#

or do i just leave it blank?

tardy delta
#

?learnjava

undone axleBOT
quaint mantle
#

so would it be like String string

#

or?

eternal oxide
#

This is really basic Java

tall dragon
#

yes

quaint mantle
#

alr thx

quaint mantle
formal bear
#

nobodys perfect lmao

quaint mantle
#

exactlyyy

humble tulip
#

forgot πŸ‘€

eternal oxide
#

My point was that your question was a really simple and basic Java question. Not a spigot one. You should at the minimum attempt a google search to find the answer.

drowsy helm
#

So apparently if you zip a resourcepack directory minecraft won't recognize it but if you zip the CONTENTS which keep in mind both give the same output, minecraft will recognize it. Anyone got ideas how i can achieve the latter programatically?

eternal oxide
#

are you sure your first zip is not including teh root folder?

drowsy helm
#

yeah

#

not working version

#

working version

#

exactly the same contents

#

contents are identical

eternal oxide
#

very odd indeed

drowsy helm
#

im stumped lol

eternal oxide
#

there has to be some difference for MC to reject it

drowsy helm
#

yeah, can't seem to find anything on stackoverflow

chrome beacon
#

Check the sha1 of both files

drowsy helm
#

yeah good call

chrome beacon
#

Was there a difference

drowsy helm
#

working:
3c4774cf546264b0c5a52241b7345b19aaf941eb
not working:
33f9bf8322306c60fc2e7e9b3a0b80c9422fb1fd

#

thats sha256 tho

#

SHA1 is the same anyway

chrome beacon
#

Yeah

main dew
drowsy helm
#

so it is different

#

just not sure how lol

eternal oxide
true perch
eternal oxide
#

simple sha1

eternal oxide
drowsy helm
#

wait zip name is diff

#

will that affect sha

#

or is it just contents

opal juniper
#

i imagine that will affect it but idk

drowsy helm
#

by the looks of it, it doesnt

#

    public static void pack(String sourceDirPath, String zipFilePath){
        sourceDirPath = getDataFolder().getAbsolutePath() + "/" + sourceDirPath;
        zipFilePath = getDataFolder().getAbsolutePath() + "/" + zipFilePath;

        try {
            Path p = Files.createFile(Paths.get(zipFilePath));
            try (ZipOutputStream zs = new ZipOutputStream(Files.newOutputStream(p))) {
                Path pp = Paths.get(sourceDirPath);
                Files.walk(pp)
                        .filter(path -> !Files.isDirectory(path))
                        .forEach(path -> {
                            ZipEntry zipEntry = new ZipEntry(pp.relativize(path).toString());
                            try {
                                zs.putNextEntry(zipEntry);
                                Files.copy(path, zs);
                                zs.closeEntry();
                            } catch (IOException e) {
                                System.err.println(e);
                            }
                        });
            }
        }catch (IOException e){
            e.printStackTrace();
        }
    }```
this is my current zipping method
#

get the same sha if i manually zipped it though

quaint mantle
#

Hiya, hope i didnt intrude anything, i've been trying to setup custom recipes and the issue is that it needs a plugin and i dont want to pass in plugin to every item i want to create, however i need to pass the item as well. Is there anyway to avoid passing the main plugin as a paraemter if i want the create recipe in the same class as the item as i want to avoid this:

#

Or is this the most efficient way

eternal oxide
#

just pass a plugin reference to teh Class when you instance it

#

?di

undone axleBOT
drowsy helm
#

I think i'll give the MinecraftCommands discord an ask

#

they probably know

left swift
small current
#

how to access a EnderDragon's attribute modifier?

#

i should modify it like this ?

#

and is dragon's default health 200 ?

river oracle
small current
#

this works i googled

#

πŸ€“

#

why when i spawn the dragon it just stays there with no move

brave sparrow
#

Presumably the health of the dragon is changing the phase from what you set it to

#

Or for some other reason it’s rejecting your phase change

small current
#

it worked after i changed

brave sparrow
#

?

small current
#

the phase

#

bellow the health

brave sparrow
#

So it was the health, makes sense

small current
#

and why it's bossbar is not showing

quaint mantle
#

i have my bungee config loaded in the default java file (like where all the startup logic happens)
how do i make it so that i can access the config everywhere without loading it in each file?

brave sparrow
#

Pass the object instance around

eternal oxide
#

?di

undone axleBOT
ocean lion
#

What rank api should I use in my plugin when creating a setRankGUI

eternal oxide
#

Most often "Ranks" are managed by your permission plugin

ocean lion
#

permission plugin then

#

What is a good api

eternal oxide
#

if your plugin needs to read ranks/permissions then hook vault

dark harness
#

How can i make a custom recipe that ignores the Position of some items?
It needs all 4 types of skulls but ignores where they are?

uneven fiber
#

yo is potion effect duration in ticks or seconds?

dark harness
eternal oxide
#

You can;t have both order and orderless

dark harness
#

So then i need to create 4 recipes

eternal oxide
#

you either need to just accept ALL ingredients, or register a ShapedRecipe for every order