#help-development

1 messages · Page 1483 of 1

paper viper
#

did you install properly?

quaint mantle
#

Yes

paper viper
#

you need to set the path too

eternal night
#

make sure to restart your shell after modifying the path

wraith rapids
#

that doesn't test whether a player moved a block, anyway

quaint mantle
#

im saying the command work

quaint mantle
#

but the maven dependcy

wraith rapids
#

that tests whether the player's last move packet caused the player to move more than 1 block of distance in any given direction

quaint mantle
#

still aint working

#

still syaing it cant find it

wraith rapids
#

which hardly ever happens

#

as players don't move 20 blocks per second

paper viper
#

hmm

wraith rapids
#

if you want to check whether the player has moved to a new block, check if location.getBlock().equals(oldBlock)

quaint mantle
#

i tried that

quaint mantle
#

how do i do this

wraith rapids
#

or does block even implement equals properly actually

#

i don't think it does

paper viper
quaint mantle
#

Um

#

it is

wraith rapids
#

use maven

quaint mantle
wraith rapids
#

google "how to shade with maven"

paper viper
#

no it isnt.. its somerthing differetn

#

your current issue is different

quaint mantle
#

It says u will also need to shade the libary into your plugin jar file

wraith rapids
#

what are you even doing

paper viper
#

^

#

Shading is like

#

including the libraries into your jar

#

but currently your first problem isnt fixed

#

so dont even think about shading

quaint mantle
#

Ok well how do i fix the dependcy

#

the command ran

paper viper
#

show us full pom

quaint mantle
#

?paste

queen dragonBOT
quaint mantle
paper viper
#
       <dependency>
            <groupId>co.aikar</groupId>
            <artifactId>acf-paper</artifactId>
        </dependency>
#

bruh

#

do you see something missing?

quaint mantle
#

No.

#

Ah

#

version

paper viper
#

You are missing the version

left swift
#

how can I make EntitySnowball invisible?

paper viper
#

tag

quaint mantle
#

I'm having a problem with using my arenaConfig file (https://paste.md-5.net/qesiyiweti.cs). I've done so it's not much static in it but more constructors but I can't seem to be able to actually get the config or anything. This is how I get it in my main class: https://paste.md-5.net/idunefamak.java and I use this line when I register my event: pm.registerEvents(new PlayerJoinListener(this, this.arenaConfig), this);. This is also how it looks like in the event class: https://paste.md-5.net/adizotugal.java

paper viper
paper viper
quaint mantle
#

k.

paper viper
#

do you see this reload button

#

when you enter the pom file

quaint mantle
#

I ammmmmmmm

paper viper
#

Ok

#

you reloaded right?

quaint mantle
#

Everytime i make a change in the pom i click the reload button

#

yes

paper viper
#

try running the command again

#

if that doesnt work, invalidate caches and try again

#

thats my best advice from the information so far

wraith rapids
#

acf-paper definitely is in the listed repository

quaint mantle
#

Ok right so

quaint mantle
#

This thing is stupid as

#

u know i had it set to @paper viper

paper viper
#

Yes

#

I know

quaint mantle
#

Well i looked at the other options

#

i put acf-bukkit

#

in the thing

#

rebuild

#

and it worked...

#

so it was acf-paper

#

all a long

paper viper
#

You know, its platform dependent right?

quaint mantle
#

Yes

paper viper
#

you cant just smack a random version and use it

quaint mantle
#

but..

paper viper
#

and also as mentioned above, it seems to exist

quaint mantle
paper viper
#

Why are you using paper then if you are working with Spigot?

#

you use paper when using paper

#

spigot when using spigot

#

etc

#

not like paper for spigot

proud basin
#

How could I use a symbol like this ➤ in mc?

quaint mantle
#

but it says still runs on spigot

#

so i thought i could use it

#

xd

eternal oxide
#

UTF8 codes

opal sluice
wraith rapids
#

it does and you can use it

#

this has nothing to do with spigot or paper

#

your maven simply cannot find the listed artifact in the listed repository

#

even though it exists

proud basin
coral sparrow
wraith rapids
#

ensure your file encoding is utf8 and you are both reading and writing it with the same encoding

coral sparrow
#

\U27A4 is the unicode for it

#

and yea

subtle vector
#

wait if a itemstack item is used to make that entity like a snowball. throwing a snowball item makes a snowball entity, is it possible to get the item of which caused the entity to spawn manually? like a trident entity can be spawned by throwing a itemstack trident. can u make a itemstack object = the cause of what threw the snowball or the snowball item.

paper viper
#

i dont think that is possible iirc?

#

you'd have to perform a manual check

wraith rapids
#

doesn't work for snowballs, no

gritty flame
#

I upload minecraft videos to pornhub and was wondering if u had any advertising advice

wraith rapids
#

all snowballs are the same as far as vanilla is considered

#

i don't know if the functionality used by tridents and such is implemented under the hood for stuff like enderpearls and snowballs

#

you can try it I suppose

final imp
#

Hi, someone has a nice Skywars ?

wraith rapids
#

no

merry goblet
#

I need help with an API it say it couldn't find the package but I imported the API into IntelliJ its a Maven problem

eternal oxide
#

If using maven you don;t import anything, you add all depends in your pom

urban trout
#

heyo im tryna make a hide and seek plugin and i am getting this error when trying to use /has start org.bukkit.command.CommandException: Unhandled exception executing command 'has' in plugin hideandseek v1.0

wraith rapids
#

yeah that tells us nothing

dusk flicker
#

We need the stacktrace

wraith rapids
#

include the whole exception, with its stack trace

urban trout
#

stack trace?

wraith rapids
#

"at blah blah"

plain surge
#

All the console error

urban trout
#

o

#

getworld string

dusk flicker
#

🤦

wraith rapids
#

Caused by: java.lang.NullPointerException: Cannot invoke "org.bukkit.World.getPlayers()" because the return value of "org.bukkit.Server.getWorld(String)" is null

dusk flicker
wraith rapids
#

literally read

urban trout
#

sorry man

fickle helm
#

has anyone messed with PAPI (PlaceholderAPI) ?

eternal oxide
#

Lots of people I expect

fickle helm
#

but I'm confused on how I would know what mob it needs it for

wraith rapids
#

you wouldn't

#

the only identifying information placeholderapi has is players

eternal oxide
#

Placeholders are based upon a player

fickle helm
#

ah that makes sense

wraith rapids
#

where did these people want you to add a %level% placeholder

#

you probably want to write some String::replace logic in your actual plugin

fickle helm
#

specifically it was requested when a player kills a mob they want some plugin of theirs to broadcast mob blah (level x) was killed by player

#

and they want my plugin to make the %level% PH available so they can tap into that

wraith rapids
#

yeah that's not really feasible

eternal oxide
#

you can't do a placeholder but you could easily add an event

wraith rapids
#

of course that would involve the other plugin listening to that event

fickle helm
#

that's true. I do have a few events already

eternal oxide
#

yes, but they are already listening to events so no different

wraith rapids
#

yes, but this sounds like an end user

#

not a developer

fickle helm
#

yes that is likely

eternal oxide
#

Make them work for it, bury it in an obfuscated API, nested deep in your codebase 🙂

wraith rapids
#

well

#

there is a way to do specifically what they want to do

#

have a last_killed_level placeholder

#

and set it every time the player kills something

#

and tell the guy to use it in the message

digital plinth
#

is it possible to stop an entity from turning its head? But only when the turning is is called by the in-game AI and not though a plugin?

wraith rapids
#

kind of cancer but should get the job done

fickle helm
merry goblet
vale cradle
#

Or cancelling its EntityTargetEvent

wraith rapids
#

surely not the first time

#

or are you here, in the spigot development support discord, without ever having used spigot api

eternal oxide
#

adding dependencies to your pom is basic maven stuff. You need to google and learn that yourself. I'm not a tutor

digital plinth
digital plinth
#

can I add a mob to a scoreboard team?

proud basin
#

How can I fix this issue 'Reload(me.jtx.water.Water)' in 'me.jtx.water.commands.Reload' cannot be applied to '()'

digital plinth
#

i should be able to

eternal oxide
proud basin
#

It's saying that its related to this public Reload(Water plugin) { this.plugin = plugin; }

digital plinth
#

.addEntry?

wraith rapids
#

you learn java

#

that is how you solve it

#

so, let's take it from the top

#

'Reload(me.jtx.water.Water)' in 'me.jtx.water.commands.Reload' cannot be applied to '()'

#

'Reload(me.jtx.water.Water)' refers to the method you want to be calling

#

the method that exists

#

me.jtx.water.commands.Reload refers to the class the method is in

#

'()' refers to what you are trying to do

#

so, in english

#

the "Reload" class has a constructor

#

the constructor has a parameter

#

the type of that paremeter is Water

#

however, you are not giving it any parameters

#

you need to give it a parameter of type Water

digital plinth
#

is there a server reload event

eternal oxide
#

you mean to detect if its a fresh start or a reload?

wraith rapids
#

there is one yes iirc

#

i remember a meme going around about listening to said event and shutting down the server

rugged topaz
#
    @Override
    public final void onEnable() {
        getServer().getMessenger().registerOutgoingPluginChannel(this, "BungeeCord");
    }
ByteArrayDataOutput out = ByteStreams.newDataOutput();
out.writeUTF("Message");
out.writeUTF(player.getName());
out.writeUTF("hello from another server!");
Bukkit.getServer().sendPluginMessage(getInstance(), "BungeeCord", out.toByteArray());

shouldn't this be enough to send a message to a player from another server?

#

because it doesnt do that.

digital plinth
#

also why am i still getting pushed

#

me and the wither are buddies

#

we are in the same team

eternal oxide
digital plinth
#

reload

proud basin
eternal oxide
#

if you want to detect it ```java
@Override
public void onLoad() {

    if (Bukkit.getWorlds().isEmpty()) {
        System.out.println("Fresh Start");
    } else
        System.out.println("Reload");
}```
keen kelp
#

can I use enum as String?

rugged topaz
ivory sleet
keen kelp
#

Im trying to do
enum Colors{
Green("§a")
}

ivory sleet
#

Or Enum::toString

rugged topaz
#

what does that mean

wraith rapids
#

it's a method reference

rugged topaz
keen kelp
#

ik ik

#

like how do I use it as a string

wraith rapids
#

call toString on it

keen kelp
#

I would want to just be able to do
p.sendMessage(Color.red + "hi")

rugged topaz
#

Colors.valueOf("Green").toString()?

#

or

wraith rapids
#

that will automatically call toString on Color.red

rugged topaz
#

Colors.Green.toString()?

keen kelp
#

I see

wraith rapids
#

because you are using the string concatenation operator +

rugged topaz
#

if fr some reason Color.red isn't working?

digital plinth
rugged topaz
#

why rn't u using ChatColor.RED +

wraith rapids
#

however you can't do Color.red + Color.bold

#

because neither Color.red nor Color.bold are strings

#

and therefore the + operator isn't cocatenating strings

keen kelp
#

but I can do Color.red + Color.bold + ""?

wraith rapids
#

yes

keen kelp
#

as long as 1 string is in there it's fine

wraith rapids
#

myes

keen kelp
#

or else I would need valueOf

rugged topaz
#

no reason to be using Color.red + Color.bold alone anyway

wraith rapids
#

you don't need valueof

#

you'd need toString

keen kelp
#

yeah they all modifiers

#

okok

proud basin
#

Have getCommand("reload").setExecutor(new Reload(this)); but I get a java.lang.NullPointerException public Reload(GoNick plugin) { this.plugin = plugin; }

young knoll
#

Why are you remaking the chatcolor enum

wraith rapids
#

Color.red.toString() + Color.bold.toString()

proud basin
#

yes

wraith rapids
#

getCommand only retrieves commands declared in your plugin.yml

#

that won't change the executor on bukkit:reload

#

nor will it override bukkit:reload as the primary command for /reload, iirc

digital plinth
#

um how do i add a mob to a team

#

.addEntry is not the one

rugged topaz
wraith rapids
#

add its uuid

proud basin
#

yea I have that

rugged topaz
#

and

commands:
  reload:

is in ur plugin.yml?

#

and ur still getting an npe?

proud basin
#

yes

#

ok so it looks like it fixed itself but the command doesn't even work itself apparently and no errors

wraith rapids
#

try /yourplugin:reload

#

where yourplugin is your plugin's name

proud basin
#

yeah no errors

wraith rapids
#

./reload will be directed to /bukkit:reload

proud basin
#

yea

young knoll
#

I mean what is it meant to do

proud basin
#

reload config

wraith rapids
#

you probably want to add it as a subcommand instead

#

./myplugin reload
instead of having to
./myplugin:reload

#

since a lot of people don't know about namespaces and it isn't exactly intuitive

proud basin
#

hm

#

How could I do a sub command

wraith rapids
#

create a main command and then see if one of its arguments matches with a subcommand

proud basin
#

pl

#

ok*

sage swift
#

if (args.length > 0 && args[0].equalsIgnoreCase("reload"))

proud basin
#

yeah that's what I got

#

but I have args.length == 1

sage swift
#

what if someone does /command reload pls

proud basin
#

nothing will happen

sage swift
#

you absolute fool

proud basin
#

why would someone do /command reload pls

sage swift
#

i don't know, but wouldn't your plugin look stupid if nothing happened if they did?

proud basin
#

no?

#

Because its not a valid command

young knoll
#

Then it should at least tell them that

#

InventoryClickEvent

proud basin
#

anyways

sage swift
#

setCancelled(true)

proud basin
#
if (label.equalsIgnoreCase("water")) {
        if (sender instanceof Player) {
            if (args[0].equalsIgnoreCase("reload")) {
                this.plugin.reloadConfig();
                player.sendMessage(ChatColor.GREEN + "Reloaded!");
            }
        }
    }
``` that's an idea on how the reload command looks like
wraith rapids
#

don't use label

#

label could be anything

#

the label is the alias of the command that was used

sage swift
#

dont use label, use Bukkit.shutdown() instead

proud basin
#

What should I use then

wraith rapids
#

command.getName

#

f.e I could go in commands.yml and create an alias "water2", and point it at your water command

#

and then I run /water2 reload

#

and nothing happens because label is "water2" and not "water" like you'd expect

proud basin
#

oh ok

digital plinth
#

hmmmmm

proud basin
#

I feel like this is messing with it getCommand("water reload").setExecutor(new Reload(this));

wraith rapids
#

i would be very surprised if that worked

sage swift
#

and what is it supposed to be

proud basin
#

I mean no errors happen but its like it just ignores it

vital ridge
#

?paste

queen dragonBOT
digital plinth
#

why won't it work tho

vital ridge
#

Could someone help me with this error:
https://paste.md-5.net/aserenilah.bash
This block of code provides that error (ive almost never worked with iterators so I could be doing a rly dumb mistake):

Iterator it = ChickenMap.runnablePerChicken.entrySet().iterator();
                                
                                while (it.hasNext()) {
                                    
                                    ChickenMap.runnablePerChicken.get(chicken.getUniqueId()).stop();

                                    it.remove();
                                    
                                }
sage swift
#

what is WitherSkull

digital plinth
#

a entity?

sage swift
#

what does the method want

#

it wants a class

#

right?

proud basin
sage swift
#

not just WitherSkull

digital plinth
sage swift
#

yes

#

it wants the class

digital plinth
#

the class of witherSkull?

sage swift
#

so what should you put instead of just WitherSkull

digital plinth
#

hmmm

#

new WitherSkull() ?

wraith rapids
#

no

#

that creates an Object of type WitherSkull

#

you want an object of type Class<WitherSkull>

#

an object that represents a class

digital plinth
sage swift
#

how do you get the class on an object

#

rhetorical question

eternal night
#

instance.getClass()

sage swift
#

no

#

sh

keen kelp
#

how do I have an enum for all the classes that extend from one

sage swift
#

he needs to figure out what to do himself

eternal night
#

Oh it wasn't a question xddd

wraith rapids
#

that gets an object that represents a class, from an object

main dew
#
    @Override
    public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
        if (!Utils.checkPlayer(sender))
            return true;
        Player p = (Player) sender;
        p.kickPlayer("");
        return true;
    }``` and this give me this warning in console ```
handleDisconnection() called twice``` how I can fix this?
wraith rapids
#

what we want is to get an object that represents a class, from the class

keen kelp
#

like
MeleeWeapon extends customWeapon
RangeWeapon extends customWeapon
and if I want a enum for them, what do I do

digital plinth
#

witherskull.getclass?

sage swift
#

no

wraith rapids
#

no, getClass is an instance method

sage swift
#

you want the static Object field

wraith rapids
#

in order to call getClass, you first require an object, because it's an instance method

#

so getClass is off the table

#

we want to get it directly from the class

keen kelp
#

I tried WeaponType(Class<CustomWeapons>) but it just says i provided the wrong class when i give it MeleeWeapon even though it extends from CustomWeapon

#

is that not how it works

eternal night
#

Oh is he trying to use spawn with the class ?

wraith rapids
#

myeah

eternal night
#

Ah

#

Well then XD

#

I shall not spoil it

wraith rapids
#

you should apply for helper

#

and then ban all the 1.8 people

eternal night
#

I enjoy telling 1.8 developers their version, API and server is not supported

main dew
#

classic spigot xD

ivory sleet
#

Sounds like a task for me /s

wraith rapids
#

i have a list

ivory sleet
#

Oo

wraith rapids
#

i've started to collect a list of 1.8 users who've asked for help, along with their user ids and the topic they were on

#

i'm going to put together a 1.8 community

ivory sleet
#

lmao

wraith rapids
#

and then have the 1.8 fucks quarantined into it

young knoll
#

Quick find their uuids too

wraith rapids
#

implying any of them have bought accounts

proud basin
#

is this better java if (command.getName().equalsIgnoreCase("water")) { if (sender instanceof Player) { if (args.length == 1 && args[0].equalsIgnoreCase("reload")) { this.plugin.reloadConfig(); player.sendMessage(ChatColor.GREEN + "Reloaded!"); } } }

wraith rapids
#

you are still using label

#

don't use label

proud basin
#

no its command

wraith rapids
#

it was label before you edited it

proud basin
#

now how should I put it in my main

#

like water reload

#

getCommand("water reload").setExecutor(new Reload(this)); or getCommand("reload").setExecutor(new Reload(this));

ivory sleet
#

Probably just water

wraith rapids
#

neither

digital plinth
proud basin
#

uh so then what would I do?

wraith rapids
#

very good

digital plinth
#

yay

proud basin
#

if neither

ivory sleet
#

"water"

proud basin
#

I got a command already named water

ivory sleet
#

Then delegate a sub command to reload your plugin?

proud basin
#

hm?

ivory sleet
#

Let me ask you this, what are you trying to do as of now?

proud basin
#

get the reload command to work

digital plinth
#

so theres two different wither skulls

ivory sleet
#

No the entire project you’re working on

digital plinth
#

the black and blue one

#

but

#

y is there only 1 witherskull

proud basin
#

oh just a book that you can edit stuff in

wraith rapids
#

they are the same entity type but with some different flags or data or something

digital plinth
#

in the docs

wraith rapids
#

see the docs of WitherSkull itself

young knoll
#

Did you check the methods of WitherSkull

digital plinth
wraith rapids
#

similarly to how there are like 20 different villagers

digital plinth
#

charged hmm

wraith rapids
#

but only one villager class

digital plinth
#

does that change the color

wraith rapids
#

probably yes

digital plinth
#

also how do i add a mob to a team

wraith rapids
#

add its uuid to the team

digital plinth
#

i found aboslute nothin on google

digital plinth
#

.addEntry?

ivory sleet
digital plinth
#

oh wait do you add it as a player

proud basin
#

it reloads config.yml

ivory sleet
#

Oh so what commands do you have currently?

proud basin
#

and a thing that makes a book

ivory sleet
#

So
/water
makes a book

/water reload
reloads config?

proud basin
#

yea

#

well that's what im wanting

digital plinth
#

hmm how can i launch a blue wither skull

#

the methods are in the object of the witherSKull class?

young knoll
#

Check the return type of launchProjectile

main dew
#
    @Override
    public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
        if (!Utils.checkPlayer(sender))
            return true;
        Player p = (Player) sender;
        p.kickPlayer("");
        return true;
    }``` and this give me this warning in console ```
handleDisconnection() called twice``` how I can fix this?
digital plinth
#

ohhhh

sage swift
#

so do stuff to that

digital plinth
#

okay thx

compact haven
#

What events do I need to listen to in order to have a reliable database -> block position reference

#

like I need to keep an accurate track of a block in a database, to store some custom data

young knoll
#

Place, Break, Explode, Piston, Change, etc

compact haven
#

like is there a definite list, because there are just so many ways a block can disappear from the world, be moved, etc

young knoll
#

Doubt it

#

You can look at the subclasses here

hearty scarab
#

Does anyone have something that serves as a reference for me to make my multi-language plugin?

young knoll
#

Check something like essentials

#

It has a file for all the messages

ivory sleet
#

I mean ideally you’d use resource bundles which essentially are made for localization

compact haven
#

im not using redlib for this @sage swift, but I know it exists

#

though thats a good question

keen kelp
#

how do I make an enum's constructor take extends of a class

compact haven
#

@waxen plinth have u looked for every event necessary to see if a block has changed

keen kelp
#

like A and B both extends C, and I want enum D's constructor to take any class that extends C

sage swift
ivory sleet
#

Just specify the type C?

sage swift
#

only so much you can do

keen kelp
#

Class<C> or C

compact haven
#

why doesnt it call an event :<

sage swift
#

neither does setting an item in an inventory

young knoll
#

Because yes

proud basin
ivory sleet
#

An instance of C then just use C, if the class then use Class<? extends C> since it could be any subtype of C in that case

young knoll
#

Just mixin in an event for it

compact haven
#

how?

keen kelp
#

public enum WeaponType {
Melee(weaponType.Melee);

CustomWeapons weapon;
WeaponType(CustomWeapons weapon)
{
    this.weapon = weapon;
}

}

compact haven
#

and since when did spigot have mixins

#

tf?

keen kelp
#

here weaponType.Melee extends CustomWeapons

young knoll
#

It doesn't

ivory sleet
#

Yeah

young knoll
#

But you can ask MD nicely for them :p

rugged topaz
#
    public static void networkLog(String message) {
        List<String> uuid = sqlData.fetchList("UUID");
        if (uuid == null) return;
        Bukkit.getScheduler().runTaskLater(instance, () -> {
            for (String p : uuid) {
                OfflinePlayer player = Bukkit.getOfflinePlayer(UUID.fromString(p));
                if (getPermissionValue(player) >= 3) {
                    sendNetworkMessage(player.getName(), replaceChatColors("&b[STAFF] &r" + message));
                }
            }
        }, 5);
    }

    public static void sendNetworkMessage(String p, String message) {
        ByteArrayDataOutput out = ByteStreams.newDataOutput();
        out.writeUTF("Message");
        out.writeUTF(p);
        out.writeUTF(message);
        Bukkit.getServer().sendPluginMessage(getInstance(), "BungeeCord", out.toByteArray());
    }

why would something like this cause a message to be sent twice to the same player? uuid does not contain 2x of the same player/player's uuid.

keen kelp
#

and weaponType.Melee gets underlined saying Expression expected

ivory sleet
#

Is weaponType a class or it might be the case that you haven’t defined what weaponType is

quaint mantle
#

How can I put items with meta data in crafting recipes? I am using Spigot-API 1.12.2

young knoll
#

Does 1.12 have exactchoice?

quaint mantle
#

No

young knoll
#

Then you need to use the PrepareItemCraftEvent

#

Or update

quaint mantle
#

How though?

compact haven
#

im confused, how does one mixin a custom event to a method if mixins arent in spigot 😔

young knoll
#

Like I said

hearty scarab
young knoll
#

Ask MD nicely

sage swift
#

unsupported versions outta here

quaint mantle
sage swift
#

as is 1.16.5

wraith rapids
#

so is 1.16.5

young knoll
proud basin
wraith rapids
#

on the contrary, 1.12 is full of unpatched and known exploits

#

as software several years out of date tends to be

digital plinth
#

how do i add a mob to a team

compact haven
#

wha

#

where did my tag go

#

it just deleted

rugged topaz
#

Bukkit.getOfflinePlayer(wither.getUniqueId())?

young knoll
#

No

rugged topaz
#

correct answer being?

sage swift
#

you dont addPlayer on a mob

young knoll
#

addEntry takes a string

sage swift
#

it's in the method name

wraith rapids
#

add the uuid

young knoll
#

No idea what the string should be though

#

Perhaps the UUID as a string

wraith rapids
#

yes

keen kelp
#

Conclure

digital plinth
keen kelp
#

any idea why it wouldn't work?

digital plinth
#

i tried but i can still hit the wither

sage swift
#

"you tried" what

digital plinth
#

i have friendlyfire of

#

off*

#

.addEntry(wither.getUniqueID)

eternal oxide
#

addEntry takes a Player name or an Entity UUID.toString

quaint mantle
wraith rapids
#

getUniqueID returns an UUID

young knoll
#

isSimilar should work

wraith rapids
#

you need a String

#

you need to convert the UUID to a string

keen kelp
#

yes

digital plinth
#

so am i not supposed to use .fromString like that

wraith rapids
#

nullpointerexception

#

you can't convert nothing into an UUID

#

you need to give it a String

#

right now you are not giving it anything; you are passing it a variable without any contents

digital plinth
#

hmm it should benn able to retrieve a value

wraith rapids
#

a variable that points at no object

#

a null-pointer

digital plinth
#

map.put(player.getUniqueId().toString(), wither.getUniqueId().toString());

#

Wither w = (Wither) Bukkit.getEntity(UUID.fromString(map.get(e.getPlayer().getUniqueId())));

wraith rapids
#

why are you storing them as strings

digital plinth
#

should i store it as UUID?

keen kelp
#

yes

digital plinth
#

don;t uuid take more space than strings?

wraith rapids
#

unless you have some good reason to not do so, yes

#

no

wraith rapids
#

strings take way more space

#

an uuid is 16 bytes

keen kelp
#

String is an array

#

and UUID is just one object

wraith rapids
#

one character of a string is 2 bytes

#

at minimum

#

depending on the encoding

keen kelp
#

and UUID is like 32 characters right

eternal oxide
#

a uuid as a string is a minimum of 72 bytes

wraith rapids
#

plus the cached hashcode

keen kelp
#

so yeah use UUID

wraith rapids
#

also, size is irrelevant

#

you should use the correct type

#

if you need to store an UUID, store an UUID

#

if you need to store a String, store a String

young knoll
#

I used to store strings over a reference

digital plinth
#

okay

young knoll
#

No idea why

wraith rapids
#

there are a handful of exceptions

#

like Player

#

Players are kind of fucked and transient and nasty, so you generally don't want to store them at all

#

being fucked and transient and nasty is a good reason to use something else, like a UUID

young knoll
#

Couldn't you store them as a weak reference

ivory sleet
#

Yeah

eternal oxide
#

You can but Player is not persistent whereas the UUID is

digital plinth
#

um so how do i add a wither to my team?

#

don't work

eternal oxide
#

that is how you add it

waxen plinth
#

But for my protection policy I have

digital plinth
#

and im still getting pushed

eternal oxide
#

what options have you set on your team?

waxen plinth
#

For data blocks I kept it pretty lightweight but I'm open to adding more if needed

wraith rapids
#

you can store them as a weak reference yes, but that only works when querying with player instances you obtain externally

abstract relic
#

anyone know why java Bukkit.getServer().getClass().getPackage().getName()
returns : org.bukkit.craftbukkit.v1_16_R3.v1_16_R3

wraith rapids
#

weak references aren't dropped the instant the object becomes unreachable

waxen plinth
#

But the important thing is that you can just check the type when you check the block as well and it should be fine

#

Because blocks can be removed by plugins

wraith rapids
#

meaning that you can still have stale player objects in your collections

abstract relic
#

on latest spigot from build tools

waxen plinth
#

So you will never get everything

wraith rapids
#

which you might then iterate over, and run into issues

young knoll
#

What would you expect it to return?

wraith rapids
#

but, it's fine as long as you are mindful of it

abstract relic
#

org.bukkit.craftbukkit.v1_16_R3

young knoll
#

NMS versions != Minecraft versions

abstract relic
#

not two versions

#

lmao

young knoll
#

Ah

wraith rapids
#

although the same could be said for just storing the players directly, but whatever

abstract relic
#

tinyprotocol broke

#

D:

keen kelp
#

what's tinyprotocol

abstract relic
#

uh

wraith rapids
#

protocollib but gay

abstract relic
#

protocollib sort of

keen kelp
#

is it just like protocolLib lite?

abstract relic
#

not really

#

it just hooks incoming/outcoming packets

#

and provides a callback

#

so you can modify the packets

#

without depending on protocollib

waxen plinth
#

Oh I used to have something like that in my library

#

I removed it because it broke jitpack 🙃

abstract relic
#

i mean i cba to reinvent the wheel

waxen plinth
#

I'm too lazy to set up my own CD

keen kelp
#

so like an alternative to protocollib?

abstract relic
#

its made by the same guy

#

managed to create this 😄

#

forgot to write the amount of airblocks in a chunk

eternal oxide
digital plinth
#

i thought it was default

#

but still i can hit the wither

eternal oxide
#

Not sure you can prevent friendly fire on a Mob in a Team. Are they even friendly to you?

wraith rapids
#

that's semantics

abstract relic
#

Oh

#

My jar built using build tools is just disabled

abstract relic
#

down syndrom spigot jar

young knoll
#

Just add some data to the wither and use the damage event

digital plinth
#

thats not valid

compact haven
#

I mean worst case coll, I could just make a patch that makes Block.setType and any other api methods call a method

#

no?

keen kelp
#

how do I make an enum with classes

wraith rapids
#

your jar is shading in extra chromosomes

young knoll
wraith rapids
#

note that both entities need to have collisions set to false for them to not collide

#

as collisions are 2 way

#

unless it's a projectile, which only does 1 way collision lookups

compact haven
#

since spigot is closed source 😔

keen kelp
#

wait what

young knoll
#

No it's not?

keen kelp
#

spigot is closed source??

young knoll
#

No

compact haven
#

we had a whoel convo on this yesterday

keen kelp
#

bruh I was aboutta send this link

compact haven
#

you need to sign a contract to see everything

young knoll
#

Not the code

compact haven
#

like you cant find the api methods or anything

young knoll
#

But yes you do need to sign it to see PRs

keen kelp
#

we can already see everything

compact haven
#

🤔

digital plinth
#

wait normal vanilla wither skulls don't have gravity

keen kelp
#

yep

compact haven
#

someone said it was closed source literally yesterday

keen kelp
#

well they are dumb dumb

outer sorrel
young knoll
#

I see sync sqlite calls

#

It's local, but file IO is still not the fastest

waxen plinth
#

I have no idea what it's meant to do

#

I had tried to use it once to make it so that players wouldn't push each other around

#

All it did was make them unable to be hit by arrows for some reason

wraith rapids
#

yes

#

like i just explained

#

collisions are two way for living entities

outer sorrel
wraith rapids
#

both entities must have them disabled for no collision to occur

#

however, projectile collisions are one-way

#

if a player has collisions disabled, projectiles will not collide with them

keen kelp
#

can I have an enum represent a class?

young knoll
#

That sounds very annoying to work with

wraith rapids
#

it is

eternal oxide
#

@digital plinth team.setOption(Team.Option.COLLISION_RULE, Team.OptionStatus.NEVER);

waxen plinth
#

As in they would still push each other around

wraith rapids
#

that is because player movement is clientside

#

and the player doesn't know about the server-side collidable flag you've set

#

collisions and the movement caused by them is still movement

#

i don't know about the collidable exemptions thing

#

it must be new

#

i don't remember seeing it last I fucked with collisions

quaint mantle
#

?paste

queen dragonBOT
quaint mantle
digital plinth
#

why is the wither still taking dmg

eternal night
#

because your runnable runs 80 ticks later ?

#

code outside the runnable just runs through

karmic grove
#

blocks.onBlockPlaced(REDSTONE_WIRE, function () {
for (let index = 0; index < 4; index++) {

}

})
here what i got how do i nake it broadcast to people with certin perms something like user has placed 4 redstone

digital plinth
#

okay i fixed it thx

eternal night
#

like, you do

makeInvulnearable
scheduleExplosionIn80
makeNotInvulnearable
#

yea

young knoll
#

Making a mob morph plugin I see

wraith rapids
#

no helping allowed

mystic tartan
#

Is there a maximum number of characters allowed in an inventory title?

main dew
#
    @Override
    public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
        if (!Utils.checkPlayer(sender))
            return true;
        Player p = (Player) sender;
        p.kickPlayer("");
        return true;
    }``` and this give me this warning in console ```
handleDisconnection() called twice``` how I can fix this?
eternal oxide
quaint mantle
#

how can i use PrepareItemCraftEvent for custom items in recipes?

main dew
young knoll
#

Do note isSimilar ignores stack size, but not durability

digital plinth
#

uhh so the only way to stop collisions is by using packets?

quaint mantle
young knoll
#

If they match, do nothing

#

If they don't setResult to null

main dew
eternal oxide
wraith rapids
#

HOW fIX

main dew
eternal oxide
#

what is the full warning?

main dew
rotund pond
#

That's not a problem I think ...
This message just indicates that a plugin try to disconnect you twice

rotund pond
eternal oxide
#

look at teh linked thread

rotund pond
#

that's what I'm doing x)

main dew
#

I have 1.12.2

eternal oxide
quaint mantle
#

Its because its trying to kick the player twice

#

it aint really that much off and issue

#

doesn't effect the plugin at all

main dew
#

I kick player only one time

eternal oxide
wraith rapids
#

1.12 is the worst version

main dew
wraith rapids
#

because it sucks

main dew
#

xD

proud basin
#

@wraith rapids Alright so I did what you said and made it into a sub command but the issue im running into is when I register Reload as a sub command I need to fill in the method with Water but I tried doing Water.class that didn't work.

outer sorrel
#

i have made the code in my playerjoinevent async but now this wont work

event.setJoinMessage(null);
young knoll
#

Don't make that part async

outer sorrel
#

Bukkit.getScheduler().runTask(plugin, () -> event.setJoinMessage(null)); ?

digital plinth
#

um can plugins detect player pressing wasd

ivory sleet
#

Just don’t wrap it in a task

wraith rapids
#

@proud basin learn java

proud basin
#

Thanks

wraith rapids
#

i don't have the effort to go on a "what is oop" tangent right now

proud basin
#

No one said you needed too

outer sorrel
ivory sleet
#

AsyncPlayerPreLoginEvent?

eternal oxide
digital plinth
#

um even after i set collision to false for both entities they are still colliding

#

y?

#

cuz the client don't know collision is disabled?

#

also can you make an entity invisible to one specific player?

eternal oxide
#

Have you set your collision and the entity collision off?

#

However the Scoreboard Team collision should be enough

digital plinth
#

yes both are off

digital plinth
#

im still colliding with ppl on my team

#

mobs on my team*

eternal oxide
#

add the player by name

karmic grove
#

how do i when event triggers it msg everyone with certain perms that it happned

eternal oxide
#

addPlayer is deprecated

digital plinth
eternal oxide
#

addEntry(player.getName())

#

oh sorry

#

yes name]

#

Player by name, entity by UUID

digital plinth
#

okie thx

#

its deprecated doesn;t mean it don't work

#

yea i am stil getting pushed

karmic grove
#

ok i want so when an entity gets tamed it notifies staff how would i do that

eternal oxide
digital plinth
#

does no colision don;t apply to mobs

digital plinth
karmic grove
digital plinth
eternal oxide
#

I've not tried

#

but I can, one sec

#

no collision with mobs is workgin for me

paper viper
#

why is your port 1

#

xD

digital plinth
#

will packets be able to stop collisions

wraith rapids
#

what games has palmergames produced

paper viper
#

palmtree game

eternal oxide
#

I just tested it and with collisions off there are no collisions between players and mobs in teh same team

digital plinth
#

he wither is constantly getting tped to me

#

is it bc of this?

#

that im geting pushed

eternal oxide
#

I'm not

digital plinth
#

?

eternal oxide
#

see for yourself. join server

#

I have all mobs added to teh same team

#

I disabled friendly fire. I can still hit the mobs but they take no damage

#

?paste

queen dragonBOT
eternal oxide
#

This tested and working. It has a couple of extras as its just a demo class.

silver cove
digital plinth
#

mine is like

#

the exact same

digital plinth
#

is it because im constantly teleporting the wither to me that im getting pushed

digital plinth
#

so when I stay still

final imp
#

hello, someone can help me with the bungeecord

#

please

digital plinth
#

i don't get pushed

#

but when I move i like can't seem to stop the velocity

#

i keep moving

final imp
#

went i try to connect send me this: io.netty.channel.AbstractChannel$AnnotatedConnectException

final imp
#

ok

weak steeple
#

Where can I put my minecraft skin so that they give me the plugin code?

eternal oxide
onyx shale
digital plinth
#

that?

eternal oxide
#

nope

#

but it is possible the TP action is doing something with collision boxes

digital plinth
#

would it fix it

#

testing...

eternal oxide
#

are you trying to hide inside teh wither?

digital plinth
digital plinth
eternal oxide
#

You are not going to be able to left or right click

digital plinth
eternal oxide
#

You will hit the wither

digital plinth
#

but it doesn;t really matter tbh

eternal night
#

Pretty sure getDirection clones internally

eternal oxide
#

it does

eternal night
#

You might wanna use setDirection

#

Not sure if a teleport is actually needed for this

#

I think it would be appropriate tho

digital plinth
eternal night
#

Basically you construct the correct location

#

And then teleport the either

#

Wither

digital plinth
vital ridge
#

yo

#

anyone has anyidea why i cant spawn skull as a falling block?

#

No errors, it just never spawns

#
skull = new ItemStack(Material.PLAYER_HEAD);
        skullMeta = (SkullMeta) skull.getItemMeta();
        
        skullMeta.setOwner("Nuxoria");
        
        skull.setItemMeta(skullMeta);
        
        fb = (FallingBlock) chicken.getWorld().spawnFallingBlock(new Location(chicken.getWorld(), chicken.getLocation().getX(), chicken.getLocation().getY() + 1, chicken.getLocation().getZ()), skull.getType(), (byte) 20);
        
        
        
        fb.setGravity(false);
        fb.setInvulnerable(true);
ivory sleet
#

might just be the client that decides not to render it

karmic grove
vital ridge
#

you sure?

wraith rapids
#

complex blocks like skulls and liquids don't work with falling blocks; the client can't render them

vital ridge
#

aight

silver cove
eternal oxide
karmic grove
silver cove
vital ridge
eternal oxide
vital ridge
#

I mean i just wanted to spawn a falling block

#

didnt pay attention rly

#

which one

#

does it affect something?

#

im on the newest spigot

eternal oxide
#

then use the one that doesn;t use magic num,bers

eternal oxide
#

modify to simplify

proud basin
#

How can I find the unicode for

vital ridge
#

since it asks for a block

#

I mean the error is that it must be a block

vital ridge
#
Caused by: java.lang.IllegalArgumentException: Material must be a block
#

points to the line

eternal oxide
#

you are using the wrong method. you still have a data byte on the end

vital ridge
#

no i dont

eternal oxide
#

show code

vital ridge
#
public DeliveryBox(Chicken chicken) {
        
        skull = new ItemStack(Material.PLAYER_HEAD);
        skullMeta = (SkullMeta) skull.getItemMeta();
        
        skullMeta.setOwningPlayer(Bukkit.getPlayer("Nuxoria"));
        
        skull.setItemMeta(skullMeta);
        
        fb = Bukkit.getWorld(chicken.getWorld().getName()).spawnFallingBlock(chicken.getLocation().add(0, 1, 0), skull.getData());

        fb.setGravity(false);
        fb.setInvulnerable(true);
        
    }
eternal oxide
#

change Bukkit.getWorld(chicken.getWorld().getName()) to chicken.getWorld()

vital ridge
#

did

#

I mean im not sure if this affects anything

#

but ill give it a try

eternal oxide
#

it shows no error here, but I've nto run it

digital plinth
#

welp

digital plinth
#

if i tp myself to an unloaded chunk

#

i don;t see thr wither anymore and i don't get pushed

quaint mantle
#

I'm having a problem with using my arenaConfig file (https://paste.md-5.net/qesiyiweti.cs). I've done so it's not much static in it but more constructors but I can't seem to be able to actually get the config or anything. This is how I get it in my main class: https://paste.md-5.net/idunefamak.java and I use this line when I register my event: pm.registerEvents(new PlayerJoinListener(this, this.arenaConfig), this);. This is also how it looks like in the event class: https://paste.md-5.net/adizotugal.java

quaint mantle
#

just a coding tip

digital plinth
#

okie thx

digital plinth
#

so libsdisguide did it

eternal oxide
# vital ridge but ill give it a try

New code to try ```java
Location loc = chicken.getLocation().add(0,1,0);
BlockData blockData = Material.PLAYER_HEAD.createBlockData();

FallingBlock fb = loc.getWorld().spawnFallingBlock(loc, blockData);
Skull skullBlock = (Skull)fb;
skullBlock.setOwningPlayer(Bukkit.getPlayer("Nuxoria"));```

digital plinth
#

the wither didn't push me around

#

i wonder how they did it

#

frick their source code is soo

#

weird

#

hmm i did /scoreboard players list

vital ridge
eternal oxide
#

doh

digital plinth
#

where can I find the docs on the different packets

quaint mantle
eternal oxide
#

as Skull is a tilestate

quaint mantle
#

Are there really nobody here that is able to help me with my issue?

eternal oxide
#

then delete ArenaConfig.setup(); from your onEnable

#

delete ArenaConfig from teh start of line 11 in your onEnable

#

so its just reads arenaConfig = new ArenaConfig();

quaint mantle
#

Can I ask how that's the issue?

eternal oxide
#

static abuse for 1, for 2 you are creating a local variable for arenaConfig instead of assigning your field

#

for 3 you don;t need a setup() method and you can replace it with a proper constructor

quaint mantle
#

Doesn't look like that was the issue at all

eternal oxide
#

it was a part of it, show your corrected code

quaint mantle
#

correct code?

eternal oxide
#

your code with the changes

quaint mantle
eternal oxide
#

ok, do you have a arena.yml in your data folder?

quaint mantle
#

yes

eternal oxide
#

ok, in your onEnable move the this.arenaConfig = new ArenaConfig(); to above the registerListeners

#

Now it shoudl work

quaint mantle
#

nope

#

almost like I should just go back to static abuse

eternal oxide
#

show yoru PlayerJoin listener class

quaint mantle
eternal oxide
#

which is line 29?

quaint mantle
#

int x = arenaConfig.getConfig().getConfigurationSection("lobbyLocation").getInt("x");

eternal oxide
#

how are you instancing yoru listener?

quaint mantle
#

pm.registerEvents(new PlayerJoinListener(this, this.arenaConfig), this);

eternal oxide
#

show the class that is in

#

actually show the registerListeners() method

quaint mantle
eternal oxide
#

your TIMV class doesn;t need to implement Listener, it already does, but it also has no Listeners in it

quaint mantle
#

wdym it doesnt need to implement it?

eternal oxide
#

JavaPlugin already implements Listener

quaint mantle
#

pm.registerEvents(this, this);

#

that one will just get an error then

eternal oxide
#

You also have no Listners methods in your TIMV class so no need to pm.registerEvents(this, this);

quaint mantle
#

the problem is still with the arenaconfig, not how that is handled?

eternal oxide
#

Yes, I'm correcting mistakes so your code is understandable. you have a null config. Which means either the file has not been loaded or your passing around instances has an error somewhere. By fixing all these issues we'll narrow it down

quaint mantle
#

I removed it

#

now it is like you said it

eternal oxide
#

ok, and you are 100% certain there is a file called arena.yml in your TIMV folder under plugins?

quaint mantle
#

100%

#

I can access it and implement things so yes 100% sure

#

via the arenamanager I have

eternal oxide
#

As your listeners are workgin I'm going to assume your EventManager implements Listener

quaint mantle
#

yes

digital plinth
#

uhhhhh

#

so how do you add a library in a Java project that don't use maven or gradlw

#

like this?

eternal oxide
quaint mantle
#

nothing is wrong with it but fine

eternal oxide
#

dude really? Lose the attitude. I'm going over your spider web code here. I would appreciate more manners.

quaint mantle
#

I do appreciate what you're doing

paper viper
#

learn to be respectful

#

we are using our time, we dont have to help if you are acting impolite

#

¯_(ツ)_/¯

quaint mantle
#

bro I am? I'm jus tnot sure what is wrong with it

eternal oxide
#

there are thre places that coudl be yoru null, arenaConfig, getConfig() or getConfigurationSection. The first two we have eliminated (probably)

#

instead of getConfigurationSection use getLocation

#

so Location loc = arenaConfig.getConfig().getLocation("lobbyLocation");

quaint mantle
#

getLocation isnt an option for me

eternal oxide
#

if that line works then you are fixed

paper viper
#

you are using some oudated version then

#

what api version?

quaint mantle
#

1.12

paper viper
#

😐

quaint mantle
#

thats the one ima stick with

digital plinth
#

why is my gradle project no building, I click the hammer thingy

digital plinth
#

i used to just male plain java projects

digital plinth
#

but the output

#

is not a jar

#

its like the same as src

paper viper
#

it should be in the libs folder

digital plinth
#

its just folders

#

library?