#help-development

1 messages · Page 953 of 1

peak jetty
#

ok i got it

lost matrix
#

@young knoll Im pulling my hair out. Doesnt matter what i try, my work directory refuses to include moj mapped files for this class.
I've meticulously read the contribution section in stash because i havent PRd nms changes for a while. And im literally unable to find out the workflow.

peak jetty
#

do you know how i can modify this number to add the player here?

blazing ocean
#

question: why

lost matrix
#

Everything that maps from X to Y should have a dedicated class which handles this relation.
And managers are a simple solution for that.

civic sluice
lost matrix
#

Alright but let me take my doggo for a walk. I need to calm first.

civic sluice
remote swallow
#

show dog

polar forge
#

Guys I wrote the plugin, everything works just fine but it doesn’t show any info I edited (with the comman /hoveredit Egitto)

#

?paste

undone axleBOT
polar forge
#

Here’s the code

#

I tested it, but it doesn’t show the info I edited

#

In chat “Hover Chat Plugin”

peak jetty
#

how do i update it now?

public PacketContainer changeOnlinePlayersAmount(int onlinePlayers) {
        PacketContainer packet = new PacketContainer(PacketType.Status.Server.SERVER_INFO);
        WrappedServerPing ping = packet.getServerPings().read(0);
        ping.setPlayersOnline(onlinePlayers);
        return packet;
    }```
hybrid turret
blazing ocean
#

and of course set your MOTD, maxplayers and version

peak jetty
blazing ocean
#

that would leave you with an otherwise empty packet

#

which might give you an exception or crash client, idk

#

paper has an event for that where you can directly modify stuff, just saying ^^

blazing ocean
#

PaperServerListPingEvent

lost matrix
blazing ocean
#

awwww

icy beacon
#

I SEE DOG

nova quail
#

how can I repeat code 16 times and wait 200 ticks before the next code block repeat?

young knoll
#

?scheduling

undone axleBOT
nova quail
shut field
#

does anyone know how the plugin “model engine” does what it does, with allowing like extra textures in game without overwriting some?

glass breach
#

Having some difficulties with damage types and events...
I've canceled the entity explode event:

@EventHandler
    public void onEntityExplodeEvent(EntityExplodeEvent event) {
        event.setCancelled(true);
    }

but I am still somehow able to damage myself with ENTITY_EXPLOSION. Could anybody help me? Thanks!

blazing ocean
blazing ocean
#

you would need to cancel an EntityDamageEvent if that's the reason

peak jetty
# blazing ocean protocollib

is this code good tho?

public PacketContainer changeOnlinePlayersAmount(int onlinePlayers) {
        PacketContainer packet = new PacketContainer(PacketType.Status.Server.SERVER_INFO);
        WrappedServerPing ping = packet.getServerPings().read(0);
        ping.setPlayersOnline(onlinePlayers);
        return packet;
    }```
blazing ocean
glass breach
blazing ocean
#

i'm pretty sure the explosion doesn't deal the damage itself, could be wrong tho....

junior cradle
#

Does anyone know why the stand breaks? if it says stand.setInvulnerable(true);

        final ArmorStand stand = (ArmorStand) this.location.getWorld().spawnEntity(this.location, EntityType.ARMOR_STAND);
        stand.setMetadata("NPC", new FixedMetadataValue(Anarchy.getInstance(), this.npcId));

        stand.setInvulnerable(true);
        
peak jetty
blazing ocean
#

your IDE should tell you what other fields are there

glass breach
#

Last case scenario, I do as you said and cancle entity explosion damage

junior cradle
echo basalt
#

I do remember making fake explosions to track damage

blazing ocean
#

would be my only explanation ¯_(ツ)_/¯

echo basalt
#

interesting

glad prawn
#

ill check for damager first

lost matrix
#

Somehow

echo basalt
tranquil badger
#

Any recommendations for looking through remapped jar? I was using jd-gui but I can't figure out the search function.

blazing ocean
#

do it in intellij

#

should be under the libraries and dependencies tab

peak jetty
#

will this work?

public PacketContainer createFakeTablistPacket(String name, String displayName, UUID uuid, int ping) {
        PacketContainer packet = new PacketContainer(PacketType.Play.Server.PLAYER_INFO);
        WrappedGameProfile profile = new WrappedGameProfile(uuid, name);
        EnumWrappers.NativeGameMode gameMode = EnumWrappers.NativeGameMode.SURVIVAL;
        WrappedChatComponent wrappedName = WrappedChatComponent.fromText(displayName);
        PlayerInfoData playerInfoData = new PlayerInfoData(profile, ping, gameMode, wrappedName, null);
        Set<EnumWrappers.PlayerInfoAction> actions = EnumSet.of(
                EnumWrappers.PlayerInfoAction.ADD_PLAYER,
                EnumWrappers.PlayerInfoAction.UPDATE_DISPLAY_NAME,
                EnumWrappers.PlayerInfoAction.UPDATE_LATENCY,
                EnumWrappers.PlayerInfoAction.UPDATE_GAME_MODE,
                EnumWrappers.PlayerInfoAction.UPDATE_LISTED
        );
        packet.getPlayerInfoActions().write(0, actions);
        packet.getPlayerInfoDataLists().write(1, List.of(playerInfoData));

        PacketContainer onlinePlayers = new PacketContainer(PacketType.Status.Server.SERVER_INFO);
        WrappedServerPing serverPing = onlinePlayers.getServerPings().read(0);
        serverPing.setPlayersOnline(getServer().getOnlinePlayers().size() + 1);
        return packet;
    }```
glad prawn
#

try it and see bro

glass breach
#

no embed perms

echo basalt
#

?tryandsee

undone axleBOT
glass breach
#

lifesaver

peak jetty
#

nope it didnt work

#

why does this not increase the player count by 1?

@EventHandler
    public void onServerListPing(ServerListPingEvent event) {
        int realPlayers = getServer().getOnlinePlayers().size();
        changeOnlinePlayersAmount(realPlayers);
    }


public PacketContainer changeOnlinePlayersAmount(int onlinePlayers) {
        PacketContainer packet = new PacketContainer(PacketType.Status.Server.SERVER_INFO);
        WrappedServerPing ping = packet.getServerPings().read(0);
        ping.setPlayersOnline(onlinePlayers + 1);
        return packet;
    }```
lost matrix
peak jetty
blazing ocean
#

what.

#

😭

rotund ravine
#

?di

undone axleBOT
rotund ravine
#

Pee is not a plugin

#

inject ur plugin instance

blazing ocean
#

/pee is crazy 😭

peak jetty
# lost matrix Maybe because you dont write the ping back into the packet?

i added this:

public PacketContainer changeOnlinePlayersAmount(int onlinePlayers) {
        PacketContainer packet = new PacketContainer(PacketType.Status.Server.SERVER_INFO);
        WrappedServerPing ping = packet.getServerPings().read(0);
        ping.setPlayersOnline(onlinePlayers + 1);
        packet.getServerPings().write(0, ping);
        return packet;
    }```
but it still doesnt work
echo basalt
#

o_o

peak jetty
# lost matrix How are you sending this?

like this:

@EventHandler
    public void onServerListPing(ServerListPingEvent event) {
        int realPlayers = getServer().getOnlinePlayers().size();
        changeOnlinePlayersAmount(realPlayers);
    }```
lost matrix
#

So you are creating a packet and then throwing it right in the trash without doing anything with it

sullen canyon
lost matrix
#

How do you expect anyone to receive a packet if you send it to literally nobody.
Its like writing a letter, throwing it in your bin, and then wondering why nobody got this letter.

echo basalt
#

PandaSpigot o_o

peak jetty
lost matrix
# sullen canyon 🤔

Looks like they use an outdated gson instance?
Or you are shading in an old version of gson which is then used instead.

lost matrix
alpine urchin
#

hi

rapid vigil
modern plank
#

the wiki shows every entity type along with its id, but these ids do not match up with the ones provided by the bukkit EntityTypes. where can i find the correct entity ids

sullen canyon
lost matrix
sullen canyon
lost matrix
#

relocate gson in your core

polar forge
#

Making now a grief alert plugin, but I actually don’t get alerts

lost matrix
polar forge
#

Can anyone check the code?

#

?paste

undone axleBOT
sullen canyon
#

:DD

polar forge
peak jetty
polar forge
#

Ops

#

Wrong ping

polar forge
lost matrix
polar forge
#

Opsie, nop

peak jetty
#

?

lost matrix
#

You dont. Just modify the outgoing packet.

peak jetty
#

is that using protocolManager?

blazing ocean
#

please read the docs 🙏

sullen canyon
#

What is even OpListEntry

#

thou I am only interacting with strings, ints and bukkit Locations

peak jetty
# lost matrix You dont. Just modify the outgoing packet.

like this?

@EventHandler
    public void onServerListPing(ServerListPingEvent event) {
        int realPlayers = getServer().getOnlinePlayers().size();
        changeOnlinePlayersAmount(realPlayers);
        // Censor
        protocolManager.addPacketListener(new PacketAdapter(
                this,
                ListenerPriority.NORMAL,
                PacketType.Status.Server.SERVER_INFO
        ) {
            @Override
            public void onPacketReceiving(PacketEvent event) {
                PacketContainer packet = event.getPacket();
                WrappedServerPing ping = packet.getServerPings().read(0);;
                ping.setPlayersOnline(realPlayers + 1);
                packet.getServerPings().write(0, ping);
            }
        });
    }```
blazing ocean
#

no

#

you can't use ServerListPingEvent

#

just put that packet listener in your onEnable

lost matrix
blazing ocean
#

unfortunately in ServerListPingEvent, you can't change the numPlayers, in PaperServerListPingEvent that's a thing

tranquil badger
#

The send method in PlayerConnection implements ServerCommonPacketListenerImpl. I was wondering whether I should be getting the ServerCommonPacketListenerImpl to use the send method or using PlayerConnection. Very new to this so I might be approaching this wrong.

Send:
connection.getClass().getMethod("send", getNMSClass("network.protocol.Packet")).invoke(connection, packet);

Error:
java.lang.NoSuchMethodException: net.minecraft.server.network.PlayerConnection.send(net.minecraft.network.protocol.Packet)

peak jetty
blazing ocean
#

that's a paper thing

#

unrelated to remapped spigot

lost matrix
peak jetty
blazing ocean
#

wdym both

#

paper is a spigot fork

#

so it's spigot but heavily modified

rotund ravine
#

?fork

undone axleBOT
#

SpigotMC maintains the Spigot server. If you are using a fork of Spigot (such as Paper, Airplane, Purpur, or other derivative works), you should seek support in the appropriate Discord servers.

tranquil badger
lost matrix
#

And you should probably use MethodHandles instead of the old reflect Method invocations

peak jetty
blazing ocean
#

yeah

#

still

#

?whereami

modern plank
#

how do i get the internal registry id of an entitytype?

#

bukkit used to have this defined but it has since been deprecated

lost matrix
#

Isnt EntityType Keyed?

modern plank
#

yeah

#

but im talking about the int id

echo basalt
#

what do you need it for

modern plank
#

used for protocol and stuff

echo basalt
#

well no

lost matrix
#

That was always an internal magic number

echo basalt
#

If you're using ProtocolLib or nms you pass the entity type

modern plank
#

yeah but shouldnt bukkit have some kind of registry

echo basalt
#

Only way you don't is if you have your own server impl

modern plank
#

to access this

echo basalt
#

In which case you should have every registry already anyways

modern plank
#

yeah in nms

#

but cant you access this just using bukkit?

echo basalt
#

There's no need to, that's the thing

#

If you're messing with packets you either have a couple native bukkit methods or you're crossing into nms territory

lost matrix
#

I also cant think of a use case for the API

sullen canyon
echo basalt
#

Yeah

#

If you want to for example, spawn a fake entity

#

THere's the virtual entity api now IIRC

#

But also the entity type field in the spawn packet is of.. an entity type

#

Not the type id

#

So even if you're using ProtocolLib you just pass the bukkit type, not the type id

#

Unless you're dealing with like.. 1.8?

lost matrix
modern plank
#

im not using protocollib. it may sound crazy but im directly writing all the stuff using a netty bytebuf

echo basalt
#

In which case you shouldn't look for help here, but rather on the mirror o_o

modern plank
#

through a little wrapper i made

echo basalt
modern plank
#

it uses the internal nms registries

#

i'd just figure that bukkit would have made a wrapper of it

echo basalt
lavish cosmos
#

Can someone make a panel here?

modern plank
lavish cosmos
#

Panel for Minecraft server

echo basalt
lost matrix
echo basalt
modern plank
#

ill have to find some nms way of doing it then

#

using reflection

lavish cosmos
#

A panel for a game, for example: a teacher's panel that expels or joins someone

echo basalt
#

uH

lost matrix
echo basalt
#

You can do that through GUIs or through a web interface

#

I've done that through GUIs before

lavish cosmos
#

Any person can do the plug-in configuration well, send a DM message

echo basalt
#

?services

undone axleBOT
lavish cosmos
tranquil badger
glad prawn
#

?tas

undone axleBOT
shut field
#

how does model engine work where the plugin has custom mob textures?

#

it has somewhat custom textures and entities but like they don't override in game ones?

lost matrix
# shut field it has somewhat custom textures and entities but like they don't override in gam...

They split the bbmodel into several item models, then emulate bones and joints, and translate it into the minecraft space.
The ingame items are then displayed using ItemModels (in never versions) or ArmorStands wearing ItemStacks (in older versions).

You can basically have millions of custom ingame items by using the customModel tag on ItemStacks which where introduced in minecraft a while ago.

shut field
#

i dont think i've seen that

#

cool thanks, I found a tutorial on it

sand spire
#

Is there a website with minecraft sounds with a button to play the sound and their unique seeds?

#

nvm x2 this doesn't show the seed...

#

last time I needed a sound I spent an hour trying to find the right seed

tranquil badger
twin venture
#

Hi , anyone know how i can send a text display?

tranquil badger
twin venture
#

no

#

a entity

tranquil badger
#

oh

twin venture
#

TextDsplay?

tranquil badger
#

you mean like a nametag or is that a entitytype I'm unaware of

twin venture
#

trying to work with hologram

#

but for 1.20.4

#

how i can send the packet?

lost matrix
#

?nms

twin venture
#

already do

lost matrix
#

Your screenshot tells me you dont

twin venture
#

yes , the code was orignaly for 1.8 , i updated but idon't know how 1.20 do it

lost matrix
#

With mojang mappings you can actually figure it out quite easily because you have actual names to work with

tranquil badger
twin venture
tranquil badger
twin venture
#

iam trying to not use armorstand , or entityArmorStand

#

iam trying to make it correctly for 1.20.4

lost matrix
#

TextDisplay is in fact an Entity

twin venture
#

i think iam useing the wrong one

twin venture
#

and also iam getting this weird bug with gradle

clear steeple
#

t

#

Hey, does anyone know a good way to start plugin development? I know some basic java and have worked with commands and rpacks, but I have no clue how to start or where to begin.

lost matrix
twin venture
tranquil badger
#

Speaking of TextDisplays

#

is their "rotation" dependent on direction?

#

I was using armorstands before but I never knew about these textdisplays till now

lost matrix
#

This explains how to create your first blank plugin

twin venture
clear steeple
#

thanks, i'll check it out!

tranquil badger
#

nevermind, got it working

lost matrix
tranquil badger
tranquil badger
#

I was using that

#

here

twin venture
tranquil badger
#

I'm assuming you used

#

?nms

tranquil badger
#

right

twin venture
#

yes

tranquil badger
#

the file it gives you is mojang mapped

#

the point in that plugin is to remap to spigot

twin venture
#

keep throwing errors

tranquil badger
#

You already have the base file though right

twin venture
#

yes

worthy yarrow
#

Text displays are fun I gotta add some more stuff to my damage holograms

tranquil badger
twin venture
#

but i do 😦

tranquil badger
#

and its in your mavenlocal?

twin venture
tranquil badger
#

you don't have mavenLocal()

twin venture
#

not maven gradle

tranquil badger
#

ik

twin venture
#

thats the 1.20 moudle

tranquil badger
#

Like I mean

#

where is your mojang-remapped file

twin venture
#

that

tranquil badger
#

but where is it...

sullen marlin
#

yes but what repo is it in

#

hint: it's a local one

tranquil badger
#

Did you use buildtools to get a mojang remapped jar?

#

then did you add it to your local repository (or somewhere)

twin venture
#

i don't get what do you mean

sullen marlin
#

you need mavenLocal() in your build file

tranquil badger
#

You need that file in mavenLocal()

#

and to consider mavenLocal() as a repo in your build file

#

then you can use this tool to remap to spigot, or keep as mojang, up to you

twin venture
#

i never used gradle before sorry for my stupid questions

sullen marlin
#

what are you doing anyway? 1.20.4 hologram?

twin venture
#

i was only maven fan :p and still

#

yes

sullen marlin
#

you know they added like display entities and stuff

twin venture
#

yes , i tried to use it , but didn't know how to use it .. too complicated

#

:-:

tranquil badger
#

very cool of them to add it though

twin venture
#

the link

tranquil badger
#

its the github linked to ?nms

#

idk if I can send links here

twin venture
#

privite?

tranquil badger
#

sure

remote swallow
static bison
#

my scoreboard registers a new scoreboard and objective on a player joining as I have unique changing values for each player on the scoreboard :

    public void onJoin(PlayerJoinEvent event) {
        Player player = event.getPlayer();


        PlayerMemory memory=new PlayerMemory();

        Scoreboard scoreboard =Bukkit.getScoreboardManager().getNewScoreboard();

        Objective scoreboardRight = scoreboard.registerNewObjective("joinSidebar", "dummy");
        scoreboardRight.setDisplaySlot(DisplaySlot.SIDEBAR);
        <more code>

I don't know how I can change the name above the player's head with rank prefixes. I know I can do this with teams but my code registers a new scoreboard for each individual player and I couldn't manage to do it protocollib. Can anyone help? I've tried googling with no success

worthy star
#

is the getPlayer() method in playerdeathevent for attacker or victim

gilded forge
#

victim

worthy star
#

and getEntity() for attacker, right?

gilded forge
#

you can get attacker by victim.getKiller()

worthy star
#

oh

#

ty

gilded forge
#

event.getEntity() is still the victim

#

because PlayerDeathEvent extends EntityDeathEvent

#

and getEntity is the method of EntityDeathEvent

worthy star
#

so both same thing, e.getPlayer() for playerdeath, e.getEntity() for entity death

gilded forge
#

yeah

worthy star
#

ight

#

thx

#

how can i set the spawn point of player? or do i have to teleport him

#

nvm

gilded forge
#

You can change it by RespawnEvent

worthy star
#

i found setRespawnLocation()

gilded forge
#

that is

worthy star
#

that is what

gilded forge
#

setRespawnLocation() is what you want

worthy star
#

oh ok

gilded forge
#

++

analog mantle
#

Does anyone know where I can find help for modding using MCP?

sullen canyon
#

the only one I know

analog mantle
#

Can you please send the invite

sullen canyon
#

I am no longer there otherwise I would've sent you the invite

twin venture
#

Hi , anyone use hikariConfig.setDataSourceClassName for 1.20?

#

what is this should be?

sullen marlin
#

hikari has very little to do with spigot

#

so not sure why 1.20 matters?

twin venture
#

that's on 1.20.4 , and using 5.1.0 hikari

remote swallow
#

i cant say ive ever had to set the driver source

twin venture
#

i need i tried..

inner mulch
#

can i disable the ability to hear the hit sound on entities?

#

or disable hitting them at all?

gilded forge
#

apply a weakness effect with 256 levels for the attacker

inner mulch
#

no

gilded forge
#

i remember a plugin which change combat system to 1.8

#

That plugin includes a feature disabling hit sound

inner mulch
#

hmm

gilded forge
#

But i forgot its name

inner mulch
#

i need to know how this can be done

#

i know it can be done somehow

gilded forge
#

Also you can try canceling PlayerInteractEvent

#

I dont know whether it works

glass breach
# peak jetty so with that would it be like this? ```java @EventHandler public void onPape...

Fellas, still clueless...

@EventHandler
    public void onProjectileHitEvent(ProjectileHitEvent event) {
        if (event.getEntityType() == EntityType.WITHER_SKULL) {
            event.setCancelled(true);
            if (event.getHitEntity() != null) {
                if (event.getHitEntity().getType() == EntityType.PLAYER) return;
            }
            event.getEntity().remove();
        }
    }

    @EventHandler
    public void onEntityExplodeEvent(EntityExplodeEvent event) {
        if (event.getEntityType() == EntityType.WITHER_SKULL) {
            event.setCancelled(true);
            event.getEntity().remove();
        }
    }

It still damages the player?! It happens when the skull collides with a block, but no actual block damage is produced and the explosion is never created, yet it still harms all entities in a radius. (Wither Skull)

Could anyone help me? Thanks!

young knoll
#

Try the damage event

glass breach
#

Yes, the damage event returns an ENTITY_EXPLOSION I believe and there is knockback and damage, but no particles or block damage

#

also I don't want to cancel out ENTITY_EXPLOSION and even if I did, I also don't want the knockback. At this point, the only really viable solution is to go back in time and remove the skull

worthy yarrow
young knoll
#

Check if the damager in the event is a wither skull

glass breach
#

in the damage event?

young knoll
#

EntityDamageByEntityEvent

inner mulch
#

bu t the sound is still there

#

ok

glass breach
tranquil badger
#

Any general info on datawatchers? Trying to send a metadata packet to modify an entity packet i sent earlier. Mainly confused as to how it links to wiki.vg/Protocol as any forum example I've found doesn't link up.

echo basalt
#

Day Integer.MAX_VALUE of writing cursed code

tranquil badger
echo basalt
#

Then it's pretty simple

#

You don't need data watchers

#

Although it'd be nice to have entity data

#

In short, every nms Entity has a "DataWatcher" (whose name is actually SynchedEntityData)

#

It contains a few fields, which have explicit types and default values

#

And each entity class (and its parents) define fields

#

For example the field 0 is of type byte and it's just a bitmask for visibility, glowing etc

#

Before 1.19 you had to create a whole data watcher (For packet entities this was done by just creating a new entity, assigning values and getting the data watcher) as the packet needed it

#

After 1.19 it's just a List of data values

#

If you're using ProtocolLib, it's a List<WrappedDataValue>

#

These data values are basically just a class that contains

  • Their ID (int)
  • Their Serializer (basically data type)
  • Their value
#

For ProtocolLib, creating such list is quite trivial:

List<WrappedDataValue> list = List.of(
  new WrappedDataValue<>(0, Serializer.Registry.get(Byte.class), (byte) 0x40)
)
#

With NMS you just get the entity's SynchedEntityData and call either packDirty (Returns a list of every value that has changed since the last packDirty call) or getNonDefaultValues (self explanatory)

#

That's about it

tranquil badger
#

I'm not using protocolLib, it asks to pass a datawatcher, how would I use that wrappeddatavalue instead

echo basalt
#

Show screenshot

#

Of you trying to initialize the whole thing

tranquil badger
#

Let me get to PC

tranquil badger
# echo basalt Of you trying to initialize the whole thing

This is where I left my code (Sorry if its a bit cramped):

MethodHandles.Lookup lookup = MethodHandles.lookup();
Object worldHandle = lookup.findVirtual(ReflectionUtils.getCraftClass("CraftWorld"), "getHandle", MethodType.methodType(getNMSClass("server.level", "WorldServer"))).invoke(loc.getWorld());
Object textEntity = lookup.findConstructor(getNMSClass("world.entity","Display$TextDisplay"), MethodType.methodType(void.class, getNMSClass("world.entity", "EntityTypes"), getNMSClass("world.level", "World"))).invoke(EntityTypes.aY, worldHandle);
Object convertedEntity = lookup.findVirtual(getNMSClass("world.entity","Display"), "getBukkitEntity", MethodType.methodType(getCraftClass("entity.CraftEntity"))).invoke(textEntity);
Object entityHandle = lookup.findVirtual(ReflectionUtils.getCraftClass("entity.CraftEntity"), "getHandle", MethodType.methodType(getNMSClass("world.entity", "Entity"))).invoke(convertedEntity);
Object dataWatcher = lookup.findVirtual(getNMSClass("world.entity", "Entity"), "an", MethodType.methodType(getNMSClass("network.syncher", "DataWatcher"))).invoke(entityHandle);
#

And I had planned on using this:

echo basalt
#

yeah this looks like ass

#

Yep you get that list from the datawatcher

tranquil badger
#

Ah

#

I see now

tranquil badger
#

yeah found it

echo basalt
#

Those serializers are usually uh

#

private and stuff

tranquil badger
#

If I do the method where I get the datawatcher afterwards and pass that, would I just modify my textEntity?

tranquil badger
#

I know its 64 but wasn't sure what that linked to

echo basalt
echo basalt
#

The idea is you call setVisible / setWhatever and then you send the packet with the dirty values

#

And for new players you send non defualt

#

?mappings

undone axleBOT
tranquil badger
echo basalt
#

Yea

tranquil badger
#

I didn't reflect it b/c easier but I'm assuming I would need to

echo basalt
#

You do that on the nms entity and then send a new packet

tranquil badger
#

yeah

#

wait so do I get the watcher after I set these values, then send metadata packet?

echo basalt
#

Yeah

tranquil badger
#

Alright, let me try that out, I'll definitely learn the List method though too

echo basalt
cinder mirage
#

How do I open the ports on my PC for my Minecraft server????

rough ibex
#

port forwarding

#

25565 by default

junior anvil
#

how do i teleport a player to a custom dimention?

inner mulch
#

a world?

junior anvil
#

yes

#

a world that isnt the overworld, the nether or the end

inner mulch
#
Location location = new Location(world, 256, 70, 256);
player.teleport(location);```

maybe like this not sure if it works?
young knoll
#

Yeah

junior anvil
#

if i had to refer to overworld what should i do instead

inner mulch
#

i dont understand

echo basalt
#

"world" is the default name for the overworld world

#

It can be overriden and shouldn't be relied upon

junior anvil
#

i get it, it checks the name of the folder

tranquil badger
echo basalt
#

Remappings

young knoll
#

Yay mapping

#

You need to use the obfuscated names for string lookups

#

Or rely on a way that doesn’t use names

tranquil badger
#
Object dataWatcher = lookup.findVirtual(getNMSClass("world.entity", "Entity"), "an", MethodType.methodType(getNMSClass("network.syncher", "DataWatcher"))).invoke(entityHandle);
Object listValues = lookup.findVirtual(getNMSClass("network.syncher", "DataWatcher"), "b", MethodType.methodType(List.class)).invoke(dataWatcher);

Error:
java.lang.NoSuchMethodException: no such method: net.minecraft.network.syncher.DataWatcher.b()List/invokeVirtual

And now I'm wondering if I f-ed up the type...

#

I am not certain what the return type is tbh

#

Oh, figured it out nvm

inner mulch
#

How do hologram plugins stack each armorstand? What entity do they use

echo basalt
#

They just use multiple entities

quaint mantle
#

How to change boat speed?

#

I want to change but it was deprecated

inner mulch
worldly ingot
#

You can use setMaxSpeed(), it just might not work on some versions is all

#

Oh, actually, no, that doesn't even work anymore lol

worthy yarrow
#

Is there like a limit to the complexity of which you can make a text display? In other words, what are all the creative features that can be messed with?

#

Also might anyone have an example of a pdc manager?

eager yacht
#

hey guys

#

is there any event call after player enchanted item in enchantment table?

echo basalt
#

EnchantItemEvent

eager yacht
# echo basalt EnchantItemEvent

how can i get what an enchant that added to player item? i only can see EnchantmentHint one but it a hint not which player added

echo basalt
#

getEnchantsToAdd

#

It's mutable so you can just remove elements if you want

eager yacht
astral pilot
#

How do i set max stack size to my custom item

vast ledge
#

You dont

#

You can look at events tho, and look if the player is stacking something higher than you want, and then split the stack moved, to basically achieve what you want

#

If you want to make an item non stackable, just add a pdc or snth

slender elbow
#

just wait until 1.20.5 😴

small valve
#

For BungeeCord, is there a way to send colored messages to the console using the logger?

quaint mantle
#

Hello what file is for configure droptiles (Paper, spigot, bukkit )

quaint mantle
#

And you can take it

valid burrow
mellow edge
#

are there any community guidelines or some common policy you must follow when uploading a plugin to spigotmc forums?

native nexus
#

Has anyone used the servicemanager before?

chrome beacon
#

?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!

cinder abyss
#

Hello, Is there an event for when an interaction will make the held item lose durability?

chrome beacon
#

how can I there an event
???

chrome beacon
#

yeah ^^

cinder abyss
rapid vigil
cinder abyss
#

I want to be asked every tick

cinder abyss
rapid vigil
cinder abyss
rapid vigil
#

you want to cancel the PlayerItemDamageEvent?

cinder abyss
#

I want to cancel item damages and the action done with the item

#

(eg: Cancel sword durability lose and mob attack)

rapid vigil
#

Cancel BlockBreakEvent and EntityDamageByEntityEvent

cinder abyss
#

okay thanks

#

and for creating path with a shovel?

#

Is that BlockBreakEvent?

rapid vigil
#

you might right clicking with a shovel on grass?

cinder abyss
#

yeha

rapid vigil
#

do you think creating a path with a shovel is breaking a block?

cinder abyss
#

no

rapid vigil
#

do you think its interacting with the block

cinder abyss
#

yeah x)

rapid vigil
#

then you got your answer

cinder abyss
#

so I should do specific cases? Because I have done with interact event before and it was just doing a lot of spam and I want to cancel on the cases when it loses durability

rapid vigil
#

cancel PlayerInteractEvent if they're interacting on a grass block with a shovel ig?

valid burrow
#

whats the best method to add a second name tag (line)

rapid vigil
#

Probably creating a scoreboard with BELOW_NAME as the display slot

#

im not sure if it will always be a number but in case it is not you could do that, otherwise you need to spawn an entity at eye location and do some code to make it invisible, have the player's data, always there etc

hybrid turret
#

Anyone a take on this? ^^^

hazy parrot
#

why do you have server inside of project folder

valid burrow
#

yeah xd

hazy parrot
#

but yeah, dont distribute jar on gh

valid burrow
#

in general just take your server outside our project folder wtf

hybrid turret
# hazy parrot why do you have server inside of project folder

I work on multiple devices and don‘t want to redownload the server every time. I basically have the eula, the server jar and some start scripts on my repo. The rest is generated on each device seperately. (Also to easily build my jar on different OSs/devices since i then can just use ${project.folder} or sum in my pom.xml.

I just want to know if it‘s only the spigot.jar that‘s not to be destributed. Bc then i‘ll have to .gitignore it once i release the plugin.

chrome beacon
#

Check the license of every jar you keep in that repo

blazing ocean
#

imagine gradle changed their license on the wrapper as an april fools joke

chrome beacon
quaint mantle
#

then how to use it

valid burrow
#

probably atributes its just an entity at the end of the day

nova quail
#

Can I cancel event only when player start walking. I used playermoveevent and It cancels every time when player just move his mouse but I need to cancel only on walk.

package milkyland.milkyanimations.events;

import milkyland.milkyanimations.commands.Pee;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerMoveEvent;

public class PeeOnPlayerMove implements Listener {

    @EventHandler
    public void onPlayerMove(PlayerMoveEvent e) {
        Pee.cancelPee(e.getPlayer());
    }
}
lost matrix
young knoll
worldly ingot
#

Yeah I don't think you're going to be able to change the max speed of a boat

ruby ermine
#

Yo can someone help me to install geyser and make it work? When I try it it doesn't work and i use Playit.gg

young knoll
#

Re-implement the boat via NMS

#

Kek

#

Unless the speed is client side

worldly ingot
#

Would be strange

lost matrix
young knoll
#

No

#

I can’t tell if sarcasm

lost matrix
#

There was a popular exploit used by hacked clients which let people fly around in boats

young knoll
#

Lol

#

At least minecraft patched Ye old god mode

valid burrow
#

can someone explain to me the differene between placeholderhooks and palceholderexpansions

lost matrix
warm mica
#

I believe expension refers to the ones that you can download from the papi ecloud

#

And hook is whatever placeholder a plugin has added

valid burrow
#

ig it got removed or will be removed

#

not sure

lost matrix
#

PlaceholderExpansion is the class you implement and register. What is the purpose of a placeholderhook?

valid burrow
#

theres also .registerPlaceholderHook but its depricated

lost matrix
#

If its deprecated then ignore it

young knoll
#

Well if it’s deprecated

#

Then it probably doesn’t matter

valid burrow
young knoll
#

Use the wiki

#

seems to be <your expansion>.register()

slender elbow
young knoll
#

Because it has tutorials on how to make and register expansions?

chrome ferry
#

why is intellij 2024.1 so ugly

slender elbow
#

wikis and guides 🤮

#

doing the wrong thing 🥰

worldly ingot
#

Part of me really does hate new PlaceholderExpansionImplementation().register() though

#

I absolutely hate having new at the start of a line. It's so gross

ruby ermine
#

Yo can someone help me to install geyser and make it work? When I try it it doesn't work and i use Playit.gg

sharp heart
#

hi guys, is there a way to get the PersistentDataType of any NamespacedKey, so I don't have an error while casting ?

worldly ingot
#

No because the type can be interpreted as anything you'd like

sharp heart
#

hm

young knoll
worldly ingot
#

booleans are just a 1 or a 0 as a byte

sharp heart
#

I just need to iterate all values of keys in an itemstack

#

maybe there is another way ?

worldly ingot
#

You should know what you're putting into it and what you expect to get out of it

#

Otherwise you'd use a list type in the NBT, but even that has to be a list of some type

lost matrix
young knoll
#

It’s all Object

sharp heart
#

In ItemsAdder there is /ia tag that just send u all tags in the item, I need to reproduce it

tender shard
sharp heart
#

yes but I need to get values too

worldly ingot
young knoll
#

Perfect

valid burrow
tender shard
slender elbow
# worldly ingot

not me 7 years ago thinking primitives were deprecated because "it's an OO language"

sharp heart
tender shard
#

CompoundTag

sharp heart
#

I don't have CompoundTag

young knoll
#

It’s not summer yet!

worldly ingot
#

7 year old you is going to cry when primitive classes are introduced

young knoll
#

Excuse me

tender shard
worldly ingot
#

Sorry, *value classes

young knoll
#

(You need NMS)

tender shard
sharp heart
#

probably

tender shard
#

why do you even need all nbt tags? what's the purpose?

sharp heart
#

I need to create an admin command to just check up tags and values of an itemstack

tender shard
#

then just use getAsString() on the itemmeta

#

or toString the itemstack

#

?

worldly ingot
#

Was just going to suggest the same

sharp heart
#

ohh maybe

worldly ingot
#

ItemMeta#getAsString()

sharp heart
#

yes I think u right

worldly ingot
#

It will get you everything though, not just the PDC

slender elbow
#

a million dollars?

worldly ingot
#

I wish

#

Forgot to add that feature when implementing it

slender elbow
#

god damn

tender shard
slender elbow
#

should I open an issue

sharp heart
#

ty !

young knoll
#

Just uhh

young knoll
#

Alias /data get entity @s SelectedItem

slender elbow
#

I'll be in my deathbed when that happens

worldly ingot
#

GTA VI releasing before value classes 💀

young knoll
#

And skyrim 2

remote swallow
young knoll
#

Best command

remote swallow
#

how do i check the 15th slot on me

young knoll
#

Idk

remote swallow
#

why not

young knoll
#

Mf do I look like I do datapacks

#

Smh

remote swallow
#

yes

#

long hair, programmer socks, cat ears

#

boom ur a datapack dev

young knoll
#

No I’m a plugin dev

remote swallow
#

no ur a nerd

young knoll
#

So are u

remote swallow
#

ur hair is longer

#

so ur a bigger nerd

glad prawn
#

ur coedr bro

peak jetty
#

why does this not work even if both the loggers get logged?

@EventHandler
    public void onPaperServerListPing(PaperServerListPingEvent event) {
        getLogger().info("event called");
        int realPlayers = getServer().getOnlinePlayers().size();
        event.setNumPlayers(5);
        getLogger().info("player count changed");
    }```
lost matrix
peak jetty
#

and if it sets the online players to 5 then it works

lost matrix
peak jetty
#

yeah because it didnt set the online players to 5 it just kept them as 1 (when i had 1 account logged on)

lost matrix
valid burrow
lost matrix
#

Check this. Im about to head to the gym...

peak jetty
#

works, thanks

agile hollow
#

how can i get the name gave on the anvil gui when the player click on the item?

young knoll
#

AnvilInventory has a getRenameText iirc

grim hound
#

how can I get the window id of a player?

worldly ingot
#

wat

#

Like the internal network id of the inventory/screen they have open? Because that's not exposed

grim hound
#

I need to open an inventory for a player

grim hound
#

I'd get it with reflection

#

but it changes names and the last one is an int

#

so I'm looking for a reliable way

grim hound
#

but that fires an event

#

which needs to be done sync

grim hound
#

can't wait

river oracle
#

Hasn't changed in forever

#

Why do you even need this though? If you want to open a nee container use ServerPlayer#nextContaineCounter()

remote swallow
#

new patch just dropped the serverplayer now has current git has on the mapping

river oracle
#

?

remote swallow
#

SeverPlayerGITHASH#containerId

#

changes every 2 days

river oracle
#

Ahh nice

#

👍

grim hound
remote swallow
#

?switchmappings

river oracle
#

Get with the times

grim hound
#

Does it really range 0-99?

worldly ingot
#

That's what that code seems to imply, yes. It's an internal network id to maintain state so it really doesn't need to go any higher

grim hound
#

well but

#

hmm

#

I guess it's stored as an int but sent as a byte

#

appreciate the help

river oracle
#

In which case the server and client may experience a bit of desync

grim hound
#

since 0 is the player inventory

pliant topaz
peak jetty
#

how do i make it so that the player which gets added using this:

public static PacketContainer createTablistPacket(String name, String displayName, UUID uuid, int ping) {
        PacketContainer packet = new PacketContainer(PacketType.Play.Server.PLAYER_INFO);
        WrappedGameProfile profile = new WrappedGameProfile(uuid, name);
        EnumWrappers.NativeGameMode gameMode = EnumWrappers.NativeGameMode.SURVIVAL;
        WrappedChatComponent wrappedName = WrappedChatComponent.fromText(displayName);
        PlayerInfoData playerInfoData = new PlayerInfoData(profile, ping, gameMode, wrappedName, null);
        Set<EnumWrappers.PlayerInfoAction> actions = EnumSet.of(
                EnumWrappers.PlayerInfoAction.ADD_PLAYER,
                EnumWrappers.PlayerInfoAction.UPDATE_DISPLAY_NAME,
                EnumWrappers.PlayerInfoAction.UPDATE_LATENCY,
                EnumWrappers.PlayerInfoAction.UPDATE_GAME_MODE,
                EnumWrappers.PlayerInfoAction.UPDATE_LISTED
        );
        packet.getPlayerInfoActions().write(0, actions);
        packet.getPlayerInfoDataLists().write(1, List.of(playerInfoData));
        return packet;
    }```
appears at the bottom of the tablist?
young knoll
pliant topaz
#

Saw that, but it didn't seem to exist somehow, wait

#

It just says it doesn't know it

young knoll
#

What api version are you using

pliant topaz
#

newest for 1.21

eternal night
#

time travelling paperOhhh

agile hollow
#

there is an api for the anvils? like for the head name getting the string etc? for the 1.20

peak jetty
lost matrix
rapid vigil
peak jetty
peak jetty
agile hollow
lost matrix
rapid vigil
eternal oxide
#

depends how "fake" your player is

#

if it's packet only, then you have to send a teams meta packet

rapid vigil
lost matrix
#

He tells you that he is your friend and then scams your for all your ingame money. So pretty fake.

eternal oxide
#

if you created the player (Bukkit entity) then you can simply add them by name to the team

peak jetty
eternal oxide
lost matrix
#

Cant you just add the player String to the scoreboard? Might as well work for fake players,#

rapid vigil
eternal oxide
lost matrix
#

I think you can add a player to a scoreboard before he joins, and he will be on it still after joining for the first time.

eternal oxide
#

If thats true, then its nice and easy

peak jetty
# lost matrix Cant you just add the player String to the scoreboard? Might as well work for fa...

like this?

public static PacketContainer createTablistPacket(String name, String displayName, UUID uuid, int ping) {
        PacketContainer packet = new PacketContainer(PacketType.Play.Server.PLAYER_INFO);
        WrappedGameProfile profile = new WrappedGameProfile(uuid, name);
        EnumWrappers.NativeGameMode gameMode = EnumWrappers.NativeGameMode.SURVIVAL;
        WrappedChatComponent wrappedName = WrappedChatComponent.fromText(displayName);
        PlayerInfoData playerInfoData = new PlayerInfoData(profile, ping, gameMode, wrappedName, null);

        ScoreboardManager scoreboardManager = Bukkit.getScoreboardManager();
        Scoreboard scoreboard = scoreboardManager.getNewScoreboard();
        Team team = scoreboard.registerNewTeam("0");
        team.addPlayer(Bukkit.getPlayer(uuid));

        Set<EnumWrappers.PlayerInfoAction> actions = EnumSet.of(
                EnumWrappers.PlayerInfoAction.ADD_PLAYER,
                EnumWrappers.PlayerInfoAction.UPDATE_DISPLAY_NAME,
                EnumWrappers.PlayerInfoAction.UPDATE_LATENCY,
                EnumWrappers.PlayerInfoAction.UPDATE_GAME_MODE,
                EnumWrappers.PlayerInfoAction.UPDATE_LISTED
        );
        packet.getPlayerInfoActions().write(0, actions);
        packet.getPlayerInfoDataLists().write(1, List.of(playerInfoData));
        return packet;
    }```
eternal oxide
#

um, you have a Player UUID?

#

you only sent packets so the player does not exist

#

Bukkit.getPlayer will have no knowledge of the player and will return null

#

you add players to teams by name not a Player object

peak jetty
#

so just this? team.addPlayer(Bukkit.getPlayer(name));

rapid vigil
#

i think its team.addPlayer(name);

peak jetty
#

it says that when i try it

rapid vigil
#

oh so it doesnt take a player name

eternal oxide
#

Not using spigot then

#

it takes a Players name

rapid vigil
#

ive seen it before taking a name

#

maybe now it doesnt and that was in older versions?

eternal oxide
#

It used to require a Player Object but that was deprecated as teams can have more than Player objects now

#

so now they are added by player name or object UUID

peak jetty
#

so this should work then?

public static PacketContainer createTablistPacket(String name, String displayName, UUID uuid, int ping) {
        PacketContainer packet = new PacketContainer(PacketType.Play.Server.PLAYER_INFO);
        WrappedGameProfile profile = new WrappedGameProfile(uuid, name);
        EnumWrappers.NativeGameMode gameMode = EnumWrappers.NativeGameMode.SURVIVAL;
        WrappedChatComponent wrappedName = WrappedChatComponent.fromText(displayName);
        PlayerInfoData playerInfoData = new PlayerInfoData(profile, ping, gameMode, wrappedName, null);

        ScoreboardManager scoreboardManager = Bukkit.getScoreboardManager();
        Scoreboard scoreboard = scoreboardManager.getNewScoreboard();
        Team team = scoreboard.registerNewTeam("0");
        team.addPlayer(Bukkit.getPlayer(name));

        Set<EnumWrappers.PlayerInfoAction> actions = EnumSet.of(
                EnumWrappers.PlayerInfoAction.ADD_PLAYER,
                EnumWrappers.PlayerInfoAction.UPDATE_DISPLAY_NAME,
                EnumWrappers.PlayerInfoAction.UPDATE_LATENCY,
                EnumWrappers.PlayerInfoAction.UPDATE_GAME_MODE,
                EnumWrappers.PlayerInfoAction.UPDATE_LISTED
        );
        packet.getPlayerInfoActions().write(0, actions);
        packet.getPlayerInfoDataLists().write(1, List.of(playerInfoData));
        return packet;
    }```
rapid vigil
#

i thought that name was deprecated and UUID is not

undone axleBOT
eternal oxide
#

NO! team.addPlayer(Bukkit.getPlayer(name)); Wrong

peak jetty
rapid vigil
eternal oxide
#

addEntry not addPlayer

rapid vigil
#

wait addEntry takes a player name?

eternal oxide
#

yes

rapid vigil
#

then thats solved ig

eternal oxide
#

player name or stringified UUID of an Entity

peak jetty
rapid vigil
#

lol i like the "stringified"

peak jetty
#

i ran it but the players stayed at the top of tab, and when i did /team list ingame it said there are no teams

eternal oxide
#

vanilla /teams is probably not going to show any teams as there are no players in that team online

peak jetty
#

ah ok, but the fake players still show up above

#

even tho the team is called "0" so it should be at the bottom (at least thats what i saw online)

eternal oxide
#

I'm still of the opinion you are going to have to manually send a teams update packet

eternal oxide
#

test, put an actual player in the group as well, to see if the group is then shown

gleaming grove
#

Is there something like MaterialCategories so I can know if an Material is for example Wood?

remote swallow
#

Tag

gleaming grove
#

ok thx

lament tree
#

Haven’t touched spigot api since 1.8.9, wtf is up with item metas

ivory sleet
#

ik they’re goofy

sharp kayak
#

Trying to import a dependency in maven using jitpack, but its returning "Could not find artifact"

remote swallow
#

what dependency are you trying to add

sharp kayak
#

An actionbar API

remote swallow
#

jitpack cant build that

#

so it wont be on jitpack

sharp kayak
#

its showing up in the jitpack website tho

remote swallow
#

everything shows up on the jitpack website

sharp kayak
#

oh

peak jetty
sharp kayak
remote swallow
#

you need to maven install the release jar then add the info corresponding to what you installed it with

#

ill grab a doc 1 sec

sharp kayak
#

Tysm

gleaming grove
#

Has already been made an API for BlockDisplays, ItemDisplays? So I can easier manage rotataion and stuff?

sharp kayak
#

@remote swallow Do you know any other API's which provide actionbar support? This one dosnt seem to work

remote swallow
#

id just use spigots built in

sharp kayak
#

How would i use it to display a constant actionbar (like in hypixel skyblock)?

remote swallow
#

use a scheduler or something to send a new action bar every tick or a few ticks

sharp kayak
#

hmm ok

young knoll
#

Change the text you send

#

Sending new text will override the old

lost matrix
# sharp kayak How would i update it tho?

I would create a Buffer. So a String for each player. Then send this buffer every 2 seconds, and when it updates.
So your task just sends whatever is in the buffer, and when the content changes, then you immediately send this update.
There are a few more optimizations you could do, but this should be enough.

sharp kayak
#

Can you provide an example pls? Sry im new to this

coarse trout
#

Hello

#

Do you guys know how to get locations of corners from blockdisplay

lost matrix
eternal oxide
#

it should still have a bounding box

coarse trout
#

WHAATTT

#

omg

#

wait

lost matrix
# sharp kayak Can you provide an example pls? Sry im new to this

Start by writing a manager class which keeps track of your buffers. Let it contain a Map<UUID, String> to keep it simple.
It should map players UUID to their buffered String.
Make sure to make the Map private and final, and dont have a getter or setter for it.
Just methods like
public void addPlayer(UUID playerId)
public void removePlayer(UUID playerId)
public void updatePlayer(UUID playerId, String content)
public void sendBuffer(UUID playerId)

lost matrix
eternal oxide
#

I thought it would be all encompasing, even though it has no collision

coarse trout
#

doesnt work

young knoll
#

Nah the bounding box is size 0

#

For all 3 display entities

#

You’d have to create a base vector for each corner and then apply the transformations to them

coarse trout
#

now i got public List<Location> getBlockCorners(Location location) {
List<Location> corners = new ArrayList<>();
// First
corners.add(location);
// Second
corners.add(location.clone().add(location.getDirection().clone().multiply(1)));
return corners;
}

lost matrix
coarse trout
#

i dont know what are talking about but

BlockDisplay blockDisplay = location.getWorld().spawn(location, BlockDisplay.class);
blockDisplay.setBlock(Material.WHITE_WOOL.createBlockData());

lost matrix
#

Alright so no transformations at all. In that case just get the Location, add (1, 1, 1) to it and span a BoundingBox on those two vectors.
This will give your the corners of your display.

coarse trout
#

i mean block display can be rotated

#

bounding box will expand hitbox?

lost matrix
#

You can literally create a 100x100 stone block if you wanted to

nova quail
#

How can I send message to player when he step into dropped block that were dropped from player by plugin? I have created a pee plugin and I need to send message to player when he step into dropped block like. You have step into player's pee.

#

I need to create event and in this event check if block has metadata and this material?

lost matrix
flint coyote
#

cursed questions

nova quail
#

That is very important

gleaming grove
#

Why does those logs are scaled smoothly but when it comes to updating their location it is rough?

    FluentApi.tasks().taskLater(() ->
            {
                //Scaling
                Transformation transform = display.getTransformation();
                transform.getScale().set(0.3f, 0.3f, 0.3f);
                display.setTransformation(transform);
            }, 20);

            FluentApi.tasks().taskTimer(60, (a,b) ->
            {
                //moving
                Transformation transform = display.getTransformation();
                transform.getTranslation().add(0.2f, 0, 0);
                display.setTransformation(transform);

            }).start();

   private BlockDisplay createBlockDisplay(Location spawnLoc, Material material) {
        BlockDisplay blockDisplay = (BlockDisplay) spawnLoc.getWorld().spawnEntity(spawnLoc, EntityType.BLOCK_DISPLAY);
        blockDisplay.setBlock(Material.OAK_LOG.createBlockData());
        Vector3f translation = new Vector3f(0, 0, 0);
        AxisAngle4f axisAngleRotMat = new AxisAngle4f((float) Math.PI, new Vector3f(0, 1, 0));
        Transformation transformation = new Transformation(
                translation,
                axisAngleRotMat,
                new Vector3f(1f, 1f, 1f),
                axisAngleRotMat
        );
        blockDisplay.setInterpolationDuration(25);
        blockDisplay.setTransformation(transformation);
        blockDisplay.setGlowing(true);

        FluentApi.events().onEvent(PluginDisableEvent.class, pluginDisableEvent ->
        {
            blockDisplay.remove();
        });
        return blockDisplay;
    }
lost matrix
coarse trout
#

bro im not mega ultra senior Fluent Task Manager Transformer

nova quail
gleaming grove
lost matrix
gleaming grove
#

doesn't work :/

coarse trout
#

why theres PI

#

as float

gleaming grove
#

IDK, this part is example code from Spigot Forum

lost matrix
#

Im heading out for a walk now. Try using a teleportation interpolation and teleport the display.

young knoll
#

You should be setting the entire transformation at once

#

Otherwise you’ll override any previous interpolation in progress

gleaming grove
#

to prevent that I've set setInterpolationDuration every 25 ticks and taskTimer every 60 ticks, so it should not override, right?

shut field
#

how do you send a message like this with the hover?

shut field
#

yeah I read through that one already

river oracle
#

well it has everything you need

#

CommandSender#spigot#sendMessage?

#

is that what you're looking for

young knoll
#

You attach a hover component to it

#

With the item

shut field
#

i see

#

thanks

lucid otter
#

Hey

#
[06.04 19:23:53] [Server] java.lang.RuntimeExceptionUnable to access address of buffer
[06.04 19:23:53] [Server]     at io.netty.channel.epoll.Native.read(Native Method) ~[custom352827.jar:git-Spigot-21fe707-e1ebe52]
[06.04 19:23:53] [Server]     at io.netty.channel.epoll.EpollSocketChannel$EpollSocketUnsafe.doReadBytes(EpollSocketChannel.java:678) [custom352827.jar:git-Spigot-21fe707-e1ebe52]
[06.04 19:23:53] [Server]     at io.netty.channel.epoll.EpollSocketChannel$EpollSocketUnsafe.epollInReady(EpollSocketChannel.java:714) [custom352827.jar:git-Spigot-21fe707-e1ebe52]
[06.04 19:23:53] [Server]     at io.netty.channel.epoll.EpollSocketChannel$EpollSocketUnsafe$3.run(EpollSocketChannel.java:755) [custom352827.jar:git-Spigot-21fe707-e1ebe52]
[06.04 19:23:53] [Server]     at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:380) [custom352827.jar:git-Spigot-21fe707-e1ebe52]
[06.04 19:23:53] [Server]     at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:268) [custom352827.jar:git-Spigot-21fe707-e1ebe52]
[06.04 19:23:53] [Server]     at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116) [custom352827.jar:git-Spigot-21fe707-e1ebe52]```
#

I'm getting this continuely

#

it's starting normally

#

And then instanly got a loop

lost matrix
#

What kind of cursed fork are you running?

#

How about you ask the maintainer of this sever jar for help...
Looks like they broke spigot.

lucid otter
#

It’s a funny story or not

#

They maked me somehow a server jar that run my slimeworldmanager and my spigot

#

Because they don’t have a functionality for custom startup parameters

remote swallow
#

id love to know what you are even running

#

i cant find any of those git hashes in the past few years

#

oh i think ive found it

#

all the way back in 2016

#

so its 1.8.8 that i have a feeling is old old so you should update

lucid otter
#

1.8.9

#

actually

remote swallow
#

1.8.9 does not exist as a server version

#

1.8.9 is a client only version with protocl compat to 1.8.8 servers

lucid otter
#

Should i try with 1.8.8?

remote swallow
#

you are on 1.8.8

lucid otter
#

But what's the difference

remote swallow
#

1.8.9 does not exist in spigot

lucid otter
#

Never heard of 1.8.9

#

I taked from somebody the jar

#

he sayed it's 1.8.9

remote swallow
#

the best advice we can give is update to latest

rapid vigil
#

?1.8 xd

undone axleBOT
lucid otter
#

I know, that i can upgrade.

#

On the other servers i have 1.20.4

remote swallow
#

update to 1.20.4

#

1.8 is outdated and unsupported

lucid otter
#

I know, it's an old config

#

That's why

#

Because i'm sure it will not run the latest version

#

Because of my plugins are not compatible

#

with the latest

remote swallow
#

time to find new plugins then

rough ibex
#

1.8 is dead

#

no more

umbral ridge
#

I still have to add support for 1.8 to some of my plugins because of clients xD

rough ibex
#

I would tell you to drop em but I know

glad prawn
#

Some people rate other people's plugins 1 star because they don't support the version they need (1.8 is an example) 💀

tender shard
tranquil ferry
#

I used api for SQL and lamp api and now plugin size is 13mb and I can't upload what should I do

remote swallow
#

use the libraries feature in plugin.yml for stuff thats on maven central

tender shard
#
  1. minimize the .jar (both gradle's shadow and maven shade support that)
    if that's not enough:
  2. use plugin.yml "libraries" feature if your stuff is on maven central and you're supporting 1.16.5+ only
    otherwise
  3. use libby or sth similar
#

alternatively just upload your plugin to another site (external download)

native gale
#

I do 2. all the time

#

Even though it cuts the support of servers lower than 1.16.5

rough ibex
#

Good

native gale
#

I also find annoying that bStats require shadowing

tender shard
#

tbf it's only like 10kb

native gale
#

10 kb x 100 plugins = 1mb

#

Though, my main annoyance is that I need to setup the shading plugin every time

quaint mantle
#

1mb is nothing

native gale
#

Just for this library

#

Like, a special child with special needs

flint coyote
#

why would the plugin size matter?
Even if they all were 10mb, who cares

native gale
#

Saving traffic, duh

remote swallow
#

there is not a project that i do not have shadow on

native gale
#

I have some

#

Where I don't use bStats

#

The library thing in plugin.yml handles it all

quaint mantle
flint coyote
#

My server runs on mobile data without a flatrate. Gotta pay per mb :(

quaint mantle
#

You should see how much kids waste TBs of data watching brainrot

rough ibex
#

Xbox games

flint coyote
#

more like the double t

#

and not the kesha one

worthy yarrow
#
        NamespacedKey chickenPetKey = new NamespacedKey(CoolPets.getPlugin(CoolPets.class), "chicken_pet_key");
        NamespacedKey chickenPetLevelKey = new NamespacedKey(CoolPets.getPlugin(CoolPets.class), "chicken_pet_level_key");
        ItemStack chickenPet = new ItemStack(Material.CHICKEN_SPAWN_EGG);
        ItemMeta chickenPetMeta = chickenPet.getItemMeta();
        chickenPetMeta.getPersistentDataContainer().set(chickenPetKey, PersistentDataType.STRING, getPetId().toString());
        chickenPetMeta.getPersistentDataContainer().set(chickenPetLevelKey, PersistentDataType.INTEGER, getPetLevel());

        chickenPet.setItemMeta(chickenPetMeta);```
Is this application of pdc correct?
remote swallow
#

id recommened to cache the keys, and you can use NamespacedKey.fromString("key:value") to make it easier

#

but the rest looks fine and a correct use of it

worthy yarrow
#

flat file prolly fine for that yeah?

remote swallow
#

by cache the keys i just mean final/static final variable

worthy yarrow
#

oh thought you meant like save

remote swallow
#

its easier to create them in 1 place incase you do ever want to change the key in future

worthy yarrow
#

Gotcha

#

The level however shouldn't be final correct? as I've got a task that'll increment xp every second, level is decided by: (BASE_XP + XP_INCREMENT) * level

#

Or rather the increment increase per level is decided that way

remote swallow
#

the values dont matter, just the key

worthy yarrow
#

Ah right

#

I'm dumb

#
    private static final String chickenPetKey = "chicken_pet_key";
    private static final String chickenLevelKey = "chicken_pet_level_key";

...

@Override
    public ItemStack petItem(){

        NamespacedKey chickenKey = new NamespacedKey(CoolPets.getPlugin(CoolPets.class), chickenPetKey);
        NamespacedKey levelKey = new NamespacedKey(CoolPets.getPlugin(CoolPets.class), chickenLevelKey);
        ItemStack chickenPet = new ItemStack(Material.CHICKEN_SPAWN_EGG);
        ItemMeta chickenPetMeta = chickenPet.getItemMeta();
        chickenPetMeta.getPersistentDataContainer().set(chickenKey, PersistentDataType.STRING, getPetId().toString());
        chickenPetMeta.getPersistentDataContainer().set(levelKey, PersistentDataType.INTEGER, getPetLevel());

        chickenPet.setItemMeta(chickenPetMeta);

        return chickenPet;
    }```
Look fine?
#

The naming could prolly be better, but if it looks fine that's the goal

tender shard
#

why not just store the NamespacedKey?

public static final NamespacedKey CHICKEN_PET_KEY = NamespacedKey.fromString("myplugin:chicken_pet");
worthy yarrow
#

But also it might have been implied and I missed it

#

Is there a reason you did "myplugin:chicken_pet"?

tender shard
#

you can either do "namespace:key_name" (first method) or just use "key_name" and provide the plugin instance (second method)

#

doesn't really matter

#

i prefer first one because then you don't need any instance and can just use static final fields without having to dependency inject anything or getting the instance somewhere else

worthy yarrow
#

private static final NamespacedKey chickenPetKey = NamespacedKey.fromString("CoolPets:chicken_pet_key");
So this is fine?

tender shard
#

CoolPets has to be lower case

#

otherwise, yeah it's fine

worthy yarrow
#

Gotcha

flat zodiac
#

hey there, i'm having problem with getPersistentDataContainer method. Basically my ide (Intellij) tells me that this method does not exist for player or itemMeta and refuses to compile the plugin... how can i fix it? i tried changin spigotAPI version in maven file but that didn't really get me anywhere...

this is the code:

        public static void WritePlayerPDC(Player player, String key, PersistentDataType type, Object value){
            NamespacedKey nKey = new NamespacedKey(MineconomiaCore.getPlugin(MineconomiaCore.class), key);
            PersistentDataContainer pdc = player.getPersistentDataContainer();
            pdc.set(nKey, type, value);

        }

Those are the imports:


import org.bukkit.NamespacedKey;
import org.bukkit.entity.Player;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.persistence.PersistentDataContainer;
import org.bukkit.persistence.PersistentDataType;

The error:

/home/jakub/IdeaProjects/MineconomiaCore/src/main/java/xyz/mineconomia/mineconomiacore/PDC.java:15:49
java: cannot find symbol
  symbol:   method getPersistentDataContainer()
  location: variable player of type org.bukkit.entity.Player

and pom.xml

        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot-api</artifactId>
            <version>1.18.2-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
undone axleBOT
tender shard
#

my guess is that you're having another dependency that has an old spigot version as transitive dependency which is higher up in your <dependencies>

tender shard
#

move your spigot-api to the top of your dependencies

#

VaultAPI probably comes with an ancient spigot dependency

tender shard
flat zodiac
tender shard
#

np!

ancient plank
#

I had a funny instance where my intellij wouldn't recognize maven imports and I thought my maven was corrupted because I moved it around, turns out it was a bug with the intellij version I was using lol. I was contemplating reinstalling everything, so I'm glad I decided to update it.

remote swallow
#

is that proguard

#

it looks like proguard

tender shard
#

eew no

ancient plank
tender shard
#

it's an old version of allatori

flat zodiac
#

why is vaultapi even importing spigotapi in the first place?

ancient plank
#

just vault things

tender shard
# flat zodiac why is vaultapi even importing spigotapi in the first place?

it's a transitive dependency. it's just how maven works. you have two options:

  1. Move spigot-api up yuorself (as you did)
    or
  2. Tell maven that you only need vault, but no transitive dependencies of it (since nobody would use vault without adding spigot-api themselves to pom)
    (either using a filter, or simply using <excludes> inside vault's <dependency>
#

but if you think about it, it only makes sense that adding vault also adds spigot as dependency, how else would you be ever able to use Vault in your project otherwise?

#

vault could ofc also declare spigot-api to be an <optional> dependency, that'd probably be the best solution

hushed spindle
#

?paste

undone axleBOT
hushed spindle
#

for context, they updated from 1.19 to 1.20.4 and then started getting this error

#

what can cause type to be null during itemstack deserialization

remote swallow
#

do you use spigots config stuf

hushed spindle
#

i suppose yes

#

sec

#

i use Base64Encoder

remote swallow
#

it most likely is failing to upgrade the version or smth

hushed spindle
#

well yeah but is there any way i can fix it

#

or at the least help them remove the error

remote swallow
#

idk how upgrading works @young knoll might

lucid otter
modest tartan
#

I'm encountering a very strange error that I can't solve like..... AT ALL. I'm essentially not being allowed to create any custom events by a null pointer exception that simply doesn't make sense. Everything is instantiated, i've made a dummy function to give my custom event some content (theoretically eliminating any possibility of it being useless and hopefully not 'null')
Error: https://paste.learnspigot.com/epusujapot.php
Custom Event: https://paste.learnspigot.com/asebesaveb.kotlin
Custom Event's Listener: https://paste.learnspigot.com/ucojifewan.kotlin
Main Class: https://paste.learnspigot.com/sexicoreji.kotlin

young knoll
#

Does it happen on spigot

modest tartan
#

Is there a moderetly simple / quick way to switch a project from Paper to Spigot?

young knoll
#

If you aren’t using papers api

#

Then just switch the server to spigot

slender elbow
#

getHandlersList needs to be static

#

that is, in a companion object and @JvmStatic annotated

young knoll
#

Oh look someone that understands Kotlin

#

:p