#help-development

1 messages ยท Page 2063 of 1

spring minnow
#

1.16.5

chrome beacon
#

Item gets removed on death

spring minnow
#

oh wait

#

that's not a big problem

#

no wait i meant

chrome beacon
#

Which is why a curse of vanishing + curse of binding pumpkin is a great way to troll your friends

spring minnow
#

curse of vanish

#

is not a big problem

rough drift
#

InventoryClickEvent#getCurrentItem() returns null when placing the item, am I using the wrong method?

spring minnow
#

had the same issue

#

but

#

curse of vanish doesn't add the enchant effect :/

chrome beacon
#

Yeah heads don't have it

#

Nothing you can do

spring minnow
#

D:

#

so you're telling me Mojang really spent one line to set a condition that makes heads not have enchantments, just to ruin my career?

#

;_;

grim ice
#

btw

#

its pronounced

#

moyang

rough drift
#

I call it Mogiang

chrome beacon
chrome beacon
#

Could you show your listener

rough drift
#

(I do use player that's just a quickly typed method to show what i do before actually calling methods on the item stack)

chrome beacon
#

Make sure that you're actually replacing an item in your inventory and not just placing it

rough drift
#

i clicked in an empty slot

#

and got null

#

so i assume it calls before setting it?

chrome beacon
#

Well yeah

#

Empty slot means null

rough drift
#

ye

chrome beacon
#

So what's the issue?

rough drift
#

I need it to not be null

#

like i actually need the item

tranquil viper
#

bump

chrome beacon
#

The method your using gets the item in the slot

#

Not the one your placing

#

Which is why it is null

rough drift
#

you did something wrong in your pom.xml/Metrics.java

rough drift
chrome beacon
#

You want getCursor

rough drift
#

yeah figured

#

thanks

midnight crown
#

Hello, I am new in the development of plugins, could you tell me where should I orient myself to add predefined things like on this screen to my commands? Thank you ๐Ÿ˜„

rough drift
#

its like CommandExecutor

#

but it returns List<String> for the tab completions

#

rather than a boolean

#

and is called each time you add a character

tranquil viper
rough drift
#

same

#

i don't know how to help you then

tranquil viper
#

dang nw

midnight crown
rough drift
#

np!

chrome beacon
#

@ivory sleet Gradle help

rough drift
#

if you don't want to return completions (meaning that you have none), return null

#

otherwise a list with some text

#

you can use args to check what args there are

#

exactly like in a command

ivory sleet
#

@tranquil viper

#

where did u put the resources pre compilation?

tranquil viper
#

Wherever intellij put them, I cloned the project from Github and optimized a couple things. I didnโ€™t touch any of the gradle related stuff though.

ivory sleet
#

what task r u using to compile?

eternal night
#

Ye gradle build won't cut it

#

Sadly they didn't setup the reactor task properly

#

๐Ÿ˜ญ

midnight crown
west oxide
#

is it a good idea to manage chat and players data from bungee plugin ?

eternal night
#

Player data from bungee sounds pretty useless

#

Your consumer would be the spigot plugin for that data

west oxide
eternal night
#

Yea but you'd need friends list on the server anyway

#

For like guis

west oxide
eternal night
#

Nah

#

Generally not much besides chat and some clienrside only packets

west oxide
#

client side ?

eternal night
#

Client side yeaaa

#

Sorry my mobile keyboard isn't too accurate

west oxide
#

thank you bro

eternal night
#

Np ๐Ÿ‘

west oxide
#

hey am getting an error code here please someone help i tried so many things
config = plugin.getFilesManager().getFile("MySql").getCustomFile();
filesManager class


    private final BCore plugin;


    private final LinkedHashMap<String,CustomFile> customFiles;

    public FilesManager(BCore plugin){

        createFile("MySql");

        customFiles = new LinkedHashMap<>();

        this.plugin = plugin;

    }


    public void createFile(String name){
        name = name + ".yml";


        CustomFile file = new CustomFile(plugin, name);

        customFiles.put(name,file);

    }

    public CustomFile getFile (String name){

        return customFiles.get(name);
    }


}```
#

and the CustomFile class


    private final String name;

    private File file;
    private Configuration customFile;

    public CustomFile (BCore plugin,String name){

        this.name = name;

        file = new File (plugin.getDataFolder(),name);

        if (!plugin.getDataFolder().exists()){
            plugin.getDataFolder().mkdirs();
        }

        if (!file.exists()){
            try{

                file.createNewFile();

            } catch (IOException e) {

                e.printStackTrace();
                return;

            }
        }

        try {

            this.customFile = ConfigurationProvider.getProvider(YamlConfiguration.class).load(file);

        } catch (IOException e) {
            e.printStackTrace();

        }

        save();

    }

    public void save (){

        try {
            ConfigurationProvider.getProvider(YamlConfiguration.class).save(customFile,file);
        } catch (IOException e) {
            e.printStackTrace();
        }

    }

    public Configuration getCustomFile() {return customFile;}

    public File getFile() {return file;}

    public String getName() {return name;}

}````
#

bungee

#

if someone helps i will very much appreciate it i cant find why

#

null pointer here config = plugin.getFilesManager().getFile("MySql").getCustomFile();

fervent gate
#

Is there a way to get the itemmeta of the placed block in BlockPlaceEvent from before it was placed?

#

or would I need to cancel the event for that?

#

get it and then continue?

tender shard
fervent gate
#

thx

cold pawn
#

Hey, does anyone know how id be able to get the latest addition to a file and make a gui from it. For context Im making a gui that logs recent player deaths, the player deaths are being stored in a file, id like to know how I can get the latest changes to the file and update the gui accordingly.

eternal night
#

Ehhh, don't store the player deaths in a file is basically the end here

#

Well txt file at least

#

Database would do wonders here with a timestamp you can sort over

#

(and an in memory cache)

pliant oyster
#

How can I check if damage was caused by a certain item?

tender shard
pliant oyster
#

alr

pliant oyster
tender shard
#

don't think so but I'm not sure

pliant oyster
#

hmm ok

tender shard
#

all I can think of is cancelling the event, then doing the damage manually

pliant oyster
#

I'm trying to make a knockback snowball

tender shard
#

then apply knockback manually

#

oh yeah you can just apply velocity

pliant oyster
#

ohh

tender shard
#

I thought you wanted to cancel an existing knockback

pliant oyster
#

well

#

I'm trying to make a projectile do more kb

tender shard
#

okay imagine this:

#

you want "100% knockback"

#

e.g. making the hit entity have as much "knockback" as the snowballs velocity

#
    @EventHandler
    public void onSnow(ProjectileHitEvent event) {
        event.getHitEntity().setVelocity(event.getEntity().getVelocity().add(event.getHitEntity().getVelocity()));
    }
#

if it should be less, just multiply the snowballs (event.getEntitiy())'s velocity e.g. with 0.5 for 50% or 0.1 for 10% etc

tender shard
#
    @EventHandler
    public void onSnow(ProjectileHitEvent event) {
        event.getHitEntity().setVelocity(event.getEntity().getVelocity());
    }
#

this will make the hit entity get exactly the velocity of the snowball

pliant oyster
#

lol

vocal cloud
#

knockback 1000 stick of justice

tender shard
#

wtf happened to my formatting

vocal cloud
#

ctrl + alt + L

delicate tartan
#

Hello,

I'm new to MC plugin development. I'm a Python programmer but am learning Java to have fun on my MC server.

I'm trying to trigger something when a player is in range of a beacon. That part was pretty easy...

public static void onEntityPotionEffectEvent(EntityPotionEffectEvent event) {

    if (!event.getEntityType().equals(EntityType.PLAYER)) {
            return;
        }

    if (event.getCause().equals(Cause.BEACON)) {
            Bukkit.getLogger().info("Player is in range of beacon.");
        }

}```

But I want whatever I triggered to be disabled when the player leaves the beacon's range.
Initially I tried to do something like:

```if (event.getCause().equals(Cause.EXPIRATION)) {
    Bukkit.getLogger().info("Player left beacon's range.")
    }```

But I quickly realized that while this works for when a player leaves the beacon's range and the effects wear off, it would also work if a player drank a potion and it wore off while he's still in beacon range.

I don't necessarily want to look for a beacon in nearby blocks because I imagine that would be an intensive function. 

I like the idea of using the EntityPotionEffectEvent as a trigger. If there was a way for me to verify that the effect that expired was from a beacon, that might work but I haven't found a way to do this. I was trying to take a look at the EntityPotionEffectEvent.java source code to see how Cause.BEACON was written but I can only see an ENUM that's passed to the EntityPotionEffectEvent class. I'm not sure how the getCause() method works behind the scenes.

Any tips would be extremely appreciated!
sand vector
#

because id's were depreciated if my 1.16 server allows any version to join would anything under 1.13 not work as there is no use of id's?

#

if that makes sense

desert musk
#
nests:
  2d3eee13-e170-4e72-86ff-b6868b1edded:
    name: unnamed-nest-0
    level: 1
  2d3eee13-e130-4e72-81ff-b6868b1edded:
    name: unnamed-nest-1
    level: 1
  2d3eee13-e110-4e72-82ff-b6868b1edded:
    name: unnamed-nest-2
    level: 1

is there a way that i can get the LIST of UIDs in the "nests" section of this yaml file

#

if anyone knows a method even if it entails reorganizing the yaml structure let me know

#

am i using yaml wrong?

#

pls i've been trying to do this for 3 days lmao

delicate lynx
#

use getConfigurationSection()

sterile token
#

Which is the command tu buidl spigot 1.18?

desert musk
young knoll
#

getConfigurationSection(โ€œnestsโ€).getKeys(false)

sterile token
#

I tried:

java -jar BuildTools.jar --rev lastest

#

And didnt work

delicate lynx
#

do you want 1.18 exactly or .2/.1

sterile token
#

Just 1.18

delicate lynx
#

use --rev 1.18 instead

sterile token
#

Oh nothin

#

Im dumb

#

I didnt download java 17 that why

delicate lynx
#

ah

sand vector
#

trying to make my code readable/ nicer to navigate. I want to have sections of code which i can shrink (like subroutines). I know you can do it in c# but im not too sure how to do it in java/eclipse

#

for example in c# you have this

young knoll
#

I think you can have sections in your ide

#

I swear spigot has them somewhere

proud basin
#

What's equivalent to implementation fileTree() for maven

sand vector
#

eclipse has code folding but not for what i would like it to do ๐Ÿคฆโ€โ™‚๏ธ

worldly ingot
#

Yeah, we use cold folding comments in the Material enum, but it only auto folds on NetBeans and I think IntelliJ

#

There might be an extension for Eclipse to add those types of comments

#

Never really looked for one tbh

fossil lily
#

How would I make it look like when tnt explodes the block go flying?

#

I see it on servers but I cant figure it out

hexed hatch
#

They turn some of the blocks into falling blocks and apply velocity to them

fossil lily
#

Hmm

#

oh okay

#

i thought i might need to make a million armor stands

#

but spigot has a createFallingBlock method

tall dragon
#

can any1 here explain to me how i can easily get a Set of classes that contain a certain annotation?

vocal cloud
#

You can use a heavy lib like reflections or you can do it yourself. Are the classes loaded?

young knoll
#

I do it using JarFile

sand vector
tall dragon
#

i kinda want a lightweight way without any clunky libs

vocal cloud
# tall dragon no

I wrote something to do that here. The library uses only base java methods so it's a super lightweight reflection library. It's also still in development so it's extremely buggy. https://github.com/MikeTheShadow/AutoRegisterLib/blob/master/src/main/java/com/miketheshadow/autoregister/util/ReflectionBase.java

GitHub

Contribute to MikeTheShadow/AutoRegisterLib development by creating an account on GitHub.

tall dragon
vocal cloud
#

You can make it not plugin dependent

rigid cradle
#

how to remove this [ ] guys

hybrid spoke
fossil lily
#

How do I make a baby/thicc wither? Do I need nms?

quasi patrol
#

In 1.17.1 I am confused in NMS on which is the thing for Remove_Player in PacketPlayOutPlayerInfo since it is different in 1.16.5 and below.

#

Probably am going to need to know the new one for add_player too.

sharp flare
#

can a projectile be converted to a itemstack in 1.15.2

#

#getConsumable does not exist in 1.15 is the reason for asking this

young knoll
#

It wonโ€™t have the data

sharp flare
#

oh rip

#

pdc won't be transferred right since the itemstack becomes an entity

young knoll
#

Correct

quasi patrol
#

Um?

marble rivet
#

i made a custom command and gave a permission on join to use it, but it doesn't show up in tab complete if the player isn't opped

#

the command is usable though

warm light
#

is there any different in Bukkit.getServer.getWorld(worldName) & Bukkit.getWorld(worldName) ??

#

and can a spawn location be null?

sullen marlin
#

no, all Bukkit.x methods are the same as Bukkit.getServer.x

sullen marlin
tender shard
#

I love the fact that Bukkit also has a setServer method

modern vigil
#

Rip

tender shard
#
Field field = Bukkit.class.getDeclaredField("server");
field.setAccessible(true);
field.set(null, myNewServerObject);
#

does someone know whether there's some kind of EnumSet Collector?

#

huh why is EnumSet.of so weird? why not just of(E first, E... rest)? Why is there a separate method for of(3 elements), of(4 elements), of(5 elements), ... o0

#

also huh am I stupid or is intelliJ stupid? Isn't the "bufferedReader.close()" statement useless here?

    public static boolean replaceStringsInFile(final File file, final CharSequence toSearch, final CharSequence replace) throws IOException {
        boolean changed = false;
        try (final BufferedReader bufferedReader = new BufferedReader(new FileReader(file))) {
            final StringBuilder inputBuffer = new StringBuilder();
            String line;
            while ((line = bufferedReader.readLine()) != null) {
                if (line.contains(toSearch)) {
                    line = line.replace(toSearch, replace);
                    changed = true;
                }
                inputBuffer.append(line);
                inputBuffer.append(System.lineSeparator());
            }
            bufferedReader.close();
            if (changed) {
                try (final FileOutputStream fileOut = new FileOutputStream(file);) {
                    fileOut.write(inputBuffer.toString().getBytes());
                }
            }
        }
        return changed;
    }
vocal cloud
#

So you read the file then want to write to it? Wouldn't that require the file to be closed?

wet breach
vocal cloud
#

1s let me format the code

wet breach
#

but to write to a file doesn't require it to be closed if its only being read

tender shard
#

I am just confused why intellij doesnt say the "close()" method is unneeded

wet breach
#

in case the try with resources fails for some odd reason, it should still close out

vocal cloud
#

Intellij supports early closing of resources ๐Ÿ‘

tender shard
#

if I move it to the bottom, it says it's unneeded

vocal cloud
#

Though intellij gets mad if you destroy a thread yourself

wet breach
#

because the try with resources reaches the close before the statement if you move it to the bottom

#

however the way you have it, is actually proper

tender shard
#

k I'll just leave it like this

wet breach
#

should always close out resources early when ever possible even if using try with resources ๐Ÿ™‚

#

others may not like doing that, but whatever lol

fervent gate
#

Is there a better way of getting the instance of the main class?

#

I use it in namespacedkeys for example

grim ice
#

make plugin final

#

also

#

there is another way

vocal cloud
#

I take after what Mojang does and I like to make a big class of keys and register them all in 1 go using a method.

grim ice
#

not better but less annoying

vocal cloud
fervent gate
#

ah wait, you're talking about namespacedkeys

vocal cloud
#

Makes a new NameSpacedKey

#

Probably should name it get or something

grim ice
#

nah

#

load() is fine

fervent gate
#

So this isn't necessary?

grim ice
#

you guess

vocal cloud
#

It saves you on having to do that every time you want the key

grim ice
#

its just DRY

vocal cloud
#

If you only use it once it's w/e but when you're writing a plugin that is basically built on it then it's different

fervent gate
#

yea, mine kinda is

grim ice
#

@fervent gate

#

did they accept u in devroom

fervent gate
#

Yes, why?

vocal cloud
#

Cause this

NamespacedKey key = new NamespacedKey(ComplexMMOStats.getInstance(), "whatever");
PersistentDataContainer container = stack.getItemMeta().getPersistentDataContainer();
container.set(key, PersistentDataType.INTEGER,5);

becomes

PersistentDataContainer container = stack.getItemMeta().getPersistentDataContainer();
container.set(CMMOKeys.Key, PersistentDataType.INTEGER,5);
grim ice
#

they seem to accept anyone but they didnt accept me lmao

fervent gate
#

Damn

#

It was a simple plugin too

grim ice
#

like uh no offense

#

but your trial plugin is definitely worse than my level

#

idk how they didnt accept me

fervent gate
#

Yea it definitely wasn't "good"

grim ice
#

and they gave me one hard of a project

#

they give me literally a Duels/Practice core

fervent gate
#

oh

grim ice
#

lmao

#

i made it eitherway and they denied me

#

after making me wait 6 days for them to review it

fervent gate
#

they gave me a chest that spawns on death with a sign. It drops its content on close

#

and despawns

grim ice
#

BRO

fervent gate
#

not the most difficult haha

grim ice
#

wtf

#

do u even get commissions btw

fervent gate
#

I have got some but I don't do them very often

#

I maybe got 2 in total where 1 client just closed it before I could get started

modern vigil
#

Is there a better way to convert an Stream<Path> to an Array<Path> than to do Stream<Path>#toArray?

fervent gate
# grim ice wtf

But yea, ur clearly more experienced than me, I'm sure you can make it through

modern vigil
#

If I cast it to an Array<Path> it throws an ClassCastException

vocal cloud
#

What's wrong with using .toarray?

modern vigil
#

It returns Object[]

buoyant viper
#

the real issue here is using a stream ๐Ÿ˜Ž

buoyant viper
modern vigil
#

java.lang.ClassCastException: class [Ljava.lang.Object; cannot be cast to class [Ljava.nio.file.Path;

#

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

buoyant viper
#

like

Path[] theArray = (Path[]) theStream.toArray(new Path[0]);

vocal cloud
#

What's your initial stream

buoyant viper
#

wait isnt there a .collect method for this

modern vigil
#

I use Files#walk with a Path to a folder as the first parameter

grim ice
#

do they like randomize the whole shit

#

thats pretty unfair

#

everyone i know got something easy

fervent gate
#

If they gave you a duels core, I guess

modern vigil
grim ice
#

@fervent gate wait ur a commission manager?

#

what does that do

buoyant viper
#

interesting documentation for Stream (Object[]::new)

vocal cloud
#

list.stream().collect(Collectors.toList());

fervent gate
#

Well, that role creates invoices, we help the client actually get a freelancer and we make sure the client gets a quality product that they are satisfied with

grim ice
#

o

buoyant viper
#

nah just

modern vigil
buoyant viper
vocal cloud
#

kotlin moment

grim ice
vocal cloud
#

Jetbrains made kotlin can't bash it

#

All hail our jetbrains overlords

grim ice
#

n o

vocal cloud
#

Gotta uninstall intellij then

grim ice
#

n o

vocal cloud
#

Then all hail our jetbrains overlords

grim ice
#

kt still sucks tho

#

they lied to me

#

it isnt kt fun

modern vigil
#

what's wrong with kotlin

grim ice
#

everything

modern vigil
#

give me an example

grim ice
#

its existence bothers me

modern vigil
#

how does that make it a garbage language

grim ice
#

its not

#

i just dislike it

#

opinion != fact

tender shard
#

if you have a class with a public field and a setter, you never know whether you access the setter or not when doing

myObject.field = newValue
grim ice
#

and the syntax sucks as well

#

if it didnt have java compatibility no one would use it

#

would be left out same as scala i assume

tender shard
#

also kotlin claims that "extension methods" are so awesome but in reality they are nothing more than a static method that accepts a given object

tender shard
#

yes lombok has it as experimental feature

buoyant viper
#

Files.walk(/* your path */).toArray { arrayOfNulls<Path>(it) } maybe @modern vigil

solid cedar
#
    public static void other() {
        ScoreboardManager manager = Bukkit.getScoreboardManager();
        Scoreboard board = manager.getNewScoreboard();
         
        Objective objective = board.registerNewObjective("e", "e2");
        objective.setDisplaySlot(DisplaySlot.PLAYER_LIST);
        objective.setDisplaySlot(DisplaySlot.BELOW_NAME);
        objective.setDisplayName("something"); //&k
        
         
        for(Player online : Bukkit.getOnlinePlayers()){
          Score score = objective.getScore(online);
          score.setScore(1);
        }
         
        for(Player online : Bukkit.getOnlinePlayers()){
        online.setScoreboard(board);
        }
    }
}``` I want to change the player's name so that it doesn't show its nickname but some other text. How to do it with this code?
vocal cloud
#

To change a player's name don't you have to mess with like nms

grim ice
#

change it completely

#

or add prefix?

solid cedar
#

completely different

grim ice
#

go mess with nms then

vocal cloud
#

Make everyone's name Joe

grim ice
#

Mama

buoyant viper
#

joe biden

grim ice
#

joey

#

@buoyant viper r u a female btw

tardy delta
#

old joe

tender shard
solid cedar
#

๐Ÿ˜‚ and how to do it?

vocal cloud
#

Alex showing up to T pose on people

buoyant viper
grim ice
#

nah i just dont see female developers often

vocal cloud
#

She does change her name every odd day

#

Female. Ugh such an awful word to use

tender shard
#

yes, better say "unmale"

buoyant viper
#

mad bc i had an idea for my smps plugin but i cant remember what it was

#

grr

tardy delta
#

scary

#

๐Ÿ‘‰๐Ÿ‘ˆ

vocal cloud
#

Whenever a player kills someone instead of dying the player gets launched 100k blocks from spawn and has to run back

tender shard
buoyant viper
#

i wanna say it was something that wouldve went under player

vocal cloud
#

Please don't turn this into twitch chat

grim ice
#

plug in

#

kinda sus if u ask me

#

whos plugging that in

tender shard
buoyant viper
#

hmm

vocal cloud
#

Make them do my crypto taxes

tardy delta
#

bitcoins

tender shard
#

people can also hire tax accountants to do the declaration for them but they are expensive and not worth it

vocal cloud
#

I should declare the spigot NFT as a charity donation

grim ice
#

ill buy spigot and its developers and staff

buoyant viper
#

it was something that wouldve affected gameplay

#

genuinely cant remember it tho

vocal cloud
#

Take a nap. Works for me

tender shard
#

that's why you should always write down ideas immediately ๐Ÿ˜›

#

a backup for your brain

vocal cloud
#

Better yet put them in extremely passive aggressive Todo statements

tender shard
#

what is an "aggressive" todo statement?

solid cedar
#

How to make a invisible player name?

tender shard
solid cedar
#

ya

vocal cloud
tender shard
# solid cedar ya

I think NMS has a method for that, otherwise yu can just add players to a team and make the name invisible for that team

#

I think you can also make the player wear an armorstand as passenger

#

whoa

buoyant viper
#

does this mean we could have managing an offline player? ๐Ÿ˜Ž

tender shard
#

not sure

#

it's a method in Player, not OfflinePlayer

buoyant viper
#

ik :(

tender shard
#

lol

#

my todo list is more friendly

vocal cloud
#

Yuck actual organization

solid cedar
#

The method addEntry(String) in the type Team is not applicable for the arguments (Player) uh

vocal cloud
#

you pass in the name

solid cedar
#

aa ok

#

getname?

tardy delta
#

what would happen when you pass in something random?

buoyant viper
tardy delta
#

where is the TODO?

#

๐Ÿ‘‰๐Ÿ‘ˆ

buoyant viper
#

my brain was just that big

#

it didnt need one

tardy delta
#

oh

tender shard
buoyant viper
#

dont need todos if u do it

tender shard
#

I do it the other way around

#

I always let people add stuff to the todo list and then I never read it

#

or I do add the stuff and then forget to mark it as done

#

or sth inbetween like adding the feature but never releasing it

vocal cloud
#

Most of TODOs are just rotting away like this

#

like I'd ask what I was thinking but I imagine this was a 5am zinger

tender shard
#

or there kind of todos:

public class TeleportLocationUtils {

    private static final int[][] offsets = {
            {-2,-2}, {-2,-1}, {-2,0}, {-2,1}, {-2,2},
            {-1,-2}, /*{-1,-1}, {-1,0}, {-1,1},*/ {-1,2},
            {0,-2},  /*{0,-1},  {0,0},  {0,1}, */ {0,2},
            {1,-2},  /*{1,-1},  {1,0},  {1,1}, */ {1,2},
            {2,-2},  {2,-1},  {2,0},  {2,1},  {2,2}
    };

    public static Location getFinalTPLocation(Block chest) {
        Collection<Block> targetLocations = BlockUtils.getBlocksInRadius(chest.getLocation(), 3, BlockUtils.RadiusType.CUBOID, new Predicate<Block>() {
            @Override
            public boolean test(Block block) {
                return false;
            }
        });
        VectorUtils.lookAt(null,null);
        return null; // TODO
    }
}

Okay, TODO, but WHAT is there to do?

buoyant viper
#

is it really coding if it isnt something u wrote at 4am that youre never gonna remember what it did?

fallen sandal
#

hello i have a code which need Dotclass

#

import java.assist.runtime.DotClass;

#

this import is not working

buoyant viper
#

wtf is DotClass

#

do u mean .class ?

tender shard
solid cedar
#
    ScoreboardManager manager = Bukkit.getScoreboardManager();
    Scoreboard board = manager.getNewScoreboard();
        Team team = board.registerNewTeam("justtest");
        team.setPrefix("ยงc[INC] ");
        team.addEntry(player.getName());
    }``` why it isn't working?
buoyant viper
#

oh its part of

#

javassist

tender shard
#

yeah that's javassist.runtime though

#

and not java.assist

buoyant viper
#

u can see where he was heading with it

#

but if u couldnt figure out a wrong import u should not be using asm to any extent

vocal cloud
#

Sometimes if I'm lucky my 5am self writes some really great documentation like with my translation library. Woke up to a lot of code and I had to read it too. Ugh

buoyant viper
#

thats just a recipe for headaches and disasters

buoyant viper
#

or leaves it for the next 5am me

vocal cloud
#

Thanks 5am self

tender shard
#

why did you add a comment for that lol

buoyant viper
#

so that he knows what the param is for

vocal cloud
#

Technically it's wrong too

tender shard
#

perfect

vocal cloud
#

It's the config file including the .yml part

#

Not just the name but the extension as well

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.

buoyant viper
rough drift
rough drift
#

why

#

just why

vocal cloud
#

C# as well

rough drift
#

yeah but thats java

buoyant viper
#

bootleg java

solid cedar
vocal cloud
#

I think my 5am self believes my 8am self to be a dumbass so all the methods have these almost sarcastically obvious comments

vocal cloud
rough drift
vocal cloud
#

Also I wrote a method that I instantly deprecated?

buoyant viper
#

LOL

rough drift
vocal cloud
#

I need 2 git accounts so I can git blame someone else

tardy delta
#

i stopped adding documentation cause it was too obvious what things do

rough drift
#

I only add docs when i feel its necessary

#

like, for ex i have a cache class and i don't document add, remove, get methods

#

because they do just that

vocal cloud
#

It's a public library so I wrote docs as practice more than anything

rough drift
#

i am so retarded

#

i found out why my saving system wasn't working

#

I was storing the amount

vocal cloud
#

you weren't saving

rough drift
#

not the slots

buoyant viper
#

forgot to save?

rough drift
#

so i was storing like

#

there are 23 items

#

not where

#

so it only loaded the 23 items

#

nothing past that

#

(it saves as uuid:slot so uuid:count 15 would load up until uuid:slot14, fair enough, but if you had 13 like that and 1 at 27 it wouldn't load)

buoyant viper
#

F

rough drift
#

i can just store the indexes i have like

tender shard
rough drift
#

uuid:count "[1, 2, 5, 6]"

#

and then load

#

uuid:1
uuid:2
uuid:5
uuid:6

#

i could very well loop from min to max

#

but i need to make it as perf as possible

#

should now work

#

like FYI

#

the saving was 100% on point

#

the only problem was the loading

#

which i had to change what i saved

granite owl
#

can i use this line to hook into other plugins commands to alterate their implementation?

#
plugin.getServer().getPluginCommand("cmd").setExecutor(new CmdExecutor());
#

am i getting that right?

manic furnace
#

In Gson, can I use my Gson object more than one time? So I can get it from my Main class evry time?

onyx fjord
#

Is there a normal way to send player a message in ChatComponent?

tender shard
tender shard
onyx fjord
#

i mean json message

vocal cloud
onyx fjord
#

click event to be exact

tender shard
onyx fjord
#

like

#

it only can copy stuff or send command

tender shard
#

maybe decompile the tellraw command and see what it does lol

fallen sandal
onyx fjord
vocal cloud
fallen sandal
#

Dotclass

#

cant i import dotclass without javassist?

vocal cloud
#

Uhhhh if it's from a library you need said library to access the class file?

grim ice
#

@onyx fjord hi nft

tender shard
grim ice
#

ill screenshot ur nft

fallen sandal
tender shard
#

for real?

vocal cloud
#

After many years

tender shard
onyx fjord
vocal cloud
#

ETH just needs to remain at this level so I can get the NFT for 69

granite owl
#

is there a method to get a registrated commands aliases?

#

like

#

/plugins

#

then getting /pl

#

bukkit:pl

tender shard
#

have you even tried to check the javadocs?

granite owl
#

bukkit:plugins

tender shard
#

Command#getAliases

granite owl
#

i mean

#

from other plugins

tender shard
#

I told you

#

getAliases

vocal cloud
#

What exactly are your trying to do. Is the plugin you're messing with open source?

tender shard
vocal cloud
marble granite
#

Hey! so my code just broke with the message that it couldnt resolve ItemMeta.setCustomModelData(int) though i have spigot 1.18.2 in my pom

chilly haven
#

I am trying to send the dtr in a message, but it gives a error at this line
String dtr = String.valueOf(manager.getFactionByPlayer(send).getDtr());
But what is wrong with this, i used string,valueof because its a double

tender shard
marble granite
tender shard
#

?paste your pom.xml

undone axleBOT
marble granite
eternal night
#

Screams like something is including some old spigot API

tender shard
#

put spigot-api at the top

eternal night
#

Lol

#

Vault

tender shard
#

currently you have vault as first dependency

marble granite
#

OH

granite owl
# vocal cloud yes

blocking command execution for certain users at runtime without touching the permission nodes

marble granite
#

might that be it?

granite owl
#

its already working

eternal night
#

(or actively exclude Bukkit from vault)

tender shard
#

that definitely is it

granite owl
#

only been missing the alias part

vocal cloud
marble granite
marble granite
eternal night
#

NbtAPI in 1.18

#

Smh

tender shard
#

yeah

vocal cloud
#

PDC is easier

marble granite
#

no it's for more support, not every version has PDC

tender shard
#

btw Lynx I moved your PDC guide in the resources list to its own category in the wiki

marble granite
#

iirc at least

eternal night
#

Oh really ?

#

?pdc

tender shard
#

yeah wait

#

check the resources list

marble granite
#

yea thats 1.14 > right?

#

PDC

tender shard
#

1.14.1+

marble granite
#

yea exactly

#

NBTAPI lets me support virtually any version

tender shard
#

1.14.1 is so old, noone uses it anymore

wet breach
#

well

#

could be worse

grim ice
#

1.8.8 is famous tho

#

1.12 is still used as well

wet breach
#

I think 1.5 is more famous

eternal night
#

Oh sweet

#

Thanks ๐Ÿ™

wet breach
#

but whose counting

tender shard
#

my father's office still has one server with windows server 2001 or so lol

grim ice
#

Hybrid forks of spigot and forge usually are 1.12

#

cuz many mods are 1.12

vocal cloud
#

My friends work used win xp computers

#

Probably still do

tender shard
#

some ATMs in germany are also still on XP lol

grim ice
#

u guys have atm

#

nice

#

we dont even have one

#

LOL

tender shard
grim ice
#

that looks dirty as fuck

#

my dead grandmother old radio

vocal cloud
#

Alright it's time to sleep lmfao. I've seen enough xp for a lifetime

grim ice
#

wait wat time is it for u

onyx fjord
tender shard
#

taco time

vocal cloud
#

3:30am

grim ice
#

o

tender shard
#

oh boy, 3.30am, time for the morning taco

vocal cloud
#

gonna hit that ballmer peak of programming

grim ice
#

i cant eat until like 8 pm

#

(fasting ramadan)

tender shard
#

ugh

grim ice
#

or drink too

tender shard
#

why do you torture yourself

grim ice
#

idk

#

religion said so

vocal cloud
#

I dropped the plugin in your off topic Alex. Lmk if it's helpful or close to what you wanted. It's for my stuff but I imagine it can be made generally useful

tender shard
#

oh yeah I'll check it out later, I have to make my awesome breakfast burger now

tender shard
#

cya

vocal cloud
#

Oh and stop drinking in the AM

sage patio
tender shard
quaint mantle
#

Is there a way to set an items hit damage to less than the normal damage?

#

Like yes, attribute modifiers are cool, but why can't you Set an attribute to something instead of adding or multiplying

crimson terrace
#

if it isnt an option (or possible) I usually put a tag in the PDC and then check the EntityDamageEvent for an item with that tag, then change the damage there

onyx fjord
#

How to run code after async task it complete?

buoyant viper
#

run for the code at the end of the async task?

#

idk

onyx fjord
#

i figured out thanks anyway

glossy venture
#

why doesnt this show the texture?
the file on the right (generated by the code) is located at assets/minecraft/models/item/redstone.json, the custom model file is located at assets/example/models/item/ruby.json and the texture for the ruby is at assets/example/textures/items/ruby.png

#

it looks like this

#

just redstone

tall dragon
#

do you have the resource pack loaded? ๐Ÿ˜‚

glossy venture
#

yeah

#

the server resource epack

#

pack

#

im pretty sure i had

#

yeah

#

this is the pack if you want to download it and look

#

i use filebin to host them automatically

quaint mantle
tall dragon
glossy venture
#

ok i reordered it putting the overrides last

#

and now the model is broken

#

which means its at least loading it

crimson terrace
slate pendant
#

Hello, I just got a question. Can a server be paused? I mean clientside singleplayer uses vanila integrated server, and it's very similar to bukkit or spigot one, so maybe this feature exists here too? (When you press ESC you pause the server if it's not "opened for lan")

#

P.S. It's bukkit/spigot API related question

drowsy helm
#

well you can pause the main thread but that will cause heaps of issues lol

slate pendant
#

yes

#

what if pause all threads

#

but no, it's a bad idea

#

even scheduller won't work then

drowsy helm
#

yeah that will just end up crashing the server

drowsy helm
#

maybe you can change the tickspeed to 0?

#

not sure how that would effect everything though

slate pendant
#

ok, I'll try

#

(later)

tender shard
#

try MinecraftServer.halt(boolean) lol

#

I think if you set MinecraftServer.running to false, it should be paused

#

the question is - how do you want to start it again?

lavish hemlock
#

Gotta love decompiled Minecraft code

slate pendant
#

basically we can just pause threads a bit over and over and try not to display warnings in console

#

The main question was does that vanila feature even exist lol

slate pendant
# tender shard

never saw that field before, who knows, maybe it's what we are talking about

#

maybe client just changes it when menu screen is opened/closed

glossy venture
#

dude i just cant get this resource pack shit to work

#

is it a 1.18.1 bug?

#

ima try it on 1.18.2

grim ice
sacred mountain
#

is there a way to asynchronously get nearby entities?

#

in a radius

eternal night
#

No

#

The method by its concept accesses entities in the world

#

Which is only safe from the servers main thread

sacred mountain
#

how would i go about making it so that whenever a player sends a chat message, only the recipients in a certain radius will recieve the message?

eternal night
#

The async player chat event provides you with all recipients?

sacred mountain
#

?

eternal night
#

Yea

#

Just .removeIf on the set

glossy venture
#

dude i swear minecraft resource packs are broken

eternal night
#

#Doubt

glossy venture
#

#nodoubt lol

sacred mountain
#

oh sorry

#

capital I

glossy venture
#

see anything wrong with this? (generated)

eternal night
#

Its a method that allows you to remove entries from a collection if a predicate matches them

sacred mountain
#

font moment

#

my intellij font shows capital i as

glossy venture
#

wait do you need to put the namespace like item/<namespace>/<id> now?

#

because if so, thansk

golden turret
#

nop

glossy venture
#

oh

golden turret
#

i simply dont use namespace:...

glossy venture
#

i want to tho

golden turret
#

you dont need

#

it is a resource pack

glossy venture
#

ill give it a try

#

i guess

glossy venture
#

like assets/<modid>/a/b/c

golden turret
#

so you are wrting a mod?

glossy venture
#

nah a plugin which allows for loading of content

#

and custom items

#

and shit

golden turret
#

so you dont need the namespace

glossy venture
#

i dont need it, i want it and if its possible i will use it

golden turret
#

then simply create a folder for your resource pack

#

in my case, hooked

glossy venture
#

yeah

golden turret
glossy venture
#

this is the generated pakc

glossy venture
#

ill try

#

maybe like mod_<id>

#

oh no wait but im copying the assets directly from the mod jar

#

into the resource pack

#

i mean it is possible

#

but it wont be very clean

#

wait i think it might be the way gson writes the json files

#

lmao

#

yeah gson has much smaller indents

#

whenever i manually edit a file it works

#

no

#

nvm

plush gulch
#

how do I check if a ProjectileHitEvent hits an entity or a block?

tardy delta
#

btw you're a fake gandalf

plush gulch
plush gulch
tardy delta
glossy venture
#

please help lmao

#

still doesnt work

#

and the resource pack is packaged correctly (i think)

#

i tried manually moving it to my resource packs folder

#

but it still doesnt work

#

hosting code

fervent gate
#

Is there a way to make block changes not heavy on the server? I knew a plugin that did a lot of block changes and the tps was very low because of them. They were all done by block.setType(), but would player.sendBlockChange() be a better solution?

young knoll
#

That would only change the block for the player

fervent gate
#

I know

young knoll
#

setType(type, false) is pretty much the fastest you can get

fervent gate
#

What about packets?

glossy venture
#

only for players again

fervent gate
#

Mk. Thanks

keen basin
smoky oak
keen basin
smoky oak
#

theres a chance the server software is different

#

if its like that you probably run a method which your localhost server has in its api but your online server doesnt

#

or is implemented differently

keen basin
smoky oak
#

well is the server software actually different?

#

bc if it's not the issue is elsewhere

golden turret
#

could someone send the link to the list of the remapped things?

smoky oak
#

?remapped

#

worth a try

midnight shore
#

How can i get every block in a chunk?

chrome beacon
#

Do a for loop

#

Or 3 of them to be exact

midnight shore
#

what do i put in this for loop?

chrome beacon
#

x, y and z

midnight shore
#

can you send me an example?

chrome beacon
#

16 x 16 for x and z and use getMaxHeight and getMinHeight for the y axis

midnight shore
#

like this?

chrome beacon
#

Yes

echo basalt
#

Metadata is saved as a collection of metadata values

#

each metadata value contains its internal object, a reference of the plugin holding it and additional data when required

#

getValue or something

#

just use your IDE

desert musk
#

what the FUCK did they do to stackoverflow????

#

lmfao

#

oh

echo basalt
#

getMetadata returns a collection

#

of metadata values

desert musk
#

because i cannot figure out how to disable the april fools joke on stackoverflow

#

can someone direct me to how to delete a yaml key and all of its contents

desert musk
#

but will that actually remove its entry?

echo basalt
#

yes

desert musk
#

cause it has sub-values

#

okok

#

sweet

#

ty

desert musk
grim ice
#

btw

#

anyone here has experience with mongodb?

desert musk
#

no but it looks cool

#

lol

ivory sleet
desert musk
grim ice
#

DB class doesnt exist anymore

#

and MongoClient is an interface now

#

and DBCollection doesnt exist too

rough drift
#

2hex its pretty easy

#

to connect

#

sorta

#

i haven't been able to test

#

since mongo's atlas is broken, and their installer is weird af

#

You need a connection string

#

then mongo client settings

#

and then MongoClients.create(MongoClientSettings)

#

don't expect to be able to use that however

grim ice
#

o

rough drift
#

as its fucking difficult getting a db

grim ice
#

ill use the old driver <3

rough drift
#

yeah ig

grim ice
#

"mongodb://" + USERNAME + ":" + PASSWORD + "@" + IP + ":" + PORT + "/"

#

is this fine

rough drift
#

yah

shut solar
#

if i use return; in repeated task does it cancel the task or just waits until it runs again?

crimson terrace
quasi patrol
#

What is the 1.17+ of Remove_Player, and Add_Player for PacketPlayOutPlayerInfo (NMS ofc) cause it was changed in 1.17 but idk what the ne one is?

desert musk
#

Entity nestEnt = Bukkit.getEntity(nestID);

this returns null

#
   public static void addMember(UUID nestID, Player player, String role) {

        // checks if yaml paths exist
        if (!nestExists(nestID)) return;
        if (containsMember(nestID.toString(),player.getUniqueId())) return;

        Entity nestEnt = Bukkit.getEntity(nestID);
 
        if (nestEnt == null) 
            throw new RuntimeException("Entity was null when reached in addMember"); // throws every time

setNestSpawn(nestID, playerUUID, nestEnt.getLocation());

    } ```

```Java
  addMember(this.getBukkitEntity().getUniqueId(), placer, "leader");

^^^ above does not work

#

however,

#
        addMember(this.getBukkitEntity().getUniqueId(), placer, "leader");
        setNestSpawn(this.getBukkitEntity().getUniqueId(), placer.getUniqueId(), this.getBukkitEntity().getLocation());
#

^^^the above works

amber palm
#

Hello together I have been programming on a Spigot plugin again for a long time. However, I forgot how to get plugin.getCustomConfig() in another class. Since I don't see a plugin. there.

Config Generation:

`
private File customConfigFile;
private FileConfiguration customConfig;

@Override
public void onEnable(){
    createCustomConfig();

}

public FileConfiguration getCustomConfig() {
return this.customConfig;
}

private void createCustomConfig() {
    customConfigFile = new File(getDataFolder(), "guild.yml");
    if (!customConfigFile.exists()) {
        customConfigFile.getParentFile().mkdirs();
        saveResource("guild.yml", false);
    }

    customConfig = new YamlConfiguration();
    try {
        customConfig.load(customConfigFile);
    } catch (IOException | InvalidConfigurationException e) {
        e.printStackTrace();
    }
}

}`

desert musk
#

create a get() member function that simply returns customConfig

#

public static FileConfiguration get() { return customConfig; }

amber palm
#

thanks ^^

desert musk
#

CustomConfig.get()

#

although i'm not actually sure why your CustomConfig.getCustomConfig() didn't work

amber palm
#

nothing Changed. he said i must remove the Static and i cant get the function in the other class

desert musk
#

huh

#

interesting so ig he just wants you to make a single CustomConfig object

#

which ig makes sense

#

you just have to import that object to each class

amber palm
#

i have it so

public FileConfiguration get() {
return customConfig;
}

desert musk
#

which is kinda dumb imo

#

so i think make a new CustomConfig object in your main class

#

and then import object into the classes that you want

amber palm
#

i cant get any function out of the Main Class. is that normal xD?

grim ice
#

im storing an inventory in redis each time a player closes a custom inventory

#

is that fine

desert musk
grim ice
#

updating

sage dragon
desert musk
#

idk whats going on

sage dragon
#

If you don't have an instance, you can only use static stuff

quasi patrol
#

...

amber palm
#

uff how do i make a Instance and where?

desert musk
#

but can someone tell me why Bukkit.getEntity(Entity.getUniqueId()) returns null?

sage dragon
amber palm
#

okay

#

i have it so Swasch main = Swasch.getPlugin(Swasch.class); now?

sage dragon
#

If your main class is named Swasch, yes

amber palm
#

okay but i cant get main in other Class?

sage dragon
#

Do it like this:

    private static Schwasch main;
    private File customConfigFile;
    private FileConfiguration customConfig;

    @Override
    public void onEnable(){
        main = this;
        createCustomConfig();
}


  public static Swasch getMain() {
       return main;
    }


  public FileConfiguration getCustomConfig() {
        return this.customConfig;
    }


    private void createCustomConfig() {
        customConfigFile = new File(getDataFolder(), "guild.yml");
        if (!customConfigFile.exists()) {
            customConfigFile.getParentFile().mkdirs();
            saveResource("guild.yml", false);
        }

        customConfig = new YamlConfiguration();
        try {
            customConfig.load(customConfigFile);
        } catch (IOException | InvalidConfigurationException e) {
            e.printStackTrace();
        }
    }
}
#

After that, you can use Schwasch.getMain()

amber palm
#

okay

sage dragon
#

Or just make your customConfig stuff static, I guess ยฏ_(ใƒ„)_/ยฏ

desert musk
#

if you're only doing one customConfig ig

#

GUYS

#

System.out.println(this.getBukkitEntity() == Bukkit.getEntity(this.getBukkitEntity().getUniqueId()));

#

this is printing false

#

??????????????

sage dragon
sage dragon
desert musk
#

this makes no sense whatsoever

sage dragon
#

Huh?

desert musk
#

oh wait you mean the whole thing

#

thought you meant getUniqueId

#

misread

#

yeah but the entity exists

#

i literally just created that entity inside of the method

#

why is it returning null?

#
public EntityNest(Location loc, Player placer) {
        super(EntityType.VILLAGER,((CraftWorld) loc.getWorld()).getHandle());

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

        CraftLivingEntity ent = (CraftLivingEntity) this.getBukkitEntity();
        ent.setAI(false);
        ent.setSilent(false);
        ent.setCollidable(false);

        ent.getAttribute(Attribute.GENERIC_MAX_HEALTH).setBaseValue(1000);
        ent.getAttribute(Attribute.GENERIC_MOVEMENT_SPEED).setBaseValue(0);
        ent.getAttribute(Attribute.GENERIC_KNOCKBACK_RESISTANCE).setBaseValue(1000);

        ent.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, Integer.MAX_VALUE, 3, true));
        ent.addPotionEffect(new PotionEffect(PotionEffectType.GLOWING, Integer.MAX_VALUE, 1, true));
        ent.addPotionEffect(new PotionEffect(PotionEffectType.FIRE_RESISTANCE, Integer.MAX_VALUE, 1, true));

        this.setHealth(1000);   // FIX THIS to read from nest level

        //  write to data

        int unnamed = 0;
        while(!NestYML.Nest(this.getBukkitEntity().getUniqueId(),"Unnamed Nest "+Integer.toString(unnamed), 1)) {
            unnamed++;
            System.out.println("Found unnamed nest with the same name, iterating");
        }

        this.setCustomName(new TextComponent(ChatColor.GOLD + "" + ChatColor.BOLD + "Unnamed Nest "+Integer.toString(unnamed)));
        this.setCustomNameVisible(true);

        addMember(this.getBukkitEntity().getUniqueId(), placer, "leader");
        setNestSpawn(this.getBukkitEntity().getUniqueId(), placer.getUniqueId(), this.getBukkitEntity().getLocation());
        System.out.println(this.getBukkitEntity() == Bukkit.getEntity(this.getBukkitEntity().getUniqueId())); // <<<<<<<<<<<<<<<<<<<<<< RETURNS FALSE
    }```
#

Hmm

amber palm
sage dragon
#

I have no idea... Bukkit.getEntity should work, I used it once too ๐Ÿค”

desert musk
#

notlikethis

#

so wack

sage dragon
amber palm
#

ma Main is in SRC and the name is Swasch

sage dragon
#

Can you show me, please?

amber palm
#

yea

desert musk
#

Trying: System.out.println(this.getBukkitEntity() == Bukkit.getServer().getEntity(this.getBukkitEntity().getUniqueId()));

amber palm
sage dragon
desert musk
#

this is gonna drive me mad

sage dragon
desert musk
amber palm
#

who shoud i put ma ymls

desert musk
#

Map as in?

sage dragon
# desert musk what's that mean

Well... A Map which contains the Entity and the UUID of said entity.

Then you wouldn't be depend on Bukkit.getEntity anymore

sage dragon
sage dragon
amber palm
#

and if not

desert musk
#

hmm

#

can you store a map like that in YAML?

sage dragon
desert musk
#

wut

sage dragon
desert musk
#

yeah

#

yeah yeah

sage dragon
#

Scrap it then, just save the Location of the entity.

You set it to not have any ai, so I won't be moving...

desert musk
#

oof

#

i mean yeah ig

#

it's just such a silly thing to not work

sage dragon
amber palm
#

can i make a Class with only Custom Config Generation and call the methods out of there in the Main?

#

so i can make the get in a Other Class the get Method

desert musk
#

trying: System.out.println(this.getBukkitEntity() == (Entity) ((CraftWorld) (Bukkit.getWorld("world"))).getHandle().getEntity(this.getBukkitEntity().getUniqueId())); lmao

desert musk
#

trying:

   public static Entity getNestEnt(UUID nestID) {
        for (World world : Bukkit.getWorlds()) {
            for (Chunk chunk : world.getLoadedChunks()) {
                for (Entity entity : chunk.getEntities()) {
                    if (entity.getUniqueId().equals(nestID))
                        return entity;
                }
            }
        }
        return null;
    }```

this crappy shit
wild nexus
#

Hello, i've got a problem, i made a GUI that show the craft of an specific item with the method getRecipesFor but i've got new item with new craft, Cobblestone Tier 1, Tier 2, Tier 3 and Tier 4 but when i use my code to show the craft of cobblestone tier 1 my gui show me the craft of cobblestone tier 4 because it is the last in my craft init method.

desert musk
#

so something stranger is happening

#

what in the world.

sacred mountain
#

player.sendMessage(String.format(e.getFormat(), e.getMessage()));
Asyncplayerchatevent

#

im not sure about string formatting i assume it needs a %s and a replacement string

#

the event provides a e.getFormat(), maybe that isnt the right hting to use?

static hollow
#

hey, i'm pasting schematic with location loc.clone().add(0, 5, 0) and i want to remove it later
As i see there is getMinimumPoint() and getMaximumPoint(), but I have no head for such mathematical things, can sb help?

desert musk
#

trying:

    public static Entity getNestEnt(UUID nestID) {
        for(World w: getServer().getWorlds()){
            for(Entity e: w.getEntities()){
                if(nestExists(e.getUniqueId())) {
                    return e;
                }
            }
        }
        return null;
    }```
last ledge
#

if(player.performCommand("pos1")){

#

this will detect if player performed pos1 command?

golden turret
#

does the chunk.getEntities iterates all entities of the world?

static hollow
#

This will perform this command

desert musk
desert musk
last ledge
desert musk
#

and still doesn't work

static hollow
desert musk
#

System.out.println(this.getBukkitEntity() == Bukkit.getEntity(this.getBukkitEntity().getUniqueId())); is always false

static hollow
last ledge
#

after that player gotta put /pos 1

static hollow
#

then you have to create a bool variable and set it to true after performing pos1

desert musk
#

because this is really really stupid

desert musk
#

that's not the problem

#

simply a quick debug

#

the problem is the Bukkit.getEntity() does not work.

glossy venture
#

what is getBukkitEntity() and what does it do

desert musk
#

it is supposed to return the entity with a given UUID

glossy venture
#

?

#

does it create an entity with a uuid

desert musk
#

no

glossy venture
#

i mean the this.getBukkitEntity()

desert musk
#

oh

#

that is an existing entity

glossy venture
#

is the entity loaded

desert musk
#

what does that mean?

#

how do i load an entity

glossy venture
#

is it in loaded chunks

desert musk
#

yeah

glossy venture
#

weird

desert musk
#

i create it in the same method

glossy venture
#

using the bukkit server createEntity?

#

oh wait

desert musk
#
public class EntityNest extends Villager {
    // entity contains unique data to be compared
    // entity name cannot be the same as another
    public EntityNest(Location loc, Player placer) {
        super(EntityType.VILLAGER,((CraftWorld) loc.getWorld()).getHandle());

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

        CraftLivingEntity ent = (CraftLivingEntity) this.getBukkitEntity();
        ent.setAI(false);
        ent.setSilent(false);
        ent.setCollidable(false);

        ent.getAttribute(Attribute.GENERIC_MAX_HEALTH).setBaseValue(1000);
        ent.getAttribute(Attribute.GENERIC_MOVEMENT_SPEED).setBaseValue(0);
        ent.getAttribute(Attribute.GENERIC_KNOCKBACK_RESISTANCE).setBaseValue(1000);

        ent.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, Integer.MAX_VALUE, 3, true));
        ent.addPotionEffect(new PotionEffect(PotionEffectType.GLOWING, Integer.MAX_VALUE, 1, true));
        ent.addPotionEffect(new PotionEffect(PotionEffectType.FIRE_RESISTANCE, Integer.MAX_VALUE, 1, true));

        this.setHealth(1000);   // FIX THIS to read from nest level

        //  write to data

        int unnamed = 0;
        while(!NestYML.Nest(this.getBukkitEntity().getUniqueId(),"Unnamed Nest "+Integer.toString(unnamed), 1)) {
            unnamed++;
            System.out.println("Found unnamed nest with the same name, iterating");
        }

        this.setCustomName(new TextComponent(ChatColor.GOLD + "" + ChatColor.BOLD + "Unnamed Nest "+Integer.toString(unnamed)));
        this.setCustomNameVisible(true);

        addMember(this.getBukkitEntity().getUniqueId(), placer, "leader");
        setNestSpawn(this.getBukkitEntity().getUniqueId(), placer.getUniqueId(), this.getBukkitEntity().getLocation());
        System.out.println(this.getBukkitEntity() == Bukkit.getEntity(this.getBukkitEntity().getUniqueId())); // <<<<<<<<<<<<<<<<<<<<<<<<<< ALWAYS prints false
    }
}```
grim ice
#

uh

#

show me NestYML

desert musk
#

ok

#

?paste

undone axleBOT
glossy venture
#

how do you create the entity?

desert musk
glossy venture
#

is it registered to the server

desert musk
desert musk