#help-development

1 messages · Page 1498 of 1

fierce barn
#

actually there is a method to make it invisible

#

not sure if it applies in 1.8

shadow gazelle
#

They already say. "Kept on death!"

fierce barn
#

LORE

public static void encryptItem(ItemStack i, String message) {
        ItemMeta im = i.getItemMeta();
        List<String> lore = new ArrayList<String>(im.getLore());
        String crypt = encryptString(message);
        lore.add(0, crypt);
        im.setLore(lore);
        i.setItemMeta(im);
    }
 
    public static String encryptString(String message) {
        String crypt = "";
        for (char c : message.toCharArray()) {
            crypt += ChatColor.COLOR_CHAR + Character.toString(c);
        }
        return crypt;
    }
 
    public static String decryptItem(ItemStack i) {
        if (i != null) {
            if (i.hasItemMeta()) {
                List<String> lore = i.getItemMeta().getLore();
                if (lore != null) {
                    if (lore.size() > 0) {
                        StringBuilder sb = new StringBuilder();
                        for (char c : lore.get(0).toCharArray()) {
                            if (c != ChatColor.COLOR_CHAR) {
                                sb.append(c);
                            }
                        }
                        return sb.toString();
                    }
                }
            }
        }
        return null;
    }
shadow gazelle
#

Could probably use that

fierce barn
#

NVM: hasItemMeta

#

smh

ivory sleet
#
//setting
ItemStack stack = ...;
net.minecraft.server.1_8_R3.ItemStack nmsStack = CraftItemStack.asNMSCopy(stack);
NBTTagCompound tag = nmsItem.hasTag() ? nmsItem.getTag() : new NBTTagCompound();
tag.setInt("keepOnDeath",1);
nmsStack.setTag(tag);
stack = CraftItemStack.asBukkitCopy(nmsStack);

//checking
boolean keepOnDeath;
ItemStack stack = ...;
net.minecraft.server.1_8_R3.ItemStack nmsStack = CraftItemStack.asNMSCopy(stack);
NBTTagCompound tag = nmsItem.hasTag() ? nmsItem.getTag() : new NBTTagCompound();
keepOnDeath = tag.getInt("keepOnDeath") == 1;
if (keepOnDeath) {
  //todo
}
shadow gazelle
#

With lore, couldn't I just do something like if lore == "this" run other stuff?

ivory sleet
#

uh you'd have to check if the List of strings contains your string

#

or not even that

fierce barn
#

yeah im pretty sure you can

ivory sleet
#

you'd need to manually loop and see if each string might be equal to your string

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) {
                ItemMeta metaofItem = invItem.getItemMeta();
                List<String> lore = metaofItem.getLore();
            
                if (lore != null && metaofItem .getLore().contains("KeptOnDeath")) {
                    player.sendMessage(ChatColor.PURPLE+"Found Soulbound item!");
                    player.getInventory().addItem(invItem.clone());
                    return;
                }

            }

        }
}

#

try that

shadow gazelle
#

Guess what isn't in 1.8 this time

fierce barn
#

getitemmeta?

shadow gazelle
#

getLore

fierce barn
#

lol

#

why 1.8 anyway

shadow gazelle
#

Wait

#

nvm

#

I'm just too big brain to import libraries it needs

shadow gazelle
fierce barn
#

theres plugins that convert it to old PVP

#

ive used them in the past

#

and pretty decent

shadow gazelle
#

Eh

fierce barn
#

my plugin is PVP orientated as well

#

i guess the performance is debatable tho.. there is mods for that however

#

oh forgot a line

plucky comet
#

in yml is it True or true

fierce barn
#

which yml

#

OH

plucky comet
#

the yaml language

fierce barn
#

yeah misunderstood sorry

#

uh

plucky comet
#

in python its True in java its true just wondering which one yaml is

fierce barn
#

i think lowercase should work fine

plucky comet
#

thx

fierce barn
#

i dont mess with yml too much

shadow gazelle
plucky comet
#

What do you mess with

fierce barn
#

if (lore != null

plucky comet
#

Do you use json?

fierce barn
#

nope, i just havent done much work involving yml/json

#

although i do understand json a little more than yml probably

plucky comet
#

Me too I think json is just better but not as newuser friendly as yml

fierce barn
#

what am i missing here?

opal juniper
#

Ehhhh - it’s better for storage rather than configs imo

fierce barn
paper viper
#

you know what super does obviously right

fierce barn
#

kinda

#

havent touched my plugin in a few months lol..

paper viper
#

super isnt a plugin concept...

fierce barn
#

it was previously super(EntityType.Zombie, loc)

#

and not erroring

#

in 1.16

#

then in 1.17 it decided that the constructor is undefined

paper viper
#

research what super does

#

then

#

it calls the parent constructor

#

so whatever class you are extending

#

in this case Entity

fierce barn
#

alright

shadow gazelle
#

@fierce barn doesn't work

fierce barn
#

no error?

shadow gazelle
#

Nope

#

Just doesn't send message

fierce barn
#

uh

#

send code again

shadow gazelle
#

Here's an example of the pants btw

reef jolt
#

Hey Guys! I have (hopefully) a small question: does anyone know if net.minecraft.server.v1_16_5.EntityPlayer has been renamed in 1.17? I am updating my plugin to 1.17. This is the error that i am getting: java.lang.ClassNotFoundException: net.minecraft.server.v1_17_R1.EntityPlayer

paper viper
#

they completely changed the package names

reef jolt
#

oh noes

paper viper
#

just import them normally via your IDE

fierce barn
#

i have the package for you

#

uhh

#

import net.minecraft.server.level.EntityPlayer;

reef jolt
#

now i have to filter if the server is running > or < 1.16.5... nice

fierce barn
#

lets print out the list

reef jolt
#

thanks guys!

fierce barn
#

and see if theres anything there

paper viper
#

:/

fierce barn
#

did getWorld().getHandle() disappear or what

#

cant find it lol

reef jolt
#

Not that i know. I made this plugin with a friend, he was the geek that put most things in the plugin.
It does get the packets from a class called "reflect", which changes the server version in the package names

paper viper
fierce barn
#

previously what it was in 1.16

#

1.17 made the constructors throw a fit

#

just trying to backtrack and go from there

paper viper
#

what is the error?

fierce barn
#

actually hold on

paper viper
#

ok i will say this again

#

go into the Entity class

#

and find the constructors

#

Eclipse gotta have some "Open Declaration"

#

or something like that

fierce barn
#

yeah

#

this was generated from source

#

so its EntityTypes instead of EntityType?

shadow gazelle
#

@fierce barn this is good, right?

List<String> lore = metaofItem.getLore();
System.out.println(lore);
paper viper
shadow gazelle
#

If so, it prints nothing

paper viper
#

and also it seems to use nms World

#

not the CraftServer

fierce barn
#

@shadow gazelle

 if (lore != null) {
    for (String getLore: lore) {
        player.sendMessage(lore);
    }
 }
dire marsh
#

damn what are all the plugins using reflection to access nms gonna do!?

fierce barn
#

i dont remember it being EntityTypes

#

blekkkkkk

paper viper
#

nms changes very frequently anyways

#

you have to adapt to the changes

fierce barn
#

yeah....

shadow gazelle
#

@fierce barn no idea what I did wrong here, but it won't build

    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) {
                ItemMeta metaofItem = invItem.getItemMeta();
                List<String> lore = metaofItem.getLore();
                if (lore != null) {
                    for (String getLore: lore) {
                        player.sendMessage(lore);
                    }
#

Closing brackets are below that

lunar schooner
#

For those using NMS (like myself) i came across an interesting change that I didnt see documented today. When you need to supply an enum to a method/constructor signature, it previously was OK to use yourEnumConstant.getClass(), this no longer works, you need to get the class of the actual enum, rather than the class of a constant in that enum 😄

#

just a PSA I Suppose

fierce barn
#

oh yeah

shadow gazelle
#

What

fierce barn
#

def need event handler

#

@EventHandler

#

above the event

#

then you need to register the event

vivid lion
#

Did you put the eventhandler annotation

shadow gazelle
#

Oh

fierce barn
#

in your main do

vivid lion
#

@EventHandler

fierce barn
#
inside your main
private static Plugin plugin;

getServer().getPluginManager().registerEvents(new ClassNameWithDeath(), this);

inside your class with the death event

public Main plugin = Main.getPlugin(Main.class);
vivid lion
#

@shadow gazelle

fierce barn
#

how i have mine setup:

paper viper
#

oh god

fierce barn
paper viper
#

oh god god

#

no no no

#

there is so much wrong

fierce barn
#

lmao

#

yes, it is

#

im aware

hybrid spoke
#

so much = nearly everything

paper viper
#

^

fierce barn
#

first plugin 🤷‍♀️

paper viper
#

the mistakes there arent first plugin mistakes

#

they are java basics mistakes

vivid lion
fierce barn
#

also never had prior java experience

paper viper
#

so much static abuse

#

and also instance is wrong

#

and naming conventions

fierce barn
#

lmao

paper viper
#

and also the generics stuff doesnt have to be specified

#

repeated code too

lofty mulch
#

at least he did something

paper viper
vivid lion
#

Lol

fierce barn
#

yeah, no prior java experience

vivid lion
#

¯\_(ツ)_/¯

lofty mulch
#

did something > did nothing

fierce barn
#

only have actually like

paper viper
#

then learn java first

lofty mulch
#

no he just have to learn java conventions

paper viper
#

look at that static

fierce barn
#

give me a few examples

#

of whats wrong

lofty mulch
#

I though static abuse belongs to java conventions?

paper viper
#

...

hybrid spoke
#

your screenshots are the examples

paper viper
#

How is static abuse a java convention??

#

java is literally OOP

lofty mulch
#

idk

#

i have never read java convention before

paper viper
#

its a mistake

fierce barn
#

instead of static do what?

paper viper
#

its not a convention issue

vivid lion
#

The term abuse should already ring bells

hybrid spoke
#

you should never overuse static

paper viper
#

^^

vivid lion
#

How is that convention

hybrid spoke
#

encapsulate

vivid lion
#

Lol

fierce barn
#

so instead of

private static Plugin plugin;

do

private Plugin plugin;

?

paper viper
#

In that case you need to use dependency injection

#

there are some things that can be static

#

and other things cannot

#

in this case, if you dont use static (which is recommended in general for plugin instances)

#

you have to use dependency injection

lofty mulch
#

nah im gonna die

#

big test today

fierce barn
#

whats the drawbacks of abusing static then?

lofty mulch
#

goodluck with that Fatul

vivid lion
lofty mulch
#

thanks

fierce barn
#

thanks lol.

lofty mulch
paper viper
#

??

lofty mulch
#

¯_(ツ)_/¯

#

I don't remember correctly

paper viper
#

..

lofty mulch
#

gonna die real now

fierce barn
#

the only 2 statics i have in my entire code just about are these 2

hybrid spoke
#

instance variable are more susceptible for NPEs than statics

fierce barn
paper viper
#

The main reason is due to how you should really only be using static for tasks that are for caching

#

and immutable

fierce barn
#

would that still be considered abuse?

paper viper
#

and certain cases

paper viper
#

in this context, it is used inappropriately

hybrid spoke
#

f.e. constants are a good use of statics

paper viper
#

^

hybrid spoke
#

in your case DI, just like pulse said, would be the right way

#

so something like this

private Plugin plugin;
public ListenerClass(JavaPlugin plugin) {
  this.plugin = plugin;
}

// in your onEnable
...registerEvents(new ListenerClass(this), this);
paper viper
#

^

fierce barn
#

i'll definitely work into going that route then

#

once i fix my prior problem

#

may reply to you later on lol

plucky comet
#

is there an on configreload

#

to check when the config reloads

fierce barn
#

not that i know of

#

you can track the command though

plucky comet
fierce barn
#

post made by HunteR(2nd one)

shadow gazelle
plucky comet
#

im trying to only register a command if something is true in the config

paper viper
#

player.sendMessage(lore); huh

fierce barn
#

getLore instead of lore ^^^

plucky comet
fierce barn
#

i couldnt tell you per sey about the events elephant with that usage

shadow gazelle
#

Also, is this right for enabling it?

getServer().getPluginManager().registerEvents(new death(), this);
fierce barn
#

if death() is the name of the class then yeah

shadow gazelle
#

It is

fierce barn
#

that would also be the reason why nothing was printing beforehand btw

#

since the event wasnt registered

shadow gazelle
#

Also getting this

#

For

    public deathListener(Main plugin) {
fierce barn
#

i couldnt tell you how doing it that way

#

if you want it quick and dirty this will work probably in 1.8

#

spoiled it to not burn anyones eyes

#

in your death class:

paper viper
#

that destroys the whole point...

#

you make the static instance to get from the plugin class

#

in that case, the static Plugin isnt necessary. Then again

fierce barn
#

brother,

paper viper
#

this is not a recommended approach

fierce barn
#

neither of us are at that level, and you'll need to guide us a little more than you probably want to in that regard

#

but hes just trying to get one thing to work, if it works, it'll work.

eternal night
#

pulse really trying to tell the spigot community what the recommended way is smh

paper viper
#

somehow i still have hope

#

but then most of us are burned out

eternal night
shadow gazelle
#

There

#

Printed The nbt

paper viper
#

🥲 true

fierce barn
#

nice

shadow gazelle
#

God

#

I'm going to die from trying to find the right windows

fierce barn
#

i didnt realize you werent registering the event from earlier

#

may of saved a lot of time

shadow gazelle
#

Sorry lol

fierce barn
#

all good

#

did targetSelector and goalSelector completely disappear in 1.17?

#

basically the last crux of my problem, i hope

shadow gazelle
#

Because it's the same light gray, I would assume I need to include the §7 in the contains?

fierce barn
#

does 1.8 haveimport net.md_5.bungee.api.ChatColor;?

#

or are you talking about the color of the text in the lore?

shadow gazelle
#

Second thing

fierce barn
#

i dont think you need to include the color

#

when it printed out the list did it include "kept on death!"?

shadow gazelle
fierce barn
#

you may need to include the color then

#

hm

#

actually you dont, i dont think

vague oracle
#

If you are comparing a String with colours in you can just use ChatColor.stripColor();

shadow gazelle
#

@fierce barn this is an interesting new issue

#

I think it has something to do with the position of the item deleting thing, but the pants all got deleted

fierce barn
#

show new code

shadow gazelle
#

That message runs

fierce barn
#

may need to have it wait for a small second

#

uh

#
Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable(){
    public void run(){
         
    }
}, 20*10);    

its highly unlikely that 1.8 will be compatible with this

quaint mantle
#

Hey, if there's any spigot devs who wouldn't mind helping me with a small coding problem, please let me know if u can help, thx

vestal dome
eternal night
#

just ask your question in here 👍

fierce barn
#

@shadow gazelle try that maybe?

#

remove the return; actually

shadow gazelle
#

My Nitro is gone :sad:

quaint mantle
#

I need the codeblock for changing text in chat to other characters, if that's not too complicated

shadow gazelle
#

3 months Nitro from EG for free time

fierce barn
#

oop

#

change 20 * 10 to 20 * 1

shadow gazelle
#

And remove return?

fierce barn
#

yeah.

#

i doubt it'll work

#

delayedtask/etc has changed naming convention through quite a few versions

vague oracle
#

Are you using that to give them the items back when they respawn?

fierce barn
#

^

vestal dome
#

In the PluginMessageEvent@Bungeecord, the getSender() is what? A "Server" Object or ProxiedPlayer?

fierce barn
#

also need to do @Override over run() too. forgot.

shadow gazelle
vague oracle
#

create a HashMap<UUID, List<ItemStack>> and save all the items into the list when they die, then listen to the PlayerRespawnEvent and if the hashmap contains their UUID as a key, loop through the list and give them their items back.

fierce barn
#

like does it work completely?

shadow gazelle
#

Yes

#

Well, you get spammed

fierce barn
#

uh

shadow gazelle
#

But that should be simple enough to fix

vague oracle
#

They only want some items to be given back right?

shadow gazelle
#

Only the ones with the right lore

fierce barn
#

ok

shadow gazelle
#

And it works, I just get spammed in chat

fierce barn
#

do this to fix the spam

vague oracle
#

So keepinventory wont work then :/ but use what i said

vestal dome
shadow gazelle
#

It spammed because I have 35 in my inv, but

#

It still sends one message for every item saved

ivory sleet
ivory sleet
#

ty Dave

vestal dome
#

nop

shadow gazelle
#

bruh

vestal dome
#

it just says Connection object

shadow gazelle
#

brb, gotta eat dinner

vague oracle
#

So click on it

vestal dome
#

omg...

ivory sleet
#

jadss

vestal dome
#

did you read my question?

ivory sleet
#

check what interfaces extend Connection

vestal dome
#

I know about it ok?

#

I'm not oblivious

#

I even asked "A "server" object or a ProxiedPlayer?"

ivory sleet
#

All Known Subinterfaces:
ConnectedPlayer, PendingConnection, ProxiedPlayer, Server

fierce barn
#
new BukkitRunnable() {
    int count = 0;

    public void run() {
    //code
    }
    count++;
    if (count == 1) {
        this.cancel();
    }
}.runTaskTimer(plugin, 0, 20);
vestal dome
#

This does not explain anything.

fierce barn
#

@shadow gazelle maybe.

ivory sleet
#

It does

fierce barn
#

woops. k

vestal dome
#

I just want to know what I am receiving here..

vague oracle
#

A Conneciton

vestal dome
#

I want to know the interface that is actually extending Connection

#

or implementing

ivory sleet
#

it can be different

vestal dome
#

ok I had to do that

#

I couldn't look at it without saying a word sorry.

ivory sleet
#

It wouldn't return Connection if it only returns one of the subinterfaces of Connection

vestal dome
#

yeah but which one...

ivory sleet
#

Different

vague oracle
#

smh

ivory sleet
#

it can vary from dispatch to dispatch

lofty pebble
ivory sleet
#

In case you need lets say a ProxiedPlayer then safely cast it to that

gaunt hatch
#

I am guessing the server also needs java 16 to run 1.17?

vestal dome
vague oracle
#

Its not that we have told you the answer

vestal dome
#

it would be worth, less, to check if it is a connected player, proxied player.

#

etc.

gaunt hatch
#

hmm now how to get my docker system to have 16 work lol

lofty pebble
vestal dome
ivory sleet
#

Same story goes for an event like EntityDamageEvent, the instance method getEntity() return type is Entity because it can be any subtype of Entity if that makes sense.

lofty pebble
#

so basically just write a check to see if it's the subinterface you want, and if it is then act on it and if it isnt then dont

gaunt hatch
#

openjdk for the server it is 🙂

gaunt hatch
#

Easy up in my container image 🙂

#

'from: java8' to 'from:openjdk16'

ivory sleet
#

just test

#

?javadoc

ivory sleet
#

oo

gaunt hatch
#

well that doesnt work lol

ivory sleet
#

what u tryna do

gaunt hatch
#

setup my docker image to support java 16

#

it seems with using openjdk it can not find the file for the deb http://archive.debian.org/debian jessie-backports main" > /etc/apt/sources.list.d/jessie-backports.list

#

and kill the image create

#

and with i change it to java 16 it cant find java in the build hmmmm

ivory sleet
#

I am very inexperienced with docker so wont be able to help you out sry

gaunt hatch
#

all good

#

Its crazy stuff lol

ivory sleet
#

🥲

gaunt hatch
#

I hate java, why did they have to change to charge for server usage.

ivory sleet
#

🥴

shut field
#

how would I go about setting an ender crystal beam to a player loc with updates

#

without lag

ivory sleet
#

wait let me just grab the docs 1 sec xD

#

?jd

ivory sleet
#

@shut field is that a particle or what would u categorize it as

autumn raft
#

Thanks but I end up doing something different

ivory sleet
#

Hmm crota I mean the least laggy thing would be to use the scheduler

#

it would allow u to change the location 20 times per second at most

shut field
#

so once per tick, that's good with me

ivory sleet
#

Yeah

ivory sleet
#

no

shut field
#

😢

ivory sleet
#

more like

#
Bukkit.getScheduler().runTaskTimer(JavaPlugin.getPlugin(Style.class), () -> {
  enderCryst.setBeamTarget(damager.getLocation());
},1L,1L);
#

without the while loop

shut field
#

what does the second 1L do

ivory sleet
#

delay, interval

#

and its a tick

#

1L = 0.05 seconds

shut field
#

ok thx

plucky comet
#

How do i unregister a command

sullen dome
#

probably PluginCommand#unregister

gaunt hatch
#

hmm... the docker manifest doen't see java:16 as vaild

plucky comet
#

How would i get discord#enabled yaml discord: enabled: true message: - Hi - This is the discord - here

plucky comet
#

like how would i get the value of discord enabled from config

sullen dome
#

which config

plucky comet
#

config.yml

narrow vessel
# plucky comet How would i get discord#enabled ```yaml discord: enabled: true message: ...
BukkitWiki

The Configuration API is a set of tools to help developers quickly parse and emit configuration files that are human readable and editable. Despite the name, the API can easily be used to store plugin data in addition to plugin configuration. Presently only YAML configurations can be used. The API however was designed to be extensible and allow ...

sullen dome
#

if i see it right:

getConfig().getBoolean("discord.enabled");

narrow vessel
#

i recommend reading

sullen dome
#

i first thought he uses jda or smt, but it was just such a simple question lol. i thought too complicated

plucky comet
#

Lmao

sullen dome
#

?

plucky comet
#

Does it return null if its not found?

sullen dome
#

i guess so

#

docs would tell you

plucky comet
#

thx

#
else if (args[0].equalsIgnoreCase("reload")){
                Socials.getInstance().reloadConfig();
                boolean dEnabled = config.getBoolean("discord.enabled");
                if(dEnabled){
                    Socials.getInstance().getCommand("discord").setExecutor(new DiscordCmd());
                } else{
                    Socials.getInstance().getCommand("discord").unregister();
                }```How do i un register a command
ivory sleet
#

No

random wedge
#

Where should issues regarding the Mojang/Spigot mappings be directed to? I've found some things that don't map correctly

sullen marlin
#

?jira

undone axleBOT
waxen locust
#

Hey, I following the tutorial for a plugin- Do I need to name the YAML file something specific or is any name fine?

#

thanks in advance

sullen marlin
#

plugin.yml

waxen locust
#

ty

gaunt hatch
#

Does anyone know I can you can apply to help with spigot development?

sullen marlin
candid silo
#

do you need optifine to have textures of entities based of their names

#

like two mobs of the same type with different textures because they have specific names

fleet wigeon
smoky finch
#

So now with this new 1.17 situation going on, if someone's using NMS, does that mean they have to rename every single class/method/field that they're using thru reflection?

sullen marlin
#

only fields

#

unless theyre using the mojang mappings

smoky finch
#

For example PlayerConnection was moved to net.minecraft.server.network
I was previously using net.minecraft.server.VERSION.PlayerConnection I guess that counts as mojang mappings

sullen marlin
#

oh yes packages moved too

smoky finch
#

With the new system does that at least mean that these are not going to be renamed or moved in the future? I mean the version barrier in the package is gone, but they're not going to rename these fields on future updates, will they?

waxen locust
smoky finch
#

That'd be getEntity()

#

If you mean the child entity

sullen marlin
#

mojang can do whatever

#

there's no guarantees

#

it's not api

waxen locust
vale cradle
#

would be nice to have a way to get to those classes at our own risk

sullen marlin
#

? you can ?

smoky finch
vale cradle
# sullen marlin ? you can ?

We can, but it's really messy, like, package names are changed between versions so, we would need to use Reflection

#

I mean, accessing the low level CraftBukkit/NMS packages without the constant version realocation

smoky finch
#

Wouldn't that mean you're basically saying "add an official Bukkit API for it"

vale cradle
#

No, not an api

#

But a not so messy way to access to them

smoky finch
#

What'd you suggest?

vale cradle
#

I'm not sure what's the reason behind the constant version realocation, but I think it might be omited

smoky finch
#

Well, like md_5 mentioned above, it's up to Mojang you gotta ask them. Spigot can't do anything about that other than to add an official API for it.

vale cradle
#

So, the org.bukkit.craftbukkit packages are realocated by mojang?

sullen marlin
#

they're not api and especially in the cases of mojang classes can change wildly between versions

#

plus you should be adding api rather than using nms

undone light
#

Did the way MapCanvas draws images get changed? Because im ending up with this werid transparency stuff. Is there new meta data I have to set to the map to make it work correctly?

rugged topaz
#

how would i create custom potion effects (dont mind creating them) but put a 45 min duration on them and have it only tick down while on the server?

#

in more terms of java rather than spigot

sullen marlin
#

@undone light that kind of looks like a client render bug

#

though I can't say for sure it isnt a spigot issue

#

but it definitely looks more like a render issue

#

try making a similar thing with normal maps in single player

undone light
sullen marlin
#

are you relying on spigot to match colours? maybe some of the new colours have weird transparency

undone light
eternal oxide
#

Do you mean you have a UUID as the key and the Pet as teh value in a Map and you want to look up using either?

#

then use the UUID. Thats what its for

#

then give it a UUID

#

The same as any other field in any class

#

the Players UUID is just a field

#

Java getters

summer scroll
#

I think you need to store the object on a List or Map, so you can easily access them whenever you want.

#

So I have 2 list, and I need somehow to make List 2 the same order as the List 1, how can I do that?

List 1:    List 2:
one        three
two        two
three      one
eternal oxide
#

If you want them both sorted you can simply use teh sort method of Collections, or change them to TreeList and it will auto sort

summer scroll
#

Not sort like a number, basically I have like a list of items that will be shown on the GUI.

#

And after restart, I want to keep the list order, not resetting back to the configured order.

eternal oxide
#

a LInkedHashSet retains insertion order

summer scroll
#

No no, the List hold different object.

#

One is a TypeItem object and one is a String.

eternal oxide
#

Then you are making no sense

summer scroll
#

It's so hard to explain and I'm stuck here.

vagrant stratus
#

Is one a key and the other a value?

wet breach
#

oh you mean hashmap?

#

or arrayList?

summer scroll
#

Is that a question for me?

eternal oxide
#

We are trying to figrure out your question

vagrant stratus
#

If you're trying to do a key:value thing, use hashmap

#

Otherwise uh, I'm not a mind reader

summer scroll
#

Yes, sorry, I'm trying to think what is the exact question

wet breach
#

well I mean you could just iterate over the array to save it to a file o.O

eternal oxide
#

Well I covered sorting, ordering and insertion order. It wasn't any of those.

summer scroll
#

So in my GUI, it will show the first 3 items on the List.

#

And after the server stop, I will have a list of String.

#

And on the server start, I will load all items on the config.

#

And I store it to a List, and of course the order will be the same as the order on the config.

#

And I want somehow to make the order the same as the List that I got from the server stop.

wet breach
#

so just save the list into yaml when server is shutting down by iterating your array or hashmap, and then on server start just re-create the list or hashmap using the data you saved 🙂

eternal oxide
#

If its just a list of strings you simply push it to your config

summer scroll
#

I've done that part.

eternal oxide
#

if you pushed it as a list of string, load it the same, config.getList

summer scroll
#

This is what I received on server stop

  normalItems:
  - diamondSword
  - tnt
  - diamondBoots
  - diamondHelmet
  - diamondLeggings
  - hoppers
  - diamondChestplate
  - glass
wet breach
#

yes a list

#

now grab it as a list on load up 🙂

#

using the method ElgarL stated

summer scroll
#

omg, so hard to explain

vagrant stratus
#

You want it exactly the same as it is in the config, right?

wet breach
#

unless their issue is they are having a problem saving the correct data o.O

summer scroll
#

So I have an object called TypeItem and it holds a String which is the config key

items:
  tnt: <--- this one
    material:
    ...
eternal oxide
#

literally config.getList("normalItems")

#

do whatever you want with the list after

summer scroll
#

It's more complicated than that.

eternal oxide
#

the config part isn't

#

you saved a list, load a list

summer scroll
#

I've done the config part.

vagrant stratus
#

They need to loop through normalitems as well as items

wet breach
#

I think the issue is they are not saving the data correctly or the expected data isn't being saved as it should be

vagrant stratus
#

Or they're not loading it properly

summer scroll
#

they load properly too

eternal oxide
#

no need to loop items, just use the list you have from normalItems and pull teh key from items

wet breach
#

ok I am at a loss at what the issue is then o.o

summer scroll
#

Alright let me try again.

#

So I have a list of TypeItem on server start

vagrant stratus
#

How about showing us the expected output and what you get

eternal oxide
#

Lets start again, what exactly is going wrong with your current code?

vagrant stratus
#

That might actually help more

eternal oxide
#

I have a feeling I get whats happening

wet breach
#

items not going into the correct slots?

eternal oxide
#

You are loading the list of items and displaying the first 3, but you are moving/rotating them somehow. So you save them as a list of the new order. But you don't know how to use that order to display the next time.

summer scroll
#

Okay, here's the expected output, the TypeItem order needs to be

configKey3
configKey1
configKey2
``` but my result is
```yaml
configKey1
configKey2
configKey3
``` and I'm having a problem with filtering which items should be put onto the List first.
wet breach
#

oh that is easy

#

Collections.rotate(list, -1);

summer scroll
eternal oxide
#

do as frostalf said, ignore your string list and rotate yorur original item list

wet breach
#

you don't need to worry how they are saved or loaded really

#

since you are rotating them around anyways

eternal oxide
#

alwasy display from the item list so it always matches

wet breach
#

however it gets saved is how it will be loaded for next time

summer scroll
#

That's not like that, I rotate the items using Collections.shuffle()

eternal oxide
#

then save it after shuffling

summer scroll
#

I already do that, but the thing is I only save the configKey.

#

Not the whole TypeItem.

eternal oxide
#

then don't. Save teh full items

#

if you want to use a string list then you use that for displaying too

wet breach
#

you could just serialize the items

summer scroll
#

Well, If I do that the value won't change, like If I modify the lore, or displayname.

eternal oxide
#

ItemStacks are serializable

summer scroll
#

It's not ItemStack tho

eternal oxide
#

you can just push your whole item list and it will save/load

#

if you are putting them into a GUI you have to be making ItemStacks

summer scroll
#

I need more than just ItemStack, I'm trying to create a Rotating Shop basically

eternal oxide
#

every item you put in yoru "Shop" is an ItemStack

gloomy edge
#

Why can't it find it?

eternal oxide
#

because its not a full release yet

#

you need to run BuildTools

#

for Spigot you'd have to run BT anyway

gloomy edge
#

I did java -jar BuildTools.jar --rev 1.17 --compile craftbukkit and java -jar BuildTools.jar --rev 1.17

summer scroll
sullen marlin
#

You didn't use --remapped

gloomy edge
#

Thanks!

sullen marlin
#

Also you don't need craftbukkit

gloomy edge
#

Oh

summer scroll
#

@eternal oxide

List<TypeItem> rotatingItems = // load from config
List<String> rotatingItemsOrder = // get the list from config

sysout("Rotating items order");
for(TypeItem item : rotatingItems){
  sysout(item.getConfigKey());
  // Result:
  // configKey1
  // configKey2
  // configKey3
  // configKey4
  // configKey5
}

sysout("Last rotating items order before server restart");
for(String configKey : rotatingItemsOrder){
  sysout(configKey);
  // Result:
  // configKey3
  // configKey1
  // configKey2
  // configKey5
  // configKey4
}

// I want to make rotating items order the same as last rotating items order

eternal oxide
#

Store your TypeItems in a Map<String, TypeItem> then you can grab them as you need based upon your configKey

summer scroll
#

Alright, I'll try.

quaint mantle
#

https://www.youtube.com/watch?v=gsvFOJWECGE&t=575s in this tutorial, he says that you can use that to detect when a player clicks on an entity, but you can't. it's a local entity (it doesn't trigger any events). does anyone have any good tutorials on player npcs that DO trigger events?
ive been trying to research for hours but my brain isnt working anymore.

summer scroll
#

I think that's it @eternal oxide, thank you so much!

#

omg, finally

summer scroll
wet breach
#

wooo nice job solving that @eternal oxide 🙂

eternal oxide
#

lol

quaint mantle
#

yep @summer scroll 😄

summer scroll
quaint mantle
#

ill try

#

brb

#

just changed my listener to that

#

it doesn't get called

#

because the player is just a packet sent to my client, it doesn't actually exist server-side

#

?jd

plucky plaza
#

can someone tell me what would happen if i turn off verbose in confiig

eternal oxide
#

you get less junk messages

plucky plaza
eternal oxide
#

no world generation spam

plucky plaza
#

oh that was what i was finding

plucky plaza
#

can someone help me with skript crashing my server sorry for posting here coz noone is available in #help-server

sonic bronze
#

Hey there. I have a hard time thinking and deciding how to approach modifications on a players attribute.
At first I just changed the basevalue, but then found out about the modifiers, but these give me a headach, because I am not able to remove them properly.
I have the line to set it and to remove it right next to each other, so when it would work like expected. Nothing should happen:

  // These values are normally generated or are from my list, but it would be to much to put everything in here so lets work with test values.
  Attribute mappedAttribute = Attribute.GENERIC_MOVEMENT_SPEED
  double evaluatedValue = 0.7d

  player.getAttribute(mappedAttribute).addModifier(new AttributeModifier("rpg-plugin-mod", evaluatedValue - player.getAttribute(mappedAttribute).getBaseValue(), AttributeModifier.Operation.ADD_NUMBER ));
  player.getAttribute(mappedAttribute).getModifiers().removeAll(player.getAttribute(mappedAttribute).getModifiers());

In the case above the movement speed increases everytime the method is called. Do you may know what I am doing wrong here?

quaint mantle
#

?jd

sour sand
#

is there a way to make it that just like how the config file generated in a directory in the plugins folder a readme will generate

sonic bronze
#

Without much thinking I would say, that you could get the location of the config file by getConfig().getCurrentPath(); and then just create a new file like you do with plain java SE

sour sand
#

ok thanks

eternal oxide
#

getDataFolder()

#

if you want to save a file from your jar then saveResource()

sour sand
#

right ok thanks

past maple
#

Hello, I will try to use nms in spigot 1.17 but when I compile my project, I have this error :
Error:(24, 9) java: cannot access net.minecraft.nbt.NBTTagCompound bad class file: /D:/Developpement/Apis/spigot/spigot-1.17.jar!/net/minecraft/nbt/NBTTagCompound.class class file has wrong version 60.0, should be 55.0 Please remove or make sure it appears in the correct subdirectory of the classpath.

I have jdk 1.16 when I compile my project and java 1.16 is installed in my computer (when I made the cmd java -version)

eternal night
#

Is your project still targeting an older java version ?

#

Through maven etc ?

past maple
#

IN my project structure, in the section project JDK, It's "16 (java version "16.0.1").

I don't use maven

chrome beacon
#

And target version?

eternal night
#

Does intellij have that ?

chrome beacon
#

Yes

past maple
#

where ?

chrome beacon
#

Just below where you select the jdk

eternal night
#

Oh sweet, never knew that 😅

past maple
#

I remove java 1.8 from my project, I have no error but I have an other error :

Error:java: invalid source release 13 with --enable-preview (preview language features are only supported for release 16)

In the Project Structure, section Project and "Project language level", the maximum I have is "13 (preview) - Switch expressions, text blocs"

chrome beacon
past maple
#

yes

chrome beacon
#

Hm

past maple
#

in Project SDK, it's 16 (java version "16.0.1") and when I compile, the console says that Information:javac 16.0.1 was used to compile java sources

polar crow
#

Hello, Im using nms 1.17 and i get error syntax in nmsEntity.dead, but it no error in nms 1.16 so how i know name of variable nmsEntity.dead in nms 1.17?

chrome beacon
past maple
#

Ah I choose X - Experimental features in Project language level and I have no error

chrome beacon
#

Ah cool

astral laurel
#

curious, is there a meta setting limit for items?

#

because my plugin stores enchant data in the item meta but the item keeps getting its data reset randomly and breaking the item

chrome beacon
#

1mb is the max player data size

astral laurel
#

more so something like this breaking

chrome beacon
#

Tinkers construct spigot shakingeyes

astral laurel
#

kek

#

private plugin

chrome beacon
#

There already is a public one

astral laurel
#

a garbage one

#

:LUL:

chrome beacon
#

Possibly havent used it

astral laurel
#

there is an old one for 1.12 that is inactive resource and thats the one I now own

#

and then another

#

the other is laggy crap

chrome beacon
#

I doubt you're reaching the NBT limit though

astral laurel
#

Like the item basically bricks itself

#

wipes enchants, and stops registering as the tinkers item

chrome beacon
#

Worst case you can handle the data in straight up binary like hideflags does

astral laurel
#

I mean so far redone a lot of code and still can't find the issue

#

even with extra debug it just fucks itself

opal juniper
#

Storing it in the item meta is not the best idea

astral laurel
#

solution?

astral laurel
#

was thinking about using proper pdc container instead

#

as thought it may just be overloading the meta

opal juniper
#

Yes - was just typing that

#

Pdc is amazing

astral laurel
#

would be possible to transfer existing items?

opal juniper
#

Wdym?

astral laurel
#

am still learning some so sorry if dumb questions

chrome beacon
#

You would have to set up some conversion system

opal juniper
#

I mean you would have to iterate over all existing tags and convert them

#

Yeah

astral laurel
#

hm

#

would not be too bad

opal juniper
#

Most likely on playerJoinEvent and openInventory check all their items

astral laurel
#

weird thing is it just seems to be swords

#

never had any other item break

opal juniper
#

Ask in paper - this sorta backend stuff they know

#

Yep

astral laurel
#

moved there, thanks for answering tho :)

halcyon topaz
#

"cannot access net.minecraft.network.chat.ChatComponentText" I get this when compiling my minecraft plugin, anyone else?

chrome beacon
#

Could you show your code

halcyon topaz
#

Yeah sure

chrome beacon
#

?paste

undone axleBOT
halcyon topaz
#

oh okay

chrome beacon
#

I'm not at my PC but make sure that class exists with that constructor

gloomy edge
#

I'm getting this also that's similar

halcyon topaz
#

ig you and I are pretty much going to have the same solution

#

If I fix it, I will let you know 🙂

quaint mantle
#

How do you determine if a pumpkin has grown on its own or placed by the player?

gloomy edge
#
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] /E:/project/Intellj-IDEA/Git/World1-6Utils/World1-6Utils_V1_17_R1/src/main/java/com/andrew121410/mc/world16utils/sign/SignUtils_V1_17_R1.java:[3,26] cannot access net.minecraft.core.BlockPos
  bad class file: C:\Users\andre\.m2\repository\org\spigotmc\spigot\1.17-R0.1-SNAPSHOT\spigot-1.17-R0.1-SNAPSHOT-remapped-mojang.jar(net/minecraft/core/BlockPos.class)
    class file has wrong version 60.0, should be 52.0
    Please remove or make sure it appears in the correct subdirectory of the classpath.
[INFO] 1 error
[INFO] -------------------------------------------------------------```
gloomy edge
#

Oh

#

You probably have the same issue @halcyon topaz ^^^

halcyon topaz
#

I have java 16

chrome beacon
halcyon topaz
#

I am retard

#

I also got class file has wrong version 60.0, should be 52.0

#

lol

#
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] /C:/Users/steve/Documents/Intellij IDEA Projects/Sucrose/src/main/java/me/nykorrin/sucrose/events/bloodmoon/entities/BloodmoonSkeleton.java:[4,34] cannot access net.minecraft.network.chat.ChatComponentText
  bad class file: C:\Users\steve\Documents\Intellij IDEA Projects\Sucrose\libs\spigot-1.17.jar(net/minecraft/network/chat/ChatComponentText.class)
    class file has wrong version 60.0, should be 52.0
    Please remove or make sure it appears in the correct subdirectory of the classpath.
[INFO] 1 error
[INFO] -------------------------------------------------------------```
gloomy edge
#

I just changed to Java 16 everything seems to be working now thanks!

halcyon topaz
#
java 16.0.1 2021-04-20
Java(TM) SE Runtime Environment (build 16.0.1+9-24)
Java HotSpot(TM) 64-Bit Server VM (build 16.0.1+9-24, mixed mode, sharing)

C:\Users\steve>```
chrome beacon
#

You need to set it in your project

quaint mantle
#

can not accept class

halcyon topaz
#

OH LOL

gloomy edge
#

Lol we all dumb

halcyon topaz
#

fr

chrome beacon
#

New Java can still compile to old versions

#

That won't work

halcyon topaz
#

Build success! Thanks for the help Olivo & andrew 🙂

quaint mantle
gloomy edge
past maple
#

?

quaint mantle
#

I've Java16

#

Wait a second, Olivo

#

AWWW SHIT

#

Hi I am updating my plugin which uses TinyProtocol to 1.17. At times I use NMS with reflection, how should I go about it? There is no more net.minecraft.server.v1_17_R1 package?

#

I haven't setted Java in project

#

wtf

quaint mantle
#

what do you mean?

#

Use decompiler

#

Or

#

I'm using the builtin intellij decompiler, I think it is fernflower.

#

U can see suggestions

#

For net.minecraft

#

Yeah I saw them

#

There are game, network

#

And all other

#

so you confirm there is no more version within it?

#

I didn't understand what the --remapped was for

quaint mantle
#

yes

chrome beacon
eternal oxide
#

read the section on nms

chrome beacon
quaint mantle
#

This option will install additional Spigot jars into your local Maven repository with the classifiers remapped-obf and remapped-mojang. You can use these to develop against a 'Mojang Mapped' Spigot jar, and then use the below Maven configuration to produce a jar suitable for distribution.

I don't really understand

#

If I don't use those jars I'll have to deal with obfuscated code?

fleet dove
#

Hello there , I need help related setting up a proxy with geyser , I tried many times. But it has been bugged.
It shows this message when trying to join from bedrock

fleet dove
#

Can't send image

eternal oxide
#

This is Spigot and Bungee support

chrome beacon
#

Wrong message reply but yeah obfuscated jar

fleet dove
chrome beacon
#

Ask geyser not us

#

?paste

undone axleBOT
eternal oxide
fleet dove
#

K bye

#

Better I not waste time here , lemme ask a developer

unreal sandal
quaint mantle
#

How do you determine if a pumpkin has grown on its own or placed by the player?

eternal oxide
#

I'd guess watch for BlockFormEvent

quaint mantle
#

ty

eternal oxide
#

once its there you can;t tell, unless you tracked it being placed or grown

chrome beacon
#

Actually I think I know

unreal sandal
#

@chrome beacon I would like to create a chat event to separate chat per world. And when I send a message in a chat there is no personalize chat but there is the vanilla chat

chrome beacon
#

Is your custom event set to work async

unreal sandal
#

I don't know because it's my first custom event

chrome beacon
#

Sounds like you didnt

unreal sandal
#

And so how can I set my event to work async ?

slim kernel
#

I know its now some time ago but I tried it and it still is getting called twice is there anything else I could do to prevent it?

unreal sandal
#

@chrome beacon ?

chrome beacon
tardy delta
#

ow never thought there were limitations to name length

chrome beacon
#

Yeah there is

jagged monolith
#

Is there currently a bug with the maven-shade-plugin and updating to java 16 (cos it hates me atm)

unreal sandal
quaint mantle
#

i need help creating a plugin,to be more specific , placing blocks

chrome beacon
quaint mantle
#

how can i use the relative position of the player to place blocks around it ?

unreal sandal
#

@chrome beacon Okay I try it

jagged monolith
chrome beacon
#

You're using the wrong Java version

quaint mantle
#

` @EventHandler
public void onHit(ProjectileHitEvent e) {

    if (e.getEntity().getShooter() instanceof Skeleton && e.getHitEntity() instanceof Player) {
        Player a =(Player) e.getHitEntity();
        int x =a.getLocation().getBlockX();
        int y =a.getLocation().getBlockY();
        int z =a.getLocation().getBlockZ();`

this is what i already tried, but i dont know how to assign it to a block and stuff

jagged monolith
tardy delta
#

wew captain america

chrome beacon
jagged monolith
wispy fossil
jagged monolith
chrome beacon
#

Are you building via the command line or your IDE

jagged monolith
#

IDE

chrome beacon
#

Make sure you've told your IDE to use Java 16

eternal oxide
#

Which IDE are you using?

chrome beacon
#

IntelliJ

#

Look at his rich presence

eternal oxide
#

k, just eclipse required an special download/update to work with 16

unreal sandal
#

@chrome beacon The super(true) doesn't fix my problem

jagged monolith
#

Project Structure is set to the java 16 jdk - I'm just at a loss what it could be.

eternal oxide
undone axleBOT
quaint mantle
unreal sandal
chrome beacon
tardy delta
eternal oxide
wispy fossil
tardy delta
#

doesnt work i guess

#

maybe lava

#

:))

quaint mantle
unreal sandal
#

@eternal oxide But when I send a message in the chat, there is nothing

tardy delta
#

god level

eternal oxide
chrome beacon
unreal sandal
#

@eternal oxide Okay thank you

tardy delta
#

@eternal oxide you once sent someone how to hide the NPCs on tab, could you send that again please? 🙂

quaint mantle
tardy delta
#

something with protocollib i guess

quaint mantle
chrome beacon
#

location.add(x, y, z)

#

?jd

chrome beacon
#

I recommend looking at the javadocs

#

And?

quaint mantle
#

for example: Player a =(Player) e.getHitEntity();

in here i need to link the object to a variable at the end

#

and i dont know who to link it to...

chrome beacon
#

Wdym?

quaint mantle
#

from what im learning i declare instances by House house = new House(); but now i got to link the object to a variable.

i got to do this House house = (House) variable

#

or i dont know the diference yet

chrome beacon
#

Yeah that's casting. You're essentially forcing one type to another

quaint mantle
#

i want to put blocks around the player

#

in a 3x3 x3

chrome beacon
#

Then you will have to loop

quaint mantle
#

i cant find it,or the constructor at least

#

thanks!

#

both of you

urban trout
#

my EntitySkeleton skeleton = new EntitySkeleton(EntityType.SKELETON); line is underlined in red

#

I've tried using world in the () and that didnt work eithert

maiden briar
#

Is there any possibility to save configs with comments in Bungee? Because bungee's Configuration class is final

lusty cipher
austere cove
#

don't bring any logic into this

urban trout
#

Description Resource Path Location Type The constructor EntitySkeleton(EntityType) is undefined capnlynxo.java /commands/src/me/renndrew/commands/cmds line 29 Java Problem

austere cove
#

it's the internet after all

lusty cipher
#

yes, that's very true

#

however spoon feeding is still bad, as they'll continue on doing the same 🤷‍♂️

quaint mantle
maiden briar
lusty cipher
#

@urban trout I'm looking at some ancient code but it seems new EntitySkeleton wants a World, not an EntityType.

quaint mantle
#

Comments are not supported at all because of the nature snakeyaml works. Your best bet would be copying the file over and never saving to it.

urban trout
#

nop

maiden briar
#

And then after saving putting them back

urban trout
#

i changed EntityType.blah blah to world because i have World world = ((CraftWorld)player.getWorld());

quaint mantle
#

hey, how do I make some command to have cooldown?

quaint mantle
lusty cipher
#

@urban trout Sorry for that last message. EntitySkeleton simply doesn't exist anymore, are you using an ancient API/Tutorial?

    world.spawnEntity(Location, EntityType.SKELETON);

Is the proper API.

urban trout
#

what counts as ancient?

#

also ty

#

i'll try it

lusty cipher
urban trout
#

o

#

its 2017

quaint mantle
pulsar star
#

Hi, I have a question, is there any known bug about the server crashing when the player is standing on a stalagmite and recieves damage from a falling object anvil/stalactite

quaint mantle
#

you could also open a ticket on jira

summer scroll
#

Can I add aliases when registering command?

minor vapor
#
commands: 
  myCommand:
    aliases: [myAlias]
#

plugin.yml ^

urban trout
minor vapor
#

You can separate each alias by a comma

summer scroll
minor vapor
#

You mean the command map?

summer scroll
#

I have this, but doesn't work

    public void registerThisCommand(){
        plugin.getCommand(COMMAND_NAME).setExecutor(this);
        plugin.getCommand(COMMAND_NAME).setTabCompleter(this);

        FileConfiguration config = plugin.getConfig();

        // Create a list with configured value
        List<String> aliases = config.getStringList("aliases");
        // Set the command aliases
        plugin.getCommand(COMMAND_NAME).setAliases(aliases);
    }
minor vapor
#

ah

lusty cipher
quaint mantle
#

guys, how do I make a command to have cooldown, like /heal or /feed?

minor vapor
#

not too sure then, I've never done that before

storm monolith
#

how can I stop a parrot from randomly flying? (stall at mid-air).
I tried to override its pathgoals but without success.

urban trout
lusty cipher
#

I think so

urban trout
#

thats what i've done

lusty cipher
#

If there's no errors from your IDE, it should work

urban trout
#

doesnt seem to work though

#

it just spawns a normal skeleton

lusty cipher
#

how fast did you just test that 🤔

minor vapor
#

skeleton#setCustomNameVisible

#

iirc

summer scroll
lusty cipher
storm monolith
#

how can I stop a parrot from randomly flying? (stall at mid-air).
I tried to override its pathgoals but without success.

urban trout
minor vapor
#

Store the time the command was executed and check the elapsed time to check if the elapsed time is or greater than your cooldown duration

minor vapor
#

E.g:

if ((System.currentTimeMillis() - lastExecuted) >= 5000L) {
  lastExecuted = System.currentTimeMillis();
  // code to execute
}
#

for 5 secs

#

just for reference, 1000ms = 1 sec

quaint mantle
#

lastExecuted is int, long, float or what

lusty cipher
#

what System.currentTimeMillis() returns, long

minor vapor
#

long

#

as it's millis

quaint mantle
#

thank you very much 💙

storm monolith
#

how can I stop a parrot from randomly flying? (stall at mid-air).
I tried to override its pathgoals but without success.

ivory sleet
#

Isn’t that a goal after all

storm monolith
#

any suggestions on how can I solve then?

ivory sleet
#

How did you override it?

storm monolith
#

Overriding the public initPathfinder method, I'm in 1.16.2

#

Then I created a custom pathfinder goal extending the PathfinderGoal class but I don't seem to find a way to let the parrot stall at mid air.

spring ore
# jagged monolith Is there currently a bug with the maven-shade-plugin and updating to java 16 (co...

I encountered the same issue. It seems like the plugin isn't really working with Java 16 yet.
If you haven't fixed it already have a look at this thread: https://www.reddit.com/r/Maven/comments/mw58hq/mavenshadeplugin_java_16/?utm_source=share&utm_medium=web2x&context=3
The answer by ProjectEden fixed my issue.

urban trout
#

how would i make it so when i summon my skeleton boss everyone gets its health in their bossbar

#

i know how to do a boss bar just not the health

storm monolith
ivory sleet
#

Hmm I will take a look once I get on my pc, on phone right now 😅

sullen marlin
jagged monolith
vital swift
#

Is it possible to get generic.luck of player?

sullen marlin
#

yes, look up attributes in the javadocs

vital swift
#

ok

spring ore
main tangle
#

where do i get 1.17 spigot?

jagged monolith
quaint mantle
#

I'm trynna check if an item has the same name and then do something with the InventoryClick event but it doesn't work. I tried this:

            if (event.getCurrentItem().getItemMeta().getDisplayName().equals(ChatColor.translateAlternateColorCodes('&', "&etest"))) {
                player.sendMessage("test");
            }```
hybrid spoke
main tangle
# jagged monolith https://www.spigotmc.org/threads/510208/

I can't figure out how to use NMS.

[INFO] --------------------------------[ jar ]---------------------------------
[WARNING] The POM for org.spigotmc:spigot:jar:remapped-mojang:1.17-R0.1-SNAPSHOT is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  1.063 s
[INFO] Finished at: 2021-06-12T14:24:37+03:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project theomonty: Could not resolve dependencies for project theomonty:theomonty:jar:1.0-SNAPSHOT: Failure to find org.spigotmc:spigot:jar:remapped-mojang:1.17-R0.1-SNAPSHOT in https://hub.spigotmc.org/nexus/content/repositories/snapshots/ was cached in the local repository, resolution will not be reattempted until the update interval of spigotmc-repo has elapsed or updates are forced -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException

Process finished with exit code 1
hallow blaze
#

what about spigotcraft at 1.17 is spigot 1.17 already out

lusty cipher
jagged monolith
dusty herald
#

considering sharing compiled Spigot jars is illegal I'm going to remove that message 👀

dusty herald
#

i dont know man im tired

#

i havent slept in like 2 4hours

jagged monolith
lusty cipher
#

how come CodeMC's spigot hosting is illegal?

#

they've done it for years

limber dust
dusty herald
#

ignore everything i say

ivory sleet
#

@dusty herald get some sleep

#

(:

dusty herald
#

it looked like that contained some compiled spigot jar in previous version

lusty cipher
#

it does?

dusty herald
#

that's not what I was looking at

#

like i said ignore me

#

im going to go to bed

lusty cipher
#

ok sure ^^

jagged monolith
# main tangle Yes?

Hmm I haven't used NSM in a long time so not 100% sure. All I could suggest is making sure you're running the latest spigot version and have all the dependencies added correctly.

main tangle
#

Yes i am sure

river shell
#

Can I prevent the server preparingspawn when I call createWorld() ? Or change the number of chunks it generates?

crude hound
#

hi, how can I set the 1.16 completition of the selectors in a spigot command plz?

lusty cipher
wraith rapids
#

if you mean the @e[this=that] selectors, you'll need brigadier

main tangle
#

I still cannot use NMS for 1.17.

hybrid spoke
crude hound
#

yes I found thx

main tangle
#

mapping? wym

#
        <!-- spigot dependency -->
        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot</artifactId>
            <version>1.17-R0.1-SNAPSHOT</version>
            <classifier>remapped-mojang</classifier>
            <scope>provided</scope>
        </dependency>

        <!-- spigot repo -->
        <repository>
            <id>spigotmc-repo</id>
            <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
        </repository>
#

is this correct

jagged monolith
#

Did you add all the stuff in the Example Maven Config as well from that link