#help-development

1 messages ยท Page 1694 of 1

paper viper
#

and see if anything changes

#

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

#

also change the name please

#

from withdraw -> Withdraw

shadow tide
#

^

paper viper
#

Plus also
new withdraw()
and new smp.heart.heartsmp.events.withdraw()

shadow tide
#

?paste

undone axleBOT
paper viper
#

use unique naming conventions to differentiate from the two classes

last ledge
#

i want to send screen shot

#

of my thing

#

@paper viper check dm

paper viper
#

Fixed issue ๐Ÿ˜„

shadow tide
#

oh, hes offline well my question was ^

last ledge
shadow tide
last ledge
#

internal error occured while using the command

#

pls help

shadow tide
#

same thing 4 me

#

idk

last ledge
#

my console error

#

pls help

shadow tide
#

hello?

#

@quaint mantle can u help?

last ledge
#

my console error

#

help pls

shadow tide
#

Caused by: java.lang.IllegalArgumentException: Item cannot be null same error as mine, yet idk why its null.

last ledge
#

same

quaint mantle
#

why ping me

last ledge
shadow tide
#

bc u are the only person ik that may be able to help

quaint mantle
#

its an error that has been solved 20 times today

shadow tide
#

cool

last ledge
#

pls help me too

#

my console

shadow tide
#

I havent seen one of them

last ledge
#

error

shadow tide
quaint mantle
#

just read the error

#

๐Ÿ˜ญ

shadow tide
quaint mantle
#

it solves all of your errors

shadow tide
#

i just don't know where it is in my code

#

noooo

#

?paste

undone axleBOT
last ledge
#

pls see if there is error in my code

quaint mantle
#

Dudeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee

#

I have TOLD you

#

ItemManager is not initialized

last ledge
shadow tide
#

ItemManager.init();

quaint mantle
#

^

shadow tide
#

in ur main

quaint mantle
#

if its never initialized, how are the items gonna be created?

last ledge
shadow tide
quaint mantle
#

show your onenable

last ledge
#

see the main

shadow tide
#
        getCommand("heal").setExecutor(commands);
        getCommand("givewand").setExecutor(commands);
        getCommand("givefirewand").setExecutor(commands);
        getCommand("giveadminwand").setExecutor(commands);
        getServer().getPluginManager().registerEvents(new PluginEvents(), this);
        getServer().getConsoleSender().sendMessage("Plugin Enabled");
        ItemManager.init();```
quaint mantle
#

Lemme ask you something

#
Eat 5 apples
Buy 5 apples

does this make sense?

last ledge
#

yes

quaint mantle
#

How

last ledge
#

eat 5 apples = u are eating 5 apples

quaint mantle
#

how are you eating apples before you buy them

last ledge
#

buy 5 apples = you bought 5 apples

#

ohhhhh

quaint mantle
#

the apples (itemmanager) are being eaten? before being bought

last ledge
#

@Override public void onEnable() { ItemManager.init(); getCommand("giveheart").setExecutor(new ItemCommands()); getCommand("giveheartfragment").setExecutor(new FragmentCommand());

#

in my main class

quaint mantle
#

Right

last ledge
#

i have it on top

#

already

#

where did i do mistake??

#

its already there

quaint mantle
#

Who tf am i helping

shadow tide
#

idk

quaint mantle
#

Cjendantix or you

last ledge
#

idk

quaint mantle
#

well it applies to you aswell @shadow tide

last ledge
#

help me

shadow tide
#

yeah

quaint mantle
#

show your itemmanager class

last ledge
#

k

last ledge
#

problem is with heartwithdraw command

#

only

shadow tide
last ledge
#

didnt u?

#

lol

shadow tide
#

?

quaint mantle
#

What youtube tutorial is this its absolute fucking dogshit

#

and should not be spreading such bad practice

#

there would be NO errors like this if it were taught correctly

shadow tide
#

prob

#

sorry

last ledge
#

and how to fix it

shadow tide
#

not myfault

quaint mantle
#

what tutorial are you guys following

#

im gonna give you one 10x better

last ledge
#

and kim simpson

#

Now pls tell the fix of the error

shadow tide
#

TechnoVision sorry

shadow tide
last ledge
shadow tide
#

he has to insult us for bad practice first like Gordon Ramsey

#

come on call us donkeys

last ledge
#

bruh i will listen to ur talks later on

#

but i need fix rn

#

pls

quaint mantle
#

alright

quaint mantle
#

at this point

shadow tide
#

me

#

?

last ledge
#

bruh

quaint mantle
#
public class CustomItemManager {

}

lets make a class

#

no

#

mr Frolic man

#

how can he

#

like

#

ykw

#

my brain

#

im gonna make this github

last ledge
#

public class ItemManager { public static ItemStack Heart; public static ItemStack fragment; public static ItemStack heartwithdraw;

#

i already have

shadow tide
#

wtf

quaint mantle
#

legit

#

wtf

shadow tide
#

omfg

#

he be trollin so hard

last ledge
#

TechnoVision taught me

#

pls dont troll me

woeful crescent
#

What's the problem

shadow tide
#

I can at least see that TechnoVision is a bad f*cking startup and will never watch his videos again

last ledge
shadow tide
#

HE BE TROLLIN SO F*CKING HARD BRO

quaint mantle
#

LMAO

#

broooooo

#

just ignore them if they annoy you

quaint mantle
#

its just the lack of trying to fix and listen

shadow tide
#

hes talking to @last ledge

quaint mantle
#

oh

last ledge
#

2 people, same time, same tutorial, same error

#

lol

woeful crescent
last ledge
# woeful crescent show error?

inecraft_player issued server command: /heartwithdraw [06:56:50] [Server thread/ERROR]: null org.bukkit.command.CommandException: Unhandled exception executing command 'heartwithdraw' in plugin HeartSMP v1.0F at org.bukkit.command.PluginCommand.execute(PluginCommand.java:47) ~[server.jar:3241-Spigot-6c1c1b2-1492826] at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:149) ~[server.jar:3241-Spigot-6c1c1b2-1492826] at org.bukkit.craftbukkit.v1_17_R1.CraftServer.dispatchCommand(CraftServer.java:776) ~[server.jar:3241-Spigot-6c1c1b2-1492826] at net.minecraft.server.network.PlayerConnection.handleCommand(PlayerConnection.java:1931) ~[server.jar:3241-Spigot-6c1c1b2-1492826] at net.minecraft.server.network.PlayerConnection.a(PlayerConnection.java:1770) ~[server.jar:3241-Spigot-6c1c1b2-1492826] at net.minecraft.server.network.PlayerConnection.a(PlayerConnection.java:1751) ~[server.jar:3241-Spigot-6c1c1b2-1492826] at net.minecraft.network.protocol.game.PacketPlayInChat.a(PacketPlayInChat.java:46) ~[server.jar:3241-Spigot-6c1c1b2-1492826] at net.minecraft.network.protocol.game.PacketPlayInChat.a(PacketPlayInChat.java:1) ~[server.jar:3241-Spigot-6c1c1b2-1492826] at net.minecraft.network.protocol.PlayerConnectionUtils.lambda$0(PlayerConnectionUtils.java:30) ~[server.jar:3241-Spigot-6c1c1b2-1492826] at net.minecraft.server.TickTask.run(SourceFile:18) ~[server.jar:3241-Spigot-6c1c1b2-1492826]

woeful crescent
#

whoa

last ledge
#

ik now dont troll

quaint mantle
#

ok

woeful crescent
#

use ```

last ledge
#

i tried everything

quaint mantle
#

LMAO

last ledge
#

i tried everything

quaint mantle
woeful crescent
#

Please paste it

#

It's kinda hard to read

#

?paste

undone axleBOT
woeful crescent
#

What's the line?

last ledge
#

scroll down

quaint mantle
#

bruh

woeful crescent
#

Where's the commands class?

quaint mantle
#

heres all my code! now fix it!!!

last ledge
#

i am being polite sir

quaint mantle
shadow tide
#

uh huh

last ledge
#

AnkleDev sir, would you please help me fix my small error ?

quaint mantle
#

you're just giving everyone your work and expecting an instant fix

shadow tide
#

now your just trying to be annoying

hasty prawn
#

What's the issue now?

quaint mantle
shadow tide
#

I just want a decent tutorial on an item manager, can you redirect me to one? @quaint mantle

shadow tide
#

sad

#

is CodedRed ok?

quaint mantle
#

probs

#

hes ok

shadow tide
#

k

quaint mantle
#

i guess?

shadow tide
#

lol

last ledge
#

to get small help, you need to listen 100 lectures from each person who passess by

shadow tide
#

to get small help you look at the documentation

quaint mantle
#

that too

hasty prawn
#

@last ledge What's the problem with your current code? Don't just say it's not working.

last ledge
#

no

#

when i execute command

#

it says

last ledge
#

internal error occured

shadow tide
#

now I'm going to rewrite my entire item manager like a good boy ||lol||

shadow tide
hasty prawn
#

It tells you that in the error bounce

last ledge
quaint mantle
last ledge
#

just tell the simple line guys

hasty prawn
#

Make it not be null

quaint mantle
#

ya

last ledge
#

how

shadow tide
#

I had the same problem as him, I would like to know where to change it from null to not, can you please tell me

quaint mantle
hasty prawn
#

By giving it a value

quaint mantle
#

spoonfeeeeed

#

cant forget

#

caught in 4k

last ledge
#

bruh

#

this Ankle Dev

shadow tide
#

bruh

#

this Frolic Gamers

last ledge
quaint mantle
#

Frolic, if somebody wanted to give you code, they would

#

dont ask for it

shadow tide
#

I don't want code, I just want to know where the value it is talking about is located, because I don't have time to rewrite my item manager riiiiight this second ๐Ÿ˜†

last ledge
shadow tide
#

the thing is, i'm not

hasty prawn
#

Pretty sure the goal here isn't to go at each other facepalm

shadow tide
#

thats just how normal people talk to each other in real life, oh wait, you don't have one

last ledge
#

this moment reminds me of the song

#

I want somebody who can help me at my worst

shadow tide
#

I'm going to stop now because first, I gtg, second that was a bad roast, third, I want to be a decent human being

woeful crescent
#

I'm helping him

simple linden
#

Hello, I am presenting an emergency, I need to deactivate the portals that lead to the netehr, disable them, can you help me how to do it
please!

quaint mantle
fickle helm
#
class2 = new DataSaving(this);
class1 = new KeepHotbarItems(this, class2);```
quaint mantle
#

wrong ping bro

fickle helm
#

oh whoops, sorry

quaint mantle
#

np

#

i posted it in that thread

fickle helm
#

I didn't see it at first, refreshed and saw it

quaint mantle
#

they're deleting their posts for some reason

#

๐Ÿค”

quaint mantle
quaint mantle
#

(

#

:

#

is there a way i can make it follow a player instead of every map entity?

quaint mantle
quaint mantle
fickle helm
#

it seems your KeepHotBarItems is not using the reference you are passing it from the constructor

quaint mantle
#

hm?

echo basalt
#

It's a bit more complicated

fickle helm
#

this is programming basics. You really should do some basic learning programs instead of winging it

eternal oxide
#

?di

undone axleBOT
quaint mantle
#

?learnjava

undone axleBOT
tacit dagger
#

Hi guys, how do i make this BukkitRunnable always running after got reloaded / server restarted? because it will stopped after plugin reload or server restarting

young knoll
#

Start it in your onEnable

tacit dagger
solid cargo
#

why does it scream at me errors?

#

its a EntityByEntityDamageEvent

#

oh wait

#

nvm even event.getEntity didnt change stuff

wise hill
#

๐ŸŒถ๏ธ

minor vapor
#

the spacing o.o

solid cargo
#

oh no whats wrong again

wise hill
#

or dont load

#

ok then fuck u

solid cargo
wise hill
#

cloudflare firewall moment

minor vapor
#

your spacing

solid cargo
#

ok and?

wise hill
#

its ugly

solid cargo
#

it takes 1 sec to fix anyways

wise hill
#

looks like mc code ๐Ÿคข

solid cargo
#

istg spigot devs have the most severe ocd ever

wise hill
#

no

#

it's just ugly

solid cargo
#

but its my code no?

wise hill
solid cargo
#

why so?

wise hill
#

oh there embedding wokrs now

#

kek

solid cargo
#

anyways

wise hill
#

yes anyway very ugly pls fix

solid cargo
#

i have this shiz rn

#

oops not fixed yet

minor vapor
#

as in execution, not style

solid cargo
#

it throws an error

#

when i damage a mob

minor vapor
#

send the stacktrace

solid cargo
#

that is uh

#

the errors in console?

minor vapor
#

yes

last ledge
minor vapor
solid cargo
#

?hastebin

#

?pastebin

minor vapor
#

?paste

undone axleBOT
solid cargo
#

there

wise hill
#

wtf

#

why does malware block it LMAO

minor vapor
#

yeah I know it got filtered on mine as well lmao, just excluded it

wise hill
#

weird

minor vapor
solid cargo
#

wait what

#

it still gives errors there?

#

ok will send

minor vapor
#

yessir

solid cargo
#

((Player) source ).sendMessage(ChatColor.AQUA + event.getEntity().getName() + " has " + Math.round(( (Player) event.getEntity() ).getHealth()) + " HP!");

minor vapor
#

and send the entire method pls

solid cargo
#

the entire if source instanceof player?

minor vapor
#

the entire event

solid cargo
#

so class

#

ok

minor vapor
#

yikes

#

btw, the last if is useless, that can be removed

solid cargo
#

uh oh

#

ok

last ledge
#

all things are inside the link

minor vapor
# solid cargo ok

Also, don't initialize your projectile variable on a new line, that can be done on one line like your source variable.

#

Other than that, try it

solid cargo
#

okay

minor vapor
last ledge
#

check my code

minor vapor
#
Caused by: java.lang.IllegalArgumentException: Item cannot be null
    at org.apache.commons.lang.Validate.noNullElements(Validate.java:364) ~[server.jar:3241-Spigot-6c1c1b2-1492826]
    at org.bukkit.craftbukkit.v1_17_R1.inventory.CraftInventory.addItem(CraftInventory.java:287) ~[server.jar:3241-Spigot-6c1c1b2-1492826]
last ledge
#

i did everything

minor vapor
#

yes I did

last ledge
#

still dosent work

#

check my code

solid cargo
minor vapor
#

Inside of your ItemManager class, make sure the fields are initialized

minor vapor
last ledge
#

see i send u all codes

solid cargo
#

didnt try that thing yet

minor vapor
#

try it then and lmk

solid cargo
#

ok

minor vapor
last ledge
minor vapor
#

Ah, I see

#

you're using the field heartWithdraw and not invoking your getHeartWithdraw method which never sets the field

#

therefore it is null

last ledge
#

of what i should do?

minor vapor
#

not invoking your getHeartWithdraw method which never sets the field
simply invoke the method

last ledge
#

in innit clas?

minor vapor
#

instead of accessing your heartWithdraw field directly from your ItemManager class, use the method #getHeartWithdraw() instead

solid cargo
#

@minor vapor i fixed it with try, catch

#

ez

minor vapor
#

that's not a fix

solid cargo
#

the code like that is working

minor vapor
#

that's simply making it shutup when it errors

#

you should fix it properly

wise hill
#

๐Ÿฆก

solid cargo
#

its for private use anyways!

wise hill
#

still bad practice

solid cargo
#

yeah, true

minor vapor
#

two each his own

minor vapor
wise hill
#

sad we cant use external emojis

minor vapor
#

boosters can

wise hill
#

oh

stone sinew
#

Oh an error??? Lets just mute that shit

#

lol

solid cargo
#

meanwhile i added this thing!!!

wise hill
#

yes

solid cargo
#

so i didnt mute it entirely

wise hill
#

๐Ÿ˜ณ

minor vapor
#

no but simply throwing a try and catch on a problem to "fix" it isn't a good idea and as said above, it's bad practice

stone sinew
#

Try catch is used to try a code block and then catch any errors so you know why they are ocurring

minor vapor
#

^

minor vapor
young knoll
#

What does the runnable do

regal dew
#

clean up when the plugin shuts down

#

ie remove that entity thing

#

there's no way you can let a runnable live if the plugin is shutdown

young knoll
#

No but you can start it again

#

If you save the data you need for it

regal dew
#

sure, but cleaning up / just starting it again when the plugin is boot is preferred

#

as someone uninstalling the plugin will have that artifact left in their world

minor vapor
#

thats what it will do

#

well, the entity will need to be removed when the plugin is disabled

#

but you can re-create it with it's data as Coll said when the plugin starts back up

young knoll
#

I mean you donโ€™t need to remove it technically

minor vapor
#

I suggest creating a temporary data file in your plugins dir for entities cleaned up when the server is stopped

wise hill
#

since when can u explain shit

minor vapor
minor vapor
young knoll
#

You can get reference with its uuid

minor vapor
#

well depending on the plugin usage, if it's public and someone say wants to uninstall it, that runnable will no-longer be there when the plugin is disabled, so you'd need to remove the entity

young knoll
#

I suppose removing the plugin is a valid concern

minor vapor
#

yeah

young knoll
#

Although ideally a server owner would make sure any entities are already gone

#

If it comes down to it you can always /kill them

minor vapor
#

yeah that could work as well

crimson terrace
#

Im trying to execute a command when a certain mob dies. I store the command in the PersistentDataContainer of the mob. How would I be able to give the command input of who killed the mob?

solid cargo
#

is there any way i can make my custom entity not stop when its near me

#

the entity is not on nms btw

last ledge
#

if(player.isDead()){ Player killer = player.getKiller(); if(player.getKiller() instanceof Player){ AttributeInstance attrib = killer.getAttribute(Attribute.GENERIC_MAX_HEALTH); attrib.setBaseValue(attrib.getValue() + 2); AttributeInstance attribb = player.getAttribute(Attribute.GENERIC_MAX_HEALTH); attribb.setBaseValue(attribb.getValue() - 2); if(player.getMaxHealth()<2){ player.setGameMode(GameMode.SPECTATOR); }
i wanted to make if players dies with less than 2 max health
then his gamemode will be changed to spectator
but its not working
pls help

hasty jackal
crimson terrace
#

It is but im not sure how to change the command to where it contains the killer.

#

Actually is there a replace method in string?

#

Yes there is. Nvm me then

last ledge
#

Rainny pls help

onyx shale
#

you dont rly need to lock ti to java

#

3 ` not 2

last ledge
#
            Player killer = player.getKiller();
            if(player.getKiller() instanceof Player){
                AttributeInstance attrib = killer.getAttribute(Attribute.GENERIC_MAX_HEALTH);
                attrib.setBaseValue(attrib.getValue() + 2);
                AttributeInstance attribb = player.getAttribute(Attribute.GENERIC_MAX_HEALTH);
                attribb.setBaseValue(attribb.getValue() - 2);
                if(player.getMaxHealth()<2){
                    player.setGameMode(GameMode.SPECTATOR);
                }```
onyx shale
#

there you go

last ledge
#

help pls

#

i wanted to make if players dies with less than 2 max health
then his gamemode will be changed to spectator
but its not working
pls help

minor vapor
onyx shale
#

why are you verifin once the attribute then you simply go through player?

minor vapor
#

^^

#

you're not even using the attribute

onyx shale
#

you do it right for the killer yet get lazy for the player

last ledge
#

wut

onyx shale
#

player.getMaxHealth() why arent you checking the attribute instead

last ledge
#

i am checking right?? player,getMaxHealth()<2

onyx shale
#

use the attribute instead as its safer

last ledge
#

ok got it

#

leme try

#
                    player.setGameMode(GameMode.SPECTATOR);
                }```
#

this way?

onyx shale
#

ye try ity

last ledge
#

it says bad operand types for binary operator '<'

#

what operand should i use then?

minor vapor
#

you're getting the attribute and not the value

last ledge
#
                if(phealth < 2){
                    player.setGameMode(GameMode.SPECTATOR);
                }```
#

will this work?

minor vapor
#

it's the exact same code

onyx shale
#

why are you sending custompayload when there is specific packets for everything?

#

or are you messing with custom clients

gray zodiac
onyx shale
#

whats the error?

chrome beacon
#

No location

onyx shale
#

ahh yes

#

but thats for opening a book not for left clicking?

#

ahh in that case this wont do it a packet will meerly do the animation

#

the rod will still be there

#

wont rly matter

#

a packet is simply a visual thing

#

it doesnt have any effect on anything else

#

but anyway you can try sending the packet and see what happens

gray zodiac
# onyx shale whats the error?
'spawnEntity(org.bukkit.Location, org.bukkit.entity.EntityType)' in 'org.bukkit.World' cannot be applied to '(org.bukkit.entity.EntityType)'
onyx shale
#

1sec

chrome beacon
gray zodiac
#

oh

last ledge
#

will this work?

chrome beacon
#

No

#

Are you sure you know Java

onyx shale
#

what version?

chrome beacon
#

You're not putting any info in the animation packet

#

Oh and if you don't know what you're doing, use Protocollib

hardy pivot
#

Hi

#

If i want to store a multiple inventories for a player how i can do it?

#

i was using HashMap <Player, HashMap<InvName, Inventory>>

#

But idk if is the correct way

odd falcon
#

hi basically i am try to stop using shade maven plugin due it makes plugin size over 9mb so , so i made way to download thoses libs and check them on plugin loading but issue here i am using some hacky way that works on java 8 but it does not work on java9+ so i tried to make class loader for URLClassLoader, to load the downloaded jar files it loads but when start to use the jar file classes it throws ClassNotFound

onyx shale
#
PacketDataSerializer dataSerializer =  new PacketDataSerializer(Unpooled.buffer());
            dataSerializer.a(EnumHand.MAIN_HAND);
            PacketPlayInUseItem packet = new PacketPlayInUseItem();
            packet.a(dataSerializer);
            //send packet
hasty jackal
onyx shale
#

damn been so long last i worked with raw packets i forgot how to use protocol vg

#

ahh think you need a size for the buffer

#

do 256

odd falcon
#

@hasty jackal issue is that its 1.16.x only and i want for 1.15.2 or even lower but thanks for the tip

onyx shale
#

unpooled.buffer(size)

#

hmm i see

#
PacketPlayInUseItem packet = new PacketPlayInUseItem();
        PacketDataSerializer serializer = new PacketDataSerializer(Unpooled.buffer(0));
        try {
            packet.b(serializer);
            serializer.setByte(0,0);
            packet.a(serializer);
        } catch (IOException e) {
            e.printStackTrace();
        }
        //send packet
#

also dont send a second animation packet

#

only this one and see

chrome beacon
#

Just use Protocollib

#

Then you might have to figure this out on your own

#

Then do it the easy way and use Protocollib

#

You don't need to do everything on your own

#

Most servers have it installed anyway

onyx shale
#

alr setted up a 1.16 gonna test it now and see

crimson terrace
#

anyone know how to hide these messages?

eternal oxide
#

de-op yourself

crimson terrace
#

any way to not show them in the console?

eternal oxide
#

no point in hiding them from console

crimson terrace
#

alright, thanks ๐Ÿ™‚

quaint mantle
crimson terrace
#

oh so its nothing I have to do when making a plugin. nice ๐Ÿ™‚

onyx shale
#

Well seemes that was the wrong packet got one who does the animation

#

however what exactly are you tring to do?

sullen marlin
#

What about it is not working

#

The first method is correct

#

The second method does that

#

The first doesnโ€™t

onyx shale
#

well this bit akward

#

dont think there is a need for packets after all..

quaint mantle
#

Can anyone help me? I'm playing around with threading trying to get the return value

public class TestThread implements Runnable{
    public volatile int value;

    @Override
    public void run() {
        value = 2;
    }

    public int getValue(){
        return value;
    }
}

However getValue always returns 0 no matter what.

#
    @EventHandler
    public void onBreak(BlockBreakEvent event) {
        Player player = event.getPlayer();
        Thread thread = new Thread(new TestThread());
        TestThread testThread = new TestThread();

        thread.start();

        try {
            thread.join();
            player.sendMessage("Values from thread" + testThread.getValue());
        } catch (InterruptedException exception) {
            exception.printStackTrace();
        }
    }```
hasty jackal
#

you're creating two instances. the first one actually gets executed, the second one does not. and then you're loading the value from the second one. of course it does not have the changed value because it never got started

gray zodiac
#

My levels isn't increasing, anything wrong?

        @EventHandler
        public void onXPDrop(BlockBreakEvent event) {
            Block blockBroken = event.getBlock();
            Player p = event.getPlayer();
            event.setCancelled(false);
            p.getWorld().spawnEntity(blockBroken.getLocation(), EntityType.EXPERIENCE_ORB);
        }
pastel drift
ivory sleet
#

Like itโ€™s in the jdk

pastel drift
# gray zodiac how
p.getWorld().spawn(blockBroken.getLocation(), ExperienceOrb.class).setExperience(1);
gray zodiac
#

o

dull whale
#

is it a boolean or string when I type true into a yml folder

ivory sleet
#

Wat

dull whale
quiet ice
#

yes

solid apex
#

Where is the right channel to ask if i cannot get a plugin to work properly on my server?

ivory sleet
blissful folio
#

where can I find protocollib javadocs?

opal juniper
#

there arenโ€™t any afaik

#

itโ€™s pretty un-documented

blissful folio
#

Oh I see, well in that case is there somewhere I can find more about Spigot 1.17 NMS?

tribal sparrow
#

is there a way to stop a custom zombie from despawning when there are no players near by? i've tried Entity#setRemoveWhenFarAway(false); however 20 ticks later Entity#isDead() returns true still? I am spawning the zombie a little bit far away but before spawning i'm forcing the chunk to stay loaded with world#setChunkForceLoaded. Would anyone be able to help me out with this?

shadow tide
paper geyser
#

appreciation post for the people who answer questions and help people! You guys chill here and teach others and even if it benefits you a bit (teaching is the best way to learn) just know I appreciate you sm and so many people's plans would not have been possible without you so many thanks <3

paper geyser
#

i dont think your item is whats null

shadow tide
#

what is

#

oh, plugin is null

#

jeez

paper geyser
#

yeah

shadow tide
#

just looked at the caused by lol

paper geyser
#

at com.CJendantix.plugin.Plugin.onEnable(Plugin.java:18) ~[?:?]

#

whats at line 18 in your onEnable class?

shadow tide
#

getServer().getPluginManager().registerEvents(new PluginEvents(), this); so it has something to do with my events

paper geyser
#

yeah looks like it

quaint mantle
#

how can I make one stick get into my hand when I click a stick?

if you take it in the left hand, 1 stick will be taken from the left hand, if you take it in the right hand, 1 stick will be taken, if you take it in 2 hands, the left and right hands are used.
how can this be done normally?

paper geyser
#

you got this from here?

shadow tide
#

nah

#

bc idk what the problem is

#

there are no errors

paper geyser
#

when you register an event don't you have to declare the main and plugin?

#

it looks like you just have 1 thing set

shadow tide
#

huh

#

sorry

#

what

paper geyser
#

ok so

shadow tide
#

where is the declaration

#

i forget

#

lol

paper geyser
#

so you see the new PluginEvents(),

#

wait firstly is that your main class?

shadow tide
#

ye

paper geyser
#

aight

#

try putting a this inside the parenthesis?

#

like

shadow tide
#

got it

paper geyser
#

no clue if I'm doing this right so

#

but! hopefully this does something

quaint mantle
shadow tide
#

it made me make a constructor in my class

shadow tide
paper geyser
#

some people don't and it hurts me physically

wise hill
#

what's the error you are getting?

quaint mantle
#

Good, just want to check of u were getting a syntax error

paper geyser
#

plugin is null

#

their line 18 is
getServer().getPluginManager().registerEvents(new PluginEvents(), this);

quaint mantle
#

If u don't might can u send the PluginEvents class ?

wise hill
#

send the Plugin class

shadow tide
#

I'm not that stupid, if I was getting a syntax error, I would know

paper geyser
#

wait

quaint mantle
#

Just asking

paper geyser
#

hold on lets go back

#

correct me if im wrong but

quaint mantle
#

Plugin.plugin() is returning null when you call new PluginEvents()

paper geyser
#

to register an event?

wise hill
#

no

quaint mantle
#

no

paper geyser
#

ahhh

shadow tide
#

lol

paper geyser
#

shhhh

#

i said nothing

quaint mantle
#

Their is a default constructor of u don't have one written

paper geyser
#

oh interesting didn't know that

shadow tide
#

@paper geyser what time is it 4 u

paper geyser
#

6:47am and I haven't slept in like 18 hours

#

all nighter lol

shadow tide
#

nooo

paper geyser
#

im a lil loopy so

#

i'm not reliable but i'm invested now lol

quaint mantle
shadow tide
#

that means u won't be on at 10 for me, and 9 4 u

paper geyser
#

i will

shadow tide
#

oh

shadow tide
#

I gtg rn

paper geyser
#

gotta sleep at a normal time today

wise hill
shadow tide
paper geyser
#

oh no

#

they said making a constructor in their event class

#

not their main class

wise hill
#

main class?

paper geyser
#

yeah

#

this is in their main class

quaint mantle
paper geyser
#

but yeah borlea

#

so like

quaint mantle
#

He's either never setting the variable he returns or sets it after he tries to register events

paper geyser
#

EVENT CLASS:

    private final Main main;

    public EventClass(Main main) {
        this.main = main;
    }

MAIN CLASS:
Bukkit.getPluginManager().registerEvents(new EventClass(this), this);

quaint mantle
#

But he never gave the class

#

Definitely should do that instead but I aint trying to tell him how to do stuff, just fixing a problem

quaint mantle
paper geyser
#

yeah

#

as I was saying

#

and idk why i didn't say this clearer

#

wait

#

nvm

#

shhh

#

oh

#

so you're using PlayerFishEvent right?

#

just do event.gethook.remove

onyx shale
#

no luck tho,from what i understand it is possible to listen to the event,check state,set item then it should do it

paper geyser
#

yeah

onyx shale
#

as the event seem to trigger on fish bite so you can be tricky and play the sound and such

paper geyser
#

PlayerFishEvent?

onyx shale
#

yes

paper geyser
#

nah

onyx shale
#

it triggers on fish bite

paper geyser
#

nope

onyx shale
#

with the state fish_bite

paper geyser
#

oh

#

yes

onyx shale
#

i just tested it a while ago..

paper geyser
#

then it does lol

#

i thought you meant in general

onyx shale
#

yeah however actually forcing pull seems impossible

paper geyser
#

you could just remove the hook and give the item to the player maybe

onyx shale
#

even thought it should be possible through .getHook.pullhook

#

yet it doesnt

paper geyser
#

mmm

#

mhm

#

there's a few solutions

onyx shale
#

you do it through event..

blissful folio
#

How can I open a custom inventory on a resource pack using Spigot?

onyx shale
#

as mentioned above through playerfishevent

paper geyser
#
  1. do a sudo fishing rod pull up with event.getHook().remove
  2. figure out how event.getHook.pullHookedEntity() bc apparently it doesnt work
#

OH

#

you want to force another player to pull it up?

onyx shale
#

only 1 problem though..

#

gl actually getting the possible fish from the loot table

paper geyser
#

you could randomly choose it

onyx shale
#

think loottables are broken in 1.16

paper geyser
#

ahh

onyx shale
#

fkd up nms implementation

paper geyser
#

mmm not quite

#

i'm not sure if

#

you can do that through the click event?

#

It's obviously possible but it requires a completely different approach

#

when a player fishes you could save the hook in a hashmap

#

then remove it on left click and give the player the item manually

#

so

onyx shale
#

this should do it

#
@EventHandler
    public void fish(PlayerFishEvent event){
        Player p = event.getPlayer();
        if(event.getState() == PlayerFishEvent.State.BITE){
            p.sendMessage("Bite");
            ItemStack rod = p.getInventory().getItemInMainHand();
            //Add damage to rod??
            p.getInventory().setItemInMainHand(null);
            Bukkit.getScheduler().runTaskLater(this,()->{
                p.getInventory().setItemInMainHand(rod);
            },2);
            p.playSound(p.getLocation(), Sound.ENTITY_FISHING_BOBBER_RETRIEVE,1f,1f);
            p.getWorld().dropItemNaturally(p.getLocation(),new ItemStack(Material.COAL));
        }
    }
paper geyser
#

that's not what they're asking I think

onyx shale
#

what to drop its up to you,doing damage to rod up to you

#

auto fish

#

thats what they askin for

paper geyser
#

from my understanding they want to stop people fishing

#

that would do autofish so good job! good code homie

#

(that sounds sarcastic it's not quick thinking is cool)

onyx shale
#

thats what he wanted..

paper geyser
#

is it?

#

I'm so confused-

#

I feel like i'm coming off rlly passive aggressive so sorry if I am haha

#

i think we're being friendly? I'm not sure I don't mean to come off aggressive

#

if I am i'm super sorry

onyx shale
#

didnt you want autofish? @quaint mantle

#

basically pull up the rod when a fish bites

paper geyser
#

from my understanding they want to make other people stop fishing

#

so like

#

when they click on a player it pulls up their rod

onyx shale
#

wut... you want spear fishing like?

vernal pier
#

theres a method called pull or something

paper geyser
#

yeah ok

vernal pier
#

on fish hooks

paper geyser
#

so what you want is

onyx shale
paper geyser
#

ok so

vernal pier
#

why not

onyx shale
#

and ima head out

paper geyser
#

aight

dire marsh
paper geyser
#

again stell sorry if I came off as mean

#

I didn't mean to

onyx shale
#

@dire marsh not working.. at least for 1.16

paper geyser
#

ok so toto

dire marsh
#

what does not working mean

onyx shale
#

you call it yet nothing happens

#

doesnt actually pull the hook

paper geyser
#

you're gonna detect when the player clicks on a player

#

no

vernal pier
#

when are you calling it

paper geyser
#

scrap that

vernal pier
#

it needs a hooked entity to pull

dire marsh
#

might be calling it at the wrong time, but if it's actually not working then make a bug report

paper geyser
#

first you're gonna make an event (PlayerFishEvent) and you're gonna put a hashmap that stores the player and their hook

#

OH

#

so they always catch fish?

#

so they can spam the fishing rod

#

and catch something

#

cool

dire marsh
#

you probably need to impl own logic then...

paper geyser
#

oh great i've done smth like this

#

ok so

dire marsh
#

or well, can't you just set the min/max wait time very low?

#

and then force a pull

#

wouldn't that work?

paper geyser
#

forcing pulls doesn't work tho remember?

#

anyways imma head out cya

dire marsh
#

look at those methods

#

Get the maximum number of ticks one has to wait for a fish biting.

#

...

chrome beacon
#

Why are you still on 1.15.2

onyx shale
#

i gave up once i understand himself doesnt know what he wants

dire marsh
#

you gotta use nms then, but I don't see why you wouldn't update to 1.16

#

???

chrome beacon
#

Just update your stuff

dire marsh
#

1.16 nms is fine?

#

that argument only work if you were on 1.16 and needed to update to 1.17, but even then updating nms between those isn't too hard

chrome beacon
#

No one really uses 1.15

dire marsh
#

then you are on your own

onyx shale
#

damn spittin on viaversion/backwards

dire marsh
#

we have given you the solution, it's up to you to either update and use that or find a way using nms

wise hill
#

nms gay

onyx shale
#

๐Ÿ‘€

#

simulates pulling the rod

dire marsh
#

I told you

#

try setting the max time

chrome beacon
#

It does work

dire marsh
#

then pulling when a fish has bitten

#

bruh

#

then how can you say "it doesn't work" when you are on 1.15 and haven't tried 1.16

chrome beacon
#

You will need nms

onyx shale
#

๐Ÿคทโ€โ™‚๏ธ

dire marsh
#

go find it

chrome beacon
#

^^

dire marsh
#

you could just save yourself the pain by updating...

chrome beacon
#

Just let the users use 1.16

#

Like why support 1.15

dire marsh
#

what 1.16 item are you talking about

wise hill
#

or use via

chrome beacon
dire marsh
wise hill
#

u can its just a plsceholder item

chrome beacon
onyx shale
#

that only plays out the pull fishing rod animation

#

you have to remove the hook give item or such

dire marsh
#

I'm pretty sure via would "fix" that

onyx shale
#

i still dont know what the problem is in the first place lol

ancient whale
#

Hey, I would like to be sure, does the Location#getChunck automatically loads the chunk ? seems like it does

ancient whale
onyx shale
#

Have a list of uuids(players that are fishing),add the player in the list if he throws a hook(listen to playerfishevent),listen to interactevent check if its left click,check if the player is in that list,check if he has a fishing rod in the hand,do the swap trick to simulate pulling,play a sound,give fish,remove from list,also you could have a runnable checking if the players in the list still have a fishing rod

quaint mantle
#

does anyone have a resource for NMS pet following

chrome beacon
#

Has anyone here worked with Bluetooth with Java or JS? I'm having issues getting it running. Any library is fine ;/

onyx shale
#

oh boy good ol pathfinding

vernal pier
#

do you really need nms for pathfinding

chrome beacon
onyx shale
#

seems not unless you store the event call and work with it

dire marsh
onyx shale
#

even for paper you still need if its packet based

chrome beacon
#

True

onyx shale
#

yes

paper geyser
#

i'm back

#

it's so cool that people also think that vanilla fishing is weird lol

#

like

#

it's not weird just like

#

also not my favourite fishing system yk?

#

you know

#

like

#

it means "you know"

#

minecraft's vanilla fishing system

#

been working on my own for like a week now

#

almost 2

#

:0

#

thats cool

dire marsh
#

check if the action was left click air then?

eternal oxide
#

do you have torches equipped in your off hand?

quaint mantle
#

I accidentaly deleted jdk 14 from my computer, now my code has errors everywhere. I reinstalled it and it still doesnt work. Please help

paper geyser
#

use PlayerFishEvent

#

PlayerFishEvent fires when the player throws the rod

chrome beacon
chrome beacon
#

...

wise hill
#

<3

quaint mantle
#

thank goodness it worked i was worried for a second

wise hill
#

:)

quaint mantle
#

<3

ancient plank
#

its 2021, nothing works

maiden briar
#

Attempt to access Class objects for TypeMirrors [ClassName] Maven does not show me the stack trace so idk what's wrong. The problem must be on the new added code:

Register registerAnnotation = element.getAnnotation(Register.class);
boolean continueLoop = false;

for(Class<?> clazz : registerAnnotation.toNotRegister())
{
    String className;

    try
    {
        className = clazz.getName();
    }
    catch(MirroredTypeException e)
    {
        className = e.getTypeMirror().toString();
    }

    if(className != null && !processingEnv.getTypeUtils().isSubtype(element.asType(), processingEnv.getElementUtils().getTypeElement(className).asType()))
    {
        continueLoop = true;
        break;
    }
}

if(continueLoop)
  continue;
quiet ice
#

does your IDE show the location of the error?

maiden briar
#

No, only that line

#
[INFO] 
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ DogLeader ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 21 source files to C:\Users\<>\IdeaProjects\DogLeader\target\classes

This is the output

#

With -e it works fine

quiet ice
#

what does that flag do again?

maiden briar
#

Print the full stacktrace

#

But it does not solve the problem

true perch
#

Does anyone know how to connect a Hosted Minecraft Server to my Local SQL Database? I want to do this for testing purposes, and I'm also super interested in learning how this is done.

wise hill
#

open the port

#

and use ur external ip

true perch
#

and which port do I open?

chrome beacon
#

Google what is my ip

wise hill
maiden briar
#

javax.lang.model.type.MirroredTypesException, at
for(Class<?> clazz : registerAnnotation.toNotRegister())

@Inherited
public @interface Register
{
    RegistrationType value();

    Class<?>[] toNotRegister() default {};
}
quiet ice
#

It is possible that the class is not on mavens build path

maiden briar
#

The class input are all classes which should be compiled

quiet ice
#

Or if it is, it could be in an altered state (which is the pain of javax.* packages - the JVM could provide them, but so could some random library)

maiden briar
#

StackOverFlow sais I have to wrap it in the exception, and from the exception I can get the type mirrors

full nexus
#

guy pls help i dont get any damge and mobs dont target me just like creative mode in my server iam the only who have this glitch pls help this is annoying

chrome beacon
#

It's not

onyx shale
#

He alrdy spammed like hell in there as well

quiet ice
#

then we know who won't live long

quiet ice
maiden briar
#

Because Java can't work with class objects?

#

Idk what is going on here

quiet ice
#

class objects as in?

true perch
maiden briar
#

Class<?> or Class<?>[] (I use the last)

maiden briar
#

That is the default SQL port

true perch
#

there's just 4 things that say "mysqld"

quiet ice
#

Ah, so you want to get the value of the annotation as a java/lang/Class array?

maiden briar
#

Yes

wise hill
#

yes, that's the porn you open on your router

maiden briar
#

And then check the classes

wise hill
#

port*

true perch
#

yeah but which one do I open

#

since there's 4 of them

wise hill
#

shouldn't matter

true perch
quiet ice
#

but the checking the classes thing isn't problematic right now, right?

maiden briar
maiden briar
true perch
quiet ice
#

at runtime?

maiden briar
#

When I call toNotRegister (which should return Class<?>[]) it does not work

maiden briar
#

Ok it works if I catch the exception

#
            try
            {
                registerAnnotation.toNotRegister();
            }
            catch(MirroredTypesException e)
            {
                types = e.getTypeMirrors();
            }
#

But is seems it still does not ignore the class

true perch
#

Is it supposed to be simple to open port 3306?

maiden briar
#

Yes in your router settings open it

#

And also open it in Defender

true perch
#

okay

maiden briar
#

In windows CMD do ipconfig and check for Default Gateway, browse that ip and open port 3306

true perch
#

Alright I'll try ๐Ÿ˜…

maiden briar
#

@quiet ice do you know a solution? Because catching the exception does nothing

true perch
#

Should I get the default gateway for my Wireless LAN Adapter Wi-Fi, or Ethernet Adapter ZeroTier One

quiet ice
#

Why can't you do Class#getName() or somethin like that to get the class name?

maiden briar
#

I tried

quiet ice
#

I don't really understand why you need to use javax packages for that

maiden briar
#

I am doing more then only that

maiden briar
#

I also have that problem, sometimes I get randomly teleported somewhere else if I try to get the spawn location

quiet ice
#

Ugh, the whole Type mirror thing lacks documentations

maiden briar
#

Yes I also found that out

#

I can better create a sub annotation which you use to not register classes

quiet ice
#

is the JVM automatically wrapping the class objects into type mirrors?

maiden briar
#

Idk

#

Yes it works if I create a seperate annotation and listen for it per class

shadow night
#

Is there a right click and left click event?

quiet ice
#

PlayerInteractEvent?

shadow night
#

Uh maybe idk

#

Like when player clicks on a mouse button the event is ran?

quiet ice
#

nah, there is no event for that. The events are always based on packets

shadow night
#

Okay

#

How do AntiAutoClickers plugins work?

eternal oxide
#

you have left and right click but not seperate events.

quiet ice
#

such plugins either read packets or listen for things such as EntityDamageEntityEvent and similar

eternal oxide
#

I guess it depends on teh type of auto click you are trying to detect

quiet ice
#

it does, yes

#

Most plugins just bother with events that actually do something

shadow night
#

Like I want to prevent people to click over 45 cps

eternal oxide
#

auto clicker for mining cobble, you'd time between click events

#

ah

#

then packets

quiet ice
#

that being said, there is no "click" packet to speak of

shadow night
#

Hmm

quiet ice
#

You will have to aggregate many packets to make an approximation of what could be the clicks

shadow night
#

Uh seems to be hard

eternal oxide
#

?pmc

quiet ice
#

However if the player is using autoclicker and there are not more packets than without, it is as if there is no autoclicker, so the count of such packets suffices mostly.
The same applies to events

shadow night
#

Uh sounds complified

quiet ice
#

it's not that hard. You just look at the list of events and listen for the events that are caused by a click, then dump it into a central processor method that does the actual logic

shadow night
#

oh

#

Now it sounds easier

quiet ice
opal juniper
#

what method is used by a hashset to check whether an element is already stored? can i override it?

quiet ice
#

HashSet is just an HashMap so it's #equals(). You cannot override it easily

shadow tide
#

@paper geyser hi

#

I'm back

paper geyser
#

hi

sullen geyser
#

welcome back ๐Ÿ˜

shadow tide
#

so, where did I leave off?

paper geyser
#

not sure

shadow tide
#

err, do you remeber what my question was

paper geyser
#

your plugin was null right?

shadow tide
#

yeah

#

@paper geyser

sullen geyser
#

So Plugin.plugin() is null?

shadow tide
#

? no

sullen geyser
#

What's null then?

shadow tide
#

at com.CJendantix.plugin.Plugin.onEnable(Plugin.java:18) ~[?:?]

sullen geyser
#

Show your main class then

shadow tide
#

what variable

sullen geyser
#

It is plugin.plugin() that is null

#

It's probably not initialised when you initialise the listener

shadow tide
#

?

#

what is plugin.plugin()

sullen geyser
#

NamespacedKey key = new NamespacedKey(Plugin.plugin(), "pdckey"); this line

#

It's not in your main

#

On line 18 you're creating a new class named PluginEvents

#

Or, a new instance of that class.

shadow tide
#

yes

sullen geyser
#

but Plugin.plugin() is null

#

So NPE ๐Ÿคทโ€โ™‚๏ธ

#

Show me your main class if you want me to help you further

shadow tide
sullen geyser
#

Yeah, so you have a variable named plugin which is returned by the method plugin()

#

But you're never setting it to anything

#

hence why it's null

shadow tide
#

so what should I set it to?

sullen geyser
#

this

shadow tide
#

so private static Plugin plugin = this;?

solid cargo
#

is the original zombie AI smart enough to utilize jump boost?

sullen geyser
paper geyser
sullen geyser
#

You cannot set it like that

shadow tide
#

yeah, so remove static

#

did that

sullen geyser
#

But you can do plugin = this at the top of your onEnable method

solid cargo
shadow tide
#

oh

#

did that

#

should work now?

sullen geyser
paper geyser
#

ill check for you

solid cargo
#

nonono

#

i will try myself!

solid cargo
#

its very hard to get

paper geyser
#

no clue