#help-development

1 messages Ā· Page 1104 of 1

fading beacon
#

anyone knows a way to make player drown faster after losing all remaining air?

rough ibex
#

deal more damage

eternal oxide
young knoll
#

When they take drowning damage

#

Send in the air strike

fading beacon
#

taking less time to reach default final damage

#

idk how to explain myself

eternal oxide
#

thats exactly what I just described to you

#

do more damage per tick of drowning

fading beacon
#

ohh ok

echo basalt
#

šŸ¤” how would I rotate it a lil more to make the center face the target instead of the corner

eternal oxide
#

don;t target the location of the player, but center it

#

the Player#getLocation is the players corner

echo basalt
#

I really don't think that's the case

#

otherwise it'd fuck with bounding boxes

eternal oxide
#

I thought it was. same as blocks

echo basalt
#

With blocks it's understandable because locations get floored

eternal oxide
#

blocks also have a BB

echo basalt
#

I believe the problem comes from display entity rotation being applied from the corner

young knoll
#

Yeah player location should be the center of the lower bounds of their bounding box

eternal oxide
#

okies

echo basalt
#

elgar spreading misinformation !!

eternal oxide
#

yep, sending everyone off in the wrong directions

echo basalt
#

I should start charging you 5 bucks every time I correct you

eternal oxide
#

I'd start using an alias

young knoll
#

Item displays rotate from the center

#

I find them easier to work with in that regard

eternal oxide
#

So this issue is just @echo basalt being bad at math then 😦

echo basalt
#

these are block displays

#

ezpz

young knoll
#

Then you have to add a 0.5 0.5 0.5 translation

#

And rotate that was well

stuck oar
#

how would i like remove colors from a string

echo basalt
#

ChatColor.stripColor

stuck oar
#

can i do it in an if statement

#

with a . thingy

#

if (meta.getDisplayName()..contains("Pig Head"));

eternal oxide
#

lol

stuck oar
#

i would like to do that but the item i want is colored

eternal oxide
#

yes

echo basalt
#

?pdc

eternal oxide
#

if (ChatColor.stripColor(meta...).contains)

echo basalt
#

there's no good reason to do those checks. ever

echo basalt
#

because we have a proper solution for identifying items, entities

eternal oxide
#

too easy to exploit

#

slap item in anvil and rename to Pig Head

stuck oar
#

oh ye

#

uh

#

what about if i check the item

eternal oxide
#

too early version for pdc?

stuck oar
#

its a player head

stuck oar
eternal oxide
#

yes

#

1.14+

fading beacon
stuck oar
#

just remove void i think

#

wait no

#

dont

#

silly me

eternal oxide
#

um, fix what?

stuck oar
#

yeh it seems fine

eternal oxide
#

did you register the listener/

young knoll
#

I wonder what setting maximum air to 0 does

fading beacon
#

yes

echo basalt
#

1.8 is early enough for..

#

?1.8

undone axleBOT
fading beacon
#

im trying to make player drown REAL quick

young knoll
quaint mantle
#

hey! im new to plugin development and want to start coding in kotlin! im looking for some resources that'd help me learn the language (specifically for plugin development) or advice on it. if any of you have resources youre willing to share, id more than appreciate it!

young knoll
#

?learnkotlin

#

What a shame

#

@remote swallow where learn Kotlin

eternal oxide
#

the bot should laugh when prompted with ?learnkotlin

echo basalt
young knoll
#

It’s like the potato snapshot

echo basalt
#

new pfp

remote swallow
#

just go

#

real answer i know is just look at some kotlin spigot code and look up what the operators do

young knoll
#

lol

#

Do they not have a tutorial

remote swallow
#

they probably do

#

i just didnt read it

runic kraken
#
            EntityPlayer nmsPlayer = ((CraftPlayer) player).getHandle();

            // Get the current food level and saturation
            int foodLevel = nmsPlayer.getFoodData().getFoodLevel();
            float saturationLevel = nmsPlayer.getFoodData().getSaturationLevel();
#

how to fix this

#

spigot 1.18.2

echo basalt
#

why does your profile pic look like if @tender shard was normal

young knoll
runic kraken
young knoll
#

?mappings

undone axleBOT
runic kraken
#

I don't know how to do it correctly

runic kraken
young knoll
#

Again why not use the api

runic kraken
young knoll
#

I mean you can still use the api methods

#

It’s just numbers, you can still pass them to whatever packet system you are using

stuck oar
#

Class:

if (xpneeded <= xp) {
                    System.out.println("Experience is higher");
                    p.sendMessage("§4§l(!) §4No XP was gained because you have hit the maximum xp for this level.");
                    p.sendMessage("§d§l(!) §dYou have sold " + ChatColor.LIGHT_PURPLE + item.getAmount() + "§d§nPig Heads§d for $" + ChatColor.LIGHT_PURPLE + moneyGained);
                    econ.depositPlayer(p, moneyGained);
                }```

Config:

```pig:
  sellprice: "1999999"
  tier: "basic"
  displayname: "§d§nPig Head"
  lore1: "§d§l* §7Required Level: §d1"
  lore2: "§d§l* §7Head Price: §d$2"
  playername: "MHF_Pig"```

Error:

```class java.lang.Integer cannot be cast to class java.lang.Double (java.lang.Integer and java.lang.Double are in module java.base of loader 'bootstrap')```


anyone know how to fix? i cant do econ.deposit unless the argument is a double but the config isnt a double
slender elbow
#

why not use getFloat instead?

stuck oar
#

what will that return

#

i need a double

#

oh i can do getDouble

slender elbow
#

does getDouble exist?

stuck oar
#

it does in 1.8.8

slender elbow
#

šŸ’€

stuck oar
#

imma check if that works

#

that works

#

im stupid haha

thorny salmon
#

i have created some items with my plugin but how to apply resourcepack to these items? i am not good with resourcepack so i dont know how to do it. does anyone know how to do this?

lost matrix
#

There is a tag on ItemStacks called CustomModelData. You can set this tag via the Spigot API and write a predicate in your model.json file within your resourcepack.

lost matrix
# thorny salmon i have created some items with my plugin but how to apply resourcepack to these ...

Here is an example for this:

{
  "parent": "minecraft:item/generated",
  "textures": {
    "layer0": "minecraft:item/paper"
  },
  "overrides": [
    {
      "predicate": {
        "custom_model_data": 1
      },
      "model": "minecraft:item/iron_pp"
    },
    {
      "predicate": {
        "custom_model_data": 2
      },
      "model": "minecraft:item/gold_pp"
    },
    {
      "predicate": {
        "custom_model_data": 3
      },
      "model": "minecraft:item/diamond_pp"
    }
  ]
}

This will override items of type PAPER if they have a custom model data of 1, 2 or 3.
Just make sure the referenced files (in this case iron_pp.json, gold_pp.json, diamond_pp.json) are in their proper location.

thorny salmon
lost matrix
#

Ignore it

worldly ingot
#

heh

#

gold pp

rough ibex
#

DIAMOND pp

torn shuttle
#

you can't say that

rough ibex
#

i just did B)

torn shuttle
#

@worldly ingot ban this filth

rough ibex
#

D:

torn shuttle
#

alright cool I solved the mystery of the broken textures, turns out I was the murderer all along

lucid fog
#

can i somehow instantly try out the plugin im working on? (im sorry if i have stupid questions im used from making mods)

#

debugging the smallest things takes so much time

torn shuttle
#

hotloading

lucid fog
#

whats that

torn shuttle
#

you know loading? imagine if it was hot

lucid fog
#

what ā˜ ļø

sly topaz
#

using Jetbrains JDK, you can hotreload most stuff

lucid fog
#

wtf is hotreload

#

pls explain like im 10 years old

sly topaz
#

remote hotswap tl;dr:

  1. download the jbr runtime from here https://github.com/JetBrains/JetBrainsRuntime/releases/
  2. download hotswap agent from here https://github.com/HotswapProjects/HotswapAgent (read the "Easy to start" section)
  3. in IDEA, right beside the "Run" button, click to edit configurations, click to add a new configuration, "Remote JVM Debug"
  4. copy the remote JVM command line arguments
  5. on your server command line...
  • Use jbr runtime's java
  • Add -javaagent:hotswap-agent.jar=disablePlugin=Log4J2 -XX:+AllowEnhancedClassRedefinition (I think you don't really need to put it in the hotswap folder considering you are specifying the agent manually?)
  • Add the remote JVM command line arguments that you copied from IDEA
  1. after the server started, "debug" the newly created configuration, it will attach to the running server
  2. recompile a class
  3. success (hopefully), you may need to manually reload the classes in Run -> Debugging Tools -> Reload Changed Classes

note: you need to use a mojmapped server (iirc)

there's more info about remote debugging in IDEA here: https://www.jetbrains.com/help/idea/tutorial-remote-debug.html#create-run-configurations

lucid fog
#

i dont know half of the words youre using

#

thanks for trying

sly topaz
lucid fog
#

oh

#

can i just change where the maven saves packaged jar files

sly topaz
#

I mean, sure

lucid fog
#

oh wait im not doing it on a hosted server

#

if u thought that

#

im using a local thing

lucid fog
torn shuttle
# lucid fog soo how do i do it

buddy it doesn't matter if you're hosting it on your pc on on elon's secret martian space station, you're still running server software

lucid fog
#

yess but i just meant that im still keeping the jar on my pc

#

like i dont need no transporting things i dont really understand those instructions but it sounded like it

torn shuttle
#

and I should really redo my setup

lucid fog
#

are yall speaking english at this point

torn shuttle
#

come back when you are not, in fact, 10 years old

sly topaz
# lucid fog soo how do i do it
<properties>
    <dir>${project.build.directory}</dir>
</properties>

<!-- make sure to replace the version of the maven-jar-plugin, you already must have it in your POM -->
<plugins>
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>YOUR_VERSION</version>
        <configuration>
            <outputDirectory>${dir}</outputDirectory>
        </configuration>
    </plugin>
</plugins>
lucid fog
sly topaz
# lucid fog tysm

you still have to do -Ddir=path/to/server/dir in the run configuration though (so, it'd be mvn -Ddir=... clean package)

#

if you don't want to do that, just set the value directly in the pom

#

that is, change <dir>${project.build.directory}</dir> to <dir>path/to/server/dir</dir>

lucid fog
#

wait so is this all

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.2.0</version>
                <configuration>
                    <outputDirectory>C:/Users/PC/Desktop/Servers/1.21 spigot server/plugins</outputDirectory>
                </configuration>
            </plugin>
            </resource>```
#

i dont have anything in the properties

    <properties>
        <java.version>21</java.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>
#

oh yeah it works thank u so much

unique shuttle
#

Hi! I'm trying to set an item to an ItemDisplay via packets, and it works fine, but when I try to set AIR, it doesn't work. It only works when I set a material that isn't air. I assign the ItemStack this way and then send a PacketPlayOutEntityMetadata to update the entity. Does anyone know why this is happening?

young knoll
#

Air isn’t really an item

#

NMS has ItemStack.Empty or something

sly topaz
#

why would you set an item display to air anyway

#

if you want to hide it, just delete it

unique shuttle
# young knoll Air isn’t really an item

Yes, the asNMSCopy method already returns an empty ItemStack if the original was air. I even set it manually, but it still doesn't update. It only updates if I set a non-empty ItemStack

stuck oar
#

anyone know how i can like

#

make it so that there isnt so many ifs

#

i need 15 of those

unique shuttle
# sly topaz why would you set an item display to air anyway

I think in my case it's better to just hide it since there can be empty slots that change to have an item while this is open. I could simply create a new entity if the slot has an item or not, but I believe it's more efficient to just send an update rather than create a new entity and update it

sly topaz
#

use PDC

#

lore is just display

analog mantle
#

Can I use native methods in my plugin and upload it to spigotmc?

worldly ingot
#

I mean we generally advise against it because you often don't really have any reason to whatsoever, but if you have to, you have to

#

There should be an obvious reason to have to use them, otherwise it might just get flagged as malware and deleted on suspicion of that being the case because decompiling native code is a bit more of a pain in the ass to review

analog mantle
#

Would a native obfuscator like jnic be allowed?

worldly ingot
#

Almost definitely not :p Again, I see no true benefit to using native methods here

analog mantle
#

There is no benefit, i'm just curious that's all!

worldly ingot
#

If it's just curiosity, then the answer is no :P

#

Again, only really in the clear if it's obvious to use native methods - accessing APIs that are not available in Java. Which is rare for a plugin to need

analog mantle
#

That's interesting but makes sense

lucid fog
#

but i dont think its necessary

stuck oar
twin sigil
#

does anyone know how to make it so only one mace can be crafted on a server

stuck oar
stuck oar
young knoll
# worldly ingot There should be an obvious reason to have to use them, otherwise it might just g...

Okay hear me out

The java plugin uses JNI to interface with some C++ code that starts a python script. The python script makes a web request and the web server utilizes PhP and JavaScript to query a value from SQL and return it. Then the python script saves this value to a file and starts a unity (C#) game that reads said file. Then perhaps we have some sort of AI made in Haskell that plays the game, once the AI wins a signal can finally be sent back to java for the plugin to utilize.

lucid fog
# stuck oar I’ll have a look

okay im not 100% sure if its gonna work, but something like this?

String itemType = ChatColor.stripColor(meta.getLore().getFirst()).contains("Required Level: 1") ? "pig" : "sheep";
System.out.println("Item Checked");
Double moneyGained = this.getConfig().getDouble(itemType + ".sellprice");
p.getInventory().setItemInHand(new ItemStack(Material.AIR));

String itemName = itemType.equals("pig") ? "Pig Heads" : "Sheep Heads";

p.sendMessage(xpneeded <= xp
    ? "§4§l(!) §4No XP was gained because you have hit the maximum xp for this level."
    : "");
p.sendMessage("§d§l(!) §dYou have sold " + ChatColor.LIGHT_PURPLE + item.getAmount() + " §d§n" + itemName + "§d for $" + ChatColor.LIGHT_PURPLE + moneyGained);
econ.depositPlayer(p, moneyGained);

if (xpneeded > xp) {
    System.out.println("Experience Is Lower");
    playerLevelManager.setXp(playerLevelManager.getXp() + item.getAmount());
} else {
    System.out.println("Experience is higher");
}

setscore(p, playerLevelManager.getLevel(), playerLevelManager.getXp());
young knoll
#

Yeah you really shouldn’t compare by name

#

Since yknow, anvils exist

worldly ingot
#

<insert recent ChestShop exploit here>

#

Or, no, it was an anti cheat I think lol

sly topaz
young knoll
stuck oar
worldly ingot
#

Vulkan sounds right

sly topaz
viscid carbon
#

Quick question with storing YAML. If i have a ConfigurationSection field in a different class aka 'HomesSection and it hasn't created the data yet but i want to call it. how do i do so without it causing a null?

#

Do i have to always call != null in the if statement?

#

or is there a better way

wraith delta
#

otherwise yea it would cause error

viscid carbon
#

Kinda figured. thanks

sly topaz
# stuck oar But surely I would still be running something 15 times which would make the code...
public static final NamespacedKey LEVEL_KEY = NamespacedKey.fromString("level", myPlugin.getInstance());
private static final int[] experienceRequirement = new int[] {15, 24, 32}; // Each one would be a level, could get this from the configuration too

var level = meta.getPersistentDataContainer().getOrDefault(LEVEL_KEY, PersistentDataType.BYTE, 0);
if (experienceRequirement.length >= level && experienceRequirement[level - 1] < xp) {
  var reward = ...;
}
worldly ingot
#

There is also a ConfigurationSection#isConfigurationSection(String) which does a null check if I'm remembering correctly

#

Yeah, it exists and does, but also checks if a default value exists. If you don't want to check if the default exists as well, there's a contains(String, boolean)

wraith delta
worldly ingot
#

You can set that boolean to true to ignore the default

sly topaz
#

implicit null check yeah

manic delta
#

ok i remember my problem, yes i tried but, i want to posicionate them under the player name, but if i use \n They will appear strangely, going through the player's skin, they do not fit under their name correctly.

sly topaz
#

that'd be two calls to get though, kinda annoying

#

value would most likely hit cache so it wouldn't matter but still

worldly ingot
#

That's fair

wraith delta
#

Right it would get stored in memory, but for the homes plugin he wants probably have to grab the latest config. i think for performance id try to do other checks to return, above any file touching

worthy yarrow
mortal vortex
#

In Vanilla Minecraft, when a player punches a boat, the boat rocks / wobbles (for a lack of better words) on its side. Is there a way to invoke this rocking movement without the boat being hit, In Spigot?

worthy yarrow
#

I would assume this animation could be sent via packets, otherwise I don’t believe there is a method in spigot api that does this

worldly ingot
#

Are Boat entities marked as damageable?

worthy yarrow
#

Maybe I’m wrong hopefully Choco knows

worldly ingot
#

Because my immediate thought is a call to damage(1) or something if so

#

Otherwise, no. No API for that. But there probably could be

worthy yarrow
#

I will look hold on

worldly ingot
#

I don't see it inheriting from Damageable so probably not. I think Minecarts have the same behaviour though, yeah? So might be worth adding a new interface for that and having boats and minecarts both implement it

mortal vortex
#

I really have no idea. I've been trying to manually do it by changing the velocity of the boat, but I can't get it to look natural.

wraith delta
worthy yarrow
#

No I do not see anything relating to damagable within boat

worldly ingot
#

I'll find an internal method for it you can call

mortal vortex
mortal vortex
worthy yarrow
#

W Choco

sly topaz
#

it was an example

#

if you go about it that way, you can avoid duplicating your code

#

you'd have to understand what I am doing there though, as it isn't complete

worldly ingot
#

Looks like EntityVehicle (and consequently, EntityBoat) has a setDamage() method

worthy yarrow
#

I feel like that would relate to damage of boat, would it invoke the animation?

mortal vortex
worldly ingot
#

Not entirely sure what the max value is, but I see setHurtDir(), setHurtTime(), and setDamage() all being used for the animation

#

Potentially calling animateHurt() is what you want

worthy yarrow
#

ah

worldly ingot
#

The float parameter is unused for boats. So probably ((CraftBoat) bukkitBoat).getHandle().animateHurt(1.0F); would work?

worthy yarrow
#

Hey choco, if you know enough about hp skyblock, would you say it's got semi rpg features?

worldly ingot
#

SkyBlock is almost definitely an RPG game

worthy yarrow
#

Right

lucid fog
worldly ingot
#

Yeah, unfortunately we have no Bukkit API for the vehicle damaging stuff. We can probably add API for it though

#

Just need to figure out a good way to expose it

worthy yarrow
mortal vortex
#

Im not sure its worth wasting your time adding something for a single usecase.

worldly ingot
#

We add methods to the Bukkit interfaces, then implement them in CraftBukkit

#

Not terribly difficult, it's just a matter of figuring out what methods to add to make it easy to use

worthy yarrow
#

This one is less to do about use case, more about quality of life

#

Why wouldn't you make it easy to do this

worldly ingot
#

Seems even Paper doesn't have API for this

worthy yarrow
#

What if theres not only one use case for this

mortal vortex
#
    nmsBoat.setHurtDir((byte) 1);
    nmsBoat.setHurtTime(10);
    nmsBoat.setDamage(10.0F);
    nmsBoat.animateHurt(1.0F);

I suppose this works for now

worldly ingot
#

Yeah that looks about right, but animateHurt() does those first three things already

#
    @Override
    public void animateHurt(float f) {
        this.setHurtDir(-this.getHurtDir());
        this.setHurtTime(10);
        this.setDamage(this.getDamage() * 11.0F);
    }
#

Eh I guess maybe it doesn't set the damage lol

#

You probably don't need to call animateHurt() at all. That might just be called automatically on tick

lucid fog
#

how do i make a command completion without players being able to actually complete a parameter using tab?

worldly ingot
#

setHurtDir(), setHurtTime(), and setDamage() is likely all you need

#

Not sure why it multiplies damage by 11 though

mortal vortex
#

yeah thats odd

worthy yarrow
#

Maybe boats just have an ungodly amount of health for some reason

worldly ingot
#

:p

mortal vortex
worldly ingot
#

Probably should expose some API for bubble column stuff too

#

e.g. whether or not a boat is being rocked by one

worthy yarrow
#

What makes something worth it to expose in the api?

worldly ingot
#

Usefulness generally

#

That's determined on a case by case basis though

worthy yarrow
#

For example this one

#

Hmm

#

When would you not want to expose bits of the api?

torn shuttle
#

when it's supposed to be private 🫢

worldly ingot
#

General rule of thumb is that we don't expose it if it's (a) a client sided value (because the server and client are merged together so we have lots of client-sided elements), (b) it's an implementation detail (like NBT), or (c) it's just not really useful at all for anybody

torn shuttle
#

I seem to recall sometimes it might be because it's too dangerous or misleading

worldly ingot
#

That as well, yeah. There are some values that you can set that just get reset on the next tick or something

torn shuttle
#

mmmh portal tick countdown or whatever the hell that was

worthy yarrow
#

In general terms of an api, what makes these "private" bits actually needed to be private?

#

Apart from the dangerous / misleading reason, I can understand a couple of those for sure

worthy yarrow
#

That is a pretty cool way to do an interface

rough ibex
#

textdisplay?

unique shuttle
unique shuttle
sly topaz
torn shuttle
worldly ingot
#

I guess take for example an entity's NBT data. We absolutely could expose it with the PersistentDataContainer, or some wrapper for NBT data, but... that's kind of gross and awkward to work with. We'd rather just make concrete methods like getHealth() rather than getNBT().getInt("Health");

worldly ingot
sly topaz
rough ibex
#

that music...

#

ow

worldly ingot
#

It would be the only outlier in the sendX() methods. You could also track it via your plugin so

#

Especially now that we're working on adding the equipment change event

worthy yarrow
torn shuttle
worldly ingot
#

We just don't want to expose anything that feels like it doesn't need exposing, or is really difficult to expose without just making it feel like it doesn't need to be there

torn shuttle
#

I 'member

sly topaz
worthy yarrow
worldly ingot
#

The way I was exposing pathfinding was kind of bleh. I would definitely revisit that with a different angle of attack. Like an NBT API was also never going to happen, but then PersistentDataContainer was birthed and it just made a lot more sense

#

Now we have an NBT API without exposing the NBT values that plugins should be using API for

torn shuttle
#

you can steal my code for it if you want

worldly ingot
#

We don't want plugins to be able to get/set the NBT of entities directly

torn shuttle
#

problem is you're not going to make a good api for this without messing with brains and goals

worldly ingot
#

Yeah

torn shuttle
#

if we had brains and goals we would be golden

worldly ingot
#

It's hard to abstract out the vanilla goals as well because most commonly that what people would want to use, is the vanilla goals

#

e.g. make a skeleton follow you

sly topaz
#

could just look at Paper's design and improve upon it

worldly ingot
#

We avoid looking downstream for API in fear of legal issues

sly topaz
#

I don't particularly like their mob goals API, feels like a direct replica of the server code

worldly ingot
#

Yeah and my initial attempt was also pretty 1:1 with the server's internals

#

Which I hate, looking back at now

sly topaz
#

though it exists, so better than nothing

torn shuttle
#

the only abstraction you can make from that is trying to implement brain logic into goals or vice-versa

#

so there's only one system

worldly ingot
#

I think ideally plugins have no concept of brains

torn shuttle
#

and you're still going to run into oddities if you do that

sly topaz
worldly ingot
#

Brains seem like an internal thing to me - and if I recall correctly, not all entities have that brain system

torn shuttle
#

oh buddy but you do realize those who have brains don't have goals

#

right

#

we don't get to pick just one

#

if we did this would already be a done deal

sly topaz
#

I haven't really looked at the brain stuff, came way later when I stopped messing with plugins

torn shuttle
#

it's been a little bit since I last directly worked on it but goals are the most basic ai priority system imaginable and brains are mildly more nuanced, but there is no intersection where both function at once

#

you will not be able to make a comprehensive ai system without doing both

worldly ingot
#

Well brains are meant to be the replacement, right? They're just doing it slowly

torn shuttle
#

and you will not be able to abstract away the fact some use brains and some use goals without losing some of the nuance of how they work

sly topaz
worldly ingot
#

Ideally Paper contributes upstream

torn shuttle
#

but then mojang reworks mobs and doesn't change them to use brains

worldly ingot
#

But they seldom do

torn shuttle
#

as a matter of fact mojang is still releasing new mobs with goals

#

because they're just variants of other mobs that use goals

#

so it's not the new system, it's just the new competing standard

sly topaz
# worldly ingot But they seldom do

they've got very different views on what makes a good API for the platform, so it's only understandable to an extent but yeah, at this point I don't know what they think about that but I am not in the Paper team to know

torn shuttle
#

I did look at their api and it's not a good solution for broader use because the mojang code was never build to be expanded upon by plugins

#

if we want a solution premium pets plugin #1290131 can get to work within a few hours of starting we would probably want some kind of way to abstract away from the internals

#

it's also made more complicated because not everything across these two systems is cancelalble to the same extent or in the same way

worldly ingot
#

And then again you run into the dilemma of having to expose vanilla behaviours but those technically including implementation details

#

That was my biggest hurdle was allowing developers to construct vanilla goals and use them, but I couldn't think of a way to do that at all

#

You'd also have to be able to expose them somehow with a getter - e.g. a way to get a list of all goals from an entity. That was difficult too because mapping those sounds like a nightmare. Maybe there's a clever way to do that with patching though

#

I don't know

torn shuttle
#
Behavior(priority);
@Override
doBehavior(){
...
}

imo

#

and forget about using the vanilla ones

sly topaz
#

just create your own abstraction and re-implement every single goal šŸ˜Ž

worldly ingot
#

Yeah but not being able to use the vanilla ones would mean you'd have to, as a plugin developer, reimplement the existing behaviours - even simple ones like following an entity

#

Which just kinda sucked

torn shuttle
#

but it would exist my dude

#

instead now it's just plainly impossible

worldly ingot
#

I know PES3_Cry

torn shuttle
#

also this could be a problem that solves itself as once the ball gets rolling the path to implementing vanilla goals might become clearer as people use it

#

imo unless you want to expose implementation the best you can do is provide some api defaults for common goals

#

no one's stopping you from making a FollowBehavior extends Behavior

worldly ingot
#

I mean one big PR at a time. The components API has been like 2 years in the making lol

torn shuttle
#

is what I would say if I didn't already solve this for myself with my own nms library

worldly ingot
#

IT SOUNDS LIKE YOU HAVE ALL THE ANSWERS >:((

torn shuttle
#

I mean sort of

#

md5 did ask if I was going to pr it

#

but I don't know if it even fits

worldly ingot
#

You can make it fit I'm sure

#

You don't have stash access do you?

torn shuttle
worldly ingot
torn shuttle
#

I've never done a PR

#

but regardless I'm not convinced my solution is the best solution

#

I think even just adding 3 presets would cover 80% of use cases

#

go to x

#

follow x

#

attack x

worldly ingot
#

Yeah it's the generifying of things and future-proofing to the best of our ability that makes it difficult

#

Because yes we could add those 3 goals to start, but we also have to write it in a way that adding the other goals should be trivial

torn shuttle
#

well just keep it very simple

#

a behavior, a priority, an override for what the behavior implements

#

I think you need a condition check

#

to validate if the thing should happen

worldly ingot
#

Maybe one day I'll revisit it. Right now I'm waaaay too busy and stressed with like... life in general lol. I've hardly had time to update any of my PRs to 1.21

torn shuttle
#

and then just do the thing

#

I mean I guess I could refer to what I did

#

start, stop, canStillUse, checkStartConditions, and the actual behavior

#

technically I just run start over and over again instead of a dedicated method for the behavior but whatever

mortal vortex
#

or maybe im not adjusting the values enough

#

nvm, it was the latter.

mortal vortex
sterile breach
#

hey Im making a void world generator here I think theres not any block, how can I replace all blocks per air block?

public class VoidGenerator extends ChunkGenerator {
    @Override
    public ChunkData generateChunkData(World world, Random random, int x, int z, ChunkGenerator.BiomeGrid biome) {
        return createChunkData(world);
    }

        VoidGenerator voidGenerator = new VoidGenerator();
        WorldCreator wc = new WorldCreator("void");
        wc.generator(voidGenerator);
        wc.createWorld();


}```
dawn flower
#

what's a good way to store data in a jar? (the jar is a dependency)

#

i tried making it a class, but it was too large it couldnt be compiled

#

i tried making it a resource but idk how to retrieve it

#

it's like 300k lines combined

blazing ocean
#

or getResourceAsStream

shadow night
#

Doesn't bukkit have a method for saving a resource

dawn flower
#

well i'm gonna use the dep for a plugin but i use the dependency itself for other stuff

dawn flower
#

also is there a way to know when a parallel stream is done

shadow night
quiet ice
dawn flower
#

they behave like async tho, it doesn't pause the main thread

quiet ice
#

Well they should synchronize once you perform a terminal action at the very least

#

Looking at the sources even non-terminal operations should be synchronized (though running parallel)

dawn flower
#

i'm just gonna use a normal stream, it's afew ms difference anyways

quiet ice
#

I haven't ever seen a task that really necessitated a pstream

sterile breach
eternal oxide
#

you don't need to generate any blocks

#

just have an empty overridden generateSurface method

sterile breach
#

thanks

sterile breach
#

when you execute a plugin maded for 1.20 (example) in an 1.21 server in theory it works how to explain that that the server can execute it? in the pom.xml it waits for the 1.20 if it doesn't find it, it won't crash?

eternal oxide
#

if you built it for 1.20, thats the minimum version it will run on

sterile breach
#

if the version in the pom doesn't match, it will still try to run it?

eternal oxide
#

Depending on how you write it, it should work on future version, but thats not a guarantee. You need to test it.

sterile breach
#

to make a lib that we'll implement as compile scope, I just have to add spigot dpendecy like a nomral plugin but without main class and plugin.yml?

tidal narwhal
#

somone have a shop like /shop then you can sell and buy

sterile breach
tidal narwhal
smoky anchor
halcyon hemlock
#

I installed neovim guys

tardy delta
#

well done

#

but installing alone isnt good enough

blazing ocean
sly topaz
#

if you are going to do java, I would just go for IJ with the IdeaVim plugin

#

the neovim java scene is still quite rough, same as vscode's though Microsoft is pushing hard to make it work

shadow night
#

I have like 4 IDEs, all for different languages (or language groups)

tardy delta
#

only 4

shadow night
#

Yeah I don't work with a lot of different languages

lean pumice
shadow night
#

What the fuck is "cheese"

quiet ice
#

surprise - a paper fork

lean pumice
shadow night
quiet ice
#

Well I guess don't run MojangAPIUtil.requestPlayerTextureProperties on the main thread?

#

Just use proper debugging techniques and you shall be rewarded handsomely, but from the looks of it this is "only" an issue of doing excessive NIO on the main thread

lean pumice
quiet ice
#

Well it really depends on how often you run that method on the main thread

shadow night
grim hound
#

If you think this is a Cheese bug, f*ck yourself

quiet ice
#

Nah, this isn't paper that included that message

lean pumice
grim hound
quiet ice
#

one as in 10^0 or one as in 10^3?

grim hound
#

to be expected

quiet ice
#

expected under what sense?

grim hound
#

web requests are blocking

#

and can take a lot of time

#

it's only expected that they can crash the server

quiet ice
#

Yeah, but if it is executed 10^0 amount of times, it shouldn't take 10 seconds.

#

This would only be an issue if the server is offline, an event that shouldn't occur most of the time.

#

And it would need to be a specific kind of offline where the connection is never interrupted/closed

grim hound
#

yo somebody

#

help

#

snakeyaml

#

is just

#

breaking stuff

#

wtf

quiet ice
#

That's one of the reason I don't do yaml these days

grim hound
#

I load a class

#

this is false for no reason

quiet ice
#

load a class?

grim hound
grim hound
#

I invoke a method it has

#

and that makes it load

grim hound
quiet ice
#

I guess you could do a Thread#dumpStack() in the clinit and see whether the stacktrace aligns with what you expect

wintry dagger
grim hound
#

it's suddenly true

quiet ice
#

naming conventions have no serious impact here

shadow night
#

I have no idea what this code even is

grim hound
#

oh wait

quiet ice
wintry dagger
grim hound
#

I'm restarted

#

XD

#

I should init the config

#

before these

#

okay, sorry y'all

#

I'm just restarted

quiet ice
#

does not compute but w/e

grim hound
quiet ice
#

not without initializing it

#

or doing null checks

#

But for primitives, nah.

grim hound
#

got it

quiet ice
#

I mean 0 and null are the same thing after all

grim hound
quiet ice
#

uninitialized arrays would be null.

#

shit, I've done a little bit too much C lately to be confusing 0 and null that frequently.
Only problem is that I have not.

grim hound
quiet ice
#

Well that is just the difference between alloc and malloc

#

But 99.9% of the stuff in the JVM is malloc'd

grim hound
#

what's that?

shadow night
#

there is alloc?

quiet ice
#

Two methods to allocate memory

grim hound
#

and only in the newer versions

quiet ice
#

Yeah, you shouldn't be using alloc in most cases though - can result in nasty security vulnerabilities if you are not careful

shadow night
#

but what exactly is alloc

#

and how is it different from malloc

grim hound
quiet ice
#

alloc does not zero

grim hound
grim hound
quiet ice
#

"Deleting" stuff in RAM is the same thing as "deleting" stuff on disk: It only removes it from some random table - but the actual data might still be present

#

So that garbage data could be anything, depending on your operating system (most OS zero the data either way).

tardy delta
#

calloc zeroes

quiet ice
#

Ah yeah indeed

tardy delta
#

you'll have to do more c šŸ˜‰

quiet ice
#

I actually never do anything more low-level than java bytecode

#

that is, I've actually never used C beyond looking at a makefile and wishing I had maven

shadow night
#

lmao

#

relatable

tardy delta
#

probably the reason i started making my own build system, cuz makefiles arent particulary fun

#

plus its code based, who doesnt want that!!

shadow night
#

I have tried C and I still have no idea how to use a library

quiet ice
#

I will need to take a look at X86_64 assembly one of these days though - there is one thing that Java does not have available and that's CMPXCHG16B so I need to write a small library to expose that sooner than later

tardy delta
#

no jvm intrinsics?

shadow night
#

what the fuck is CMPXCHG16B

quiet ice
#

Compare & Exchange 16 bytes

#

(CAS for 128-bit values, in plaintext)

quiet ice
blazing ocean
#

@shadow night should i rename palm to mackingcheese

blazing ocean
#

šŸ‘

tardy delta
#

dont start trolling here too

blazing ocean
#

you're an opp, as neon would say

tardy delta
#

i have no idea what that means

clear elm
#

whats the event when a player equips a armor piece

blazing ocean
blazing ocean
#

i did that on my laptop on the train btw

#

took 50 minutes to compile

sterile breach
#

Im trying to save my intelji project to github with git Ilinked my github account and tried to create a first commit but because my github mail is private it dont work how can I change the git email to set the github no reply mail in intelji?

sly flint
#

anywone is here

#

i need help

blazing ocean
#

?ask

undone axleBOT
#

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

sly flint
#

@blazing ocean

drowsy helm
#

Plugin is null

#

Show your code

blazing ocean
#

also paper

drowsy helm
#

You cant getConfig statically

#

You are trying to do it in the initialiser of the variable

#

private String webhock = plugin.getConfig().getString("Discord.WebHockURL");

sly flint
#

private String webhock = getConfig().getString("Discord.WebHockURL");

#

@drowsy helm

#

can i use like that?

drowsy helm
#

Just set it in your onEnable

sly flint
lucid fog
#

how do i make a parameter above the chatbox without players being able to actually complete the parameter using tab?

halcyon hemlock
#

W or L?

#

also how does linux use literally 360mb ram

#

my window computer uses like 10 gigs on startup

#

šŸ’€

eternal oxide
#

windows has a LOT of useless stuff

slender elbow
#

how else are they gonna send all your data to Microsoft?

tardy delta
#

good ol arm cortex a76

tardy delta
quiet ice
ivory sleet
#

?ban @cinder abyss highly inappropriate behavior

undone axleBOT
#

Done. That felt good.

tardy delta
#

i didnt see ):

quasi gulch
#

Why is the PlayerInteractEvent called twixe when i right click a block but not when left clicking or clicking air?

remote swallow
#

?interactevent

undone axleBOT
#

The PlayerInteractEvent may be called once per hand. If you only want code to be executed once, you can check the result of https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/player/PlayerInteractEvent.html#getHand(), then decide functionality.

For example, only executing code if the main hand was used:

@EventHandler
public void onPlayerInteract(PlayerInteractEvent event) {
    if (event.getHand() != EquipmentSlot.HAND) { // * if the hand used is NOT the main hand:
        return; // do not progress past this point  |
    }
    // provide functionality
}
quiet ice
quasi gulch
#

okay thanks

ivory sleet
pine crest
#

lol

#

bro is an n word enjoyer

quiet ice
#

ah, so it's more of a long-term improper behaviour

shadow night
halcyon hemlock
slender elbow
#

mfw Minecraft will now bundle asm :simon_peek:

halcyon hemlock
quiet ice
#

that is rather unexpected

tardy delta
#

geols happiness intensifies

quiet ice
#

have you seen a modloader that doesn't ship asm?

#

From a modder's perspective there is no difference since all modloaders already ship asm

#

And in the worst case, java already has a version of asm already shaded in

near furnace
#

hey

#
sender.sendMessage("Successfully set the join message to: " + ChatColor.translateAlternateColorCodes('&', message.toString()));

Any one know how to implement a .replace("%player%", .getPlayer().getDisplayName) here?

#
sender.sendMessage("Successfully set the join message to: " + ChatColor.translateAlternateColorCodes('&', message.toString().replace("%player%", "&o<player name>")));

Will this work? šŸ˜…

lucid fog
#
sender.sendMessage("Successfully set the join message to: " + ChatColor.translateAlternateColorCodes('&', message.toString().replace("%player%", sender.getName())));```
near furnace
#

owh

#

so it will work, thanks :)

#

lemme try

lucid fog
#

yeah

near furnace
#

time to do the ?tas

#

brh

#

?tas

undone axleBOT
lucid fog
#

lmfao

near furnace
#

yes time to do this

quiet ice
#

the message.toString() part is slightly concerning me.

near furnace
#

yess it worked

lucid fog
#

yippee

near furnace
quiet ice
#

nah, it really depends on the datatype of message. It's okay if it is a CharSequence or a StringBuilder, but any other type is a bit concerning

near furnace
#

oh well its a StringBuilder so no need to worry

#

:)

#

Guys, i think i got a headphone dent 😨

quiet ice
#

Thought so halfway

#

headphones? Amateur.

lucid fog
#

r u using speakers?

#

😭

quiet ice
#

always have been.

lucid fog
#

damn

#

i dont have speakers

#

songs just hit different in headphones

quiet ice
#

It's not like I'm using my PC setup on public transport and stuff

lucid fog
#

lmao

#

anyways

#

i really dont wanna spam this question much but i literally cannot find a single answer anywhere..
how do i make a parameter above the chatbox without players being able to actually complete the parameter using tab?

quiet ice
#

parameter in what sense? Is there a vanilla feature that comes similar to what you intend to do?

lucid fog
#

like for example the /summon command shows you "[<nbt>]" but you cant really press tab on it

quiet ice
#

My guess is that the bukkit API does not expose this and that either you need to find a wrapper library for that or using brigadier directly.

slender elbow
#

yes, you can't do that with the api

#

unless you are using a certain downstream fork but we don't talk about that

near furnace
lucid fog
#

lmaoo

near furnace
#

omagod

#

may god be with you

quiet ice
#

yeah? Like any sane human being?

lucid fog
#

im alan

near furnace
#

im fahi

lucid fog
#

cooool

near furnace
#

so coool

#

At what knowledge level, would you classify someone as a intermediate or someone who knows how to code minecraft plugins?

quiet ice
#

I'm not artistically inclined nor am I a musician, hence there most likely is little for me to distinguish in the first place.
And being with headphones makes me really uncomfy. Blame autism here again I guess.

lucid fog
#

guys, is it a bad idea to make a paper plugin instead of spigot..?

quiet ice
near furnace
lucid fog
near furnace
clear elm
#

Hello i have a question.

@EventHandler
public void onPlayerDropItem(PlayerDropItemEvent event) {
Player player = event.getPlayer();
ItemStack item = event.getItemDrop().getItemStack();
ItemMeta meta = item.getItemMeta();

    if (meta != null) {
        String displayName = meta.getDisplayName();
        if (MAGIC_WAND_NAME.equals(displayName) || CHEST_OPENER_NAME.equals(displayName)) {
            event.setCancelled(true);
            player.sendMessage("You cannot drop this item!");
        }
    }
}

i have this event that cancelss the dropping of 2 items and it works but if i go to my inventory go to the item and press Q there the message that i cant drop it comes but the item dissapears why?

quiet ice
lucid fog
#

also sorry for pinging

#

wait is it paper only

near furnace
#

Spigot's default command framework vs Aikar's command framework: Stay tuned to see who wins!!

quiet ice
# near furnace i see, what about advanced?

Mastering the event system, being able to use asynchronous tasks, understanding classloading and having a firm grip of other java features, etc. etc.

Maybe even having a good inuition of the inner workings of NMS but it really depends on where you draw the line. I generally prefer to exclude NMS since you can often get well by without it.

quiet ice
clear elm
#

it just dissaperars its not in my inv and not on the ground

near furnace
ivory sleet
#

i think geol is just an expert-plus-plus

quiet ice
#

keep in mind that I haven't actively written bukkit plugins for a few years now.

shadow night
#

I'm chilling in fabric and spigot and you are in both

quiet ice
#

Also, I have no clue about the inner workings of NMS (though it's not like that is a terrible issue since the bukkit API is incredibly powerful and I already have decent experience with java reverse-engineering proguard-obfuscated applications)

quiet ice
shadow night
quiet ice
#

The western galimulator community is mostly dead though so I don't really have a home hence I'm here.
There is still a larger chunk surviving on the other side of the great firewall, but that is a place which is a bit hard to reach.

shadow night
#

no idea what all that means but ok

quiet ice
#

I mainly mod galimulator (a rather shoddy game written in java), that's probably the only thing you need to know

shadow night
#

ah

#

that makes more sense now

jolly cliff
#

Hello so i am developing prison kind server and got some problems like without op i can place blocks in my guarded region even if i disable it or can't use rankup command but it works when i am op would be nice to get some help some pm me maybe you could help me a bit šŸ™‚ i struggle with some things even like i can't make that without op people could use workbenches or something like that when flag is allowed

river oracle
#

anyone else had issues with intellij taking a long time to open after the recent update

#

idk why but mine is taking like 2 mins to startup now

chrome beacon
#

haven't had that issue

#

could try reinstalling it

cold pawn
#

For anyone who uses WorldGuard, when do I register custom session handlers? I can't do it onEnable because it gives me an error saying WorldGuard is not loaded yet, or is there a way to wait until WorldGaurd is loaded?

peak depot
#

loadafter

#

or smth

chrome beacon
#

Add WorldGuard to your plugin.yml dependencies

cold pawn
#

I did, its a soft depend

chrome beacon
#

Then your plugin will load after WorldGuard

cold pawn
#

Thats what I thought as well but it doesn't, it loads before for some reason

chrome beacon
#

Show your code

#

and your plugin.yml

#

also the error would be useful

cold pawn
cold pawn
sullen canyon
cold pawn
#

?

#

Its in Java

sullen canyon
#

uh I see

chrome beacon
cold pawn
#

Yes it is. I put it at the bottom thinking it might help as well šŸ¤·ā€ā™‚ļø

chrome beacon
#

Is WorldEdit installed on the server

cold pawn
#

Yeah

river oracle
cold pawn
#

WorldGuard does load, it just does after everything else already has

river oracle
#

your load is set to startup

#

gonna cause issues

chrome beacon
#

right I missed that

blazing ocean
river oracle
#

the forgotten child

cold pawn
#

its really helpful tho ngl

eternal oxide
#

The unwanted child

blazing ocean
#

var in java is great

river oracle
#

if you don't need to be enabled before the server its kinda pointless

#

if you do you'll need to lazily initialize world guard. As long as you can ensure you use it AFTER the world is loaded

cold pawn
river oracle
#

Could be worse could spend 3 hours only to find you spelt a word wrong and it wasn't being spell checked

cold pawn
#

True lol, pretty sure it got added because of the Minecraft Development intellij plugin

river oracle
#

that plugin is the devil

#

i stg

subtle folio
#

is there a resource on coding phase based ingame gamemodes?

river oracle
#

I can't imagine it'd be much more complex unless you're dealing with a heavily multi threaded environment

#

something like

public interface GamePhase {
  void enable()
  void disable()
  void cleanup()
}
#

I always cleaned up events and such with a cleanup method

#

unregistered them and such

subtle folio
#

yeah yeah

#

im thinking like i want to make an events framework

#

where there is different team setup phases

#

then the actual game phase

#

then a callback for when its over

golden garden
#

Am I missing something or when setting new spawn location of PlayerRespawnEvent or PlayerPortalEvent, functions #setTo and #setRespawnLocation, if player doesnt have bed, server sends message: You have no home be or charged respawn anchor, or it was obstructed.
I also saw this in #news on spigot page:
Mojang recently released Minecraft 1.21 and the first builds of Spigot for this version are now available. As expected given the short time since 1.20.6, this release mainly just moves the experimental 1.20.6 features into the main server. There are however some underlying changes which you should keep an eye out for, particularly to teleportation between worlds which may have some as of yet undiscovered bugs.

grim hound
near furnace
#
@Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {

        Plugin plugin = myplugin.getPlugin();

        if (sender instanceof Player p) {

            Location location = p.getLocation();

            plugin.getConfig().set("spawn.x", location.getX());
            plugin.getConfig().set("spawn.y", location.getY());
            plugin.getConfig().set("spawn.z", location.getZ());
            plugin.getConfig().set("spawn.pitch", location.getPitch());
            plugin.getConfig().set("spawn.yaw", location.getYaw());
            plugin.getConfig().set("spawn.world", location.getWorld().getName());

            //plugin.getConfig().set("spawn", location);

            plugin.saveConfig();

            p.sendMessage("Spawn location set!");

        } else {
            Bukkit.getServer().getConsoleSender().sendMessage("Only online players with administrative permission can execute this command!");

        }

        return true;
    }

}```
never worked with spigot's serialization interface, but can anyone show me how i could serialize these .set(spawn.args)
tepid silo
#

does anybody knows why bungeecord return nullpointer when i try to get a playername?

quaint mantle
tepid silo
#

what u mean?

#

ProxyServer.getInstance().getPlayer(uuid).getDisplayName()

eternal oxide
#

if the player is not connected you can;t get its instance

tepid silo
#

is connected

eternal oxide
#

?paste stacktrace

undone axleBOT
tepid silo
eternal oxide
#

return value of "net.md_5.bungee.api.ProxyServer.getPlayer(String)" is null

tepid silo
#

ah my bad

eternal oxide
#

you are using a string not a uuid

tepid silo
#

xd

#

works fine

eternal oxide
#

no

queen sequoia
#

Not sure if this is the place to ask, but I have a ProtocolLib question.

I'm trying to make a TEXT_DISPLAY via packets. I'm having issues with the ENTITY_METADATA packet. I'm trying to set the text of the display like so:

PacketContainer packet = ProtocolLibrary.getProtocolManager().createPacket(PacketType.Play.Server.ENTITY_METADATA);
        packet.getIntegers().write(0, this.entityId);

        List<WrappedDataValue> metadata = new ArrayList<>();
        WrappedDataWatcher.Serializer chatComponentSerializer = WrappedDataWatcher.Registry.getChatComponentSerializer(true);
        Optional<WrappedChatComponent> optionalText = Optional.of(this.text);

        metadata.add(WrappedDataValue.fromWrappedValue(23, chatComponentSerializer, optionalText));

        packet.getDataValueCollectionModifier().write(0, metadata);
        return packet;

The index of the packet is 23 according to here: https://wiki.vg/Entity_metadata#Display

My client is disconnecting when receiving this packet saying:
java.lang.IllegalStateException: Invalid entity data item type for field 23 on entity l['Text Display'/200000, l='ClientLevel', x=30.63, y=-60.00, z=1.41]: old=empty(class xn), new=Optional[literal{This is a line}](class java.util.Optional)

So I'm confused because the client seems to say field 23 isn't where I should be putting this, but protocol says I should be. Any help is greatly appreciated!

slender elbow
#

why not just use real text displays?

river oracle
#

🌈 "Performance" 🌈

slender elbow
#

except that they quite literally don't do anything lmao

river oracle
slender elbow
#

(they don't)

river oracle
#

what I stg they did

river oracle
#
   public void tick() {
      Entity entity = this.getVehicle();
      if (entity != null && entity.isRemoved()) {
         this.stopRiding();
      }
slender elbow
#

zzz

halcyon hemlock
#

Nice

river oracle
#

thats one variable assignment a null pointer check and another boolean check

halcyon hemlock
#

I can't see

river oracle
#
   L0
    LINENUMBER 138 L0
    ALOAD 0
    INVOKEVIRTUAL net/minecraft/world/entity/Display.getVehicle ()Lnet/minecraft/world/entity/Entity;
    ASTORE 1
   L1
    LINENUMBER 139 L1
    ALOAD 1
    IFNULL L2
    ALOAD 1
    INVOKEVIRTUAL net/minecraft/world/entity/Entity.isRemoved ()Z
    IFEQ L2
   L3
    LINENUMBER 140 L3
    ALOAD 0
    INVOKEVIRTUAL net/minecraft/world/entity/Display.stopRiding ()V
#

this is a proposterous amount of computing here

halcyon hemlock
shadow night
#

Why are we doing bytecode

river oracle
#

just showing @slender elbow how heavy TextDisplays are on the server

blazing ocean
#

those run on the jvm

shadow night
#

bytecode is far from assembly

river oracle
#

mmm unfortunately I can not :(

halcyon hemlock
#

Just rebuild it in rust lol

shadow night
#

Quite a lot of instructions

shadow night
#

Can we rewrite mc in rust and then add JNI so we can still use java mods and plugins

halcyon hemlock
#

Probably

#

I'm gonna do that

#

And also add typescripy plugin support

shadow night
#

Good luck, see you in two years

halcyon hemlock
#

Lemme finish ma server first

shadow night
#

3 years

halcyon hemlock
#

Everything is done, now just need to make chunks and shit

#

Wait fuck. What about physics. How does nms do physics? Is Mc physics hard??

#

I never though of that

shadow night
#

where have you seen physics

#

The only physics that we have in minecraft is falling

#

And velocity

halcyon hemlock
#

Hmm

#

That's true

#

What physics engine does unreal engine use

#

Can u integrate it into other projects

shadow night
halcyon hemlock
#

What's physx

#

Isn't that something physics related

#

I should make realistic minecraft with those new entity blocks

#

That's a good fucking idea

chrome beacon
halcyon hemlock
#

Chaos something

#

Chaos vehicle and shit too

#

And cloth physics I think

#

For packets, is the bottleneck the client or the server

#

Like can I pull something insane with block entities

chrome beacon
#

it does depend though as always

halcyon hemlock
chrome beacon
#

Java is not the bottleneck

#

You can write it in Java if you want to

river oracle
#

yo guys you know what'd be crazy

#

writing optimized java code

#

nvm bro its java šŸ˜‚ it'll never happen

shadow night
river oracle
#

I wonder how many people here could actually write C good enough to justify it over java lol

halcyon hemlock
#

Whenever I write java I never care about performance that much compared to rust or cpp

shadow night
river oracle
#

assembly is slow asf

halcyon hemlock
shadow night
orchid gazelle
#

If you write good Java code, in most cases you won't notice like any difference in performance to rust or cpp

halcyon hemlock
#

I'm a transgender

#

Transistor*

#

I'm the cpu

#

O(0) constant space

river oracle
shadow night
#

Java is pretty fast

river oracle
#

My point is kinda that most people complain about java's performance and then go write shit code in other languages

shadow night
#

Especially comparing to a lot of other bytecode langs

river oracle
#

its semantics not really an actual fact

shadow night
#

Why do people complain about java being slow when the people who complain about that usually write even slower languages

orchid gazelle
#

Python

#

šŸ’€

river oracle
#

python my belovedf

quaint mantle
halcyon hemlock
#

Anaconda

quaint mantle
shadow night
quaint mantle
#

I tried to compile v8 and it took 4hours

shadow night
#

Try compiling firefox

#

I wonder how long it takes

blazing ocean
#

just use lua react

#

roblox remade all their tech in lua

#

so fucking based

umbral ridge
#

lua ligma

#

balls

torn shuttle
shadow night
#

It's cool

eternal oxide
#

targeting those Fortnight kiddies I see

torn shuttle
#

try again

brittle geyser
shadow night
torn shuttle
#

good

quick dome
#

just make the guy hit the dab a few times too

shadow night
#

Lol

blazing ocean
#

don't you dare insult magma

quick dome
#

I have a question, with NMS is it possible to change the pathfinding of an already existing entity? Like I want to add the goal Panic to the entity. I tried but it's not working, the many variations I tried had just either made the entity stand-still in place or just did not work at all.

    private void entityFlee(LivingEntity en) {
        if(en != null) {
            PathfinderMob mob = (PathfinderMob) ((CraftLivingEntity) en).getHandle();
            mob.goalSelector.addGoal(0, new PanicGoal(mob, 1.5D));
        }
    }
}```
#

Am I just stupid or smth šŸ™ƒ 🄲

karmic falcon
#

Entity e = p.getLastDamageCause().getEntity();

can e be p if the damage is void

eternal oxide
#

yes, IF the player managed to damage themselves before taking void damage

#

no idea how they would manage that though

karmic falcon
#

it happens even tho the player doesnt get damaged before

#

the only damage is void

eternal oxide
#

ah yes, its the damagee so its the player who was damaged

#

Check getDamageSource().getCausingEntity()

#

or getDirectEntity() as it may be an arrow

lethal knoll
#

What is the new way to get a Particle?

eternal oxide
#

get a particle?

lethal knoll
#

I got this:
world.spawnParticle(Particle.valueOf(particleName), livingEntity.get().getLocation(), 100);

#

But it throws:

#

Caused by: java.lang.IllegalArgumentException: missing required data class org.bukkit.Color

#

That's for all the plugins since 1.21

#

at java.base/java.lang.Thread.run(Thread.java:1583) [?:?]
Caused by: java.lang.IllegalArgumentException: missing required data class org.bukkit.Color
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:218) ~[guava-32.1.2-jre.jar:?]
at org.bukkit.craftbukkit.v1_21_R1.CraftParticle.createParticleParam(CraftParticle.java:69) ~[spigot-1.21-R0.1-SNAPSHOT.jar:4289-Spigot-fb8fb72-8ee6fd1]

eternal oxide
#

Depends on teh Particle but you likely need the T data

lethal knoll
#

hmm, but is there no way to fetch it from a value?

#

The use case is simple, I want to specify the particle name

#

and it spawns

eternal oxide
#

default to null and see what happens

lethal knoll
#

but default to null what exactly? The Particle.valueOf() does not take a 2nd parameter

eternal oxide
#

the spawn method

#

after your 100 100, null);

lethal knoll
#

okay trying

#

still crashes

#

same error

eternal oxide
#

what particle is giving the error?

lethal knoll
#

particle: "SPELL_MOB"

eternal oxide
#

ym thats not a valid particle

lethal knoll
#

not sure, but it seems like it doesn't exist anymore

#

yeah but it absolutely did exist before 😦

#

but okay, that explains it

eternal oxide
#

might be an idea to validate teh return of valueOf

lethal knoll
#

That's indeed something I should do

#

Any idea what is the new name of the particle or not?

torn shuttle
#

I AM THE CHAT

brittle geyser
worthy yarrow
#

I wish I was magma level, this sort of thing would make my rpg mechanics way cooler

torn shuttle
#

well guess what bud

#

that's free open source and written to act like an api

#

you can literally get this working in under 3 minutes

worthy yarrow
#

oh shit

torn shuttle
#

I even handle the automatic resource pack creation, merging and distribution now

worthy yarrow
#

I guess that just means I have to learn how to model

#

and animate for that matter

torn shuttle
#

that I can't do for you

#

arguably I can't even do for myself

worthy yarrow
#

I tried to make a bush once

#

and it looked exactly what you'd expect a 1.8 minecraft bush to look like

torn shuttle
#

man

#

this video is taking so long to make

#

I actually thought it was going to be a 1 day adventure

#

we're on day 4

eternal oxide
#

hour long MC cinematic?

torn shuttle
#

nah, devlog

#

it's time I stat taking my yt presence seriously

fading beacon
#

is there a way to change mobs scale on CreatureSpawnEvent using the new attribute command?

#

"/attribute [entity] minecraft:generic.scale base set [value]"

river oracle
#

#getAttributes

#

entities are attributal

#

you might need to cast to living entity

earnest girder
#

is it bad to have multiple listeners from the same event, for example PlayerInteractEvent? I have multiple classes for different purposes, each listening for the same event. Should I move them all to the same class or does it not matter?

young knoll
#

I mean, you'll get a tiny bit more performance with one listener that delegates to all the other classes

#

But it doesn't matter that much

sterile breach
#

Hey guys, Im making a replay plugin to replay... a player and I Wonder, do I also have to record
Other players for example if the player Im recording hit another player should I record it ?
Idk how other replay plugins works

olive lance
river oracle
#

do EventListeners have to be public

sterile breach
#

Yes I think

#

Spigot need to acces them

river oracle
#

sounds about right

sterile breach
#

If its private -> cant access

river oracle
#

well was just wondering cuz yk you always have setAccessible

sterile breach
#

Yes I thought about it but spigot try to be as fast as possible using relfection will take a certain time

hazy parrot
#

so i would assume it can be private

river oracle
#

nice was just about to look at stash

#

thanks

sterile breach
#

Oups sorry

olive lance
#

When I attempt to registerEvents against a new instance of this class, I am getting 'unable to find HandlerList for PlayerEvent'.
Can I not implement PlayerEvent? https://paste.md-5.net/ixosawobeg.java

#

probably am mixing up vocabulary

remote swallow
#

you need to expose the handler list

#

there should be a non static and a static version

olive lance
#

@remote swallow Wow, that was it. Im ngl i dont really understand it too much; after you mentioned this I looked at another custom event on github and saw how they had the additional static event and implemented it and now its just working flawlessly.
Going to re-read the events API post. not sure how i missed this

lucid fog
# quick dome I have a question, with NMS is it possible to change the pathfinding of an alrea...

not 100% sure, maybe try this

private void entityFlee(LivingEntity en) {
    if (en != null && en instanceof CraftLivingEntity) {
        PathfinderMob mob = (PathfinderMob) ((CraftLivingEntity) en).getHandle();
        
        // Clear existing goals
        mob.goalSelector.removeAllGoals();
        
        // Add the panic goal
        mob.goalSelector.addGoal(0, new PanicGoal(mob, 1.5D));
        
        // Force AI update
        mob.getSensing().tick();
        
        // Optionally, damage the entity to trigger panic
        // en.damage(1);
    }
}```
quick dome
summer scroll
glass inlet
#

What is the difference between ArmorStand.setVisible(boolean visible) and ArmorStand.setInvisible(boolean invisible)?

runic kraken
#

How I can disable /list command on spigot and replace my own command. Make own custom /list command system

summer scroll
#

Otherwise you need to unregister it.

edgy crystal
#
        Animals entity = (Animals) player.getWorld().spawnEntity(player.getLocation(), ped.getPet().getAnimal());
        entity.getPersistentDataContainer().set(new NamespacedKey(Main.getInstance(), "owner"), PersistentDataType.STRING, player.getUniqueId().toString());
        entity.setCustomName("§7" + player.getName() + "'s Haustier");
        entity.setCustomNameVisible(true);
        entity.teleport(player.getLocation());
        ped.setEntity(entity);
        entity.setInvulnerable(true);
        entity.setSilent(true);
        entity.setRemoveWhenFarAway(false);
        entity.setAI(false); // hinteher laufe
        entity.setCollidable(false);
        entity.setCanPickupItems(false);
        entity.setBreed(false);
        entity.setTicksLived(Integer.MAX_VALUE);

        if (ped.getPet().isSmall()) {
            entity.setBaby();
        } else {
            entity.setAdult();
        }
    }

public void everySecond() {
        PlayerPed ped = getActivePed();
        if (ped == null) return;

        Entity pet = ped.getEntity();
        if (pet.isValid() && player.isOnline()) {
            ((Animals) pet).setTarget(player);
        }
    }```

why doesnt this work? // why doesnt it follow me
wintry dagger
#

Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.13.0:compile (default-compile) on project: Fatal error compiling: java.lang.NoSuchFieldError: Class com.sun.tools.javac.tree.JCTree$JCImport does not have member field 'com.sun.tools.javac.tree.JCTree qualid' -> [Help 1]

#

when compile intellij maven

#

java 21, spigot 1.21

stuck oar
#

Double moneyGained = this.getConfig().getDouble(entry + ".sellprice");

  sellprice: "1999999"```

why this not working

1 is code
2 is cfg
#

its returning 0.0

#

nvm

torpid sapphire
#

how does backwards/forwards compatibility work with the spigot api? what versions can i expect my 1.21.1 plugin to run on? and how are some plugins able to run on almost any version?

sleek creek
#

I think you will get an better answer for that in their own discord

red trout
#

?nms

torn shuttle
#

well

#

I thought making my video devlog was going to take 1 day

#

it took 6 days