#help-development

1 messages · Page 900 of 1

eternal night
#

horrible people would say, add a --gui flag or something

bleak eagle
#

unacceptable

tender shard
#

I wanted BT to always try to open the GUI unless any arg is given

eternal night
#

that sounds pretty not smart

tender shard
#

Why not?

eternal night
#

no args builds latest ?

river oracle
eternal night
#

you'd be breaking behaviour

river oracle
tender shard
eternal night
eternal night
bleak eagle
#

it's also one of the reasons why so much crud and legacy code builds up everywhere

river oracle
#

fr if you wanna break shit and deperecate random stuff please see yourself to the paper discord

eternal night
#

exactly

#

but like, given this shit might be run in CI, breaking behaviour like that is just

#

why

tender shard
#

Who has a graphics environment on their ci

eternal night
#

the current way is fine

bleak eagle
#

simple, no gui by default, unless ran with --gui (and perhaps a .bat that just runs the jar with --gui for less technically inclined users just trying to compile it)

#

not the other way around which is being done currently

eternal night
#

I mean, I run this locally prior to some of my automated tests

#

its not a full CI

#

but it would still explode

#

for 0 gain

#

like, literally 0

#

if people can type java -jar BuildTools.jar into their shell in the right directory, what is the point in opening a gui

tender shard
#

One advantage would be that itd work for @bleak eagle

bleak eagle
#

so true

eternal night
#

They would be prefectly fine with a --gui flag

bleak eagle
#

i could make a pr

eternal night
#

probably a nice idea

bleak eagle
#

it just avoids all of these .desktop launcher shenanigans

tender shard
bleak eagle
#

start a fork called NeoBuildTools and add it there

#

then encourage everyone to switch to it

eternal night
neat bone
#

Can someone help me with a oneblock?

tender shard
#

?ask

undone axleBOT
#

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

bleak eagle
#

yeah just write out the question in full so people can see it

bleak eagle
#

no point in asking to ask

neat bone
#

I need help to be able to create a oneblock on a server with its respective plugins and such please

eternal night
#

Are you asking for someone to setup a server network with you 😅

#

that smells more like a question for the forum

bleak eagle
#

find some oneblock plugin and chuck it in plugins/

#

then follow the respective docs for that plugin on how to set it up fully?

neat bone
#

I have the AOneBlock

tender shard
neat bone
#

and I can't configure it

bleak eagle
#

yeah this channel is more about the development of spigot itself

#

like the server software

eternal night
#

well or plugin development

neat bone
#

oh

bleak eagle
#

if you need help with configuring plugins ask there either way

neat bone
#

sorry

#

y very sorry

bleak eagle
#

i will help you though

#

just not to flood this chat

rare rover
#

erm, what's another way to access a pickaxe's data every block? Currently accessing its PDC everytime which i heard isn't recommended

#

although idk what else to do

#

memory? Not sure how to fully set that up doe

#

this is being executed every block:

fun executeAllEnchants(
        player: Player,
        playerData: PlayerData,
        blockLocation: Location,
        random: Random
    ): EnchantResult {
        val itemMeta = player.inventory.itemInMainHand.itemMeta
        val dataContainer: PersistentDataContainer = itemMeta.persistentDataContainer

        val connection = player.getConnection()
        val enchantResult = EnchantResult()
        pickaxeEnchants.forEach { enchant ->
            val enchantmentLevel: Int = enchant.getEnchantmentLevel(dataContainer)
            if (enchantmentLevel > 0) {
                val result: EnchantResult =
                    enchant.execute(
                        player,
                        playerData,
                        connection,
                        dataContainer,
                        enchantmentLevel,
                        blockLocation,
                        random
                    )

                enchantResult += result
            }
        }

        return enchantResult
    }```
zinc moat
#

how do i register a command in the main class

#

i got a command in the main class and i want to register that

uneven iris
#

Hey guys, I'm new to plugin development, but I have a specific function I need for the minecraft server I run:

  • Each player is on one of 5 of the vanilla /team teams. [extralife, firstlife, secondlife, thirdlife, spectator]
  • I need for every team except thirdlife to have keep inventory enabled
  • However, thirdlife needs to have keep inventory disabled in some way - they need to drop items on death.
  • I'm using this plugin for the life system similar to Grian's serieses - https://www.spigotmc.org/resources/last-life.91586/
    sorry if this is too specific or impossible, always used prebuilt plugins, but there are none for this purpose soo... this might also be possible with command blocks
#

There's also the placeholder %lastlife_life% which could mean keep inventory is off if set to 1 and on otehrwise per player

spiral kindle
#

so like getCommand("speed").setExecutor(this);
and then add a onComand methode. highly recomend to just make a second class thogh.

bleak eagle
#

you can use event listeners - i'll write up a quick example for you

uneven iris
#

yoo ty!! i really have no idea how plugins work in general so--

#

server is paper 1.20.2 if that's important

bleak eagle
#

nah it's been an api feature forever

#

you should be able to use it

spiral kindle
zinc moat
#

alr

worldly ingot
#

If you have a command in your plugin class, the plugin class is already the default executor

#

You don't need to re-set it to this

#

JavaPlugin is a CommandExecutor already, any commands you register from your plugin.yml will automatically call your JavaPlugin#onCommand() :p

spiral kindle
#

intresting...

quaint mantle
#

There is any guide to change player skins?

grim hound
#

Does anyone know where "can't deliver chat message check server logs" comes from?

zinc moat
#
    @EventHandler
    public void onWalk(PlayerMoveEvent event) {
        if (!ParticleTrail) {
            Player player = event.getPlayer();
            World world = player.getWorld();
            world.spawnParticle(org.bukkit.Particle.REDSTONE, event.getFrom(), 3,0,0.5,0);
        }
    }

This is giving me this error (the message.txt)

#

does anyone know why its erroring

spiral kindle
#

I think you need to convert it to a color

zinc moat
#

yh but how

spiral kindle
#

try Color.fromRGB(3, 0, 0.5), 0

zinc moat
#

0.5 is erroring

spiral kindle
#

oh yea seems to be a class so need to make an objekt

zinc moat
eternal oxide
#

pass it a new DustOptions

#

for data

spiral kindle
#

DustOptions dustOptions = new DustOptions(Color.fromRGB(255, 0, 0), 1); // Example: Red color, size 1
world.spawnParticle(Particle.REDSTONE, player.getLocation(), 100, dustOptions);

zinc moat
#

alr thanks give me a minute

spiral kindle
#

and i dont thing doubles work

zinc moat
spiral kindle
#

yea you need to do 100 , dust options

zinc moat
#

alr

#

nothing erroring

#

ima compile upload and reload 1 sec

#

weird

#

it works

#

no errors

#

but it doesnt show at the player

spiral kindle
#

the 100 is the number of particels

zinc moat
#

yeash i know

#

but like

#

the particles dont show

#

nvm

#

it works

spiral kindle
#

nice

fluid river
#

Minecraft server runs on UDP, right?

eternal oxide
#

tcp

fluid river
#

tcp only?

spiral kindle
eternal oxide
#

yes

fluid river
#

k, both lan and dedicated run on TCP?

eternal oxide
#

yes

#

it's the same

fluid river
#

The only difference is Minecraft uses network Discovery for lan

#

And direct messaging with online

#

Am i right?

eternal oxide
#

for lan teh client runs up an instance of teh server, same as dedicated

fluid river
#

For each server added to server list, client sends a status packet

#

and if server replies in certain amount of time, displays amount of players and ping. If not - red cross.

zinc moat
#

is there a way to get command arguments and use them outside of the command?

fluid river
#

args

#

in onCommand

zinc moat
#

i know

fluid river
#

Or you mean commandmap stuff

zinc moat
#

nvm

spiral kindle
eternal oxide
#

correct

fluid river
#

But also when client opens multiplayer tab, he sends a check packet to his network every several seconds

plush gulch
#

How do I get the direction a player is moving in? Like north, west, south or east

fluid river
#

And so he sees servers of his network users

spiral kindle
#

I mean the status also works with lan worlds

fluid river
#

Yeah but you don't add lan servers to serverlist

#

They are displayed anyways

#

Even if you haven't entered ip and port in add server tab

spiral kindle
#

I mean if you are in the same network sure. but if you are not it works jsut as well

fluid river
#

So well, the only difference is just endpoint

#

For lan its broadcast

#

And for dedicated servers its server ip

spiral kindle
#

for lan it is both

fluid river
#

I don't rly get the point of directly checking ip of a lan server

#

If you can just ask lan to provide every server which is running

spiral kindle
#

if you want to connect to someones lan world and you are not in the lan obviosly

#

It works exactly same as a normal server

#

So if player A in Netowrk A wants to connect over the internet to lanworld of Player B in netowrk B you see it same as a normal server if you add it

fluid river
#

Yeah but you just can't access another lans

spiral kindle
#

you cant acess anouther lan but anouther lan server

#

The "lan server" is just a normal server protocall wise with the only addition being the broadcasting in local netowrk

#

you can just as well connect to it from outside if you do the port forwarding

fluid river
#

Im talking about no portforwarding situation

zinc moat
#

asdenjer

#

are you busy

spiral kindle
fluid river
#

open world for multiplayer

#

Start hamachi

#

voila

#

I guess

spiral kindle
#

vpns dont count. neither do mods

spiral kindle
fluid river
#

Dont they act as fake lan

zinc moat
spiral kindle
#

caus we where talking about the netowrking protocoll not how to play Minecraft

fluid river
#

I mean i'm currently testing my game using vpn

#

With a friend's pc

zinc moat
#

so this is the code and basically it works fine but when other people are on the server they also get the particle's but when i enable/disable it it also does it for the other people who have access to the particle trail how do i make it so like it only does it for 1 person not everyone when toggling the command

fluid river
#

So you say i can't connect to my brother's pc in the next room if he don't port forward over TCP, right?

eternal oxide
spiral kindle
spiral kindle
#

Wtf are you talking about port forwarding has nothing to do with a lan

wet breach
spiral kindle
#

It only applies when you have a router in the equation

wet breach
#

connecting to a system inside the network from another system in the network does not require port forwarding

zinc moat
eternal oxide
#

pseudojava if (!event.getPlayer().getPDC().get(yourPlayersSetting))

spiral kindle
fluid river
#

So 2 PCs in one room connect to each other over LAN with no problems right?

eternal oxide
#

?pdc

fluid river
zinc moat
#

can someone just show me how to actually do it

empty horizon
wet breach
#

oh LAN, yeah typically yes but it depends on setup such as software firewalls and if anything is listening on the port you are trying to connect on

#

but in general yes

fluid river
#

yeah yeah i know

quaint mantle
#

@echo basalt lmao that vc is crazy

empty horizon
#

Disable windows firewall

quaint mantle
#

i was just in there

spiral kindle
echo basalt
#

TIL that the minecraft network I've been making for the past 2 weeks is actually being sponsored by the biggest ytber in spain

young knoll
fluid river
#

So one player starts a TCP Server on local, second player starts TCP client and sends a packet to LAN network

echo basalt
#

and I've been speaking to one of his producers this entire time

wet breach
#

make sure it advertises your name 😉

echo basalt
#

I'm the only dev

#

and the producer was praising me on his livestream

wet breach
#

Lol nice

zinc moat
fluid river
young knoll
#

Yes pdc can hold booleans

empty horizon
echo basalt
#

I've been typing in spanish with this producer for the past couple days and now my instagram is in spanish huh?

fluid river
#

Its an example, not an actual situation

zinc moat
#

yeah i have no idea how to even use pdc after reading allat i think i migth just scrap the project

spiral kindle
#

something like this

echo basalt
#

that's not pdc

fluid river
#

player.getPDC().setSmth(key, value);

echo basalt
#

but that use case scenario is applicable

#

I just have wrapper classes for pdc

zinc moat
#

did you make that?

echo basalt
#

I can't bother setting up keys n shit

spiral kindle
#

mainly copilot made that XD

zinc moat
#

is copilot free or paid

spiral kindle
#

if you are a student it is free outherwise it is not

fluid river
#

If you live in Russia, its just blocked 🙂

zinc moat
#

do you need a student id?

spiral kindle
#

you need a student email i think

echo basalt
#

copilot my beloved

#

I have it until august I think

rough ibex
#

I'm old-school, dong it myself...

torn shuttle
#

yo @echo basalt do you use mojang remappings for sending packets?

echo basalt
#

yuh

young knoll
#

Do people still do NMS without mappings

#

Insane people

echo basalt
#

I'm struggling with resource packs rn

torn shuttle
#

most docs use spigot

#

is the problem

echo basalt
#

tried adding 2-3 new characters and this shit just refuses to load

torn shuttle
#

for the font?

echo basalt
#

ye

torn shuttle
#

fonts are ass

echo basalt
#

might be transparency related idk

young knoll
#

Are the characters too big

echo basalt
#

nope

young knoll
#

I know there’s a size limit

torn shuttle
#

wdym by refuses to load

echo basalt
#

it just shows up as a square

bleak eagle
#

@uneven iris

#

let's say you have a main class

package net.oikei.exampleplugin;

import org.bukkit.plugin.java.JavaPlugin;

public final class ExamplePlugin extends JavaPlugin {
    @Override
    public void onEnable() {
      //
    }

    @Override
    public void onDisable() {
      //
    }
}

looks pretty sad and empty. your plugin-enabling logic should fit into the onEnable() method and the stuff that runs when your plugin is disabling (like on server shutdown) can be chucked into onDisable(). we'll keep it sad and empty for now, because first we'll need to make some event handlers. what the hell are event handlers? they're basically methods containing your own code that executes whenever something happens anywhere on the server. this can be a lot of different things, from players sending chat messages, to joining, leaving, dying, armor stands being manipulated, squids making weird noises, whatever... now, all your event handler methods have to be inside a class that we call the event listener.. inside are those aformentioned methods called event handlers. alright, let's finally make this event listener class containing all our event handlers, we're actually only gonna have one event handler for now, but oh well :P in the above example code, the main class is located in the package net.oikei.exampleplugin. when we're making these new event listener classes it's really good practice to organize them into a new package, even though in our case we're only gonna have a single event listener with a single event handler. we'll call this new package containing our event listener listeners, so it will be at net.oikei.exampleplugin.listeners. you can do this easily in whatever ide you're using. let's make our actual event listener class inside of this package. we'll just call the class a boring EventListener, cuz it's the only event listener we'll have. it will be at net.oikei.exampleplugin.listeners.EventListener.

torn shuttle
#

also fyi the minecraftl client has a half-decent error logger for resource packs

bleak eagle
#

next step is to tell java that our new class is actually indeed supposed to be an event listener class. we can do this by adding implements Listener to our class definition. so, say the code inside the EventListener class looks like

package net.oikei.exampleplugin.listeners;

public class EventListener {
    //
}

it should be turned into

package net.oikei.exampleplugin.listeners;

import org.bukkit.event.Listener;

public class EventListener implements Listener {
    //
}

okay, now we finally have a class that java knows is supposed to be an event listener class containing event handlers, inside a nice listeners package. let's FINALLY add an event handler to it! okay, so far i haven't mentioned which event we're supposed to handle. it's gonna be the PlayerDeathEvent. the code will now look a little bit like this

package net.oikei.exampleplugin.listeners;

import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerDeathEvent;

public class EventListener implements Listener {
    @EventHandler
    public void onPlayerDeath(PlayerDeathEvent event) {
        //
    }
}

we've added our event handler method that should handle the PlayerDeathEvent. notice the @EventHandler annotation, it's important! just tells bukkit that the method we're about to write should be used to handle some sort of event, and is not just a regular old method like any other. we've called the method onPlayerDeath but the name of it can be anything, as long as it takes in the event you'd like to handle as its first argument, which you can also notice here ((PlayerDeathEvent event))! cool, now anything we put inside will get executed whenever any player dies. now, the really neat thing about events is that we can modify them and get extra info about them inside our event handlers.

echo basalt
#

mf

torn shuttle
#

jesus

bleak eagle
#

as has been mentioned earlier, every event handler method must take the event it wants to handle as its first and only argument, in our case we want a PlayerDeathEvent and we're storing it in the event variable. using this magic event variable we can do a lot of cool crap. let's get the event's player, aka the actual player that died when this event was triggered. we can use the getPlayer() method in the event variable for this. it will return a Player object, so we'll make a player variable of the Player type to store the player in.

package net.oikei.exampleplugin.listeners;

import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerDeathEvent;
import org.bukkit.entity.Player;

public class EventListener implements Listener {
    @EventHandler
    public void onPlayerDeath(PlayerDeathEvent event) {
        Player player = event.getPlayer();
    }
}

neat. now we have to check whether this Player is in a specific Team called thirdlife. we already have the player ready, but now we need to get the specific Team object to check if the player is in it. teams work a little weird in spigot, they're actually stored as a part of the scoreboard, so to get a team we first have to get the server's main scoreboard. we can do it using getMainScoreboard() like so

package net.oikei.exampleplugin.listeners;

import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerDeathEvent;
import org.bukkit.entity.Player;
import org.bukkit.scoreboard.Scoreboard;

public class EventListener implements Listener {
    @EventHandler
    public void onPlayerDeath(PlayerDeathEvent event) {
        Player player = event.getPlayer();
        Scoreboard mainScoreboard = Bukkit.getScoreboardManager().getMainScoreboard();
    }
}
echo basalt
#

this blud is chatgpt

bleak eagle
#

nice. now, from this main scoreboard, let's get our thirdlife Team. we can do that using getTeam() like so

package net.oikei.exampleplugin.listeners;

import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerDeathEvent;
import org.bukkit.entity.Player;
import org.bukkit.scoreboard.Scoreboard;
import org.bukkit.scoreboard.Team;

public class EventListener implements Listener {
    @EventHandler
    public void onPlayerDeath(PlayerDeathEvent event) {
        Player player = event.getPlayer();
        Scoreboard mainScoreboard = Bukkit.getScoreboardManager().getMainScoreboard();
        Team thirdlifeTeam = mainScoreboard.getTeam("thirdlife");
    }
}

cool. the thing is, we're good programmers. and we don't want our stuff crashing. that's why we'll actually have to check if this thirdlife team even exists in the first place before working on it. conveniently, if a team doesn't exist on a server, the getTeam() method we just used will simply return null. so we can add a neat little if-statement to do it

package net.oikei.exampleplugin.listeners;

import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerDeathEvent;
import org.bukkit.entity.Player;
import org.bukkit.scoreboard.Scoreboard;
import org.bukkit.scoreboard.Team;

public class EventListener implements Listener {
    @EventHandler
    public void onPlayerDeath(PlayerDeathEvent event) {
        Player player = event.getPlayer();
        Scoreboard mainScoreboard = Bukkit.getScoreboardManager().getMainScoreboard();
        Team thirdlifeTeam = mainScoreboard.getTeam("thirdlife");

        if (thirdlifeTeam == null) { // the team is nonexistent!!
            Bukkit.getLogger().warn("the thirdlife team doesn't exist!") // log this terrible failure
            return; // terminate this event handler early
        }
    }
}
torn shuttle
#

chatgpt is slower than this

bleak eagle
#

alright, now we can safely check if our player is in our team. a team has "entries" which are really just strings of the names of players which are in a team. we'll use the hasEntry() method on our Team to check if the player is in the team

package net.oikei.exampleplugin.listeners;

import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerDeathEvent;
import org.bukkit.entity.Player;
import org.bukkit.scoreboard.Scoreboard;
import org.bukkit.scoreboard.Team;

public class EventListener implements Listener {
    @EventHandler
    public void onPlayerDeath(PlayerDeathEvent event) {
        Player player = event.getPlayer();
        Scoreboard mainScoreboard = Bukkit.getScoreboardManager().getMainScoreboard();
        Team thirdlifeTeam = mainScoreboard.getTeam("thirdlife");

        if (thirdlifeTeam == null) { // the team is nonexistent!!
            Bukkit.getLogger().warn("the thirdlife team doesn't exist!") // log this terrible failure
            return; // terminate this event handler early
        }

        if (thirdlifeTeam.hasEntry(player.getName()) { // our team has an entry that is equal to the player name, aka our team has our player in it
            //
        }
    }
}

notice how we've also used the getName() function on our Player to get their name, which we've then passed into the Team's hasEntry() method, which we've checked for trueness. okay, at this point, we can run code when a player that's in the team thirdlife dies. remember how i said that we can use the magic event variable not only to get info about the specific event that occured, but also modify the event? the PlayerDeathEvent actually has a really cool method that allows us to set keepInventory on an event basis. so for one event, we can have keepInventory enabled, and for another, we can have it disabled!

echo basalt
#

but yeah this just refuses to load

bleak eagle
#

alright, now we can safely check if our player is in our team. a team has "entries" which are really just strings of the names of players which are in a team. we'll use the hasEntry() method on our Team to check if the player is in the team

package net.oikei.exampleplugin.listeners;

import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerDeathEvent;
import org.bukkit.entity.Player;
import org.bukkit.scoreboard.Scoreboard;
import org.bukkit.scoreboard.Team;

public class EventListener implements Listener {
    @EventHandler
    public void onPlayerDeath(PlayerDeathEvent event) {
        Player player = event.getPlayer();
        Scoreboard mainScoreboard = Bukkit.getScoreboardManager().getMainScoreboard();
        Team thirdlifeTeam = mainScoreboard.getTeam("thirdlife");

        if (thirdlifeTeam == null) { // the team is nonexistent!!
            Bukkit.getLogger().warn("the thirdlife team doesn't exist!") // log this terrible failure
            return; // terminate this event handler early
        }

        if (thirdlifeTeam.hasEntry(player.getName()) { // our team has an entry that is equal to the player name, aka our team has our player in it
            //
        }
    }
}

notice how we've also used the getName() function on our Player to get their name, which we've then passed into the Team's hasEntry() method, which we've checked for trueness. okay, at this point, we can run code when a player that's in the team thirdlife dies. remember how i said that we can use the magic event variable not only to get info about the specific event that occured, but also modify the event? the PlayerDeathEvent actually has a really cool method that allows us to set keepInventory on an event basis. so for one event, we can have keepInventory enabled, and for another, we can have it disabled! we can use the setKeepInventory() method on our PlayerDeathEvent event variable to do this.

echo basalt
#

bro

torn shuttle
#

d@echo basalt you've done ClientBouSetEntityPacket(s)?

bleak eagle
#

we don't want keepInventory for players on the thirdlife team, so we'll set it to false

package net.oikei.exampleplugin.listeners;

import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerDeathEvent;
import org.bukkit.entity.Player;
import org.bukkit.scoreboard.Scoreboard;
import org.bukkit.scoreboard.Team;

public class EventListener implements Listener {
    @EventHandler
    public void onPlayerDeath(PlayerDeathEvent event) {
        Player player = event.getPlayer();
        Scoreboard mainScoreboard = Bukkit.getScoreboardManager().getMainScoreboard();
        Team thirdlifeTeam = mainScoreboard.getTeam("thirdlife");

        if (thirdlifeTeam == null) { // the team is nonexistent!!
            Bukkit.getLogger().warn("the thirdlife team doesn't exist!") // log this terrible failure
            return; // terminate this event handler early
        }

        if (thirdlifeTeam.hasEntry(player.getName()) { // our team has an entry that is equal to the player name, aka our team has our player in it
            event.setKeepInventory(false); // no keepInventory for these idiots
        }
    }
}

and let's use an else-statement to make sure players not on the team do have keepInventory

#
package net.oikei.exampleplugin.listeners;

import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerDeathEvent;
import org.bukkit.entity.Player;
import org.bukkit.scoreboard.Scoreboard;
import org.bukkit.scoreboard.Team;

public class EventListener implements Listener {
    @EventHandler
    public void onPlayerDeath(PlayerDeathEvent event) {
        Player player = event.getPlayer();
        Scoreboard mainScoreboard = Bukkit.getScoreboardManager().getMainScoreboard();
        Team thirdlifeTeam = mainScoreboard.getTeam("thirdlife");

        if (thirdlifeTeam == null) { // the team is nonexistent!!
            Bukkit.getLogger().warn("the thirdlife team doesn't exist dumbass! set up your world first") // log this terrible failure
            return; // terminate this event handler early
        }

        if (thirdlifeTeam.hasEntry(player.getName()) { // our team has an entry that is equal to the player name, aka our team has our player in it
            event.setKeepInventory(false); // no keepInventory for these idiots
        } else {
            event.setKeepInventory(true); // all the keepInventory for these nerds though
        }
    }
}

nice, that's basically it, but since computers are really dumb we need to do one last thing - tell bukkit to use our event listener with our event handler. we have to "register" it. let's go back to our sad and empty main class and add the following to our onEnable()

package net.oikei.exampleplugin;

import org.bukkit.plugin.java.JavaPlugin;
import net.oikei.warezlogin.listeners.EventListener; // <--- import our event listener here

public final class ExamplePlugin extends JavaPlugin {
    @Override
    public void onEnable() {
        getServer().getPluginManager().registerEvents(new EventListener(), this); // <--- register it here
    }

    @Override
    public void onDisable() {
      //
    }
}

compile your plugin and test it out, and i guess you're done

echo basalt
torn shuttle
#

no

bleak eagle
#

alright that's all @uneven iris

torn shuttle
#

ClientboundSetEntityDataPacket

echo basalt
#

ah that one

#

Yeah I've done it

bleak eagle
#

sorry it took so long but i couldn't type much faster

echo basalt
#

quite chill

bleak eagle
#

also sorry for flooding the chat

torn shuttle
# echo basalt quite chill

ClientboundSetEntityDataPacket clientboundSetEntityDataPacket = new ClientboundSetEntityDataPacket(id, List.of(SynchedEntityData.DataValue.create(new EntityDataAccessor<>(16, EntityDataSerializers.ROTATIONS), new Rotations(180,180,180))));

I feel like I'm not using it the way it was meant to be used

bleak eagle
#

i'm worryingly autistic

torn shuttle
#

that's just a quick rotation test

torn shuttle
#

yeah I figured something's wrong

echo basalt
#

Basically each entity class has a bunch of serializers n shit

#

thing is all of these are private

torn shuttle
#

oh fantastic

#

I love that

echo basalt
#

you should just have an nms entity (no need to add it to the world)

#

and use its data watcher

torn shuttle
#

I can't

#

well ok I can if I don't add it

#

so I create an entity without spawning it?

echo basalt
#

Yeah

torn shuttle
#

and then get its data watcher?

echo basalt
#

just constructor

#

Yep

#

Just use its nms methods

#

Then get the synched entity data

#

and pack non defaults

torn shuttle
#

constructor so I actually full on initialize it right

echo basalt
#

or pack dirty

torn shuttle
#

not any spawn methods

echo basalt
#

nope

spiral kindle
echo basalt
torn shuttle
#

did you check what the client says when your rsp loads?

echo basalt
torn shuttle
#

those models you were working on are packet entities?

#

oh right they were meg anyway right

echo basalt
#

meg does that part

torn shuttle
#

yeah

#

that's what I'm working on

echo basalt
#

this is just the block display for showing how full the bin is

#

or whatever

#

and the items on the belt are packet entities yeah

#

only reason why I did em packet-based is because SWM was saving my shit

torn shuttle
#

I must really like pain because I'm doing this for both armorstands and display entities

echo basalt
#

and I didn't know Entity#setPersistent was a thing

torn shuttle
#

lmao

#

just wait until you discover removewhenfaraway

#

that thing is a war crime

echo basalt
#

and my alt refuses to work

young knoll
#

Then use a different launcher?

torn shuttle
#

so what did you say about it not loading earlier? I lost it in the bible that other dude posted

echo basalt
#

mojank launcher doesn't like to work either

wet breach
torn shuttle
wet breach
#

lol

young knoll
#

The heck did you do to your mc setup

#

My logs work fine

echo basalt
#

gdlauncher doesn't do logs

#

and I used game pass on my alt which means it asks me for a username every time I try to launch it

#

Even though I bought the fucking account

#

my main just straight up crashes the game on the mc launcher

#

and my alt gives me invalid session on gdlauncher

#

fucking pain in the ass

torn shuttle
# echo basalt

hey did you cehck to see if you can name files like that, out of curiosity

echo basalt
echo basalt
torn shuttle
#

I think caps doesn't work I don't know if numbers work, I have a working file and no numbers

#

the naming requirements for these are downright insane

echo basalt
#

the answer is no

#

ten.png doesn't work

torn shuttle
#

also every height I have is 256 no clue why I paid someone to write this garbage for me

#

actually they're all 136 by 256 I think it's because they're all for the same size menu

#

so probably not it

echo basalt
#

I just want a 10x1 rectangle I can scale for some bossbar shenanigans

torn shuttle
#

I will say I don't do \ for my unicode

#

which you do

echo basalt
#

with or without the problem remains

#

I already tried all sorts of combos

torn shuttle
#

and the texture is placed in the right spot?

echo basalt
#

Yes, I have other icons and it all works

#

I've done fancy resourcepack stuff in the past ik how this works

young knoll
#

get some working client logs smh ¯_(ツ)_/¯

torn shuttle
#

oh so it's just this one icon then?

#

well these icons

echo basalt
#

got my main acc to work let's see

#

and for some reason this works now

#

huh

torn shuttle
#

man my nms project was not built to handle packets and this is starting to destroy my soul

echo basalt
#

noob

#

I went too hard on the opacity ffs

young knoll
#

F

spiral kindle
echo basalt
#

why is minecraft casting a shadow

torn shuttle
#

and ultimately I only need 3-4 maybe 5 packets total

echo basalt
#

and for some reason ascent doesn't work on a bossbar fml

hasty prawn
echo basalt
#

neither up nor down

#

and I don't have the patience to do this with actionbars

echo basalt
#

deadline's in like 19 hours

torn shuttle
#

if only you'd spent less time cooking and more time eating rotisserie chicken and chugging cheap energy drinks

#

go do it with actionbars

#

or be really funny and do it with titles

spiral kindle
#

isnt that a perfect job for chatgpt?

wet breach
torn shuttle
echo basalt
#

nah I had a nice 5$ pizza for dinner

#

and I'm gon chug red bull

torn shuttle
#

the greasemaster strikes once again

wet breach
#

if the best military runs just on that, maybe we should apply that to other places since it seems to work XD

echo basalt
#

thing is I have a lot more than just bossbars to do

torn shuttle
#

I bet the project he was hired to do is a remake of pizza tower in minecraft

spiral kindle
wet breach
echo basalt
#

nah I'm making an mcci competitor

torn shuttle
torn shuttle
echo basalt
#

mccisland

#

fancy minigame server

torn shuttle
#

so skyblock, I mean I saw it so it makes sense

wet breach
#

must not be fancy enough

young knoll
#

Well it’s got about 500 online

#

So not quite hypixel

torn shuttle
#

it's a shame mc performance is so horrid because I kind of am tempted to make a kind of factorio like game in mc

torn shuttle
#

but there's no overhead and the client would commit sudoku the moment more than three models are on screen

echo basalt
#

our closed beta tomorrow is gonna have ab 200 people so I gotta just pray I get this shit done within the next 19 hours

torn shuttle
wet breach
#

make your own client

torn shuttle
#

at that point I'd just make my own game

#

with blackjack and hookers

young knoll
#

Why’s the client an issue

wet breach
#

as long as you don't mess with the auth stuff, you are free to change everything else

torn shuttle
young knoll
#

If your making a dedicated factorio like game just re-model noteblocks and you’ll probably be fine

torn shuttle
#

there's basically a guaranteed low cap for how many models you can do

uneven iris
young knoll
#

I mean factorio belts would just be an animated texture

torn shuttle
#

sure, that's literally what illusion did a few days ago

young knoll
#

The only big fancy model things that come to mind are trains and inserters

uneven iris
torn shuttle
#

well, there's also the things on the belts

#

and then just about every machine that you want to have an animation

#

at least an animation that makes sense

young knoll
#

I guess all the items on the belt could become an issue

#

Mc doesn’t do too bad with a bunch of item displays tho

torn shuttle
young knoll
#

You can also just heavily cull them by distance

#

Well bedrock isn’t my problem :p

torn shuttle
#

yeah, it's mine seemingly

young knoll
#

Noted

#

Idk tell ‘em it’s java software and to cope

rough ibex
#

Issue closed: out of scope

torn shuttle
young knoll
#

Could just add a particle toggle

torn shuttle
#

can't because that actually makes the bosses unplayable

young knoll
#

F

torn shuttle
#

they telegraph where things are

#

like zones on the floor for damage or for healing or whatever

young knoll
#

Idk what bedrocks problem is, java doesn’t seem to have many issues up to the particle cap

torn shuttle
#

if you can't see it then the game doesn't make any sense

#

bedrock does particles completely differenty, they don't even behave the same way

#

and it's as far as I can tell extremely unoptimized compared to java which doesn't even make that much sense

young knoll
#

Nah don’t worry C++ is a way better language

#

So it can’t be laggy

#

Bedrock is a perfect game with no flaws

torn shuttle
#

to be fair it's faster in just about everything I know of except this very specific thing

#

in which it's much worse

young knoll
#

It’s faster in being glitchy too

torn shuttle
#

maybe, I only booted it once when it first came out and then never again

young knoll
#

I like the videos where people just randomly die

torn shuttle
young knoll
#

Shhhh not those ones

spiral kindle
#

can i get the entity from an itemstack?

torn shuttle
#

no

#

items are entities, itemstacks can be anywhere

#

like in an inventory or a container

#

or nowhere at all

spiral kindle
#

😭 so if i want the entity a dispenser gives out the only way to check if it was droped by a dispenser is to randomly search around it?

echo basalt
#

I just wasted an hour debugging shit because I was saving to the wrong file

#

fml

zealous sparrow
#

does anyone else get Caused by: java.lang.ClassNotFoundException for their implementation dependencies in gradle?

echo basalt
#

the launch is at 7pm our time

torn shuttle
#

better go get some more $5 pizza and $.5 energy drink

echo basalt
#

imma make a couple thousand off of this

torn shuttle
#

I'm sure you're paying your taxes on it too

echo basalt
#

exactly

young knoll
#

Yes hello I am the IRS

torn shuttle
#

in portugal you'd be the AT

#

btw this is the same guy who refuses to move to a house where he can actually use the kitchen so he can stop having $5 pizza and $5 rotisserie chicken for every meal

young knoll
#

Yes I am AT&T

#

Wait

torn shuttle
#

I actually owed taxes to the AT because I did a typo in a payment

#

I believe it was 20 cents

#

and I would've gotten away with it too if it wasn't for those pesky automated verifications

echo basalt
#

Homie I don't even have my license yet

#

And my income's too unreliable to rent, especially in the region I live in

torn shuttle
#

move to alentejo, you can buy a house for 2k

echo basalt
#

Ah yes

#

I'd love to herd sheep for a living

#

Or harvest cork

young knoll
#

You say that now but give it 10 years more of being a programmer

#

And you’ll long for the fields

torn shuttle
#

don't forget about becoming a drunkard and dying by the age of 50

#

and then your widowed wife gets to live to 100

echo basalt
#

sounds uh

#

familiar

royal hawk
#

Hello who can help?
I have 2 plugins example PluginA and PluginB
In PluginA main logic in PluginB logic and use api from PluginA

When I reload pluginA my methods in PluginB breaks I think after reload jvm see old classes need a help with this:0

echo basalt
#

easy solution, just don't reload

royal hawk
wet breach
torn shuttle
#

make sure you unload everything you need to unload on the shutdown method and then reinitialize it on startup

#

I don't owe jack shit

#

to anyone

uneven iris
#

so guys, i'm incredibly stupid and don't know how to compile properly, one of the legends here wrote me a file and I can't for the life of me figure out what to do with it


import org.bukkit.plugin.java.JavaPlugin;
import net.oikei.warezlogin.listeners.EventListener; // <--- import our event listener here

public final class ExamplePlugin extends JavaPlugin {
    @Override
    public void onEnable() {
        getServer().getPluginManager().registerEvents(new EventListener(), this); // <--- register it here
    }

    @Override
    public void onDisable() {
      //
    }
}```
```package net.oikei.exampleplugin.listeners;

import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerDeathEvent;
import org.bukkit.entity.Player;
import org.bukkit.scoreboard.Scoreboard;
import org.bukkit.scoreboard.Team;

public class EventListener implements Listener {
    @EventHandler
    public void onPlayerDeath(PlayerDeathEvent event) {
        Player player = event.getPlayer();
        Scoreboard mainScoreboard = Bukkit.getScoreboardManager().getMainScoreboard();
        Team thirdlifeTeam = mainScoreboard.getTeam("thirdlife");

        if (thirdlifeTeam == null) { // the team is nonexistent!!
            Bukkit.getLogger().warn("the thirdlife team doesn't exist dumbass! set up your world first") // log this terrible failure
            return; // terminate this event handler early
        }

        if (thirdlifeTeam.hasEntry(player.getName()) { // our team has an entry that is equal to the player name, aka our team has our player in it
            event.setKeepInventory(false); // no keepInventory for these idiots
        } else {
            event.setKeepInventory(true); // all the keepInventory for these nerds though
        }
    }
}```
#

would someone be able to help me compile this (I downloaded intellij, minecraft version needs to be 1.20.2)

echo basalt
#

yay I got some progress

#

they're all fucked

young knoll
#

320 blaze it

torn shuttle
echo basalt
#

no

torn shuttle
echo basalt
#

actually it scales

#

troll of bozo

torn shuttle
#

how are you doing those numbers anyhow, do you have different pngs for different numbers?

echo basalt
#

custom font

torn shuttle
#

whitespace?

echo basalt
torn shuttle
#

because you can't just put text at the far right like that unless you are just maxing out bossbar text

echo basalt
#

as for spacing you're using a really shitty version of the negative spacing font

#

the new version is nice

young knoll
#

I gotta get me that

echo basalt
#

I have a lil thing to merge spaces on automatically generated strings :)

#

which is how I achieved those fancy background color menus

#

ignore the colors I suck at using a color picker

#

anyways time to make bossbars invisible

young knoll
#

Do I see the background gui poking through at the top

#

0/10

echo basalt
#

0/10 I work with that I was given

young knoll
#

I hate it and I will never recover from this

torn shuttle
#

if you think that's bad you should see how the model hitboxes were

echo basalt
#

I already fixed those

young knoll
#

My hitboxes are still scuffed

torn shuttle
#

wowe a xmas miracle

young knoll
#

Because they are just hardcoded lul

torn shuttle
#

he also hardcoded positions for the belts instead of putting metadata in the model

minor junco
#

Hardcoded hitboxes 😵

torn shuttle
#

which is cringe af and not based in the least

young knoll
#

I haven’t written the parsing for them yet

#

Hush

#

Sadly interaction entities don’t push other entities :/

echo basalt
#

why isn't my bossbar invisible

young knoll
#

Uhh

#

Yes

echo basalt
#

I think the fuckin server resourcepack is overriding this shit

torn shuttle
#

this is annoying because I have to split this fake entity garbage between my shaded library and my models plugin

#

I really want to drop support for 1.18

plush gulch
#

is there an event for two entities colliding?

minor junco
#

Have you tried entity collide event

plush gulch
#

in the docs

remote swallow
plush gulch
#

are there workarounds for spigot?

minor junco
#

I mean theoretically if there was no event in spigot you could track every entity's bounding box and check if they intersect

#

But there should be an event for sure, like I remember seeing an event for that

#

Tbf it could've been a custom event of mine

young knoll
#

Yeah that would be a pretty laggy event

zinc moat
#

guys i have a command and a event listerning in the same main file is there anyway i can get the arguments from the command and check in the listener if its greater then 1 argument and if it is then it does something but if its not then it does smthing else?

minor junco
#

?xy

undone axleBOT
spiral kindle
minor junco
#

Cause depending on that your implementation varies

zinc moat
young knoll
#

I wonder if you can make just the top bossbar invisible

#

Maybe some core shaders magic

uneven iris
#

@bleak eagle i am a dumbass, is there any chance you could compile it for me 💀

#

why the hell can i not post images

slender elbow
#

because you're white

#

like me

#

(not verified)

#

god that never gets old

echo basalt
#

Looks nice

#

the bossbar magic is done

#

now I just need to do other random BS fixes and we should be good for launch

remote swallow
slender elbow
#

i have

remote swallow
#

do you not want to sign into spigot

slender elbow
#

but i gotta change my nick on forums but im broke

remote swallow
slender elbow
#

@eternal night Mr Paper

#

give me your lunch money

remote swallow
#

your like something there just hold mini ransom, they paid for a mac so surely they could donate 10 dollary doos to a triage team member

young knoll
echo basalt
#

there's a folder that has all the pngs

#

just make them invis

#

no core shader magic

#

no nun

young knoll
#

Wut

echo basalt
#

used to be gui/bars.png

young knoll
#

Won’t that make them all invisible though

echo basalt
#

now it's gui/sprites/boss_bars/...

young knoll
#

Ah I see I could just remove one colour

echo basalt
#

pre 1.20 or whatever it's just changing bars.png and icons.png for some reason

#

although I think the one on icons.png is the same color but for horses

young knoll
#

Might still look into shaders so I don’t yeet an entire colour

remote swallow
#

"DO NOT USE THE YELLOW BOSS BAR ANYWHERE OR IT WILL BREAK EVERYTHING AND RM RF / YOUR COMPUTER"

spiral kindle
#

is there any sensable way to get the minecard that a dispenser dispenses?

Like this is how i curently do it and this sucks:

#

@EventHandler
public void onBlockDispense(BlockDispenseEvent event) {
ItemStack item = event.getItem();

    if (item.getType() == Material.MINECART) {
        Block block = event.getBlock();
        if (block.getType() == Material.DISPENSER) {
            // Get the direction the dispenser is facing
            BlockFace facing = ((Directional) block.getBlockData()).getFacing();
            Block blockInFront = block.getRelative(facing);
            Bukkit.getScheduler().runTaskLater(this, new Runnable() {
                @Override
                public void run() {
                    for (Entity entity : blockInFront.getLocation().getChunk().getEntities()) {
                        if (entity instanceof Minecart) {
                            Minecart minecart = (Minecart) entity;
                            if (minecart.getLocation().getBlock().equals(blockInFront)) {
                                dispensedItems.add(minecart);
                            }
                        }
                    }
                }
            }, 1L);
        }

    };
    }
torn shuttle
#

I've started boiling all the vegetables I eat and I swear they 100% look like plastic toys or like photoshoot food

remote swallow
#

are you boiling then in acid or something

torn shuttle
#

no they just look incredibly shiny and plastic

uneven iris
torn shuttle
#

the liquid type

river oracle
torn shuttle
#

throw some trace Cl in there for fun

uneven iris
#

Your water is really really pure

#

That cant be healthy

river oracle
torn shuttle
#

iron water to build an iron will

#

I should probably at least add some salt to this

uneven iris
#

My water is more pure than any of you

torn shuttle
#

I haven't looked into how much salt I should be putting in there so I'm just not

uneven iris
#

Reverse osmosis B)

#

Off of well water

#

So no stinky chlorine

river oracle
#

Bold of you to assume I don't have the same setup

uneven iris
river oracle
torn shuttle
#

I actually had a distiller which was supposed to be for water for a couple of weeks (not used for water)

river oracle
#

I live in the middle of nowhere

uneven iris
#

thinks of something to argue about

torn shuttle
#

and I'm probably buying a different one in a couple of months

uneven iris
#

YOO SAME

remote swallow
uneven iris
#

surely nothing that would get you arrested if you gave to kids

remote swallow
#

specifically here

uneven iris
torn shuttle
#

isopropyl alcohol because I like living on the edge

#

and in case you're wondering, yes, it's fabulously flammable, even spontaneously so

uneven iris
#

hamlet population: so small that it doesn't have a population

slender elbow
uneven iris
#

ok someone should frfr compile my project for me👍

echo basalt
#

fart knox

torn shuttle
#

fart nuts

#

hey illusion

#

guess what

echo basalt
#

yes?

torn shuttle
#

the gym opens in 4 hours and 30 minutes

echo basalt
#

cool

torn shuttle
#

get your preworkout routine going

echo basalt
#

mine opens at 6:30am

torn shuttle
#

damn must be nice

#

I wish I had a 24/7 one around here

echo basalt
#

6:30am to 10pm baby

torn shuttle
#

mine's 7:30 to 10pm, absolute coward behavior

#

and closed on sunday + closed most of saturday

echo basalt
#

mine closes at 8pm on the weekends

#

and on holidays

torn shuttle
#

I would pay triple what I pay my gym just to have it be 24/7

#

so tired of this garbage

echo basalt
#

40 bucks a month

#

indoor heated swimming pool + sauna n shit

torn shuttle
#

and right now you can't realistically work out between 5 and 7 pm, the place is absolutely swarming

echo basalt
#

the kicker is that I get access to 2 gyms not 1

torn shuttle
#

oh you're not even in a gym you're in a health club

echo basalt
#

nah I'm in a gym

#

the owners opened a second branch

torn shuttle
#

I'm blanking out on the name of the local fitness club

#

health place? that doesn't sound right

echo basalt
#

lmao

rough ibex
#

defined volume of good health

torn shuttle
#

holmes place

#

it's like 50 or 60 a month and has indoor pool, jacuzzi, sauna and so on

echo basalt
#

oh yeah my airbnb was right next to one

torn shuttle
#

and you can barely work out there

echo basalt
#

and by right next to one I mean literally out the door

torn shuttle
#

yeah there's one like a 4 minute walk from here

echo basalt
#

but nah we don't have those down south

#

we have like 2 subways though

torn shuttle
#

they're not fit for working out in anyway

echo basalt
#

I took a 1 hour train to eat subway

rough ibex
#

I remember I once went to a subway and the bacon was green.

#

literally

#

At the edges of the pan, it was a dark green

torn shuttle
#

I remember eating at subway over a decade ago

#

I am pretty sure that if I ate that regularly I'd already be dead

echo basalt
#

they're reworking my local mall I think we're gonna have a starbucks too

#

one of my local malls*

torn shuttle
#

where the hell do you even live

echo basalt
#

south

torn shuttle
#

are you in the most bs tourist spot imaginable

echo basalt
#

yeah

#

we have more strip clubs than grocery stores

torn shuttle
#

afaik starbucks and subway only exist in lisbon outside of your area

#

and it's like 1 store

echo basalt
#

I visited 3 subways in lisbon

torn shuttle
#

really?

echo basalt
#

and like 2 starbucks

#

maybe 3

torn shuttle
#

to be fair I don't go to lisbon, that has to be one of the worst cities in europe

echo basalt
#

there are 2 subways in my whole region

#

one's at the airport and the other's by the beach 1hr away

#

I think we have a starbucks at the same shopping we have an ikea at

#

that's ab it

torn shuttle
#

man we don't even have an ikea here

echo basalt
#

it's like a 1 hour drive too

torn shuttle
#

not that I really care, I make my own furniture

echo basalt
#

on the sketchiest road

torn shuttle
#

oh well then it's not much different from what we have, it's 1h30 to go to porto's ikea from here

echo basalt
#

you go straight for about 9 roundabouts then do a sharp turn into a mega narrow street

torn shuttle
#

oh so basically it's portugal

echo basalt
#

that's also on a hard incline

#

cross the shady bridge and you're at the widest highway

torn shuttle
#

hell I went to france a week ago and that's basically a description of the road to go to france

#

I think you pretty much have to take the worst stretch of the ip3 to get to porto's ikea from here so ours is objectively worse, pretty sure it's been the deadliest road in the country

echo basalt
#

Imagine experiencing cold lmao

torn shuttle
#

what's your temp right now

echo basalt
#

It says 11C but I got my window open on full blast and I'm wearing a tshirt

torn shuttle
#

11c here as well buddy enjoy your living in a bs tourist destination lifestyle

#

and I also have the window open with the fan on

echo basalt
#

Prob a tiny ass window

#

Taking a shit rn think imma call it lisbon

torn shuttle
#

I won't flex the apartment, it's something I inherited

#

but it's big. Very big. So big that I'm moving to something smaller in the next year or two

echo basalt
#

Imagine inheriting shit smh

torn shuttle
#

cope and seethe my dude

vocal cloud
#

-40 is nice wym

river oracle
torn shuttle
#

unless you're imillusion in which case it's fart in disguise

echo basalt
#

bro doesn't miss an opportunity

torn shuttle
echo basalt
#

#1 in your neighbourhood

#

well time to sleep

#

done plenty of work today

hazy warren
#

is there any known solution to making interaction entities that are stacked on a player not teleport off them for a split second once every 60 seconds?

eternal oxide
#

interaction entity?

hazy warren
eternal oxide
#

are they set as passengers, or are you manually teleporting them?

hazy warren
#

the minecraft client uncontrollably kicks them off and puts them back on immediately causing 2 ticks of weird behaviour every 60 seconds

torn shuttle
#

behold

#

AbstractPacketArmorStandDisplayEntity

#

another banger class name by yours truly

torn shuttle
#

real quick how do people usually manage manually sending entity packets to players, I assume the normal way of doing it would be to just check if a player is within a distance that would be able to see the entity?

#

I know there's a million of potential optimizations and such, just trying to get an idea of what the baseline is

inner mulch
#

Can I let the Server wait, when using a command without stopping everything Else?

eternal oxide
#

no

drowsy helm
#

what are you trying to achieve?

torn shuttle
#

nirvana

#

oh that wasn't for me

lost matrix
# inner mulch Can I let the Server wait, when using a command without stopping everything Else...

Letting the server wait will result in the entire application simply freezing because minecraft handles (almost) everything consecutively on a single thread.
However, you can schedule code to be executed at a later point in time by using the BukkitScheduler.

If you want to compute expensive operations (like loading a file or accessing a web endpoint), then you can simply spawn a new Thread and let the computation be
handled independent from the minecraft server. Inside this thread you can use the BukkitScheduler to create a task as soon as your code is done executing, in order to
get the result back on the servers main thread.

torn shuttle
#

hey nms nerds can you confirm my suspicion that this actually spawns the entity in-world?

#

because I just want the entity without it actually spawning, I need to manage it via packets exclusively

lost matrix
#

You need to still add it to your ServerLevel. The constructor doesnt actually attach the entity to your world.

torn shuttle
#

oh awesome

#

perfect

#

thanks

#

oh one last thing before I go to the gym, is there a way to get a spigot armorstand entity from that?

#

actually you know what I don't really need that

#

I can probably manage it as nms regardless

eternal oxide
#

to get teh spigot entity you have to add to world

torn shuttle
#

I feel like spigot is missing some intermediate class that would be really cool to have then

#

like ArmorStandBlueprint or something

lost matrix
eternal oxide
#

for Spigot the entity doesn't exist until it's in the world

torn shuttle
#

yeah

#

never really used this side of things

lost matrix
#

Ah there is actually a huge PR for virtual entities pending in the stash. Its still bein worked on.

torn shuttle
#

well there it is

#

I've had to virtualize a ton of entity stuff before

#

the worst is chunk loading management

#

just very flaky, chunks seem to be able to double load among other weird things

lost matrix
#

Hm? I dont have problems while loading my packet based holograms when a chunk loads.

inner mulch
torn shuttle
#

not a big problem for holograms but a big problem when suddenly there's two of any kind of boss

drowsy helm
#

when i worked with packet entities a while ago i did have double loading issues aswell

lost matrix
#

Hmm

torn shuttle
#

yeah it took me a while to nail it down but I did manage to get actual evidence of it happening

#

it's extremely flaky

drowsy helm
#

this was on like 1.17 tho

torn shuttle
#

iirc it happened on 1.14, 1.15, 1.17 and one build on 1.18, after that I already had an alternate system that took it into account

#

might've been in more versions while getting caught by a prior system that tried to combat it

lost matrix
#

@echo basalt you wanna develop a server?

quaint mantle
#

I use org.bukkit.event.server.ServerListPingEvent to change the Motd of the server...
Any Ideas why that doesnt work when I get kicked?

torn shuttle
lost matrix
#

If he's paying me

lost matrix
quaint mantle
lost matrix
quaint mantle
#

1.20.4

lost matrix
echo basalt
#

I did some talking this dude wants to hire me long term

quaint mantle
lost matrix
quaint mantle
#

Hello, I'm currently doing fun fun things with the Plugin Messaging Channel.
And as far as I understand, the PMC on the spigot side only works as long as someone is on the sub-server, right?
Is there any workaround or do I have to come up with a custom solution?

lost matrix
quaint mantle
#

its a public project so no fake clients
but with the custom solution i thought of some kind of socket server

#

also, we are using MultiPaper and i dont know how well a fake client would work on that xd

#

Is there an example how to use the PMC

eternal oxide
#

?pmc

blazing ocean
#

is there a way to shade ProtocolLib?

quaint mantle
#

You can do with shadowjar

eternal oxide
#

ProtocolLib is a Plugin and should not be shaded

quaint mantle
#

If you gonna shade protocol lib, nothing gonna happen in runtime

bleak eagle
#

do you know java basics?

torn shuttle
#

are fireworks shot from a crossbow still registered as firework projectile?

bleak eagle
#

the nogui flag is literally useless

#

it makes sense, really, but it's really dumb

#

it's never stored nor accessed

rough drift
#

and yet

#

it works

lost matrix
bleak eagle
# rough drift it works

it works because the gui is never ran if you're running from the command line - and you have to run from the command line to pass the flag

#

the way buildtools is designed also prevents from checking whether an explicit enable gui flag is set without chucking the classes around

#

the gui is started first if it has to be started, and only then are the flags parsed

rough drift
#

If you run from the command line it still works

wet breach
#

the pic IKE shows is the gui the flag is for

bleak eagle
wet breach
#

it does

bleak eagle
#

oh i'm not talking about the server

#

i'm talking about buildtools

wet breach
#

anyways, so what used to happen when you didn't have that option

rough drift
#

oh lol

wet breach
#

is all the output went to that gui

#

and nothing on the command line

#

for headless servers this was a bit inconvenient because you had to use xforwarding to see that gui lol

#

so, using the nogui option prevented that window from opening up automatically

#

today, its not needed because the output goes to both places and isn't just taken over by the gui

wet breach
#

however buildtools has its own gui thing now

#

hope the explanation I gave clears up the nogui flag and why it is even a thing 🙂

#

btw, the nogui option only applies the JVM application gui, not the gui of the application provides

rough drift
#

on another topic,

var blockData = Bukkit.createBlockData(Material.OAK_SIGN, data -> {
    var sign = (Sign) data;
    sign.setRotation(face.getOppositeFace());
});

var signBlock = block.getRelative(signDirection);
world.setBlockData(signBlock.getLocation(), blockData);

var state = (org.bukkit.block.Sign) signBlock.getState();
```I'm trying to create a hanging sign and edit it's state, however I get

```java
Caused by: java.lang.ClassCastException: class org.bukkit.craftbukkit.v1_20_R1.block.CraftBlockState cannot be cast to class org.bukkit.block.Sign
```Where did I go wrong?
wet breach
#

maybe you want wall sign?

rough drift
#

oop

#

oh shit

#

I did not know the difference

#

let me try

bleak eagle
#

where could i keep a huge set of flag variables that have to be accessed globally later on? should i make separate class for them or shove them into an existing one? i don't know what the convention exactly is

#

they're all final - i think

wet breach
#

if they are final, then put them in an enum

bleak eagle
#

i don't think an enum can be used in this case

#

maybe i'm wrong? i'm not really much of a java programmer xD

tender shard
bleak eagle
#

trying to implement the gui flag

tender shard
#

if the flag is there, args is not empty and hence the GUI is not shown

wet breach
bleak eagle
#

yeah no i understand

#

we're talking about buildtools gui though

#

it's a bit wonky

eternal night
#

(this is still about forcing a gui open from build tools from the command line)

tender shard
bleak eagle
#

i have to turn the classes around so that the flags get parsed first (in Bootstrap?) and then get passed onto Builder for further use

#

but Bootstrap should check for an explicit --gui flag and start it in that case before Builder checks anything else

blazing ocean
#

is there any way to make a player glow to only a specified group of players with a specified colour? scoreboard teams dont work for me, ive tried that using regular commands as well, so creating a team, changing colour, adding players and giving them glowing. all shown for everybody in white

dire marsh
#

i think you need packets for that

blazing ocean
#

yeah i think so too

blazing ocean
eternal oxide
#

you did it wrong then

dire marsh
#

as setGlowing just sets the metadata on the entity, which is broadcasted to all players

wet breach
eternal oxide
#

setting a colour for opposing teams is what its for

dire marsh
#

scoreboard teams just determine the colour

bleak eagle
#

@tender shard i was thinking of defining all the OptionSpecs publicly somewhere, like in Bootstrap, so that they could be accessed both in Bootstrap and Builder. parse() would be run once at the start of Bootstrap and the OptionSet it returns would get passed to Builder as an argument. does this sound OK to you?

eternal night
bleak eagle
tender shard
#

its obviously a joke

#

lol

bleak eagle
#

it's separate from the rest of the flag parsing code

#

OK sorry i don't get jokes often LOL

eternal night
#

I mean, you can abstract the options away into some type that re-exposes them via getters

#

and pass that one around

bleak eagle
#

ugh maybe

wet breach
bleak eagle
#

it uses jopt

wet breach
#

its a jvm flag last I recalled, not a flag that is provided specifically

bleak eagle
#

this is unrelated to anything jvm

wet breach
dire marsh
bleak eagle
wet breach
#

but...it makes no sense to implement a gui flag, if the jvm provides a nogui flag

#

which you should be able to grab if it is set from the system properties or metadata

eternal night
#

....

bleak eagle
#

the way buildtools does it is different

#

it has checks to see whether the jar is run from the command line or a graphical file manager

#

and starts the gui based on that

#

but the issue is that most linux distros don't really allow you to start jars from file managers

#

making running the gui impossible on linux without hacks using .desktop files and etc

wet breach
#

thats not true

bleak eagle
#

i've tried it on ubuntu, linux mint and kde neon

#

none do

wet breach
#

window managers on linux is what controls whether or not Java applications on linux can show a gui or not

bleak eagle
#

no no

wet breach
#

also, java has a system properties you can configure

bleak eagle
#

i meant being able to start jars from the file manager

#

all distros just open it as a zip

#

and you need to write a separate jar launcher wrapper

wet breach
#

oh the file manager, don't think I have ever used a file manager

bleak eagle
#

?

wet breach
#

the execute flag has to be set for it to not open as a zip 😛

bleak eagle
#

it's set to execute

#

it opens as an archive

wet breach
#

well, I never had that happen except on linux mint

#

but there is system settings though you can tweak to fix that

bleak eagle
#

in either case an explicit gui flag would solve all this hackiness if you take a step back

wet breach
#

yes and one is provided by the JVM

bleak eagle
#

being able to start a gui from the command line is useful in either case

bleak eagle
#

how can i start buildtools gui from the command line on linux right now?

torn shuttle
#

@echo basalt bro 3.1 magnitude earthquake in algarve? You really need to cut back on that greasy food, you getting out of bed is making the news

bleak eagle
#

lmao

wet breach
bleak eagle
#

nope it's explicitly set up not to

wet breach
#

however all I am saying is a duplicate flag just doesn't need to be created

#

just updated to check it

bleak eagle
#

it checks whether you are running it from the command line and doesn't start the gui in that casae

bleak eagle
#

--gui isn't a valid jvm flag

wet breach
#

nogui

#

nogui

bleak eagle
#

what i'm trying to implement is an explicit gui flag

wet breach
#

that isn't the same as --gui

bleak eagle
#

not the other way around

wet breach
#

what I keep typing is an explicit flag

bleak eagle
#

it's inverse

#

you are specifying not to start the gui and not to start the gui

wet breach
#

its a boolean option

bleak eagle
#

wtf?

wet breach
#

so you can do nogui false

bleak eagle
#

you're sure?

#

i've never seen it used this way

wet breach
#

I am pretty sure its a boolean option but I am going off info that is probably outdated by now

#

as there was a time I was messing with all the gui stuff and buildtools 😛

bleak eagle
#

yeah no i'll try, i didn't think of it

#

it can be checked in either case, no?

wet breach
#

yeah it can be checked

#

you just might have to do it differently if its a jvm flag though

bleak eagle
#

i'll see if jopt picks it up first

wet breach
#

yeah see if it does

eternal night
bleak eagle
#

i haven't been able to find any doc about the nogui flag being part of the jre

#

it's all minecraft specific

eternal night
#

Frostalfs memory might be playing a trick on them

bleak eagle
#

yeah if i just google "nogui flag java" it throws only minecraft server forum posts at me

slender elbow
#

yeah there is no such "nogui flag provided by the jvm"

eternal night
#

Which puts you back into your original dilemma

slender elbow
#

at best i guess you have java vs javaw on windows but that is slightly different

bleak eagle
#

i hate java i hate java i hate java

eternal night
#

Nah, hate build tools for making decisions before parsing flags

slender elbow
#

^ ultimately it's up to the program to display a UI or not

bleak eagle
#

yeah right i'll go with my original plan of switcherooing it

eternal night
#

Probably a smart idea yea

wet breach
#

I was just going through a list of all the stuff in the JVM

slender elbow
#

that's a lot of stuff

echo basalt
#

(I was deadlifting)

bleak eagle
#

darn i was just expecting you to talk about eating a big mac or something

slender elbow
#

lol

torn shuttle
#

I need to get back into deadlifting

wet breach
river oracle
wet breach
#

well its more of a system property

river oracle
#

Why do we want to start the gui from command line do it the right way and make a jar launcher

#

It's not hard it's just a .desktop file

wet breach
#
//how to set it in code or retrieve it
System.setProperty("java.awt.headless", "true");
//how to set it on the command line
-Djava.awt.headless=true
#

now, I don't remember if nogui just made it more convenient or not, I would have to look in the code of some older versions and possibly the jvm but that will be for some other time lol

remote swallow
#

iirc the nogui on spigot is added by spigot

ivory sleet
#

^

wet breach
#

because setting the system property should make it global to not run any GUI thing

river oracle
#

I think he is referencing the BTGUI which simply reads from the flag

#

The server works as intended

torn shuttle
#

man I am too tired for this code right now

torn shuttle
#

I wrote myself into a corner

river oracle
#

And for the gui there is no nogui flag because it only runs when you double click it which is intended to preserve old behavior. The real solution to their question is to make a jar launcher on Linux which is not hard to do

torn shuttle
#

real quick if I want to use a class that has initialization and public methods and I need it to work in a multimodule context where each module has a similar but different implementation what should I be looking at

#

I feel like it has to be interface or an extension

#

interfaces don't have initializing methods though right

#

oh yeah I should mention that basically one module holds the object just so I can standardize the methods but each module has different code for how the methods work

bleak eagle
#

it's aliiive

torn shuttle
#

does it have to be extended?

#

maybe there's a generics solution I'm not thinking of?

bleak eagle
#

also this just forces your jre to identify itself as headless which is slightly different