#help-development

1 messages Ā· Page 1497 of 1

dire marsh
#

seems nms packages are different now :o

#

import net.minecraft.world.level.block.state.IBlockData;

shut oyster
#

Hey @wraith rapids, yesterday we talked about Anvil Inventory's and their problems in Spigot, and i fully switched to paper after a lot of hasseling and was hoping if you could point me into the right direction using Anvil as inventory in paper.

eternal night
#

there is Player#openAvilInventory I think

#

tho for paper related questions, just hop over onto their discord

shut oyster
#

yea its was just because i talked about it to that guy yesterday and online the documentation is a bit scare but yea

shut oyster
shadow gazelle
#

v1_8_8_R1 doesn't work and neither does v1_8_R1

shut oyster
shadow gazelle
#

No autocompletion

shut oyster
#

at all or just that?

quiet ice
#

Are you sure that you have the right jar?

shadow gazelle
#

1.8.8 R0.1 Spigot API

quiet ice
#

That is the wrong one

#

You need nms

shadow gazelle
#

The server software, or something else?

quiet ice
#

server software, craftbukkit jar should suffice

#

I think it is known as org.spigotmc:spigot, but idk pre-1.13 artifact naming

shadow gazelle
#

I'm assuming I have to build it?

quiet ice
#

Correct.

shadow gazelle
#

Would the Spigot jar also work?

quiet ice
#

I think so, unless it is the spigot-api jar

#

What is the recommended way of obtaining the materials that are within a tag while still using "valid" bukkit API? I am currently using reflections on the org.bukkit.Tag class but this isn't the best way of doing that I recon given that datapacks can define those

#

nvm, Bukkit#getTag exists

sharp bough
#

is there some api to handle multiple config files?

quiet ice
#

There is the bukkit config API

sharp bough
quiet ice
#

yes

shadow gazelle
#

About how long does building normally take?

sharp bough
#

building like plugin building or placing blocks?

dusty herald
#

building the server

quaint mantle
#

About 2 years

floral flare
#

I am trying to make a permissions plugin in BungeeCord, however, I don't know any method to store and at the same time pull the information to the plugin, in this case, would I be able to keep updating the config.yml of the BungeeCord jar itself by my plugin?

dusty herald
#

yeah

floral flare
dusty herald
floral flare
#

Thanks

sharp bough
#

is this a good example

#

for multiple config files?

dusty herald
sharp bough
#

wut

dusty herald
#

they're developing with the Bungeecord api

sharp bough
#

so?

dusty herald
#

you sent bukkit code šŸ‘€

#

shame on you

sharp bough
#

:c

#

i just want multiple config files

#

the end justifies the means

dusty herald
#

the one provided by that wiki article is a great start

dusty herald
#

oh i was talkinga bout what i sent

#

i have no idea what that does lmao

quiet ice
#

bukkit config API

dusty herald
#

yeah it's a mess

quiet ice
#

It is basically the same system as the normal bukkit config api

dusty herald
#

i mean i am a mess not the code

#

then again I use ConfigAPI

floral flare
#

@dusty herald

quiet ice
#

What is this?

#

Does it extend JavaPlugin or similar?

dusty herald
dusty herald
floral flare
sharp bough
quiet ice
#

I so far have good experience with bukkit's API, it however shouldn't be used for writing

dusty herald
#

like I did in that code

sharp bough
#

but it cant write

dusty herald
#

yeah, I don't use the API for writing

#

I just save the resource

quiet ice
#

JavaPlugin#getResourceAsStream

#

With Java 10's (I think that was it) InputStream#transferTo it should be easy to do

dusty herald
#

ConfigAPI pulls shit from the jar and adds directories and whatnot, makes it a hell of a lot easier for me

#

saves comments too

sharp bough
#

and what do you use to write?

#

getinstance.getconfig.set ?

odd sentinel
#

anyone know why I'm getting Unsupported class file major version 60 building my plugins on java 16 despite having gradle v7.0.2

undone axleBOT
odd sentinel
#

I have it

dusty herald
#

sorry misread

#

it appears your server is not using java 16?

#

that's when I normally see that error

odd sentinel
#

not running a server

dusty herald
#

try turning it on and off

#

serious

odd sentinel
#

build fails with Caused by: java.lang.IllegalArgumentException: Unsupported class file major version 60 yet I clearly have gradle 7

dusty herald
#

šŸ¤” I have no idea why it isn't compiling

#

I'm used to maven sadly, what does your gradle script look like?

gaunt hatch
#

So i am having a issue when trying to complie in 1.17 Java 16 on the dependencies.

it tells me the 'complie' on the dependency is not vaild.

quiet ice
#

Java home is likely fucked

gaunt hatch
#

problem occurred evaluating root project ''.

Could not find method compile() for arguments [com.zaxxer:HikariCP:4.0.3] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

quiet ice
#

What does ./gradlew --version return?

odd sentinel
#

I pasted the link

floral flare
gaunt hatch
#

its set to 7.0.2-all

dusty herald
dusty herald
#

it's possible yeah, but like I said

#

no idea ):

floral flare
#

No problems

#

Thanks for help

quiet ice
gaunt hatch
#

oh my JAVA_HOME is not set that might do it

#

werid tells me its not set right even though in cmd it is right hmmmm

lean gull
#
    public static HashMap<VariableElement, String> chatColor;
    public static void init() {
        chatColor = new HashMap();
    }``````java
            UUID uuid = player.getUniqueId();
            Ludicrousy.init();

            if (Ludicrousy.chatColor != null) {
                Ludicrousy.chatColor.put(uuid, "&c");
            }```"uuid" in the last line of the second code block has red below it
#

(first one is where i set chatColor, second is where i set their value)

#

(also both of these are two different classes)

odd sentinel
#

might be the shadow plugin then, but I don't see an update for java 16

#

oh nvm

lean gull
#

ur not talkin to me, right?

odd sentinel
#

their wiki sucks

#

no

lean gull
#

ok

quaint mantle
#

what architecture do i need for java 16

opal juniper
lean gull
#

so i can use variables as the key

#

i'm not sure what a variable element is tho

#

i thought it's what it sounds

gaunt hatch
#

Yea same error

#

Could not find method compile() for arguments [com.zaxxer:HikariCP:4.0.3] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

opal juniper
#

Nah just use the String

#

Which stores their uuid

#

And then you can do Bukkit#getPlayer

lean gull
#

wat?

#

im confused, sorry

#

there's no string where i define the uuid variable

odd sentinel
#

you can use uuid.toString() I'm sure

opal juniper
#

Uuid can be stored as a string

quaint mantle
#

i need a little help downloading java 16

odd sentinel
floral flare
#

@dusty herald, is creating a folder for my plugin, but I want to modify the BungeeCord's own folder with my plugin

opal juniper
quaint mantle
#

its asking for an architecture

dusty herald
#

UUID.fromString(String) if you need to convert a string to UUID

opal juniper
dusty herald
quaint mantle
#

64 bit

#

its asking for ARM and PPC

quaint mantle
#

idk which one

opal juniper
quaint mantle
#

no

lean gull
quaint mantle
#

windows

opal juniper
#

Then use the windows x64 installer

#

You need an account

quaint mantle
#

oh okay

#

ty

opal juniper
#

Near the bottom

dusty herald
#

?java16

undone axleBOT
dusty herald
#

šŸ˜‰

opal juniper
#

That also works

odd sentinel
quaint mantle
#

ah it works, thank you

lean gull
#

required type: String
provided: UUID

opal juniper
#

.toString() or cast it

lean gull
#

i did do dat doe

opal juniper
#

Well then it would be a string

lean gull
#

apparently, tis' not

opal juniper
#

Send the line of code with the red line

lean gull
#
Ludicrousy.chatColor.put(uuid, "&c");```
eternal oxide
#

oh

#

you gave a UUID

quaint mantle
#

Anyone know how can i get head with skin value and set it in gui?

opal juniper
#

Nah he is trying to store it

#

You need to either .toString() or cast it iirc

eternal oxide
#

Your Map is setup with a String and you are trying to use a UUID

lean gull
#

no, i did uuid.toString();

opal juniper
#

What and it still said that you gave a uuid ?

lean gull
#

yee

eternal oxide
#

yeah, no you didn;t

opal juniper
#

Cause that seems impossible

lean gull
#
        else if (cmd.getName().equalsIgnoreCase("chatcolor")) {
            UUID uuid = player.getUniqueId();
            uuid.toString();
            Ludicrousy.init();

            if (Ludicrousy.chatColor != null) {
                Ludicrousy.chatColor.put(uuid, "&c");
            }

        }```
eternal oxide
#

Learn Java

lean gull
#

i'm learning by coding

#

and by help from strangers :P

dusty herald
#

😱

glacial trellis
#

how different is the 1.16 code to 1.17 are there many changes

dusty herald
#

oh i just read it im

#

but why

candid silo
#

are you able to extend a vanilla entity in order to give it additional fields and such?

opal juniper
#

That’s not the best way unfortunately- at least learn basics b4

lean gull
#

i put String instead of UUID where the uuid is defined, now it has a red line at the bottom of it :P

#

you happy joch?

#

ok sorry that was sassy

quaint mantle
#

So noone has an idea to make gui with custom head value?

opal juniper
quaint mantle
#

Np

opal juniper
#

What do you mean by value

candid silo
#

a head with a specific skin?

lean gull
#

i think they mean a slot

quaint mantle
#

Yes

#

I have this value: eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNGNhYzk3NzRkYTEyMTcyNDg1MzJjZTE0N2Y3ODMxZjY3YTEyZmRjY2ExY2YwY2I0YjM4NDhkZTZiYzk0YjQifX19

#

I want to use it for gui

opal juniper
#

So you need the itemstack form?

#

For an inventory?

quaint mantle
#

Yes i think

sharp bough
#

so theres no need to make another variable

#

i dont see a reason why you would make uuid a stirng

opal juniper
#

Wait no

quaint mantle
#

Something like this

opal juniper
quaint mantle
#

Ty

odd sentinel
lean gull
opal juniper
sharp bough
#

i was reading about multi config files

#

and this is the example

#

would that work just for the config.yml file?

fossil lintel
#

Anyone here that has tried to upgrade their Bukkit/CraftBukkit/Spigot development environment from 1.16.5 to 1.17?
I'm getting the following error:

error: sha1 information is lacking or useless (src/main/java/net/minecraft/world/level/World.java).

I run buildtools using java -jar .\BuildTools.jar --dont-update, but have pulled all the master branches manually.
So far I tried to remove the work/ and Spigot folders and have buildtools create it themselves.

sharp bough
#

try again?

#

is that the first attempt?

opal juniper
quaint mantle
#

I want to use skin value not url

opal juniper
#

Sorry

dusty herald
#

you get the skin value from the url magically

#

not sure how

fossil lintel
quaint mantle
#

Oh i didn't know that

opal juniper
#

Just google it - there are a million and one examples

quaint mantle
#

byte[] encodedData = Base64.encodeBase64(String.format("{textures:{SKIN:{url:\"%s\"}}}", url).getBytes());
So i have to put the skin url in %s ?

tardy delta
#

What
package com.mojang.authlib does not exist

quaint mantle
#

How can i get url from skin value

opal juniper
#

I’m not an expert

#

Umm ya don’t

#

There is another way

#

I thought you wanted custom heads for a gui

tardy delta
fossil lintel
#

Oh, I might've found the problem. My personal repo is not up to date

#

Derp

quaint mantle
tardy delta
#

oh nvm

opal juniper
#

So I provided the way for an image

quaint mantle
opal juniper
#

I haven’t done heads b4

#

Then why do you want skins

quaint mantle
#

You told me

tardy delta
#

how can i see for which version i compiled a plugin?

#

intellij

opal juniper
#

You can’t

#

If you used maven you can

tardy delta
#

yes that

opal juniper
#

Oh - it’s in the meta inf or something

#

So open it like a zip and navigate to it

quaint mantle
#

Idk what should i ask for but i want to use skin value for custom head in gui

umbral token
fossil lintel
#

Wheeee, I can continue my PR work now

fossil lintel
tardy delta
#

is it build jdk?

#

i assume its in manifest.mf

umbral token
#

The directory is clean

undone light
#

(1.17) Using Bukkit.createMap(world) is giving me "Cannot read field "mapView" because "worldmap" is null" This worked with 1.16.4 but seems to have broken, and the docs dont suggest anything has changed, any ideas?

fossil lintel
#

I had a simmilar issue, but my build dir was far from clean

fossil lintel
#

Rebuild Spigot

lean gull
#
    public void onChat(AsyncPlayerChatEvent event) {
        Player player = event.getPlayer();
        UUID uuid = player.getUniqueId();
        Ludicrousy.init();

        if (Ludicrousy.chatColor.put(uuid.toString(), "&c") != null) {
            event.setCancelled(true);
            Bukkit.broadcastMessage(player + "&c: " + event.getMessage());
        } else if (Ludicrousy.chatColor.put(uuid.toString(), "&c") == null) {
            event.setCancelled(true);
            Bukkit.broadcastMessage(player + "&f: " + event.getMessage());
        }
    }```this does literally nothing, someone please help
thanks in advance
undone light
sharp bough
#

and register the event

tardy delta
#

woah

dusty herald
#

you have no idea how many times I've screamed at my code because I forgot the handler

#

now I have a listener template for my dumbass šŸ˜‚

tardy delta
#

all those things give me the error that package com.mojang.authlib does not exist

import com.mojang.authlib.GameProfile;
import com.mojang.authlib.properties.Property;

lean gull
#

where do put handler

sharp bough
lean gull
#

wait nvm

#

i think i found it

tardy delta
#

šŸ¤¦ā€ā™‚ļø

sharp bough
#

send code

lean gull
#

what

#

i'm new to this ok

sharp bough
#

?paste

undone axleBOT
tardy delta
#

go learn the bukkit api

lean gull
#

i can't even do that

#

the buttons don't work

#

i mean half of them don't

sharp bough
#

its not hate

#
#

you should watch his tutorials first

dusty herald
#

TSC is great

sharp bough
#

try to understand the structure

fossil lintel
dusty herald
#

something about them idk

#

retrooper help pls

lean gull
#

so.... it still doesn't work

sharp bough
#

did you watch the videos i told you about?

lean gull
#

anyone know how to help?

tardy delta
sharp bough
#

bro i hope someone comes and yells at you

#

wheres NNY when i need one

tardy delta
lean gull
#

chat color plugin

#

a very dumb one

#

...it only has one color...

undone light
tardy delta
#

code maybe? or a bit more explained?

lean gull
#
    public static HashMap<String, String> chatColor;
    public static void init() {
        chatColor = new HashMap<String, String>();
    }``` this is the main class
sharp bough
#

lmao

tardy delta
#

okay

lean gull
#

and this is the commands class

        else if (cmd.getName().equalsIgnoreCase("chatcolor")) {
            UUID uuid = player.getUniqueId();
            Ludicrousy.init();

            if (Ludicrousy.chatColor != null) {
                Ludicrousy.chatColor.put(uuid.toString(), "&c");
                player.sendMessage("§aEnabled chat color!");
            } else if (Ludicrousy.chatColor == null) {
                Ludicrousy.chatColor.put(null, null);
                System.out.println(Ludicrousy.chatColor);
                player.sendMessage("§cDisabled chat color!");
            }

        }```
#

i know, i'm bad

dusty herald
#

what doe s Ludicrousy.init();
do

tardy delta
#

and an listener?

tardy delta
sharp bough
#

Love the video or need more help...or maybe both?
šŸ’¬Join us on Discord: http://discord.gg/invite/fw5cKM3
Thank you for tuning in to this episode of TheSourceCode! ā¤ļø

If you enjoyed this video make sure to show your support by liking , commenting your thoughts, and sharing for all your friends to see and learn!

All code is available on Github:
...

ā–¶ Play video
#

lmao

lean gull
#
public class LudicrousyEvents implements Listener {```this is the listener in the events class
dusty herald
#

that should be LudicrousyListeners

lean gull
#

tutorial said to just put it as the file name

tardy delta
#

well there's very much in there šŸ˜‚

lean gull
#

so can anyone help?

tardy delta
#

how can that stupid thing find a repo again? i forgot about it

gaunt hatch
#

Does spigot ever publish the changes from version to version?

neon storm
#

How do you get a tag from a string?

I want something like this to happen:

Tag<Material> tag = Tag<Material>.fromString(inputString);

iron condor
#

Has anyone used NuVotifier as an API?

sharp bough
#

is there a way to create a hashmap with all values of particle. and set the boolean to a value in config?

#

like a next or builder

#

or smth

#

i dont wanna type every single value

dusty herald
#

Enum#values()

#

Particle[] particles = Particle.values();

#

something like that

gaunt hatch
#

ugh, i love how in 1.16.4 there was no obfucation on objects then in 1.17 there is

restive lichen
#

I'm getting the classic "plugin has been compiled by a more recent version of the Java Runtime (class file version 59.0), this version of the Java Runtime only recognizes class file versions up to 52.0" error, how do I downgrade my compiler in eclipse?

#

(or better yet upgrade the server)

dusty herald
#

what are you using?

#

ubuntu?

restive lichen
#

windows

dusty herald
#

for your server?

restive lichen
#

yeah

dusty herald
#

?java16

undone axleBOT
restive lichen
#

much appreciated

lean wadi
#

is there any special setup needed for building 1.17?
Failed to execute goal net.md-5:specialsource-maven-plugin:1.2.2:remap (remap-fields) on project spigot: Execution remap-fields of goal net.md-5:specialsource-maven-plugin:1.2.2:remap failed: A required class was missing while executing net.md-5:specialsource-maven-plugin:1.2.2:remap: com/google/common/base/Preconditions

quiet ice
#

Try deleting .m2 and the bt cache

gaunt hatch
#

Anyone can get stuff updated and added into spigot right?

quiet ice
#

no, you need to sign a CLA and yea

gaunt hatch
#

How can one get to that part?

#

Do i request on the forms?

quiet ice
#

?stash

#

smh

iron condor
#

how would you go about creating a vote listener plugin>

#

?

tardy delta
#

pff package net.minecraft.server.v1_16_R3 does not exist

plucky comet
#
Economy eco = PotFill.getEconomy();```Im getting a Cannot resolve symbol 'PotFill' when that is my main classname
gaunt hatch
#

they dont have the version anymore in the package so in example

#

net.minecraft.server.MinecraftServer

quiet ice
#

That is 1.16.3

#

Or higher

lean wadi
#

geol: the error changed to .apache.maven.artifact.resolver.ArtifactNotFoundException: Could not find artifact org.spigotmc:minecraft-server:csrg:maps-spigot-fields:1.17-R0.1-SNAPSHOT

quiet ice
#

The change you mentioned only affects 1.17

quaint mantle
#

Ive got java 16 installed but im getting this error when trying to make spigot 1.17

#

The version you have requested to build requires Java versions between [Java 16, Java 16], but you are using Java 8

quiet ice
#

maven or gradle?

gaunt hatch
#

Check your JAVA_HOME

plucky comet
quiet ice
#

Ah nvm

lean wadi
#

im using buildtools, so idk

tardy delta
#

for some reason this is red

quiet ice
#

Ye, check JAVA_HOME

gaunt hatch
#

8 might be set still

#

I unistalled 8 fully and updated JAVA_HOME

#

no need for 8 anymore tbh

#

So how does one apply to help with spigot?

shadow gazelle
#

I don't know what I did, but anytime I build the plugin jar it only has the Spigot API

#

I've tried resetting the artifact settings and it still does it

quiet ice
#

What are you building it with?

tardy delta
#

bruh just changing spigot-api to spigot saved all my issues

shadow gazelle
quiet ice
#

Welp, nothing I can help you with either maven/gradle or bust

plucky comet
#

?paste

undone axleBOT
hushed spindle
#

i'm trying to update my stuff to java 16 but i have this weird ass error where tools.jar seems to be missing

#

considering i have the jdk, not jre. I have the environment variable set to my jdk 16.0.1 directory, and i have my intellij updated to 2021.1.1 i really dont know how to fix this bug any more

gaunt hatch
#

did you update the project jdk and gradle setting jdk in intellij?

hushed spindle
#

you mean setting the project sdk to something like openjdk 16?

#

gradle settings i havent checked out yet sec

#

although by the way tools.jar is actually physically missing from my jdk directory which i dont think should be the case?

gaunt hatch
#

hmm maybe 16 doesn't have it?

hushed spindle
#

but i have 16?

gaunt hatch
#

16 yea sorry

hushed spindle
#

and another guy i asked did say he did have tools.jar so im just very confused

gaunt hatch
#

you using java or OpenJDK?

hushed spindle
#

although one website did say tools.jar shouldnt be there any more after java 9 but then why do i get the error that tools.jar is missing when compiling

#

isnt openjdk a version of java

gaunt hatch
#

my understanding its a bit diffrent

hushed spindle
#

i tried it with other installations of java as well and same results

white plover
#

What does java -version say?

hushed spindle
#

16.0.1

#

although wait

white plover
#

mhh weird

quaint mantle
#

that's be work? I don't know something about new PacketDataSerializer in 1.17.

final ByteBuf buffer = Unpooled.buffer(6);
PacketDataSerializer pds = new PacketDataSerializer(buffer);
PacketPlayOutScoreboardTeam packet = new PacketPlayOutScoreboardTeam(pds);
white plover
hushed spindle
#

that would indicate its a jre instead right

#

or does it always say that when you do java version

gaunt hatch
#

Here is a new one for me

[Fatal Error] HikariCP-4.0.3.pom:2:10: Already seen doctype.

Trying to shadow jar a build and it fails

white plover
hushed spindle
#

yeah

white plover
#

Ahh the article is for Linux whoops

hushed spindle
#

i could just try to reinstall the jdk again and see if that works

#

although it kind of appears like the jdk im trying to install is actually an jre judging by the way it acts

white plover
#

hmm weird

cloud berry
#

guys wat tf is this error...? i literally can't do anything wit my project

#

no errors in buildpath

#

all i did was swap out luckperms jars version 4 to 5...

#

im just trynna switch api versions ._.

hushed spindle
#

did you update the build path/analyze dependencies

cloud berry
#

wat? how do i do this?

#

ive never had 2 do anything b4 while changing dependencies

hushed spindle
#

there should just be a button for analyze dependencies either in a menu or when right clicking idk

#

i havent used eclipse in a while

#

or just remove and re-add the dependency

cloud berry
#

i mean theres refresh but it didnt do anything

cloud berry
hushed spindle
#

did you add it back in yet

cloud berry
#

no...

#

like

#

it should be throwin errors about unknown imports...

#

read th error message its weird af, wtf is an included .class file?

hushed spindle
#

right now its throwing that error because it cant find the dependency you're trying to code with, removing the dependency shouldnt change that

cloud berry
#

ok added it back... same error

#

bruh this isnt the right error :I

#

something else's fucked up

#

oh ok

#

@hushed spindle ok i figured it out... i added th old version back in & it works cuz they changed the import

#

but

#

like

#

why cant it show me normal errors taht i can click on? -_-

hushed spindle
#

could be a jar import issue or an eclipse issue

cloud berry
#

i click on that error msg & it sends me to line 0 which is a fucken comment...

#

yea nothings working rite 4 me today -_-

#

ill just have 2 find errors manually scannin files 4 red underlines

#

fml

gaunt hatch
#

Does anyone have a sample of using shadow jar 7 and gradle 7 with java 16?

#

can not get figured out

cloud berry
#

its fuckin hell bruh

lime hollow
#

how to change "tab" menu?

cloud berry
#

whoevr decided java16 was a good idea @ mojang needs 2 b thrown in max secorety prison

#

/rant

gaunt hatch
#

I had no issues getting the code setup for java 16, its just the gradle is my issue. So much changed

cloud berry
#

istg i woulda broken somethin in me room rn if i didnt ahv a 4wk old cat in me lap 🤣

hushed spindle
#

im just havin weird ass errors where the jdk is acting like a jre so i cant actually compile anything

cloud berry
#

oh dam ;-;

quiet ice
#

time to uninstall some stuff

lean wadi
#

geol: wiping the work folder ended up fixing it. somehow.

gaunt hatch
odd sentinel
#

all I did was bump the version to 7.0.0

#

or are you coming from gradle v6->7 too?

gaunt hatch
#

yea

#

when i bump to 7 it doesnt find the version

odd sentinel
#

the only change I had to make when I updated to v7 is changing compile to implementation in gradle.build

gaunt hatch
#

did you have a node like this?

odd sentinel
#

id "com.github.johnrengelman.shadow" version "7.0.0"

gaunt hatch
#
    dependencies {
        include('org.slf4j:slf4j-api')
        include('org.slf4j:slf4j-log4j12')
        include('log4j:log4j')
        include('com.zaxxer:HikariCP')
        include('mysql:mysql-connector-java')
    }
}```
odd sentinel
#

no I exclude

shadow gazelle
#

I don't know what I did, but anytime I build the plugin jar it only has the Spigot API

#

I've tried resetting the artifact settings and it still does it

#

IntelliJ

maiden thicket
shadow gazelle
#

Build Artifacts

maiden thicket
#

your plugin doesnt export spigot

shadow gazelle
#

I built another plugin before and it was fine

maiden thicket
#

spigot is a provided thing

#

it shouldnt have to export it

#

considering ur putting it on a spigot server

shadow gazelle
#

Okay, but how do I make it build the jar with my code?

gaunt hatch
#

yea cant get shadow to work

maiden thicket
#

build artifacts will do that for you

shadow gazelle
#

:l

#

I'm using build artifacts, but when I build it, my code isn't there

maiden thicket
#

you created a new jar empty with dependencies right

shadow gazelle
#

What

maiden thicket
#

for your artifacts settings

crude axle
#

Also, How do I fix this problem? ```
[ERROR] /C:/Users/eirik/IdeaProjects/Movecraft/modules/v1_17_R1/src/main/java/net/countercraft/movecraft/compat/v1_17_R1/IWorldHandler.java:[20,39] cannot access net.minecraft.world.le
vel.chunk.ChunkSection
[ERROR] bad class file: C:\Users\eirik.m2\repository\org\bukkit\craftbukkit\1.17-R0.1-SNAPSHOT\craftbukkit-1.17-R0.1-SNAPSHOT.jar(/net/minecraft/world/level/chunk/ChunkSection.class
)
[ERROR] class file has wrong version 60.0, should be 55.0
[ERROR] Please remove or make sure it appears in the correct subdirectory of the classpath.

#

Happens to multiple classes

#

Tried changing the SDK to jdk 16, with no luck

quiet ice
#

You might need to update the compile target to 16

#

Since you are now binding into Java 16; a Java 11 compiler might not be able to understand J16 bytecode

gaunt hatch
#

So no one has any idea about shadow jar error:
[Fatal Error] '': Already seen doctype.

plucky comet
#

is there a way to ```java
getConfig().containsignorecase()

round tundra
#

anyone know how i go about making player heads in guis load instantly? I tried adding them to a hashmap running async before the gui is opened but still no luck :/

quaint mantle
wet breach
quaint mantle
#

how i can fix this?

ivory sleet
#

Is the class package private?

#

Then you’ll have to reflect it

quaint mantle
#

public abstract class NPC

#

and Packet is public interface

wet breach
#

you are referencing the incorrect place for that class
while you might see that class in that location in the minecraft jar, in the server jar for spigot it is simply located in net.minecraft.server.(version).Packet

ivory sleet
#

Why shadowJar.include that? Implementation will automatically be shaded

gaunt hatch
#

Will Implementation include it in the jar build?

ivory sleet
#

For shadowJar yes

gaunt hatch
#

Same errors still removing the shadowjar node

wet breach
ivory sleet
#

What’s the error doccode

gaunt hatch
#

[Fatal Error] HikariCP-4.0.3.pom:2:10: Already seen doctype.
[Fatal Error] slf4j-api-1.7.30.pom:2:10: Already seen doctype.

ivory sleet
#

Frostalf I believe they just ended up not using spigot mappings

wet breach
#

o.O

#

really?

ivory sleet
#

Yeah switched to the mojang ones iirc

wet breach
#

well that isn't part of spigot mappings

ivory sleet
#

Tbf no clue I just know net.minecraft.server.version isn’t a thing in 1.17

wet breach
#

ah so they stopped with the versioning of NMS

ivory sleet
#

Yup from what I understand

gaunt hatch
#

which is great

wet breach
#

well then its located in net.minecraft.server.Packet

quaint mantle
wet breach
#

unless they stopped with the relocating files as well

gaunt hatch
#

Those errors tell you anything @ivory sleet

ivory sleet
#

DocCodeSharp do you use maven and gradle?

gaunt hatch
#

gradle

#

7.0.2

shadow gazelle
#

If I added custom NBT tags to an item, would they not show up in something like NBTExplorer?

wet breach
quaint mantle
shadow gazelle
#

1.8

gaunt hatch
#

oh.....

ivory sleet
#

DocCodeSharp remove the dependencies in shadowJar

gaunt hatch
#

same errors

ivory sleet
#

It shouldn’t be needed also did you declare the right repos?

wet breach
#

@gaunt hatch https://jolbox.com/ is no longer a valid maven repo

ivory sleet
#

you also need mavenCentral()

#

If you wanna use those repos

wet breach
#

@gaunt hatch also you specified jolbox twice

#

not that it matters anymore since its not valid anyways lol

gaunt hatch
#

yea i never saw that hahaha

ivory sleet
#

Like you declared mavenLocal(), add mavenCentral() also

gaunt hatch
#

sweet

#

mavenCentral() fixed it

#

i removed all others

ivory sleet
#

Yep

wet breach
#

there you go, told you it was maven repo related šŸ˜›

ivory sleet
#

Whenever u wanna declare a repo url mavenCentral is crucially needed

gaunt hatch
#

i remeber that in gradle 6 and it throw the biggest fit

wet breach
#

now you know when you see doctype seen errors, its maven repo related šŸ˜‰

gaunt hatch
#

Thank you

#

Yes i do, 15 years of coding and never seen that one error before. Seen it say like not found in the repo but that one was new

ivory sleet
#

Yeah didn’t know it was considered a fatal error lol

wet breach
#

what it actually means is that it attempted to look for it, but wasn't getting the correct document page for the repo where it should search

gaunt hatch
#

the best part o googles that error and i found NOTHING!! saying that lol.

ivory sleet
#

Spigot help-development > google KEKW

gaunt hatch
#

woo install is gone on gradle 7

wet breach
#

https://discuss.gradle.org/t/apparent-dependency-resolving-problem/2004
@gaunt hatch go to the bottom user has it explained

Gradle Forums

Hello, During resolving dependency of ā€˜org.apache.axis2:axis2-ant-plugin:1.6.1’ (and happens with others too) several fatal errors (see below) are shown by gradle (milestone-9). Despite that fresh downloads and the build is reported to be successful. There were no such things earlier. The closest thing I could find is: http://gradle.1045684.n5...

ivory sleet
#

Frostalf do you use gradle or maven btw?

wet breach
#

Maven

ivory sleet
#

šŸ˜”

quaint mantle
#

how to compile project artifacts like maven install?

iron condor
#

what does this mean?

Vote listeners can be compiled by including Votifier in the class path. For example:

javac -cp Votifier.jar FlatfileVoteListener.java

Can't figure out on how to do it with intellij

gaunt hatch
#

gradle had install in 6 seems its gone in 7

quaint mantle
#

if i'm compiling with maven i got this:
cannot access net.minecraft.network.protocol.Packet

shadow gazelle
#

Anyone have any ideas on what I did wrong here? Or, if I did anything wrong? NBTExplorer doesn't show the custom NBT tag.

    private static void createBluePants() {
        ItemStack itemB = new ItemStack(Material.LEATHER_LEGGINGS);
        LeatherArmorMeta meta = (LeatherArmorMeta) itemB.getItemMeta();
        meta.setColor(Color.BLUE);
        meta.setDisplayName("§9Fresh Blue Pants");
        meta.spigot().setUnbreakable(true);
        List<String> lore = new ArrayList<>();
        lore.add("§7Kept on death!");
        meta.setLore(lore);
        itemB.setItemMeta(meta);
        net.minecraft.server.v1_8_R3.ItemStack nmsLeatherLeggings = CraftItemStack.asNMSCopy(itemB);
        NBTTagCompound leggingsCompound = (nmsLeatherLeggings.hasTag()) ? nmsLeatherLeggings.getTag() : new NBTTagCompound();
        leggingsCompound.set("KeptOnDeath", new NBTTagString("true"));
        nmsLeatherLeggings.setTag(leggingsCompound);
        CraftItemStack.asBukkitCopy(nmsLeatherLeggings);
        freshPantsB = itemB;
    }
wet breach
shadow gazelle
#

NBTExplorer entry for it

wet breach
#

alright, is the plugin you are trying to compile even for 1.17?

#

or whatever it is you are depending on

#

if not, then your issue is a mis-match in versions due to NMS being different between 1.16 and 1.17

gaunt hatch
#

Well that sucks them removing maven from gradle 7 removed alot of key features they have not added back. That is a bad choice

past maple
#

How using nms ItemStack with spigot 1.17, I didn't found the class net.minecraft.server.ItemStack ?

quaint mantle
#

I have already converted everything I need under 1.17

#

It can't execute import

gaunt hatch
quaint mantle
past maple
#

More complicated in 1.17 than 1.16

gaunt hatch
#

its better tbh

young knoll
gaunt hatch
#

cause the removal of nbt version any future update you do not have to worry about where it changed. If they keep it that way that is

wet breach
quaint mantle
gaunt hatch
#

Yea the obvustion in 1.17 went backwards alot where in 1.16 it was great. it sucks now seems like the patchs did not update the objects the same

quaint mantle
shadow gazelle
young knoll
#

I assume they will fully transition the mappings eventually

gaunt hatch
quaint mantle
wet breach
quaint mantle
#
<dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot</artifactId>
            <version>1.17-R0.1-SNAPSHOT</version>
            <classifier>remapped-mojang</classifier>
            <scope>system</scope>
            <systemPath>C:/Users/Aniby/Desktop/BuildTools/spigot-1.17.jar</systemPath>
        </dependency>
quaint mantle
wet breach
#

why do you set a classifier tag?

#

instead of using a system scope tag, why not just install the server jar into your local maven repo instead?

#

shouldn't change anything, just looks better doing it that way is all

somber hull
#

how the fuck do i tell if a player inputed a number?

#

Since its a string

wet breach
#

parse the message for numbers

quaint mantle
somber hull
#
            if(!(isNumeric(args[1]))) {
                plr.sendMessage("Please type a number!");
                return true;
            }
            float xp = Float.parseFloat(args[1]);
            float curXp = plr.getExp();
            plr.setExp(curXp-xp);
#
    public static boolean isNumeric(String strNum) {
        if (strNum == null) {
            return false;
        }
        try {
            double d = Float.parseFloat(strNum);
        } catch (NumberFormatException nfe) {
            return false;
        }
        return true;
    }
#

gives me an NPE on plr.setExp(curXp-xp);

quaint mantle
#

use Doube.parseDouble()

somber hull
#

but XP is a float

quaint mantle
#

use float instead double in try?

somber hull
#

holy shit

#

thank you

#

lol

#

i copy pasted this from a website that used doubles

#

guesse i forgot to change that

wet breach
#

NumberUtils.isCreatable(String)

#

from Apache Commons which is shaded into spigot, that method checks if the string is a number of any kind

somber hull
#

oh shit, ok

#

so it returns true if it is a number?

wet breach
#

yep

#

whether it is an int, double, float, scientific notation

quaint mantle
#

idk what i should do with cannot access net.minecraft.network.protocol.Packet

lilac valve
somber hull
#

@wet breach all im seeing is NumberUtils.isNumber

quaint mantle
somber hull
#

and its deprecieated

quaint mantle
#

you shouldn't use it

lilac valve
wet breach
#

seems apache commons might have updated their methods for such things lol

somber hull
#

there is isDigit, isNumber, etc

wet breach
#

try refreshing

somber hull
#

if(NumberUtils.isCreatable(args[1])) {

#

ohhh

lilac valve
somber hull
#

numberUtils is deprecieated?

lilac valve
somber hull
wet breach
#

@lilac valve
ZOMBIFIED_PIGLIN_SPAWN_EGG should be the last thing on that list

quaint mantle
#

I need any help with it. It wouldn't compile
cannot access net.minecraft.network.protocol.Packet

lilac valve
somber hull
#

@wet breach there is StringUtils with isNumeric

wet breach
#

that should work too

somber hull
#

wait, but i still got an NPE

#

on here

#

plr.setExp(curXp-xp);

#

omg

#

leme see if im dumb

wet breach
#

then in that case probably should validate the inputs on top of insuring you are not subtracting from 0 when a player doesn't have xp šŸ˜‰

#

as well as making sure that the xp specified isn't larger then what the player has, otherwise you end up in the negatives as well

plucky comet
#
   public static ItemStack createItemByte(Inventory inv, int materialId, int byteId, int amount, int invSlot, String displayName, boolean hideFlags, String... loreString){
        ItemStack item;
        List<String> lore = new ArrayList();

        item = new ItemStack(Material.getMaterial(materialId), amount, (short) byteId);

        ItemMeta meta= item.getItemMeta();
        meta.setDisplayName(Utils.formatChat(displayName));
        for(String s : loreString){
            lore.add(Utils.formatChat(s));
        }
        if (hideFlags){
            meta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES, ItemFlag.HIDE_POTION_EFFECTS);

        }
        meta.setLore(lore);
        item.setItemMeta(meta);
        inv.setItem(invSlot, item);

        return item;

    }
}```Im getting a null pointer exception on this line invslot is = to 15
gaunt hatch
#

i am so not a fan of this update lol now i cant get maven-publish publishToMavelLocal() to work lol

wet breach
#

Guess this is one of the few times where maven wins šŸ˜„

gaunt hatch
#

In this case yes! lol

#

Just not a fan of maven over all, but now idk lol

wet breach
#

well I mean, can't really beat it just works most of the time

#

only times I have ever had problems with maven, is when some maven plugins had difficulties updating to new java versions

eternal night
#

I guess wait for papermcs tooling to come out

#

that is going to be gradle based

fierce barn
#

so previously in 1.16,

import net.minecraft.server.v1_16_R3.WorldServer;

was the way to grab the WorldServer import, however in 1.17, there isnt any version to grab there anymore, and im not finding any sources on any changes šŸ˜“

#

i see an alternative method that uses

import net.minecraft.server.level.WorldServer;

however im not sure if it references the same way. simply, i'm just trying to use addEntity(world)

young knoll
#

That is correct

#

"This being said there are some important changes to NMS this release, namely that all fields have been reverted to their obfuscated form. This, along with the repackaging of NMS, are crucial steps in the highly requested process of transitioning to using the so-called 'Mojang Mappings' for development of Spigot itself."

See 1.17 post

spare socket
#

The Mojang Mappings use server.level so it's not updated every version

iron condor
#

Is there a way to disable player skin (so it shows steave or alex) without changing the name?

fierce barn
#

gotcha šŸ‘

iron condor
#

I saw some old post on bukkit about that and had something to do with packets

gaunt hatch
#

i wonder why they changed it like that and it went back to there obfuscated form.

young knoll
#

I mean

#

It says

** This, along with the repackaging of NMS, are crucial steps in the highly requested process of transitioning to using the so-called 'Mojang Mappings' for development of Spigot itself."**

spare socket
gaunt hatch
#

yea but how is obfuscated object mojang mappings?

young knoll
#

It's not

#

It's a step

coral schooner
#

I found a critical issue with the new spigot release! Where do I report it?

young knoll
#

?bugs

gaunt hatch
#

I feel a step that could have waited till it was compelted, but that is just me šŸ™‚

young knoll
#

Darn

coral schooner
#

Yes

#

Bugs

spare socket
#

Just report it on the forums

young knoll
#

No no

gaunt hatch
#

?Bug

young knoll
spare socket
#

oh right the pain of jira

young knoll
#

Alright plugin update is done

#

Theoretically, need Protocollib to actually try it

gaunt hatch
#

i am stuck on getting publishing to work lol

spare socket
#

I'm just laughing at how fast some of us plugin devs are updating their plugins considering it's been out... not even 24 hours

fierce barn
#

just ready to get on the grind yakno

young knoll
#

Honestly messing with java 16 took the longest

wispy fossil
#

just to avoid the sprawl of "pLz 1.17 sUpPoRt" i think it's worth it

young knoll
#

Needed to jump to the beta 21-06 build of eclipse for java 16

spare socket
#

Considering I've been working in Java 16 since it came out it wasn't to bad for me to fix up my few plugins

shadow gazelle
#

How would I search for a specific NBT tag in an item?

fierce barn
#

items are a little harder iirc, because the NBT's get wiped as they get picked up iirc...

#

may be confusing it with something else

shadow gazelle
#

No Nitro emojis here...

#

I think you are

young knoll
#

The entity nbt will be

fierce barn
#

this may help

young knoll
#

But not the itemstack

shadow gazelle
#

I'm trying to make it so that when a player dies, their inventory is searched, and if they had an item with the custom NBT tag I added, then the item would be right back where it was

#

Like keep inventory, but only for one or a few items

fierce barn
#
NBTItem#setString(String key, String value)
NBTItem#setInteger(String key, Integer value)

NBTItem#getString(String key)
NBTItem#getObject(String key)

or

NBTItem#getKeys()
Which will return a Set<String> of all keys, which will be easy to iterate through.

stated by Oscaaz in thread: https://www.spigotmc.org/threads/get-all-nbt-tags-created-by-my-plugin.392133/#post-3529416

shadow gazelle
#

Is that only a thing in newer versions?

#

I'm using 1.8.8

fierce barn
#

oof

#

your way back

shadow gazelle
#

NBTItem isn't a thing

fierce barn
#

for 1.8.8

#

youd probably have to do...

#

Metadata over NBT's

shadow gazelle
#

I was thinking check the item for the NBT tag

#

Because it's the same every time

#

Unless it's not there

gaunt hatch
#

anyone use maven-publish before to copy to local?

shadow gazelle
#

if(is.getItemMeta() is what I have right now, I can't process what would go after that

fierce barn
#

ah gotcha

#
if (proj.hasMetadata("Poison")) {
       damagedEntity.addPotionEffect(new PotionEffect(PotionEffectType.POISON, 80, 1));
}
#

just something i grabbed rq

#

i'll show you how i applied the poison

#
if (ability == "PoisonShot") {
        proj.setMetadata("PoisonShot", new FixedMetadataValue(plugin, true));
        plugin.masterCD = 8;
        plugin.cooldowns.put(PoisonUUID, plugin.masterCD);
        ability = "None";
}
#

so whenever the item is generated, use the setmetadata line, put "Soundbound" or something

#

then read .hasMetadata("Soulbound") when you iterate through the table on your itemstacks

#

the quick and dirty way i can imagine saving it to the same exact slot position would be to write over the same metadata, like "Soulbound 27", then set it to slot27 and write it back to Soulbound

eternal night
#

string comparison is done using String#equals not ==

shadow gazelle
#

This is what I have for generating the item

    private static void createBluePants() {
        ItemStack itemB = new ItemStack(Material.LEATHER_LEGGINGS);
        net.minecraft.server.v1_8_R3.ItemStack nmsLeatherLeggings = CraftItemStack.asNMSCopy(itemB);
        NBTTagCompound leggingsCompound = (nmsLeatherLeggings.hasTag()) ? nmsLeatherLeggings.getTag() : new NBTTagCompound();
        leggingsCompound.set("KeptOnDeath", new NBTTagInt(1));
        nmsLeatherLeggings.setTag(leggingsCompound);
        CraftItemStack.asBukkitCopy(nmsLeatherLeggings);
        ItemStack ItemB = CraftItemStack.asBukkitCopy(nmsLeatherLeggings);
        LeatherArmorMeta meta = (LeatherArmorMeta) ItemB.getItemMeta();
        meta.setColor(Color.BLUE);
        meta.setDisplayName("§9Fresh Blue Pants");
        meta.spigot().setUnbreakable(true);
        List<String> lore = new ArrayList<>();
        lore.add("§7Kept on death!");
        meta.setLore(lore);
        ItemB.setItemMeta(meta);
        freshPantsB = ItemB;
    }
fierce barn
eternal night
#

yes it won't error, it may just not work at all

fierce barn
#

it definitely works

#

may just be one of those things where its soon to be depreciated

eternal night
#

it works because you are lucky you are hitting the string cache twice here.

shadow gazelle
#

Is there any way to put an NBTTag onto an item that only has a name?

eternal night
#

This is not how string comparison is supposed to be done and is just straight up bad style

fierce barn
#

^not disagreeing

eternal night
#

okay xD

fierce barn
#

like a default itemstack?

shadow gazelle
#

Ignore that

#

it's saying hasItemMeta can't be applied to a string

eternal night
#

maybe you are calling it on a string xD

fierce barn
#

is how it looks for me

#

not sure how it puts it in 1.8.8

fair venture
#

Which mappings does spigot use for their minecraft server patches for 1.17?

shadow gazelle
#

I forgot to delete the old thing lol

fierce barn
#

server.level

eternal night
#

internally spigot still uses spigot mappings

shadow gazelle
#

Wait

#

No

fair venture
shadow gazelle
#

rip

#

hasMetadata isn't in 1.8

eternal night
#

maybe, just maybe, 1.8 is outdated and a pain to work with

fierce barn
#

you can setLore in 1.8

#

you'll have to mess around with lore likely

eternal night
#

tbh anything 1.13+ should just stick to PDC for these things btw

#

idk if that is applicable to you fatul

quaint mantle
#

I’m not sure if this is the right place to ask, but I am trying to figure something out and need some higher up help. I’m trying to figure out how to disable vein miner for one specific player, and can’t figure out a solution (if there is one) can someone help me?

fierce barn
#

just trying to update my 1.16 PVP plugin to 1.17

#

still pretty confused with the mappings

fierce barn
#

for example in usage of saber factions:

dusk flicker
#

oh god the main is named Main

fierce barn
#

yeah haha

#

its my first plugin, but ive been working on it on and off for 2-3 years

#

lot of old stuff mixed with new

hybrid spoke
fierce barn
#

uhh

#

it just likes that line... yakno

#

chill area

gaunt hatch
#

OMG YES!!! I got it to publish

#

For anyone having issues

publishing {
    publications {
        shadow(MavenPublication) { publication ->
            project.shadow.component(publication)
        }
    }
    repositories {
        mavenLocal()
    }
}
quaint mantle
# fierce barn for example in usage of saber factions:

See I’m not well experienced in writing scripts. I’m learning to code but am brand new to it. Would I have to use something like the ā€œscriptā€ plugin? And then disable veinminer for that specific player?

shadow gazelle
#

Does an event need an init?

fierce barn
#

you can just enable that specific class onEnable ^^^

#

if this is what you mean

shadow gazelle
#

Okay

fierce barn
#

commands are a little different in my case

#

same class, different command

fierce barn
#

CodedRed and TechnoVision on youtube have good sources of learning

#

you can think events as an action in the game

#

like BlockBreakEvent

#

BlockPlaceEvent, etc

quaint mantle
fierce barn
#

yw

empty swallow
#

i do it little differently

maiden cape
#

Why do Phantom and Slime not have a base interface called like "Sizeable"

#
public interface Phantom extends Flying {

    /**
     * @return The size of the phantom
     */
    public int getSize();

    /**
     * @param sz The new size of the phantom.
     */
    public void setSize(int sz);
}
fierce barn
#

are you referring to the different size stages of slimes?

maiden cape
#
public interface Slime extends Mob {

    /**
     * @return The size of the slime
     */
    public int getSize();

    /**
     * @param sz The new size of the slime.
     */
    public void setSize(int sz);
}
#

wth is the point of this

fierce barn
#

they felt like trolling

shadow gazelle
#

Cloning the item that is supposed to be kept should be safe, right?

fierce barn
#

id think so yeah

#

anyone know where all the pathfinders fall under now?

shadow gazelle
#

How would I get the inventory slot it was in and put the item there?

paper viper
#

they dont use the v1_16_R3 stuff anymore

#

they just completely changed the package names

sullen marlin
#

Yeah any decent ide will import them

#

Class names Haven't changed

fierce barn
#

yeah i just didnt see it fall under the drop down list anywhere

paper viper
#

^

sullen marlin
#

(unless you use the Mojang maps)

fierce barn
#

yeah your right lmao

#

i did lose 2 of them in the process though

#

i guess GoalHurtByTarget and GoalSelector arent in anymore?. nope nevermind. its inside, goal.target

fresh lichen
#

any info on other repositories besides maven central?

paper viper
#

they arent supported

#

you have to handle that yourself

#

for that case

fresh lichen
#

if spigot already loads them from maven, what stops us from using it to load from literally different URL?

quaint mantle
fresh lichen
#

why use some 3rd party library just for that

#

if it has most of it under the hood already

paper viper
#

it can append to classloader in java 16 using agents, use a jarinjar loader

#

install, relocate, check hashes

#

for dependencies

#

a ton of stuff

quaint mantle
#

noice, thanks for that

paper viper
#

np

vestal dome
#

Uhhhh

#

I have a server that sends a PluginMessage to the bungeecord, is there a way that the Bungeecord can detect which server sent the plugin message?

dense geyser
#

not without the plugin sending that message putting the server in the message afaik

vestal dome
#

bru

#

how would I put the server on the message if I don't have that info

#

is there a plugin channel?

fierce barn
#

did you make the plugin that sends the message?

vestal dome
#

to get the server name on the bungee?

#

yes

spring fog
#

How can I check if an entity is x amount of blocks away from the ground?

dense geyser
#

just get the server name and apply it to the message?

sullen marlin
wet breach
#

and MD_5 responded

dense geyser
#

oh nvm

vestal dome
dense geyser
#

md_5 the king

fierce barn
dense geyser
#

what does Player#setMaximumNoDamageTicks do? all the javadoc says is it "sets the maximum no damage ticks" which is really helpful

fierce barn
#

well

vestal dome
#

how can I get the Server using the Connection class?

#

hm

fierce barn
#

oh you just mean over any block in general

#

uh

wet breach
dense geyser
#

ah ok, I just keep seeing it where attack speed is changed (to be made smaller), so I'm really confused

wet breach
#

it is probably used in other places

dense geyser
#

whats the default ticks of an attack speed if it was that?

#

possibly?

fierce barn
# spring fog How can I check if an entity is x amount of blocks away from the ground?
public static List<Block> getBlocksBelow(World world, Location startLoc) {
      List<Block> blocks = new ArrayList<Block>();

      int startY = (int) (startLoc.getY());
      int endY = (int) (startLoc.getY()-255);
        
      for (int y = minY; y <= maxY; y++) {
          blocks.add(loc.getBlock());        
      }
      return blocks;
}

World world = entity.getWorld()

List<Block> blocks = getBlocksBelow(define World as a variable wherever you use this, Entity.getlocation());

for (Block block : blocks) {
    if (block) {
        isGround = true
    }
}

#

shit i misread it again

#

he wants to know WHEN an entity is amount of blocks away

#

šŸ¤¦ā€ā™‚ļø

vestal dome
#

can someone ask me about what I asked?

ivory sleet
#

yes?

fierce barn
vestal dome
#

how can I get the server,

#

out of a plugin message.

#

event.....

fierce barn
#

oh your the same guy from earlier lol

#

5:03 PM] md_5: uh yes, get the sender and get their server

ivory sleet
#

Jadss maybe give me a little recap

fierce barn
#

aka

#

sender.getServer()

sullen marlin
#

doesnt Connection cast to Server even

#

print it out

vital ridge
#

Why does playerdeathevent e.getEntity.getKiller return null?

#
@EventHandler
    public void onDeath(PlayerDeathEvent e) {

        System.out.println("Died");

        if (e.getEntity() instanceof Player) {
            
            Player p = (Player) e.getEntity();
            
            System.out.println(p.getKiller());

            if (p.getKiller() instanceof Sheep) {

                if (p.getKiller().getPassenger() instanceof FallingBlock) {

                    System.out.println("Passenger flyinblock");

                    Sheep sheep = (Sheep) e.getEntity().getKiller();

                    e.setDeathMessage(p.getName() + " was slain by Dirt.");

                }

            }

        }

    }
#

sysout p.getkiller returns null

ivory sleet
#

he wasn't killed by a player then

fierce barn
#

^

vital ridge
#

PlayerDeathEvent only registers when you get killed by a player??

ivory sleet
#

yup

vital ridge
#

ohh aight

#

didnt know that

#

sry

#

and thank you

ivory sleet
gaunt hatch
#

That moment when WE is not updated and you are thinking of just grabbin the code and updating it yourself

shadow gazelle
#

@fierce barn how would I go about cloning and giving that item back to the user, now?

ivory sleet
#

I mean ItemStack implements Cloneable

vital ridge
#

Tho, is deathmessage modifyable in entitydeathevent?

ivory sleet
#

unsure

fierce barn
#

item.clone()

vital ridge
#

SHt yea thats what I need to do

shadow gazelle
vital ridge
#

need to check if player was killed by a sheep with certain conditions

#

and then modify the death message

fierce barn
#
ItemStack clonedItem = new ItemStack(item.clone());
player.getInventory().addItem(clonedItem);

i believe

#

as far as putting it back in the same slot, you'll probably have to wiki that one. i cant give an easy answer rn

shadow gazelle
#

I've looked at about 20 different threads already

fierce barn
#

i'll see if i can help then

gaunt hatch
#

you dont need to create it new

shadow gazelle
#

After it gets deleted?

gaunt hatch
#
player.getInventory().addItem(item.clone());
#

the clone makes a new object for it

fierce barn
#

does 1.8 have this?

getItem​(EquipmentSlot slot)
ivory sleet
shadow gazelle
#

Well, it doesn't have item

ivory sleet
shadow gazelle
#

And when I use ItemStack.clone() it gives me, cannot be referenced from static context

ivory sleet
#

yeah its an instance method

fierce barn
#

alright

#

i kinda see where you coming from then

shadow gazelle
#

Can't use item, though

fierce barn
#

i just did item as a variable

#

assuming it was already variabled

shadow gazelle
#

oh

fierce barn
#

but you probably arent even looping for the item yet are you

shadow gazelle
#

I am

#

I think

fierce barn
#

and does it find the soulbound item?

ivory sleet
#

?paste your code

undone axleBOT
vital ridge
#

Is there any possible way to modify a death message when player gets killed by an animal or any other entity under EntityDamageEvent?

paper viper
#

yes by the death event

vital ridge
#

Yea but playerdeathevent works only if a player kills you

vital ridge
#

it always returned null when a sheep killed me

ivory sleet
#

Yeah Nuxoria, technically you could just nullify the message in the death event and then use EntityDamageByEntityEvent to send the messages

fierce barn
#

did you check to see if it actually found the KeptOnDeath meta yet?

ivory sleet
#

also getItemMeta()#equals(String) will always be false

fierce barn
#
    public void onPlayerDeath(PlayerDeathEvent event) {
        Player player = event.getEntity();
        Inventory inv = player.getInventory();
        event.getDrops().clear();

        for (int i = 0; i < inv.getSize(); i++) {
            ItemStack invItem = inv.getItem(i);
            if(invItem != null) {
                if (invItem.getItemMeta().equals("KeptOnDeath")) {
                    player.sendMessage(ChatColor.PURPLE+"Found Soulbound item!");
                    player.getInventory().addItem(invItem.clone());
                    return;
                }
            }
        }
    }
}
#

check if it'll send you a message to that step first

#

just to verify

#

also

#
player.getInventory().addItem(invItem.clone());
#

should work

shadow gazelle
#

PURPLE is invalid

#

I love 1.8

fierce barn
#

oop

#

remove the color then haha

vital ridge
shadow gazelle
#

ChatColor isn't, PURPLE is

#

šŸ¤”

ivory sleet
#

its like PINK and DARK_PINK or smtng

shadow gazelle
#

Oh

#

DARK

#

DARK_PURPLE

ivory sleet
#

nvm

ivory sleet
fierce barn
#

yeah just try that

#

remove the chatcolor though if you want lol. forgot to change it

ivory sleet
#

tho still invItem.getItemMeta().equals("KeptOnDeath") is always false

fierce barn
#

1.8 doesn't have hasItemMeta iirc

#

hm

ivory sleet
#

oh it's not about that, just that you cant compare an itemmeta instance against a string

#

or I mean you can but they will never be equal

shadow gazelle
ivory sleet
#

Well what are you trying to do?

shadow gazelle
#

Check if the item has the KeptOnDeath NBT tag

fierce barn
#

i showed him a method earlier but the crux was that hasItemMeta compares a string

#

which wasnt valid in 1.8 so it led here

ivory sleet
#

oh yeah

#

well 1.8 doesn't have any nbt api afaik

fierce barn
#

none

ivory sleet
#

so either go with nms or something like nbt api

shadow gazelle
#

Using nms for making the custom tag on the item, how would I use that to check the item?

fierce barn
#

the easiest solution would be Lore

#

if you dont mind the player seeing the text