#help-development

1 messages · Page 2218 of 1

quiet ice
#

And the map-like .put operation is also more expensive being O(n) instead of O(≈1)

neon nymph
#

Yep, hence why I didn't use it

quartz basalt
#

what does this error mean java.lang.NullPointerException: Cannot invoke "net.minecraft.world.item.Item.u()" because the return value of "org.bukkit.craftbukkit.v1_18_R2.util.CraftMagicNumbers.getItem(org.bukkit.Material)" is null from for (Material mat : Material.values()) { if (mat != null) { if (mat.getCreativeCategory() == CreativeCategory.BUILDING_BLOCKS) { blocksList.add(mat); } } } specifically if (mat.getCreativeCategory() == CreativeCategory.BUILDING_BLOCKS) {

quiet ice
#

Could be a spigot bug

#

I'd use Triple backticks for Code Block, much more readable

quartz basalt
#

huh?

#

so do you think i should open a spigot bug thing?

quiet ice
#

Test it in 1.19 First though

quartz basalt
#

wdym why

#

i need this for 1.18 so whats the point

quiet ice
#

Because 1.18 is EOL

sacred mountain
#
yellow heheh eh e eh eh eh```
quartz basalt
#

EOL?

quiet ice
#

End of life

#

= No updates

quartz basalt
#

.-----.

eternal oxide
quartz basalt
#

api-version: 1.18

            <groupId>org.spigotmc</groupId>
            <artifactId>spigot-api</artifactId>
            <version>1.18.2-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>``` yes
quiet ice
#

that is probably what is happening

#

The alternative is that it is crashing due to Material.AIR etc

quartz basalt
#

i dont think thatd happen though

eternal oxide
#

Can you post the full stacktrace

quartz basalt
#

yeah

quiet ice
#

I.e. things that are Not supposed to be itemstacks

eternal oxide
#

?paste

undone axleBOT
quiet ice
#

Remember that Material also contains types that do Not really exist

#

At least Not for itemstacks

quartz basalt
quiet ice
#

Hence BukkitMagic returns a null itemstack there and Bukkit cannot Grab the Creative category

eternal oxide
#

?stash

undone axleBOT
quartz basalt
#

what about it

quiet ice
#

I'd Insert a Material#isItem condition there

quartz basalt
#

alright ill try

quiet ice
quartz basalt
#

oh

eternal oxide
#

can you see if this also happens on Spigot? You are running paper

quartz basalt
#

yeah gimmi a sec restarting server cuz i was gonna change to 1.19 to test it

eternal oxide
#

line 421 does not exist in spigot CraftMagicNumbers

tired atlas
#

Anyone any idea how to send raw bytes to a player connection? I used ProtocolLib but that seems buggy with 1.19.. and I don't need all the abstractions

eternal night
#

raw bytes must be one of the worst ideas I have heard in a while

#

no offense, but you will put more work into getting that to work than anything else in your entire plugin

quiet ice
#

Just use the raw nio channels at that point

tired atlas
#

I got it working with ProtocolLib already

eternal night
#

raw bytes is a whole different world than protocol lib

quartz basalt
#

.isItem() seemed to fix it thanks

tired atlas
#

No like, sending the raw bytes with protocollib

eternal night
#

lmfao 😂

#

I mean, enjoy updating

quiet ice
#

That defeats the purpose of that lib

tired atlas
#

Feels like there should be an relatively easy way to just tell the server to send the bytes to the player

eternal night
#

lol

tired atlas
eternal night
#

not really. The servers interacts with the netty channel, which expects packets

quiet ice
#

Also, compression

eternal night
#

encryption

tired atlas
#

Guess I'll have to dig through the ProtocolLib source then

quiet ice
#

Can be discarded for offline mode

eternal night
#

also there is literally no "backwards compatible" network protocol out there

pale egret
#

Has anyone here used bisecthosting? Does it have good performance? The premium option

eternal night
#

just in 1.19, I think 2 whole packets were dropped ?

#

one was added, a bunch were changed

quiet ice
#

Or even #general

eternal night
#

don't think protocol lib sends bytes directly either does it ?

#

should just wrap the mojang packet types

tired atlas
tired atlas
winged anvil
#

anyone here know why I can't connect to redis hosted off a separate machine from my machine even though I have it set to listening to all interfaces in the config as well as protected mode off

eternal night
#

it is still a "mojang packet"

#

that just only holds its bytes

vapid junco
#

is there any way i can get the vector perpendicular to player.getEyeLocation().getDirection()?

eternal night
#

tho again, protocol lib does a LOT

#

even sendWirePacket will still go through compression and encryption, because it has to

#

and no

#

legacy text is legacy text

#

use a proper text library (adventure is pretty cool)

halcyon mica
#

So what am I doing wrong here?

#
    public static float getYawToLookAt(Vector a, Vector b) {
        double x = b.getX() - a.getX();
        double z = b.getZ() - a.getZ();

        return (float)Math.toDegrees(Math.atan2(Math.toRadians(z), Math.toRadians(x)));
    }```
#

The result is consistently -90 degrees, regardless of the two vectors

tired atlas
#

The z and x you are passing to Math.toRadians aren't angles, what are you trying to do? :o

eternal night
#

toRadians

#

on x and z

#

yea

halcyon mica
eternal night
#

Looks alright, but yea, z and x are not angles

halcyon mica
#

Well, the issue is still the same

#

The offset angle is always 0, -2

tired atlas
#

Just Math.atan(z / x) ?

halcyon mica
#

Well, then I don't get the angle from vector A

#

But from origin, i.e. 0

tired atlas
#

You get the angle "from the origin", but it will be the correct angle still

halcyon mica
#

How, the position is not necessairly between the origin and the point

#

Yeah go figure, that doesn't work

nova sparrow
#

How would you get the closest player to another player?

ocean lion
tardy delta
#

i guess it just takes the length of the longest item in the row and adds some spaces

sacred mountain
#

i have a length util somewhere

#

it's a bit complicated though

#

but i've got to sleep now

minor garnet
restive mango
#

How quickly is an entity reference replaced after that entity dies? Like if I’ve saved a reference to an entity in a runnable and check that entity for some property a minute after it dies, what would happen?

tired atlas
#

Math.atan2(x, z) is a "safer" way to write Math.atan(x / z)

sacred mountain
#

tis true

#

i just use my own math class

restive mango
#

Alternatively, anyone know how to give a projectile some custom movement stuff without using a bukkitrunnable?

tired atlas
restive mango
#

Yeah, like make a projectile home in on the nearest entity, or orbit an entity, be thrown in an arc, home in on the direction an entity is looking, stuff like that.

#

I can do all of it with bukkitrunnables, but just wondering…

tired atlas
#

Sadly the "over time" part requires BukkitRunnable, I think

eternal oxide
#

runnables

restive mango
#

Darn

#

Well, my original question about references still stands — these projectiles /do/ things when they hit stuff, and I can either use the runnable or the listener for the collision to do that.

eternal oxide
#

There is a ProjectileHitEvent

ocean lion
tired atlas
#

I do see how it would be neat to have it close to eachother, code wise

nova sparrow
ocean lion
#

add my discord

dire sand
#

Hello

restive mango
#

@eternal oxide I know, but then I have to save all the information related to the projectile collision onto the projectile itself.

#

Otherwise the listener can’t get it, no?

dire sand
#

I am working on an animation to display blocks in a wave in front of the user. I have the animation working, but on the off chance some of the blocks in my animation get placed as real blocks whereas the other blocks are hollow. https://paste.md-5.net/wevagivaco.cs

#

How can I solve this?

#

I was thinking this can maybe occur b/c the velocity of the block was set to be facing down

eternal oxide
#

either use ItemMeta or PDC

ocean lion
#

ElgarL could you help me?

eternal oxide
graceful turret
#

whats the best option to set some text under player nickname?

ocean lion
#

But then it returns null

eternal oxide
#

if you set a field it can't return null

tired atlas
#

I'm trying it now, and I can still access it's properties (For a cow I'm testing .isDead()

eternal oxide
#

Player target = null with a setter and getter

#

in your onCommand target = targetPlayer

tired atlas
#

(Even .getLocation() shows the last location it lived still)

eternal oxide
#

it flags it for cleanup

tired atlas
#

But how will it be cleaned up if my code still has a reference?

quartz basalt
#

is it possible to color lore

eternal oxide
#

yes

tired atlas
#

It can't change to null when I already have it as an object

quartz basalt
#

ChatColor.translateAlternateColorCodes('&' on lore doesnt work so how would i?

eternal oxide
#

ChatColor.RED

tired atlas
quartz basalt
#

ah

eternal oxide
ocean lion
eternal oxide
tired atlas
eternal oxide
eternal oxide
tired atlas
eternal oxide
#

depends on what you are doing in each

#

at all times you will have Thousands of tasks running on your CPU

#

My PC right now has 2174 seperate Threads running

#

in 98 processes

#

you can add thousands more, it all depends on what you are doing in them

#

what are you running in each?

#

for starters they are on a timer, so not running all the time

#

Nothing there sounds like heavy tasks, so no problems.

tardy delta
#

querying a database

eternal oxide
#

lots of square roots

#

BIG math

#

depends how many you do and how often

#

again, without knowing quantity and how I can;t say for sure

ocean lion
#

Caused by: java.lang.NullPointerException: Cannot invoke "org.bukkit.entity.Player.setHealth(double)" because "this.target" is null

at com.yanesagrybnow.targetgui.targetListener.onMenuClick(targetListener.java:44) ~[?:?]

eternal oxide
#

have you set it from inside your Listener?

#

or if you are accessing it INSIDE your listener you have to set it elsewhere

#

You should not have a Listener running which is expecting a value from outside that is not there

#

we seemed to get crossed messages there at teh end 🙂

ocean lion
#

ElgarL I have done this but I cant access it?

#

Am I just stupid or

eternal oxide
#

Do I have to answer that? 😄

rare flicker
#

is it alright if i ask for people here to upvote an issue i posted?

ocean lion
#

If you could try to help me further it would be appreiciated

eternal oxide
#

ok, show me your Listener

#

Class

#

?paste

undone axleBOT
ocean lion
eternal oxide
#

I don;t see any refernce to the object target.setHealth(0);

ocean lion
#

right since thats where I dont know what to do

eternal oxide
#

ok you are creating a menu of player heads

ocean lion
#

I obviously want the Player whoToTarget = player.getServer().getPlayerExact....... to be accessed not just a Player target

eternal oxide
#

when you click on a player head you shoudl be setting target to that owning Player

tardy delta
#

you can just do Bukkit.getPlayerExact

ocean lion
#

?

#

I have that

#

but I want to access the whoToTarget outside the{}

eternal oxide
#

so teh code where you click the head you shoudl be setting the Player target field

#

ah ok

#

This line targetMenuUtils.openTargetMenu(player, whoToTarget);

alpine coral
#

So I've tried looking up info about pinging a minecraft server in js, but I can't rlly find any

#

how would I go about it?

chrome beacon
#

Use PrismarineJS

alpine coral
#

And I mean like, getting this info

ocean lion
alpine coral
chrome beacon
alpine coral
#

Well okay take out the js part of it

#

it isn't even reliant on the js

tired atlas
alpine coral
#

what headers would I use

eternal oxide
alpine coral
#

nvm found this

eternal oxide
#

so line 37 where you need a target you call targetMenuUtils.getTarget()

#

needs to be static as you have no reference to the instance

#

Lastly you should not close nor open an Inventory from within the InventoryClickEvent You need to delay it 1 tick

chrome beacon
alpine coral
proper notch
#

Are you just trying to get the info from a server ping?

alpine coral
#

yes

chrome beacon
#

First of you should know that you're not going to do a http request

proper notch
chrome beacon
#

You're going to have to use TCP

proper notch
#

My end solution was quite different, but that's good to sorta understand what you've actually gotta be doing

chrome beacon
#

There are already js libs for this. Why not use them?

alpine coral
#

because I was saying js cuz alot of ppl use it and I figured someone would answer, but I won't actually be using js

chrome beacon
#

...

ocean lion
#

@eternal oxide

chrome beacon
ocean lion
eternal oxide
#

have you set it static

#

getTarget has to be static

#

no idea what your error is though, its not in teh paste

chrome beacon
#

That appears to be an infinite loop

eternal oxide
#

oh ok I see

#
    public Player setTarget() {
        return this.target;
    }```Do you see an issue here?
alpine coral
#

yes

ocean lion
#
    public static Player target = null;

    public static Player getTarget() {
        return target;
    }

    public static Player setTarget() {
        return target;
    }
#

and inside the openMenu its target= getTarget(){

tardy delta
#

looks like static abuse 🤔

ocean lion
#

He legit told me to put static

#

?

tardy delta
#

idk lol havent read the whole thing

eternal oxide
#
    public void setTarget(Player player) {
        this.target = player;
    }```
torn yarrow
#

has anyone got a plugin for 1.19 and java1.17 that is using gradle..ie looking for gradle config... don't normally touch it but have a plugin i'm updating to the latest.

eternal oxide
#

Yep he has to use static because he won;t pass instances as I showed yesterday 😦

tardy delta
#

¯_(ツ)_/¯

ocean lion
#

it wont let me use this.target; with a static

eternal oxide
#

fix your setTarget method

ocean lion
#

I did now

eternal oxide
#

now fix in your openTargetMenu you need to do setTarget(target);

#

I have no idea why we are doing it this way. We could have done it in the Listener 😛

#

I didn;t notice you are using a double Listener

ocean lion
#

Wow thank you so much

#

wdym we could do it in listener XD

#

HAHA

eternal oxide
#

scrub all the changes to targetMenuUtils

#

no need to store a target in there at all

#

"best"

lost matrix
#

There is no best way.

#

There are several valid approaches and each one needs to be thought out.

#

I would suggest using an advanced command framework.

#

Im using ACF. But it has a very steep learning curve and is pretty hard to master.
There are several others you can take a look at.

tardy delta
#

same

ivory sleet
#

I use Bukkit command framework

#

Known for its simplicity

#

Tho it is a bit limiting

#

Like if you wanna just do it yourself

#

Map some command executors

#

Map<String,CommandExecutor>

#

Minimalistic

lost matrix
#

I think the most time consuming work is context resolving.
I would much rather create a command like this:

public void onCommand(CommandSender sender, Player target, int amount) {

}

And then register a context resolver (CommandSender, CommandContext) -> Player (once)
So i can reuse it in every command by just specifying the type instead of having to parse and validate String over and over again.
But all of that needs reflections.

ivory sleet
#

Well, in that case

#

Cloud

#

Or just reflect into the brigadier dispatcher

#

and use brigadier purely

#

(Might not even need reflection)

lost matrix
# ivory sleet Cloud

Isnt that the one that uses a builder pattern and therefore has gigantic tree definitions?

ivory sleet
#

You have annots as well

#

But yes it follows a similar style to brigadier

#

Which sure can be a bit verbose

#

But it allows you to easily compose commands with literals and arguments on the fly

#

With quite easy reusability

lost matrix
#

Im just looking at it. Doesnt look too bad.

ivory sleet
#

Yeah, the nesting can become pretty awful, so I usually create a ton of variables… but well it works fine Ig

#

(Which is why using annotations isn’t actually that bad, but helps with reducing boilerplate a lot)

lost matrix
#

But im way too committed to ACF. Poured too much time into it so i wont change.

ivory sleet
#

Lmaoo

#

I mean acf is extremely solid so don’t think you over committed the wrong library

#

No?

#

Justify

#

Still awaiting your explanation :3

lost matrix
#

Yeah its very solid. Its just a hustle working with others because explaining how the internals work is a bit...

ivory sleet
#

🥲

ocean lion
#

Can anyone help me test the plugin. Need someone to use on

lost matrix
tardy delta
#

oh thats a thing

ocean lion
#

Just wanted to know if anyone would help but ty

rain echo
lost matrix
rain echo
#

i forgot to remove it

#

it doesnt need Listener

lost matrix
#

Dont expose your maps like that. You should never have any getters or setters for data structures like maps, sets, lists etc...

rain echo
#

wdym?

lost matrix
#

You can take that quite literally

winged anvil
#

why not

rain echo
#

well i need to get my map

#

in another class

tired atlas
#

Just let the guy have his maps

lost matrix
winged anvil
#

lmfap

rain echo
#

a class that converts the menu to config and vice versa

winged anvil
#

true

#

already have get method

lost matrix
#

This breaks strong encapsulation and will inevitably lead to a mess. Especially in bigger projects.

#

Yes

rain echo
#

but then how i can get the map or the list from another classes?

lost matrix
rain echo
#

but, the thing i did with the instance of the menu in the main class, is okay?

lost matrix
#

Ill give an example. One moment.

tired atlas
#

But if you need to add and remove items, just use a map

#

Once you have it working, you might want to spend the time to abstract it, but is it worth it now?

#

Abstraction as in, not exposing the map (or any object that itself contains state) directly but instead having dedicated methods to interact with the map (or any object) for "encapsulation"

#

Maybe, but is it worth the hassle while you are working on a feature

#

I find that all the strong encapsulation and code rules keep me from playing around and getting cool things to work

shy forge
#

Can someone help me resolve a java.lang.IllegalArgumentException: Unsupported class file major version 62 error I keep getting with Gradle?

lost matrix
#

?paste

undone axleBOT
rain echo
#

thanksss, checking now

iron glade
#

How do I get the file from the FileConfiguration?

tardy delta
#

iirc not

lost matrix
#

Its pretty much just a glorified Map<String, Object>

iron glade
#

oh damn

sterile token
#

Hi

#

Who had tagged me?

sage coral
#

A problem occurred running the Server launcher.java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at net.minecraftforge.fml.relauncher.ServerLaunchWrapper.run(ServerLaunchWrapper.java:70)
at net.minecraftforge.fml.relauncher.ServerLaunchWrapper.main(ServerLaunchWrapper.java:34)
Caused by: java.lang.ClassCastException: class jdk.internal.loader.ClassLoaders$AppClassLoader cannot be cast to class java.net.URLClassLoader (jdk.internal.loader.ClassLoaders$AppClassLoader and java.net.URLClassLoader are in module java.base of loader 'bootstrap')
at net.minecraft.launchwrapper.Launch.<init>(Launch.java:34)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
... 6 more
any help me

ivory sleet
#

Forge?

sage coral
#

yes

lost matrix
tardy delta
#

heeheeheehaw

uneven fiber
#

hey yall im tryna add arrows into the players inventory but i've been failing...

#

what am i doing wrong?

sage coral
#

any help me ?!

uneven fiber
ivory sleet
#

I’m sorry but this isn’t the forge support discord

uneven fiber
#

rose for your troubles

ivory sleet
#

There are probably other, more suitable places where you can get help with addressing said error

neon nymph
#

How can I "create" block data using the string returned by a #BlockData.getAsString()?

lost matrix
neon nymph
#

Oh that's a thing lol, thanks

lost matrix
uneven fiber
lost matrix
tardy delta
#

my brain is dead at this time of the day

main dew
#

How disable create end portal

tardy delta
tardy delta
#

verified the reason and blocking the event accordingly?

#

registered it?

main dew
tired atlas
misty current
#

if I have a class Car that extends Vehicle, can I get in the constructor of Vehicle the class object of the super constructor caller? (in my case, Car)

tardy delta
main dew
tardy delta
#

uhh and is that doin anything?

main dew
eternal night
#

unnecessary as fuck but nice xD

main dew
misty current
#

i need to get the car instance from inside vehicle

#

this.getClass() would return vehicle.class

#

basically

tired atlas
eternal night
#

Oh god

tired atlas
#

Yeah... I'm that kinda guy :P

eternal night
#

That's worse than the guy that wrote one in Rust

#

Which was at least fun

tardy delta
tired atlas
#

Hahaha, let me have my javascript

tardy delta
#

check if this extends Car and cast it

misty current
#

i want to get the class object of the class that called a super constructor from inside the super constructor

tardy delta
#

just getClass might do it iirc

#

anyways im going to bed

misty current
sterile token
true shuttle
#

ok so i know this is such a noob question, but how can I make a class that only runs when I call it? like a function or something

last sleet
#

You can make a static method and call that.

echo basalt
#

constructor

sterile token
last sleet
sterile token
#

So yeah, i prefer doing utilities method static

uneven fiber
sterile token
last sleet
# true shuttle Yea i think u got it

Tbh if you don't know what static methods are, you should seriously consider learning basic java before coding plugins for Minecraft, or else 99% of your time is gonna be spent looking up stackoverflow.

sterile token
#

On minecraft plugins: not knowing basic java == be 1h asking, searchingon internet, etc something easy to do

uneven fiber
#

hey yall im facing an issue where for some reason, the amount of arrows given to a player doesn't decrease

#

like 32 arrows are originally given, but even if they shoot the bow 10 times the amount doesn't go down from 32

#

any ideas why?

sterile token
uneven fiber
#

HOW DID I FORGET I ADDED THAT

sterile token
#

Yeah dont worry

#

Common things

uneven fiber
#

LMFAO thank you

sterile token
#

Your welcome :D

uneven fiber
#

i was wondering what was happening for 10 minutes

#

hahaha

sterile token
#

Haha, sometimes happen that i update a file.yml on a plugin, them restart and the same errors. After 10m i realise i was using the fucked old yaml files

true shuttle
uneven fiber
#

this is why taking breaks while coding indirectly hurts you

sterile token
#

Because static is part of basic java

sterile token
last sleet
uneven fiber
#

and free online 🤷‍♂️

true shuttle
sterile token
#

LOL LMAO

#

First time i see that on a plugin

#

👀

golden turret
#

I'm sending an entity destroy packet to the player (I'm on 1.17.1) and teleporting him far from the entity.
When I use /tp on the entity location I can see the entity.
How can I make the entity not appear for the player even if he walks back to the location?

humble tulip
#

The packet is sent when the chunk loads for the player

#

Or maybe even after

iron glade
#
    public static String trueOrFalseColor(boolean b) {

            if (b) return "§a";
            else return "§c";

    }```
This looks so wrong xd
#

Usually I'm not a fan of leaving out brackets

dusk flicker
#

oh my

late sonnet
#

._.

dusk flicker
#

personally id do something like

respectiveColoor(boolean value)

return b ? "§a" : "§c";
humble tulip
#

Or a static final string

dusk flicker
#

obviously psuedocode, and spelling isnt great

iron glade
humble tulip
#

True Color

#

False Color

dusk flicker
#

yeah a static final string would be decent

iron glade
#

ever since I learned about the ternary operator I fell in love with it

restive mango
#

How would I make a projectile invisible?

last sleet
#

Maybe you can send an entitydestroypacket to players that see the projectile.

restive mango
#

Got an example of any packet code I could explore? I haven't worked with packets before.

#

Any basics plugins which use it, I mean.

last sleet
# restive mango Got an example of any packet code I could explore? I haven't worked with packets...

Hah, I also haven't really worked with packets or NMS before but I found this thread on the spigot forums :
https://www.spigotmc.org/threads/making-projectiles-arrows-invisible-to-all-players.459673/
It might help you.

iron glade
#

Anyone can recommend a way to obfuscate a maven project?

humble tulip
restive mango
#

great, i'll take a crack at this, thanks a bunch @last sleet

golden turret
humble tulip
golden turret
#

that is only when the chunks loads in the world

#

not for the player

humble tulip
#

True

#

Might have to use protocollib

west scarab
#

why isn't this code working?? this should be all right syntax and stuff....

    @EventHandler
    public void join(PlayerJoinEvent event) {
        Player p = event.getPlayer();
        event.setJoinMessage("PLAYER JOINED!");
        Bukkit.broadcastMessage("Testing Stuff");
    }```
#

it doesn't set the join message or broadcast, no errors

worldly ingot
#

Was the event registered?

west scarab
#
package things.things;

import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.Action;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.plugin.java.JavaPlugin;

import java.util.HashMap;
import java.util.UUID;

public final class Things extends JavaPlugin implements Listener {

    @Override
    public void onEnable() {
        Bukkit.broadcastMessage("" + Bukkit.getServer().getOnlinePlayers());
    }

    @EventHandler
    public void join(PlayerJoinEvent event) {
        Player p = event.getPlayer();
        event.setJoinMessage("PLAYER JOINED!");
        Bukkit.broadcastMessage("Testing Stuff");
    }
    public static void clicker(PlayerInteractEvent event) {
        event.getPlayer().sendMessage("Testing");
        Player p = event.getPlayer();
        Block b = event.getClickedBlock();
        UUID u = p.getPlayer().getUniqueId();
        Integer bal = Balance.get(u);
        if(event.getAction() == Action.RIGHT_CLICK_BLOCK) {
            if(b.equals(Material.COBBLESTONE)) {
                Balance.put(u, bal+10);
                p.sendMessage("Balance: " + Balance.get(u));
            }
        }
    }

    public static HashMap<UUID, Integer> Balance = new HashMap();

}
#

that's the full code

#

nothing in it works for some reason with 0 errors

west scarab
worldly ingot
#

Yeah that's not registered. You need to register your listeners

west scarab
#

im very new just started yesterday,

worldly ingot
#
@Override
public void onEnable() {
    Bukkit.getPluginManager().registerEvents(this, this);
}```
#

The first this referring to the instance of the Listener, the second this referring to the Plugin

west scarab
#

just put that in and it'll work?!

worldly ingot
#

Yes

west scarab
#

lemme test!

worldly ingot
#

Your PlayerInteractEvent won't work though. You would have to remove the static and annotate it with @EventHandler as well

west scarab
#

how do you annotate

worldly ingot
#

Additionally, Block will never equal a Material. Your if (b.equals(Material.COBBLESTONE)) should be if (b.getType() == Material.COBBLESTONE)

#

Just adding @EventHandler above the method

west scarab
#

ahh

#

what does static even do?

worldly ingot
west scarab
#

the stuff you said works, thanks so much but 1 more thing

#

it's not sending the balance thing

    @EventHandler
    public void clicker(PlayerInteractEvent event) {
        Player p = event.getPlayer();
        Block b = event.getClickedBlock();
        UUID u = p.getPlayer().getUniqueId();
        Integer bal = Balance.get(u);
        if(event.getAction() == Action.RIGHT_CLICK_BLOCK) {
            if (b.getType() == Material.COBBLESTONE) {
                Balance.put(u, bal+10);
                p.sendMessage("Balance: " + Balance.get(u));
                return;
            }
        }
    }```
worldly ingot
#

Likely have a NullPointerException in your console. Balance.get(u) will throw an error because it's going to try and auto unbox an unmapped value. You can use Balance.getOrDefault(u, 0); instead and it should work

west scarab
#

link this? java Balance.getOrDefault(u, 0); Balance.put(u, bal+10);

worldly ingot
#
    @EventHandler
    public void clicker(PlayerInteractEvent event) {
        Player p = event.getPlayer();
        Block b = event.getClickedBlock();
        UUID u = p.getPlayer().getUniqueId();
        Integer bal = Balance.getOrDefault(u, 0); // This line here should use getOrDefault()
        if(event.getAction() == Action.RIGHT_CLICK_BLOCK) {
            if (b.getType() == Material.COBBLESTONE) {
                Balance.put(u, bal+10);
                p.sendMessage("Balance: " + Balance.get(u));
                return;
            }
        }
    }```
west scarab
#

OHHH thanks ima try it!

#

YES works, thank you so much, but it's doubling how do i fix that like when i click once it's registering two clicks

subtle folio
#

How do I lsiten for when a Player enters a minecart?

west scarab
#

probs vehicle related i'd imagine ^

restive mango
#

Ugh, people are going to hate me for asking this, but how do I create instances of a class I'm using for data storage which are accessible from any of my other classes?

#

Like...

#

Suppose I have this:

#
public class ParamClass {

    private final int height;
    private final int width;
    private final int depth;

    public ParamClass(int height, int width, int depth) {
        this.height = height;
        this.width = width;
        this.depth = depth;

    }

    public int getHeight() {
        return height;

    }

    public int getWidth() {
        return width;

    }
}
#

And I want to have two ParamClass things which I can access from my other classes, one with height, width, and depth of 2, 4, and 6, and the other with 5, 6, and 10.

#

How do I actually create those and then access them from anywhere?

quaint mantle
#

and you asking how to instantiate in java

restive mango
#

yes D;

quaint mantle
#

google

#

and its funny

#

to create a new Object

#

you would do

#

new Object

#

so new MyObject(param1, param2)

restive mango
#

Ugh, the issue is then I have to create it WHENEVER I'm using it... I really am just hoping to use it to store the data once.

#

And then call the class to read that data

quaint mantle
#

there's absolutely nothing wrong with that

restive mango
#

Yeah, but I'm instantiating the same object in multiple different classes

#

Like to use the prior example, I might need that 2-4-6 cube in multiple different classes, I'd really prefer to only need to make it once.

quaint mantle
#

you do realize

#

in java you can store references

#

they're called variables

restive mango
#

yeah, but how would I create that and then use it? Would I just run it in OnEnable?

quaint mantle
#
class A {
    Some ref;

    A(Some ref) {
        this.ref = ref;
    }
}

class B {
    Some ref;

    B(Some ref) {
        this.ref = ref;
    }
}

// some class
Some some = new Some();
A a = new A(some);
B b = new B(some);

assert a.ref == b.ref;
#

@restive mango are you a rust user

restive mango
#

nay

quaint mantle
#

mkay cause this seems like a very rust user migrating to java type of question

restive mango
#

I will be honest, I don't understand your code snippet

west scarab
#

Does anyone know how to convert a string to a material?
here is code:

                String b = getConfig().getString("clicker" + i);
                Block b2 = // need help here```
eternal oxide
#

you can't get a Block from a Material

west scarab
#

so like inn my config i have like

#

clicker1: "white concrete"

#

would I have to name it like WHITE_CONCRETE

#

and then how would i convert from there?

eternal oxide
#

it would be easier if you did

west scarab
eternal oxide
#

Material.matchMaterial(string)

west scarab
#

so

#

Block b = Material.matchMaterial(string)

#

?

eternal oxide
#

No. I already said you can;t get a Block from a Material

#

Material mat = Material.matchMaterial(string)

golden turret
#

I'm using ProtocolLib to intercept the PacketPlayOutSpawnEntityLiving to cancel the packet.
It is working fine for entities like creeper but it is not being fired for armor stands.
I also tried PacketPlayOutSpawnEntity but it is not being fired too.
What could I do?

ornate patio
#

how do i get the nearest type of block to an entity

#

For example, the nearest water block to a horse

quaint mantle
#

scheduling

#

?scheduling

undone axleBOT
worldly ingot
west scarab
worldly ingot
#

Yeah I'm not sure what scheduling has to do with anything here. Though I don't think there's a solution to this at all

#

There's no guarantee of the order in which the client receives the message packets

rocky latch
#

Hi

#

help me pls

worldly ingot
#

Not as far as I'm aware

rocky latch
#

thai language can't send in my serverchat

worldly ingot
#

Presumably that says "Unicode chat is not allowed." Sounds like a plugin you have installed that doesn't want to allow for unicode characters

#

#help-server is probably better for that, unless you wrote the plugin

worldly ingot
#

LuckPermsChat? That might do that.
EDIT: I see no mention of "Unicode" in the LPC GitHub. Probably not

quaint mantle
#

What does "An internal error occurred while attempting to perform this command" usually means

vocal cloud
#

Means you made a mistake

quaint mantle
#

any specifications?

quaint mantle
ornate patio
#

(ping me if you respond pls)

#

ok honestly im so lost

#

how do i make a horse pathfind to the nearest water source without actually stepping in

#

I'm using NMS and this is my first time messing with pathfinding

#

I'm also using mojang mapped

quaint mantle
#

minecraft news

#

developer codes horses to take a piss in the nearest river

ornate patio
#

uhh

#

i

#

well

#

nice

ornate patio
# ornate patio ok honestly im so lost

i have no idea what I'm doing, this is what I've got

BlockPos blockPos = new BlockPos(getX() + 10, getY(), getZ());
getNavigation().createPath(blockPos, 1);   
#

doesn't do anything

quasi patrol
#

Can you get the cause of the teleport from Entity Teleport Event, like whether or not it is natural or /tp

west scarab
#

would this work??

worldly ingot
west scarab
#

i want it to set that integer to somthing if x is x basically

humble tulip
#

Stuff that haopens if the stuff in the if is true goes after the if

#

Not before

#

If (x) {
Stuff
}

west scarab
#

ik but it's not working it's not registering that give is set when i do that

#

it's being weird

humble tulip
#

Can u show ur code

#

?paste

undone axleBOT
west scarab
#

yea 1s

#

    private Integer getint(Material o) {
        Integer give = 1;
        if(o == Material.WHITE_CONCRETE) {
            Integer give = 3;
        }
        if(o == Material.ORANGE_CONCRETE) {
            Integer give = 5;
        }
        return give;
    }```
drowsy helm
#

you are redeclaring give outside of the scope

#

give = 5

#

instead of Integer give = 5

#

and why non primitve integer?

west scarab
#

wym

drowsy helm
#

why are you using Integer

#

and not int

west scarab
#

🤷‍♂️

drowsy helm
#

but yeah

private int giveInt(Material o){
  int give = 1;
  if(lbah blah blah){
    give = 3;
  }
  if(2bhahaljads){
    give = 5;
  }
return give;
}```
#

idk how that isnt giving oyu errors

west scarab
#

it is

#

now

humble tulip
#

That can't give errors

west scarab
#

thanks for helping im new to java lol just started last night

west scarab
drowsy helm
#

you're declaring a new variable with the same name

humble tulip
#

Ohh i watched what u sent

#

My bad

#

He already defined give and tried to redeclare it

desert loom
drowsy helm
#

or switch

desert loom
#

yep

drowsy helm
#

or even better immutable map

west scarab
#

would this work?

    private Integer getint(Material o) {
        int i = 1;
        int give = 0;
        while(i < 16) {
            if(o == Material.matchMaterial(getConfig().getString("clicker" + i))) {
                give = getConfig().getInt("amt" + i);
            }
            i++;
        }
        return give;
    }```
drowsy helm
#

what are you trying to do?

west scarab
#

ok so in my config i have this,

Unique: 0

clicker1: "white_concrete"
clicker2: "orange_concrete"
clicker3: "magenta_concrete"
clicker4: "light_blue_concrete"
clicker5: "yellow_concrete"
clicker6: "lime_concrete"
clicker7: "pink_concrete"
clicker8: "gray_concrete"
clicker9: "light_gray_concrete"
clicker10: "cyan_concrete"
clicker11: "purple_concrete"
clicker12: "blue_concrete"
clicker13: "brown_concrete"
clicker14: "green_concrete"
clicker15: "red_concrete"
clicker16: "black_concrete""

amt1: 1
amt2: 3
amt3: 5
amt4: 10
amt5: 20
amt6: 40
amt7: 100
amt8: 150
amt9: 220
amt10: 250
amt11: 300
amt12: 500
amt13: 1000
amt14: 2500
amt15: 5000
amt16: 10000```

Im trying to detect the block type then detect which number it would be from the config, then return the amt with that number if that makes since
drowsy helm
#

yeah that should work but its probs not the best way to do it

west scarab
#

is there a better way without doing like 100 lines lol

drowsy helm
#

with yml you can have children varibles

#

so

#
clicker1: "white_concrete"
 - amt: 1
#

for example

#

or even better

#
white_concrete: 1
ornate patio
#

what even is a scalar

drowsy helm
#

then you can just get the Material name

private Integer getint(Material o) {
  String name = //Whatever to get material name
  return getConfig().getInt(name);
}
drowsy helm
ornate patio
#

alright

drowsy helm
#

i might be wrong though

#

for the mostpart a scalar is a float that multiplies a value

ornate patio
#

also is AttributeModifier a good use case for this scenario:
A player who changes the movement speed of a horse by right clicking a stick to cycle between 4 different speeds (Walk, Trot, Canter, Gallop)

carmine valley
#

hey guys I'm currently working on a plugin, I had the first class working but when I made a new class and started working on it my initial code just stopped working. Any idea why's that? I'm using these for my listeners in each class: ```cpp
getServer().getPluginManager().registerEvents(new Knockback(this), this);
getServer().getPluginManager().registerEvents(new DoubleJump(this), this);

#

main ^

drowsy helm
ornate patio
#

alright ty

drowsy helm
carmine valley
#

sure

#
public class Knockback implements Listener {
    private MCBrawl plugin;
    private Map<UUID,Double> heatMap = new HashMap<>();

        public Knockback(MCBrawl plugin) {
            this.plugin = plugin;
        }

    @EventHandler
    public void onPlayerHitPlayer(EntityDamageByEntityEvent event) {
        if (event.getDamager() instanceof Player && event.getEntity() instanceof Player) {
            double heatValue = heatMap.get(event.getEntity().getUniqueId());
            heatValue++;
            heatMap.put(event.getEntity().getUniqueId(), heatValue);
            LivingEntity damaged = (LivingEntity) event.getEntity();
            LivingEntity damager = (LivingEntity) event.getDamager();
            Vector damagedV = damaged.getLocation().toVector();
            Vector damagerV = damager.getLocation().toVector();
            Vector velocity = damagedV.subtract(damagerV).normalize().multiply(heatValue);
            damaged.setVelocity(velocity);
            if (heatValue >= 7) {
                Bukkit.getScheduler().runTaskLater(plugin, () -> {
                    damaged.setVelocity(velocity.clone());
                }, 6);
                if (heatValue >= 10) {
                    Bukkit.getScheduler().runTaskLater(plugin, () -> {
                        damaged.setVelocity(velocity.clone());
                    }, 2);
                    if (heatValue >= 15) {
                        Bukkit.getScheduler().runTaskLater(plugin, () -> {
                            damaged.setVelocity(velocity.clone());
                        }, 3);
                    }
                }
            }
        }
    }
    @EventHandler
    public void onJoin(PlayerJoinEvent event2) {
        heatMap.put(event2.getPlayer().getUniqueId(), 0.0);
    }
    @EventHandler
    public void onDeath(PlayerDeathEvent event3) {
        heatMap.put(event3.getEntity().getUniqueId(), 0.0);
    }
        }```
drowsy helm
#

and its just not calling the events?

carmine valley
#

that's the initial one that stopped working and can't get it back to work

#

I literally even erased all the code I wrote after it and it still won't work

#

I gotta start using github for shit like that

waxen plinth
#

GitHub ≠ git

drowsy helm
#

how are you verifying that its not being called?

carmine valley
drowsy helm
#

just do a printline on one of the events

#

if its being printed, the event is being called

#

if not it means it's not being registered correctly

carmine valley
#

sure lemme try that and get back to ya

carmine valley
drowsy helm
#

yeah the registerEvents method

#

make sure thats being called aswell

carmine valley
#

with a print statement too?

drowsy helm
#

yeah

#

mind sending your main class aswell

carmine valley
#

so smth like that? cpp System.out.println("MCBrawl loaded successfully!"); getServer().getPluginManager().registerEvents(new Knockback(this), this); System.out.println("Register events working 1"); getServer().getPluginManager().registerEvents(new DoubleJump(this), this); System.out.println("Register events working 2");

drowsy helm
#

yeah

carmine valley
#

that's my main ```cpp
package me.r3dx.mcbrawl;

import org.bukkit.plugin.java.JavaPlugin;

public final class MCBrawl extends JavaPlugin {

@Override
public void onEnable() {

    System.out.println("MCBrawl loaded successfully!");
    getServer().getPluginManager().registerEvents(new Knockback(this), this);
    System.out.println("Register events working 1");
    getServer().getPluginManager().registerEvents(new DoubleJump(this), this);
    System.out.println("Register events working 2");
}

@Override
public void onDisable() {
    System.out.println("MCBrawl terminated successfully!");
}

}

drowsy helm
#

don't see why that wouldnt work

carmine valley
#

interesting

#

no messages at all in my console

#

regarding my plugin ofc

drowsy helm
#

are you getting any errors when loading

carmine valley
#

none

#

all other plugins are working fine

#

essentials, world edit, etc

drowsy helm
#

its showing up on /plugins right?

carmine valley
#

lemme check

bronze swan
#

where can I find resources on getting started making a plugin for the latest version of minecraft

carmine valley
#

I think it has to do with 1.19, it stopped working right after it released

drowsy helm
carmine valley
bronze swan
drowsy helm
#

NAh not really sorry

bronze swan
carmine valley
drowsy helm
#

so is it showing up in /plugins?

#

i see nothing wrong with your code

carmine valley
#

like random block drops

#

dream typpa beat

carmine valley
drowsy helm
#

agreed, i learnt the most from actually making plugins

#

even if i didnt post them

bronze swan
#

yeah I have an idea of what I want to make even though it's a bit complex

carmine valley
#

the more complex the more fun and the more you'll learn

hybrid spoke
#

if you dont know what you have to do, you will learn the most

bronze swan
#

I want to make use of something called multipaper so I can have hundreds of players in one map

#

so I need to develop something specifically to work with multipaper

carmine valley
#

oh multiverses plugin typpa beat?

west scarab
#
  @EventHandler
    public void clicker(PlayerInteractEvent event) {
        Player p = event.getPlayer();
        Block b = event.getClickedBlock();
        UUID u = p.getPlayer().getUniqueId();
        Integer bal = Balance.getOrDefault(u, 0);
        Integer clicks = Clicks.getOrDefault(u, 0);
        if (event.getAction() == Action.RIGHT_CLICK_BLOCK) {
            Material o = b.getType();
            b.setType(Material.OBSIDIAN);
            Clicks.put(u, +1);
            Integer give = getint(o);
            Integer bal2 = bal+give;
            String msg = color("&f&l+ &a$") + bal2 + " &f&l+ &e" + Clicks.get(u);
            p.sendMessage(msg);
            p.spigot().sendMessage(ChatMessageType.ACTION_BAR, new TextComponent(msg));
            Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
                public void run() {
                    b.setType(o);
                }
            }, (3*20));

            return;
        }
    }```
**why isn't it registering the click event?**
hybrid spoke
#

?paste

undone axleBOT
bronze swan
#

multiverses is multiple worlds on one server right?

carmine valley
#

I want to work on smth like that too soon

drowsy helm
west scarab
drowsy helm
#

can you show me that code

bronze swan
#

multipaper is the opposite, it's multiple servers sharing the load of one world

west scarab
#
    @Override
    public void onEnable() {
        Bukkit.getPluginManager().registerEvents(this, this);
        getConfig().options();
        saveDefaultConfig();
    }```
drowsy helm
carmine valley
#

@drowsy helm nope not showing /pl

drowsy helm
bronze swan
#

yeah I checked out mammoth unfortunately it's discontinued

#

mammoth recommended me to multipaper so that's what I'm going to try to use

west scarab
#

yes

drowsy helm
#

oh really? I thought it was still going

bronze swan
#

I think it only discontinued recently

drowsy helm
west scarab
drowsy helm
#

see if its firing at all

#

and is your class implementing Listener?

west scarab
#

yep

bronze swan
#

do you know what hypixel and similar servers use to create a bunch of different lobbies and minigames in one server? is that the multiverses plugin or something similar?

west scarab
#
package lunarcore.core;

import net.md_5.bungee.api.ChatMessageType;
import net.md_5.bungee.api.chat.TextComponent;
import org.bukkit.*;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.Action;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.plugin.java.JavaPlugin;
import java.util.HashMap;
import java.util.UUID;

public final class clickers extends JavaPlugin implements Listener {

    @Override
    public void onEnable() {
        Bukkit.getPluginManager().registerEvents(this, this);
        getConfig().options();
        saveDefaultConfig();
    }

    public String color(String text) {
        return ChatColor.translateAlternateColorCodes('&', text);
    }


    @EventHandler
    public void clicker(PlayerInteractEvent event) {
        Player p = event.getPlayer();
        p.sendMessage("testing");
        Block b = event.getClickedBlock();
        UUID u = p.getPlayer().getUniqueId();
        Integer bal = Balance.getOrDefault(u, 0);
        Integer clicks = Clicks.getOrDefault(u, 0);
        if (event.getAction() == Action.RIGHT_CLICK_BLOCK) {
            Material o = b.getType();
            b.setType(Material.OBSIDIAN);
            Clicks.put(u, +1);
            Integer give = getint(o);
            Integer bal2 = bal+give;
            String msg = color("&f&l+ &a$") + bal2 + " &f&l+ &e" + Clicks.get(u);
            p.sendMessage(msg);
            p.spigot().sendMessage(ChatMessageType.ACTION_BAR, new TextComponent(msg));
            Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
                public void run() {
                    b.setType(o);
                }
            }, (3*20));

            return;
        }
    }

    private Integer getint(Material o) {
        int i = 1;
        int give = 0;
        while(i < 16) {
            if(o == Material.matchMaterial(getConfig().getString("clicker" + i).toUpperCase())) {
                give = getConfig().getInt("amt" + i);
            }
            i++;
        }
        return give;
    }


    public static HashMap<UUID, Integer> Balance = new HashMap();
    public static HashMap<UUID, Integer> Clicks = new HashMap();

}```
carmine valley
drowsy helm
#

servers like minehut use kubernetes

#

and a heavily modified bungeecord

bronze swan
#

what does it mean to manually deploy your server instances?

drowsy helm
bronze swan
#

like what does it mean to "deploy" them

west scarab
drowsy helm
#

like they create and configure their servers

#

and minihubs etc

carmine valley
drowsy helm
bronze swan
#

how does bungeecord do it?

drowsy helm
#

bungeecord is whats called a proxy

#

all it does is take one ip and spread packets to different servers

carmine valley
west scarab
#

proxies connect multiple servers together and can connect a player between each server

#

i thinkk

drowsy helm
#

yeah correct

bronze swan
#

are there disadvantages to using proxies over the way hypixel does it

drowsy helm
#

hypixel uses a proxy

#

and network uses a proxy

bronze swan
#

wait so how is it different?

drowsy helm
#

proxies and server instancing are two different things

west scarab
#

basically say you buy 3 servers, you can configure them in a single bungeecord server (a proxy / hub server,) and then you can do /server (server name) once it's configured to connect.

drowsy helm
#

proxies are what manages traffic between servers, instancing is deciding what servers are in that network

bronze swan
#

so adding/removing servers from being managed by the proxy?

drowsy helm
#

yeah exactly

#

all the proxy does is make it so i can connect to all those servers through 1 ip

bronze swan
#

so just what servers are currently active and inactive

drowsy helm
#

yeah exactly

carmine valley
#

woah that's weird, I found that in my maven repo <java.version>1.8</java.version>

drowsy helm
#

MultiPaper is one big proxy

#

but with extra features

carmine valley
drowsy helm
#

and seeing if its firing at all

drowsy helm
#

you should probably upgrade but its still fine to run with

slate mortar
carmine valley
#

what's that then?

drowsy helm
#

^ java version

bronze swan
carmine valley
bronze swan
#

what would that hierarchy look like

west scarab
slate mortar
#

i'd personally use 18 for 1.19 or 17 for 1.18

west scarab
#

it went in console

bronze swan
#

like a proxy that controls multiple other proxies?

carmine valley
#

I will change it to 17 and see if anything changes

drowsy helm
#

they are not technically there

bronze swan
#

yeah like npc characters that replicate the movements of players in other servers

drowsy helm
#

yeah

bronze swan
#

yep i've seen that in a few different games

drowsy helm
#

its just good because you are splitting actual game calculations to different servers

carmine valley
#

is this the right version to use for 1.18.2 ? cpp <groupId>org.spigotmc</groupId> <artifactId>spigot-api</artifactId> <version>1.18.2-R0.1-SNAPSHOT</version>

drowsy helm
#

all the server has to do is handle packets

drowsy helm
drowsy helm
bronze swan
#

or is it fine

drowsy helm
#

if they are coded well they shouldn't have issues

bronze swan
#

that's what I was thinking

drowsy helm
#

but there is always a latency issue that will occur naturally

bronze swan
#

I have heard about issues with projectiles and such on servers that use similar architecture

drowsy helm
#

thats why mammoth never implemented pvp im pretty sure

bronze swan
#

oh it didn't?

drowsy helm
#

I might be wrong but in the early stages they didnt

carmine valley
#

hey buoo mind if I send you console ss to see if you can see anything that I'm not seeing?

drowsy helm
#

sure

bronze swan
#

I definitely cannot go without pvp in what I am trying to use multipaper for so I hope it doesn't have the same problem

drowsy helm
#

on my rpg server i split each world into a different server

upper tendon
#

As my server runs, it slowly uses more and more RAM, does that mean I have a memory leak, or...?

drowsy helm
#

and each town i did something called server meshing

carmine valley
bronze swan
drowsy helm
carmine valley
bronze swan
#

oh yeah that's easy

upper tendon
bronze swan
#

did you do server meshing all over the server?

drowsy helm
bronze swan
#

was it all location based?

carmine valley
upper tendon
drowsy helm
drowsy helm
carmine valley
#

I didn't see that before

#

so the version is the problem?

drowsy helm
#

and each town had a different amount of instances depending on the player capacity

drowsy helm
#

should be fine

carmine valley
#

it's already 1.18.2

drowsy helm
#

latest 1.18.2 though?

carmine valley
#

lemme check

#

so update the spigot api?

drowsy helm
#

and the version your server is running

bronze swan
#

do you have any suggestions for how I should structure that

drowsy helm
#

tahts sorta how mine was structured

#

will it be very pvp centric?

#

if so probably your best option is to instance per world

#

so 1 instance for nether, 1 for overworld, and 1 for end

#

thats probs the best you can do

bronze swan
#

idk if that would work for me if I want a larger worl

#

world

#

also that's a good point to make I didn't even consider the other dimensions

drowsy helm
#

yeah it atleast spreads the load by 3

#

but as for regular survival you don't really have much options

#

if you're a REALLY good coder you could implement server meshing for each few hundred chunks

#

but then again you can run into issues

bronze swan
#

idk if server meshing based on location is a good approach for me

drowsy helm
#

yeah probably not

#

whats your projected player count?

#

probably the biggest issue with pvp survival is that you can't vertically scale, you're limited to one server

bronze swan
#

I want to be able to scale as much as I need to

carmine valley
carmine valley
#

I just deleted the api-version line from my plugin.yml file and it works fine now

#

than you very much for the help, I really appreciate it <3

drowsy helm
#

but that splits your community

bronze swan
#

yeah that's not what I want

bronze swan
#

otherwise I wouldn't use multipaper at all and would just make multiple survival servers

#

what appeals to me about multipaper is that i want to have hundreds of players all fighting and competing in one big world

drowsy helm
#

yeah i dont really think you can. Like i've seen survival servers with 300+ players

#

but they have some serious fucking server power

bronze swan
#

yeah but multipaper's whole purpose is to spread the load

#

mammoth could host 1000 players in one area in the example I saw

drowsy helm
#

yeah

#

if it was non pvp, you could easily do that

#

im not entire sure on the latency though

bronze swan
#

what complicates it when pvp is involved

drowsy helm
#

if its two servers on the same network, i dont think it would honestly be that bad

bronze swan
#

what do you mean

drowsy helm
#

like say you had 2 nodes on multipaper if they are on the same network the latency would not be bad for pvp

bronze swan
#

oh I was just using 2 as an example

#

I would probably have many more as the server expands

drowsy helm
#

yeah either way if all of them are on the same lan the latency would be minimal

torn shuttle
#

I am having the world's most specific issue, I was trying to put a schematic file in the resources of my plugin but compiling the plugin makes the gson compression break on the schematic, rendering it unusable. Has anyone else had this issue?

drowsy helm
#

oh sup magma havent seen you in a while

bronze swan
#

how might I break up the load if not by set locations

drowsy helm
#

aside from multipaper, nothing really

#

multipaper ise more designed for mmo rpgs though

#

not survival

bronze swan
#

does multipaper only let you break up servers by set locations?

drowsy helm
#

no

#

it works everywhere

bronze swan
#

I'm trying to figure out what way I should break up the load

drowsy helm
#

yeah im trying to say for survival there is none

#

thats why you dont see huge survival servers

bronze swan
#

what do you mean there is none though? why?

#

surely there is a way

drowsy helm
#

logistically there isnt a way without big latency issues or other inconveniences

bronze swan
#

i would think this would be a solved problem considering how many massive mmos use similar technology though

drowsy helm
#

like minecraft mmos

#

or actual mmos

bronze swan
#

actual mmos

torn shuttle
#

actual modern mmos do layering these days

drowsy helm
#

most mmos use location based server meshing

bronze swan
#

all of the minecraft mmos i've seen have been confined to a set area

#

what if your mmo isn't confined to a small area

drowsy helm
#

and they dont use shitty minecraft packets

#

same thing as multipaper does

bronze swan
#

I just don't think location based server meshing is the only way to go about things

#

could you do like region based server meshing or something?

drowsy helm
#

wdym region based?

bronze swan
#

like all players in a certain region are managed by the same server

#

or multiple servers dedicated to that region

drowsy helm
#

yeah definitely

#

but latency

#

like i said, its either latency or inconveniences

bronze swan
#

what if you made a system that puts players onto the same server the moment they start to engage in combat

drowsy helm
#

inconvenience

#

that is slow

#

loading screens

bronze swan
#

so you should only set what server a player is on when they first join?

#

how did you avoid loading screens when moving to different spots on your map

#

or did you?

drowsy helm
#

i didnt, i just minimised them as much as possible

#

there was still loading but only like 2-3 seconds

#

but that took a lot of server jar modification

bronze swan
#

well I don't know what to do if there is no reasonable way to dynamically adjust what server a player is on without annoying loading screens

drowsy helm
#

yeah for survival there just isnt

bronze swan
#

I'm determined to find a way to make it work

drowsy helm
#

aside from dimension instances, thats it

west scarab
#

hey @drowsy helm quick question, in configs how do you get the children thingys you were talkin abt?

#

like with the "- " 's

#

what would the path be ^^

drowsy helm
#

ignore my spacing in the yml its probably off

west scarab
#

no i mean like

#

in the getConfig().getString("path");

#

what'd the path be?

drowsy helm
#

yeah it would be a.b

#
node1:
 - node2:
   - node3:

node1.node2.node3 to get the last node

west scarab
#

ahh

#

ok thx!

bronze swan
bronze swan
#

in mmo games when you travel between different areas do you typically have an accompanying loading screen

#

I wouldn't think so right

drowsy helm
#

no but mmos use their own server code

#

we are limited to minecraft

bronze swan
#

so minecraft's server code needs to change in order for this to be in any way possible

drowsy helm
#

yeah pretty much

upper tendon
#

I ran a memory analysis on my plugin, and there's nothing really concerning... the program says the PlayerChunkMap and ChunkProviderServer are "leading suspects," but obviously I don't think that's the issue. And in terms of objects of my classes, there's only an amount of each that there should be... so why would I keep gaining memory usage in my server over time?

drowsy helm
upper tendon
#

No, it just slowly increases until it maxes out at the 8gigs I assigned...

drowsy helm
#

e.g player joining, leaving, breaking blocks, typing command etc

bronze swan
drowsy helm
#

if its over time i would check out your runnables

#

make sure you arent holding hard references to Player

drowsy helm
#

and i really doubt microsoft want's to remake the notchian server any time soon

bronze swan
#

if the two servers are physically very close to one another will there be a lot of latency between them?

upper tendon
drowsy helm
#

if they are on the same network the latency should be really low

bronze swan
#

pvp would probably work if all of your servers are on the same network then right

#

without the need for either of the players' server to change or anything

drowsy helm
upper tendon
#

kk

drowsy helm
bronze swan
#

oh so this can be a lot simpler than I thought I just need to ensure that servers have very minimal latency

#

isn't latency an issue in many individual servers with pvp anyways?

drowsy helm
#

yeah exactly, as long as the servers are on the same lan, a modern datacenter should not have much latency

bronze swan
#

like latency between players

drowsy helm
#

yeah, but it just adds on top

bronze swan
#

yeah definitely

#

but that's the challenge that comes with this kind of scaling

#

I think this idea is pretty feasible

drowsy helm
#

tell me how it goes

bronze swan
#

actually I still don't understand how to fix the issue

#

I obviously still need to update the players' server as they move around still

#

but I cannot have any loading screens or anything of that nature

#

that would be terrible in a competitive pvp environment

drowsy helm
#

multipaper does all of that for you

bronze swan
#

yeah but with significant drawbacks to the actual gameplay

drowsy helm
#

or were you planning on making your own implementation

bronze swan
#

I'm not sure

drowsy helm
#

i mean what drawbacks?

#

its probably pretty well optimized

bronze swan
#

like constant loading screens as you move around

#

wait

#

that wouldn't be a problem nevermind

#

I fried my brain talking about this so much lol it should be fine

drowsy helm
#

yeah multipaper isnt location based

#

lmao

bronze swan
#

as long as the player isn't changing their server it should be fine

#

I think region based server meshing would work fine

#

and makes the most sense for what I want to do

drowsy helm
#

i mean logically it would be best aswell

#

players on at the same time are most likely in the same timezone

bronze swan
#

yeah exactly

drowsy helm
#

but your proxy would still bottleneck it

bronze swan
#

what do you mean?

#

I've heard that term before but don't really know what it means

drowsy helm
#

you can only have 1 proxy, if the proxy is in the US and say your node is in Australia, the people on the Australian nodes still have to go through the US proxy

bronze swan
#

the proxy is what the player connects to in order to join the server right?

#

so every action would have to go through the proxy?

drowsy helm
#

yeah

upper tendon
drowsy helm
#

is it a big plugin?

#

I dont mind reading through it if its not too big

upper tendon
#

No it's just a bingo game I made for practice

drowsy helm
#

send through the repo

bronze swan
#

@drowsy helmmay i send you an image in your direct messages?