#help-development

1 messages · Page 826 of 1

smoky oak
lost matrix
rotund ravine
#

IJ is being nice

smoky oak
#

whats the maven settings to install something to .m2 inclusive javadocs? just 'install'?

smoky oak
#

ah i meant my own stuff lol

#

in the arg list / configuration

chrome beacon
#

I thought you were still trying to get the spigot javadoc jar working

smoky oak
#

ive given up on that one

#

im using 1.20.1 now

#

i think

#

i dont actually remember

chrome beacon
#

if you have that then install might do it 🤷‍♂️

smoky oak
#

hm

#

would <goal> jar </goal> work u think?

#

defuq

#

it generates a @param for <T>, but its not showing up in the javadoc

#

the other params are

native bramble
#
ModifierTier modifierTier = unbreakingModifier.getTier();
modifierTier.decrementTierParameter();
unbreakingModifier.setTier(modifierTier);```
native bramble
#

this is custom classes

#

not api

lost matrix
native bramble
#

and they output equal values

lost matrix
#

Show the code you used for testing

native bramble
#
@EventHandler
    public void onItemDamage(PlayerItemDamageEvent e){
        ItemStack itemStack = e.getItem();
        if(!hasItemModifier(itemStack, Modifiers.UNBREAKING)) return;
        AbstractModifier unbreakingModifier = AbstractModifier.modifierFromItem(itemStack, Modifiers.UNBREAKING);
        if(unbreakingModifier.getTier().getCurrentTierParameter() == 0) return;
        e.setCancelled(true);

        System.out.println(unbreakingModifier.getTier().getCurrentTierParameter());
        ModifierTier modifierTier = unbreakingModifier.getTier();
        System.out.println(modifierTier.getCurrentTierParameter());
        modifierTier.decrementTierParameter();
        System.out.println(modifierTier.getCurrentTierParameter());
        unbreakingModifier.setTier(modifierTier);
        System.out.println(unbreakingModifier.getTier().getCurrentTierParameter());

        createItemWithModifier(itemStack, unbreakingModifier);
    }```
lost matrix
#

Could you comment the output after your sysouts?

native bramble
#

wym?

lost matrix
#
        ModifierTier modifierTier = unbreakingModifier.getTier();
        System.out.println(modifierTier.getCurrentTierParameter()); // 1
quaint mantle
#

show the output

native bramble
#

oh

#

wait

#

u about this?

lost matrix
# native bramble [15:21:09 INFO]: 50 [15:21:09 INFO]: 50 [15:21:09 INFO]: 50 [15:21:09 INFO]: 50

If your output is

        ModifierTier modifierTier = unbreakingModifier.getTier();
        System.out.println(modifierTier.getCurrentTierParameter()); // 50
        modifierTier.decrementTierParameter();
        System.out.println(modifierTier.getCurrentTierParameter()); // 50

While ModifierTier#decrementTierParameter() is

    public void decrementTierParameter(){
        this.currentTierParameter--;
    }

then you are not using the code you've sent us. (Or your jvm is broken)

native bramble
#

wtf

#

not using the code?

#

i will check

#

okay

#

i dont uderstand how

#

but i check in the method

public void decrementTierParameter(){
        System.out.println(this.currentTierParameter);
        this.currentTierParameter--;
        System.out.println(this.currentTierParameter);
    }```
quaint mantle
#

Also, why do hell you want tiers for unbreakable flag?

native bramble
#

and its working in this method

desert loom
#

I believe it's because this.currentTierParameter is refering to a different object than the one returned by getCurrentTierParameter

#

make getCurrentTierParameter return your field instead and It might work as you intend

lost matrix
#

oh god...

remote swallow
#

what in the fook

native bramble
#

ohhh

#

really

lost matrix
#

I thought you had a simple getter for the field

native bramble
#

sry\

#

at start of writing this class i dont have this variable

smoky oak
proud badge
#

?tas

undone axleBOT
lost matrix
proud badge
#

was trying to get the link

#

To the video

smoky oak
#

ah

#

i didnt click that cuz its light mode

native bramble
#

thank u guys

#

now working

smoky oak
#

I want to store a bunch of booleans in a PDC. Which of those options is better:

  1. converting the booleans into an int/long
  2. making a boolean array PDC type that does it for me
eternal night
#

second

#

that way your PDC type can hide the implementation

smoky oak
#

its the same thing, just in the PDC type then?

eternal night
#

Yea

#

have that thing to take care of how you mystically store them

smoky oak
#

aka 'add powers of 2'

#

ive a list of those up to 2 bil

#

iirc adding and bit & takes 1 operation each, so it should be faster than bit shifting it by 0<n<32

warm mica
#

You can use EnumSet, that's internally just a bitmap

smoky oak
#

ye but can u store that in a PDC

warm mica
#

Oh, no idea

#

Alternatively you can use BitSet, which you can convert to byte arrays and vice versa, which is a nice wrapper for setting the bits

#

And for the position use enum#ordinal()

smoky oak
#

ordinal changes if the implementation does

#

im not gonna use that

#

hm issue, I cant seem to get the EnumSet class i need for a custom PDC type

#

the issue being that i cannot just use EnumSet because this only works with a very specific Enum

eternal night
#

you gotta do some ugly casting

smoky oak
#

i... cant figure out how

#

the autocomplete aint helping

#

i only need it for the complext type method thingy too :/

eternal night
#

I think you do

(Class<EnumSet<Type>>) (Object) EnumSet.class
#

or something along thje lines

smoky oak
#

k ill try that

#

btw

#

is the PDAC important or can i ignore it?

eternal night
#

you don't need to use it

#

no

#

its there to create new data containers

#

if your data type serialises to a nested PDC

smoky oak
#

ah no i dont

#

its enum <-> int

#

cuz an enum basically is just a boolean

#

i just want to do it in a way that doenst break when i add a new value to the enum

eternal night
#

that would be a long[] then

smoky oak
#

i mean

#

it wont have that many entries

#

the reason im using int is to keep the actual PDC entry short

#

i want to keep it readable when readout using /data get

#

31 values should be enough

#

uh

#

how do i create an empty enumSet

young knoll
#

iirc it's EnumSet.noneOf

smoky oak
#

ye that did it

slate tinsel
#

Is there no 1.20?

#

like 1.19 for 1.19

young knoll
#

No

#

It was fully replaced with .1

slate tinsel
#

Okey

young knoll
#

Pretty sure .3 was also fully replaced

smoky oak
#

why can't i use this here? It doesnt work with new, nor with adding the <int, enumset>

remote swallow
#

it needs to be an instance iirc

smoky oak
#

instance?

#

wha

remote swallow
#

an instance of the pdc type

smoky oak
#

why does new now work

#

wtf

remote swallow
#

the data type interface uses all instances

smoky oak
#

hm

young knoll
#

I just make mine singletons

remote swallow
#

josh

#

does stash have dark mode

smoky oak
#

I'd rather not have a singletron with a conversion method this size

rapid trout
#

Hello i am trying to change the yaw and pitch of a player. The problem is that the player is teleported on the center of a block when the pitch and yaw is modified. Is there a way to modify pitch and yaw without change the player's position ?

smoky oak
#

it shouldnt move the player

#

code pls

#

?paste

undone axleBOT
warm mica
smoky oak
#

wat

#

wait i dont care

#

the implmentation wont change while the code is running

#

if it does not my problem

rapid trout
# smoky oak code pls
float pitch = (float) (p.getLocation().getPitch() + (Math.random() - 0.5) * inaccuracyAmount);
        float yaw = (float) (p.getLocation().getYaw() + (Math.random() - 0.5) * inaccuracyAmount);

        Location l = p.getLocation();
        l.setYaw(yaw);
        l.setPitch(pitch);
        p.teleport(l);
warm mica
deep herald
#

anyone know how to install 1.20.2 nms?

young knoll
#

?nms

smoky oak
#

everythign is jeff here aint it

remote swallow
#

yup

smoky oak
#

i got the PDC explanation from one of his posts too

deep herald
smoky oak
#

its him, md and choco

#

thats it

#

thats the entire forum

remote swallow
deep herald
#

in the intellij terminal?

remote swallow
#

id recommened in a different folder

deep herald
#

wdym

remote swallow
#

run it in a clean folder in downloads for example

#

with cmd or git bash

deep herald
#

java -jar BuildTools.jar --rev 1.20.2 --remapped
i did that

remote swallow
#

you need to downloads buildtools first

undone axleBOT
deep herald
#

where do i put the .jar

remote swallow
#

id recommened a new folder inside downloads and run it there

deep herald
#

i put it in my idea projects

remote swallow
#

i would avoid against doing it inside your project as it will contain all of bukkit, craftbukkit and spigot and probably all of mc source and you dont want to put that on git

deep herald
#

all mb

kindred sentinel
#

I have 2 questions, the first is how does EulerAngle work? If I try to rotate the head of the armor stand using

armorStand.setHeadPose(new EulerAngle(0,1,0));

The head of the armor stand turns to 57.29578f, and the second question is, how to know in which direction the player is facing? It's hard for me to figure out how to use player.getLocation().getDirection() to find out which direction of the world (north/south/west/east) a player is facing

deep herald
remote swallow
#

should be

#

reload maven

deep herald
#

thats not in my project

#

btw

remote swallow
#

thats fine

#

its added to your maven local

deep herald
#

do i make the scope as system?

remote swallow
#

leave scope as provided

deep herald
#

ok

remote swallow
#

yep thats correct

deep herald
remote swallow
#

correct as well

deep herald
#

then why is that erroring

remote swallow
#

reload maven

deep herald
#

wait wtf?

remote swallow
#

is that from reloading maven

deep herald
#

yes

wary harness
#

question if I compile plugin and target java 17

```<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.11.0</version> <!-- Use the latest version available -->
            <configuration>
                <source>17</source>
                <target>17</target>
            </configuration>
        </plugin>
    </plugins>
</build>```
#

will that plugin be able to run on 1.8

remote swallow
undone axleBOT
wary harness
#

servers

deep herald
#

no

remote swallow
deep herald
#

thats java 8 only

wary harness
#

nothig above

deep herald
#

?paste

undone axleBOT
remote swallow
#

java 11 works but not everyone will be running it

wary harness
#

ok I see

#

I am having weird problem

remote swallow
#

if anything i recommened not having all updats for like 1.18+ and having an old download ver that has the main features

kindred sentinel
#

how does EulerAngle work? If I try to rotate the head of the armor stand using
armorStand.setHeadPose(new EulerAngle(0,1,0));
The head of the armor stand turns to 57.29578f

deep herald
wary harness
#

I complile jar with dependancies on Scope- compiled
and they are not addded to jar

deep herald
#

if u wanna see

wary harness
#

so I was thinking maybe problem is in java

remote swallow
deep herald
#

oh

wary harness
remote swallow
#

nope, add shade plugin

wary harness
#

ok

#

I am in rabbit hole a bit

deep herald
remote swallow
#

check the jar exists at C:\Users\USER\.m2\repository\org\spigotmc\spigot\1.20.2-R0.1-SNAPSHOT should be called spigot-1.20-2.R0.1-SNAPSHOT-remapped-mojang.jar

wary harness
#

one more

#

I am running multi modular configuration

#

can shade plugin be in ProxyManagerModule

#

and dependancies listed as scope compiled in Bungee and Veleociy module

#

or that will not work

remote swallow
#

if it all compiles to 1 jar it should™️ work

wary harness
#

well I got weird problem

#

like from some reason when I do it that way Transitive dependancies are added to my uber jar

remote swallow
#

same command as before

remote swallow
wary harness
#

and nothig depends on ProxyManager

smoky oak
#

alright time for my god complex to be replaced by imposter syndrome cuz im about to test my code
wish me luck

kindred sentinel
remote swallow
#

get eye direction and do math

kindred sentinel
#

i'm too stupid..

remote swallow
#

well you get Player#getEyeLocation().getDirection() check what its facing is

#

you just figure out which segment its in, 4 or 8 depending on how accurate you want

smoky oak
#

dont think you need to

#

just grab the pitch and be like if(<45°) elif(<135°) elif... adjusted for the 2Pi thing

inner mulch
#

is it possible to apply a potion effect to a player that the player cannot see in the top right?

smoky oak
#

well

#

if the particles are invisible so is the symbol in the top right

#

the thign in the inventory you cant get rid of

#

using the api at least

inner mulch
#

so i could get rid of it without modding ?

smoky oak
#

again, if you make the particles invisible

#

its an arg in the effect while creating it

remote swallow
#

i thought the icon still showed for that

inner mulch
#

so no particle = no icon?

remote swallow
#

oh there is an icon param

kindred sentinel
inner mulch
#

thats pretty cool

remote swallow
inner mulch
#

thanks

smoky oak
kindred sentinel
#

oh.. A vector, yeah

smoky oak
#

also if you have a vector

#

you can just flatten the y part of it and check which values larger than the other

remote swallow
#

yeah you dont really need a y for this

smoky oak
#

ye just grab the vectors x and z and compare em

#

i believe the vectors are normalized so whichever vector has the larger absolute value gives you if it's north/south or east/west, and if the larger absolute value is positive/negative gives you which of those it is

remote swallow
#

idk if they're normalized on get, might be best to nromalize anyway

smoky oak
#

i know thats not actually related but its much easier to see on normalized vectors

#

not required, its just easier to visualize in ur mind

remote swallow
#

normalizing will remove some accuracy but i dont that might accuracy would be needed formost stuff

kindred sentinel
#

i made something like this

#

double x = player.getLocation().getDirection().getX();
double z = player.getLocation().getDirection().getZ();

                if (Math.abs(x) > Math.abs(z)) {
                    if (x > 0) {
                        player.sendMessage("West");
                    } else {
                        player.sendMessage("East");
                    }
                } else {
                    if (z > 0) {
                        player.sendMessage("South");
                    } else {
                        player.sendMessage("North");
                    }
                }
remote swallow
#

?tas also i mean i would normalize the vector but sure

undone axleBOT
north nova
#

why not use player.getEyeLocation()

#

to do that

remote swallow
#

oh you should also use getEyeLocation().getDirection

#

didnt see that part

north nova
#

or u can use the yaw

#

of eyelocation

zealous scroll
#

If multiple potion effects are supported, is there a proper way of removing a potion effect of a given type without removing all effects of that type?

kindred sentinel
#

How to create inventory?

#

like without any block

hazy parrot
#

Bukkit.createInventory

kindred sentinel
#

Thanks

scenic onyx
#

?paste

undone axleBOT
scenic onyx
quaint mantle
#
        if (event instanceof EntityDamageByEntityEvent == false) {

        }
``` does this look good or bad compared to the (!(instanceof))
scenic onyx
lost matrix
quaint mantle
#

k

#

lol

#

I just saw someone on stackoverflow say that

#

You're writing too much chars

lost matrix
scenic onyx
lost matrix
scenic onyx
quaint mantle
#
if(!(e instanceof EntityDamageByEntityEvent)){/*logic*/}
lost matrix
scenic onyx
remote swallow
#

what in the

icy beacon
#

??

remote swallow
#

why do you run install, compile and clean package and package

icy beacon
#

all you need is mvn clean package

remote swallow
#

you dont even really need that

scenic onyx
icy beacon
#

but i use mvn clean package

remote swallow
#

just mvn package, only clean when needed

icy beacon
#

yep

scenic onyx
quaint mantle
#

Did you added hikari to deps?

lost matrix
scenic onyx
#

ah

quaint mantle
#

Do your project has multi modules?

scenic onyx
lost matrix
#

When you run any maven goal, then it gets thrown right into your face...

quaint mantle
#

Thats problem

#

is this a good or bad way to seperate two events

scenic onyx
undone axleBOT
scenic onyx
#

this is the log

lost matrix
quaint mantle
#

so like

#

if I wanted to add logic of an entitydamageevent, and I also want to add logic for entitydamagebyentityevent

remote swallow
quaint mantle
quaint mantle
scenic onyx
lost matrix
lost matrix
keen ferry
#

What mappings are usually used nowadays? Mojang or spigot?

icy beacon
#

Mojang is more convenient

lost matrix
#

Spigot mappings got dropped

keen ferry
#

oh they did?

remote swallow
#

spigot internals still use obsfucated/spigot but most people use mojang now

keen ferry
#

got it, thanks

eternal oxide
#

?nms

kindred sentinel
#

If I created an inventory and made it open when I click on a block, then when I reload the server, the inventory will disappear, right? Then I need to store it in the PersistentDataContainer?

remote swallow
#

you shouldnt ever be reloading production servers, ideally not even dev servers so you shouldnt need to keep track of that

eternal oxide
#

if you want to preserve changes you need to store it somewhere

remote swallow
#

also i dont think invs have pdc

eternal oxide
#

if it's always the same, don't

kindred sentinel
eternal oxide
#

depends on the block

#

only a TileState will have a PDC

kindred sentinel
#

dependency

kindred sentinel
lost matrix
remote swallow
#

you schedule a restart

#

class it as maintenance

keen ferry
remote swallow
#

if anything the data should be stored across restarts

scenic onyx
#

@lost matrix tnx

clear elm
#

whats good youtuber to learn java?

lost matrix
keen ferry
#

I looked it up online and apparently I had to use NMS? How can I set an entity's path and pathfinding otherwise?

lost matrix
#

You cant set anything like that with packets.
Packets are used to notify a client that something on the server has changed.
Like the position of an entity.
AI runs entirely on the server and the client has no idea about what an entity is thinking.
So extening an NMS class and then actually spawning the entity in a world is the way to go for custom AI.

floral drum
#

I hate ClientboundBlockChangeAckPacket

#

or whatever it's called

#

that shit screwed me over for a week

remote swallow
#

the change ack packet!:!??!

floral drum
#

mhm

#

whatever

#

"ClientboundBlockChangedAckPacket"

#

that fucker

#

why tf did mojang decide to create that packet...

keen ferry
umbral ridge
#

I think if everything was properly coded, packets and other bullshit wouldn't even exist

#

mojang 😣

young knoll
#

Yeah the client would just use magic to sync with the server

umbral ridge
#

What is syncing between the client and the server?

lost matrix
remote swallow
#

how are you sending the data without packets

lost matrix
eternal oxide
#

fixed

#

no need for the internet

remote swallow
#

hard line copper from server in germany to player in aus

lost matrix
#

fr, what did they think back then?
Noobs creating the internet-

river oracle
floral drum
#

fr

river oracle
#

Honestly this spex guy is right let's delete the internet

#

Fuck packets this is all mojangs fault

umbral ridge
#

☕ 🚬

river oracle
#

I think you need a little networking in your life spexx just the basics buddy then we'll be square

umbral ridge
#

im drinking packets of coffee right now we dont need them

smoky oak
#

tldr
dont go to big forums

umbral ridge
#

im scared

remote swallow
#

he hasnt sent me his onlyfans yet

river oracle
#

I got better things to do with my life than that buddy in good

remote swallow
#

i thnk ur safe

umbral ridge
#

god help please

#

XD

remote swallow
#

hes too busy with a gf and a cat

river oracle
remote swallow
#

im going to cook stuff

#

whats ur orders

umbral ridge
#

lasagna

eternal oxide
#

pork with bean sprouts

river oracle
remote swallow
#

how do i make a project with spigot and mc creator with nms so i can make a full network server with bedwars, hypixel skyblock and wool wars all custom coded with double the amount of stuff hypixel has

#

in 1.4 with java 17 and using pdc i saw its really good

#

you arent remapping most likely

river oracle
#

?nms follow this tutorial for nms

lost matrix
#

Sounds like you compiled with the wrong mappings

eternal oxide
#

?paste teh full error

undone axleBOT
remote swallow
#

that is the obsfucated mojang name

#

the server doesnt run mojmaps

eternal oxide
#

you probably shaded protocolLib into your jar

remote swallow
#

?paste it

undone axleBOT
remote swallow
#

that looks correct

#

whats wrong with the imports

#

if thats the compiled jar those arent getting remapped

eternal oxide
#

We can't tell you've nto posted the full error

cedar pine
#

Does anyone have experience with custom skills (like fishing, mining, trading) etc and have a solid way for a message to be sent when the skill is leveled up? Mine just simply isn't working

eternal oxide
#

Main.java:42

#

what is on that line?

remote swallow
#

i just read this pom and why is the compiler plugin outputand source set to 15, also you probably just need to do a clean package

eternal oxide
#

seems so

#

did you build with artifacts or run package under maven?

remote swallow
#

what steps do you take to package

eternal oxide
#

is that Eclipse?

remote swallow
#

^^

#

ah

#

that should have mvn prefixed

#

you were compiling with intellij instead of maven

eternal oxide
#

easy way to tell, use the maven window on teh right

remote swallow
#

without the mvn prefix it wont compile with maven

#

it will use intellij

#

ohh

river oracle
#

@remote swallow when you gonna update your PR

remote swallow
#

either create a new run config that has clean package as run and swap to it then use that or just run the clean task and swap back to just base package config

#

because you still arent remapping

#

you need to run the clean task

scenic onyx
#

This is the first time I create a multi-instance bw plugin, how can I manage the availability and type of bedwars? With MySql?

#

emm, i update this

#

Sr.Developer i put Jr.Dev

#

nono

scenic onyx
#

i know

#

so?

kindred sentinel
remote swallow
kindred sentinel
remote swallow
#

your maven shade plugin has 3.5.1?

kindred sentinel
#

Oh

#

i figured out, yeah, i shall change it to 3.5.1

#

thanks

clear elm
#

whats an good yt tutorial to learn java?

#

what

remote swallow
#

what method names are too long

#

doesnt sound native

#

bug the developer of the lib

clear elm
#

bin ich also wie soll ich java lernen?

remote swallow
#

?learnjava is probably the best i know of anyway

undone axleBOT
remote swallow
#

what

#

just wanna say the server is english only

river oracle
#

ok

remote swallow
#

good for you

clear elm
#

?learnjava

undone axleBOT
young knoll
#

I don’t wanna :(

wary harness
#

I got weird problem my transitive dependencies end up in my uber jar

#

I am listing specific dependancies for Module1 and Module2 and MasterModule should shade there dependancies but it ends up grabing there transative dependancies

lost matrix
wary harness
#

and then add shaded jar as dependancies in Master module

lost matrix
lost matrix
smoky oak
#

is it possible to make inedible items edible without nms?

wary harness
#

to be clear more ProxyManager has those two as depndancies

#

not If I go in bungeeproxy and addd dependancis and shade configuration there

#

only those dependasies are added and not there transative stuff

#

but if I move shade configuration to ProxyManager pom then I am getting jar like 5 mb

#

full of junk

#

if I do each module seperatly problem is not apearing

lost matrix
#

I have never seen a master module with source code. That just doesnt make sense to me...

wary harness
#

there is nothing in src

#

that is POM configuration

#

to be more clear

#

proxy is parent to those 3 inside if it

#

proxy - pom

#

and proxy parent is BeastTokens

#

I think I made my life complicatedd

#

with no reason

#

and I need to rethink it

#

xd

#

so basiavly in proxy I am adding some shared dependancies which can be used by BC, VP and ProxyManager

lost matrix
#

Ok so dependencies declared in your parent pom, will be added to each child module.

wary harness
#

yeah

#

for example HikariCP

lost matrix
#

And what specifically is your problem with this setup?

wary harness
#

so I don't need to add them to each moddule

#

here

#

this is ProxyModule Pom

#

but when thing get shaded with it

#

then I get junk jar

lost matrix
#

What is "ProxyModule"??

wary harness
#

this is if I do each module seperatly

wary harness
#

xd

valid burrow
#

how to i check if an entity is passenger and if gets the entity is riding

lost matrix
#

I dont see a module named "ProxyModule"

wary harness
#

well ProxyManager has BungeeProxy and VelocityProxy as dependancies

#

and then it run shadding

wary harness
lost matrix
wary harness
#

I think I broke whole think made it over complicated

valid burrow
wary harness
#

I wanted it to be simpler but I just f... up everything

valid burrow
#

how can i make an entity not make a sound when its hit

#

or in general disable an entites sound would be even better

lost matrix
wary harness
#

well it is quite complicated

#

you have time to hope in voice room

lost matrix
valid burrow
lost matrix
valid burrow
#

how can i make a player appear sleeping or swimming

#

either one would be okay

quaint mantle
#

No

#

Its client side

#

Also, you cant do it with nms

wide cipher
#

i have jdk 17, but i also have 21, i need to download 1.18.2 from BuildTools, how do i run it with 17 instead of 21

remote swallow
#

specify the path to the java 17 java.exe

river oracle
#

it auto manages java versions for you

#

@remote swallow yet another BTGui win

remote swallow
#

bnerd

wide cipher
river oracle
#

no love for the gui 🥲

remote swallow
#

use the gui

#

its easier than explaning

wide cipher
#

ok

#

is that the exe file?

remote swallow
#

yup

river oracle
#

or the jar whatever fancies you

remote swallow
#

nothing fancies me

wide cipher
#

what java command do you have to do to open the gui with the jar?

river oracle
#

just click it to run

wide cipher
#

oh

river oracle
#

you might have to ignore windows smartscan

misty current
#

can you display a fake damage animation for an entity?

wide cipher
river oracle
wide cipher
#

i clicked on both, the jar file did that and the exe just showed the logo then didn't open

river oracle
#

brub sorry its still in dev lol

wide cipher
#

ok

river oracle
#

how about this one 🥲 I patched that bug I'm pretty sure

#

if not I'll show you the command line way

#

well, I don't know windows

wide cipher
#

can i do java --jar BuildTools.jar gui?

river oracle
#

but I'll try

river oracle
wide cipher
#

yeah its just running

river oracle
#

🥲

wide cipher
#

wtf those are the only versions i HAVE

river oracle
#

Press Debug Info

#

then copy and paste that into a paste for me

#

?paste

undone axleBOT
remote swallow
#

thats using java 8

#

Options > Click Override Java Detect > Click Detect and Choose java 17

river oracle
#

Debug Panel only shows that

wide cipher
#

yeah

remote swallow
#

ohh

river oracle
#

@wide cipher tell me the location of your java 17 install please

#

that's a bug but for now you'll need to manually set the path

#

where it is on windows I have no clue I've been on linux too long now

wide cipher
#

C:\Program Files\Java\jdk-17

river oracle
#

you can set the GUI's path to that manually

#

its just a bit of work to navigate there

wide cipher
#

it wants a file, what file do i put it as, folders don't count

steel swan
#

Hi!
would anyone know how to tell if a player is facing the X or Z axis?

river oracle
wide cipher
#

ok

clever lantern
#

when i spawn directional particle, what are the offset parameters doing?

misty current
#

how can I display an entity damage effect to a player?

wide cipher
wide cipher
misty current
#

what about playEffect?

#

what does it do?

wide cipher
#

idk ive never used it

misty current
#

i've tried it but it doesnt seem to work

wide cipher
#

yeah so prob use packets

misty current
#

what's the remapped packet name in 1.20?

eternal oxide
#

?mappings

undone axleBOT
river oracle
#

anyways you can still run regular BT with that java relase just copy and paste the path to the java.exe file

#

and run the whatever/path/to/java/17/bin/java.exe BuildTools.jar --rev 1.18.2

#

should work

wide cipher
#

ok

wide cipher
eternal oxide
#

""

river oracle
#

idk windows command line so can't help there

eternal oxide
#

spaces in path

wide cipher
wet breach
#

Surround with quotes

#

Command prompt allows spaces but you have to use quotes

wide cipher
#

like "C:\Program Files\Java\jdk-17\bin\java.exe"

wet breach
#

Yep

#

But you missed -jar

#

Which needs to come after java outside the quotes

wide cipher
#

doing this "C:\Program Files\Java\jdk-17\bin\java.exe" BuildTools.jar --rev 1.18.2 getting this ```Error: Could not find or load main class BuildTools.jar
Caused by: java.lang.ClassNotFoundException: BuildTools.jar

#

oh

#

yep thanks

eternal oxide
#

only works if the buildtools.jar is where you are running this command

nova tusk
#

Hey guys! I recently switched from windows to linux to continue programming my spigot plugins. I unpacked the BuildTools.jar with the terminal and got 1.19.2.jar but the problem is that once I upload the jar into eclipse(programming software) importing the libraries wont work

umbral ridge
#

Welcome to linux 🤓

nova tusk
#

When I hover over „JavaPlugin” it says „cannot resolve type”

#

And the imports cant be recognised either

#

Any ideas?

nova tusk
umbral ridge
#

have you installed java?

nova tusk
#

Yes

#

In fact I got the 17 jdk

#

@umbral ridge are u able to help me?

#

Maybe I show u my screen or something

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

umbral ridge
nova tusk
umbral ridge
#

get the jar file and import it in eclipse by changing the build path

#

I recently switched from Eclipse to JetbrainsIDE so I know a little about it

umbral ridge
nova tusk
nova tusk
nova tusk
umbral ridge
#

I can't call im not home

nova tusk
#

@umbral ridge

#

When are u gonna be available

#

For a call if u dont mind

candid galleon
#

why not use maven?

umbral ridge
#

Use the right jar for the build path

#

You want the Spigot-API version

nova tusk
#

But I preffer my own way

nova tusk
umbral ridge
remote swallow
#

?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

umbral ridge
wet breach
umbral ridge
sullen marlin
#

Netbeans best beans

remote swallow
#

i hate the netbeans codestyle it puts on java

sullen marlin
#

?

#

It's the normal style by default and you can easily customise it

remote swallow
#

but its the like c++ or c# format not java

sullen marlin
#

They're the same

#

What is java format

slender elbow
#

.java

#

duh

carmine mica
#

if ( isBad ( thisFormatting ) )
{

}

remote swallow
#

yes

#

that

carmine mica
#

oh wait that is netbeans' DEFAULT?

#

that explains SO much

eternal oxide
#

yeah I dislike the { on a new line

#

its kinda more logical, but it just looks bad

wet breach
#

Believe it has some other defaults you can select from

remote swallow
#

yeah well md didnt so now i will hate netbeans

maiden geode
#

Hello,
Does anyone here know how to register custom entities using 1.20.2 NMS Version? And how to spawn them?

warm mica
#

But generally it's the same as in the older versions

valid burrow
#

im sure if he knows nms he also knows if he should use it or not

inner mulch
#

does calling an empty method does something with the perfomance in any way?

compact haven
#

why in the world would you call an empty method, though?

inner mulch
#

that wasnt the question

compact haven
#

the performance impact is negligible, but you're still placing the method parameters on stack temporarily if nothing else

compact haven
#

🤔

young knoll
#

What if your plugin doesn’t have an onDisable implemention

#

Then spigot calls an empty method!

inner mulch
#

ok

inner mulch
valid burrow
#

Every time i put a wolf on an entity it starts atacking the entity how can i stop that

compact haven
#

you're fine

valid burrow
#

no i need the ai

inner mulch
#

cancel entity damage evnet?

valid burrow
#

that would be stupid

#

canceling hundrets of events every second

inner mulch
#

then i guess you gotta figure it out yourself

compact haven
#

optimize when you need to, premature optimization is not as good as identifying and alleviating hot traces 🤷

valid burrow
young knoll
#

Those poor sheep/skeletons

inner mulch
young knoll
#

Imagine if humans had bears stacked on their heads

valid burrow
#

it attacks all entites

#

not only sheep and skeleton

#

idk why

valid burrow
young knoll
#

Idk rip out half their ai goals

valid burrow
#

nms?

#

not again..

#

welp see yall in 5 hours when i have depression

young knoll
#

You don’t have it already?

#

Amateur

valid burrow
#

i mean yeah but that will like

#

5x it

#

im soon gonna be out of the 32b integer limit

sullen marlin
umbral ridge
#

nice christmas hat md

warm mica
young knoll
#

Gotta have that performance

warm mica
#

Spending hours over hours creating unmaintanable code for 1 less ns/tick, lets goo

young knoll
#

Not sure what crazy code ur writing

#

I recently made a custom NMS entity that basically does no ticking at all, it’s only a few methods

inner mulch
warm mica
young knoll
#

Don’t really need custom entities for ai

#

I would just make custom goals instead

warm mica
#

Yes, that's why there aren't a million reasons

warm mica
wide cipher
#

while building the multimodule project it said it couldn't find org.spigotmc:minecraft-server:1.20-R0.1-SNAPSHOT:txt:maps-mojang even though that's what the tutorial said to do

remote swallow
#

1.20 doesnt exist anymore

#

use 1.20.1 and run buildtools with --remapped

wide cipher
#

ok

torn oyster
#

is there a way to generate like 100x100 blocks of world

#

then make it like start to disintegrate sorta at the edges to close in

#

sorta like a world border closing in\

#

world being vanilla world gen

young knoll
#

Custom world generator

torn oyster
#

can I just generate 6x6 chunks and leave everything else as void?

young knoll
#

Yes

#

If you use the various shouldGenerateX methods

wide cipher
#

<remappedDependencies>org.spigotmc:minecraft-server:1.20.1-R0.1-SNAPSHOT:jar:remapped-mojang</remappedDependencies> it can't find this

#

even though i did the buildtools

remote swallow
#

did you run buildtools with --rev 1.20.1 and --remapped

wide cipher
#

yes

rare rover
#

what's the api's for builds, releases, and versions?

remote swallow
#

hm??

rare rover
#

the endpoints

remote swallow
rare rover
#

i need this, but for spigot

remote swallow
#

oh that doesnt exist

rare rover
#

;-;

#

rip

remote swallow
#

we have buildtools

rare rover
#

okay

remote swallow
#

just run it every like 3 days and you have the jar

rare rover
#

o, rip

#

alr

young knoll
#

The magic of compile if changed

torn oyster
#

how come you can directly download paper but you have to use buildtools for spigot?

#

just curious

wide cipher
remote swallow
#

paper uses binary patches at runtime and thats a legal grayzone

#

spigot wont enter it

remote swallow
# wide cipher

check the jar exists C:\Users\USER\.m2\repository\org\spigotmc\spigot\1.20.1-R0.1-SNAPSHOT

wide cipher
remote swallow
#

that one exists, go back 2 folders and check the jar exists in org\spigotmc\minecraft-server\1.20.1-R0.1-SNAPSHOT

wide cipher
remote swallow
#

i cant see the name of the 1 jar in there

wide cipher
#

wdym?

remote swallow
#

i cant see if the jar has -remapped-mojang on it

#

its cut off

#

im gonna guess you probably need to run buildtools agin

wide cipher
#

yeah it isn't remapped for some reason

#

is it just --rev 1.20.1 --remapped?

remote swallow
#

should be

wide cipher
remote swallow
#

did it complete fully

#

i just checked and remapped deps isnt even meant to have mc server

#

?nms

remote swallow
#

copy the special source plugin on the link and change the versions

remote swallow
#

this does not come up in it anywhere

wide cipher
remote swallow
#

no

wide cipher
#

wait

remote swallow
#

read it

#

that has spigot, you have minecraft-server

wide cipher
#

im confused, how did i get to that?

remote swallow
#

no clue

wide cipher
#

new error

remote swallow
#

it doesnt support java 20

#

use 17 or 21

wide cipher
#

i dont have 20

#

i have 17 and 21

remote swallow
#

major version 64 is java 20

#

so something is using java 20

wide cipher
young knoll
#

Yes that

wide cipher
#

ok

#

oh that was my bad apparently i had my project sdk set to jdk 20

quaint mantle
#

Anyone know a Damageable#damage(amount, source) that doesn't do lb

#

Knockback*

wide cipher
#

new error

#

fixed

#

how can i use the multi module plugin in my plugin? @remote swallow

remote swallow
#

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

wide cipher
rotund ravine
remote swallow
#

also designed for libs so you just have to rework it a bit

wide cipher
#

like i want to make the spigot dependency have the right version, how would i do that? <dependency> <groupId>org.spigotmc</groupId> <artifactId>spigot</artifactId> <version>1.20.2-R0.1-SNAPSHOT</version> <scope>provided</scope> <classifier>remapped-mojang</classifier> </dependency>

quaint mantle
#

It's just been super complicated to make a system for that

#

like spawn prot and all that

rotund ravine
#

Just emulate a damage event

wide cipher
rotund ravine
#

You mean getHandler?

wide cipher
#

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

wide cipher
#

hi, i have a noMethodError, i don't need help fixing it, i just want to know what .fQ does with NMS java.lang.NoSuchMethodError: 'com.mojang.authlib.GameProfile net.minecraft.server.level.EntityPlayer.fQ()'

eternal oxide
#

?mappings

undone axleBOT
torn oyster
#

does worldborder.getSize() show current size

#

like including transition

#

if it was halfway through a transition from like 100 to 20 blocks would that say 60

eternal oxide
#

I doubt it. My guess is the size change is client side

quaint mantle
#

does spigot have api for the tick command yet

wide cipher
eternal oxide
#

make sure you check the correct version

wide cipher
#

yeah, looks like its probably the respawnAngle method

torn oyster
#

how do i generate 6x6 chunks

#

in a void world

torn oyster
#

also how do i change world minimum height to 0

eternal oxide
#

only at creation

torn oyster
#

is that possible

#

like start the world with a void chunk gen then after that randomly generate 6x6 chunks in centre using a different one

shadow night
torn oyster
#

i already have my biome provider and chunk generator and stuff

torn oyster
eternal oxide
#

in your ChunkGenerator you could detect your 6x6 and alter the generation in those chunks

wide cipher
#

how would i use reflection to do this?

lost matrix
wide cipher
#

so it has to be done with packeys

#

packets

#

and if you don't respawn them it won't update

#

unless you know an easier way

lost matrix
# wide cipher unless you know an easier way

Probably. But porting this to reflections is pretty much doing the same, but instead of
calling methods and constructors directly, you would call them via reflections and use Object for everything.
What is your reasoning behind using reflections instead of lets say ProtocolLib.

wide cipher
#

i have not really used protocolLib bedore

lost matrix
#

Hm. You need to be careful with reflections because they can be very slow if not used correctly.
Caching is quite important here.

wide cipher
#

if so, how would i do it?

wet breach
wide cipher
wet breach
#

I believe we have api for setting the player skin

lost matrix
#

ProtocolLib is usually more maintainable than using reflections as the internals are abstracted away.
Its not as abstract as spigot, but you get a decent version stability.

wet breach
#

and the rest can be done with packets for the players you only want it shown to

eternal oxide
#

setting skin is not in spigot

wide cipher
#

yeah, PlayerProfile, but im not sure how to do it like this ``` public static void setSkin(ServerPlayer player, String[] skin) {

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

    player.getGameProfile().getProperties().removeAll("textures");
    player.getGameProfile().getProperties().put("textures", new Property("textures", texture, signature));

}```
wide cipher
eternal oxide
#

yes, but that doesn;t actually change the skin for any clients

wet breach
#

it will still show for the player it is being changed on

wide cipher
wet breach
#

they want to only show updated skin to certain players anyways

eternal oxide
#

yes

#

?paste for me

undone axleBOT
wide cipher
eternal oxide
eternal oxide
#

mine

wide cipher
#

i mean that that is what i got the code from

wide cipher
#

tho i need to make it not version dependent

eternal oxide
#

I updated it for 1.20.4 yesterday

wide cipher
eternal oxide
#

you either have to do the version specific stuff yourself, or leave that to ProtocolLib

#

Mine avoids Version specifics in Bukkit but you can;t really avoid it in NMS

lost matrix
eternal oxide
#

which is why you'd have to do that part with ProtoclLib and leve them to update

wet breach
wide cipher
eternal oxide
# lost matrix Implementing an interface without abstract methods? <:squint:606921344977862797>

Multiversion API```javapublic interface Skins {

/**
 * Set a new skin on the Player and update all clients.
 * 
 * @param player    the Player to have his skin changed.
 * @param skin        a String[] skin to apply.
 */
public void changeSkin(Player player, String[] skin);

/**
 * Change a Players name.
 * This name is transient. It will be reset if you change the players skin.
 * 
 * @param player    the Player who's name we will change.
 * @param newName    the new name for this Player.
 */
public void changeName(Player player, String newName);

}```

wide cipher
#

does anyone know how to do it with ProtocolLib

lost matrix
#

Where override annotation

eternal oxide
#

Its not actually production code. just reference so I can see NMS changes in each version

#

However abstraact on an interface is not required as its implicit

dry hazel
eternal oxide
#

the implementation "should" be override though

lost matrix
eternal oxide
#

the implementation "should" be override though

#

yep

bitter rune
#

I like Picard I need to finish watching Star Trek Picard

eternal oxide
#

Not Trek

devout vault
#

Hello, I have a problem. When someone toy connects to the server and then immediately kicked out. A meme in the console says An error occurred when enabling the resourcepack. Please contact admins or disable resourcepacks. And I tried disabling ItemsAdder.jarr and it works fine. And when I turn it on and the others won't connect and does anyone know

valid basin
#

Does someone know why this doesn't open a book (without having a book in your inventory)? It should open it using NMS.

    public boolean onCommand(CommandSender sender, org.bukkit.command.Command command, String label, String[] args) {
        if (!(sender instanceof Player)) {
            sender.sendMessage(ChatColor.RED + "Only players can use this command.");
            return false;
        }

        Player player = (Player) sender;
        Profile profile = ProfileManager.getProfile(player);

        // Create a writable book
        ItemStack book = new ItemStack(Material.WRITTEN_BOOK);
        BookMeta bookMeta = (BookMeta) book.getItemMeta();
        bookMeta.setTitle("Achievements");
        bookMeta.setAuthor(player.getName());

        // Add a cover page
        bookMeta.addPage(ChatColor.BOLD + "Achievements\n\n" + ChatColor.RESET + "Click through the pages to view your achievements.");

        // Automatically categorize and generate pages based on achievements
        for (AchievementsEnum achievementsEnum : AchievementsEnum.values()) {
            generateCategoryPage(bookMeta, achievementsEnum, profile);
        }

        // Set the book meta and open the book
        book.setItemMeta(bookMeta);
        ((org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer) player).getHandle().openBook(CraftItemStack.asNMSCopy(book));
        return true;
    }```
hazy parrot
#

There is api for it

#

Player#openBook

valid basin
dire marsh
#

1.8 moment

valid basin
#

Why the nms doesn't open the book tho? Is there something I'm doing wrong?

dire marsh
#

iirc it needs to be in the player's selected slot and delayed by a tick

#

at least that's how i remember doing it back then

clever lantern
#

can i set durability of the block?

#

for example set grass to be as durable as obsidian?

eternal oxide
#

no

clever lantern
#

ok

#

so its not possible to change the block below player to other without changing durability?

astral pilot
#

yo how do i make mobs drop custom items

astral pilot
eternal oxide
#

its still an ItemStack

astral pilot
#

ah

astral pilot
#

i mean where are enchants usually stored

umbral ridge
#

its stored in itemmeta

astral pilot
#

i see

umbral ridge
#

its a separate class

#

ItemMeta

astral pilot
#

also stored there

#

and the type?

#

like is it a grassblock

#

also stored there

umbral ridge
#

display name?

#

that is in itemmeta

astral pilot
umbral ridge
#

type is an enum

astral pilot
#

is the type in itemmeta too or

#

no

umbral ridge
#

no

#

look through the javadoc everything is there xD

#

?jd-s

undone axleBOT
umbral ridge
#

search for ItemMeta and see the functions

astral pilot
#

okok will do thanks

umbral ridge
#

and ItemStack clasz

spare hazel
#
@EventHandler(
      priority = EventPriority.HIGH
   )
   public void onPlayerFish(PlayerFishEvent e) {
      if (!e.isCancelled()) {
         if (e.getPlayer().getInventory().getItemInMainHand().getItemMeta().getPersistentDataContainer().has(HypixelCustomItems.getPlugin().getItemKey(), PersistentDataType.STRING)) {
            CustomItem customItem = HypixelCustomItems.getPlugin().getItem((String)e.getPlayer().getInventory().getItemInMainHand().getItemMeta().getPersistentDataContainer().get(HypixelCustomItems.getPlugin().getItemKey(), PersistentDataType.STRING));
            if (customItem.getSkillRequirement() != null && customItem.getSkillRequirementAmount() != 0 && HypixelCustomItems.getSkillCore().getPlayer(e.getPlayer().getUniqueId()).getSkillWithString(customItem.getSkillRequirement()).getLevel() <= customItem.getSkillRequirementAmount() - 1) {
               e.setCancelled(true);
               return;
            }

            if (e.getState() != State.CAUGHT_FISH) {
               return;
            }

            HypixelCustomItems.getPlugin().getItem((String)e.getPlayer().getInventory().getItemInMainHand().getItemMeta().getPersistentDataContainer().get(HypixelCustomItems.getPlugin().getItemKey(), PersistentDataType.STRING)).onCatchFish(e);
         }

      }
   }```
why is this executing the CustomItem#onCatchFish(e); event though my skill level is 1
#

please i need help

young knoll
#

Add debug statements

#

Figure out what code is being run

spare hazel
#

ok

echo basalt
#

read the entire thing pls

astral pilot
#

get has something that says
"If the Object does not exist but a default value has been specified, this will return the default value. If the Object does not exist and no default value was specified, this will return null."

#

how do i set default value

#

on it

young knoll
#

addDefault

#

Or setDefault, something like that

echo basalt
#

addDefault

young knoll
#

Pretty sure you gotta add it every time the plugin runs tho

#

I prefer just using the get methods that let you pass a default directly

main summit
#

Hi, wondering if there's a Developer who would be willing to add a handful of missing advancement types and a reset players advancements command to this plugin https://www.spigotmc.org/resources/custom-advancements.91167/ I'm not wealthy but i can see what i can do to compensate your time. I'm not the owner of the plugin but the owner has said they're happy for someone to do so.

echo basalt
#

?services ideally

undone axleBOT
echo basalt
#

Asking for services on a channel where a lot of the traffic is beginners asking for help is a slightly bold move

main summit
#

first time i've been here and it does say in the header serious spigot and bungeecord developments help

#

maybe it needs to be a little more specific if it's not for what i'm seeking

young knoll
#

Help for people that are writing code

#

Not for finding people to write code

main summit
#

fair enough but it doesn't exactly advertise that in the header, pointing out that it should if they don't want my type of enquiry here.

astral pilot
#

so it supports passing a default directly

spare hazel
#

?paste