#help-development

1 messages · Page 1254 of 1

undone axleBOT
modern crown
#

Ok

#

Thanks

vital sandal
#

is there any event detect when player is charging for horse jump event ?

viscid maple
#

hey how to create npc on netty packets?

brazen badge
#

I'm working on a bot detection system for my Minecraft server using Machine Learning (ML) and Deep Learning (DL). The goal is to analyze player behavior in real-time to identify suspicious activities like automated movements or clicks that indicate bot behavior.

  • Running ML/DL inference directly on the Minecraft server can negatively impact performance, especially during high traffic or bot attacks.
  • I'm considering using asynchronous operations to offload computations and prevent blocking the main thread, but I’m not sure if it will be scalable or effective under heavy load.

What is the impact of running ML/DL models in real-time on a Minecraft server? Are there specific considerations for minimizing latency and maintaining server responsiveness? Is using asynchronous operations enough to prevent performance degradation during inference, or are there other techniques (like parallel processing or batching) that can help? Would offloading inference to an external server or cloud be a better solution for scaling this system?

Thanks in advance!

thorn isle
#

works entirely the same in the context of minecraft as it does with anything else

#

you definitely don't want to run your inference on the main thread, that much is obvious; but other techniques or doing things asynchronously aren't any different from any other, minecraft-unrelated, use case

#

entirely depends on the hardware available and the size of your model

#

try it and see basically

sly topaz
#

machine learning for bot detection sounds like a terrible idea, you'd have better luck just making a plugin which detects certain heuristics that are common to bots

thorn isle
#

it's been done before, iirc it was matrix or something that did it

rough drift
thorn isle
#

it was completely unusable and allowed people to killaura one another through walls

blazing ocean
#

10/10 force pushed straight to prod

sly topaz
#

but in practice, it sucks balls

#

detecting good kill aura is hard no matter the technique, so I can understand that but bot detection? I don't think that's ever been a problem in minecraft servers

#

at most you'd have players using that one mod that automates building, but that's mostly a non-issue

#

what is with all the different distributions

blazing ocean
#

jetbrains🤔

#

I have no :jbthink: so that'll do

sly topaz
#

I know the with JCEF one that embeds chromium, don't know what fastdebug for it means though

#

then there's JBR FreeType, which last I knew is just a font renderer?

blazing ocean
#

kekw

#

JBR is also required for a custom window bar for jewel, so who knows

#

I don't think this is ideal is it

sly topaz
#

so much for handling the exception kek

blazing ocean
#

I love stackoverflows!

sly topaz
#

if all your exceptions are meant to be rethrown for some reason, go ahead

#

many programs do that out of convenience, I am unsure of the benefit there though

blazing ocean
#

in my tick loops and everything for game instances I have try/catches for GameInstanceException s which stop the instance immediately

#

I should probably just use the same logic in there

sly topaz
#

as long as your engine doesn't depend on exceptions to be stopped, that sounds fine to me

sly topaz
#

but unless you're looking at JVM bugs, that's just not necessary, so I guess that answers my question

blazing ocean
#

does this look good

thorn isle
#

apart from the language

rough drift
blazing ocean
#

I was moreso asking javier but okay

#

what game do I make for an example plugin

pseudo hazel
#

what in the generics is that

#

also why do you not have a game to make for your own library

#

make bedwars

blazing ocean
#

hmm sure

pseudo hazel
#

or manhunt

#

idfk

blazing ocean
pseudo hazel
#

or recreate yesterdays update

blazing ocean
#

I don't think a lot of that is possible from just the server-

pseudo hazel
#

but a lot of it is

#

what isnt possible

blazing ocean
pseudo hazel
#

well im not saying you gotta make all the menus exactly the same

#

just make an approximation

blazing ocean
#

maybe

pseudo hazel
#

idk just giving ideas

blazing ocean
#

I think I'll go with bedwars for now

pseudo hazel
#

yeah

blazing ocean
#

just need to make an actual schematic API now-

pseudo hazel
#

if its to show your library

#

make a simple and or well known game

viscid jetty
#

hey, Can you help me to resolve my problem?
When i dont send a Packet my Scoreboard appear but if i send a packet my Scorebord disappears... idk why
I want set a Texture/icon on my Scoreboard with my ressourcePack

public class ScoreboardTest implements Listener {

    private final ProtocolManager protocolManager;

    public ScoreboardTest(ProtocolManager protocolManager) {
        this.protocolManager = protocolManager;
    }

    @EventHandler
    public void onPlayerJoin(PlayerJoinEvent event) {
        Player player = event.getPlayer();
        createBasicScoreboard(player);
        sendCustomTextPacket(player);
    }

    private void createBasicScoreboard(Player player) {
        ScoreboardManager manager = Bukkit.getScoreboardManager();
        Scoreboard board = manager.getNewScoreboard();
        Objective objective = board.registerNewObjective("Test", Criteria.DUMMY, ChatColor.RED + "Test");
        objective.setDisplaySlot(DisplaySlot.SIDEBAR);

        TextComponent textComponent = new TextComponent();
        textComponent.setText("\u0037");
        textComponent.setFont("customfont:images");

        String jsonMessage = ComponentSerializer.toString(textComponent);

        objective.getScore("Test0").setScore(0);
        objective.getScore("Test1").setScore(1);
        objective.getScore("Test2" + jsonMessage).setScore(2);

        player.setScoreboard(board);
    }

    private void sendCustomTextPacket(Player player) {
        PacketContainer packet = protocolManager.createPacket(PacketType.Play.Server.SCOREBOARD_OBJECTIVE);

        packet.getStrings().write(0, "Test");
       packet.getChatComponents().write(0,WrappedChatComponent.fromJson({\"text\":\"\u0037\",\"font\":\"customfont:images\"}"));

        try {
            protocolManager.sendServerPacket(player, packet);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
pseudo hazel
#

yeah thats p much a given for any minigame framework

blazing ocean
#

?paste please

undone axleBOT
pseudo hazel
#

or, you know, just depend on world edit to do it for you

blazing ocean
#

I'll be using FAWE for it yea

#

I haven't played bedwars in years this is gonna be annoying

sly topaz
#

the concept is pretty simple

pseudo hazel
#

i know you arent creative (since those are your own words) but you dont have to carbon copy bedwars xD

#

just make something up as you go

sly topaz
#

I mean, all there is to bedwars is 3 type of generators, a base which you have to protect, an item shop and an upgades one, in essence

#

everything else is up for interpretation

blazing ocean
#

wait what, abstract events don't need handler lists do they

Error while registering listener for event type class net.radsteve.axi.game.instance.event.GameInstanceInitializeEvent: org.bukkit.plugin.IllegalPluginAccessException: Unable to find handler list for event net.radsteve.axi.game.instance.event.GameInstanceEvent. Static getHandlerList method required!
public abstract class GameInstanceEvent<T : GameInstance<T>>(
  /** The associated game instance. */
  public open val instance: GameInstance<T>,
) : Event()

public class GameInstanceInitializeEvent<T : GameInstance<T>>(
  instance: GameInstance<T>,
) : GameInstanceEvent<T>(instance) {
  override fun getHandlers(): HandlerList {
    return HANDLER_LIST
  }

  public companion object {
    @JvmStatic
    private val HANDLER_LIST: HandlerList = HandlerList()

    @JvmStatic
    internal fun getHandlerList(): HandlerList = HANDLER_LIST
  }
}
sly topaz
#

wonder if it is because it is marked as internal

blazing ocean
#

internal is public on the JVM

#

okay well fuck you

sly topaz
#

lol

blazing ocean
#

it is public, but it gets mangled

#

yep that fixed it

acoustic pendant
#

How do anti cheats detect hacks like baritone? Macro type

Big changes of yaw or something like that?

sly topaz
acoustic pendant
sly topaz
#

well, that kind of mod is easily detectable if they do things like you mentioned

blazing ocean
#

what if I can just do huge turns of my mouse really precisely

sly topaz
#

then sorry not sorry, gotta send an email to server owner with video proof of your amazing minecraft turning abilities

drowsy helm
blazing ocean
#

@john hypixel

sly topaz
#

jokes aside, ideally you'd have more than a single heuristic to detect the hack

drowsy helm
#

Im sure theres many small things they check

sly topaz
#

I don't think anyone here has built an anticheat recently but in essence it is all they do, build heuristics which closely check player behavior for anything in the extremes

#

your best bet is trying out the hacks for yourself and checking what are obvious tells of its behavior, and check if they're detectable from the server side

acoustic pendant
#

But that could be bypassed if the hack is pressing w

acoustic pendant
blazing ocean
#

it is!

shadow night
#

**@**jvmstatic moment

blazing ocean
#

imagine I pasted that without a codeblock

shadow night
#

One guy in NeoForge did that once

#

Guess why I know that

blazing ocean
#

haha

shadow night
#

Their reaction was also something like "wtf why did that ping someone" lmao

acoustic pendant
#

Unless heuristic is something amazing I don’t know

thorn isle
#

there was a guy named eventhandler or something here at one point

#

looks like he's finally realized to change his username

shadow night
#

Lol

sly topaz
#

you'd pile up these heuristics until they reasonably detect the behavior in question reliably, notwithstanding the false positives

acoustic pendant
#

I see

#

So it depends on the previous user behaviour to know if they are cheating or is it in general?

drowsy helm
#

Typically in a given session

#

Are you trying to make your own anti cheat?

lone sorrel
#

Hello quick question trying to learn NMS and using ProtocolLib for 1.21.1 to open a window. Im trying this packet.getModifier().write(1, MenuType.GENERIC_9X3); but it throws Cannot cast org.bukkit.craftbukkit.v1_21_R1.inventory.CraftMenuType to net.minecraft.world.inventory.Containers if i try MenuType from net.minecraft.world.inventory.MenuType i get a java.lang.ClassNotFoundException: net.minecraft.world.inventory.MenuType Is there someone that could point me in the right direction? thank you

sly topaz
lone sorrel
#

Nope just attempting to learn honestly but i want to work it out im just confused

sly topaz
#

MenuType is a pretty recent API addition, probably not what ProtocolLib is looking for

#

if you want to know what kind of elements a packet wants, your best bet is listening to the packet in question and printing all the relevant information

#

that and also checking the minecraft wiki for documentation on the protocol

lone sorrel
#

public MenuType getType() { return this.type; }

acoustic pendant
#

But seems like a task I can’t do lol

drowsy helm
#

Are you using moj mappings?

sly topaz
drowsy helm
drowsy helm
drowsy helm
#

More Protocol Lib bullshit

sly topaz
#

I mean, anticheats aren't a particularly hard task, just very tedious as you have to spend a lot of time refining the heuristics, and making sure the restrictions it imposes don't negatively affect the experience for your players

thorn isle
#

ncp forever

sly topaz
#

something most of the free ones get wrong is not taking latency into consideration so it ends up being shitty for anyone with more than 150ms of latency

drowsy helm
#

*if you want to stay on top of cheaters

#

Still fun to learn though

polar forge
#

i get this error while testing this plugin

chrome beacon
polar forge
#

how do i fix it

chrome beacon
#

check if it's null before using it

polar forge
#

how do i do it

#

thats the issue im facing

chrome beacon
#

?learnjava

undone axleBOT
#

For Beginners:

Codecademy - Learn Java: Interactive Java programming course from basics to more advanced concepts. Perfect for absolute beginners.
https://www.codecademy.com/learn/learn-java
JetBrains Academy - Java Developer Track: Learn by doing with projects and challenges. It covers Java fundamentals to advanced topics.
https://www.jetbrains.com/academy/
Udemy - Java Programming Masterclass for Software Developers: Updated courses that cover Java 8 to Java 17 features. Suitable for those who prefer structured learning.
https://www.udemy.com/course/java-the-complete-java-developer-course/

For Intermediate to Advanced Learners:

Oracle Java Tutorials: The official guides by Oracle for Java programming—great for understanding the depth of Java.
https://docs.oracle.com/javase/tutorial/
Baeldung - Learn Java and Spring: Focus on Spring Framework and modern Java technologies. Best for intermediate learners aiming to expand their knowledge.
https://www.baeldung.com/

Practice and Hands-on Learning:

Exercism - Java Track: Solve exercises and get feedback from mentors. Great for practicing coding skills.
https://exercism.io/tracks/java
LeetCode: Practice your coding skills and prepare for technical interviews with Java.
https://leetcode.com/

Free Resources and Documentation:

Java Programming and Documentation: A comprehensive collection of Java programming guides, tutorials, and API documentation.
https://docs.oracle.com/en/java/

Community and Support:

Stack Overflow: A vast community of developers. Great for getting help with specific problems or understanding concepts.
https://stackoverflow.com/questions/tagged/java
r/learnjava on Reddit: Join the community of Java learners and get advice, share resources, and discuss projects.
https://www.reddit.com/r/learnjava/

Remember: Learning to program takes practice and patience. Don't hesitate to experiment with code and participate in community discussions. Happy coding! 🎉

polar forge
#

like literally

chrome beacon
#

You're asking how to make an if statement to check if somethings null

polar forge
#

i know how to do it

chrome beacon
#

Then why are you asking how

polar forge
#

but idk what to place before the = sign

blazing ocean
slender elbow
#

if (thing is null)
don't do the thing
else
do the thing

#

that'll be $30

polar forge
#

what is thing

slender elbow
#

date

#

or something idk

chrome beacon
#

the thing you want to do

blazing ocean
polar forge
#

expiration date, i dont see any string called date

#

thats why im asking

chrome beacon
#

It's not a string

#

it's a date

slender elbow
#

check the stack trace

#

handleIsPlayerBannedCommand

#

line 73

chrome beacon
#

that too

polar forge
#

i know where the issue is

slender elbow
#

you are passing null to the format method

#

check that the thing you pass is not null before passing it

polar forge
#

i didnt even want to show the expiration date

#

so ill just remove it

manic delta
#

Is it possible to send players to another server (on the same network/proxy) from spigot?

sullen marlin
#

Yes via plugin messages

sly topaz
#

would the Player#transfer method achieve the same thing or is that not supported by bungeecord

#

also, are cookies passed around properly when using plugin messages to transfer?

#

ig since it is stored in the client it should

drowsy helm
thorn isle
polar forge
#

Ok

urban cloak
#

i assume when it uses the traditional approach it doesnt pass cookies+

thorn isle
#

cookies are retained until the client goes back to the server list screen, basically

#

a player connected to a bungee proxy is always connected to the "same server" and so will retain cookies set, no matter which backend they get forwarded to by the proxy

#

transfer packets are different in that they count as a different session (e.g. will fire handshaking/auth logic again) but connections triggered by a transfer packet are treated specially by the client in that cookies are retained

sly topaz
thorn isle
#

none of which you can really use if you transfer the player off the bungeecord proxy onto some other server

#

all of that communication relies on the player being connected to the target server through bungee; the data piggybacks on the player's own connection between the proxy and the backend

restive mango
#

I'm having some trouble with config files. When I initially create my config file, it has all these headings:

'Prophecy Texts:
Crimson Comet Start Location:
Crimson Comet End Location:
Crimson Comet Start Time:
Crimson Comet End Time:
Sunlight Splash Ticks: 50
Moonlight Splash Ticks: 50
Crimson Comet Regen Ticks: 120
Voidlight Wither Ticks: 70
Darklight Blindness Ticks: 70
Sunlight Lore:
Moonlight Lore:
Crimson Lore:
Voidlight Lore:
Darklight Lore:
Undersunlight Lore:'

However, after I run the following code:

List<String> prophecies = this.getConfig().getStringList("Prophecy Texts");
prophecies.removeIf(t -> Long.parseLong(t.split(" ")[0]) < System.currentTimeMillis());
this.getConfig().set("Prophecy Texts", prophecies);
this.saveConfig();

The file becomes

'Prophecy Texts: []'

losing all the other headings. How can I fix this?

#

I assume it's something saveconfig related

#

but idk

#

If I save a bit of text into the config file, the text gets overwritten, is that normal behavior for saveconfig!?

#

@ancient plank

ancient plank
#

aeso why do u ping me

#

u can just ask in the staff discord

restive mango
#

because you are the answer to my problems

#

yeah but i didnt think that far ahead

young knoll
#

I wonder if the empty values get parsed to 0

ancient plank
#

I haven't used spigot's built in yamlconfig stuff in a while

restive mango
#

well no, because even the values with numbers get deleted @young knoll

#

i could recheck and reset all the config values but i feel like that is nuts

ancient plank
#

that's just an aeso moment

wet breach
restive mango
#

not entirely true

remote swallow
#

If it's a list []

young knoll
#

Well all those values with numbers are certainly less than currentTimeMills

wet breach
#

seems the problem has been identified

restive mango
#

no

#

they're all wrong sadly

wet breach
#

right

#

have fun with that

#

yaml is not new

#

neither are we

#

but hey if you know the problem not sure why you came here 🙂

dapper night
#

so what file is better

wet breach
#

file?

dapper night
#

format

wet breach
#

depends on your needs, what is easier for you, and preference

#

in regards to plugins, any format just about will do

#

xml, ini, yaml, toml, hcl

#

doesn't matter really what you choose, except maybe who ever uses your plugin I suppose

restive mango
#

right so for those who want the real answer, you can just set copydefaultvalues to true in the config options, to avoid the nulling you do need to add a placeholder

wet breach
#

it was specified earlier to use a default value as well

#

and then for the values set, well you ended up in the end setting it to empty values

#

since in the beginning you obtained empty values

#

anyways, not sure why you are here asking for help in the end though if you know what is wrong all along

paper viper
#

is there a way to create void worlds faster? I'm currently using WorldCreator with void generator and it's pretty slow for generating minigame arenas tbh

#

it takes a few seconds and the server lags

#

or should i just use a void world template instead

#

and copy and paste it

young knoll
#

Set keep spawn in memory to false

#

And set a fixed spawn location

sly topaz
#

keeping a void world and just copypasting it is probably better though, that way you don't have to worry about generation

paper viper
#

would i have to recreate a new void world for each version

#

hmm

#

i could have something where it creates it for each new server version in a folder

#

and just uses that as a template to copy and paste

#

but is keep spawn in memory false + fixed spawn location fast enough?

#

going to test right now

#

wish i could do it async because its an io operation

buoyant viper
#

i feel like some amount of fuckery could be done

ivory sleet
#

biggest issue is that there might be some async catcher sitting deep down in the implementation (speculative) else fuckery would be allowed

sharp flower
#

looking for a plugin developer(willing to pay)
Dm me

undone axleBOT
sharp flower
smoky anchor
sharp flower
#

ok

dreamy glade
#
player.setOp(true)
// Do something
player.setOp(false)

Is this really dangerous, or is it just a myth? If it is dangerous, has there ever been any proof of concept for the potential exploit?

chrome beacon
#

Yeah that can be a bit dangerous

#

but sometimes you don't really have a choice

#

put that set op false in a try finally

#

to make sure it always runs

dreamy glade
#

Literally everyone agrees on that but i am yet to see any poc

#

If that really exploitable, if would been a disater already. I saw many wide-used plugins still doing that and nothing ever happened

#

Assuming the "do something" part never fails.

chrome beacon
#

Which it can

dreamy glade
#

The only thing that may happen is the host machine blacked out before player.setOp(false) is executed.

ivory sleet
#

depends on what //Do something is

ivory sleet
wet breach
#

do you need a proof of concept of using the command op in how a person you op has the ability to do just about anything they want?

dreamy glade
jagged thicket
#

tbh

dreamy glade
wet breach
dreamy glade
#

and clean up op list on server start

umbral ridge
#

what are unvetted jars

wet breach
#

otherwise their only alternative is to somehow be allowed to use the command to op or to spoof uuid (only happens on offline mode)

wet breach
umbral ridge
#

that wouldnt be a problem if you make everything by yourself

#

XD

wet breach
#

not even for yourself

wet breach
#

its fine if you are initially making stuff

#

but afterwards you should avoid ops

umbral ridge
#

yes

dreamy glade
wet breach
#

making use of permissions instead allows you to reduce the amount of damage someone could do and forces them to have to take over your account to make it possible if we are not factoring offline mode

dreamy glade
#

For now I just write a plugin that check all command events

#

Even op can't execute commands unless they somehow gained access to my username and masked my ip

wet breach
#

except you are managing a list of ops. Someone opped can op other people and bypasses basically all checks

#

online mode is indeed harder but not impossible

dreamy glade
#

how can they bypass the checks if they are hardcoded?

wet breach
#

because you are not controlling the server

dreamy glade
#

the plugin literally change the command behavior

wet breach
#

at least not directly

dreamy glade
#

they can't change that

wet breach
#

except you are ignoring the jar route 😉

#

jars can override what you have done unless you changed the server code itself

#

anyways, its your server if you don't care about the dangers I see it pointless to be asking about it

slender elbow
# dreamy glade If that really exploitable, if would been a disater already. I saw many wide-use...

it seriously depends on what Do something really is, generally speaking player connections are ticked and packets are processed at the beginning of a tick loop, but there are times during a server tick where packets can be processed too; if your //Do something happens to trigger some code that lets the server process packets mid tick-loop, the player's packets will be processed while the player is op, meaning they can do anything as they are op; but again, it really depends on what the "Do something" actually does

#

it's definitely possible

thorn isle
#

executeMidTickTasks comes to mind, iirc triggered by sync chunk unloads, not sure if it processes packets though

slender elbow
#

anything that calls the managedBlock method

#

it's generally around chunk loads yes

sly topaz
#

while possible as in anything is possible, the probability of it actually happening is extremely low. Reason people don't bet on it is because permissions exist

thorn isle
#

in practice though i think this should be mostly safe as long as you remember to de-op in a finally block, at least i don't remember ever hearing of anything going wrong with this despite this being a fairly common thing to do

sly topaz
#

it just comes down to principle, like using the same password on every site

#

sure, it works and you'll probably never get hacked, until it does happen

eternal oxide
#

password1234

thorn isle
#

if you really want to make it watertight, you could add in a pre command process listener that permits only and exactly the expected command through

#

i doubt anyone really does this though

orchid brook
#

I have an economy plugin and i want to use the same database across two servers. Should i introduce a slight delay before loading the player's economy data from the database when they connect, in order to prevent fetching outdated values if the data hasn't been saved yet when the player disconnected? I'm saving the data in an async task when the player disconnects, that's why I'm asking if I need to add a small delay before loading the data. I imagine this could cause issues if the player disconnects from server A and connects to server B quickly.

eternal oxide
#

yes you will need to wait for fresh data

#

cross server transfers are very fast (bungee)

orchid brook
#

is 5L is enough ?

eternal oxide
#

it will vary

#

There is no way to know how long it will take as there are too many variables

orchid brook
#

Ok so i need to try and see

#

is there a better way that i didn't know instead of putting delay before fetching the data ?

eternal oxide
#

redis

#

or wait

thorn isle
#

whatever database scheme supports locking columns

#

redis is a good way for synchronization/communication as well

orchid brook
#

So using redis to cache the player economy and save it into mysql every X time. And when a player connect if he is not in the redis i fetch the mysql data to add him ?

thorn isle
#

i personally dislike redis as a key-value store, it seems awfully underbaked for it

#

i mostly use it just for pubsub messaging

orchid brook
#

Oh yeah i can just stay with mysql and just use pubsub to send the player econnomy stored in my K V Map from server A to the K V Map from server B right ?

thorn isle
#

that works, or you can use the pubsub messaging as a "cache synchronization" system much like in processors; "i need this data" -> server owning the data pushes the data to main memory (mysql) -> sends "data is up to date" -> server(s) needing the data fetch it

#

or you can instead of saving it to the main storage send it via a pubsub message as you described too, that works as well

orchid brook
#

This seems the simplest to me.

thorn isle
#

should work

#

just need to be wary of races where the client gets tossed around multiple servers faster than the redis messages can keep up

#

e.g. you might have a player going from servers A -> B -> C, and B ends up sending the kv map to C before it gets the real kv map from A, and you end up with bogus data

#

a way that doesn't require messaging at all and is maybe the most robust is to have an extra column in your data for exclusive lock; as long as the row is held by another server, other servers will consider the row stale; and a server first has to atomically mark itself as the row's exclusive owner before loading it into the cache

#

this has problems with server crashes where the server holding the lock never releases it; throw timestamps at it to recover

#

or use redis, or use database synchronization primitives, or 🤡 well, fuck around with it, synchronizing a cache reliably and effectively across multiple machines is far from trivial

orchid brook
#

When a player disconnects from Server A, i save their data to MySQL asynchronously After that, Server A send a signal to the other servers that the data is updated like an update notification (Pub/sub) with the data saved. Server B receive the message and use the data send by server A ?

thorn isle
#

yes, that's probably the simplest way of doing it

orchid brook
#

So in the end it comes down to the same as putting a delay before fetching the data, but in this case with redis I know exactly when the data has finished saving so i don't need to worry about putting 5L delay or 15L or 20L

thorn isle
#

pretty much yes

orchid brook
#

okay i think i got it

thorn isle
#

though with messaging there's always the consideration of messages not getting sent or getting lost on the network

#

so you'll want to pair that with a wait still, maybe 30 seconds

orchid brook
#

my redis server is on the same host of the server so that fine ?

thorn isle
#

so if you don't get a "data is saved" message by then you assume the server responsible for it died or something broke somewhere and just load whatever is in the database

#

well... the server the player comes from might crash before it's done saving

orchid brook
#

oh u mean if the server crash for example

#

oh okay yep

thorn isle
#

don't want to permanently deadlock the player if that happens

orchid brook
#

I got it thank u very much ! will try that right now

sly topaz
orchid brook
sly topaz
#

ah I misunderstood the problem, you were having issues synchronizing the data while transfering players, I was thinking reconnection

#

if that's the case, yeah then Redis is usually the choice people use for that scenario

#

though distributed caches are a pain in the ass in their own merit, it's the easiest choice

#

it's either that or having a shared database, which for each one of those, a systems engineer cries in the morning

orchid brook
#

and what about only use redis as database since redis have persistence also. I can store all data in redis and when the player go in server B since there are using the same redis i don't need to worry about synchronizing

restive mulch
feral bay
#

a user on a redis ?

#

is that a thing ?

restive mulch
#

(don’t skid just view and read to understand, then try to make your own version :))

orchid brook
#

this plugin use pubsub systeme like we say above

sly topaz
#

if it is a network one, you're pretty much in the same place whether you use redis or mysql

orchid brook
sly topaz
#

ah, you're hosting the database on the same machine as the servers?

orchid brook
#

yep

sly topaz
#

if that's the case, I don't see how mysql could be so slow as to not receive the write before the player switches servers, have you measured your write speeds?

thorn isle
#

process to process communication isn't instant either but it's considerably faster than network io

#

if this was for high frequency lookups like permission checks it'd probably be unacceptable, but economy which is probably called at most once or twice a tick is fine

orchid brook
sly topaz
thorn isle
#

same thing under the hood if it's on the same physical machine

#

when it goes out the socket that's when you see higher delays

sly topaz
#

yeah but the abstractions also can hurt quite a bit unless you have setup it in a way that's a non-issue

restive mulch
thorn isle
#

hypervisors are pretty good these days

#

but yeah there's probably some overhead

restive mulch
#

and don’t allow users to use the economy while in that loading period/state

sly topaz
thorn isle
#

and shared memory is probably out of the window, though i don't think plugins/redis would do that anyway

sly topaz
#

if it isn't fast enough, then you can probably play a little with the mysql settings in order to make it fast enough

orchid brook
#

yeap so little delay or just use redis as pub/sub

restive mulch
thorn isle
#

delays are a bit of a bandaid since there's no guarantee that disk io or whatever won't randomly be saturated because of some automatic backup or god knows what else at the exact time of transfer

sly topaz
#

I mean, if you wan to go the RDB route, that's fine too, just annoying as you'd have to migrate your data as well as your current code

sly topaz
thorn isle
#

the approach of sending a "i'm done saving the data" plugin/pubsub message from the server the player is transferring from, and then waiting for either that or a 10-30 second timeout on the receiving server, is probably the easiest solution

#

waiting as in blocking in the async player prelogin event

sly topaz
#

it also depends on how critical the data, and how you want to tackle issues such as crash of the server or even of the whole instance

#

if you can't afford to lose the data, then not writing to disk isn't much of an option

orchid brook
thorn isle
#

it'll get written to disk anyhow, the messaging is just to make sure we don't expect the write to conform to some magic timespan we pull out of the hat

#

because one day it won't and then someone loses their money

echo basalt
#

uh

#

what about a "I'm saving X data for Y player"

#

and then it just whatevers

thorn isle
#

mm yes

echo basalt
#

Ooor you can use a microservice and have everything go through that

orchid brook
#

hm u lost me lol

orchid brook
echo basalt
#

No because we don't wait as much

#

Instead of waiting for the save to go through we tell in advance what we're saving with a lower latency

thorn isle
#

we're not really interested in when the saving starts but when it's done

echo basalt
#

eh.. why

thorn isle
#

to make sure we don't load stale data

echo basalt
#

we wouldn't be loading stale data

thorn isle
#

if you load before saving you won't get the saved data, yes?

echo basalt
#

we write to a low latency cache before writing to high latency persistent storage

#

we default to reading from that low latency cache before persistence

restive mulch
thorn isle
#

i really doubt a mysql transaction to save someone's economy balance is going to take more than 50ms

orchid brook
#

So i can send the data that is currently being saved to server B and use that data instead of send "data is finish save u can fetch it now" if i understand ?

thorn isle
#

not really worth throwing another cache in between

echo basalt
#

by low latency I mean like <3ms

#

(redis)

#

mysql takes as long as 1.5s to connect from my metrics

thorn isle
#

you'd presumably keep a persistent connection

orchid brook
#

or i can simply use redis for storing whole data with persistence also and use the same redis for both server 😂

echo basalt
#

or just have a microservice that saves to the db eventually

#

or use redisson locks

sly topaz
#

I haven't seen a transaction take more than a second in the same machine

echo basalt
thorn isle
#

connecting from scratch can take a while for sure

blazing ocean
#

I've had supabase take like 3s before 😭

sly topaz
blazing ocean
#

cloud

sly topaz
#

well, that is understandable, there's no telling the environment in that scenario

thorn isle
#

yes put your economy data in the cloud

blazing ocean
#

well that was for very different data

echo basalt
#

we're exclusively cloud hosted at "work"

blazing ocean
#

and the connection wasn't even a bad one 😭

sly topaz
#

put your data in the cloud and let copilot vibe your sql queries

echo basalt
#

because planetscale ooooo reliability

thorn isle
#

my data is in a box in the basement

blazing ocean
sly topaz
echo basalt
#

we pay the whatever

#

40 bucks a month

#

(which makes no sense)

blazing ocean
#

what even is planetscale I don't remember

echo basalt
#

sql

#

but like fancy sql

thorn isle
#

you can have my box in the basement for 2/3rds of that

blazing ocean
#

$40/month for fancy sql is crazy

orchid brook
#

so should i use only redis for saving all data with persistence and connect both server to same redis or use mysql -> redis as pubsub or use ecloud / copilot ?

echo basalt
#

autoscales

blazing ocean
#

just set up kube

echo basalt
sly topaz
thorn isle
#

i still think a simple "data on remote is up to date" message on save and then blocking for that or a timeout on join is the simplest solution while being decently robust

sly topaz
#

otherwise redis pubsub and mysql

echo basalt
#

ram sink

#

just make a microservice that has proper locking

#

and a local cache and whatever

thorn isle
#

the nice bit about this is that you can throw it on the lowest priority in the async prelogin listener and all of your database reads will read up to date data out of the box

sly topaz
#

they're hosting all on the same machine illusion

thorn isle
#

without any migrations or code changes or whatever

orchid brook
echo basalt
#

microservice isn't exclusively about latency

thorn isle
#

you pinknames and your microservices

#

smh

echo basalt
#

shut up non

sly topaz
#

microservice arch only works if it isn't hosted in the same place though

blazing ocean
#

what about megaservices

eternal night
#

what about cutie services

echo basalt
#

that's a me

blazing ocean
#

no that's a me

sly topaz
orchid brook
#

i dont realy know if redis persistence good enough

sly topaz
#

honestly, you could use a sqlite database for a minecraft server and that'd get you far enough in most cases

orchid brook
#

so i can’t use sqlite

sly topaz
#

if you are planning to shard the server, as long as you have a separate instance for redis, it should be fine

#

then again, I see no benefit in using something like redis instead of whatever sql database if it is gonna end up sharded tbh, but I haven't used redis that extensively to tell you for sure how well it scales in this scenario

#

from what I've heard, it does just fine, so ultimately it isn't a bad choice

#

you'll have to figure out things like doing microservices if latency ends up becoming an issue, but that's that

orchid brook
#

sql is good

#

since we are on the same machine sql should be fine also for sharding ?

sly topaz
#

the issue with redis would be the fact that it is just a KV, so there'd be no structure on the data other than the player <-> balance relationship or similar, you'd have to rethink how you save your data in order to have things like total server balance, as you can't just do SELECT * FROM economy_balance

#

in the case of balance itself, it isn't nowhere near as much of an issue as you'd mostly care about the player <-> balance relationship, which is in fact just a KV, so a column-row approach provides little benefit, but when it comes to different type of data where you want to have more than a singular relationship, it starts becoming less than ideal, if anything

#

you'd also have to account for the fact that redis puts everything on memory, meaning the larger your server gets, the more memory it'll hog from your instance, mainly why people only prefer it as a distributed cache rather than their main storage

#

there's also completely different, middle-ground choices like mongodb but I don't have as much to say in that area as I don't actively play with those

thorn isle
#

(it's web scale)

#

it all depends on your access patterns

#

if you need multiple servers doing low-latency writes (like say doing shop sign transactions on the main thread) there basically is no winning move and you're just fucked and need to redesign your system

#

if there's only one low latency writer (presumably the server the player is on) that is doable

#

if other servers need to also read that data and maybe do atomic transactions on it, you need to get into muh cache coherency bullshit

#

if other servers only need to read relatively up to date data, like say /bal on a player on another server, that's doable without anything complicated

feral bay
#

im not a dev btw

#

just following this topic

thorn isle
#

that's called a ledger and yes that's a valid technique

sly topaz
thorn isle
#

but the issue with a ledger is that you typically want to modify it atomically which is a no-no for a remote db + main thread access because you will end up blocking

paper viper
# sly topaz yes

actually i just realized that i'm still teleporting the player right after the world created so its no use either way... should i use paperlib and use teleportAsync?

sly topaz
#

paperlib's teleportAsync just delegates to normal teleport on spigot as far I am aware

sly topaz
feral bay
#

do you mean ram when you say memory ?

paper viper
thorn isle
paper viper
#

probably because of worldguard, multiverse, and other plugins combined i feel...

thorn isle
#

and that data set is unbounded and potentially thousands of players

paper viper
#

i dont know tho

sly topaz
thorn isle
#

and when you add to it something more complicated than just a number, it gets out of hand real fast

sly topaz
#

and yes, I do mean ram when saying memory

thorn isle
#

e.g. imagine storing the inventory contents of 10,000 players in memory

orchid brook
#

im gonna stick with sql for everything

feral bay
orchid brook
#

because i use lot of relational query like query all generator from generator table attached to a player

feral bay
#

unless you have 10k players

thorn isle
#

players accumulate over the years

feral bay
#

yes but for a server with resets each 3 monts ?

#

its more than fine to use redis?

thorn isle
#

even a server with 20 concurrent players tops can easily have 10,000 historical players

feral bay
#

if you only need the data for 3 months and reset everyone each 3 months

sly topaz
feral bay
thorn isle
#

for economy alone, you probably won't hit any sort of measurable memory footprint until a few thousand players

sly topaz
#

if it is just economy, you'd probably not have to worry about it too much, it's just integers and player uuids

thorn isle
#

i know because i ran pex (which stores all permissions in a big bukkit yamlconfig) with ~10,000 players

#

now the maxbans name trie for the same number of users... that's almost a gigabyte

#

muh fucking 20-fold nested Map<Character, Map<Character, ...>> maps

orchid brook
#

even for a server that reset every 3 month using redis for everything for sharding is not good i think

#

for only economy yeah but sharding mean also inventory, location, etc

thorn isle
#

as an aside, if you're "sharding" on a single machine, maybe look into folia

#

that's basically that exactly

orchid brook
#

considering that u are sharding 2 miroir map that never change like spawn etc, you didnt need to store chunk etc and sync the map this can still be an issue using only redis

thorn isle
#

it breaks compatibility with most bukkit plugins but most major and popular plugins have support for it

#

and it's much smoother than do-it-yourself sharding on one machine will ever be

sly topaz
#

is folia in a state where you don' have to have a full-time developer working for you to utilize it now, I haven't touched the paper discord in a while

thorn isle
#

and you can use a single database and a single cache and not have to worry about cache coherence nonsense

thorn isle
#

depends on your plugins i suppose

orchid brook
#

i see lot of plugins work on folia

thorn isle
#

towny and slimefun and many others do support it out of the box, but smaller/spigot plugins might not

orchid brook
#

as soon that u are developping wholes plugin by yourself u can directly use folia anyway

thorn isle
#

eh well the api breakage is mostly around schedulers

ivory sleet
thorn isle
#

the diffs in towny were basically search and replace everywhere on Bukkit.getScheduler

sly topaz
#

I'd use folia even less if I were a server owner developing the plugins lol

thorn isle
#

but yeah that is absolutely right

#

just because it compiles doesn't mean its correct

sly topaz
#

it's time wasted making sure folia and the plugins behave correctly rather than actually improving the server

thorn isle
#

threading and concurrency are one of the hardest things to get right in programming

sly topaz
#

the traditional approach of having multiple survival instances works fine, players don't mind too much

thorn isle
#

yeah i don't really plan to move to folia either

#

i'll just throw async x and y patches at the server internals until it stops lagging to shit

#

next on the chopping block is the fucking entity tracker

quaint mantle
#

How does packet based vanish and unvanish work?

thorn isle
#

you first send packets as if the player had quit, i.e. destroy entity packet iirc, and then you suppress any outgoing packets pertaining to that player from reaching other players

#

since no information about the player is going out to the other players, they physically can't see the vanished player no matter how modified their client is

#

just "pertaining to that player" is a little bit nebulous; there are still ways to infer another player being somewhere by e.g. entity collisions, items being picked up, or chests being opened; those will have to be handled on the server, typically by cancelling the related events

sly topaz
thorn isle
#

yeah they basically do all this out of the box, minus the listen+cancel pickup/collision events

#

e.g. if a hidden player within view distance picks up an item, the item pickup packet is sent to destroy the item entity, and not knowing what to do with it (since the hidden player doesn't exist as far as it's aware) the client will assume that it itself picked up the item

#

playing the item pickup animation with the player itself as the recipient

paper viper
#

im not sure tbh

sly topaz
#

my bets are on the random spawn point methods still being called for some reason

#

you'd just have to start profiling, make the world and teleport, end profiling

paper viper
#

Yeah

sly topaz
#

or if you don't want to deal with profiling, you can try the copying worlds approach too

paper viper
#

i think the issue is the loading actually

#

im not sure tbh

sly topaz
#

then your only choice is profiling

unborn olive
#
      <dependency>
          <groupId>org.spigotmc</groupId>
          <artifactId>spigot</artifactId>
          <version>1.12.2-R0.1-SNAPSHOT</version>
          <scope>provided</scope>
      </dependency>```

Help, this is don't work
#

Dependency 'org.spigotmc:spigot:1.12.2-R0.1-SNAPSHOT' not found

#

It worked before

sly topaz
#

?nms

sly topaz
#

unless you didn't mean to use NMS, in which case just add -api to the artifact name and make sure you have the spigot repository in your repositories block

unborn olive
#

Thanks

quaint mantle
sly topaz
#

rather than not requiring them, they do't exist lmao

quaint mantle
#

True md_5

sly topaz
#

not that it couldn't be generated, but I doubt anyone cares enough to do that

quaint mantle
#

Although, it's quite interesting that they didn't pick 1.8.9 🤔

thorn isle
#

1.12 is a popular version because it's the last pre-flattening one

#

and iirc the chunk system performance got fucked hard in 1.13

sly topaz
slate siren
#

1.8.8

orchid brook
#

Javier did you already work with mongodb ?

trim lake
#

Why Im getting exception here? It shoudl cancel the task right<

new BukkitRunnable(){
            @Override
            public void run() {
                crateManager.spawnAll();
                respawnTask.cancel();
                respawnTask.runTaskTimer(QAdventure.instance, 0, configFile.getConfig().getInt("settings.timer-update-interval") * 20L);
            }
        }.runTaskLater(this, 20L);
thorn isle
#

cancelling the task doesn't make it eligible to be scheduled again i don't think

young knoll
#

^

#

Tasks can’t be reused

trim lake
#

oh, thats why.. so I will set it to null and create new one, that should do. Thanks a lot

ivory sleet
#

u can have like an internal runnable otherwise that u just pass to the bukkit runnable otherwise

young knoll
#

otherwise intensifies

tender shard
#

I got too many data classes called Data

#

GUIs suck

ancient plank
#

lol

tender shard
#

I remember the times when I hated on kotlin

#

lol I was so stupid

sullen marlin
#

Fkn Kotlin

ivory sleet
#

the invocation operator overloading in kotlin is my favorite, now any method can do anything from a semantic pov, how splendid (or should I say anything can be a method)

worldly ingot
young knoll
#

Player hashtag money

ivory sleet
#

oh its more like, if u have (equivalent in java)
String string = "wow";
string(); //this is overloadable

#

ofc that isnt valid java, but just to demonstrate ^^

sullen marlin
#

I dont get it

ivory sleet
#

Okay let's say we have some class
Parser parser = new Parser();

kotlin would allow me to turn parser into a function object (sort of)
so I'd effectively be able to call
parser() as a method, ofc this assumes that Parser.invoke() is defined some where, invoke() is not a normal named function mind u.

I think this is extremely obscure and one reason I avoid kotlin to some degree are due to these features that 3rd party libraries use limitlessly, u just dont know what the code does anymore, unless things are named extremely well

sullen marlin
#

so its kind of just a method with no name?

ivory sleet
#

yea

#

but it looks like parser() now is a function invocation

#

ik, quite confusing

blazing ocean
blazing ocean
ivory sleet
#

ive seen u use it 👀

#

like a lOOOT

blazing ocean
#

invoke? no

#

It makes code confusing to look at and will only allow you to go-to-definition whilst on the parenthesis

#

I use it like once in my game engine

blazing ocean
turbid crest
#

Hello 🙂 I'm writing my custom-made factions plugin, and have some data that I need to access a lot (factions data, players data, claims data). These are stored in a SQLite file.
Should I cache them in my plugin ?
If yes, what would be the best approach to cache them ?
If not, should I try using any other faster DB than SQLite ?

chrome beacon
#

Yes cache them

#

Player data for example can be loaded when a player joins. If you're querying a player that's offline you can keep it in a data structure like a map for a bit of time before unloading it

#

Libraries like Caffine can help with that type of caching

#

As for the db SQLite is fast enough

turbid crest
#

Thanks 😄

#

Also (unrelated), do you know of a good GUI library for 1.21 ?

summer scroll
#

I'm trying to create a minion plugin and here's the code on how I spawn the entity https://paste.md-5.net/matudurero.cs and I want to create a function to pick up the minion by shift + left clicking it. I've tried to use EntityDamageByEntityEvent and the event is not called when I left click (damage) the minion, probably because of the setInvulnerable(true) option, got any idea?

#

This is how I debug it.

    @EventHandler
    private void onDamage(EntityDamageByEntityEvent event) {
        Bukkit.broadcastMessage("Entity damage called");
    }
thorn isle
#

i think your only ticket is to listen to player interact event for left click air and raytrace for the entity in front of them

#

entity interact events only fire for right clicks

summer scroll
#

Found this on spigot forum but that's not the case right now. I'm using 1.21.4

#

Going to play around a little bit and might need to raytrace it manually.

smoky anchor
#

Other alternatives:
You could not have the marker be invulerable and instead disable damaging it manually via events
Or I believe the client still sends entity interaction packet, so you could check that

summer scroll
#

I decided to listen to PlayerArmorStandManipulateEvent, so shift right click to pickup the minion, need to use this because PlayerInteractEntityEvent doesn't get called.

fringe jetty
grim ice
#

yes

slender elbow
#

only if you are purchasing spigotmc for USD $5,000,000

#

otherwise, no never heard of 'im

sly topaz
#

I'm sure one could sell spigot for more if they really wanted to market it

jagged thicket
#

totally

#

ez couple 100k

eternal night
#

ah yes

#

100.000 > 5.000.000

jagged thicket
#

nah no one would buy it for 5 mil

#

(i aint counting zeros)

blazing ocean
#

of course everybody would buy it for less

eternal night
#

buying an open source project 5Head

blazing ocean
#

SPGT stocks stonks

sly topaz
#

I mean the site more so than the project

eternal night
#

the ROI gonna be wild when you get to chill on donations

jagged thicket
eternal night
#

mhm, people gonna love that

#

Also legally very fun

jagged thicket
#

standard google play, apple store cut btw

sly topaz
#

well yeah but those dominate their markets

eternal night
#

and have the fun advantage of being gatekeeper AF

sly topaz
#

spigotmc nowadays is just another player, albeit still a big one

eternal night
#

especially apple store

vast ledge
eternal oxide
#

If apple made a car, it would be electric and you'd have to tun it on its roof to plugin it in

blazing ocean
#

true

fringe jetty
#

how can i make my plugin working from 1.20 - 1.21.4

sly topaz
#

if it doesn't use any NMS, it may work just as is

sharp heath
#

Hello, although the codes are correct, shapedrecipes are not working on my server, can you help me?

wet breach
#

kind of a paradox in that statement don't you think?

sharp heath
#

I can send you the codes if you want?

#

I don't get any error messages but the recipes don't work

sharp heath
vast ledge
#

Something cannot be correct and not work

#

Send the code

#

?paste

undone axleBOT
sharp heath
#

It doesn't work in any plugin. It used to work but now it doesn't work.

vast ledge
#

Did you update recently?

sharp heath
sharp heath
#

1.16-> 1.19

vast ledge
#

Did you check if the way recipes are handled changed?

vast ledge
#

(Not sure if required) Did you update the players recipe?

sharp heath
#

I guess I did whatever was necessary

sharp heath
vast ledge
#

Loop through online players and run discoverRecipe

#

Check if that fixes it

#

Or, if you're not loading recipes while players are online, add discoverRecipe to the join event

sturdy viper
#

hello can someone help me with Orebfuscator i downloaded it but it doesnt work dm me if you can help me

slender elbow
mortal hare
#

Software architecture question:

let say i have class which manages object references by creating specific implementation of objects themselves, thus enabling to have parse dont validate approach of not having to check validity of the player object if it was passed like a parameter;


public interface Player {
  void sendMessage(string text);
  void unregister();
}

public class InMemoryPlayer implements Player {
  private final Map<UUID, Player> players;

  public InMemoryPlayer(Map<UUID, Player> players) {
    this.players = players;
  }

  public void sendMessage(string text) {
    // ...
  }

  public void unregister() {
    this.players.remove(this);
  }
}

public interface PlayerManager {
  Player addPlayer(UUID id);
  Player getPlayer(UUID id);
}

public class InMemoryPlayerManager implements PlayerManager {
  private final Map<UUID, Player> players = new HashMap<>();

  public Player addPlayer(UUID id) {
    if (this.players.containsKey(id)) {
      throw new IllegalArgumentException("Player with id: " + id + " is already added to the player manager");
    }
    return this.players.put(new InMemoryPlayer(id));
  }

  public Player getPlayer(UUID id) {
    return this.players.get(id);
  }
} 

this looks neat, also syntax is cleaner since you can do:

PlayerManager manager = new InMemoryPlayerManager();

Player player = manager.addPlayer(playerId);
player.sendMessage("Hello!");
player.unregister(); // Removes it from player manager

but then this approach introduces cyclic dependency inside implementation of the InMemoryPlayer where it requires to have a Map containing itself in order to function properly (which in theory can cause memory leaks?).

#

My question

is there any way to solve this without removing declaring every single method from Player interface inside PlayerManager leaving Player with only data as that would that introduce precondition check whether supplied Player object is inside the registry before you can proceed executing sendMessage for example?

#

my main concept of creating Player class instead of putting every method under one single class PlayerManager is that you wouldnt need to do runtime checks whether the player belongs in the player manager

public interface PlayerManager {
  void addPlayer(Player player);
  Player getPlayer(UUID id);
  public void sendMessage(Player player, string text); // You could move such methods in player manager but then you have to check whether player belongs in the manager itself at runtime for each method.
}
eternal oxide
#

seems a pointless design decision for Player

mortal hare
#

my main motive is that if you construct implementations in the manager side you can then avoid having to check whether Player object really belongs to this manager in the first place

eternal oxide
#

A Player object should never be stored in your plugin. Being specific.

mortal hare
#

... that's just an example it has nothing to do with bukkit api

eternal oxide
#

theres no point in wrapping a class such as in your eample, when you can just use the object itself

#

what rules you decide to define if it shoudl even be in the manager is upto you

mortal hare
#

by wrapping it you avoid it since the manager constructs the object for you

#

but then there's cyclic depedency like this

#

syntax is cool tho

eternal oxide
#

if you are completely wrapping all methods anything outside the PlayerManager shoudl never have any access to an actual Player object

sly topaz
#

it'd be more helpful if you show a real use case

#

I am also unsure how this correlates at all to parsing tbh

mortal hare
#

if i've putted lets say sendMessage(Player player, String message inside PlayerManager now i need to check whether Player is inside PlayerManager also allows for wrong input in the first place

sly topaz
sly topaz
mortal hare
thorn isle
#

This isn't python

golden turret
#

guys, i have a lava block that i cant lose. Im cancelling the BlockFormEvent to prevent the water from transforming it on obsidian, but that just makes the lava to disappear. How can i fix this?

thorn isle
#

Cyclic references don't cause memory leaks

golden turret
#

same thing with event.getBlock

solid cargo
# golden turret

cant you set the location that gets transformed or something to lava?

#
        event.getBlock().setType(Material.LAVA);
#

idk if that works tho

solid cargo
#

no

paper viper
#

Is there anyway to stop things like banners, or any similar things from dropping into their item form if the support block is broken or changed? Like for example base block of banner being changed to redstone. Are there any ways for this in spigot?

#

In paper there’s a BlockBreakBlockEvent

#

But what’s an alternative for spigot

thorn isle
#

switching to paper

orchid trout
#

1 million dollars and ill do it

thorn isle
#

you can try your luck with block physics event but you won't like it and the server won't either because it fires approximately 10 morbillion times per tick

paper viper
#

and i cancel all item drops that arent players

thorn isle
#

if you just want to prevent them dropping the item, rather than prevent them from being broken altogether, that's a bit easier

#

those two events should get you decently far

#

you can also try for example setting an unobtainable custom name or other identifier on the banner, and then delete any spawning items that have that identifier

#

this way no matter how the block is broken, the drop is removed

thorn isle
#

he's a python programmer

acoustic shuttle
#

Anyway know how to get the inventory action "PICKUP_ONE" to trigger?

#

Couldn't find anything on it

#

does it even exist?

#

and for that matter how do you get "pickup some"

#

and PLACE_SOME 🙏 😭

thorn isle
#

place some happens when topping up a stack with more items on your cursor that'd fit in the stack

#

so you don't place ALL from your cursor, nor do you place ONE from your cursor (as you would with e.g. right click), but SOME

#

not sure if pickup some ever happens with the vanilla client

#

i could see pickup one happening for stacks of 1, though that could might as well be pickup all

acoustic shuttle
#

tbh Ima just keep those events thatt seem unoccuring with what I think they'd work with, I'm just making a storage system rn and I'm being tedious cuz it's easy to dupe with virtual storage systems

jade oasis
#

can you someone send me everything i need to know around implanting offlineplayer() into my code cause ways knew of dont work

chrome beacon
#

What are you trying to do? And what isn't working?

jade oasis
# chrome beacon What are you trying to do? And what isn't working?

I made a punishment GUI plugin so when doing /punish IGN I have a selection of wools each being a punishment and each having a set of offences and each I click will check which offence they are on and mute or ban etc for the right amount of time but /punish IGN only works for online players that are currently active

manic delta
#

i think #OfflinePlayer consumes a lot of resources

flat lark
#

Is there a way to update datapack information at runtime or push information. I was tryna create custom advancements and was just going to create a wrapper then convert it to json and was wondering if I can have it put it into the datapack folder.

slender elbow
#

you can load the advancement json in UnsafeValues#loadAdvancement

flat lark
#

Oh I could just build a json file in my plugin folder then just load that. Also, would their be anyway todo that with enchantments?

slender elbow
#

it doesn't need to be a file, you pass the json as a string directly

#

and there is no supported api for dynamically loading enchantments no

#

internals land for that

flat lark
#

I currently followed a guide on custom enchantments but keep getting a tags error.

#

Hence I was looking into enchantment datapack stuff with spigot. Since spigot dosen't provide for it.

young knoll
#

You can absolutely bundle a datapack in a plugin

#

But the plugin will load and copy it to the datapack folder too late

#

So you have to then restart the server

flat lark
young knoll
#

?

slender elbow
#

the server only loads data packs (effectively) once during startup

#

it does not automagically reload modified files

flat lark
slender elbow
#

there is, but not everything data packs offer can be reloaded

kind hatch
#

There is. /minecraft:reload.

don’t think it works on servers tho

slender elbow
#

for example dimension definitions

#

yeah it does

#

but it's severely limited due to the many things that are simply not hot reloadable

#

stuff like advancements and functions is for example

flat lark
sly topaz
#

Did you end up going the advancement route with your challenge editor? I thought it would’ve been too restrictive

flat lark
#

I am kinda still debating. I feel like advancements would relieve the need for like 10 event handlers. Since they may get called all the time. like on block break event.

sly topaz
#

I don’t really see a problem with having a lot of event handlers tbh, rather if it is gonna work the way I believe it is, that might be your only option

flat lark
#

Advancements count as its own list as well.

vital sandal
#

is there anyway to increase speed while moving underwater ?

#

like increase boat speed ?

rough ibex
#

boat speed or movement speed underwater

#

you described 2 different things

vital sandal
#

hmm

#

I want to increase the movement speed of this horse underwater

#

but I cannot see any event that trigger this

#

EntityMoveEvent doesn't call

#

same for VehicleMoveEvent

rough ibex
#

is it being lead

vital sandal
#

nope

#

during riding

#

when being lead it still work

jagged thicket
vital sandal
#

I mean I cannot find any event tracking that the horse is moving

buoyant viper
#

?stash for me

undone axleBOT
buoyant viper
#

wait thats not what i need even

#

?jd-s

undone axleBOT
near night
#

how would i run code on an items nbt changing? i need to reevaluate placeholders in an items lore when the nbt chnages

eternal oxide
#

how is the lore being changed?

near night
eternal oxide
#

you mean the lore needs updating if a placeholder changes

#

Then you need to find a way to track when the placeholder needs updating

#

placeholders in lore is a bad idea

near night
#

why?

eternal oxide
#

because teh placeholder is replaced when you create the item

eternal oxide
#

it doesn't actually exist in the lore after creation

near night
#

yeah, but i'm making a custom item system, the lore is stored in a class of the custom item so i can just read it from that on update

#

i need dynamic gemstone slots and coin values

eternal oxide
#

So any item which once HAD the placeholder no longer does once its created. It could be stuck in a chest and unloaded after, but will never be updated as its just text in the lore after creation. The placeholder no longer exists on it

near night
#

but i can just do meta.setLore(lore); and lore is stored in a class as a template of the lorw

#

or how would you recommend adding dynamicly updated gemstone slots and price values to the lore?

eternal oxide
#

the lore displayed by the client is just text. it has no placeholders

#

You would have to monitor every inventory that is opened, every item that is dropped or picked up

near night
#

yeah, so i would do like meta.setLore(placeholder.parse(lore)); and lore is still a template that i can refer to each update

eternal oxide
#

there is also no event sent when teh player opens their own inventory so you would have to scan all player inventories any time a placeholder needed updating

near night
#

hmmm, damn

orchid trout
#

is there a compact sidebar plugin for intellij?

blazing ocean
#

what

#

is this like, not compact to you

orchid trout
#

i want to see 1 million files

blazing ocean
#

what

orchid trout
#

i need tahoma 8px

#

9px

young knoll
#

You would not believe your eyes
If 10 million file-flies

pseudo hazel
#

that sounds like dodging the actual problem

#

which is either bad organization or way too many files

cinder abyss
#

Hello, how can I get a head as ItemStack from an URL in spigot 1.8.8 ?

young knoll
#

AuthLib fuckery

warm mica
timber basalt
#

How can I prevent players from shift clicking items from a custom inventory? I have registered the InventoryCLickEvent and I am checking if event.getClick.isShiftClick, but that doesnt do anything.

eternal oxide
#

?nocode

undone axleBOT
#

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

timber basalt
eternal oxide
#

does the sound play?

timber basalt
eternal oxide
#

also, do NOT close an inventory in the InventoryClickEvent

timber basalt
timber basalt
#

Yup I put it inside a task that runs a tick later and it works perfectly now. Thanks

manic delta
#

You can use that lib

hasty umbra
manic delta
#

Has anyone made a free VPS with Oracle? I have one, but it won't let me make internal connections. How do I connect from outside to the VPS database? I'm supposed to have everything configured correctly. But it doesn't work for

chrome beacon
#

MySQL isn't accessible from outside by default

#

same goes for mariadb

#

You need to tell it to bind to 0.0.0.0 if you want to access it

magic pebble
#

someone want to be a developer in my server

#

is an advanced server

#

with 3d models

worthy yarrow
#

?servicez

#

?services

undone axleBOT
slate tinsel
#

Is it possible to undo an force push?

manic delta
#

I also made sure I had the firewall configured properly.

buoyant viper
slate tinsel
#

I did make some commits from GitHub website for creating md files and things, and then I did push my code from intellij to github and clicked force push, so everything in the md files got removed

#

and all the commits about the md files also

buoyant viper
#

F

buoyant viper
# slate tinsel how? 🙂

i dont particularly remember since i only did it once by merging my repo with a Fork that hadnt touched anything yet, but this may be a better start than whatever tf i was doing

orchid trout
#

why cant i name a package "new">

sly topaz
orchid trout
#

i know its keyword

#

but why not

#

its file name

#

directory

sly topaz
#

packages are part of the fully qualified name of a class

viscid carbon
#

?paste

undone axleBOT
orchid trout
#

ok

viscid carbon
sly topaz
#

that is, if you have a class in some/package/SomeClass its simple name is SomeClass but the fully qualified name is some.package.SomeClass, if you were to put new there, it'd confuse the compiler

blazing ocean
#

what gradle version?

sly topaz
#

it is the gradle version

#

well rather, it is the gradle version imposing a kotlin version that is too old, which produces the mismatch

blazing ocean
#

old gradle versions aren't pulling in too old kotlin versions

#

in all cases though, update to 8.13

sly topaz
blazing ocean
#

funky embed

sly topaz
#

I'm amazed google picked up the slack convo at all, is that a slack thread or something?

blazing ocean
#

that is a slack thread

#

slack threads are indexed

#

but that's also a weird URL

hollow vessel
#

hi, how can I glow entity only for certain player?

sly topaz
#

that's very nice, fixed one of the big issues I have with discord chats, which is the fact that there's zero discoverability on old issues

blazing ocean
#

this is the actual link

sly topaz
#

that link requires login tho

blazing ocean
blazing ocean
sly topaz
#

I already have one, but I doubt most people do lol

blazing ocean
#

I only had to wait for like 2h

sly topaz
#

mine took like 4h but at that point, you've already moved to try something else lol

blazing ocean
#

I asked a question in the #reflect channel a month ago and still got no proper response

sly topaz
#

I love how even the kotlin team is completely flabbergasted at Gradle's architecture, as far as classloading issues go anyway

sly topaz
blazing ocean
sly topaz
blazing ocean
#

magic links are kinda meh but are fine tbh

sly topaz
#

it was either my google or my proton account anyway

blazing ocean
#

why do I have this draft

buoyant viper
turbid crown
#

For example, I have a resource on spigot, can I edit the documentation on it?

blazing ocean
buoyant viper
#

_<

chrome beacon
paper viper
#

not sure why but my warning emoji has a square to the right of it? It displays it properly though

#

using UTF-8 to save my properties file

#

oh shit

blazing ocean
#

got a screenshot and client logs?

paper viper
#

found the reason

#

its cause the emoji includes font

#

need to use ⚠

#

not ⚠️

blazing ocean
#

yea that'd be it

rough ibex
#

variation selectors yay!

rough ibex
#

those terms dont work together the way youre using them

lean pumice
#
        List<EntityData> entityData = new ArrayList<>();
        entityData.add(new EntityData(23, EntityDataTypes.BLOCK_STATE, 1));
        entityData.add(new EntityData(17, EntityDataTypes.FLOAT, 20f));
        entityData.add(new EntityData(20, EntityDataTypes.FLOAT, 1f));
        entityData.add(new EntityData(21, EntityDataTypes.FLOAT, 1f));

        int id = SpigotReflectionUtil.generateEntityId();
        WrapperPlayServerSpawnEntity spawn = new WrapperPlayServerSpawnEntity(
                id,
                UUID.randomUUID(),
                EntityTypes.BLOCK_DISPLAY,
                SpigotConversionUtil.fromBukkitLocation(player.getLocation()),
                0,
                0,
                new Vector3d()
        );

        WrapperPlayServerEntityMetadata metadata = new WrapperPlayServerEntityMetadata(
                id,
                entityData
        );

        User user = PacketEvents.getAPI().getPlayerManager().getUser(player);
        user.sendPacket(spawn);
        user.sendPacket(metadata);

why the block display not spawn?

manic delta
lean pumice
sly topaz
#

thanks for coming to my ted talk

#

jokes aside, you can probably use this mod on your client: https://modrinth.com/mod/gadget to dump the packets you sent and compare them to an entity packet sent by the API/natural spawning

blazing ocean
#

gadget is archived now 😔

eternal night
sly topaz
#

really? They should update their modrinth description smh

echo tangle
#

how do i get a sign to already have text on it. i'm currently sending three packets to try and get an editable sign with text already on it. blockchange, blockmetadata, and opensigngui. the sign places, and the gui opens, but the sign doesn't have any text on it, am i missing something?

chrome beacon
#

That's all you need to do

#

Make sure you put the text on the same side as the text editor opens

echo tangle
sly topaz
#

I think the API covers all there is as far as signs go

echo tangle
#

how would you do it without packets?

sly topaz
brisk summit
thorn isle
#

notworking

echo basalt
#

?notworking

undone axleBOT
#

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

quaint mantle
#

Why is my config failing to read 2 identical lines?

  Lines:
  - ''
  - ' §7| &fAlive: &5%alive_size%'
  - ' §7| &fDead: &5%dead_size%'
  - ' §7| &fTokens: &5%tokens_%player%%'
  - ''
  - §7§oEdit this in the config of Neon.```
#

You see, the first line is a space but in the actual scoreboard it isn't.

#

let me send the scoreboard code too ig

echo basalt
#

I'm going to assume the scoreboard team already exists

#

the way we got around this in the old days was by appending color codes to every empty line

quaint mantle
#

interesting

#

should I do that now too?

echo basalt
#

seems to still work iirc

quaint mantle
#

What about if there's 2 identical texts?

#

It seems to happen to those too.

thorn isle
#

why not use the new scoreboard components? they'll let you get rid of those numbers on the right as well, and won't care about two lines being the same

#

iirc the api is Score::setDisplay or some such

young knoll
#

I don’t think we have api for that

thorn isle
#

is it paper only? 🤡

young knoll
#

Mayhaps

#

I know choco made a PR for it but I don’t think it was ever merged

thorn isle
#

it's almost like there's a pattern

#

in other news, it turns out my minimum viable implementation for threaded entity tracking actually worked out without any major changes

#

minimum viable as in i just comment the shit out in ChunkMap::tick and do it in a thread pool

#

haven't had the server crash yet at least, but we'll see 🤡

#

next i will uh take a look at doing some of the simpler ai goals off the main thread