#help-development

1 messages Β· Page 524 of 1

echo basalt
#

look at how much less offending you'd get if you at least tried to learn the basics instead of applying some arabic "I'm not gonna become a master on it just for this one bump up the road"

karmic salmon
#

bec.

remote swallow
#

if you cant even google you arent going to go anywhere with plugin dev

karmic salmon
#

Never asked πŸ’€

#

idc

#

thank you :)

#

now

#

stop telling me learn java damn

#

ask for help not for clowns ☠️

echo basalt
#

throwback to when this happened

remote swallow
#

there is 1 person i know of here that will help you with basic stuff the rest of us wont

karmic salmon
echo basalt
#

@fluid river I regret pinging someone else I blocked but like

karmic salmon
#

I never asked πŸ’€

echo basalt
#

all hope is lost

karmic salmon
#

ok be rude

#

ah

chrome beacon
#

Block and move on

remote swallow
#

the blue sky is giving me troll vibes

karmic salmon
#

i telling to immillusi

karmic salmon
echo basalt
#

is that a ghost or something

#

looks like medication

eternal oxide
#

its 9 or 10am for Nukerfall

karmic salmon
#

insteed of saying learn whole java for small error

echo basalt
karmic salmon
#

maybe tell me how get error?

echo basalt
#

10am in russia

karmic salmon
#

send me helpful link?

#

tell me google?

remote swallow
#

you casted an instance to something it isnt

karmic salmon
#

yep

agile anvil
#

Google is a great way to learn

karmic salmon
#

so i try fix it rn

echo basalt
karmic salmon
karmic salmon
remote swallow
#

i sent you a link to fix it but you didnt understand it because you havent learnt java

eternal oxide
echo basalt
#

oo I might actually learn from this

echo basalt
remote swallow
#

throwback to this

karmic salmon
karmic salmon
buoyant viper
#

watch the fuckin language, fucker

remote swallow
karmic salmon
#

?learnjava

undone axleBOT
agile anvil
karmic salmon
#

not by tell me learn java

remote swallow
buoyant viper
#

if u learn the java u can figure out casting

remote swallow
#

^^

karmic salmon
remote swallow
#

what other link

#

?di ?

undone axleBOT
karmic salmon
buoyant viper
#

in 5 words you have created quite possibly the most unintelligible statement ever

remote swallow
#

cant wait for the "why does it work i copied it right of the wiki"

buoyant viper
#

i Fucked ur mom

karmic salmon
#

this.plugin just set this class to var called plugin

#

how to report people here for swearing

fossil wraith
#

anyone knwos about how my script doesn't works when i click on the result item of the custom Anvil?
@EventHandler public void TeleportNameSetEvent(InventoryClickEvent event) { ItemMeta itemMeta = event.getCurrentItem().getItemMeta(); Bukkit.broadcastMessage(itemMeta.getLocalizedName()); if (event.getInventory().getType()==InventoryType.ANVIL) { AnvilInventory anvilInventory = (AnvilInventory) event.getClickedInventory(); if (itemMeta != null && itemMeta.getLocalizedName().equals("BasiCore.confirmNameButton")) { Bukkit.broadcastMessage("Rename button clicked!"); event.setCancelled(true); } } }

this works on other space except the result item slot of the custom anvil GUI

buoyant viper
remote swallow
#

this.plugin refers to a class variable

karmic salmon
#

PlayerStatsPlugin plugin

#

now i learning πŸ’€

remote swallow
#

its called psudo code

karmic salmon
#

not by telling me learn java

karmic salmon
eternal oxide
#

Learn java and no one would tell you to learn java

remote swallow
#

can confirm

karmic salmon
#

done

remote swallow
#

no you havent

karmic salmon
#

stop telling me

eternal oxide
#

No you didn't

karmic salmon
buoyant viper
#

wait we were supposed to learn JAVA? shit... i learned Scala....

karmic salmon
agile anvil
#

I'm just wondering how old you are ?

remote swallow
#

okay how do i use reflection to find out if the server is using mockbukkit

young knoll
#

What’s a java

karmic salmon
eternal oxide
#

I never gave my opinion

chrome beacon
#

anyone knwos about how my script doesn t

karmic salmon
remote swallow
#

my god you are a literal child

karmic salmon
#

mockbukkit is server not java

buoyant viper
#

my what in brother christ

remote swallow
#

mockbukkit is coded in java

karmic salmon
#

yes

remote swallow
#

just like spigot

karmic salmon
#

i know

remote swallow
#

and funilly enough what your coding in

eternal oxide
karmic salmon
#

java is diff learning plugins

#

plugins have other add-on things

#

and i learning it rn

remote swallow
karmic salmon
#

So

buoyant viper
#

to makea da plugin 1 must learna da java

remote swallow
#

java is different than plugins how

#

oh right the startup is different, thats very sad

karmic salmon
eternal oxide
#

oh mockbukkit is the server test/emulator thing?

karmic salmon
#

plugins made by java

buoyant viper
#

but plugins are java

remote swallow
#

yeah

eternal oxide
#

ah never used it

karmic salmon
#

but plugins have addon

buoyant viper
#

wat

karmic salmon
#

and i learning the add-on

buoyant viper
#

plugins are the addon

karmic salmon
#

yep

#

i learning plugins

#

not java

#

big diff

remote swallow
#

@tender forge can we get The Blue Sky kicked or something, hes just a mega troll at this point

buoyant viper
#

but u couldnt figure out casting an object for ur plugin?

karmic salmon
#

you can't kick some one who try find help but other people tell him learn java damn

remote swallow
#

you are just a troll

karmic salmon
#

this

#

Plugins

#

not java

#

big diff

karmic salmon
remote swallow
#

casting is java mechanics

buoyant viper
#

what r u here for again

remote swallow
#

not spigotapi

buoyant viper
#

what was the original issue

karmic salmon
#

i ⭐ Learning ⭐

eternal oxide
#

Actually a timeout has been applied in the past for those who refuse the advice given and annoy enough of the channel

karmic salmon
#

"plugin"

#

litty plugin word there

remote swallow
chrome beacon
karmic salmon
#

yes casting java

#

but we need cast it

#

to plugin

remote swallow
#

you normally dont ever need to cast your plugin

eternal oxide
#

You can not cast an Airplane to a Car

buoyant viper
#

but they have wheels!

eternal oxide
#

they are both Vehicles but they are not the same

karmic salmon
remote swallow
#

correct

#

casting wont fix it

eternal oxide
#

you need an instance of this

karmic salmon
#

yep

eternal oxide
#

which needs to be your plugin

remote swallow
#

you can fix it if you do something called reading

karmic salmon
eternal oxide
#

so you need dependency injection, which you have already been told

karmic salmon
#

can i read now in peace after i know what is problem

#

That told by you guys and the link you send πŸ’€

#

this more simple than drinking water

#

EpicEbic is only one that don't block me until now πŸ’€

remote swallow
#

how would you know if i blocked you already

karmic salmon
#

i think winnipixie to

karmic salmon
#

nope

karmic salmon
#

if it set to nothing

#

means youi blocked me

#

if it set to like text or anythimg

#

means you still don't blocked me

#

i can't say winnipixie blocked me or not

remote swallow
#

you sent me a message request

karmic salmon
#

bec she don't have about me

karmic salmon
#

again

#

confirm check

remote swallow
#

cant dm me if i blocked you

karmic salmon
#

yep

#

@eternal oxide blocked me aready

eternal oxide
#

I'm all private. Only friends can DM me, and I have no friends 😦

karmic salmon
#

oh

eternal oxide
#

Nope, I have no one blocked

karmic salmon
#

then it not block]

#

hmm

#

guys put about me

remote swallow
#

i have quite a few people blcoked

#

a lot came from here

karmic salmon
#

☠️

#

rip

#

i think only one is olivo and imllusion

#

blocked me

#

good good

#

they uiseless anyway

agile anvil
#

Bro

karmic salmon
#

they being rude

eternal oxide
#

lol they are good helpers.

agile anvil
#

Is your goal to get a ban ?

karmic salmon
#

i could be rude too

karmic salmon
chrome beacon
#

Well I'm here quite a lot πŸ˜‚

karmic salmon
eternal oxide
#

I suggest you drop it then. Bans are probably approaching.

buoyant viper
#
package com.example.exampleplugin;

import com.example.exampleplugin.somepkg.AnotherClassWoah;
import org.bukkit.plugin.java.JavaPlugin;

public class SomePlugin extends JavaPlugin {
  @Override
  public void onEnable() {
    // do stuff
    AnotherClassWoah woah = new AnotherClassWoah(this);
    woah.doSomethingLol();
  }
}```

```java
package com.example.exampleplugin.somepkg;

import com.example.exampleplugin.SomePlugin;
import java.util.UUID;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;

public class AnotherClassWoah {
  private final SomePlugin plugin;

  public AnotherClassWoah(SomePlugin plugin) {
    this.plugin = plugin;
  }

  public void doSomethingLol() {
    Player player = Bukkit.getPlayerExact("winnpixie");
    UUID uuid = UUID.randomUUID();

    player.setMetadata("Starttrue", new FixedMetadataValue(this.plugin, uuid));
  }
}``` why cast when u can pass!
karmic salmon
#

who could ban

eternal oxide
#

They are just fed up with talking to a brick wall

karmic salmon
#

i never asked for the code

#

i asked for help

#

πŸ’€

#

ok now this troll

#

me not want ban

#

ok bye now

remote swallow
#

you dont understand getting help, you only understand being given the code

agile anvil
#

System.out.println("you dont understand getting help, you only understand being given the code");

buoyant viper
#

AuthorNagException: Nag author(s): '_Rolyn' of 'Discord' about the following: System.out usage

remote swallow
eternal oxide
#

People here will give code to those they feel already know but just need a push. Or its something which really interests them. Everyone else gets taught.

karmic salmon
#

wait

#

wat we even need at this.plugin

#

why we need it

eternal oxide
#

this always references the Object you are currently in. You need Plugin not this

remote swallow
#

a lot of the time if you have a good attitude people will give you the code to do what you want even if your new and you arent just refusing to learn java after starting a plugin

karmic salmon
#

learning plugin

#

not learning java

sullen marlin
#

πŸ‘€

karmic salmon
#

just fixing the error you said :D

remote swallow
#

md can we ban him

karmic salmon
remote swallow
#

hes been trolling for like an hour today and has done it before

karmic salmon
#

ah no

#

it not troll

#

idk

#

i want code now

#

i think md_5 will read all chat anwyay

eternal oxide
#

read the links you were given, and the examples, then go write it πŸ˜‰

#

You are literally just trying to replace this with dependency injection

karmic salmon
#

fr ☠️

agile anvil
#

And please understand AT VERY VERY LEAST what are objects, instances and classes

karmic salmon
#

bruh how i don't know what is objects and classes πŸ’€

eternal oxide
#

Learning Java πŸ˜›

karmic salmon
#

then how i would even know to start plugin πŸ’€

eternal oxide
#

We can teach you it if you ask

karmic salmon
#

πŸ’€ πŸ’€ πŸ’€ πŸ’€ πŸ’€ πŸ’€ πŸ’€ πŸ’€ πŸ’€ πŸ’€ πŸ’€ πŸ’€ πŸ’€ πŸ’€ πŸ’€ πŸ’€ πŸ’€ πŸ’€ πŸ’€ πŸ’€ πŸ’€ πŸ’€ πŸ’€ πŸ’€ πŸ’€ πŸ’€ πŸ’€ πŸ’€ πŸ’€

buoyant viper
karmic salmon
#

this litty the problem

buoyant viper
#

does this count as static aboos @echo basalt

eternal oxide
#

It really is the problem. You don;t understand Objects, instances and inheritance

karmic salmon
agile anvil
#

We can't do a whole java course for you like that

eternal oxide
#

If you actually asked to learn we would teach. When you ask for a fix because you don;t want to read is when there is a problem

buoyant viper
karmic salmon
echo basalt
#

um

karmic salmon
#

just asking 🀯

sullen marlin
#

?learnjava

undone axleBOT
eternal oxide
#

ok

karmic salmon
#

oh

remote swallow
#

how does it feel

echo basalt
#

It's quite weird and you're not really following conventions

remote swallow
#

to get ?learnjava'd by md

karmic salmon
#

ok i will check the link

remote swallow
#

all it took was md

karmic salmon
#

so time check links

echo basalt
buoyant viper
echo basalt
#

maybe an enum with a predicate?

eternal oxide
#

When you create a Class, that is an object, when you use that class new MyClass you are creating an instance of that class. You can have many instance of some Objects, but only one of others, like Plugin

remote swallow
#

maybe you should have that manor with people responding when you ask for help

karmic salmon
buoyant viper
#

im looking on stash and i can not find anything abt not using a logger

fossil wraith
karmic salmon
#

can't you just guys tell me everythign you need is there damn

echo basalt
buoyant viper
#

thats on PAPER?

echo basalt
#

yeah

buoyant viper
#

i couldve sworn ive seen it on spig

echo basalt
#

nope

karmic salmon
#

ok cya now

echo basalt
#

there are other nags but souts are paper-specific

remote swallow
#

i found a startup param to disable it

echo basalt
#

yeah it's hidden

remote swallow
#

what other startup params are hiding from us

echo basalt
#

nag interval

#

uhh

#

nag timeout

#

skipServerPropertiesComments

buoyant viper
remote swallow
echo basalt
#

you can disable it

#

it just like

#

removes comments from server.properties apparently

#

there are also others like bypass host check, debug entities, gameprofiles

remote swallow
#

you can controll all the server.properties stuff from startup cant you

echo basalt
#

ignore world version changes type deal

#

usually just bound to env variables

remote swallow
#

you can specify it on startup and cant you have env vars

#

i remember asking chatgpt about it

buoyant viper
remote swallow
#

at the top iirc

karmic salmon
#

wait i using paper not spigotmc πŸ’€

#

?whereiam

#

eh

#

?whereami

karmic salmon
#

ok time go paper discord server

buoyant viper
echo basalt
#

lmao what the fuck

#

I just looked at CraftBukkit#main

#

the fuck

#

actually this is paper

remote swallow
buoyant viper
#

now thats fixing log4j i guess

karmic salmon
#

I Will join when i need this server

#

cya

echo basalt
remote swallow
#

he actually left

chrome beacon
#

They'll be back

remote swallow
#

should we feel bad for paper

buoyant viper
#

as if a plugin is going to shade the entirety of fucking Minecraft

remote swallow
#

just gave them a warning

buoyant viper
echo basalt
#

where the hell

#

are these being set

remote swallow
#

cmd line

buoyant viper
#

jvm arg

#

-Dcom.mojang.eula.agree=true

remote swallow
#

-Dcom.mojang.eula.agree=true

#

i was too slow

buoyant viper
#

thank u

echo basalt
#

oh so that's how you set them

remote swallow
#

?learnjava

undone axleBOT
remote swallow
#

ty cafebabe

buoyant viper
#

i like -DIReallyKnowWhatIAmDoingISwear

remote swallow
#

BOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO

#

PAPER HAS MARKDOWN

echo basalt
#

oo

buoyant viper
#

?!!??!

echo basalt
#

you can specify external plugin jars

remote swallow
buoyant viper
#

oh

echo basalt
#

or what plugins folder you want to use

remote swallow
#

mega troll

echo basalt
#

and the world container which is why Bukkit.getWorldContainer is a thing

buoyant viper
#

F

karmic salmon
#

nvm will stay here

remote swallow
#

hes back

#

that was quick

karmic salmon
#

will not leave ;/

#

you guys rude

buoyant viper
#

looks like those r spigot things @echo basalt

#

or well probably CB

echo basalt
#

they are

buoyant viper
#

wtf happens when u run server with --demo enabled ... expandssia

echo basalt
#

Ireallyknowwhatimdoingiswear is the only hidden one

echo basalt
karmic salmon
#

ok i will ask here if all ways of fix error is done like bing ai google and links

echo basalt
#

which is hardcoded to this

buoyant viper
#

u can specify the fucking max player count w program args?!?

echo basalt
#

you can specify an alternative plugins folder

buoyant viper
#

whats --serverId

#

what does that set

echo basalt
#

don't see that anywhere

remote swallow
#

what is jfr

echo basalt
#

server id most likely a 1.19.4 thing

buoyant viper
#

only place its used in nms :v

echo basalt
#

yeah it's most likely a chat report thing then

#

anyways

buoyant viper
#

has an unused setter hmm

echo basalt
#

this mf is uploading other people's plugins on spigo

echo basalt
#

wouldn't make sense tho

buoyant viper
remote swallow
echo basalt
buoyant viper
#

yeah crash reports

remote swallow
#

illusion when he accidentally joins vc

echo basalt
remote swallow
echo basalt
#

I'm down to vc but like

#

there's no point

#

in having a bunch of sweaty nerds at 9am going "yes hello

buoyant viper
#

yes hello latematt here

small holly
#

so uhhhhh this is gonna sound like a strange question

opal juniper
#

no it won’t

small holly
#

I am getting the following error
Caused by: java.lang.NoSuchMethodError: 'dev.selena.items.ItemMapperBuilder dev.selena.items.ItemMapperBuilder.skullSignature(java.lang.String)'
But when I open the jar file with JD GUI its there so its in the jar file

#

I had this issue once before and I don't know how I fixed it lol

chrome beacon
#

Make sure you don't have two of the same plugin in your plugins folder

small holly
#

nope

remote swallow
#

restart the server fully

chrome beacon
#

^

remote swallow
#

most likely 2 instances got loaded

small holly
#

done that

#

restarted everything you could think of

#

including computer

chrome beacon
#

and you decompiled the jar inside the plugins folder?

small holly
#

yep

chrome beacon
#

Could you send the jar

misty current
#

can you disable playerdata from saving?

eternal oxide
#

?paste the method dev.selena.items.ItemMapperBuilder.skullSignature(java.lang.String)

undone axleBOT
chrome beacon
misty current
#

thanks

small holly
#

method is legit just

    public ItemMapperBuilder skullSignature(String signature) {
        this.skullSignature = signature;
        return this;
    }
eternal oxide
#

is that in the same code base as you are calling from?

sullen marlin
#

do you have another plugin with an older version of that class loaded

small holly
#

yes

sullen marlin
#

well thats the problem

round finch
#

PlayerJoin -> mojangreport

#

jokin

small holly
#

oh okay will try that out

eternal oxide
#

have to relocate code if you want different versions

opal juniper
#

need a Player#report

small holly
karmic salmon
#

lol

small holly
#

now I got a new thing to ask about (been about a year since I touched Skull texturing)
Why am I getting this when I try set the texture on GameProfile

[20:11:59 WARN]: java.lang.IllegalArgumentException: Can not set com.mojang.authlib.GameProfile field org.bukkit.craftbukkit.v1_8_R3.inventory.CraftMetaSkull.profile to dev.selena.libs.authlib.GameProfile

Code that yall probably gonna laugh about

    private ItemStack getHead() {
        ItemStack head = new ItemStack(Material.SKULL_ITEM, Amount, (short) 3);

        SkullMeta headMeta = (SkullMeta) head.getItemMeta();
        GameProfile profile = new GameProfile(UUID.randomUUID(), null);

        profile.getProperties().put("textures", new Property("textures", Skull_Texture, Skull_Signature));

        try {
            Field profileField = headMeta.getClass().getDeclaredField("profile");
            profileField.setAccessible(true);
            profileField.set(headMeta, profile);

        } catch (IllegalArgumentException | NoSuchFieldException | SecurityException | IllegalAccessException error) {
            error.printStackTrace();
        }
        head.setItemMeta(headMeta);
        return head;
    }
#

It is saying this line is throwing the error
profileField.set(headMeta, profile);

chrome beacon
#

Wrong game profile

#

You need to set the AuthLib GameProfile not your own

small holly
#

oops

#

accidently shadowed it into the development API

#

okay well progress Im not getting the error but Im also not getting the texture

echo basalt
#

set the name to ""

#

what's what I do

chrome beacon
#

1.8 πŸ’€

remote swallow
#

doubt it likes the name being null, or the signature

small holly
#

Imma double check the texture lol

#

I hate myself

eternal oxide
small holly
#

dw is fixed

#

I did a stupid

#

texture was wrong

eternal oxide
#

ok, just there is a simpler way with post 1.18.2 versions

small holly
#

1.8

eternal oxide
#

oh 😦

small holly
#

ye but its a factions server for some reason and we are using winespigot

#

hardly lol

harsh mirage
#

Is Protocollib support given here?

floral drum
echo basalt
#

ProtocolLib is popular enough that people know how to use it here

echo basalt
#

So if you have any development questions just ask away

echo basalt
#

give him fava jessons

fluid river
harsh mirage
#

Well it's an issue with my plugin. So I'm using ProtocolLib for spawning a few experience orbs in an PlayerMoveEvent. This is the code for it:

@EventHandler
public void onMove(PlayerMoveEvent event){
    ProtocolManager manager = ProtocolLibrary.getProtocolManager();
    Player player = event.getPlayer();
    Location location = player.getLocation();

    PacketContainer packet = manager.createPacket(PacketType.Play.Server.SPAWN_ENTITY_EXPERIENCE_ORB);
    packet.getIntegers().write(0, player.getEntityId());
    packet.getDoubles().
            write(0, location.getX()).
            write(1, location.getY()).
            write(2, location.getZ());

    packet.getShorts().write(0, (short) 10);

    manager.sendServerPacket(player, packet);
}

But I get this whenever I try to write the doubles:
Field index 0 is out of bounds for length 0

#

The integer writes fine, as in it doesn't give any error.

fluid river
harsh mirage
#

1.19.4

fluid river
#

No freejavalessons today

harsh mirage
#

Latest Spigot & ProtocolLib.

echo basalt
#

and I can't stress this enough

#

the wiki.vg impl isn't the nms impl that protocollib wraps

#

and if you look at the nms class

#

from what I remember, just use getEntityTypes.write

fluid river
#

So the packet does not have shorts anymore

harsh mirage
echo basalt
#

something like that

#

just look at the nms packet class, look at the fields

#

that's what protocollib modifies

harsh mirage
#

Where do I find the NMS packet class?

fluid river
#

Yeah just look at sources(bukkit/protocollib) instead of wiki

#

Are nms on ?stash?

chrome beacon
#

No

floral drum
#

yeah there’s no shorts

chrome beacon
#

NMS is copyrighted

floral drum
#

only 2 inta

harsh mirage
#

Where do I find the sources? 😭

floral drum
echo basalt
#

I'm an idiot

floral drum
#

mreow

harsh mirage
#

Oh.

#

So it needs the entity id, the location in X Y Z and the value.

#

But then again, my error would appear when writing the location, not the short.

chrome beacon
#

wiki vg isn't wrong the data is sent as a short

#

It's just saved in an int variable named value

#
  • looking at 1.19.2... waiting for 1.19.4 to build
harsh mirage
#

Now whenever I send the value as a short, my player freezes and I can't do anything but disconnect.

floral drum
#

send an entity id different from the player

#

like 47284

#

for example

#

maybe?

chrome beacon
#

Yeah you want the entity id to be unique

#

Duplicate entity ids could cause problems

harsh mirage
#

It requires the ID of the player, does it not?

#

Oh actually

#

You might be right.

#

Cause setting it the same id as the player makes the player freeze and that.

#

Hmm

#

It works now

#

Ahaha

#

Thank you so much

chrome beacon
#

Listen to the entity metadata packet

#

and remove the enchantments from the armor

#

That will remove the glint for other players

#

It won't remove the glint for the player wearing the armor

echo basalt
#

basically

#

To display armor on an entity

#

an Entity Metadata packet is sent from the server -> client

#

containing the armor data

#

You want to intercept that packet, modify the armor data to contain no enchantments

floral drum
#

packets are quite simple when you get the hang of it <3

echo basalt
#

packets are like objects

#

a box of data labelled with an identifier

#

Except they're basically objects that get sent over a network

#

Here let's make a basic technical example

#

We'll have 2 packets, in theory:

  • SendMessage (uuid, string), which sends a packet indicating a message
  • Kick (uuid), which just kicks
floral drum
#

real king <33

echo basalt
#

Let's say that SendMessage in our protocol has the id of 1

#

and Kick has the id of 2

#

Writing the packet would be something like

#

For sendmessage:
write(1) - packetid
write(uuid) - player id
write(message) - message

For kick
write(2) - packetid
write(uuid) - player id

this is an oversimplification, in reality you'd be writing the characters individually etc

floral drum
#

from what I experience with protocollib, is that it has some issues with performance :D

echo basalt
#

And that is just a byte[]

#

And then the read process would be something like

floral drum
#

I hate protocollib sometimes

wet breach
floral drum
#

fukin’ overhead

echo basalt
#

int id = readbyte

id = 1 -> message packet (read id, read text)
id = 2 -> kick packet (read id)

and then just handle logic

echo basalt
wet breach
#

indeed

echo basalt
#

So yeah that's the basics of packets

#

Now, minecraft has a bunch of pre-defined packets

floral drum
#

if you had a custom client, you could make your own!

wet breach
#

yes but this only works when you have a protocol established, I was merely commenting further on that what he is saying is an over simplification indeed. πŸ™‚

echo basalt
#

That you can play around with

#

um

#

fake entities, fake blocks

#

fake holograms

floral drum
#

fake chunks :D

echo basalt
#

fake chunks are pain

#

done those before tho

floral drum
#

I hate how different chunk packets are in later versions

#

such a pain in the ASS

wet breach
#

most common usage is fake entities. The advantage here is that only the client knows about it and not the server so the server uses less resource, but the exchange for that is forcing the client to use more resources which is alright in most cases

echo basalt
#

somewhat

tough magnet
#

I've been following along with the Spigot Plugin Development guide. I the guide makes you make a main plugin class. However, intellij already gives you a main class. I made another project and completely skipped the make a main plugin class step and just treated main how like main plugin class and it worked. So, why does the guide have you make a main plugin class?

wet breach
#

in the case of MC, this is half true but only because the client dictates the data in some cases where it shouldn't

wet breach
#

if the server was allowed to dictate everything or nearly everything, then server side anti cheats are not a problem πŸ™‚

echo basalt
#

Here's that one time I used protocollib wrappers to create fake entities

#

it was pain

wet breach
#

lag bans are nothing new are still a thing in games today

#

most of the time you just get kicked

echo basalt
#

no ❀️

wet breach
#

no

sullen marlin
#

Player#sendBlockChange

wet breach
#

anything client side is subject to be manipulated by the end user

#

not good if you want to prevent cheating πŸ™‚

#

you can inject whatever you want client side, but if the server was allowed to not trust the data from the client to begin with its a non-issue

#

again client side trusted data

#

its not derived from the server

echo basalt
#

what if minecraft had a better tickrate for handling packets

#

for movement overall

flint coyote
#

better tickrate as in more tps?

#

Would mean all plugins have to run in less time aswell

wet breach
#

why in less time if the tps is increased?

flint coyote
#

Because things run every tick. More ticks = shorter time for execution during each tick

floral drum
#

20tps = 50ms per tick
40tps = 25ms per tick?

flint coyote
#

tps of 20 = 50ms. tps of 40 = 25ms

wet breach
#

and you think your cpu runs that slow?

flint coyote
#

I never said the CPU is slow. I know most operations are done in microseconds. Yet still servers with a lot of entities or a lot of heavy plugins exceed the 50ms per tick. Reducing it would therefore make things worse

wet breach
sullen marlin
flint coyote
#

But entities follow ticks. Therefore if you double the tickrate each entity would get ticked twice as much. If you exceed 50ms for ticking all entities why would it get better with 25ms ticks?

flint coyote
sullen marlin
flint coyote
#

Oh. Yeah that would make sense

echo basalt
#

there should be a way to have a modular spigot thing like

echo basalt
#

what if you just don't want advancements ever?

#

and want to just

#

nuke those checks

#

or just like

#

have a completely lightweight version where hoppers aren't a thing

flint coyote
# wet breach because of scaling

But you can't just partition those entities and tick 50% every odd tick and 50% on the others. That would cause issues with skipped ticks

echo basalt
#

maybe I'm thinking too much about minestom

#

man pinged lukas

#

it's ok he's my homie irl

#

he an addict when it comes to that game but it's whatever

wet breach
flint coyote
#

Certainly. Could be that I misunderstood what you meant by scaling aswell

wet breach
#

you are focused on the overall time length, where as I am talking about not just dealing with seconds but rather smaller time scales. At the smaller levels you have more time. CPU's and code are capable of executing at those higher speeds without issue lol

echo basalt
#

JNI based server when

wet breach
echo basalt
#

C server when

flint coyote
#

But wouldn't time consuming tasks like ticking every entity still be a problem? I mean sure the CPU doesn't care about the interval but looping and ticking all entities will still take time. While server with less entities can have higher ticks (maybe even 5 times as high), servers with a lot of entities must tick slower to not exceed tick times. Right?

wet breach
#

outdated now

#

but already done

echo basalt
#

ASM server whe

#

fuckin

#

dedicated minecraft server hardwhere when

wet breach
echo basalt
#

no OS just pure hardware

ivory sleet
flint coyote
ivory sleet
#

Well it helps also but sometimes does get in the way

flint coyote
ivory sleet
#

Since you inherently don’t require thread safe stuff for memory effects etc

ivory sleet
#

When it comes to the notchian server (and forks like spigot and paper) given that you know stuff about how the server will be used you may be able to optimize through jvm options btw

#

Like quite heavily optimize

flint coyote
#

Is there a guide on that somewhere? Sounds interesting

wet breach
#

there isn't really a guide to use JVM options

#

at least nothing so called modern

ivory sleet
#

A good start is to look at zgc and g1gc, the two gcs you probably wanna pick between, then I think aikar has a good set of jvm flags, but ye as frostalf said

wet breach
#

I have explained about the JVM memory a bit before

ivory sleet
#

Like there are so many flags

wet breach
#

and that how your code is structured affects some things with it

ivory sleet
#

And just so many of them are documented sadly

wet breach
#

and there is a JVM flag to increase some things in regards to that

#

for instance, if your Object goes over a certain size, it doesn't go into heap space

#

I mean, it doesn't go in the stack space

#

it actually goes over that and lands randomly somewhere in heap

#

thus making it slower to lookup all its data

#

conversely the same happens when you make too many objects

#

I recommend learning more about the JVM and how it works πŸ™‚

#

but as Conclure said there is a lot that just simply isn't documented at least not in a way that is easily accessible

harsh mirage
#
@EventHandler
public void onMove(PlayerMoveEvent event){
    ProtocolManager manager = ProtocolLibrary.getProtocolManager();
    Player player = event.getPlayer();
    Location location = player.getLocation();

    PacketContainer packet = manager.createPacket(PacketType.Play.Server.WORLD_PARTICLES);

    packet.getModifier().writeDefaults();
    packet.getParticles().write(0, EnumWrappers.Particle.EXPLOSION_NORMAL);
    packet.getDoubles().
            write(0, location.getX()).
            write(1, location.getY() + 1).
            write(2, location.getZ());
    packet.getIntegers().write(0, 1);

    manager.sendServerPacket(player, packet);
}

Why does every particle look the same? EXPLOSION_NORMAL looks like a black something particle. If I change it to HEART for example, it looks the same.

chrome beacon
#

Use the API for particles

#

There's no need for Protocollib

ivory sleet
#

Alos Fabsi, on a programming level you may also be able to optimize certain stuff by adhering to certain paradigms like data oriented design

#

(Not to be confused with Data Oriented Programming)

flint coyote
ivory sleet
#

Yea indeed

flint coyote
#

that's why I asked if there's a "performance guide"

ivory sleet
#

Yeah there is, but not an objective one, and I don’t think tps change would help

#

True

flint coyote
#

how do you see that?

chrome beacon
#

Spark

flint coyote
#

I only know the sparkjava web framework

ivory sleet
#

You also have JFR, and the debugger

flint coyote
wet breach
flint coyote
#

Is Timings also a Plugin or is that included in spigot?

flint coyote
wet breach
flint coyote
#

Well I guess I could find issues with my own code quite easily since I'm usually aware what slow workaround that should be fixed I'm producing while I'm coding. I'm more concerned about foreign plugins performance

#

Therefore just improving it would be fine

wet breach
# flint coyote Well I guess I could find issues with my own code quite easily since I'm usually...

yes, but as I said, what I was talking about is not something you can discern from just looking at your code. You have to observe it happening from the memory side where you notice objects going into general heap space when they shouldn't be. If this happens it causes your code to run slower when those objects that exist outside of normal memory areas because of size limits need to be fetched/looked up. There is plenty of other things in the JVM that have quirks or hidden ways they work that if you learn about them can help improve your stuff πŸ™‚

young knoll
#

Timings is included in spigot

#

Paper has timings v2, but it’s marked for removal

floral drum
#

mreow

smoky anchor
#

Hi all!
If I were to access a chunk using Location.getChunk() every tick (using a repeating task for example) will it ever unload (fire the ChunkUnloadEvent) ?

#

From my limited testing, the answer is no.

eternal oxide
#

if you want to keep it loaded add a Plugin Ticket

smoky anchor
#

I want the exact opposite, I want it to unload, but I think accessing it every tick keeps it loaded.
But I am not sure if this is correct.

eternal oxide
#

why do you want it to unload AND access it every tick?

smoky anchor
#

I don't want to access it if it is unloaded

sullen marlin
#

Yeah that would be very laggy

#

World#isLoaded or whatever

smoky anchor
#

But the chunk never gets unloaded if I keep calling getChunk()
I think

sullen marlin
#

?jd-s

undone axleBOT
eternal oxide
#

Won't use the chunk so won't keep it loaded

smoky anchor
#

Alright I'll try using this ty

quaint mantle
#

how can i turn my plugin into a dependency<

floral drum
#

huh

quaint mantle
#

how

#

i need a explanation for someone with 10iq

#

thx

harsh mirage
#
private void sendSoundToPlayer(Player player, Sound sound){
    Location playerLocation = player.getLocation();

    PacketContainer packet = manager.createPacket(PacketType.Play.Server.NAMED_SOUND_EFFECT);
    packet.getSoundEffects().write(0, sound);
    packet.getSoundCategories().write(0, EnumWrappers.SoundCategory.MASTER);
    packet.getIntegers().
            write(0, playerLocation.getBlockX()).
            write(1, playerLocation.getBlockY()).
            write(2, playerLocation.getBlockZ());

    packet.getFloat().
            write(0, 1.f).
            write(1, 1.f);

    manager.sendServerPacket(player, packet);
}

Why does this not work? There is no sound whenever I call that function.

remote swallow
#

why are you using packets for sound

#

player#playSound

harsh mirage
#

Cause I'm experimenting with ProtocolLib.

#

I want to understand it.

echo basalt
#

ProtocolLib is fairly simple

#

look at the nms impl

#

and just

#

use wrappers

harsh mirage
#

What's the implementation for NAMED_SOUND_EFFECT?

echo basalt
#

if you have 3 int fields on the nms class then you just write thsoe 3 ints

echo basalt
#

without an IDE you just

harsh mirage
#

Well yeah but what's it called?

echo basalt
echo basalt
#

select whatever version

harsh mirage
#

?

echo basalt
#

and just type Clientbound and end up somewhere

#

that should be the one

harsh mirage
#

How do I write to the Holder field for example?

#
private final Holder
echo basalt
#

uhh

#

let's see

#

in paper mappings it just seems like it's a ResourceLocation aka namespaced key

#

but that seems to have changed in 1.19

harsh mirage
#

Yeah well it requires a holder.

#

Which I'm not sure how to write to.

young knoll
#

Holders are just a container for registry objects

echo basalt
#

maybe packet.getMinecraftKeys.writeWhatever

#

never seen holders before honestly

#

but then again I haven't played with 1.19

chrome beacon
#

before using packets

harsh mirage
#

I've just said that I'm trying to do it with ProtocolLib so I understand how it works.

young knoll
#

I never use protocollib for sending packets

#

It’s very

#

Odd

harsh mirage
#

Is the SoundSource supposed to be the sound category?

#

Like master, ambient etc?

smoky anchor
young knoll
#

Just don’t access it if it isn’t loaded?

smoky anchor
#

But it is loaded

#

I can't know that it will unload

floral drum
#

world.isChunkLoaded

smoky anchor
#

wouldn't that return true if I am using world.getLoadedChunks() ?

chrome beacon
#

It would

#

Do you just want to keep the chunk loaded?

#

If so add a chunk ticket

young knoll
#

If you are using that why do you ever need to call getChunk

#

You already have the chunk

smoky anchor
smoky anchor
young knoll
#

Well to get a chunk object the chunk has to be loaded

#

So

chrome beacon
#

Why do you want to load the chunk for a single tick?

smoky anchor
#

I want to use the chunk when it is loaded

#

I want the game to load/unload the chunks when they should

chrome beacon
#

Then just access the chunks in the loop

eternal oxide
#

if (world.isChunkLoaded(x,z)) { world.getChunk(x,z)...

#

no access of chunk unless it's loaded

smoky anchor
#

But I am iterating over all loaded chunks
world.getLoadedChunks()
So I doubt that would work

eternal oxide
#

if you are iterating all loaded chunks then they are loaded. chunks do not instantly unload

#

you have to leave them alone without players near for them to unload

young knoll
#

Don’t call getChunk

#

You already have a chunk instance

eternal oxide
#

?stash

undone axleBOT
smoky anchor
#

Guys, I understand I have the chunk
I pass the Location in my code, what I sent is an example
I just don't want Location.getChunk() to keep the chunk loaded till the next tick

eternal oxide
#

then don;t use it

chrome beacon
#

You don't need to call getChunk in the first place

floral drum
#

The thing is - why do you "need" to use "Location#getChunk"?

eternal oxide
#

you already have all loaded chunks you are iterating

#

calling Location.getChunk is pointless

remote swallow
#
  • the location you get would be the wrong chunk anyway
smoky anchor
remote swallow
#

oh wait you do times it by 16

floral drum
#

microoptimization

fallen pecan
#

Hi does anyone know how to add a pet menu with the McPets plugin?

smoky anchor
young knoll
#

Only the compiler can answer that :p

eternal oxide
#

you are literally getting the chunk, creating a Location from that chunk, then calling location.getChunk

smoky anchor
#

Alright, so what I gathered is that I can not stop the chunks being loaded till the next tick when using the location.getChunk()
I just have to work around it, thank you all

floral drum
#

..

smoky anchor
young knoll
#

Then pass both

remote swallow
floral drum
#

πŸ’€

eternal oxide
#

In teh code you posted you are iterating all loaded chunks

floral drum
#

man used my ss

chrome beacon
remote swallow
young knoll
#

I can’t imagine telling every loaded chunk to unload is a good idea

smoky anchor
eternal oxide
#

YOUR code, iterates every chunk, creates a location from that chunk, then calls getChunk. Completely pointless

floral drum
smoky anchor
young knoll
#

I mean I imagine the server is smart enough to not unload it if a player is loading it

#

… maybe

chrome beacon
#

Why does it matter if it's loaded for a single tick more

remote swallow
#

my poor 50ms on startup

young knoll
#

Because they run it every tick

eternal oxide
#

he's iterating every tick so hes keepign all chunks loaded

young knoll
#

New optimization

#

If you never unload chunks mc never has to load them

remote swallow
sullen canyon
#

πŸ€—πŸ€—πŸ€—πŸ€—πŸ™πŸ™πŸ™

floral drum
#

gotta LOVE that purple circle on coll's message

remote swallow
#

best use of a super reaction

floral drum
#

LMAO

young knoll
#

Hell yeah

floral drum
#

valorant an AMAZING game

remote swallow
#

no

floral drum
#

I agree ebic

young knoll
#

To be fair the best use of a super reaction is to throw it in the bin

round finch
#

super reaction bin lets go

young knoll
#

I thought super reactions were going to be cool unique reactions

floral drum
#

lets dump super reactions on my message because cool

young knoll
#

Like brand new ones

#

But no they are just normal emojis with dumb animations

#

(That don’t even animate on my mobile app)

floral drum
#

so stupid how you get a limited amount of em

#

so cringe

#

"5 per week"

floral drum
#

lmao

tardy delta
#

how dare you

young knoll
#

What message

#

Y’all are trippin

river oracle
#

You're tripping

keen ferry
#

How do I listen for server-side stuff that isn't triggered/spawned by the player? (block changes, particle spawned, mob spawned...)
For example: Block changes. How do I capture all server-side block changes, no matter if they are triggered by plugins, by players, or something else?

tardy delta
#

events

keen ferry
# tardy delta events

BlockPlaceEvent doesn't capture block changes made from other plugins, only those that are placed by players.

ivory sleet
river oracle
#

Only do this if your plugin is private

keen ferry
#

:( yeah this won't work for me, plugin is made for public use

river oracle
#

Then there is no way

keen ferry
#

understandable, thank you

young knoll
#

I wish we had just a catch all event for when a block becomes air

#

Or when air becomes block

river oracle
#

AirGetBlockEvent

floral drum
#

registering an objective

remote swallow
floral drum
remote swallow
#

why fuckin not

#

i took a ss of something else and it had that init

floral drum
#

nerd

remote swallow
#

shut

floral drum
#

love you too son <3

river oracle
#

Initn

remote swallow
#

my spacebar isnt the best

river oracle
#

Init mate

remote swallow
#

innit bruv

#

ill chef you up fam

river oracle
#

Chef

floral drum
#

bruh

river oracle
#

πŸ‘¨β€πŸ³

remote swallow
#

you wanna scrap

river oracle
#

Scrap

#

I love this monkey

#

Dk dk

remote swallow
#

donkey skong

#

djungleskog

grave kayak
#

hey i'm having trouble with the spawnNPCForDefaultPlayer section, I am getting the debug message "failed to wrap player" any assistance would be much appreciated https://pastebin.com/U2yQBgVx

weak bear
#

Hello how to make a tablist on 1.12.2 pls

eternal oxide
grave kayak
eternal oxide
#

Thats all the code you provided.

past vapor
#

Hey I'm using this with Potion Meta to set the potion color to its default type but as you can see the potion type is not showing as the correct color

#

Server version 1.19.4
Client version 1.19.2

strange rain
past vapor
#

Thanks πŸ™‚

rough drift
#

--gemerate-source puts these in the maven repo, where do I get the output source jar

eternal oxide
#

I hope typo --gemerate-source

rough drift
#

it is --generate-source

undone axleBOT
rough drift
#

I am not going to lie

#

that looks better than what I've been working on so far

rough drift
eternal oxide
#

pretty sure --generate-source doesn't create the sources jars. It only creates the files/folders

#

I've never had either actually create a jar though

worldly ingot
#

They both create .jar files

#

You probably weren't looking in the right place

#

They'll be under Bukkit/target and CraftBukkit/target

eternal oxide
#

probably not

#

actually, there is no target folder under Bukkit nor CraftBukkit

#

spigot-api and spigot-server have target folders only

worldly ingot
#

Then you haven't run BuildTools yet

#

There's no way at all there isn't a target folder lol

eternal oxide
#

I just did clan run

#

clean*

#

there are target folders, but only in Spigot-API and Spigot-Server

sullen wharf
#

❀️

worldly ingot
#

You should be looking at the Bukkit/CraftBukkit dirs in the root

eternal oxide
#

nope BT

#

In there is CB and Bukkit

#

no target folders in either of those

worldly ingot
remote swallow
#

no file extensions?

#

windows 11?

eternal oxide
#

in Spigot there is Spigot-API and Spigot-Server, both of which have target folder

quaint mantle
#

yo

#

how do we use the 1.7 api

#

is there a spigot 1.7 api

#

or bukkit

#

only

young knoll
#

Yes but not officially

quaint mantle
#

how do i use it

remote swallow
#

carefully

quaint mantle
#

?

#

its not in this repo

young knoll
#

Correct

young knoll
#

Anything pre 1.8 has been removed due to the DMCA

#

So you won’t find it on any official sites

quaint mantle
#

how did it get dmca

young knoll
#

You can use some sketchy reupload or you can stop trying to use an 8 year old api version

hazy parrot
#

?dmca

undone axleBOT
quaint mantle
#

here could i find a reupload

remote swallow
#

just found a 1.4.6 spigot

quaint mantle
#

can u find me a 1.7

remote swallow
#

i found it already

young knoll
#

We ain’t going to provide you with 3rd party reuploads

quaint mantle
remote swallow
#

nope

quaint mantle
#

?

#

ok

eternal oxide
#

Found my archive. No I'll not send you any

quaint mantle
#

why

#

ur guys are such robots

eternal oxide
#

Its illegal to distribute

subtle folio
#

gpl3 when

agile anvil
#

We ran 1.0.1 with a spigot mate on here

#

Very...

#

Empty

young knoll
#

They aren’t officially available anymore for a reason

#

Idk why you’d ever want to use an 8 year old api anyway

eternal oxide
#

I remember it was annoying at the best of times

#

constantly trying to find a way to work around issues

quaint mantle
#

...

#

why does that matter

remote swallow
#

but why in an 8 yr old api

eternal oxide
#

I can see someone wanting to make a mod for 1.7 but a plugin? Seriously?

remote swallow
#

that has a percentage of the features we have now

young knoll
#

It’s also filled with bugs and exploits

#

The only reason it isn’t vulnerable to the log4j exploit is because minecraft hadn’t even started using log4j yet πŸ€“

rough drift
#

--generate-source only generates the api sources from what I see

tardy delta
#

ike in the house

rough drift
#

what

tardy delta
#

responding to all possible reactions

rough drift
#

yes

rare rover
#

is there a way to store an entity with armor and stuff without spawning it?

young knoll
#

Sadly no

#

Not with the api

rare rover
#

😦

#

okay

young knoll
#

I guess you could be janky and store it using a structure

rare rover
young knoll
#

But other than that the API does not have the concept of virtual entities

rare rover
#

and it would be way easier to just construct the entity then store it aka private final Entity entity;

dense falcon
#
                    ItemCustom vanish = new ItemCustom("Β§lΒ§9Vanish", Material.IRON_HOE, 1, true);
                    vanish.addKey(plugin, "vanish");

Why I have to use my func here but not in my constructor directly ? https://sourceb.in/iwat0aFfZb

To add the NamespacedKey I mean.

ivory sleet
#

which is ur function?

remote swallow
dense falcon
dense falcon
remote swallow
#

you have a param you dont use

#

may want to use it

dense falcon
#

It does not matter, it's with vanish and it's the same thing.

#

I will fix it btw :>.

ivory sleet
thick oracle
#

Hey!

I'm currently having some issues with setting a spectator target.

Basically, what I'm doing is teleport the player to the target and then set the spectator target. The target doesn't move at all, yet as soon as I set the spectator target, the camera seems to always do a 180 degree turn. Does anybody know what could cause this or how to prevent it?

(The teleport as well as the delayed task are to help with larger distances.)

Spigot 1.19.3 / Java 17.0.3

public void setSpectate(Player target) {
  player.setGameMode(GameMode.SPECTATOR);

  PotionEffect blindness = PotionEffectType.BLINDNESS.createEffect(30, 9);
  PotionEffect slowness = PotionEffectType.SLOW.createEffect(30, 0);
  player.addPotionEffects(Arrays.asList(blindness, slowness));

  player.hidePlayer(plugin, target);
  player.teleport(target.getLocation());

  Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, () -> {
    player.showPlayer(plugin, target);
    player.setSpectatorTarget(target);
  }, 10);
}
ivory sleet
#

u can view a constructor as a function that just runs when creating an instance of the class with new

dense falcon
remote swallow
ivory sleet
dense falcon
#

Nvm I guess it was a bug...

#

It works now.

ivory sleet
#

yea

dense falcon
#

Thanks guys :).

ivory sleet
#

sometimes u just gotta recompile everything (:

dense falcon
#
    @EventHandler
    public void onJoin(PlayerJoinEvent event) {
        Player player = event.getPlayer();
        FileConfiguration config = plugin.getConfig();
        config.set("modt." + player.getUniqueId() + ".enabled", "off");
        config.set("modt." + player.getUniqueId() + ".vanish", "off");
    }

    @EventHandler
    public void onLeave(PlayerQuitEvent event) {
        Player player = event.getPlayer();
        FileConfiguration config = plugin.getConfig();
        if (config.getString("modt." + player.getUniqueId() + ".enabled").equals("on")) {
            player.getInventory().clear();
            config.set("modt." + player.getUniqueId() + ".enabled", "off");
            config.set("modt." + player.getUniqueId() + ".vanish", "off");
        }
    }

Second problem :(, it does not change in my config.yml :

modt:
  b6fe2775-5c19-404e-9df3-3c08a237c168:
    enabled: 'on'
    vanish: 'off'
ivory sleet
#

obviously

#

you never save ur config object on the server to ur config file on disk

#

like FileConfiguration is basically a hashmap and it does not write its content to the config.yml automatically

#

u need to useplugin.saveConfig() iirc

tranquil prairie
#

?paste