#help-development

1 messages ยท Page 1418 of 1

crude charm
#

changing the biome

quaint mantle
#

how, snow is client side

#

yeah I would need to change the biome for each chunk loaded

#

I think it would be best doing it via packets no?

crude charm
#

I wouldn't but its up to you

quaint mantle
#

so you would just change each chunks biome type?

crude charm
#

no

#

I would check for x weather type and allow it

#

set x type

#

ect

quaint mantle
#

what do you mean by set x weather type?

crude charm
#

set it to raining

#

or storming

quaint mantle
#

if its rain or snow is determined by the client

#

not by the server

crude charm
#

you'd have to change the biome then

#

or just use fake snow

quaint mantle
#

well that is what I am saying

crude charm
#

ye for snow but dont do it for rain and stuff

quaint mantle
#

well it has to be global weather so I would have to do that for rain too in deserts and snowy biomes

crude charm
#

oh

#

ok

drowsy helm
#

you're not moving

#

the entity you are riding is

#

oh right there is head movement

#

is it all the same listener or different for each stand

#

thats strange

#

looks like a bug

sleek dragon
#

how could I string together some TranslatableComponent() and output it to the player's Actionbar?

#

String hud = new TranslatableComponent("space.100") + Stamina.getStamina(player) + new TranslatableComponent("space.-80") + Mana.getMana(player) + new TranslatableComponent("space.80");

#

something like this

#

player.spigot().sendMessage(ChatMessageType.ACTION_BAR, hud)

#

i dont believe this would work

sullen marlin
#

ComponentBuilder

sleek dragon
#

I'd need ComponentBuilder right

#

lol

#

u beat me to it

#

I think I just have to read up on ComponentBuilder docs or something

#

cuz it kinda confuses me on how I'd string it together and append it in the way I want

sullen marlin
#

?

#

you just replace + with .append

sleek dragon
#

i might just be overcomplicating it

sullen marlin
#

I have no idea

quaint mantle
#

hey guys so I found this class that I need to modify the weather like I want

#

but I am pretty sure the mappings are for 1.16, what would be the 1.15 ones?

young knoll
#

Huh I was going to do something like that, good to see it's still possible

paper viper
#

look at the comments in the class

#

try and see if the variables in the 1.15 class exists

#

if not, try to find whatever the variable was originally called

#

if it doesn't exist or just completely different, you may have to just rewrite it

young knoll
#

1.15 didn't have the data driven biomes

#

So there are likely a lot of changes

paper viper
#

In that case, yeah then it's likely there will be a lot of changes

young knoll
#

I did it back in like 1.10? by just changing the biome array in the map chunk packet

maiden thicket
#

without bungee in general or without bungee's api?

dense goblet
#

is there an event that fires whenever the crafting grid is updated, even if it doesnt form a valid item?

sullen marlin
#

PrepareItemCraftEvent

dense goblet
#

oh that fires even if its just random items in the grid?

sullen marlin
#

I think so

dense goblet
#

you're right ๐Ÿ˜„

cinder thistle
#

bye

sullen marlin
#

you can use plugin channels

quaint mantle
#

how do you use sounds?

#

or

#
p.playSound(p.getLocation(), Sound.ENDERDRAGON_WINGS, );
```what doI put as the third value
sullen marlin
#

what do the javadocs say

quaint mantle
#

thx

#

ah

#

i see ty

wise cape
#

Trying to get the vanilla ender dragon boss bar, however I'm having trouble finding where I can grab the object from. I don't see in the docs where there's an event to grab it from, nor do I see it on the World object, just a bit confused with how to interact with an existing one.

sage swift
#

Boss#getBossBar

wise cape
#

So to get the ender dragon object I only see one event and its EnderDragonChangePhaseEvent, however according to the docs it only fires when it switches phases. I dont think I can rely on this.

sage swift
#

i mean, World has getEnderDragonBattle...

wise cape
# sage swift i mean, World has `getEnderDragonBattle`...

So I noticed you could remove it from both the EnderDragonBattle object and the EnderDragon object so I tried both.


        if (event.getPlayer().getWorld().getEnderDragonBattle() != null) {
            System.out.println("Player Now in The End");
            event.getPlayer().getWorld().getEnderDragonBattle().getBossBar().removeAll();
            event.getPlayer().getWorld().getEnderDragonBattle().getEnderDragon().getBossBar().removeAll();
        }```
#

However, the second returns a NPE, but the bar is still there lol.

sage swift
#

(is it even possible to remove the bossbar from bosses?)

wise cape
#

(I'd hope) :/

#

Mmmm... I think the issue may be that I'm tying this to the playerJoinEvent which fires before the world checks if the ender dragon is there

#
[05:35:37 INFO]: Player Joined
[05:35:37 INFO]: Player Now in The End
[05:35:37 INFO]: + Patrity Connected
[05:35:37 INFO]: Patrity[/xxx:38871] logged in with entity id 215 at ([world_the_end]4.529872263298235, 73.0, 20.523585212879755)
[05:35:38 INFO]: Scanning for legacy world dragon fight...
[05:35:38 INFO]: Found that the dragon has not yet been killed in this world.
#

๐Ÿ˜ซ

drowsy helm
#

since when could you declare arrays like int[] arr = {1,2,3,4};??????

#

wtf

#

am i dumb

wise cape
#

always o.o

candid galleon
#

since like forever

#

lol

drowsy helm
#

i always throught i had to declare a new array

#

like

candid galleon
#

ah

#

like new int[] {}

drowsy helm
#

int[] arr = new int[]{1,2,3,4};

wise cape
#

like a list lol

drowsy helm
#

like that

worldly ingot
#

To be fair, in some cases you do have to

#

For instance, as a method argument

quaint mantle
#

omg

#

im simping over your beard

#

how do i grow a beard like that

patent ice
#

You don't.

worldly ingot
#

What beard?

#

lol

quaint mantle
#

send husky pic

patent ice
#

send noodles

quaint mantle
#

choco has evolved to Chad

#

with a selfie as a pfp

quaint mantle
compact haven
#

when you have both the dog pfp and selfie pfp

torn oyster
#

read info there

prime leaf
#

Trying to understand Minecraft code ItemBow.java - what is the integer i that is passed in?
public void a(ItemStack itemstack, World world, EntityLiving entityliving, int i)

quaint mantle
#

what method is that

torn oyster
quaint mantle
#

You got a reply from md_5 himself on your post

torn oyster
#

wait rlly

#

oh yeah

#

but idk what other plugin

#

bungee

#

or spigot

#

wait probably bungee

#

but still

cold field
#

does anyone have any idea why when I send a playerinfopacket with inside an entity with a skin to a target player if the target is still joining it spawns the npc without rendering the skin?

quaint mantle
#

are you sending the packet to all players?

limpid veldt
#

Is there a way to break blocks as the player without using NMS? Looked at EcoEnchant's source to get an example of how it handles the different block breaking enchants such as blast mining or dynamite but it uses NMS stuff such as BlockPosition or weirdy nms/bukkit libraries such as org.bukkit.craftbukkit.v1_16_R2.entity.CraftPlayer.

Spigot alternatives?

inb4 the obvious block.setType(Material.AIR)

quaint mantle
visual tide
#

is there a way to let tabcompleter show only stuff that contains that what you already typed, like with vanilla commands

limpid veldt
quaint mantle
#

anyway you can spawn the block break particles at the block and increase it's stage every x ticks & eventually set the block to air

limpid veldt
#

thats a pretty good option ngl

quaint mantle
#

just determine the breaking speed by the hardness of the block

limpid veldt
#

is there a programmatic way to do this or will I have to make a large enum/config file listing these

quaint mantle
#

nah you don't have to do that

#

pretty sure Block#getBlockPower() is the hardness though I don't know for sure.

visual tide
limpid veldt
#

always assumed that was redstone power

quaint mantle
#

if the literal creator of spigotmc gives you a suggestion but you don't take that suggestion it's up to you my dude @torn oyster

torn oyster
#

i have answered their question

#

but it doesnt work

#

and im waiting for a response

chrome beacon
#

Is the listener registered

torn oyster
#

yes

#

ofc

quaint mantle
#

are you on 1.8

torn oyster
#

yes

quaint mantle
#

ur fucked

#

nothing that can help you

#

I use 1.8 too and can't cancel this event either.

#

Give me 0.2 seconds and I'll show you what I use

wispy fossil
#

funny question
any way of getting an entity, using #setVelocity or similar physics, through blocks?
no teleports?

quaint mantle
#

@torn oyster is your plugin a bungee plugin or just a spigot plugin

torn oyster
#

uhh the asyncpreplayerloginevent is spigot

#

cuz im making a minigame framework

quaint mantle
#

right

#

Well idk what to do then other then not using the Async event

torn oyster
#

wait what do u use then

quaint mantle
#

PlayerLoginEvent will work

torn oyster
#

u cant cancel that

quaint mantle
#

You can kick the player immediately upon joining

torn oyster
#

nono

#

the async event

quaint mantle
#

I actually put my login handling shit on a bungee plugin

torn oyster
#

doesnt let them join

#

but it says SUCCESS

#

when i /send

quaint mantle
#

oh right

torn oyster
#

but they dont connect

quaint mantle
#

right right right

#

so everything is fine except the message

torn oyster
#

yeah

#

but if it isnt FAIL

#

then it wont do the thing that i really need it to do

quaint mantle
#

send ur code

torn oyster
#
    @EventHandler
    public void prePlayerJoin(AsyncPlayerPreLoginEvent e) {
        String name = e.getName();
        UUID uuid = e.getUniqueId();
        
        if (Bukkit.getOnlinePlayers().size() >= MinigameManager.getMinigameManager().getCurrentMinigame().getMaxPlayers()) {
            e.disallow(AsyncPlayerPreLoginEvent.Result.KICK_OTHER, "full");
        }
    }```
#

idk what else to send

quaint mantle
#

assuming you're sending them back

#

hmm

#

so they are in fact kicked for 'full' right

torn oyster
#

yea

quaint mantle
#

but where is your command

torn oyster
#

/send is an in-built bungeecord command

quaint mantle
#

oh didn't know that

#

I always made my own /server command as a bungee pl

torn oyster
#

it sends them to a server

quiet ice
#

You could make use of Plugin Messages

quaint mantle
#

Bungee messaging / Redis

#

that's what I do

torn oyster
#

what

#

im trying to make the bungeecord /send command fail when i e.disallow

#

on spigot

quaint mantle
#

the send won't fail as bungee has succesfully connected them, the fact that you cancel their login doesnt mean the bungee failed

torn oyster
#

no it doesnt successfully connect them

#

at no point do they enter the server

quaint mantle
#

Connecting happens before login in

#

and you're using the login event

#

so yes they are properly connected

#

the way I did this is set a redis variable to the max amount of players & checking that on the other server to see if a player is allowed to join or not

torn oyster
#

i have a custom full thingy tho

#

cuz i want admins to be able to join and spectate

#

and i will also cancel the event if the minigame is running

quaint mantle
#
 try {
                    Jedis jedisResource = BlitzSG.getInstance().getJedisPool().getResource();
                    String canJoin = jedisResource.get("canJoin");
                    jedisResource.close();
                    if (Boolean.parseBoolean(canJoin) == false) {
                        p.sendMessage(ChatColor.RED + "No games available at the moment!");
                        return;
                    }
                    ByteArrayDataOutput out = ByteStreams.newDataOutput();
                    out.writeUTF("Connect");
                    out.writeUTF("hub");

                    p.sendPluginMessage(BlitzSG.getInstance(), "BungeeCord", out.toByteArray());
                } catch (Exception e) {
                    e.printStackTrace();
                    p.sendMessage(ChatColor.RED + "No games available at the moment! " + ChatColor.GRAY + "(e)");

                }``` This is what I had for this
torn oyster
#

how would i put that into my event

#

or wherever it goes

quaint mantle
#

this was for when you clicked a sign

torn oyster
#

is this in the hub

#

where is this located

quaint mantle
#

but you need redis which you probably don't have if you've never done anything with it

#

yeah it's in the hub

torn oyster
#

what is redis

quaint mantle
#

it's another server

#

Redis is an open source (BSD licensed), in-memory data structure store, used as a database, cache, and message broker. Redis provides data structures such as strings, hashes, lists, sets, sorted sets with range queries, bitmaps, hyperloglogs, geospatial indexes, and streams. Redis has built-in replication, Lua scripting, LRU eviction, transactions, and different levels of on-disk persistence, and provides high availability via Redis Sentinel and automatic partitioning with Redis Cluster.

ivory sleet
#

For short redis can be used as a message service

#

And as a cache

candid galleon
#

is there not a way to see how many food points a material will restore?

ivory sleet
#

Sadly not in the api I think

candid galleon
#

oof

#
    private static final Map<Material, Integer> points = new EnumMap<>(Material.class);

    static {
        points.put(Material.APPLE, 4);
        points.put(Material.BAKED_POTATO, 5);
        points.put(Material.BEETROOT, 1);
        points.put(Material.BEETROOT_SOUP, 8);
        points.put(Material.BREAD, 5);
        points.put(Material.CARROT, 3);
        points.put(Material.CHORUS_FRUIT, 4);
        points.put(Material.COOKED_CHICKEN, 6);
        points.put(Material.COOKED_COD, 5);
        points.put(Material.COOKED_MUTTON, 6);
        points.put(Material.COOKED_RABBIT, 5);
        points.put(Material.COOKED_SALMON, 6);
        points.put(Material.COOKIE, 2);
        points.put(Material.DRIED_KELP, 1);
        points.put(Material.ENCHANTED_GOLDEN_APPLE, 4);
        points.put(Material.GOLDEN_APPLE, 4);
        points.put(Material.GOLDEN_CARROT, 6);
        points.put(Material.HONEY_BOTTLE, 6);
        points.put(Material.MELON_SLICE, 2);
        points.put(Material.MUSHROOM_STEW, 6);
        points.put(Material.POISONOUS_POTATO, 2);
        points.put(Material.POTATO, 1);
        points.put(Material.PUFFERFISH, 1);
        points.put(Material.PUMPKIN_PIE, 8);
        points.put(Material.RABBIT_STEW, 10);
        points.put(Material.BEEF, 3);
        points.put(Material.CHICKEN, 2);
        points.put(Material.COD, 2);
        points.put(Material.MUTTON, 2);
        points.put(Material.PORKCHOP, 3);
        points.put(Material.RABBIT, 3);
        points.put(Material.SALMON, 2);
        points.put(Material.ROTTEN_FLESH, 4);
        points.put(Material.SPIDER_EYE, 2);
        points.put(Material.COOKED_BEEF, 8);
        points.put(Material.SUSPICIOUS_STEW, 6);
        points.put(Material.SWEET_BERRIES, 2);
        points.put(Material.TROPICAL_FISH, 1);
    }
#

well just finished writing that up ๐Ÿ‘Œ

wispy fossil
#

haha

#

good job

candid galleon
#

tyty

wispy fossil
#

๐Ÿ‘ ๐Ÿ‘ ๐Ÿ‘

candid galleon
#

good thing I don't care about saturation

wispy fossil
#

hoooo boy

shadow sonnet
#

now can i set die max durability

warm apex
#

any help?

candid galleon
#

?ask

queen dragonBOT
#

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.

rapid vigil
#

Hey, Is there a way to clear the player's inventory but only keep one specifc thing?

candid galleon
#

clear the inventory and then add the one specific thing

rapid vigil
#

Alright thanks

kind coral
#

can i actually do this?

#

people told me it would break my code

#

so i would like to know

quaint mantle
#

which database is the most efficient to use?

candid galleon
#

@kind coral what's configManager?

#

and Hasler it depends on the data and how much of it usually

kind coral
candid galleon
#

assuming you coded it properly it shouldn't break it afaik

kind coral
#

its not my lib, its made by another developer its very useful and it makes me code stuff 10x faster lul

candid galleon
#

should be fine then

kind coral
#

pog works fine

#

how would i get the age of a crop, i've been trying with BlockData but nothing 1.16.5

empty oyster
#
    @SuppressWarnings("unchecked")
    public static void giveWinnerInventory(Player p) throws IOException {
        YamlConfiguration c = YamlConfiguration.loadConfiguration(new File(path, p.getName()+"winnerInventory.yml"));
        ItemStack[] content = ((ArrayList<ItemStack>) c.get("inventory.armor")).toArray(new ItemStack[0]);

        if (p.getInventory().firstEmpty() == -1) {
            for (ItemStack i : content) {
                p.getWorld().dropItemNaturally(p.getLocation(), new ItemStack(i));
            }
        } else {
            p.getInventory().addItem(content);
        }
        
        content = ((ArrayList<ItemStack>) c.get("inventory.content")).toArray(new ItemStack[0]);
        
        if (p.getInventory().firstEmpty() == -1) {
            for (ItemStack i : content) {
                p.getWorld().dropItemNaturally(p.getLocation(), new ItemStack(i));
            }
        } else {
            p.getInventory().addItem(content);
        }
         Bukkit.broadcastMessage("LOADED INVENTORY");
    }

and then i use the method, i get an error bc of the:
ItemStack[] content = ((ArrayList<ItemStack>) c.get("inventory.armor")).toArray(new ItemStack[0]);
And i dont know what to do now..

AnyBody can help?

candid galleon
#

@kind coral Ageable

#

what exactly have you tried?

timid rose
#

can anyone help me set a world border

kind coral
candid galleon
#

@empty oyster you should be able to just do (ItemStack[]) c.get("inventory.content")

#

@kind coral could I see your code?

#

Ageable ageable = (Ageable)e.getClickedBlock().getBlockData();

kind coral
candid galleon
#

@timid rose you can use World#getBorder and reference the WorldBorder javadocs

candid galleon
vast quest
#

How can I set a block at a location to water

empty oyster
#

@candid galleon not working :/

cold field
#

The npc spawn without skin

quaint mantle
#

can u send ur full code

candid galleon
#

@vast quest setType(Material.WATER)

cold field
#

only if I send the packet while the player is joining. If i just send a packet when the player is already joined it spawns the npc with the skin

vast quest
#

thanks

cold field
vast quest
#

I was wondering if it should be WATER_BUCKET or LEGACY_WATER

candid galleon
#

neither

vast quest
#

yeah

cold field
#

?paste

queen dragonBOT
cold field
#

@quaint mantle

empty oyster
#
  public static void giveWinnerInventory(Player p) throws IOException {
    }
        YamlConfiguration c = YamlConfiguration.loadConfiguration(new File(path, "winnerInventory.yml"));
        ItemStack[] content = (ItemStack[]) c.get("inventory.armor");
        p.getInventory().setArmorContents(content);

        content = (ItemStack[]) c.get("inventory.content");

        p.getInventory().setContents(content);
        Bukkit.broadcastMessage("loaded INVENTORY");

This is also not working ;/

: ItemStack[] content = (ItemStack[]) c.get("inventory.armor");

candid galleon
#

what do you mean by "not working"

quaint mantle
#

what game version

cold field
#

don't watch line 8

cold field
empty oyster
#

@candid galleon i got the same error for : ItemStack[] content = (ItemStack[]) c.get("inventory.armor");

candid galleon
#

what's the error?

empty oyster
#

at de.daniellainand.utils.SaveYML_LoadYML.giveWinnerInventory(SaveYML_LoadYML.java:24) ~[?:?]

candid galleon
#

huh okay

#

so cast it to arraylist then

#

and then on a separate line convert to array

empty oyster
#

ok i try it

craggy cosmosBOT
cold field
#

lol, bugged

#

Have you found something?

craggy cosmosBOT
empty oyster
#

#CrashTheBot xd

cold field
#

@quaint mantle ?

quaint mantle
#

hi

cold field
#

...

quaint mantle
#

idk dawg

#

i don't really mess with 1.12 or up

#

1.8 for that matter โ˜˜๏ธ

cold field
#

oh, ok.

#

thanks anyway

quaint mantle
#

I'd give the citizens plugin code a look

cold field
#

i've tried. But from what I saw they create a fake player properly registered as entity into the server

#

I think that it is not bugged bc the server take care of it.

quaint mantle
#

ahh

#

why not just do that then

cold field
#

I've already made the plugin. I would prefer not mess up

quaint mantle
#

what does the plugin do

cold field
#

register a player actions and make the npc do the same actions

quaint mantle
#

so a replay system basically

cold field
#

yes

quaint mantle
#

how functional is it right now

cold field
#

80%. There is the skin problem and I need to to make an another thing.

#

The skins load.

#

Sometimes they just don't load. Only the player is joining

rapid vigil
#

Hey, is there any single way to do it so If you quit while you're in a specifc arraylist you won't get removed?

quaint mantle
#

yes

cold field
#

I would try with uuid or OfflinePlayer

cold field
quaint mantle
#

idk i'm considering using a similair system but in 1.8

#

Saw an API on github for it but idk how useful that'll be

cold field
#

it depends on what you use it for

#

๐Ÿ˜„

quaint mantle
#

Just duels/FFA fight replays

#

save the last 2 minutes of gameplay before the anticheat bans a player so you can later verify etc

cold field
#

I think that would be a good feature

#

If there is an api that does it for you

#

just make a setting to enable and disable that function

quaint mantle
#

I think it replays everything on the server, not just your specific players

quaint mantle
cold field
#

I need that for a school project XD

quaint mantle
#

looks easy enough

#

need what

#

btw I was wrong it is for specific players

craggy cosmosBOT
vast quest
#

dyno bad

cold field
#

lol

#

I think that it may be a datawatcher problem

vast quest
#

prob

#

but it shouldnt take this long

#

unless the database is at mars

#

:d

tribal holly
#

Hi, i'm using ExacteChoice to creatin custom recipe with custom items inside it but it don't reconize it :

#

in my hold plugin it work fine but here not

#

if i use intellij auto correction it set me this but it work one time in two

#

some craft work and other not for any reason

#

and when i try to print result and ingredient it show me correctly but the craft ingame don't work

#

wanna kill my self

#

and this one work...

tribal holly
#

the declaration

#

the builder

woven coral
#

it doesn't send "test", anybody know why?

sleek pond
#

does the flie exist?

paper viper
#

^

#

also, 100 yml files

#

for location.

#

you know, json exists right?

sleek pond
#

or just yml

#

lol

young knoll
#

Yeah yaml has sections too

woven coral
paper viper
#

??

#

In that case it makes even more sense

#

to use json

#

instead of yaml cause of objects

woven coral
#

what? A file is a lot more simplier

woven coral
candid galleon
#

JSON is just text

woven coral
#

in my plugin folder no

sleek pond
#

well then thats why

woven coral
young knoll
#

Then you should invert the if

woven coral
paper viper
#

you know, this is why I prefer Path over File

#

lol

woven coral
paper viper
#

then.. create it

woven coral
#

if I specify "location1.yml", it works

woven coral
paper viper
#

configFile.createFile()

woven coral
#

thats what Im tyring to figure out...

woven coral
paper viper
#

yes

woven coral
#

no can do

sleek pond
#

lmao why

paper viper
#

also, consider trying out paths

woven coral
#

because I need to have a template

sleek pond
#

then you just inject your template

woven coral
# sleek pond then you just inject your template

that will require even more work, my original question is why it's not creating it unless if I specify "location1.yml", not "How can I do this in a different way", I have my own reasons for doing how I am, but since ya'll don't know what I'm trying to do, ya'll won't understand why

sleek pond
#

im guessing because those folders don't exist it doesn't work

#

iidk

candid galleon
#

you have to make the file

paper viper
#

just do mkdirs() then first

#

to create the directories

#

then create an empty file

#

using createFile()

woven coral
#

the directories do get created

#

the files dont

young knoll
#

You are checking file.exists

#

And then creating it

#

If the file doesnโ€™t exist, file.exists will be false

#

And it wonโ€™t be created

visual tide
#

is there a way to let tabcompleter show only stuff that contains that what you already typed, like with vanilla commands

young knoll
#

StringUtils.copyPartialMatches

chrome beacon
visual tide
#

thx

torn shuttle
#

On today's issue of long class name daily: EnderDragonEnderFireballBombardmentConfig

sleek pond
#

uhhhhh

#

I had something worse

torn shuttle
#

this isn't the worst one, it's just the third one I've written today lol

candid galleon
#

I think EnderFireballConfig would be more apt

sleek pond
#

oggleProximityChatCommandConfigurationManagerInformationPaths.java

torn shuttle
#

EliteMobDamagedByPlayerAntiExploitListener.java

sleek pond
#

lmao

#

my worst listener name was

torn shuttle
#

it's not the only entity whose name contains "ender"

#

hell it's not even the only fireball power for this specific multiphased boss fight

wraith rapids
#

use packages

torn shuttle
#

I am using packages

wraith rapids
#

use them better

candid galleon
#

send a ss of your hierarchy

sleek pond
#

ToggleProximityChatCommandListener.java

torn shuttle
#

lol I need more vertical space

candid galleon
#

probably make a package for each entity

#

powers.premade.enderdragon

#

powers.premade.ghast

torn shuttle
#

weeeeee

candid galleon
#

etc.

wraith rapids
#

what you need is more packages

#

split these into a subpackage named config, you can then drop the Config suffix on each of them

torn shuttle
#

first off that would just become insanely annoying to navigate in the project hierarchy and secondly it wouldn't really fix the reason why I am using this nomenclature which is just ease to access using intellij's double shift search feature

wraith rapids
#

split all of the enderdragon ones into a sub sub package of enderdragon and you can drop the enderdragon prefix for them

torn shuttle
#

intellij is really good at picking out verbose methods and class names

#

and there's not really a tangible downside to it

wraith rapids
#

these class names are needlessly verbose and you're practically using prefixes and suffixes like attack and config in place of where you should normally use package names

torn shuttle
#

if that makes it harder to navigate then what's the point

wraith rapids
#

leverage the fact that it is fine for multiple classes to have the same name if they are in different packages

sleek pond
#

^

#

also

#

verify

wraith rapids
#

it won't be harder to navigate; things will be categorized instead of being in one enermous fucking list in a single package

torn shuttle
#

I literally just said why I make them verbose instead of doing multiple packages

#

I never actually browse packages for any reason

#

unless I genuinely forget how I made a thing 3 years ago

wraith rapids
#

you having to use search to find your classes is a symptom of your project structure sucking ass

#

consider the possibility that someone else might work on the same project in the future

torn shuttle
#

no, double tapping shift and typing in a few letters to access a class is faster than any package hierarchy

wraith rapids
#

they won't know every class by name

#

they will be going by the project structure in finding things

torn shuttle
#

I literally do it on projects where I have 3 classes just because I don't have to take my hands off of my keyboard

wraith rapids
#

they will expect things to be logically placed and grouped together

#

as is the convention

torn shuttle
#

they are grouped together, I just don't have immense depth in packages

#

these are all configuration files and they are all functionally the same thing

wraith rapids
#

they aren't grouped together enough if you have a massive shitlist like that

torn shuttle
#

the powers are subdivided in packages

silk hamlet
#

Does anyone know how to add a "breakstage" to a block? Like if you're mining it

wraith rapids
#

you'll have to fuck with the protocol for that

silk hamlet
#

uh

#

Like a minimg stage

wraith rapids
#

define add

silk hamlet
#

basicly yeah

sleek pond
#

like change the block breacking texture to the next stage?

silk hamlet
#

Yes or setting one to the block

wraith rapids
#

i don't remember there being anything in the api for that, you'll need to jump through some protocol hoops

silk hamlet
#

4 example your shooting an arrow and it hits a block and then it will be in a breakstage

#

oof yikers

torn shuttle
weary fossil
#

my code returning the stacktrace of mysql:

[10:28:37 WARN]: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '='e508f17b-0fd6-390c-a930-e02dfcfa6356'' at line 1
#

but i dont find erro on the code

wraith rapids
#

i do yes

#

it's called using your eyes

weary fossil
#

?paste

queen dragonBOT
wraith rapids
#

unless you have a class with the same name in each of those 772 project packages, you can just look at the match list and open the right one

#

how do you think imports work?

torn shuttle
#

I would literally have 20 fireballs at this stage

wraith rapids
#

ever imported bukkit.Block?

torn shuttle
#

or more

wraith rapids
#

of course, but you wouldn't be calling them all just fireball

torn shuttle
#

I certainly haven't

weary fossil
#

the paste md5 is off?

dusk flicker
#

huh

wraith rapids
#

the issue is you have been calling them not just fireball too verbosely

dusk flicker
#

Paste is up fine

weary fossil
#

wtf

#

does work here

dusk flicker
#

use like hatebin then

weary fossil
#

yeah

dusk flicker
wraith rapids
#

hatebin best bin

torn shuttle
dusk flicker
#

yep

#

I agree NNY

wraith rapids
#

that sounds like someone refusing to follow convention because they're too used to doing the contrary

#

which is fine if you're working on it alone or if it's a convention in your team

weary fossil
wraith rapids
#

but it won't stop me from calling it dogshit when I see it

weary fossil
#

[10:28:37 WARN]: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '='e508f17b-0fd6-390c-a930-e02dfcfa6356'' at line 1
this stacktrace

torn shuttle
dusk flicker
#

that hatebin

#

literally just has 'a' in it

weary fossil
#

where?

#

ah

#

wtf

dusk flicker
candid galleon
#

can confirm

#

and is that Chrome? gross

wraith rapids
#

all you're proving is that it's not even a convention on your end, now it's just you being inconsistent with whether you use packages or not

weary fossil
#

one moment

#

i still saved

#

WTF

torn shuttle
#

config files are all functionally just config files

weary fossil
#

on paste md5

wraith rapids
#

your distinction of function is arbitrary

torn shuttle
weary fossil
#

i can send the code on pastebin?

wraith rapids
#

and it's dog shit

weary fossil
#

sorry for bin

torn shuttle
#

if you want to go and subdivide dozens of identical 6 lined classes into different packages to make it harder to browse in general that's on you

wraith rapids
#

if you have dozens of identical 6 lined classes you are probably doing something wrong to begin with

torn shuttle
#

a war crime, I know

wraith rapids
#

that doesn't require an identical class for each and every thing

#

ever heard of oop

#

imagine if we had to write a new class for every single thing we wanted

cold field
wraith rapids
#

bukkit ๐Ÿ˜Ž

torn shuttle
#

sure, let me know how you would minimize that

torn shuttle
wraith rapids
#

i would minimize it by leveraging on oop

torn shuttle
#

really now

wraith rapids
#

hard to say without seeing your project

weary fossil
#

i having the stacktrack

[10:28:37 WARN]: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '='e508f17b-0fd6-390c-a930-e02dfcfa6356'' at line 1
this stacktrace```
but i dont find the erro on my code
https://pastebin.com/Eiivbn1E
torn shuttle
dusk flicker
#

well you misspelt key on like 28

wraith rapids
#

but I would probably have each boss or whatever you have hold a config of generic type and only access specific paths through it, possibly using config path objects declared in the impl of that boss to manage which paths are used

severe wing
#

Can someone code a minecraft one-player-sleep(but 50% not one) plugin with a backdoor in it. It is a server with just friends and im doing it as a prank. please dm me if you can :)

torn shuttle
weary fossil
#

oh, its missplace

torn shuttle
#

bosses just have a list of which powers they want

wraith rapids
#

then just replace boss with power

weary fossil
#

stills the erro

#

same stacktrace

eternal oxide
dusk flicker
#

I don't do SQL so someone else would have to help you

severe wing
#

oh sorry

weary fossil
torn shuttle
#

anyway I have to get back to working

wraith rapids
#

not having to declare and write a new class for literally every new thing

weary fossil
#

anyone makes SQL?

torn shuttle
cold field
#

does anyone know how mineskin works?

wraith rapids
#

i disagree

#

i've made my point, you either don't agree or refuse to listen, either way this is just going in circles

cold field
#

@wraith rapids I know that you know

#

๐Ÿ˜„

wraith rapids
#

i don't do skins

cold field
#

๐Ÿ˜ฆ

eternal oxide
# weary fossil anyone makes SQL?

This statement is wrong. Notice the ( before UUID ps = MySQLConnect.getConnection().prepareStatement("CREATE TABLE IF NOT EXIST " + MySQLConnect.table + "(UUID VARCHAR(100),NAME VARCHAR(100),POINTS INT(100),PRIMARY KEY (UUID)");

#

You have no corresponding close

weary fossil
#

im learning sql right now

#

its so bad to work lol

#

now, the table has created

#

but

#

same stack

eternal oxide
#

Needs a space before WHERE getConnection().prepareStatement("SELECT * FROM " + MySQLConnect.table + "WHERE UUID=?");

#

Same here, needs a space before WHERE PreparedStatement statemant = MySQLConnect.getConnection().prepareStatement("SELECT * FROM " + MySQLConnect.table + "WHERE UUID=?");

weary fossil
#

hmmm sure

#

format error

#

yeah, its works

#

thx my g

dense goblet
#

how well supported is the blast furnace?

#

can you add recipes to it the same way as with a normal furnace

#

and can you intercept smelting output

limpid veldt
#

if you want to directly view, edit, create, modify etc a SQLite database highly recommend DB Browser SQLite
For a remote SQL database navicat is really good but I think its premium

limpid veldt
wraith rapids
#

iirc I last used heidisql for navigating remote sql databases

#

it worked "fine"

#

and I don't remember pirating it so it's probably freeware

limpid veldt
#

navicat was premium but GTXHosting had a perpetual license key for all users regardless if you keep them as a host or drop them

wraith rapids
#

lol

limpid veldt
#

that is a long ass username

minor garnet
#
    @EventHandler
    public void ChunkLoadEvent(final ChunkLoadEvent event) {
        if (event.getChunk().isLoaded())
    }```

does this condition arrive if a chunk is new, or has never been generated, or does it mean that there is already someone on that chunk?
eternal oxide
#

There is a populate event that fires for new chunks too

minor garnet
#

but in the case even if a player is present in this chunk?

wraith rapids
#

iirc the chunk load event also has a method for checking whether it's loaded for the first time

minor garnet
#

i don't know in the library im using there is this method later i see docs

wraith rapids
#

what

pearl wolf
#

what is the name of Enchantment table material ?

unreal quartz
#

ENCHANTING_TABLE

pearl wolf
#

Thank you

quaint mantle
#

Hello, should i put @\EventHandler on each event function, or one is enough?

#

sorry for the ping.

ivory sleet
#

Yes each

wraith rapids
#

the annotation annotates a method as an event handler

#

only methods that are annotated as such are called by the bukkit event system

quaint mantle
#

Yep got it

sleek dragon
#

is there a way to get the player's current breath level? (the bubbles on the HUD when theyre underwater)

#

all my searching so far shows its clientsided, but in vanilla you can get a breathlevel scoreboard so it should be somehow possible, right?

sleek dragon
#

thank you

lusty cipher
#

@wraith rapids btw from yesterday, the skulls have started to behave 100% normally today again lol

quaint mantle
#

How can I modify the tab player list?

pearl wolf
#

anyone here are using XSeries ?

minor garnet
#
    @EventHandler
    public void ChunkLoadEvent(final ChunkLoadEvent event) {
        final Chunk chunk = event.getChunk();
        for(Entity entity : chunk.getEntities()) {
            if(!(entity instanceof ArmorStand)) return;
            final ArmorStand armor = (ArmorStand) entity;
            final String name = armor.getCustomName();
            Bukkit.broadcastMessage(name);
//            if(name == null || (!name.startsWith("loot"))) return;
//            final String[] str = name.split(":");
//            LootManager.getLootByName(str[1]).ifPresent
//            (e -> LootManager.spawnLoot(e.getLocation(), e.getItem(), e.getName()));
//            Bukkit.broadcastMessage("ยงaThe armor deleted");
        }
    }```
i never used this event and ''broadcastmessage'' is dont calling
wraith rapids
#

don't return

#

continue

#

return exits the method

minor garnet
wraith rapids
#

i reiterate; return exits the method

#

if you hit any entity that isn't an armorstand, the entire execution terminates

minor garnet
#

what is reitairate?

wraith rapids
#

repeat

minor garnet
#

ah now i understand

#

if i use break ?

wraith rapids
#

then your for loop exits entirely

eternal oxide
#

why? you were just told to use continue

wraith rapids
#

use continue

minor garnet
#

hm

wraith rapids
#

continue skips one iteration of the loop

#

break skips the entire loop

#

return skips the entire method

minor garnet
#

ok thanks

#

does not continue to work ..

    @EventHandler
    public void ChunkLoadEvent(final ChunkLoadEvent event) {
        final Chunk chunk = event.getChunk();
        for(Entity entity : chunk.getEntities()) {
            if (entity instanceof ArmorStand) {
                final ArmorStand armor = (ArmorStand) entity;
                final String name = armor.getCustomName();
                Bukkit.broadcastMessage(name);
            }
        }
    }```
wraith rapids
#

yes, that works as well

#

but generally continue is preferred

#

makes it more readable

minor garnet
#

yes ik

#

but dont send me the armor stand name

wraith rapids
#

how are you testing it

minor garnet
#

i'm going up and down

wraith rapids
#

that doesn't load the chunk

#

the chunk is already loaded

#

you need to go out of the server's view-distance

#

that will unload the chunk

#

once you return, the chunk will be loaded

#

it's not a Chunk Enter Event, it's a Chunk Load Event

minor garnet
#

aaah ok

#

now whatโ€™s making me scared is about how Iโ€™m going to save a set of identities in one location

eternal oxide
#

save entities?

wraith rapids
#

i would tell you to use the chunk pdc but you're a 1.8 plebian

hoary tiger
#

I know it's a bit of a stupid question but, I needed to make a class to extend a module but I don't know how I would activate that file/class from my main file? Sorry and Thankyou! ๐Ÿ˜„

mild agate
#

is it possible to access the plugin on the waterfalls to the plugin on the spigot?

dusk flicker
#

No.

eternal oxide
#

waterfall != spigot nor Bungee, but you are looking for Plugin messaging channels

dusk flicker
#

It would have to transfer data over PMCs or something like Redis

wraith rapids
#

waterfall is to bungee as paper is to spigot

#

the real winner's choice is velocity though

cinder thistle
#

Velocity is a great experience

wraith rapids
#

i pray that the chat related protocol is decently optimized and doesn't just hammer the components into json or something

#

because holy shit do some of these components get big

vast quest
#

is there anwyay I can cancel the farmland breaking by entitys?

#

Ik how to make it with player but on EntityInteractEvent there is not seem to be a getAction

vast quest
#

wouldnt getblock trigger air?

#

Wait

#

canceling that would just make the entity not move there

wraith rapids
#

kinda doubt that's how it works

vast quest
#

Idk it just makes sense that it would cancel the move there

wraith rapids
#

maybe from a player's perspective

#

but i don't see a reliable way of doing that in the code under the hood

#

the event is fired when the block is about to be changed, which means the entity is already on that block

#

and I wouldn't expect cancelling the event to teleport the entity backwards

vast quest
#

Idk imma try to cancel it ig

eternal oxide
#

it would not move the entity, it would stop the block change is all.

#

farmland is not destroyed by walking on it. Only by jumping

rugged topaz
#

i'm successfully grabbing soil blocks in a radius, but how would i check if there's a crop on top of them or not?

chrome beacon
#

Check the location above against the crop tag

rugged topaz
#

and after the comparison proceeds to be false

#

do i just set the block to wheat?

#

or

#

bc i wanna 'regen' crops

wraith rapids
#

well

#

not every crop is wheat

rugged topaz
#

i'm doing this specifically for wheat

#

already did the comparison

eternal oxide
#

cast to Ageable

rugged topaz
#

ye

#
if (!(loc.add(0, 1, 0).getBlock() instanceof Ageable)) {
// put wheat
}
eternal oxide
#

then you set the age

wraith rapids
#

the block is never ageable

#

the blockdata may be ageable

eternal oxide
#

^

wraith rapids
#

blocks themselves never implement anything

#

Block is just a dummy holder object for a Location

rugged topaz
#

and to check blockdata?

wraith rapids
#

instanceof

#

block.getBlockData() instanceof Whatever

rugged topaz
#

? so im still getting the block?

#

o

#

need a 1.8 alternative

#

getBlockData doesn't exist

wraith rapids
#

idk, try block.getData

#

get fucked though, 1.8 sucks

eternal oxide
#

good luck then

rugged topaz
#

that returns a byte

#

ye tbh

plain scroll
#

im trying to build my plugin

#

i click on the folder > proportys > but theres no jjava build thing

#

i have buildtool;s downloaded

eternal oxide
#

So many things wrong, You need to follow a tutorial

wraith rapids
#

proportys

compact haven
#

make sure to chnage' the proportys

eternal oxide
plain scroll
#

tnx

wraith rapids
#

i certainly hope the protocol doesn't send chat messages as json

#

look at this shit

eternal oxide
#

um

quaint mantle
#

ew

eternal oxide
#

I really hope thats not sent as is over the network

wraith rapids
#

same

eternal oxide
#

however, I'm 100% certain it is

wraith rapids
#

:despair:

eternal oxide
#

I recently had to make a change to GroupManager as it was blowing up the bungee chat buffer if it listed too many permissions at once.

#

buffer was supposed ot be able to take 15k characters or something like that

#

I had to limit my send to 2k characters or once sent it exceeded that 15k

wraith rapids
#

yeah I'm working on like a public exchange box plugin and the index listings are probably going to get pretty huge component wise

#

each of the item names is actually a hover component that'll hold all of the item data

#

it's going to fucking explode with shulker boxes I bet

eternal oxide
#

yep

wraith rapids
#

i'm sending it all as a single component because otherwise it shifts around a little on the client before being fully rendered

eternal oxide
#

In my day we had to optimise every single bit that went over the network as it all cost money. These days, its all libraries and don;t give a shit mentality..

wraith rapids
#

same with all other development tbh

#

prime example is that every desktop application is based on electron these days

#

same in web development, and everywhere else

#

nobody gives a shit if it doesn't work properly or is super inefficient as long as you can churn out as much results as possible in x time

eternal oxide
#

yep

#

The trouble is, these days no one is taught about network traffic and optimization

#

its all hidden and devs just send whatever they fancy

wraith rapids
#

who can afford to optimize anyway when in the end all of the extra effort you spend on making things good just comes out of your paycheck in the form of new paying projects you could've spent that time on instead

plain quest
#

how do i use spigot 1.8 with maven?

#

???

#

??

#

?

wraith rapids
#

giving up is a good option

plain quest
#

oh

#

did they drop support?

#

for 1.8

wraith rapids
#

yes, over 5 years ago

plain quest
#

what the hell

#

anyway

#

ok

#

but itโ€™s the most popular version whatโ€™s wrong with them ๐Ÿ˜ฉ

wraith rapids
#

it's not

chrome beacon
#

Lol not even close

wraith rapids
#

only like 8% of servers are 1.8

eternal oxide
#

8% are on 1.8

wispy fossil
#

Supporting a version from 5 years ago is hard ๐Ÿ˜ญ
its more fun to have all the new features for spigot to enjoy

plain quest
#

fine

wraith rapids
#

1.8 is ancient, buried, dead, and shit

#

get with the times and put your autoclicker on the shelf

wispy fossil
#

this should be biblically published

plain quest
#

ok one more thing, with maven dependency on 1.16 i realised that i canโ€™t use nms

#

is there an other dependency for that?

chrome beacon
#

Run BuildTools and switch spigot-api to spigot

wraith rapids
#

you can't use nms with any of the api maven dependencies

#

you need to add the project itself as a dependency

#

that is, replace the spigot-api dependency with spigot

plain quest
#

ok

wraith rapids
#

but that artifact is not distributed publicly so you'll have to build it locally with buildtools

plain quest
#

too much work when you can just include the jar as dependency but anyway

chrome beacon
#

Maven is neat

wraith rapids
#

including the jar as a dependency means you'll be losing out on all the benefits of a dependency manager

plain quest
#

which are?

wraith rapids
#

transitive dependencies, for example

#

if the thing you depend on depends on something else, you will have to manually hunt down that jar and inport it as well

#

just a day or two ago a guy came here for help because his ide-imported spigot jar didn't include the bungee chatcolors

#

you will also need to manually redownload and reimport new versions of all your dependencies every time they update

#

you also can't deploy anything automatically or run any proper build scripts

#

you also lose out on stuff like filtered resources

#

it's very ghetto

#

but yes, it's very easy

#

it just comes at a cost

plain quest
#

sure

coral sparrow
#

Is it possible to play noteblocks for everyone using bukkit 1.8.8 lol

#

spigot 1.8.8

opal juniper
coral sparrow
opal juniper
#

If you want to do it for everyone, you would have to loop thru every online player

coral sparrow
opal juniper
#

and then there is the Player#playSound()

coral sparrow
#

the one who plays it?

#

is it therre is playsound lol

narrow berry
#

hello, is it possible to set players' spawn when typing / lobby, I have a bungeecord server.

#

plugin: Lobbysystem - bungeecord.

opal sluice
#

Does the spectator mode trigger the MoveEvent ?

eternal oxide
#

yes

opal sluice
#

Ok nice thanks ^^

hidden delta
#

๐Ÿ‘€๐Ÿ‘€

magic dome
#

hey guys im trying to add custom ore generation on top of the default world using blockpopulators. How can i get the default worldgenerator?

#

so that i can add it on tom?

vernal basalt
#

how can i go from this to like

#

aqua affinity 1
blast protection 3

#

and just a list enchant

chrome beacon
#

Use translatable text components

vernal basalt
#

what

chrome beacon
vital ridge
#

yo does someone know a good way to completely leave pitch and yaw untouched when tping a player

#

I tried getting pitch and yaw from old loc

#

and then tping him and setting the pitch and yaw

#

but with constant teleporting it still looks jittery

#

i teleport the player everytime he clicks a certain thing

wraith rapids
#

the issue isn't that the pitch or yaw changes

#

the issue is that you copy the pitch and yaw at the time when your code runs

#

and then teleport the player

#

however, before the server can inform the player that the player has been teleported

#

the player has already moved

#

because of latency

#

which makes it jittery

#

to make it smooth, you will have to do it in a way that sends a player a relational move packet, like /minecraft:tp does

vital ridge
#

so with packets_

wraith rapids
#

where instead of telling the player to move to absolute location X and point at absolute pitch and yaw Y and Z, the server tells the player to change their location by a relative dX and a relative pitch and yaw of dY and dZ

#

you could look into the under-the-hood of the minecraft:tp command and see what logic that invokes

#

the bukkit teleport methods are absolute

vital ridge
#

ive tested

#

the command

#

you mean

#

the code?

wraith rapids
#

well, does the command still look jittery to you

vital ridge
#

no it doesnt

#

thats exactly what i need

wraith rapids
#

yeah, you will have to call whatever code that command calls

vital ridge
#

Okay tho where ill find it?

#

In like a jar?

wraith rapids
#

build spigot sources locally

vital ridge
#

a decompiled jar

wraith rapids
#

and then look at the sources

vital ridge
#

cant i just use jdgui?

wraith rapids
#

or decompile the jar, but that will probably give you cancer

vital ridge
#

and decompile spigot

vital ridge
wraith rapids
#

with build tools

#

there's some parameter you pass to it and it shits out the sources

vital ridge
#

currently looking into the spigot jar

#

Okay i dont know exavtly where is it located

#

but ill search a bit

wraith rapids
#

CommandTeleport in net.minecraft.server

vital ridge
#

I can see that this sht is absolutely crazy lmao

#

understandable but

#

Damn thats some crazy stuff

wraith rapids
#

most people who need to work with nms view the properly mapped sources, that have the proper names and shit for everything

vital ridge
#

Well they for sure are skilled asf lol

#

but yea

wraith rapids
#

the md69 mappings used in splรถgget are incomplete and inconsistent and kinda trash

#

everything starts making much more sense once shit actually has proper names

vital ridge
#

yeah thats true tbh

#

the block physics are defined by number 2 and 4

#

if im right

#

but yea i see that there he sets the headrotation

#

with some kind of variable

wraith rapids
#

on the server side yes

#

what's important is what goes out to the player

#

because player movement is client-side

#

the client doesn't give a shit about what the server has set its head rotation to

vital ridge
#

i rly dont see what he exactly does here

#

too much variables

#

and some stuff ive never used personally

#

It gets

#

the navigation

#

and plays with the head rotation

wraith rapids
#

((EntityPlayer) entity).playerConnection.a(d0, d1, d2, f, f1, set, org.bukkit.event.player.PlayerTeleportEvent.TeleportCause.COMMAND); // CraftBukkit
probably this

vital ridge
#

well the variables

#

are problaly

#

I bet this wont rly help me

#

I saw this line

#

but tried to like dig more in

wraith rapids
#

you'll probably want to ask someone who fucks more with nms

#

one of the core developers of paper will probably know more of what's going on

vital ridge
#

oh wait

#

nah i doubt none of them has time

#

to solve my tp issue

#

or help me

wraith rapids
#

they do help people frequently on their discord

#

unlike here

#

where the only people who answer any fucking questions are the regulars

vital ridge
#

maybe i should extend the

#

nms class

#

and try smthing with that

#

The CommandTeleport

quaint mantle
#

hey guys is there a way of setting the wool's color ?

#

except using

#

ItemStack item = new ItemStack(Material.WOOL, 1, (byte)5);

#

like setting the color later

wraith rapids
#

use a version that isn't 5 years old

quaint mantle
#

nobody knows?

wraith rapids
#

.setData or whatever you ancient fucks called it

#

i don't remember, it's been half a decade

quaint mantle
#

damn what the fuck

#

chill

wraith rapids
#

never

sand vector
#
1.    private FileConfiguration configuration;
2.    public void save(Plugin plugin, String name) {
3.        try {
4.            file = new File(plugin.getDataFolder(), name);
5.            configuration.save(file);
6.        } catch (IOException e) {
7.            e.printStackTrace();
8.        }
9.    }

I use this function to save my custom YAML files. When calling the function I get a NullPointerExeption error on line 5. Any ideas?

wraith rapids
#

NPE means that you are calling a method on some variable or field that does not have a value

#

that is, the variable's value is null

#

it does not point at an object, it is a null-pointer

quaint mantle
#

^

chrome beacon
#

In your case configuration is null

wraith rapids
#

you have declared a field named configuration, but you have never assigned any object to it

#

the field is empty

#

you need to create or obtain an instance of FileConfiguration somehow, and then put that instance into the field

slate pendant
#

Hello, do you know how to prevent a server from loading any worlds on start?

sand vector
#

So do i need to doconfiguration = YamlConfiguration.loadConfiguration(file);

wraith rapids
#

either that, or doing the same in the constructor of this class

sand vector
#

ok, thanks

wraith rapids
#

you probably want to load the configuration from the file when this object is constructed

#

then remember the file and the name, and when the save and load methods are called, load/save from the correct file

slate pendant
chrome beacon
#

Why do you want that

vital ridge
#

this code is usable

chrome beacon
#

And no I there's no good way to do it

vital ridge
#

but

wraith rapids
#

iirc it's pretty difficult to get the server not to load worlds on startup

slate pendant
#

to start one of many servers fast

vital ridge
#

my teleportcause is the plugin

#

and ill need to use it under tp event

#

right?

#

since thats using .getto variables

#

.getto methods*

wraith rapids
#

dunno

vital ridge
#

well idk ill try

wraith rapids
#

you spooked them by looking like a noob

#

they don't want to handhold people

vital ridge
#

not looking like

#

i still am lol

wraith rapids
#

well yeah but looking like things is the important part

vital ridge
#

well im slowly improving

#

But slowly ๐Ÿ˜„

wraith rapids
#

if it looks like a duck and behaves like a duck, it's probably a duck

slate pendant
#

Many people here sometimes recommend editing the server jar. Does that mean I need to open the server code, make the changes and sometimes merge this version with official updates?

eternal oxide
#

I've never seen anyone recommend editing the server jar

slate pendant
#

but sometimes its is necessary

wraith rapids
#

very rarely

slate pendant
#

at least when I ask some questions here I often get such answer

eternal oxide
#

If you wish for something to be added to the API you can make a pull request.

wraith rapids
#

you're probably asking for something that is borderline impossible, or misunderstanding the answer

slate pendant
#

In addition, I wanted to ask, how can I keep worlds' folders NOT in the same place with the server main files?

wraith rapids
#

uhh

#

i'm not sure if that's possible anymore

#

there used to be a setting called world container, which was a path to a directory where your worlds were

slate pendant
#

like in a subfolder

wraith rapids
#

but i think that was nuked in 1.16.2 somehow

eternal oxide
#

symlink

wraith rapids
#

i'm sure it stopped working and blew up, but i'm not sure if it was ever fixed

slate pendant
#

and also, I got the problem of right click on air without an item in hand not registering by PlayerInteractEvent and etc. Is that normal?

eternal oxide
#

read the javadoc it tells you all about the event.

#

?jd

wraith rapids
#

iirc it fires, but is cancelled by default

#

or if it doesn't fire at all, it's just because it's not possible to detect clicks on air with an empty hand

#

because the client doesn't send any interact packets

eternal oxide
#

This event will fire as cancelled if the vanilla behavior is to do nothing (e.g interacting with air). For the purpose of avoiding doubt, this means that the event will only be in the cancelled state if it is fired as a result of some prediction made by the server where no subsequent code will run, rather than when the subsequent interaction activity (e.g. placing a block in an illegal position (BlockCanBuildEvent) will fail.

slate pendant
#

yes, I mean this

#

and can I use packets to somehow make client think something in hand but not to show it

#

but I don't think it's possible

wraith rapids
#

no

eternal oxide
#

No need, just annotate to not ignore cancelled event

slate pendant
#

I didn't think of checking canceled ones

wraith rapids
#

event handlers by default do not ignore cancelled events

#

which imo is a major oversight

#

too many times have I ran into plugins doing dumb shit by listening to events that are cancelled and doing shit despite them being cancelled

slate pendant
#

and how can I send info about adding item to someones inventory (hotbar) without anybody else getting this packet?

wraith rapids
#

imo if something is cancelled it should be treated as if it didn't happen

quiet ice
#

Ah you meant that

wraith rapids
#

by the plugins and the server alike

quiet ice
#

ignore my comment

quiet ice
gusty bough
#

Teams collisions-rule do not work, any idea?

slate pendant
#

I tried learning random packets, but finished only with NullPointerException on the client side))

eternal oxide
gusty bough
#

Mhhh I tested with a spigot server without plugins (I first though it was plugin's fault) and team do not change collisions between players

eternal oxide
#

how are you setting collision on teh team?

slate pendant
#

How can I store some data in an item to identify it later? By NBT tags?

gusty bough
#

I did it ingame via /team add name, /team join both players and /team modify team_name collisionRule never

#

And on a plugin