#help-development

1 messages · Page 1251 of 1

thorn isle
#

and then plugin.yml

polar forge
thorn isle
#

plugin.getCommand("delmap").setExecutor(this);

slender elbow
#

you're not gonna believe this

thorn isle
#

you are trying to get the command named delmap

#

but your plugin.yml has no such command

slender elbow
#

your plugin.yml does, indeed, not have a delmap command

remote swallow
#

woah

thorn isle
#

there is tptomap and setmap

#

but no delmap

remote swallow
#

who wouldve guessed that, i sure as hell didnt

thorn isle
#

so... add a delmap command to your plugin.yml

polar forge
#

The problem is

#

i get this error even with /tptomap

#

if i send that command

thorn isle
#

yes

#

because your plugin is disabled

#

because it ran into an error

polar forge
#

ok

thorn isle
#

because you tried to get a command that doesn't exist

#

one thing causes another

polar forge
#

you guys thought i was a liar

thorn isle
#

no

slender elbow
#

no-one said that

polar forge
#

or a troll

slender elbow
#

but you keeping information from us does not help us help you

thorn isle
#

because you were being an absolute fucking clown

eternal oxide
#

I said I believed you were a troll as you refused to find the error we needed

slender elbow
#

hiding information = no bueno

polar forge
#

i gave u the info as much i understood what u guys wanted

drowsy helm
#

💀

polar forge
#

im not hiding info im trying to undertsand what u guys are asking for me

thorn isle
#

we were very clear that the error you were sending wasn't the right one

#

and that there is another error in the log

#

at the very top of the log

#

which there was

polar forge
#

i thought u meant at the top of the paste i sent

#

of the log that was in the paste

thorn isle
#

and that is why you were being a clown

polar forge
#

you guys werent clear

#

at the top of the log

thorn isle
#

for future reference

#

what you sent was an error or an exception

remote swallow
#

i weirdly remember saying latest.log about 10 times

thorn isle
#

the "log" refers to the entire log

#

and yes, we told you to look at latest.log, as in the file, specifically

#

that is nowhere near unclear

polar forge
#

and for future reference, dont call someone a troll if he says he doesnt get what u guys are saying

thorn isle
#

you were absolutely acting as if you were a troll

polar forge
#

i was acting as someone being lost

thorn isle
#

maybe not intentionally, but we can't know that

polar forge
#

then why assume?

eternal oxide
remote swallow
#

love the fact it took like an hour to resolve 1 very small and easy to fix issue

thorn isle
#

we assume because you were being inconceivably daft

polar forge
#

I was trying to understand you

remote swallow
#

omg darthmango

vague swallow
#

Let's end this debate at this point since it doesn't lead to anything

thorn isle
#

sure, it's fine, though in the future it may be more productive to ask questions rather than say "i've already done it"

#

e.g. "what do you guys mean by log, i already sent it"

polar forge
#

^

#

I asked multiple time the question but didnt understand

#

but sure lets end it

remote swallow
#

have fun, see you back in about 2 hours

thorn isle
#

^

#

explicitly says "file" and the exact file name

polar forge
#

Funny enough i thought u guys meant the paste site

#

bc that was the latest.log file

#

of the error

remote swallow
#

what about this

manic delta
#

can i get spawner itemstack with custom entity or i need to set the entitytype after a player place it

#

i was searching on spigot but I didn't find anything about that, only with blocks placed

thorn isle
#

it's available as blockstatemeta iirc

#

as are all other tile entities; chests and the like

#

how you'd create a spawner tilestate to attach to the meta without like placing a physical block in the world and getting its state, i'm not sure; maybe there is a factory somewhere

manic delta
#

i made it

#

thank you vcs2

young knoll
#

You can set it for the item

#

But the player needs op to place it

prime tartan
young knoll
#

Kotlin

red bolt
#

Is there a way to get player input like playerinputevent but outside the event?

remote swallow
#

Listen to it and pass the event to a method

red bolt
#

ye

young knoll
#

Player#getInput iirc

red bolt
#

cool thx

#

just with any bukkit player?

manic delta
#

@sonic goblet why the skull lol

manic delta
#

well i dont care actually

#

is a client issue

sonic goblet
manic delta
sonic goblet
#

I’m sure you do lol

red bolt
red bolt
manic delta
manic delta
#

let me see

#

atom material icons

red bolt
#

oh cool thx

glad prawn
#

Yes?

worldly ingot
#

You have a class called Isometric_GM and a method called tick, but you're referencing that method as though it's static, but it's not. It's an instance method

#

You either need a new instance, or, which I'd argue is the better approach, have your Isometric_GM class implement Runnable and replace your tick() method with run(), then you can pass in new Isometric_GM() directly

red bolt
#

oh

glad prawn
#

this::tick is fine

red bolt
#

?

#

wdym

glad prawn
#

Because it is not static

red bolt
#

Isometric_GM is not this

glad prawn
#

You referencing an instance method

red bolt
#

yes..

young knoll
#

Doesn’t mean it’s an instance method in the current class

glad prawn
#

Then it is better as Choco suggested.

red bolt
#

I'm already implementing Listener

orchid furnace
young knoll
#

Comma

red bolt
orchid furnace
red bolt
#

np, literally learnt how to do it like 20minutes ago myself xD

red bolt
#

what's this abt?

tender shard
#

you're missing the brackets

#

new Isometric_GM()

red bolt
#

oh lol I tried earlier but it didn't work cuz I was missing "this" argument and I mistook it for smth else 🤦

flat lark
#

I used build tools to create obf mapped spigot but I don't know what folder its in.

wet breach
tender shard
#

usually you don't need to know where exactly that file is though because you'd also use maven or gradle or whatever to "use it"

manic delta
sullen marlin
#

creative mode?

#

there's inventorycreativeevent

sullen marlin
#

in creative mode all you can tell is that the client has set a block to a slot

#

so you could just purge all NBT in the event

manic delta
#

That event is called when the player puts a creative item in their inventory, so right? It wouldn't apply in this case right

sullen marlin
#

why wouldnt it

manic delta
#

I'll check how it works, I'll be right back

manic delta
#

oh lol it worked

#

tysm

tender shard
#

is creative inventory handled server-side nowadays?

sullen marlin
#

No

slender elbow
#

have you never heard the expression "the client is always right"?

remote swallow
#

just ignore the client giving itself an item that shouldnt ever exist

tender shard
red bolt
#

How do I force the player into specating an entity? (I know how to make them spectate, but how do I keep them there?)

echo basalt
#

setSpectatorTarget?

#

and then just cancel events ig

red bolt
#

yup

#

prob with that is that the player will still exit it for a split second

#

it's doable cuz some srvs do it

flat lark
#

Cause I am doing this.

sullen marlin
#

that's not what the version is

#

its, eg, 1.21.5-R0.1-SNAPSHOT

#

look in the folder to see the versions available

flat lark
#

is it1.21-R0.1-SNAPSHOT

eternal oxide
#

run buildtools

blazing ocean
#

you didn't run BT

flat lark
#

I did

#

Although, I did it in my downloads folder.

eternal oxide
#

did not for 1.21.5

flat lark
#

Do I need that to get the mappings for 1.21.4-R0.1-SNAPSHOT?

eternal oxide
#

latest is .5

flat lark
#

Am I suppose to build in the directory or should it automatically put it there?

eternal oxide
#

you build it anywhere

#

it gets installed to your local repo (.m2)

flat lark
#

It didnt for me. But is the obsucatued mapped code located in org.spigot.spigot or

eternal oxide
#

As you have been told more than once, RUN buildtools for the version you want. If you want remapped add -remapped

#

?nms

flat lark
#

I did run buildtools with --remapped I just didn't know the location and the spigot documentation is vague and dosen't say nothing about this besides run buildtools but not where the jar is located or maven implementation.

eternal oxide
#

you don;t need the jar yourself when using remapped

#

it gets installed to your local maven

flat lark
#

I got that part. You said its get installed to your local maven yes. But nowhere in org.spigotmc.spigot shows that jar even though I have ran it with remapped on it thats what Im saying. Maybe some file location issue

eternal oxide
#

the xml you posted has no scope so you didn;t follow the tutorial

flat lark
#

Well I am now.

eternal oxide
#

also Spigot is lite on nms as its not actually Spigot

#

Spigot is just the API NMS is minecraft code

flat lark
#

https://paste.md-5.net/guvahitusu.xml

This should be correct?
I did (still getting "Unresolved dependency: 'org.spigotmcspigot1.21.5-R0.1-SNAPSHOT'"
java -jar BuildTools.jar --rev 1.21.5 --remapped

eternal oxide
#

looks fine. What IDE?

flat lark
#

Intellji

eternal oxide
#

are you in offline mode?

#

else click refresh/update maven in the maven tab

flat lark
#

I have refreshed it multiple times.

eternal oxide
#

?paste your pom

undone axleBOT
eternal oxide
#

looks fine to me

flat lark
#

when I look in my .m2 I dont see that 1.21.5 there so is that the issue Im quite stumbled

eternal oxide
#

your buildtools log says its there

#

it tells you where it installed them

flat lark
#

NVM I lied

#

I was reload depends not project 🤦‍♂️

slim wigeon
sullen marlin
#

The effect is probably in your head

slim wigeon
#

How can I see that because when I try to see this like in 3rd person view, I don't notice anything?

sullen marlin
slim wigeon
#

I tried, I cannot get the numbers correct

valid basin
#

Hey fellas, I'm trying to make the player sitting on an entity using reflection that supports 1.8.8-1.21.5 but for some reason net.minecraft.network.protocol.game.PacketPlayOutSpawnEntity class doesn't exist on 1.21.4. If someone knows the correct mappings. I've checked on mappings.dev but it doesn't seem to work. this is my code:

eternal oxide
#

why are you using nms to spawn a bat?

valid basin
#

To make player sit on an entity and so they can't dismount

#

and I don't want to use bukkit events for it. It's just not smooth

eternal oxide
#

not smooth?

valid basin
#

Yeah I made it so when user dismounts I just mount him back on the entity 1 tick later

#

but when user actually rotates the rotation is weird

#

when it's an actual server-side entity

eternal oxide
#

sounds odd

valid basin
#

Do you know how to fix this tho? Like what are the correct mappings for modern versions?

eternal oxide
#

?mappings

undone axleBOT
valid basin
eternal oxide
#

in newer versions its addEntity

#

older used Spigot mappings. Now we use Mojang

valid basin
#

So this could code should work?

                    try {
                        spawnPacketClass = Class.forName("net.minecraft.network.protocol.game.ClientboundAddEntityPacket");
                    } catch (ClassNotFoundException e) {
                        spawnPacketClass = Class.forName("net.minecraft.network.protocol.game.PacketPlayOutSpawnEntity");
                    }
                    spawnConstructor = spawnPacketClass
                            .getConstructor(Class.forName("net.minecraft.world.entity.EntityLiving"));
                    spawnPacket = spawnConstructor.newInstance(bat);```
eternal oxide
#

try it and see. I don;t use reflection for it can;t tell you

valid basin
#

Alright, thx

#

I'll test it out

umbral ridge
#

Can you hide the names above the players head?

#

So that it wouldnt say anything

blazing ocean
#

yes, teams

umbral ridge
#

Soo make 1 team and add everyone to it? and just hide the name for team?

blazing ocean
#

yup

umbral ridge
#

teams are persistent right... ive never used teams

#

on player join, add the player to the team? the best way to add players to the team?

blazing ocean
#

Team#addPlayer or something

umbral ridge
#

how do you create a team?

#

i wanna create it in the game so i can just add players to it onjoin

blazing ocean
#

/team

umbral ridge
#

XD

cinder abyss
#

Hi there! Today I’m going to explain how to setup a multi-module project using maven to support different NMS versions. Important notes about this tutorial: Every step will have detailled screenshots using IntelliJ. I explicitly chose not to include everything as copy/pastable source code, but normal screenshots (you can click on them to show ...

blazing ocean
#

I mean you'd just do the same things but using gradle

cinder abyss
#

there's things that are weird

remote swallow
#

It's a gradle thing where it can't find them or smth use findProject(":nms:ver")?.projectDir = ...

cinder abyss
#

but at least I can sync

#

now I need to make it build lol

blazing ocean
#

I mean it depends on where the remap configuration comes from and what it does

#

because it might do weird resolver shit

#

because I can tell you that subprojects like that will always resolve when the configuration is implemented properly

cinder abyss
#

or I'll use shadowjar one

#

looks like I don't need a configuration

blazing ocean
#

well by default implementation adds to the runtime and compile classpath configurations

white crescent
blazing ocean
#

you're sending the json string, not the component

smoky anchor
#

?components you do not need to format the components yourself lol

undone axleBOT
cinder abyss
blazing ocean
#

I have no idea what you mean

cinder abyss
#

main build task executes at first...

blazing ocean
#

explain what you want it to do and how it's currently behaving

cinder abyss
#

so it doesn't shade correctly

#

I want to do a multimodules nms project for gradle

blazing ocean
#

could just add a dependency to remap the other projects to another shadow task

cinder abyss
blazing ocean
#

no, I'm saying you could make a shadow task that depends on the other projects remap takss

cinder abyss
blazing ocean
#

idk just create a task inheriting from ShadowJar

cinder abyss
#

okay, so that

blazing ocean
#

haven't looked at that page

cinder abyss
# blazing ocean haven't looked at that page

it was fucking laborious :```kts
tasks.compileJava {
subprojects.forEach {
if(usesReobfuscatedJar(it)) {
dependsOn(it.tasks.remap)
} else if(it.name != "NMS") {
dependsOn(it.tasks.build)
}
}
}

tasks.assemble {
dependsOn(tasks.shadowJar)
}```

wooden furnace
#

horse.getInventory().setSaddle(item) seem to be broken in 1.21.5 (worked in 1.21.4 and older versions). Does anyone know if this method has been moved/changed to something else?

CraftBukkit version 4460-Spigot-b4e69d9-6b8999d (MC: 1.21.5) (Implementing API version 1.21.5-R0.1-SNAPSHOT)

Stracktrace:

Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0
        at java.base/java.util.Arrays$ArrayList.set(Arrays.java:4232) ~[?:?]
        at net.minecraft.core.NonNullList.set(SourceFile:54) ~[spigot-1.21.5-R0.1-SNAPSHOT.jar:4460-Spigot-b4e69d9-6b8999d]
        at net.minecraft.world.InventorySubcontainer.a(InventorySubcontainer.java:198) ~[spigot-1.21.5-R0.1-SNAPSHOT.jar:4460-Spigot-b4e69d9-6b8999d]
        at org.bukkit.craftbukkit.v1_21_R4.inventory.CraftInventory.setItem(CraftInventory.java:101) ~[spigot-1.21.5-R0.1-SNAPSHOT.jar:4460-Spigot-b4e69d9-6b8999d]
        at org.bukkit.craftbukkit.v1_21_R4.inventory.CraftInventoryAbstractHorse.setSaddle(CraftInventoryAbstractHorse.java:20) ~[spigot-1.21.5-R0.1-SNAPSHOT.jar:4460-Spigot-b4e69d9-6b8999d]
        at se.file14.procosmetics.cosmetic.mount.type.InfernalHorror.onMountEquip(InfernalHorror.java:39) ~[?:?]
sly topaz
#

that method is just a convenience method for inventory.setItem(0, item) but if it is throwing out of bounds exception with length 0 then that means the inventory has no slots

wooden furnace
sly topaz
#

because I can't think of any cases where the inventory would be of size 0

#

gonna look at the source I guess

tall furnace
#

Ok so block dust particles changed from 1.20 to 1.21 and I'm having a hard time figuring out exactly what Spigot wants now. Error is
data (class org.bukkit.craftbukkit.v1_21_R1.block.data.CraftBlockData) should be class org.bukkit.Particle$DustOptions
How exactly do I get an instance of Dust Options? Not seeing it in the docs.

#

My line of code in question is as follows: java loc.getWorld().spawnParticle(Particle.DUST, loc.getX(), loc.getY()+0.1, loc.getZ(), 24, 0.5, 0, 0.5, 0, Material.COARSE_DIRT.createBlockData());

sly topaz
sly topaz
#

I don't think you're looking for the DUST particle if you are trying to display block particles

#

try BLOCK_CRUMBLE or BLOCK particles

#

the description of the constant should tell you which data type it expects

tall furnace
#

Ah, ok. I tried BLOCK_CRUMBLE but it doesn't exist in 1.21 and apparently DUST is no longer applied to blocks.

sly topaz
#

there's FALLING_DUST which also takes BlockData so may as well try that, I don't remember which one was the block particles one

tall furnace
#

Thanks alot, BLOCK seems to be what I was after

sly topaz
#

well, glad you got it working anyway

tall furnace
#

My IDE disagrees

#

I'm in 1.21.1, guess they added it between then and 1.21.5

sly topaz
#

that could be the case, there was a list where it mentions what the equivalent particles are in the new names but I don't remember where it was anymore

sly topaz
#

from the looks of it, saddles might be part of the entity equipment now rather than their inventories which are completely useless now for normal horses (not for chested ones)

#

you can try horse.getEquipment().setItem(EquipmentSlot.SADDLE, item) instead

lime pulsar
#

how can i find if an itemframe is at a block location?

sly topaz
lime pulsar
#

thank you!

weary blade
#

Hey! I noticed a problem on spigot 1.21.5 with lore. Basically I don't see item's lore in menu (lore set using ItemMeta#setLore(List<String>)). Does anyone has this problem too?

chrome beacon
#

Did you forget to set the item meta back on to the item

weary blade
#

Nope, everything worked on older versions. It happens only on 1.21.5

umbral ridge
#

how do you show a scoreboard on a side?

sly topaz
umbral ridge
#

with ingame commands

#

scoreboard objectives?

sly topaz
#

I mean, you do need an objective to display, yes

sly topaz
weary blade
sullen marlin
sly topaz
#

since everything that used to be there is now in the entity equipment

#

probably would be good to make it work again by just making it call the respective entity equipment methods but also deprecate it

tribal sky
#

hey

#

does anyone know the new form of f(NBTTagCompound)

short pilot
#

what is the most optimal way to make a custom entity return to a set point, after it is no longer in combat?

sly topaz
sullen marlin
#

?xy

undone axleBOT
tribal sky
sullen marlin
#

yes

sly topaz
#

for both really lol

tribal sky
#

well look

#

im not a coder

#

im helping my friend fix a plugin he owns

#

its a popular one

sly topaz
#

from what version to what version

tribal sky
#

the method was changed in 1.21.5

tribal sky
sly topaz
#

and from which object is that method being called

tribal sky
#

f(NBTTagCompound) is the method

sly topaz
#

yeah but from what class

tribal sky
#

EntityLiving.f(NBTTagCompound),

#

this?

#

Could not pass event PlayerInteractEntityEvent to plugin name
org.bukkit.event.EventException: null

sly topaz
#

would be helpful to have the whole stack trace / error instead

#

?paste

undone axleBOT
sullen marlin
#

would be helpful to know what the code is meant to be doing

sly topaz
tribal sky
#

source?

sly topaz
#

I just looked at the name from the old mappings and then looked at the new ones

chrome beacon
#

Why are you using unmapped

sly topaz
#

?mappings

undone axleBOT
sly topaz
chrome beacon
#

right, pass that question to the dev then

sly topaz
#

they're just trying to fix a plugin that probably has been abandoned or something

chrome beacon
#

They said it's their friend

tribal sky
#

its actually famous and still used

sly topaz
tribal sky
#

im not

sly topaz
#

which plugin to begin with

tribal sky
#

dev is also trying to fix it

#

you probbaly used the plugin

#

i dont know if i should say ,plugin owner might not be supportive about it

sly topaz
#

why are you glazing a plugin name lol

tribal sky
#

its a great one

#

you prob used it

wintry anvil
#

Could any1 look at my code rq and tell me if there is ANYTHING that could make my RAM spike up like idk? bc I got huge RAM issues rn and idk anymore...

Link would be here: https://github.com/Emn4tor/Waystonez

GitHub

Contribute to Emn4tor/Waystonez development by creating an account on GitHub.

sly topaz
#

lmao, okay. If it isn't abandoned then ask them to come here and ask the questions themselves

tribal sky
#

he was looking at other resources

peak shard
tribal sky
#

well yeah

#

lol

sly topaz
chrome beacon
#

Never heard of that plugin

sly topaz
#

if not, then just use mojmap

#

?nms

tribal sky
#

num1 search

#

or even just villager plugin

peak shard
sullen marlin
#

why do you even need nms

chrome beacon
#

^ I was about to ask

sly topaz
#

good question lol, I don't think there's anything about villagers that isn't already handled by the API

peak shard
#

to write an entity's entire nbt data to a string

chrome beacon
#

for what purpose?

sly topaz
#

you can use EntitySnapshot for that I believe

peak shard
chrome beacon
#

Yeah use an EntitySnapshot

peak shard
chrome beacon
#

No need for NMS here

peak shard
#

does EntitySnapshot work with Nbt in the background or? Bc i also need to decode the Nbt data and create a villager from it

chrome beacon
#

EntitySnapshot has a method to spawn an entity from it

#

also if you just want to put it on a spawn egg that's doable as well

#

Since the spawn egg can directly spawn your entity

#

If you really want to store it as a string there are methods for that as well

sly topaz
# peak shard lemme read the docs
private static final NamespacedKey VILLAGER_KEY = new NamespacedKey(MyPlugin.instance(), "villager");

// Storing 
var snapshot = villager.createSnapshot().getAsString();
var meta = someItem.getItemMeta();
meta.getPersistentDataContainer().set(VILLAGER_KEY, PersistentDataType.STRING, snapshot);
someItem.setItemMeta(meta);

// Spawning
var snapshot = someItem.getItemMeta().getPersistentDataContainer().get(VILLAGER_KEY, PersistentDataType.STRING);
Bukkit.getEntityFactory().createEntitySnapshot(snapshot).createEntity(someLocation);
#

that's how you'd use it

sly topaz
peak shard
sly topaz
#

yes, it's been there for a while now

chrome beacon
sly topaz
#

don't remember which version it was introduced though, let me check

peak shard
chrome beacon
#

Seems to be added in 1.21

sly topaz
peak shard
chrome beacon
#

Can just skip 1.20.0 and .1 then

#

Not many users there

peak shard
#

are there any other ways than NMS then if i want to support 1.20 as well?

chrome beacon
#

Or use nms just for those versions specifically

#

Use nms for 1.20(.1) and EntitySnapshot in 1.20.2+

peak shard
#

its also important that it works with nbt, so that it works after updating from previous versions

#

idk how EntitySnapshot exactly works

sly topaz
#

actually, the EntitySnapshot class exists since 1.20.2 but the EntityFactory was added in 1.20.5

sly topaz
peak shard
#

i think i'd still prefer nms at this point tho

sullen marlin
#

...

sly topaz
#

I mean, you'd have to deal with maintaining that over versions

sullen marlin
#

so you want to do this every single update?

#

rather than just have your plugin not need updates

sly topaz
#

you'll have to use NMS for the versions where the API didn't exist, but you're better off using the API in the versions where it does exist

peak shard
sly topaz
#

and for the versions where you have to use NMS, use a remapping plugin so you can use the mojang-mapped names instead

#

?nms

sly topaz
#

you can check out that guide for reference

peak shard
sly topaz
#

nope

sullen marlin
#

Im so confused why this is an issue discussion even?

#

take all your existing code, stop making changes to it

wooden furnace
sullen marlin
#

and then where you were previously going to put (if 1.21.5) nms(); just put (if 1.21.5) api();

chrome beacon
#

oh and do proper nms detection

#

otherwise you'll have people complaining when your plugin won't work on Paper

blazing ocean
#

(if 1.21.5) nms(); my favourite

sly topaz
#

oh it is both a plugin and a mod

peak shard
blazing ocean
peak shard
#

if you mean package relocation i already check for that

chrome beacon
#

hm? not in the code on Github 🤷‍♂️

sly topaz
sly topaz
chrome beacon
#

Wait you do in a catch block

#

I missed that, do it the recommended way 😅

peak shard
chrome beacon
#

For now maybe

#

but you're relying on it throwing an array out of bounds exception

peak shard
#

yeah the reccomended way makes way more sense

sly topaz
#

eh, I doubt that'll ever not be the case, either way works, one is just less pretty to look at

#

if you want to get onto the nitty-gritty, then it would be less performant to depend on the exception being thrown as exceptions are expensive, but it isn't like this is a performance-sensitive method anyway

peak shard
#

ok, EntitySnapshot doesnt seem to be compatible with older versions on its own (as in it cant parse pure Nbt) probably the entity id data is missing

nova roost
#

does somebody know how i can copy the data of a block and the block from a location to a location. for example chest contents or sign text

sly topaz
chrome beacon
nova roost
sly topaz
chrome beacon
#

Do note that not all blocks have a block state (chests and signs do though)

peak shard
sly topaz
#

why does it even include the id, it's spawning a new entity so it should just discard it

sly topaz
peak shard
#

i dont mean the uuid, i mean the entity id (i.e: minecraft:villager)

sly topaz
#

ah I thought you were talking about the network id of the entity

tribal sky
#

hey guys just checking up is it all going well?

nova roost
sly topaz
tribal sky
sly topaz
#

couldn't you just add the id yourself? Since it should just be villager anyway

#

unless you are storing different types of entities

peak shard
#

yeah, i already previously stored the entity type (either villager or zombie villager) in a custom nbt key, i could just append it to the nbt

sly topaz
peak shard
sly topaz
#

I mean, there is Gson

nova roost
sly topaz
#

you could probably just use that lol

sly topaz
peak shard
nova roost
sly topaz
peak shard
#

i think it differs quite a bit no?

sly topaz
peak shard
#

keys dont need quotes in NBT, but they do in json for a start

sly topaz
#

block.getState().copy(...).update()

peak shard
#

i mean i could just try to hack it and try to modify the string

sly topaz
peak shard
#

idk how sensable that is though

chrome beacon
sly topaz
chrome beacon
#

Hence the name Mojangson

peak shard
#

this is returned by EntitySnapshot:

{AbsorptionAmount:0.0f,Age:0,AgeLocked:0b,Air:300s,Brain:{memories:{"minecraft:home":{value:{dimension:"minecraft:overworld",pos:[I;-772,64,-257]}}}},Bukkit.Aware:1b,Bukkit.updateLevel:2,CanPickUpLoot:1b,DeathTime:0s,FallFlying:0b,Fire:-1s,FoodLevel:0b,ForcedAge:0,Gossips:[],Health:20.0f,HurtByTimestamp:15,HurtTime:0s,Inventory:[],Invulnerable:0b,LastGossipDecay:4473005L,LastRestock:0L,LeftHanded:0b,Motion:[0.0d,-0.0784000015258789d,0.0d],OnGround:1b,PersistenceRequired:0b,PortalCooldown:0,RestocksToday:0,Rotation:[143.17049f,12.191358f],Spigot.ticksLived:49,VillagerData:{level:1,profession:"minecraft:none",type:"minecraft:desert"},Xp:0,attributes:[{base:20.0d,id:"minecraft:max_health"},{base:16.0d,id:"minecraft:follow_range",modifiers:[{amount:0.023075759650816374d,id:"minecraft:random_spawn_bonus",operation:"add_multiplied_base"}]},{base:0.5d,id:"minecraft:movement_speed"}],fall_distance:0.0d,id:"minecraft:villager"}```
sly topaz
#

wonder if gson has any issue with it

nova roost
sly topaz
nova roost
sly topaz
#

do update(true)

chrome beacon
#

Did you set the block at that location first

nova roost
#

thx

#

works

sly topaz
#

the file name lmao

peak shard
#

lol

sly topaz
#

here's in a paste

peak shard
# sly topaz eh, it should be fine™

this is truly one of the fixes of all time

String nbt = data.get(NBT_KEY, PersistentDataType.STRING);
if (!nbt.contains("id:\"minecraft:villager\"")) {
    nbt = nbt.substring(0, nbt.length() - 1);
    nbt = nbt.concat(",id:\"minecraft:villager\"}");
}
sly topaz
tribal sky
#

y'all still working?

sly topaz
#

that's how development goes usually

tribal sky
#

make a plugin for me 🤑

#

villager discounts apply for all that's it

sullen marlin
#

Who do they normally apply for

tribal sky
#

the one who cures the villager

peak shard
#
    static {
        try {
            Class.forName(NMSUtils.cbClass("entity.EntitySnapshot"));
            Class.forName(NMSUtils.cbClass("entity.EntityFactory"));
            isEntitySnapshotSupported = true;
        } catch (ClassNotFoundException exception) {
            isEntitySnapshotSupported = false;
        }
    }
peak shard
#

i hate the indentation ffs

sly topaz
#

why are you looking for cb classes

#

they are API classes

peak shard
#

my bad

tribal sky
#

I might try to get in java

#

is it similar to python more or web development

peak shard
rough ibex
#

are apples more like bananas or grapes

#

???

peak shard
#

web development can be a gazillion languages too lol

rough ibex
#

different language

tribal sky
#

But like

#

lists

#

or arrays?

peak shard
#

every language has both

#

wdym

blazing ocean
tribal sky
#

I can't explain 😭

rough ibex
#

List<T> e = new ArrayList<>();

tribal sky
#

like is the indention needed

blazing ocean
#

no

peak shard
tribal sky
#

good i hate it

blazing ocean
#

if you don't use indentation, your code will just be unreadable

rough ibex
#

You should really just read java code and see how it works

tribal sky
peak shard
#

@sly topaz uhh there is an issue with either the serialization or just the way EntitySnapshot works itself

chrome beacon
#

Recommend Intellij

rough ibex
#

Either

#

but ij is better for it

chrome beacon
#

but vscode works

blazing ocean
#

vsc has java support but it's not very good

thorn isle
#

pythonoid detected

peak shard
tribal sky
chrome beacon
#

?learnjava

undone axleBOT
#

For Beginners:

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

For Intermediate to Advanced Learners:

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

Practice and Hands-on Learning:

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

Free Resources and Documentation:

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

Community and Support:

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

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

tribal sky
#

damn for web development there was courses by meta

rough ibex
#

Okay

peak shard
tribal sky
#

is it learning java or specifically something in java

sly topaz
peak shard
#

will do in a sec

sly topaz
#
var nbt = data.get(NBT_KEY, PersistentDataType.STRING);
var type = data.get(TYPE_KEY, PersistentDataType.STRING);
if (type != null) {
  var entityType = type == VillagerType.ZOMBIE ? "minecraft:zombie_villager" : "minecraft:villager"; // would probably be better to put the id as a param of the enum constant
  nbt = nbt.substring(0, nbt.length() - 1).concat(",id:\"" + entityType + "\"}"); 
}
#

this is how I'd go about the entity id btw

#

now that I think about it, you could just get the TYPE_KEY lol

#

the issue only comes with fabric items which use EntityType

peak shard
# sly topaz now that I think about it, you could just get the TYPE_KEY lol

this is what im doing atm:

    @Override
    public Entity readAndSpawnAt(String string, EntityType type, Location location) {
        // Check for possibly missing type data in the string
        String typeData = "id:\"" + type.getKey() + "\"";
        if (!string.contains(typeData)) {
            StringBuilder builder = new StringBuilder(string);
            builder.setCharAt(builder.length() - 1, ',');
            builder.append(typeData);
            builder.append("}");
            string = builder.toString();
        }
        EntitySnapshot entitySnapshot = Bukkit.getEntityFactory().createEntitySnapshot(string);
        return entitySnapshot.createEntity(location);
    }
sly topaz
peak shard
sly topaz
#

oh nvm, I read that wrong

#

if you already know the entity type beforehand, then that should work fine, yeah

sly topaz
#

well the data is definitely there

peak shard
sly topaz
#

can you try a summon with that nbt

#

I want to make sure the nbt isn't malfored for some reason

peak shard
sly topaz
tribal sky
#

is this good

sly topaz
#

I just generated it with mcstacker so I don't know if it is any good lol

peak shard
#

i got [00:11:57] Unable to summon entity due to duplicate UUIDs

#

as the command block output

#

wait lemme randomize sth

sly topaz
#

you can just kill that entity

#

or remove the uuid part

peak shard
#

ok

#

i spawned it

#

and it also doesnt have the enchantments

#

weirdd

red bolt
#

My brain aint computing rn could you tell me if this looks like it would work?

@EventHandler
public void playerInput(PlayerInputEvent e) {
    Player p = e.getPlayer();

    if (p.getCurrentInput().isForward() != e.getInput().isForward() && p.getCurrentInput().isForward()) {
        playerKeyPress.computeIfAbsent(p, k -> new ArrayList<>()).add(KeyCodes.W);
    } else {
        playerKeyPress.computeIfAbsent(p, k -> new ArrayList<>()).remove(KeyCodes.W);
    }
}
ArrayList<Player> playersInIsometric;
HashMap<Player, ArrayList<KeyCodes>> playerKeyPress;
peak shard
#

theres also an error log

slender elbow
#

the else block will also run if the forward input didn't change, e.g. i keep pressing forward but i also press right

peak shard
peak shard
red bolt
#

alr is this better?

@EventHandler
public void playerInput(PlayerInputEvent e) {
    Player p = e.getPlayer();

    if (p.getCurrentInput().isForward() != e.getInput().isForward() && p.getCurrentInput().isForward()) {

        playerKeyPress.computeIfAbsent(p, k -> new ArrayList<>()).add(KeyCodes.W);

    } else if (p.getCurrentInput().isForward() != e.getInput().isForward() && !p.getCurrentInput().isForward()) {
        playerKeyPress.computeIfAbsent(p, k -> new ArrayList<>()).remove(KeyCodes.W);
    }
}
tribal sky
peak shard
tribal sky
slender elbow
#

i'm not exactly sure what you're tryingt o achieve with the map that wouldn't be achieved with simply storing or just accessing the player's current input

red bolt
slender elbow
#

yeah uh, just, player.getCurrentInput().isForward() etc?

#

🤔

red bolt
slender elbow
#

yes

red bolt
#

oh wait

slender elbow
#

if it's true, it's pressed; if it's false, it isn't

tribal sky
red bolt
#

my brain ain't braining today 🤦

#

tysm

#

that just made this 100x times easier ty 🙏

sly topaz
peak shard
sly topaz
#

use the data command to print the entity's nbt and compare it with whatever entity snapshot returns

peak shard
red bolt
sly topaz
#

components:{"minecraft:enchantments":{levels:{"minecraft:silk_touch":1,"minecraft:unbreaking":2}this formatting is definitely weird, don't know where it is coming from

tribal sky
red bolt
#

gn o/

peak shard
slender elbow
#

you don't need that even

peak shard
#

as in: HashMap<Player, HashSet<KeyCode>>

red bolt
slender elbow
#

you can access the player's current input by.. accessing the player's current input :pepelaugh:

red bolt
slender elbow
#

true true

red bolt
peak shard
#

here is the nbt data from ingame

#

oh wait

#

thats for another villager

#

heres the EntitySnapshot's nbt for the same villager

sly topaz
#

okay I am confused, while the nbt from my command was malformed, these two are the exact same

peak shard
sly topaz
#

I don't see any reason these should fail to spawn with proper enchantments

sly topaz
peak shard
peak shard
peak shard
#

thanks

#

yeah it looks fine ngl

#

what could we do in this case? :p

#

oh wait

#

tf

#

its working

#

at least that one villager

flat lark
young knoll
#

I believe you can check if an item has custom enchantments, yeah

#

You’d check the namespaced key

sly topaz
# peak shard at least that one villager

I was staring at the codecs like a maniac to check whether there was some data loss somewhere along the run, as all it does for creating is calling the load method on nms.Entity

peak shard
#

it has a levels key instead of the enchantments

sly topaz
peak shard
sly topaz
peak shard
#

yep

red bolt
#

how can I get Math in java?

sly topaz
#

if that's the case, then it must be the fact that the nbt format changed and since you don't apply datafixerupper to your nbt, it didn't upgrade as it should have

red bolt
peak shard
#

send the full code

red bolt
chrome beacon
red bolt
#

I need to import it

#

but it does not give the option

peak shard
#

yeah probably an import issue

sly topaz
#

@young knoll sorry for the ping, but I think you had a class which dealt with saving and loading entities while applying DFU properly?

red bolt
#

do you know the import?

peak shard
chrome beacon
#

^^

peak shard
#

java.lang.Math

red bolt
#

oh thx

sly topaz
#

the issue is most likely an odd pair of parenthesis

red bolt
#

worked 👍

peak shard
#

do you think there is a way to apply the dfu?

sly topaz
#

there is a way to do that, I just don't remember how lol

frosty arrow
#

Hey, i got a question about the customModelData. Since minecraft changed something about the customModelData in the new version(s), has this changed something about the way to use it in my plugin? Im using this code to set the modelData from the config.yml:
itemMeta.setCustomModelData(customModelData);
But is this still a valid way due to the changes?

sly topaz
#

I have to cook dinner but once I finish I can look into that properly

peak shard
frosty arrow
chrome beacon
#

Under the hood it just converts that int to a float

frosty arrow
#

But i think it can also be a string

chrome beacon
#

Yes

frosty arrow
#

So i will just be convertet to a string?

chrome beacon
#

No

frosty arrow
#

So?

sly topaz
#

now I wonder, since EntitySnapshot doesn't save data version, and createEntity also doesn't apply DFU, it probably breaks the same way

chrome beacon
frosty arrow
#

How does it work with a string?

chrome beacon
#

oh and colors

peak shard
#

since the whole data format is different

#

at least i think

frosty arrow
sullen marlin
sly topaz
#

Will do

peak shard
sick wave
#

where do I put my external jar files within my gradle project, in order to use Path.of?
I'm trying to use the experimental stuff

public class APILoader implements PluginLoader {
    @Override
    public void classloader(PluginClasspathBuilder classpathBuilder) {
        classpathBuilder.addLibrary(new JarLibrary(Path.of("libs", "DecentHolograms-2.8.16.jar")));
    }

}

but keep getting this error when running my server: [17:01:18 ERROR]: [DirectoryProviderSource] Error loading plugin: Could not find library at libs\DecentHolograms-2.8.16.jar

I've created this folder inside the root repository folder. I've also place the plugin within my plugins. IK Path.of was introduced in JDK 11, but I'm not sure how this works when your project gets compiled to a jar file, and have to rely on relativeness.

peak shard
#

i mean in the worst worst case i could warn players that updating to 1.21.5 would break previously picked up villagers, but that is far from ideal :/

sullen marlin
#

you need to run the upgrade methods on the data

peak shard
sullen marlin
#

your fault for using NMS (although I acknowledge the API apparently has the same issue)

#

yes

sly topaz
#

do note that you have to apply the VILLAGER_TRADE data fixer, not the item stack one

sly topaz
chrome beacon
#

I suggest you head over to the Paper discord

peak shard
#

but to be fair, EntitySnapshot wasnt even an option when i was trying to find a way to do this

#

(at least for the api version i was looking at)

young knoll
#

Mmm yeah I didn’t really think about DFU when making snapshots

#

Do serialized items go through DFU these days?

sullen marlin
#

but yeah we should look at adding versioning to snapshots (and also the equivelant methods @worldly ingot added for items or blocks or whatever)

peak shard
#

idk if thats an issue though

sly topaz
#

just add data version to your PDC so that you can check whether it is new or not

sly topaz
peak shard
#

idk which one makes more sense

sly topaz
#

from 1.20 since anyone upgrading from that version will have issues otherwise

#

it'll apply more data fixers than necessary but it's a one time thing so eh

chrome beacon
#

I wonder what will happen if the data is newer though

sly topaz
#

it should properly ignore the data fixers it can't apply

#

I'll test it later when I finish cooking

chrome beacon
#

Give me a ping when you're done so I find the result tomorrow :)

peak shard
#

also, what if i just try to manipulate the string myself?

#

{components:{"minecraft:enchantments":{levels:{"minecraft:unbreaking":1}}} -> {"minecraft:enchantments":{"minecraft:fortune":3}}

#

this seems to be the breaking change so

sly topaz
#

I mean, there's nothing stopping you from doing that

#

I would personally do that as well so that you don't have to deal with nms in the code that is supposed to be full API lol

#

that said, unless the API is fixed in this version, you'll have to deal with DFU for future versions

peak shard
#

i think ill look into it tmr

#

its best to save the data version now though, in case its needed later

#

regardless of what i do

sick wave
worldly ingot
#

For this very reason. Because they don't go through the DFU

#

Those entity snapshots were also only really meant as a way to pass an entity template into a spawner configuration, so same thing there. I don't think it needs a version. They were never meant for serialization

red bolt
#

So I'm making the player a spectator of an armorstand but when I move (tp) the armorStand the player does not follow...

slender elbow
red bolt
#

I'm even making the player a specator every time I tp the armor stand

worldly ingot
#

I meant like being able to configure an item in a config.yml similar to how you would write a /give command. Because people kept making these stupid convoluted YML item parsers instead of using the SNBT format Mojang already has built-in for their commands

#

It's up to server owners to keep their config.ymls up to date much like they keep their command blocks up to date

young knoll
#

Bold of you to assume they have command blocks

worldly ingot
#

I'M DRAWING A COMPARISON KEKW OMG

young knoll
#

HOW MANY COMMAND BLOCKS DOES HYPIXEL USE HUH

worldly ingot
#

WHOLE SERVER IS DONE WITH COMMAND BLOCKS

red bolt
#

really?

young knoll
#

Knew it

red bolt
#

I thought they mostly used plugins

wet breach
#

the easiest way to do this is to have a new armorstand at the destination before hand, and then you teleport and mount player to new armorstand, delete old one

red bolt
#

what about velocity?

#

if I use velocity it'll work

slender elbow
#

in fact

#

I wholeheartedly disagree

#

words simply lack the ability to express my disagreement

worldly ingot
#

That's why you contribute to Paper and I don't really contribute anywhere anymore KEKW

slender elbow
#

your mother

worldly ingot
#

wtf

slender elbow
#

sorry

#

i just wanted to say it

#

it was very funny

worldly ingot
#

Was pretty funny

red bolt
#

what is this chat 😂

wet breach
remote swallow
worldly ingot
#

Anywhere public*

remote swallow
#

Damn doesn't even update his component pr

worldly ingot
#

I gave up

remote swallow
#

Fair

red bolt
#

😂

young knoll
#

Choco is ded

#

Rip in peace

jagged thicket
red bolt
#

Why isn't this working?

ArmorStand playerAS = playersArmorStand.get(p);

Location asLoc = playerAS.getLocation();
float yaw = asLoc.getYaw();

double radians = Math.toRadians(yaw);

double forwardX = Math.sin(radians);
double forwardZ = Math.cos(radians);

double rightX = -Math.cos(radians);
double rightZ = Math.sin(radians);

double leftX = Math.cos(radians);
double leftZ = -Math.sin(radians);

double backwardX = -forwardX;
double backwardZ = -forwardZ;

Vector velocityRight = new Vector(rightX * asMovementSpeed, 0, rightZ * asMovementSpeed);
Vector velocityLeft = new Vector(leftX * asMovementSpeed, 0, leftZ * asMovementSpeed);
Vector velocityForward = new Vector(forwardX * asMovementSpeed, 0, forwardZ * asMovementSpeed);
Vector velocityBackward = new Vector(backwardX * asMovementSpeed, 0, backwardZ * asMovementSpeed);


if (player.getCurrentInput().isForward()) {
    playerAS.setVelocity(velocityForward);
}
if (player.getCurrentInput().isBackward()) {
    playerAS.setVelocity(velocityBackward);
}
if (player.getCurrentInput().isLeft()) {
    playerAS.setVelocity(velocityLeft);
}
if (player.getCurrentInput().isRight()) {
    playerAS.setVelocity(velocityRight);
}
undone axleBOT
#

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

drowsy helm
#

what are you trying to achieve

red bolt
drowsy helm
#

also what is p

red bolt
#

it's supposed to move when one of those keys are pressed with velocity but its not

drowsy helm
#

in this context

red bolt
#

player

drowsy helm
#

either asMovementSpeed is too low or zero or the current input isn't working properly. What have you done to try and debug it

red bolt
#

well I used to tp it to move it instead of using velocity and that worked so its not the input

drowsy helm
#

also I'm assuming

playersArmorStand.get(p);

is a hash map which means you are using a player as a key, which is a big nono

red bolt
#

why?

drowsy helm
#

using player as a key causes data leaks. Use UUID

red bolt
#

oh ok

#

thx

#

but yeah the volicty should be getting applied

drowsy helm
#

just print velocity to console and see if the output looks normal

red bolt
#

hmm is this too small?

[22:18:43 INFO]: 0.7156892555090487,0.0,0.6984188496517714
[22:18:43 INFO]: 0.7156892555090487,0.0,0.6984188496517714
[22:18:43 INFO]: 0.7156892555090487,0.0,0.6984188496517714
[22:18:43 INFO]: 0.7156892555090487,0.0,0.6984188496517714
[22:18:43 INFO]: 0.7156892555090487,0.0,0.6984188496517714
[22:18:44 INFO]: 0.7156892555090487,0.0,0.6984188496517714
[22:18:44 INFO]: 0.7156892555090487,0.0,0.6984188496517714
[22:18:44 INFO]: 0.7156892555090487,0.0,0.6984188496517714
[22:18:44 INFO]: 0.7156892555090487,0.0,0.6984188496517714
[22:18:44 INFO]: 0.7156892555090487,0.0,0.6984188496517714
[22:18:44 INFO]: 0.7156892555090487,0.0,0.6984188496517714
[22:18:44 INFO]: 0.7156892555090487,0.0,0.6984188496517714
[22:18:44 INFO]: 0.7156892555090487,0.0,0.6984188496517714
[22:18:45 INFO]: 0.7156892555090487,0.0,0.6984188496517714
[22:18:45 INFO]: 0.7156892555090487,0.0,0.6984188496517714
[22:18:45 INFO]: 0.7156892555090487,0.0,0.6984188496517714
#

(of values)

#

bigger values but still wont move a pixel

drowsy helm
#

is the gravity on the armour stand disabled?

#

thats the only other thing i can think of

red bolt
#

OOOH

#

that affetcs it

#

🤦

drowsy helm
#

yep

red bolt
#

easy but overlooked solution 🙄🤦

red bolt
sullen marlin
#

given velocity is physics

red bolt
#

yup cool thx

drowsy helm
#

what is setNoPhysics from?

#

is that a paper thing

red bolt
#

seems like it

drowsy helm
#

indeed it is

#

in spigot all you need is gravity, couldn't tell you what would happen in paper

red bolt
#

ye

#

is there a comparison of how much velocity I need to move said distance?

#

like .5 for one block smth

#

aprox

drowsy helm
#

uh probs just have to fuck around with numbers

#

I'm not sure on that

red bolt
#

ye lol 😅

#

thx for the help tho

red bolt
#

I HAVE A PROBLEM!
FIRST:
so umm disabling the gravity works, but it means the armorstand wont stay in the air... which is a problem...

Second:
My player does not follow the armorstand... (they are spectating the AS)

drowsy helm
red bolt
#

yup

red bolt
#

but like I mean when a mob walks around you follow so whats the difference here?

dreamy glade
#

Anyone know what event I can listen to in ProtocolLib to intercept and modify messages sent by server to player?

red bolt
dreamy glade
#

I tried that event but it seem to only trigger on player chat?

#

I want the opposite

red bolt
#

isn't that what you want

#

wdym

dreamy glade
#

Like when player type /essentials version. the server send plugin messages to the player via sendMessage()

#

i want to intercept that event and change the message

#

I saw premium plugin done that but i'm not sure how

red bolt
drowsy helm
red bolt
dreamy glade
drowsy helm
#

its not plugin message

#

looks at link i sent

#

plugin message is for client channel messaging

red bolt
drowsy helm
#
  1. I dont think you can make velocity work without gravity. You can either try display entity interpolation or just manually calculating velocity then update every tick (will be choppy)

  2. Are you unmounting it or something?

#

it should follow naturally

red bolt
#

I'm not unmounting it

#

I stay mounted I'm stuck in it but remain at the original position when I exit the armorstand I tp to it's latest location

#

my alt sees the armorstand move away but I stay there

drowsy helm
#

wait wdym "when i exit the armorstand"

#

why exit if you're trying to follow it?

red bolt
#

at the end of testing

#

I kill the armor stand or go into creative

#

sending a vid one sec

red bolt
#

dont know why it does this but yeah

sly topaz
#

one may argue that it is misuse, but is it really? Considering it is the only sensible way to serialize these objects, be it in a configuration or whatever other type of data storage

#

if it were the case that the server platform had to provide their own upgrading system, I can understand, but vanilla provides it for people to use, so I realistically see no reason to not take advantage of it and make people's lives easier

red bolt
wet breach
topaz stirrup
#

Does anyone know how to set the tick of a falling sand block? (I just got into plugin making so sorry if it is a stupid question.)

sullen marlin
#

What do you mean?

topaz stirrup
# sullen marlin What do you mean?

so I made falling sand that I don't want to despawn, the reason I won't use block displays is because they have no collision, but I don't like how they time out after 600 ticks, is there some way to stop that or at least reset the timer.

#

is it not possible?

#

Or even how to detect left click on falling sand as it seems that also doesn't work.

sullen marlin
#

setTicksLived maybe

topaz stirrup
drowsy helm
#

but can definitely do work arounds with invis entities

topaz stirrup
slim wigeon
#

So annoying, server got killed

grim hound
#

Is it possible to create a decently big character that'd still get affected by color codes, with a texture pack?

blazing ocean
#

what

#

bitmaps get tinted when a text colour is set

grim hound
blazing ocean
#

they do

echo basalt
#

They do

#

You can use a 1x1 pixel with a huge height to fill the whole screen

topaz stirrup
echo basalt
#

Or make a thread

topaz stirrup
topaz stirrup
grim hound
#

"physical" interact is an option

topaz stirrup
grim hound
#

Can you give a riding entity an offset/translation?

blazing ocean
#

is it considered bad practice to have a game instance be a listener and register/unregister it at its lifecycle phases? I know it's usually discouraged to register listeners at runtime but it would seem annoying to implement a seperate listener for all game instances and all I need

drowsy helm
#

can you not have some sort of proxy listener to pass it through to?

blazing ocean
#

well that's what I was saying, it's annoying to have to do that for each event I need

#

because I'm not gonna implement that for each event there is

#

well, I could write some script that would generate such an interface but that's also really annoying

drowsy helm
#

yeah just heaps of boilerplate

#

i mean as long as you handle unregistering properly it's not inherently that bad

blazing ocean
#

so that's kinda a lot

blazing ocean
#

thanks

weak bear
#

Hello which is the best version to make my server actually thx you

blazing ocean
#

latest

tribal sky
umbral ridge
#

3 hours for teleport

rough drift
umbral ridge
#

need to handle everything

#

different types of teleportations

chrome beacon
#

sub sections 🙏

umbral ridge
#

XD

jagged thicket
#

does java have smth like

"hello {0} im from {1}".format("user1", "abc")

like python natively

umbral ridge
#

you have String.format

#

String.format("This is %s, and it's year %s", "spigot", "2025");

jagged thicket
#

ahh alright makes sense

jagged thicket
hazy parrot
#

Or "".formatted if on newer java versions

young knoll
#

They are adding string templates

#

Eventually™️

thorn isle
#

just remember to actually unregister it or you'll be accumulating bogus event handlers and leaking memory

#

for more oop style event listening, i'd recommend having the object your game lifecycle is bound to to implement Listener but declare any event handlers, and subscribe to events with

PluginManager::registerEvent(
    @NotNull Class<? extends Event> event,
    @NotNull Listener listener,
    @NotNull EventPriority priority,
    @NotNull EventExecutor executor,
    @NotNull Plugin plugin)
#

where EventExecutor is a functional interface which is typically just passed a method reference to what your @EventHandler method would be

#

once the game is done call HandlerList::unregisterAll(Listener)

blazing ocean
#

I'm probably gonna change it in the future to one listener per instance to support priorities and such

chrome beacon
blazing ocean
#

so you can easily listen to all possible events

#

it's cursed, but works

chrome beacon
#

Could you not just have a generic method

blazing ocean
#

then what if you wanna handle multiple events

red bolt
wet breach
#

should probably make sure they are not in creative and flying first

#

there are just some things the server won't do on its own, such as removing flying

red bolt
chrome beacon
#

Have it like a register event method

blazing ocean
#

oh I meant on the instance-side

#

well that could work but needs actual registration

thorn isle
blazing ocean
#

see my message above

thorn isle
blazing ocean
#

I thought he meant like a fun <T : Event> handle(event: T)

thorn isle
#

e.g.

this.listenTo(PlayerMoveEvent.class, (event) -> doSomething());
red bolt
blazing ocean
thorn isle
#

or

this.listenTo(PlayerMoveEvent.class, this::onMove);

private final void onMove(PlayerMoveEvent e) {
   //do something
}
#

if you think about it, writing a method call and passing it a lambda isn't much different from implementing and annotating a method

#

same amount of boilerplate

blazing ocean
#

yeah I'm aware, but for my implementation, you just register one singular listener that listens to all events and calls them for the provided handleables

wet breach