#help-development

1 messages ยท Page 15 of 1

eternal oxide
#

I guess md5 must have been referring to some other reason

tender shard
noble lantern
#

what are you trying to achieve?

tender shard
azure hawk
#

well how then

noble lantern
#

ohh

tender shard
noble lantern
#

you might have to check spigot src ngl

#

and see how it laods worlds

tender shard
#

probably, yeah

azure hawk
#

and all works fine exept the onInteract event

noble lantern
#

typically, i beileve if you filter for the world type of OVERWORLD, it may be the first default world (Not sure about multiple oveworlds tho)

noble lantern
azure hawk
#

Yes

#

ok wait

#

it works now

#

but the arrow is left ckick block and air instead of right click block and air

#

but why lmao

fickle pine
#

how do I use this damned replace function ๐Ÿ’€

warm mica
#

method*

tender shard
#

the same as you would do in vim

fickle pine
#

nah

#

one sec

#
 String emoji = ":smile:";
        String emojilink = "APILINK";
        if (message.contains(emoji)) {
            event.setCancelled(true);
            event.getMessage().replace(emoji, emojilink);
            }
#

oops

tender shard
#

what does message(String) do

fickle pine
#

included mixed code

tender shard
#

event.setMessage(event.getMessage().replace("asd","foooooo"))

#

strings are immutable

#

you cannot just replace anything in a string and expect it to be applied to the actual string. String#replace returns a new string

fickle pine
#

icic

noble lantern
#

?paste

undone axleBOT
noble lantern
#

Time to suffer:

Exception: https://paste.md-5.net/vopatinace.bash

The code that fires the said exception

Is the first line in the screenshot, any reasons this packet doesnt exist? It exists on the protocol website, using protocol lib btw

#

oh nvm okay so guess protocol lib no worky on 1.19

chrome beacon
#

Dev builds work

noble lantern
#

just download off git and compile?

#

My client and server is being spammed to hell rn lol

just running the plugin alone

#

nvm

noble lantern
#

found the ci link

#

yep!

#

ty ๐Ÿ˜„

#

lemme give it a try and see

chrome beacon
#

Top of the spigot page :)

grim ice
#

๐Ÿ’€

noble lantern
grim ice
#

debugging is attempting to know what place does your code bug (stop running), typically using print statements

noble lantern
fickle pine
noble lantern
#

total client/server spam gone tho so thats a big plus though

#

Wait, do i need to depend on that ci jar too?

chrome beacon
#

They did change the major version

#

So probably

noble lantern
#

ahh so prolly packet name change

#

ggs

#

got i hate installing maven files, be back in 5 years kekw

vocal cloud
#

gradle moment

chrome beacon
eternal night
#

Packet Name didn't change

#

Entity living spawn packet was removed

noble lantern
#

why

eternal night
#

Or United with normal entity spawn

#

Whatever you wanna call it

noble lantern
#

but website still shows them seperate

eternal night
#

Makes perfect sense imo XD

#

Which one ?

noble lantern
#

oh wait

#

nono

#

your right

#

SpawnEntity

#

herderder

fickle pine
#

rip

noble lantern
#

i even linked it earlier and it said SpawnEntity lmfao

eternal night
#

XD

noble lantern
#

or maybe they do

#

but imma try spawn entity, cause i even followed the packet structure for it kek

#

LMAO

#

WTF

#

so this is why you dont use deprecated type ids

#

click "Mob Types"

#

that was only part i couldnt find anything for

hot wolf
#

Does anyone know a good api for usign RGBirdFlop? Because iridium is giving me quite a bit of trouble right now.

#

oh nvm

#

might not even need one

#

my bad

chrome beacon
#

Typo in link

#

Lowercase m for it to work

quaint berry
#

I have learnt java and I've managed to fix this, Thanks for the help!

#

(Not sarcasm)

knotty meteor
#

How can i get 1 closest player within my radius of 10 blocks?
And how can i fix that it is not myself?

chrome beacon
chrome beacon
knotty meteor
#

Thank you! I will try that :D

chrome beacon
#

Well that's some messy code. Anyways store the list of items

#

Also

#

?main

chrome beacon
#

?di

undone axleBOT
knotty meteor
#

I check from my location who is closest, but it still gives myself as closest player

tender shard
#

show your code

chrome beacon
#

Try it and see

tender shard
#

I always get the closest player like this, or similar

    private static @Nullable Player getNearestPlayer(@Nonnull final Player player) {
        return player.getWorld().getPlayers().stream().filter(other -> player != other).sorted((o1, o2) -> (int) o1.getLocation().distanceSquared(o2.getLocation())).findFirst().orElse(null);
    }
knotty meteor
#
        Entity target = getClosestEntity(p.getLocation(), 6);
        
            if (target instanceof Player || target.getName() != p.getName()) {
                p.sendMessage(Utils.colorize("&6Je bent nu &c" + target.getName() + " &6aan het zakkenrollen..."));
                target.sendMessage(Utils.colorize("&6Je wordt nu door &c" + p.getName() + " &6gezakkenrold!"));
        } else {
            p.sendMessage(Utils.colorize("&cJe moet naast iemand staan om te zakkenrollen!"));
        }
    }
    
    public static Entity getClosestEntity(Location center, double radius){
        Entity closestEntity = null;
        double closestDistance = 0.0;

        for(Entity entity : center.getWorld().getEntities()){
            double distance = entity.getLocation().distanceSquared(center);
            if(closestEntity == null || distance < closestDistance){
                closestDistance = distance;
                closestEntity = entity;
            }
        }
        return closestEntity;
    }```
tender shard
#

yikes

chrome beacon
#

Why every entity

tender shard
#

why are you doing all this manually

#

just get a stream of players in the same world, filter and sort it, done

chrome beacon
#

That's going to kill your server quite quickly

knotty meteor
#

Is there a better way of doing it then?

tender shard
#

I literally sent you a oneliner above

chrome beacon
#

Yeah both of us have recommended ways

knotty meteor
#

Oh damn can i try that?

knotty meteor
#

Thanks i will try it!

drowsy helm
#

my dude is missing his beard ๐Ÿ˜ฆ

chrome beacon
#

Making custom npcs

#

?

drowsy helm
#

yeah

#

no clue why the overlay thingy on the skin isnt working

chrome beacon
#

Why not use Citizens

drowsy helm
#

challenging myself

knotty meteor
#

Thank you so much it works now!!

chrome beacon
#

You need to send the skin layer meta data then

drowsy helm
#

ez

chrome beacon
#

^ refer to this

drowsy helm
#

ty ty

eternal oxide
#

Does your NPC extend ServerPlayer?

drowsy helm
#

yeah im using ServerPlayer

chrome beacon
#

Ah not a packet npc

drowsy helm
#

nah, still packets though

#
        Util.sendPacket(new ClientboundPlayerInfoPacket(ClientboundPlayerInfoPacket.Action.ADD_PLAYER, npcPlayer), players);
        Util.sendPacket(new ClientboundAddPlayerPacket(npcPlayer), players);```
eternal oxide
#

no need for a packet. In your NPC class just add this.getEntityData().set(Player.DATA_PLAYER_MODE_CUSTOMISATION, (byte) 0xFF);

drowsy helm
#

oh sick thankyou

eternal oxide
#

that will enable multi layer skins

#

so when you add them to the client it all gets sent correctly

chrome beacon
#

Will the add packet take care of sending the meta data

#

Isn't that another packet? Or do I remember wrong

eternal oxide
#

The ADD_PLAYER will add them, but he's already doing that. Without teh data set it only shows first layer of the skin

chrome beacon
#

Alright

eternal oxide
#

No clue why its not set by default, but who knows

drowsy helm
#

Player.DATA_PLAYER_MODE_CUSTOMISATION doesnt exist anymore?

#

nms Player right

eternal oxide
#

yes, its a private field so only accessible in teh class which extends ServerPlayer

drowsy helm
#

ah

#

sweet

noble lantern
#

cause im working on the same exact thing rn lmfao

drowsy helm
#

uh its not but i can send my code

#

i havent really done much yet

noble lantern
#

i mainly am just confused about the InfoPacket

#

spawn packets ez, but jesus the info one

drowsy helm
#

you just have to pass through the ServerPlayer

noble lantern
#

which is odd

#

finding spigot code on stack overflow lmao

drowsy helm
#

yeah nms stuff sucks to figure out

noble lantern
#

i scoured spigot and then that shows up lmfoa

drowsy helm
#

never any resources out there

eternal oxide
#

``java

noble lantern
#

Yeah most i found were outdated asf

eternal oxide
#
    private static void showAll(Npc npc) {

        ClientboundPlayerInfoPacket playerInfoAdd = new ClientboundPlayerInfoPacket(ClientboundPlayerInfoPacket.Action.ADD_PLAYER, npc);
        ClientboundAddPlayerPacket playerSpawn = new ClientboundAddPlayerPacket(npc);
        ClientboundRotateHeadPacket headRotation = new ClientboundRotateHeadPacket(npc, (byte) ((npc.getYHeadRot() * 256f) / 360f)); // 
        ClientboundPlayerInfoPacket playerInfoRemove = new ClientboundPlayerInfoPacket(ClientboundPlayerInfoPacket.Action.REMOVE_PLAYER);

        for (Player player : Bukkit.getOnlinePlayers()) {
            ServerGamePacketListenerImpl connection = ((ServerPlayer) NMSUtils.getServerPlayer(player)).connection;
            connection.send(playerInfoAdd);        // Inform client this Entity exists.
            connection.send(playerSpawn);    // Spawn this entity on the client.
            connection.send(headRotation);
            connection.send(playerInfoRemove);    // Remove from servers tab list
        }
    }```
noble lantern
#

So extending SeverPlayer essentialls just handles the InfoPacket?

hybrid spoke
drowsy helm
hybrid spoke
#

nostalgia kicks in

drowsy helm
#

probs had this skin for a good 5 years now

noble lantern
#

or is there some method in the info packet?

drowsy helm
#

you can set the skin at any time with the gameProfile

#

then send the info packet

eternal oxide
#

I use a setSkin method in my extended class```java
public void setSkin(String[] skin) {

    String texture = skin[0];
    String signature = skin[1];

    this.getGameProfile().getProperties().put("textures", new Property("textures", texture, signature));
    // Enable the second layer of the ServerPlayer's skin
    this.getEntityData().set(Player.DATA_PLAYER_MODE_CUSTOMISATION, (byte) 0xFF);
}```
noble lantern
drowsy helm
#

why use an array as params lmao

#

oh Elgar while you're here

#

how do you handle interaction?

#

because afaik the event doesnt fire if i click my npc

eternal oxide
#

I haven't checked interact events firing. I do have code for attacking them

azure hawk
#

Why arent they any dye items to chose from

noble lantern
chrome beacon
#

1.8 iirc

noble lantern
#

The last line enum does exist for me

chrome beacon
azure hawk
noble lantern
azure hawk
noble lantern
#

Back then you had to set data manually of a specific material

chrome beacon
#

^

azure hawk
tender shard
drowsy helm
chrome beacon
eternal oxide
azure hawk
tender shard
#

Material.INK_SAC

#

and they have a different durability

azure hawk
#

bruh

#

wtf

tender shard
#

yeah well

noble lantern
tender shard
#

use a proper MC version and you won't have to deal with this

noble lantern
#

had wrong Player import

azure hawk
#

is there a website were i can see the durabillity for each dye

#

xd

noble lantern
#

?1.8 my mans

undone axleBOT
chrome beacon
tender shard
#

/**
* Gets the closest player in this world, or null if there is no player
*/
public static @Nullable Player getClosestPlayer(final @Nonnull Location location) {

#

oh

#

wrong paste lmao

azure hawk
#

like that

#

or how

tender shard
#

just google minecraft dye ids

azure hawk
#

XD

azure hawk
chrome beacon
azure hawk
#

so like this and ID is the certian id

tender shard
azure hawk
#

ok

chrome beacon
#

You can pass the durability in the construcor as the 3rd param

#

2nd is stack size

azure hawk
chrome beacon
#

No

azure hawk
#

ok

tender shard
#

that does not look like a valid short to me, lol

#

the color is only the 10 part

#

351 is the ink sac

chrome beacon
#

They skipped the learning java part we told then 10 times yesterday

#

So they have no idea what they're doing

sullen current
#

hi, i'm creating my first plugin and i follow a tutorial to implement Vault... but it didn't work. Somone can help me?

azure hawk
#

what does this ink sac thin have to do with java xD

chrome beacon
#

The code you're writing isn't valid java

tender shard
chrome beacon
#

?paste in here

undone axleBOT
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.

chrome beacon
#

Ah right that exists

azure hawk
#

like

#

xd

chrome beacon
#

Alex already awnsered what you need to do

tender shard
#

shit wrong video

#

it was the one where I mistyped the same thing 12 times

chrome beacon
sullen current
chrome beacon
#

Copilot?

chrome beacon
sullen current
azure hawk
#

how can i put any dye in my inv/gui

tender shard
chrome beacon
#

Nice

chrome beacon
sullen current
#

it didn't give me money

chrome beacon
#

Did it send your messages

sullen current
#

nop

tender shard
#

you never set econ to anything not-null. Why didnt you tell us that you get console errors?

chrome beacon
#

._.

tender shard
#
public static Economy econ = null;

This is always null so getEconomy() is also null so it throws a NPE

quaint berry
#

In the .getTargetBlock() what are the args?

quaint berry
sullen current
#

so how can i fix it?

quaint berry
#

Thank yoooouuu

chrome beacon
tender shard
#

check line 52

azure hawk
#

why does this not work

sullen current
#

ok so if i set it != null it will work?

chrome beacon
#

Because why would it

tender shard
chrome beacon
tender shard
#

set the field instead

sullen current
#

i don't understand....๐Ÿ˜…

azure hawk
tender shard
#

remove the word "Economy" in line 52, and then do ?learnjava lol

tender shard
chrome beacon
noble lantern
#

oh shit

#

this worked??

#

first time?

#

nice, no im not spawning it in , cant make me

noble lantern
#

for a extra piece of candy

quaint berry
#

What does it do ???

tender shard
#

materials that it ignores / "sees through"

young knoll
#

It tells you

quaint berry
#

Oh I'm retarted

azure hawk
#

xd

#

pls

tender shard
#

I fucking hate it when people keep asking the same questions and simply refuse to learn basic java, instead they decide to waste eversone's time with their ignorance

chrome beacon
tender shard
#

I also blocked him lol

azure hawk
#

Ok

#

cool

sullen current
tender shard
chrome beacon
#

That part it correct you just need to set the variable in setupEcon

noble lantern
sullen current
#

there is a function return with it but i also write it

eternal oxide
chrome beacon
noble lantern
#

ohhh setPos

#

tyty

tender shard
#

doesn't the entity constructor already require to give a location?

#

like the AreaEffectCloud here?

drowsy helm
noble lantern
#

Also i assume ClientboundEntityMove packet, is the packet used to manipulate the entity movements?

Trying to find the wiki.vg packet im trying to compare again uhhh

drowsy helm
#

seems like this.getEntityData().set(Player.DATA_PLAYER_MODE_CUSTOMISATION, (byte) 0xFF); doesnt wanna work

#

yeah pretty sure

#

moveTo just does it for you

young knoll
#

ClientBoundEntityMovePacket.Pos iirc

noble lantern
#

this packet

#

Is the specific one im wanting to use, and i assume clientboundentitymove is this?

young knoll
#

ClientBoundEntityMove is abstract

noble lantern
tender shard
#

wiki.vg would be quite useful... if they'd actually use the proper packet names instead of random, made up names

noble lantern
#

so moveTo calls actually threw errors, or similar method did that cant remember

noble lantern
young knoll
#

Wiki.vg would be very nice with the mojmap names

noble lantern
#

ikr

#

okay yah .Pos is that packet

#

ty

#

love me these var1 var2 var3 variables

young knoll
#

Entity id, x movement, y movement, z movement, onGround

noble lantern
#

changes are relative right

young knoll
#

Yes

drowsy helm
young knoll
#

I think 4096 is one block

noble lantern
#

oh

#

perfect

#

that exactly what i need lmfao

young knoll
#

I just worked with this earlier :p

noble lantern
#

Yeah im changing from citizens to packet based npcs

#

hoping this way the npcs actually stay on theyre pathfinding path

patent fox
#

how do i make custom entity follow player? btw im using remapped

noble lantern
#

depends on the entity

#

What entity?

patent fox
#

zombie

noble lantern
#

setTarget(entity, false);

Where false = attacking the player while chasing

I think you need to get the entities navigator

#

getNavigator() iis

#

wait

#

lemme double check

chrome beacon
#

I'd use a custom goal

#

And remove all the other ones

noble lantern
#

oh yeah the chasing goal

patent fox
#

yeah im trying to learn how to use goals but there are no remapped tutorials

sullen current
chrome beacon
vivid cave
#

I want to see the source code of LivingEntity$getLineOfSight where can i find it?
Going through bukkit or even spigot's repo i can only find the interfaces of LivingEntity, where's the implementation?

young knoll
#

CraftLivingEntity

vivid cave
#

oki thanks!

chrome beacon
undone axleBOT
vivid cave
#

Also just wondering, why is it done like that? What's the point of making an interface if there's only one implementation of it, why not directly coding the classes/implementation?

chrome beacon
#

Because that's how APIs should be done

#

If someone decides to make a custom implentation like Glowstone there won't be a problem

noble lantern
hybrid spoke
patent fox
vivid cave
noble lantern
hybrid spoke
#

or more simple said, API is an interface by defintion

#

you interfere with the interface without knowing whats behind

vivid cave
#

oki^^

noble lantern
young knoll
#

Ah

#

Nope, not players

tender shard
undone axleBOT
young knoll
#

Imma guess it points to World#rayTrace

vivid cave
patent fox
#

?

sullen current
# chrome beacon ?learnjava

can u write me a simple code to make work my plugin please? because i need this plugin as soon as possible ๐Ÿ™‚ after that i promise u i'll study more java...๐Ÿ™

tender shard
twilit roost
#

?paste

undone axleBOT
tender shard
twilit roost
young knoll
#

Mojang has some strange names

tender shard
#

or use NMS to launch it

twilit roost
#

also used Projectile but gave on that bcs of this

noble lantern
#

oh the npcs were spawning in

just halfway accross the fuckin map

young knoll
#

You must implement Bukkit projectile

#

To launch it using Bukkit

twilit roost
#

right
well if I want to do it NMS way?
Please no "Update breaks everything"

young knoll
#

Idk, look into NMS player for a launchProjectile method

#

Or look at what CraftPlayer calls for launchProjectile

tender shard
#

you can only launch custom projectiles if they extend one of the existing projectile classes

#

otherwise it'll fail

tardy delta
#

is there a better way to have sync and async implementations of some db stuff instead of this?

#

i could also join the future but thats kinda resource expensive

noble lantern
#

I setPos but seems like the position does-

#

im so sorry

#

fucking

drowsy helm
#
    public void setLocation(Location loc){
        entity.setPos(loc.getX(), loc.getY(), loc.getZ());
    }```
#

thats it

#

entity being ServerPlayer

noble lantern
#

yeah i realized now

#

that im setting pos after the packets set facepalm

drowsy helm
#

lmao

tardy delta
#

spawnIn -> spawnAt ๐Ÿ™„

noble lantern
twilit roost
noble lantern
#

get() blocks until future compeletes, which would execute the future in sync

chrome beacon
#

?services

undone axleBOT
noble lantern
drowsy helm
#

still bald :/

noble lantern
#

B A L D

#

i need to make mine lock on the ground ๐Ÿ’€

#

theyre just walking around in air LMAO

drowsy helm
#

yeah seems setting their flight mode and game mode still makes them float

split kettle
#

How long does a refund take?

noble lantern
#

seems good now

tender shard
#

why the heck do people use Arrays.deepEquals for normal arrays, ugh

noble lantern
#

they walk FAST tho kek

tender shard
split kettle
hybrid spoke
#

quick question: are y'all a fan of final everything within an api which is not explicity meant to inherit, instantiate, do whatever with it?

hybrid spoke
#

or is it just like a "fuck it, their fault"

split kettle
noble lantern
#

some things a user may want to change

split kettle
drowsy helm
tender shard
tardy delta
noble lantern
#

especially if this is for pathetic api

tardy delta
#

ik get can throw an exception but uhh

noble lantern
hybrid spoke
noble lantern
#

yeah ide say non finals

#

unless its something a user wont change

smoky python
#

Hi guys, I'm trying to make a bed placing function with Loc of the Bed foot, and Blockface for direction.
I get the error : cast exception bed / block data ...
I'm on 1.19 version, can you help me ?

noble lantern
#

like BukkitMappings and shit

#

all that can be final

hybrid spoke
#

its just the minor things like dont instantiate pathimpl yourself f.e.

noble lantern
#

But actual impl stuff maybe leave non final

#

ahh

#

yeah stuff like thats fine

split kettle
tender shard
smoky python
#

[10:47:16] [Server thread/ERROR]: Error occurred while enabling Bedwars v1.0 (Is it up to date?)
java.lang.ClassCastException: class org.bukkit.craftbukkit.v1_19_R1.block.data.CraftBlockData cannot be cast to class org.bukkit.block.data.type.Bed (org.bukkit.craftbukkit.v1_19_R1.block.data.CraftBlockData and org.bukkit.block.data.type.Bed are in unnamed module of loader java.net.URLClassLoader @5c29bfd)

tender shard
smoky python
#

that's good?

noble lantern
#

but like if i want to change a variable or something, at least make it non final

tender shard
noble lantern
#

that way even if its not public i can ez hack into it with reflection

tender shard
#

send the full error...

smoky python
#

...

split kettle
smoky python
#

Bed bedDataFoot = (Bed) block.getBlockData();

tardy delta
#

did you check instanceof?

noble lantern
#

time to make a packet navigator

#

this shits gonna be aids

smoky python
#

That's the line

tardy delta
#

isnt it the blockstate you need ๐Ÿค”

tender shard
smoky python
#

I have tried with multiple usages but without success..

tardy delta
tender shard
smoky python
#

yes

#

Bed is directional(is BlockData)

tardy delta
#

mye i see

tender shard
#

as said, the block is not a bed

#

print out the block in a debug thing

tardy delta
#

and do instanceof

smoky python
#

The block is a bed

#

I have set the block type to bed before

#

If I come here, It's because I haven't find solution

tender shard
#

print out the block

tardy delta
#

with the one line code you sent, you arent checking if the block is actually a bed

smoky python
#

Don't take me for a quiche please

tardy delta
#

lol

tender shard
#

one of those people again

#

comes here, asks for help, provides no code, doesnt show an error message, gets angry when people have suggestions

smoky python
#
        block.setType(type);
        BlockState state = block.getState();
        System.out.println(state);
        Bed bedDataFoot = (Bed) block.getBlockData(); // Le bed est un org.bukkit.block.data
        bedDataFoot.setPart(Bed.Part.FOOT);
tender shard
#

good luck fixing it yourself then

smoky python
#

type is RED_BED

tardy delta
#

instanceof as i said ๐Ÿฅบ

tender shard
#

and what does it print now?

smoky python
#

error

#

error

#

cast

tender shard
#

...

#

no

tardy delta
#

i cant..

hybrid spoke
#

just ?paste everything you have and get as response in your console

tender shard
hybrid spoke
#

otherwise you wont receive any help

smoky python
#

java.lang.ClassCastException: class org.bukkit.craftbukkit.v1_19_R1.block.CraftBlock cannot be cast to class org.bukkit.block.data.type.Bed (org.bukkit.craftbukkit.v1_19_R1.block.CraftBlock and org.bukkit.block.data.type.Bed are in unnamed module of loader java.net.URLClassLoader @5c29bfd)

hybrid spoke
#

what dont you understand about "everything"

#

?paste

undone axleBOT
tender shard
smoky python
tender shard
#

it's the fifth time that he refused to show the full error or code lol

noble lantern
#

casting NMS to bukkit

#

lets go

smoky python
#

Excuse me, I don't usually ask for help on discords ^^

tender shard
#

in MainBedwars line 22

#

erm

#

I meant

#

in BedwarsManager.java line 155

smoky python
#

So I can't do bed placement without CraftBukkit?

tender shard
#

what?

#

Stop casting a block to bed

#

and cast the BlockData instead

smoky python
#

Nope, i'm casting a blockData to the bed...

tender shard
#

No, you are not

hybrid spoke
#

you dont

noble lantern
#

Show the code

smoky python
#

Bed bedDataFoot = (Bed) block.getBlockData(); // Le bed est un org.bukkit.block.data

tender shard
#

it literally says it exactly here

#

you are doing it in bedwars manager line 155

smoky python
#

Yep, but it's not logic.

#

and that's why i'm here

tender shard
#

for the third time - bedwars manager line 155

#

stop casting the block to bed there

rare flicker
#

Alright i'm a bit confused, i'm making an inventory menu, something that's already been done a thousand times before
and yet i can't seem to prevent a player from moving items in and out of the inventory using the number slot keys

anyone knows the event fired for that?
doesnt seem to be
InventoryClickEvent
InventoryDragEvent
InventoryInteractEvent
InventoryMoveItemEvent

chrome beacon
#

It's InventoryClickEvent

smoky python
tender shard
#

bedwars manager line 155

rare flicker
smoky python
noble lantern
#

wild question

Can packets from ServerPlayer#connection be sent async

#

nvm

rare flicker
#

well thanks then

#

i swear i'm either becoming blind over time or idk

tardy delta
#

too much weed

rare flicker
# tardy delta too much weed

Drug is not a weed, plant is a meth. Can you grow weed, can, drug, plant??? YES. Can you weed drug? NO. ||Reference to Jeaney collects||

tardy delta
#

hmmm

tender shard
#

oh random reply

#

sry lol

tall dragon
tender shard
#

huh that's weird

#

thanks

tall dragon
#

of course ๐Ÿ‘ i dont rlly like it either

noble lantern
#

How am i gonna know who wrote my method tho

#

๐Ÿ˜

delicate lynx
#

I didn't even know you can show authors

wet breach
#

is there non-vanilla enchantments?

sweet pike
delicate lynx
#

you could probably getKey() and see if it contains "minecraft:" lol

#

unless the custom enchant is dumb and doesn't use it's own name

eternal oxide
#

getKey().getKey() should be "minecraft"

sweet pike
#

thank you!

tardy delta
#

damn 2000 lines

delicate lynx
#

you're also like 50 builds out of date

tardy delta
#

dont really care, im just testing my plugin

drowsy helm
#

anyone know why PacketType.Play.Client.USE_ENTITY on protocolLib calls 4 times for 1 entity lol

tender shard
#

which packet is that?

#

ServerboundUseItemPacket?

#

it's once for each hand and maaaaaybe it also gets send once for block and once for air? no idea lol

drowsy helm
#

oh yeah i think thats right

#

gotta figure how to discriminate them with protocollib

river oracle
drowsy helm
#

hate crime on packets >:D

river oracle
#

They don't deserve it

tardy delta
#

intellij crashed for no reason lol

vivid cave
tardy delta
#

?stash ?

undone axleBOT
tardy delta
#

assuming you want to see the craftbukkit internals

tender shard
tardy delta
#

nah dont have it

#

it probably was too hot in here for the poor intellij ๐Ÿคค

hoary sierra
#

rip lmao

sterile token
#

?bump

#

?status

eternal night
#

lmao

sterile token
#

Is the bot down?

eternal night
#

I don't think there is a bump status

#

lol

sterile token
#

I want to bump the Thread

#

Which is the cmd

hybrid spoke
#

?ping

undone axleBOT
#

Pong.

eternal night
#

I don't think that command exists ?

sterile token
#

okay

#

And how do I close the Thread

hybrid spoke
#

top right 3 dots

#

->archive

sterile token
#

Ohh ok

#

Thanks

tardy delta
#

EntityZombie is the code mojang wrote right?

#

ah wait

#

craftbukkit

eternal night
#

EntityZombie is the spigot mappings name for the NMS zombie

tardy delta
#

oh uh

sterile token
#

Nms are things that came from moksng right?

tardy delta
#

yes

#

moksng

sterile token
#

And what the diff thru nms and packet

#

Because packets are over nms right

eternal night
#

packets are part of the server internals ?

#

no

sterile token
#

Oh ok

#

I never used nms on spigot

#

Sorry

boreal seal
#

wondering anyone wants to code together?

#

idk coding alone is boring me lastly

#

(i code unique game-modes for my server)

#

not mini games a gamemodes

#

like DayZ (for example)

tardy delta
#

?services maybe

undone axleBOT
chrome beacon
#

Do you want to join a project or are you looking for people to join your project

tardy delta
#

he wants to code with his gf ๐Ÿฅบ

boreal seal
#

nah not services not gonna pay for a hobbie

#

i can either join other people projects as well

#

just to improve my own skills

#

i will not pay someone to code with me its so funny

eternal night
#

I mean, look at open source projects and contribute ?

boreal seal
#

FourteenBrush it was really not nice

ashen quest
#

yo guys, how can I change one trade of a villager?

boreal seal
#

i dont mind to join anyone else project i would be happy

chrome beacon
#

Have you worked with Minestom before? If so you can help me with that

boreal seal
#

what is Minestom an api?

#

ill google it not sure what is minestom honestly

eternal night
#

sever software

chrome beacon
boreal seal
#

no not really i have exprience with bukkit/spigot

#

but i might do some homework ;p seems to be pretty much the same thing

chrome beacon
#

Well it's another java project for Minecraft

#

But no mojang code

boreal seal
#

yeah mojang obsf their code

sterile token
chrome beacon
#

It's much faster but it takes a bit of work to get something running. It's perfect for minigames or custom game modes

boreal seal
#

i see

chrome beacon
#

If obsf is obfuscation ;/

ashen quest
ashen quest
#

oh haha

boreal seal
#

i see minestom look pretty dupe

#

kinda break the limits i guess

#

since in the first video to make an axe fly like this you would use armorstands that are invisable

chrome beacon
#

Yeah you should join the Minestom discord and see what people have made

boreal seal
#

does Minestom support 1.8?

#

wait ill check it

chrome beacon
#

1.18.2 only

#

There is no reason to run 1.8

#

And don't say pvp. You can disable attack cooldown

boreal seal
#

performance

#

its less about pvp

#

1.8 has more limits

chrome beacon
#

Performance isn't that bad in modern versions

#

My phone can run 1.19 at 40 fps just fine

#

Samsung A51

boreal seal
#

modern phones are having better cpus then many non modern computers

chrome beacon
#

True but if you're running a CPU that's older than Minecraft it's probably time to upgrade

boreal seal
#

i guess you got a good point

chrome beacon
#

I have a 10 year old i5. I run 2 Minecraft instances, a server and Intellij without a problem

#

And at times a few chrome tabs together with that

boreal seal
#

i see i have an a gaming laptop with i7-10700k

#

and an rtx 2080

#

(laptop gpu)

#

but i kinda stick to the version due the players in my server

chrome beacon
#

I got a GTX 960

boreal seal
#

how much vram?

chrome beacon
#

2

boreal seal
#

oh man its disgusting

#

i think you need to upgrade

#

like its enough for many things

chrome beacon
#

I can run Apex Legends at lowest settings

#

That's probably the most intensive game I play

#

I do want to work a bit with Unreal Engine but it runs out of vram in an empty project

boreal seal
#

ah

#

i had a bad computer as well in the past

#

with an i3 and 4gb vram gpu

#

i got the new laptop only because apex legends

#

but i dont play it anymore oftenly i dont have any friends to play with ;c

#

my only friend is working in the military industry so i see him only in weekends

chrome beacon
#

Apex is the most fun with friends

#

Have 900 hours now

#

Still suck at the game though

boreal seal
#

yeah when i played it for the first time

#

like a year ago

#

it felt so unusual futuristic shooter

#

was really fun

#

but my friends are losers once they die i dont want to play this game anymore

#

if you are from the EU we can play together โค๏ธ i always get teammates without mic ;c

tardy delta
#

'for school' myes

chrome beacon
ashen quest
#

yo guys, how can I change one trade of a villager?

chrome beacon
#

setMerchantRecipe

tender shard
#

Villager#setRecipes

chrome beacon
#

Yeah my bad

#

Just setRecipe it takes an int and a merchant recipe

tardy delta
#

does anyone know if i can set the output dir of the package command to some sftp destination?

boreal seal
#

hey guys it looks fine?

tardy delta
#

404

boreal seal
#

oh

#

i cant send images as well

#

it waits to be accepted

#

ill give it sometime

tender shard
undone axleBOT
#

Usage: !verify <forums username>

tardy delta
#

to get only the subvalues of a config sections

boreal seal
#

!verify EvanMclever

undone axleBOT
#

A private message has been sent to your SpigotMC.org account for verification!

boreal seal
#

oh it looks fine?

tardy delta
#

or is there a better way to get the amount of all the messages by code?

tender shard
# boreal seal

lmao "waste less time with my wife and more into coding" ๐Ÿ˜„

tardy delta
#

doing config.getValues(true).size() - config.getValues(false).size(); basically now

boreal seal
#

on my free time

tardy delta
#

i would like to waste less time with my wife lmao

boreal seal
#

and she mind if i play with friends

#

im realistic

ashen quest
boreal seal
#

i hope today when i get home to see some wierd plugin ideas

undone axleBOT
tardy delta
#

why is the no config::computeIfAbsent kekw

#

i'd probably make a getOrSet method

ivory sleet
#

Maybe reflect the linked hm and computeIfAbsent youโ€™re extremely desperate, else kotlin with its extension functions kek

tardy delta
#

smh i have no idea what im doing moment

ivory sleet
#

Myeah I mean you could go with an adapter design if you wanna do it sophisticatedly

tardy delta
#

now both of us figuring out what an adapter design is ๐Ÿฅฒ

pine forge
#

How can you get the main server world (the world that people join on and thats specified in the server.properties)? I've read that Server.getWorlds().get(0) works, but im not entirely sure if thats always the case.

ivory sleet
#

Well basically a wrapper Ig

tardy delta
#

ah a wrapper that does not directly return the wrapped values but does something with them?

ivory sleet
#

More like you copy the methods interface of ConfigSec or whatever you wanna copy and then implement a class which wraps an original ConfigSec and delegates to it when you call the adapter methods

pine forge
ivory sleet
#

In addition since its your interface you could add whatever preferable methods you want

pine forge
#

odd

#

hey elgar :D

tardy delta
#

oh

ivory sleet
#

You could have your own locale abstractipn where you store all messages in a repo class, then it will be easy to determine the size with Map::size or sth

#

Else yeah believe that approach suffices

pine forge
#

Thanks :D

tardy delta
eternal oxide
#

If importing jars from that folder you need to import teh bootstrap one

#

If using Maven, you should not be importing jars

pine forge
#

or gradle

#

Any reason not to use gradle for plugins?

ivory sleet
ivory sleet
eternal oxide
#

Maven is simpler and building against spigot, its setup for maven

ivory sleet
#

Both maven and gradle work, theyโ€™re equally simple Id say

#

Use whatever you like the most

tardy delta
#

i'm currently having a lang.yml file with all the messages in, but the thing is that whenever i add new messages to the file in the jar, those dont appear in the runtime file

pine forge
#

okay

tardy delta
#

so i tried to write the default messages to the runtime file if it wasnt present

ivory sleet
#

Check for missing entries by key maybe and fallback to default ones and populate the file.

ashen quest
#

how do i create a villager that will give my enchant

I have the trading part setup but still cant figure out how to find that villager

should I use EntitySpawnEvent, or some event related to a villager profession being changed?

chrome beacon
#

Use maven or gradle then

#

?bootstrap

undone axleBOT
#

Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or the entire contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.

Please read the release notes for further information: https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-1-release.534760/#post-4305163

chrome beacon
#

You used that jar right

tardy delta
#

maybe smth like this might work

#

instead of me counting the messages ๐Ÿค”

ashen quest
#

how to check if a villager is a librarian?

eternal oxide
#

why?

ashen quest
#

ty

torn shuttle
#

Hey I have a weird question, are chunks meant to throw the chunk load even several times in a row and possibly even in the same tick?

#

and I mean the same chunk

#

because I'm having that issue

slate delta
#

This is possible to unregister a craft in furnace ?
I want remove the Iron Pickaxe to Iron Nugget

mystic sky
ivory sleet
#

Speed does not imply simplicity gain

#

Nor malfunction

mystic sky
#

Well, they are not ""equal"" at all

#

Oh is gradle hard ?

ivory sleet
#

equally simple does not mean equal

#

Read again

#

But also

#

Saying gradle is faster is vague

#

It hugely depends on setup

mystic sky
ivory sleet
#

Tho yes it caches some stuff which make it fast, but you can configure maven to be parallel also in which it may be faster than gradle

ivory sleet
#

Dont spread fud

split kettle
#

Can someone help me on a plugin I bought a week ago doesn't work and I asked for a refund it doesn't say on the page no refund they said it in dms I need the refund back it doesn't work I already went to PayPal they haven't answer them at all.

waxen plinth
#

This is a chat for devs

ivory sleet
#

In that comparison gradle seems a lot faster, tho there are a lot of aspects to pay attention to

eternal oxide
#

My reason for using Maven... I only code for Spigot (no forks). I know Maven, its simple and I want to play with NMS, which Spigot/specialsource makes so simple.

rain mason
#

i want to use nms so bad but still have no idea how to install it

#

like i know i have to use btools

#

anways time to boost rq

split kettle
rain mason
#

slay

serene onyx
waxen plinth
ivory sleet
#
  • Besides this is isnt the place for those discussions Akuma
golden kelp
waxen plinth
#

Get their trades

#

The number of trades - 1 is the index of the last one

ashen quest
#

How do I check when a user tries to enchant something using an anvil, do I need to hear for both InventoryClickEvent and InventoryDragEvent?

glass mauve
#

there is this event

#

but it says this: "Called when an item is put in a slot for repair by an anvil."

#

for repair, but it maybe works for enchants too

#

there is also EnchantItemEvent

#

but thats for enchantment table

ashen quest
#

Thank you, Ill use PrepareAnvilEvent

icy beacon
#

i just realized that idk how to really use buildtools. i successfully ran it, so... what next? where do i put the files for it to be indexed by my ide? i really have no clue lol

tardy delta
icy beacon
#

nope, nms

#

if it was api i'd just use maven normally

#

i ran buildtools for --latest

tardy delta
#

cant you just use spigot as dependency

#

not spigot-api just spigot

icy beacon
#

i am pretty sure you can't

#

lemme try

#

but the proper way for nms is buildtools, i just don't know what to do now lol

twilit roost
#
            Entity shooter = ((CraftEntity)p).getHandle();
            WeaponBullet bullet = new WeaponBullet(shooter,p.getLocation(),speed, range,damage,headshotDamage);
            float xRot = shooter.getXRot();
            float yRot = shooter.getYRot();
            bullet.shootFromRotation(shooter,xRot,yRot,0.0F,1.5F,0.0F);

Why does this, for me atleast, shoot most of the time somewhere off?
WeaponBullet:
https://paste.md-5.net/wevuderehu.java

#

Entity is nms

icy beacon
eternal oxide
twilit roost
twilit roost
eternal oxide
#

why nms projectile?

icy beacon
tardy delta
#

oh

twilit roost
icy beacon
#

wdyfm 10000 methods to be implemented

#

Projectile projectile = World#launchProjectile or smth i don't remember

twilit roost
#

๐Ÿคฆโ€โ™‚๏ธ

icy beacon
#

you can literally modify it to your fancy

eternal oxide
#

Spigot Projectile you can launch any projectile and set the Item to have ti look like anything you want

twilit roost
#

well I wanted to just do WeaponBullet.shoot or smthing
and it would work fine
I didn't want to set each Bullet everytime I would like to shoot

eternal oxide
#

Thats a simple wrapper method

twilit roost
#

nvm
soo no clues why it shoots sometimes wrongly

dense laurel
#

Can someone help me? I'm trying to create a ban command but target.setBanned(bool); doesn't work

#

do i need to import anything?

eternal oxide
#

You could even create a Consumer to set all your projectile settings, then specify it in the launchProjectile

twilit roost
twilit roost
dense laurel
dense laurel
#

it gives me an error

#

maybe should i import something for it to work?

#

i'm making the plugin for 1.16.5

icy beacon
#

it's not a thing i am pretty sure

#

it's like Bukkit.getBanList().addEntry() or smth

#

i don't thing Player#setBanned is a thing

dense laurel
#

i'll try this one then

icy beacon
#

Bukkit.getBanlist(Type.NAME).addBan(username, reason, expires, source);

#

i copied this from a thread, if it's outdated just check what it's like now

#

Variables:

  • username: the username or IP-address if you are ip-banning (String)
  • reason: String: the reason. (You can use ChatColor)
  • expires: This is the Data (java.util.Data) insert 'null' to permanent ban
  • source: The player's name who banned. Not really important. (Could also be 'console' or something like that)
twilit roost
dense laurel
twilit roost
#

therefore Player doesn't contain setBanned

icy beacon
#

because it is NOT a thing

#

come on you just have to look up the javadocs

twilit roost
dense laurel
#

and work on an unban command then look through this

icy beacon
#

you might want to check BanList#isBanned just to fool-proof your plugin, idk if it would throw an exception if you'd try to unban a not banne dplayer

ashen quest
#

Does anyone know how to make intelliJ auto deploy my plugin to a different server, maybe smth like ssh into that vps and paste the file?

twilit roost
ashen quest
#

oh thats for local

#

i m sayin like to my remote server

twilit roost
#

or pls send me pom.xml build section
I'm not near PC rn

twilit roost
#

maybe try making it ftp://smthing

ashen quest
#

i found, Tools (intelliJ tab) -> Deployment

prime sandal
#

Hello, I need to know how can I set custom texture to a skullItem (item with skullMeta) with spigot 1.19 ?

#

profile field does not exists anymore

twilit roost
#

NMS stuff
there's plenty of util stuff or just code on net

twilit roost
prime sandal
#

okok thank you

twilit roost
twilit roost
prime sandal
#

Yes I tried a texture that works normally

#

eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMTNlOGJiYzhkMTc0YWVjZDZiNDY4ODhmYTYzZjliYWRlMTRiMDQyZTVlMTcwNjMxMzlkNjdmOGUwMTYzYTM4In19fQ==

twilit roost
#

please code

icy beacon
#

please don't ask to be spoonfed

#

ask for pseudocode, for concept, never for code, unless you are REALLY struggling and will NEVER EVER resolve this by yourself

prime sandal
#

It's good it's fixed, It was indeed a problem in my code

sullen canyon
#

hello, how can i detect if player was hitted by rod?

#

i mean like hooked

twilit roost
#

entitydamagebyentity
and check if damager is holding rod

#

maybe not the best way
but will work I think
or there might br some rodhookevent or smthing

prime sandal
twilit roost
prime sandal
#

Exactly yep

twilit roost
#

' ' perhaps send your solution here for future souls not knowing what to do?

#

damn it doesn't work on phone

prime sandal
#

Texture head itemstack (kotlin)

    private fun texturedHead(texture: String): ItemStack = ItemStack(Material.PLAYER_HEAD).apply {
        itemMeta = (itemMeta as SkullMeta).also {
            it.javaClass.getDeclaredField("profile").apply { isAccessible = true }[it] =
                GameProfile(UUID.randomUUID(), null).apply {
                    properties.put("textures", Property("textures", texture))
                }
        }
    }

and to find texture from PLAYER_HEAD itemstack :

    private fun getTexture(skull: SkullMeta) = (skull.javaClass.getDeclaredField("profile")
        .apply { isAccessible = true }[skull] as GameProfile).properties["textures"].iterator().next().value
rotund pond
#

Why using Kotlin for Minecraft plugins ?

#

(I've never used Kotlin, just wondering why it could be a good idea)

tall dragon
#

any1 here experienced with minimessage?

#

i cant figure out how i can add an item to text. where you hover over a word and can see an item tooltip

#

found this. but dont rlly understand what they mean with SNBT string

ivory sleet
balmy valve
#

anyone know how to make this work? getType() returns a Material which cant be used with endsWith

eternal oxide
#

getType().name()

noble lantern
#

dang that was like

#

a 4 day response xD

eternal oxide
#

Watching Supernatural ๐Ÿ™‚

eternal night
river oracle
#

can anyone in here teach me about scoreboards or link me to a guide I'm trying to get started with the basics of Spigots scoreboard API but its confusing me. I can't figure out the whole team thing

vivid cave
#

I don't understand, why is the craftbukkit's github taken down by dmca

river oracle
#

?dmca

undone axleBOT
vivid cave
#

thx

fleet comet
#

What does a protected var do?

river oracle
fleet comet
#

thx

sterile token
#

You can also do a quick search on google

#

I mean we can help you but also google is your best friend

#

๐Ÿ˜‚

fleet comet
#

well i found the class def not sure what the var was

hoary perch
noble lantern
#

the value/sig is what you use normally

#

you can specify

hoary perch
#

yes, this is what i want

noble lantern
#

?unsigned=true

If you dont wanna use sig and just use value as base 64

#

otherwise value is the base64, and sig is well, the sig

hoary perch
#

I dont have signature on the page

#

I just have texture

noble lantern
#

so its unsigned then

#

you only need value

#

if you need it signed use ?unsigned=false

hoary perch
#

yes but how can i get the contents from the site with a httplibrary or smth

noble lantern
#

its json

hoary perch
#

i never used such a library before

noble lantern
#

data.properties[0].value - to access it in javascript for example

#

Json is relatively standard

#

typically youd know json before learning http requests

hoary perch
#

i need the website

noble lantern
#

huh?

hoary perch
#

i know json