#help-development

1 messages · Page 2209 of 1

solid sigil
#

Oh I misunderstood the original question. Yeah language really should have no effect, there might be different defaults but you can always change it

coarse elk
#

Does anyone know how to keep items in the players 2*2 crafting grid?

quaint mantle
#

how tf would that work

#

kotlin and java compile to the same thing

#

its not like arrays magically grow in size depending on the language

solid sigil
sterile token
#

Allright
Also where i can find Ziggurat library?
I have searched around all github and didnt find it

quaint mantle
#

it no longer exists

#

use a different library

sterile token
#

Oh ok

#

I didnt know

#

Really thanks

quaint mantle
#

apparently the developer got banned, it was paid anyways

coarse elk
sterile token
#

I can suppouse that Ziggurat was on MCM (MC-Market)?

quaint mantle
#

yes

sterile token
#

Oh

#

A friend just send the last version of the lib before getting banned the author

#

Its ilegal but me

#

As far i dont use it on public resources no one will matter

solid sigil
crisp steeple
#

def possible, i would suggest using packets since thatll cause the least pain but i saw you were having issues with that as well

sterile token
#

Yeah i hate using packets

#

They are really painful

crisp steeple
#

hmm well i think this could be possible just by modifying the setslot packet going to the client, let me take a look

ornate patio
#

how do i properly send the male and female emoji

quaint mantle
#

#

\♂

#

\♀

ornate patio
# ornate patio

player.sendMessage(Utils.colorize("&9♂ Male")); results in this

ornate patio
# quaint mantle

if i paste in the male emoji into chat, it also pastes some weird character after it..

ornate patio
#

thanks

humble tulip
#

male horsey

ornate patio
#

how do i send an empty line in chat

quaint mantle
#

||
||

ornate patio
#

nvm

#

yeah thanks

quaint mantle
#

can you not send a space?

ornate patio
humble tulip
ornate patio
#

_ _

humble tulip
#

how do i copy that

ornate patio
#

underscore underscore

#

_ _

humble tulip
#

__

ornate patio
#

type that

quaint mantle
#

what i did is ||(\n)||

ornate patio
#

with a space

humble tulip
#

_ _

ornate patio
#

_ _

quaint mantle
#

||
||

humble tulip
#

oo

ornate patio
#

_ _

river oracle
#

nah you can't

#

wo

#

that updated

quaint mantle
river oracle
#

when I sent the message there were like 50 messages not there

humble tulip
#

how is ur disc so dark

sinful comet
#

Cannot resolve method 'isInvulnerable' in 'Player'

public class GodCommand implements CommandExecutor {

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (sender instanceof Player) {
            Player p = (Player) sender;
            if (p.isInvulnerable()) {

            }
        }


        return true;
    }
}
quaint mantle
#

did you import the right Player

#

are you using a spigot-api version that includes that method

sinful comet
#

I'm using Intellij

quaint mantle
#

that in no way correlated to what i asked

sinful comet
#

I wasn't answering the API version

#
<version>1.8.8-R0.1-SNAPSHOT</version>
quaint mantle
#

im not gonna go searching for helpchat docs

#

update

#

have fun

sinful comet
#

import org.bukkit.entity.Player;

#

I would say I have the right import

quaint mantle
#

search for the method

solid sigil
#

you might have to cast it to entity?

#

it should do it automatically but it might have missed it

quaint mantle
#

i dont think the method exists in 1.8

river oracle
#

computers generally don't miss things

solid sigil
#

oh 1.8

#

idk that was the best error i could think of

#

you're prob right ab version

#

yeah I just checked

#

tanner you'll have to find a different way to check invulnerability or a different condition to check for

sinful comet
kind hatch
#

It might have actually been called god mode in 1.8

humble tulip
#

suggestions for a class that will store my lang.yml stuff?

#

idek what to call it

solid sigil
kind hatch
humble tulip
#

one lang file

solid sigil
humble tulip
#

ppl can set lang stuff themselves

#

ig i can provide translations on github

#

but one is enf

kind hatch
#

Hmmm, well I call my setup LocaleManager

humble tulip
#

nice ty

sinful comet
#

enables and disables god for a player

humble tulip
#

that's easy

#

is that all the plugin does?

sinful comet
#

I'm checking if they're invulnerable and disabling vulnerability

kind hatch
#

It's for 1.8 though.

sinful comet
#

if they aren't invulnerable, i enable vulnerability

humble tulip
#

u gotta put invulerable players in a set

#

and cancel any dmaage to them

#

and when they run the command, check if theyre in the set

#

remove them

sinful comet
#

i'm just gonna dev for 1.19 and use via backwards and rewind for older players

humble tulip
#

or if not, add them

#

lol

#

yep that's the way to go

sinful comet
#

I can use via backwards and rewind together right?

humble tulip
#

languagestorage is the way to go since they can also create placeholders to use in other parts of the plugin config so they dont need to keep typing or copy pasting

sinful comet
#

how do i get the latest version of java?

#

oracle is only showing me 8

golden kelp
#

get from adopitum

#

adoptium JDK 17

kind hatch
#

Or Zulu

sinful comet
#

got it from azul

humble tulip
solid sigil
#

That's a lotta .yml's

kind hatch
river oracle
earnest forum
#

new items?

#

and its not config

#

clearly the actual config yamls are outside of the versioned folders

tranquil viper
#

Does anyone know how to get the location of a chest when you close the chest's inventory?

humble tulip
#

See if it's a chest

#

And then get chest location?

tranquil viper
#

Ah I was getting its location before checking if it was a chest

#

thanks

reef forge
#

How can i get a list of goals of a mob in nms since i want to clear it up

#

ping me if you can help

humble tulip
#

And you can get the goals from there

reef forge
#

targetselector?

humble tulip
#

Yes

reef forge
#

ok but

#

When i try to clear it

#

it gives error since teh function is protected

humble tulip
#

Use reflection

river oracle
#

use my reflection Utils that are totally safe and aren't public

reef forge
#

so it can completly remove the old target ai right?

humble tulip
#

Yes

reef forge
#

ok

humble tulip
#

Are you sammu 😂

reef forge
#

um sorry?

humble tulip
#

Nvm

#

He had the same question

#

Why are you clearing the goals tho

#

Jist make an enitity wifh no goals

#

Just*

earnest forum
#

make a class that extends the entity you want

reef forge
#

i want to clear goal cuz i want to avoid phantom hitting the players

#

just want to convert phantoms to bird

humble tulip
#

Ah ok

#

U can do it either way

earnest forum
#

PhantomAttackPlayerTargetGoal

#

this is mojang mapping name

reef forge
reef forge
earnest forum
#

thats complicated

#

u dont have to do that

#

because then you have to define what the entity will do every tick

humble tulip
humble tulip
earnest forum
#

yea i guess but its a lot more complicated for just removing 1 goal

quaint mantle
#

any way to add mutliple version support to a plugin?

compact haven
#

yes

quaint mantle
#

how?

#

are there any tuts?

compact haven
#

oh that's a different question

#

was only prepared to answer if there was a way

quaint mantle
#

aa

#
@SuppressWarnings("unused")
public class v1_16_R2 extends VersionSupport {

    private static final UUID chatUUID = new UUID(0L, 0L);

    public v1_16_R2(Plugin plugin, String name) {
        super(plugin, name);
        loadDefaultEffects();
    }

    @Override
    public void registerVersionListeners() {
        new VersionCommon(this);
    }```
#

like dis?

#

?verify

compact haven
#

let me type

quaint mantle
#

okay

compact haven
#

there are two ways that you can entertain, based on how much of your codebase requires this:

  • use a common abstraction module with interfaces & utility classes

  • then have a module for each version-range that you support & can operate

  • use an interface that outlines version-specific methods

  • implement that interface for each version/range that you support

if the versions are different because of nms, then there's the first two and:

  • using Moderocky/Glass library to generate usable objects based on an interface & annotations specifying nms methods
quaint mantle
#

alr

sweet pike
#

is anyone here familiar with skript? how would i turn this into java/bukkit code?

drawDragonBreath particle "flame", center player, id {_id}, arcPitch .1, arcCount 20, arcDensity 50, arcSteps 2, arcLength 6, visibleRange 30

small current
#

what is the event for an item being dropped for any reason

#

like chest being broken

#

and sruff like that

earnest forum
#

dont think there is one

small current
#

i should listen to block and entity ?

earnest forum
#

theres PlayerDropItemEvent, EntityDropItemEvent, BlockDropItemEvent

#

yea

#

listen to both and have them call the same method

small current
#

so listening to entity and block will do for all items being dropped?

earnest forum
#

most

#

could be all

#

dont count on it though

sinful comet
#

entity should also include players

#

since players inherit the entity class

reef forge
#

'this.targetSelector.removeGoal(NearestAttackableTargetGoal);' why it gives error?

glossy barn
#

Whats the context the code is in?
What is the error you're receiving?

reef forge
sinful comet
#

How do I prevent the player from losing any hunger without changing the game mode?

Java 17
API version 1.19

reef forge
#

give him saturation 1 forever

#
@Override
        protected void addBehaviourGoals() {
           
        }```I am unable to override this function
wet breach
#

why the double cast?

untold sierra
#

Hello, can I create a custom entity with custom model without using a resource pack?

wet breach
#

you can create a custom entity class without a resource pack, but the custom model comes from the resource pack since the client only contains default models

#

the best you could do without resource pack is disguise the entity as a different one but that gets a bit more complex

untold sierra
#

hmm ok thanks

small current
#

what is the event for hopper picking up items

dark arrow
#

bro i did as told and zombie no longer fights player but for some reason zombie is not fighting any mobs even i added the code fight pigs

ruby fjord
#

Does anybody know if in MariaDB BIN_TO_UUID is implemented?

untold sierra
#

im unable to create a class that extends a horse why..?

iron glade
#

everyone having problems here today

mighty pier
#

how do i give armor stands data?

tender shard
mighty pier
#

idk

#

i just like want to

#

access them

tender shard
tender shard
#

?services

undone axleBOT
dark arrow
#
@Override
    protected void addBehaviourGoals() {
        this.targetSelector.addGoal(2, new NearestAttackableTargetGoal(this, Player.class, false));
        this.targetSelector.addGoal(2, new NearestAttackableTargetGoal(this, Pig.class, true));
    }```I have ovverrided the behaviour goals so that zombie wont kill players and fight pigs instead but it works fine for player but for somereason it does not fight players
earnest forum
#

because you're overriding the same goal

earnest forum
#

you are setting the 2nd goal to kill player and then resetting it to kill pig

tender shard
#

the video only shows your IDE

limpid bronze
#

oh my bad sorry

dark arrow
earnest forum
#

you are setting the 2nd goal to kill player and then resetting it to kill pig

sinful comet
#

@quaint mantle post your error here and wait for someone to help.

quaint mantle
#

hi guys i keep getting this bug with a couple of my plugins in my console what does this mean- 12.06 10:25:33 [Server] Server thread/WARN Legacy plugin BetterCreeperEggs v1.9 does not specify an api-version.

does it mean the plug-in is corrupted or something

tender shard
earnest forum
#

yes because your name gets set to your spigotmc name

tender shard
quaint mantle
#

okay cheers

#

but what does it actually mean

#

doesn’t mean like anything is wrong with them right?

#

wait actually i think something is wrong alex it’s doing it for all of my plugins

#

everyone

#

and they used to work fine without it

brittle lily
#

Hey Guys How Can I get Players From List

quaint mantle
#

and i uploaded all the plugins to my new server and now they all getting this bug and not working properly

tender shard
#

do you know how a list works?

quaint mantle
#

alex do you know?

sinful comet
tender shard
quaint mantle
#

alex this was the line before the messages about the plugins Initializing Legacy Material Support. Unless you have legacy plugins and/or data this is a bug!

#

okay thank you

dark arrow
earnest forum
#

yeah but you're resetting the same goal

#

which is 2

#

you're setting the 2nd goal to not kill players and then setting it to kill pigs

#

set one of them to a different goal

brittle lily
dark arrow
dark arrow
# earnest forum set one of them to a different goal
@Override
    protected void addBehaviourGoals() {
        this.targetSelector.addGoal(1, new NearestAttackableTargetGoal(this, Player.class, false));
        this.targetSelector.addGoal(2, new NearestAttackableTargetGoal(this, Pig.class, true));
    }```
tender shard
#

I wish there was a way to declare both a static and non-static method with the same name in the same class :<

limpid bronze
#

Hey, I have problem, when I click on the result slot the event it's cancelled and it's what I want but when I hold the click and drag the item in my grey stained glass pane or my inventory, some diamond block disapear in the result slot because it's reseted to 1 diamond block (result of the recipe given), see the video if you don't understand
Thank you in advance to the one who will know how to help me

tender shard
untold sierra
#
public class myEntity extends Horse {

gives error

Class 'myEntity' must either be declared abstract or implement abstract method 'getColor()' in 'Horse'
light flax
#

hi! my dream its to make an kitPvP server but i need help, so i am looking for someone that can help me with pluggins. i am on java and pc! dm me if you are intressed

sacred mountain
#

hi im back

sinful comet
#

?services

undone axleBOT
sacred mountain
#

hi bot ur back

#

yay

#

HI MININ

humble tulip
#

now we can ?learnjava people

#

Hallo

sacred mountain
#

i need to do that

#

:D

#

i got intelliultimate so i can do sql stuff easier now

summer scroll
#

Does anyone know how to use the metadata packet with ProtocolLib? I'm struggling how to do that, my goal is to spawn an armor stand with custom name, invisible, etc.

sacred mountain
#

well

#

learn the api maybe

#

im fairly sure you can use the world#spawnParticle() method

humble tulip
#

What does that do exactly

sacred mountain
#

i've no clue what arcdensity and arcpitch is

#

what even is arc

humble tulip
#

Same

#

Arc is basically an angle

sweet pike
#

precisely 🤷‍♂️

near crypt
#

how can i get the last key of an path of an yaml file?

sacred mountain
#

that seems like it would need a bit of math lol

humble tulip
#

@sweet pike atleast show us what it does ingame

sacred mountain
#

theta/360 x 2 * Math.PI x dist

#

arc length im fairly sure

#

then you can calculate from the player and use a loop for the unknown

#

lmao

humble tulip
#

Get the section and then get the keys

sacred mountain
#

buildtools

#

well it says

#

that spigot wasn't found

#

isnt it spigot-api not spigot

#

and then buildtools seperately idfk

gleaming olive
#

How can I have armor for a zombie but no one sees it ?
like which packet ?

humble tulip
#

Did u run it with 1.19 and --remapped

sacred mountain
#

then you get the connection handle and send the packet

gleaming olive
#

no no wait

sacred mountain
#

handle of the player that is

gleaming olive
#

i mean no one sees the armor of the zombie

humble tulip
#

PacketPlayOutEntityEquiptment

gleaming olive
#

ok thanks!

spare prism
#

Is that a normal way of using CompleteableFutures?

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if(!(sender instanceof Player)) {
            sender.sendMessage("instance");
            return true;
        }

        Player player = (Player) sender;

        if(!sender.hasPermission("cloudauth.login")) {
            sender.sendMessage("perm");
            return true;
        }

        if(args.length < 1) {
            sender.sendMessage("args");
            return true;
        }

        Main.getInstance().getDataManager().playerExists(player.getUniqueId()).whenComplete((playerExists, e) -> {

            if(playerExists) {

                Main.getInstance().getDataManager().getPassword(player.getUniqueId()).whenComplete((password, exc) -> {

                    if(password.equals(args[0])) {
                        sender.sendMessage("correct");
                    } else {
                        sender.sendMessage("wrong");
                    }

                    if(exc != null) {
                        Main.getInstance().getLogger().severe("Something went wrong while logging in for the player " + player.getName());
                        exc.printStackTrace();
                    }

                });

            } else {
                sender.sendMessage("not registered");
            }

            if(e != null) {
                Main.getInstance().getLogger().severe("Something went wrong while logging in for the player " + player.getName());
                e.printStackTrace();
            }

        });

        return true;
    }
undone axleBOT
spare prism
sacred mountain
#

so you're waiting for them to login

#

and then running it

#

surely you should just listen for the login? i dont get why it's in a command

humble tulip
#

Why are u storing string password

#

That's just a disaster

sacred mountain
#

lmao

humble tulip
#

Just use authme or something bro

sacred mountain
#

yea

humble tulip
#

Cryptography is something u don't wanna have to figure out

spare prism
#

I'm asking u if that's a normal way of using CompleteableFutures

sacred mountain
#

or at least encrypt it

sacred mountain
sacred mountain
#

he lieks completablefuture lol

#

can you send an actual video

#

it keeps downloading it

humble tulip
#

I saw it

#

Does it follow the players line of sight

sacred mountain
humble tulip
#

It looks like it did

#

It's a horrible vid

#

It's first person

tardy delta
sacred mountain
#

shreyas

#

can you explain what it does

#

seeing as you know skript

#

😬

#

what version

spare prism
sacred mountain
#

whencomplete i assume

tardy delta
#

as it gets the result immediately iirc

sacred mountain
#

aight so theres the spigot particleapi

spare prism
sacred mountain
#

thats a good thing

#

so it does wait

#

getNow is the one that gets immediately

sweet pike
sacred mountain
#

why is it downloading 74mb to my pc

#

i cant play it through discord

#

ill watch it in a sec

sweet pike
humble tulip
#

Bruh just look at how skunity does it

sweet pike
#

want me to imgur it>?

sacred mountain
#

ok so

#

thats

#

effectlib dragon effect

#

and can be created with one

#

like 4 lines of code

#

a direction vector and the dragoneffect

#

i'm not sure how they created that with skript

#

WHY IS 4 SECONDS OF VIDEO 75mB

sweet pike
tardy delta
# spare prism oh, ok, tysm

and you should be checking the exception before checking the result, cuz i assume your playerExist method is returning a CompletableFuture<Boolean> so when an exception occurred the Boolean returned with whenComplete will be null so checking if (exists) will throw a nullpointerexception cuz it calls Boolean#booleanValue internally

sweet pike
sacred mountain
tardy delta
#

if you only want to handle normal cases where no exception occurred you can use CompletableFuture#thenRun or thenAccept

humble tulip
sacred mountain
#

yeah

#

thats a java lib

humble tulip
#

drawDragonBreath is tje script command

sacred mountain
#

right so

#

to do it in java

#

ill send my code rq

#

i have a killeffect like that

#

it's really simple just use an effectmanager and paly the dragon effect

tardy delta
sacred mountain
#

effectmanager you just need to init at the plugin startup

sacred mountain
tardy delta
#

yes

sweet pike
sacred mountain
#

EffectLib

#

de.slikey

#

if you send me the skript i can probably recreate it in java

humble tulip
#

?paste

undone axleBOT
humble tulip
#

How skunity does it

#

Gonna send effectslib method nw

tardy delta
#

they probably never heard of a constructor

sacred mountain
#

wtf

sweet pike
sweet pike
#

ive never seen more params in my life

#

and ive had a solid look at nms

river spear
#

How do I get the week from the date?

sacred mountain
#

math

#

i love math

#

i had a trig test on friday

#

non calculator

humble tulip
tardy delta
#

Date#getDay is deprecated, it tells to use Calender#get(Calender.WEEK_OF_YEAR)

#

@river spear

river spear
#

Using this I get week 25 even though the correct week is 23: calendar#get(calendar.WEEK_OF_YEAR)

iron glade
#

How to open this demo window ingame?

safe notch
#

Packets

#

Nms

iron glade
#

-.-

safe notch
#

It was gameStateChange packet iirc

humble tulip
#

What demo window?

tardy delta
#

i thought an api method was added

safe notch
#

Not sure

tardy delta
safe notch
#

Oo this exist

iron glade
#

lul perfect

#

ty

dusk flicker
#

wasnt that added like last week lol

opal juniper
#

how is the best way to run something on main and then have a callback

tardy delta
#

im always using completablefutures instead of callbacks

#

in my opinion more useful when you actually need to store the result

#

i guess youre talking about async stuff

sweet pike
dark arrow
#

minion325 bro yesterday you told me to override addBehaviur goals and so i did that and now the zombie no longer hits the player but it also does not hit the pig which i added in the target selecter

tardy delta
keen star
#

hi someone help please i have an problem when set AttributeModifiers for item can someone give me an example for that pls

sacred mountain
sacred mountain
reef lagoon
gleaming olive
#

can I change skin of a zombie ?

tardy delta
#

resourcepack

gleaming olive
#

using packets?

#

I managed to make it a pig, but idk about players .-. , they dont have any id

dark arrow
dark arrow
# humble tulip Send ur code
@Override
    protected void addBehaviourGoals() {
        this.targetSelector.addGoal(2, new NearestAttackableTargetGoal(this, Player.class, false));
        this.targetSelector.addGoal(3, new NearestAttackableTargetGoal(this, Pig.class, true));
    }```
tender shard
tardy delta
#

the thing from the paste above

#

idk

tender shard
#

that's ugly

#

ew

tardy delta
#

m wondering what an Expression would be

gleaming olive
humble tulip
#

That's decompiled

#

It's a skript addon

tardy delta
#

skript is still hurting my brain

dark arrow
gleaming olive
#

i want to work with packets

wet breach
#

skript is really dumb

#

really no reason to use it if you know how to use java

tardy delta
#

people who dont know to use java 🤡

dark arrow
#

or you can make a working npc which has zombie ai i have seen many server with that feature but its complex

gleaming olive
#

or i can just send a packet of a player...

#

but idk how to change the skin

dark arrow
#

in npc you can just upload a custom skin

#

but i dont know that we can send a packaet of npcs

minor garnet
#

some1 know how i can make a baby rabbit not grow up forever?

dark arrow
#

i dont know a method to do it forever but it can be changed to really long times like many years

dark arrow
minor garnet
#

hm

tender shard
minor garnet
tender shard
#

one sec

#

I think Ageable has a method for that

#

just setAgeLock to true

dark arrow
#

sorry then 😦

tardy delta
#

then we will have a really big rabbit

#

big chungus

tender shard
# dark arrow sorry then 😦

if you somehow need an extremely high or extremely low value for something, in 99% of cases there's a better solution 😄 🙂

dark arrow
#

ok 🙂

wet breach
minor garnet
#

i'm not using latest spigot ver

wet breach
#

they still have an age

#

the server checks the age and if its a certain number or above it changes it to an adult

#

but if the age is always reset to 0

#

it never happens

minor garnet
tender shard
#

why dont you use setAgeLock as I told you?

quaint mantle
#

Hi, i need a vector tutorial, idk how this work

tender shard
#

you didnt say which version yo uuse

minor garnet
#

1.12.2

wet breach
tender shard
minor garnet
#

aaah

tender shard
#

that will btw still work in 1.19

#

it's just deprecated there because now Breedable exists

minor garnet
#

oka thx

sage patio
#

why this return 0 always?

quaint mantle
#

?learnjava

undone axleBOT
sage patio
quaint mantle
#

i cant

#

you're checking if they are the EXACT same thing

#

no

quaint mantle
sage patio
quaint mantle
#

can you just listen?>

#
[A, B, C, D, E, F]
myreference = array[0]
assert array[0] == myreference;
#

they are accessing the same location in memory

#

you're checking that, but for the items

#

they are different ItemStacks, but you want to check isSimilar

#

@sage patio

sage patio
#

i got it thanks

quaint mantle
#

also instead of using an enhanced for loop

#

you can just loop through the contents

tardy delta
#

inentory implements Iterable<ItemStack>

#

so just loop over te inv

sage patio
#

nice, thanks

quaint mantle
#

feel like looping through every possible character combination?

#

if you can, you could try getOfflinePlayer

#

wait no

#

if you can get their uuid

#

you're good

eternal night
#

getPlayer(String)

#

while it does return the closest player

#

you then just check afterwards

#

null check that

#

but yea

#

your issue is basically that ```java
// Players online:
// - LynxPLAYHackerMan
Bukkit.getPlayer("lynx").getName() == "LynxPLAYHackerMan"

#

getPlayer(String) looks through all players, filters for players whos name start with your passed name (ignoring case) and then returns the one that is closest to the string you passed

sage patio
#

I've this code for removing a certain amount of items from player's inventory
but what should i do then player does not have that amount i need to remove?

dusk flicker
#

why are you using Integer rather than int?

sage patio
#

thanks for help, but this does not solve my problem

#

i've fixed that never mind

eternal night
#

don't worry, that one is made up xD

copper burrow
#

Hey, I'm trying to get into coding Plugins, however my IntelliJ is not suggesting anything! Anyone know a solution?

eternal night
#

how did you setup your project

copper burrow
#

Step by step?

eternal night
#

well no, generally are you using maven or gradle ?

copper burrow
#

Maven

eternal night
#

can you share your pom.xml

eternal oxide
#

?paste no bot yet?

undone axleBOT
eternal oxide
#

It Lives!!

copper burrow
#

.

sage igloo
#

can someone please explain how spigot packages work and what they are?

eternal oxide
#

Pom looks fine

solid sigil
copper burrow
#

literally anything

sage igloo
#

i meant these

chrome beacon
chrome beacon
copper burrow
#

yes

chrome beacon
#

What class are you trying to use

eternal oxide
#

Probably a better question, are you following a tutorial?

chrome beacon
#

True

eternal oxide
#

Deleting this link as thats not a good tutorial

chrome beacon
#

Which one?

copper burrow
#

i've tried like 3

#

also using the minecraft development plugin thing

chrome beacon
#

So what class are you trying to access

copper burrow
#

man, i just started coding, all I know is I'm typing in my Main.java and nothings suggestingh

chrome beacon
#

What did you type

#

Also do you know Java

solid sigil
chrome beacon
solid sigil
copper burrow
chrome beacon
#

And did you import the Bukkit class

copper burrow
#

yes

chrome beacon
#

I'll ask again; Do you know Java?

copper burrow
#

barely

golden kelp
#

string, wait till int pulls up, the battle will be legendary

chrome beacon
#

Sounds like you might have tried to access Bukkit outside of a method and field

#

?learnjava Might be best to go through some of these

undone axleBOT
golden kelp
#

yea but java needs to enforce it

#

yea

#

i cant

quiet ice
#

Integer is one of the worst class to exist, along all other wrapper classes

solid sigil
#

Bruh

ivory sleet
#

Worst?

#

Myeah well once we get primitive classes you could say good bye to Integer

quiet ice
#

Well, there isn't much incentive to use it that is

#

If it wasn't for generics

ivory sleet
#

Yeah true

solid sigil
#

Generics I was about to say

#

That's a perfectly fine incentive lol

quiet ice
#

Valhalla when

ivory sleet
#

Which valhalla will solve ^

solid sigil
#

What's that

ivory sleet
#

Valhalla is a java enhancement project

solid sigil
#

Ah

ivory sleet
#

One of the java enhancement proposals in there aims to avoid unnecessary boxing and unboxing, one solution to it is to allow developers to pass "primitive types" to type parameters

#

Myeah lynx might need to correct me here

eternal night
#

The fact that I can allocate my optionals on stack 🥰

#

no

#

tho that isn't really the main goal

ivory sleet
eternal night
#

it is a nice byproduct but the main point is memory layout

ivory sleet
#

Ah makes more sense actually

eternal night
#

like the benchmarks are pretty juicy

ivory sleet
eternal night
#

especially allocation

#

like, damn the usability for minecraft will be sick

#

basically anything from Vec3d over BlockPos

#

BoundingBox

ivory sleet
#

1000 less?

#

Damn

solid sigil
#

Aw my gifs aren't embedding today

eternal night
#

this btw

ivory sleet
#

Holy

sacred mountain
#

best intellij plugins?

#

deciding what plugins to add

#

wrong channel lol

tardy delta
sacred mountain
tardy delta
#

dont think your mom will code something

sacred mountain
#

hmm it's a risk im willing to take

tardy delta
#

dad coding a waifu

#

smh

sage igloo
#

is skript a good alternative to making a custom plugin?

sacred mountain
#

no

tall dragon
#

not in my opinion

sacred mountain
#

skript is ass

#

ong

sage igloo
#

okay

#

is it like laggy? is it slow?

#

ah right

tall dragon
#

big plugins are bassically impossible to make in skript

#

idk Worldedit, Land protection

#

that kinda stuff

sage igloo
#

i just need something that sets variables and progress markers to work with the magicspells plugin

#

also degrees facing variables

sacred mountain
#

worldedit has math

#

math fun

#

i remember graphing things in minecraft

#

using the worldedit api

sage igloo
#

hehehe

sacred mountain
#

i remember live graphing the coronavirus death rates

#

idk what i was doing

#

trig > algebra

#

trig more fun

#

yes

#

¯_(ツ)_/¯

#

well its not just robotic

#

hhehe add one to both sides

#

yeah tbh

sage igloo
#

starting my journey of learning java today

sacred mountain
#

i've been looking at fourier transforms

sage igloo
#

wish me luck haha

sacred mountain
#

interesting

#

ezpz

#

Heheheha

#

finally got it

sage igloo
#

idk it all seemed very complicated when. first looked at it

#

i guess it will get easier

sacred mountain
#

well

#

i am one

#

¯_(ツ)_/¯

sacred mountain
#

make sure to box every variable

#

oh this isnt general

#

make sure not to do that

sage igloo
#

box?

solid sigil
#

prob talking about wrapper classes

#

you'll learn about those

#

also

#

this isnt perfect for learning stuff in the order you need, but its a very good & clear reference for individual topics

sacred mountain
#

boxing is just unnecessary stuff like Integer.parseInt(5) or String.valueOf(somethingthatisalreadyastring)

fervent gate
solid sigil
#

an instance of what class

fervent gate
solid sigil
#

an instance of CommonCow?

fervent gate
#

Yes

solid sigil
#

well this is your only constructor

#
public CommonCow(AdventureMC plugin) {
        this.plugin = plugin;
    }```
#

so new CommonCow(instanceOfYourPlugin)

fervent gate
#

Yes, and now I need to initialize CommonCow(instanceofmainclass) in the enum

solid sigil
#

uhh you'll prob have to put the enum in a class and pass plugin instance into that class

eternal night
#

provide a Function<AdventureMC, Pet> as a parameter to the enum constructor

solid sigil
#

or that

eternal night
#

and then you can have a

public Pet create(AdventureMC instance) {
    return this.function.apply(instance);
}
tardy delta
#

i was doing a similar thing

#

cuz i really wanted it to be an enum

eternal night
#

only fuck up you have is enums not allowing generics

#

which makes the return value well

#

somewhat meh

tardy delta
#

there was a time i believed they could lol

#

the rust enums are pretty neat

#

you still have to construct them so they arent really constants but they can provide a different number of parameters and are generic

fervent gate
#

Now this is the constructor, what do I put in the enum fields?

sterile token
#

Hi, why when relocating maven dependencies into the jar, it shade everything instead of just the dependencies

fervent gate
#

COMMON_COW(Utils.getHeadItem("49706", ChatColor.DARK_GRAY + "Common Cow"), "common_cow", new ???)

tardy delta
#

a lambda

eternal night
#

i -> new CommonCow(i)

#

or CommonCow::new

tardy delta
#

CommonCow::new

eternal night
#

:>

tardy delta
#

ninjad again

sterile token
#

Lyn are you the one in the photo?

eternal night
#

what photo o.O

sterile token
#

Your profiile

eternal night
#

are you asking if I'd would use a real picture of myself online ? kekw

eternal night
#

obviously that is me

terse raven
#

yo is there a mevent for when the player lands?

eternal night
#

lands ?

sterile token
#

PlayerMoveEvent?

vast raven
#

((Player) event.getRightClicked()).getPlayer().addPotionEffect(PotionEffectType.BLINDNESS.createEffect(10, 6)); ((Player) event.getRightClicked()).getPlayer().addPotionEffect(PotionEffectType.SLOW.createEffect(10, 6));

#

It doesn't work, why it wouldn't?

eternal night
#

any error ?

vast raven
#

N.

eternal night
#

but beyond that, that looks good

#

keep in mind that effect will only last .5 seconds

vast raven
#

I even putted an if to check if the clicked entity is an instance of Player.

terse raven
vast raven
#

I tried every way, no clues.

sterile token
terse raven
#

falls -> then hits blocks

fervent gate
#
        return function;
    }```
This was a bit more advanced than I am used to haha. Can I just call the functions inside of Pet from the result of this function?
tardy delta
#

you can do public Pet getPet(AdventureMc pluginIGuess) { return function.apply(plugin) }

vast raven
fervent gate
#

Thing is that I don't have a "plugin"

vast raven
#

Like effect give ... effect

sterile token
eternal night
#

wat

#

no

#

pls don't

#

dispatching a command is like, the literal last option

frosty geyser
#

Currently working on a plugin for a java & bedrock server that when you send a message it sends it to people only in the group and when I send a message it only shows it to one person:
https://prnt.sc/HvYtZ73Sfkna

code:
https://pastebin.com/DXtDdVuZ

Lightshot

Captured with Lightshot

vast raven
frosty geyser
#

i have no clue if its a Spigot issue or if its a Geyser & Floodgate issue

frosty geyser
#

wdym how?

sacred mountain
#

wait a damn second

eternal night
sacred mountain
#

thats not

#

thats java

#

and bedrock

vast raven
eternal night
#

yea

#

if you need 10 seconds, 10 * 20 or 200 it is

vast raven
#

Well, you got.

sacred mountain
#

got

vast raven
frosty geyser
sacred mountain
#

im not sure how well spigot code works with geyesr

sterile token
#

Also Geyser, uses their own protocol implemention?

frosty geyser
#

but it was mentioned 1.19 now has chat authentication and i have no clue if the authentication is buggy or not

#

since its random for who it sends the messages to so i'm really confused

sterile token
#

I dont know much about Geyser, i just know that geyser is a plugin that allow java and bedrock connection

tardy delta
untold jewel
#

Hello brothers. I have a NullPointer Error I desperatly need help with

tardy delta
#

show code

undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!

sterile token
#

So if you have a question just ask it and providing the code or error if you have

frosty geyser
sterile token
tardy delta
#

random tag

untold jewel
#

I'm trying to open a Inventory from a public void open method. Everything seems fine in the code but it gives me a nullPointerError on the line where I try to open it

terse raven
#

how do i detect when someone stops falling

sacred mountain
#

thats what i do

sacred mountain
untold jewel
#

sout?

sacred mountain
#

system dot out dot println

frosty geyser
terse raven
untold jewel
#

I have done it

#

Everything seems fine, with debug messages

sacred mountain
untold jewel
#

I can show code

#

``public class KitsCommand implements CommandExecutor {

public kitselectorGUI kitselectorGUI;

@Override
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
    if (!(sender instanceof Player)) {
        Colorize.sendMessage(sender, Message.MUST_BE_PLAYER_ERROR);
    } else {
        Player player = (Player) sender;
        if (player.hasPermission(Main.instance.getConfig().getString("permissions.kit_command"))) {
            kitselectorGUI.open(player);
            return true;
        } else {
            Colorize.sendMessage(player, Message.NO_PERMISSION_ERROR);
        }

    }
    return true;
}

}
``

warm saddle
#

Hey so is there a way to change the colour of a glow effect without using teams?

#

and if so how many colours can be used?

sterile token
untold jewel
tardy delta
#

you never assign something to it

untold jewel
#

Okay.. I

#

I'm kind of a beginner, how would I assign something to it?

eternal night
#

usually through the constructor

sly bay
#

i want to kill all armor stands, but this doesnt work: /kill @e[type=armor_stand]. any ideas why?

frosty geyser
#

so it seems to be on spigot's end

sterile token
untold jewel
sterile token
#

I talked to the owner of Geyser, and told me that Geyser for working use their own protocol library implementation (they created one) which on 1.19 could not work because the protocol changes between diff minecraft versions

fervent gate
frosty geyser
#

but its not sending it to both java platforms either, so its not something to do with Geyser, its something wrong on spigot but i have no clue what

fervent gate
tardy delta
#

put in your plugin instance thro dependency injection

fervent gate
#

In an enum?

tardy delta
#

thro the method parameters

untold jewel
sterile token
#

I have a dought related to that, why some plugins that works on multiplatform (for example, bungeecord and spigot) use an Enum for loading the common things?

untold jewel
#

oh

#

could I post the whole code here and take a look?

sterile token
untold jewel
#

My issue is that I have a nullPointer on when I open the inventory

sterile token
#

Its bettter

#

?paste

undone axleBOT
untold jewel
#

ok I will

sterile token
#

Thanks

#

Because paste-md5 format the code and add colors

sterile token
#

Allright thanks

#

I will check

untold jewel
#

on line 20 "kitselectorGUI.open(player);"

#

there is a nullPointer error

#

KitsCommand class

sterile token
#

Allright

#

Where is the NPE?

eternal night
#

we have been there

#

pass an instance through the constructor

untold jewel
#

NPE on line 20 of KitsCommand

tardy delta
#

give it a value

daring lark
#

how to animate armor stand?

untold jewel
#

as I said im a beginner and dont really know how I would do that

eternal night
#

?di

undone axleBOT
eternal night
#

^^ the guide should teach you how

solid sigil
#

?help

undone axleBOT
#
CafeBabe Help Menu
*Red V3*
**__Admin:__**

selfrole Add or remove a selfrole from yourself.

**__Cleanup:__**

cleanup Base command for deleting messages.

**__Core:__**

embedset Commands for toggling embeds on or off.
info Shows info about CafeBabe.
licenseinfo Get info about Red's licenses.
mydata Commands which interact with the data CafeBabe has about...
set Commands for changing CafeBabe's settings.
uptime Shows CafeBabe's uptime.

**__Downloader:__**

findcog Find which cog a command comes from.

**__Mod:__**

names Show previous names and nicknames of a member.
userinfo Show information about a member.

**__ModLog:__**

listcases List cases for the specified member.
reason Specify a reason for a modlog case.

**__Permissions:__**

permissions Command permission management tools.

solid sigil
#

hmm

#

is there a way to view all the cafebabe spigot link commands

#

?help spigot

untold jewel
eternal night
#

👀

#

did you read the guide linked

untold jewel
#

Yes I did read it, and frankly I dont understand any of it. I dont know where I should put it, why I should put it there

#

and how it helps my cause

honest ember
#

someone know how to fix the non breaking space bug please? I managed to set everything except when I do /money

eternal night
#

best of luck then

untold jewel
#

Do you feel powerful not wanting to help someone who is new? If I dont understand the guide you sent and still need help I should just quit?

eternal night
#

if you don't understand the basic guide here, I don't know how to help you

eternal night
#

like, I could link you basic java tutorials ?

#

or spoonfeed you the solution

#

but neither of those probably help you

sly bay
#

hey there, im spinning a armorstand in a repeating task. When i kill the armorstand entity, the task still continues rotating the armor stand. How can i check if the armor stand is actually still there? this is my following code:

        ArmorStand armorstand = (ArmorStand) event.getBlock().getWorld().spawnEntity(event.getBlock().getLocation().add(0.5, 5, 0.5), EntityType.ARMOR_STAND);
        armorstand.setHelmet(new ItemStack(Material.PLAYER_HEAD, 1));

        int taskid = Bukkit.getScheduler().scheduleSyncRepeatingTask(Utils.g_plugin, new Runnable() {
            int x = -360;
            @Override
            public void run() {
                Location l = armorstand.getLocation();
                System.out.println(l.getX() + " " +l.getY() + " " + l.getZ());
                l.setPitch(x);
                armorstand.teleport(l);
                armorstand.setHeadPose(new EulerAngle( 0, Math.toRadians(x) , 0));
                x+= 10;
            }
        },0, 3);

armorstand.getLocation always returns the location, even if the armor stand is gone

woeful crescent
#

spoonfeeding is how people learn

#

chill

eternal night
#

spoonfeeding is so far from how people learn it is wild

#

especially at this level

woeful crescent
#

how did you learn?

eternal night
#

by reading guides ?

#

the guide literally spoonfeeds you

woeful crescent
#

i learned by making spigot plugins that were absolutely atrocious and copying code from the internet

eternal night
#

you have to use a minimal about of brain power to convert the example in the guide to this situation

woeful crescent
#

eventually, you learn what that code means

#

yeeeop

eternal night
#
public class PlayerListener implements Listener {
  private final PlayerStatsPlugin plugin;

  public PlayerListener(PlayerStatsPlugin plugin) {
    this.plugin = plugin;
  }

  @EventHandler
  public void onJoin(PlayerJoinEvent event) {
    event.getPlayer().sendMessage("This server uses %s :)".formatted(plugin.getName()));
  }
}
#

is literally the same concept as the class they posted

untold jewel
#

Except I dont use listeners?

eternal night
#

I-

woeful crescent
#

yeah, but he doesn't know how to code, so he just doesn't understand what "implements" or even what having an instance method means???

eternal night
#

Yea but then it is a

#

?learnJava

#

moment

#

awww

woeful crescent
#

you don't need to learn java first

#

this is HOW you learn java

#

you write crappy stuff first, cobbled together w/ a bunch of copy paste...

eternal night
#

you learn java by understanding a higher level construct of dependency injection

#

before even knowing inheritence

#

the type system

woeful crescent
#

no

#

that's how some people learn

untold jewel
#

Archonic maybe you could look at my code then

woeful crescent
#

and that may arguably be a better way to learn

eternal night
#

if you think so

solid sigil
#

i'd reccomend learning java before spigot tho czu it'll just get all mixed up

woeful crescent
#

yeah, but we have to compromise with this guy not wanting to put the time in to learn java first

#

he has two options:

#

a. listen to you guys, get bored, quit

#

or b.

woeful crescent
#

get spoonfed, make plugins that semi-work and that he thinks are cool, and be engaged push it a little further

untold jewel
#

here is the code if you want to take a look

woeful crescent
#

eventually, things will come together and he will actually be able to learn java

untold jewel
#

nullPointer on KitsCommand line 20

woeful crescent
#

you should start a thread

eternal night
#

add java public KitsCommand(kitselectorGUI kitselectorGUI) { this.kitselectorGUI = kitselectorGUI; } over the onCommand method

#

when you call new KitsCommand() you pass an instance of kitselectorGUI

#

e.g. new KitsCommand(new kitselectorGUI())

#

there is your spoon

#

eat well

solid sigil
#

good soup

untold jewel
#

Well thank you, but it still does not work. implemented the code and changed the exectutor

#

Now it just says nothing in the console

#

no error but doesnt open an inventory

#

Nevermind, now I get this error in the console

eternal night
#

Well, the actions field is null

woeful crescent
#

how are you filling the actions field?

eternal night
#

you might want to initialize it in the constructor of InventoryManager

#

not at all

vast raven
#

Hi guys, I've one question. I guess you know CrackShot plugin, who does not, is a plugin for weapons, and in most of cases, to drop a weapon, you need to do it clicking the slot from the inventory and then dragging out from the GUI, dropping normaly with Q cancels the event. I wanna to remake this, so I wanna check if a dropped item is directly with Q key or from the inventory. My idea was to check the click type on InventoryClickEvent, and then set some variables. Is there a direct method in PlayerDropItemEvent to check this thing?

sterile token
#

The server doesnt know what key is pressing the player*

vast raven
#

No actually, but I need to check if a drop was done with the Drop key or from the inv.

#

I found you need to use 3 events.

eternal oxide
#

Impossible to know

sterile token
eternal oxide
#

Yes

vast raven
sterile token
#

He? What Packet

eternal oxide
#

Spigot only knows an item is being dropped.

vast raven
#

I said that I need to find how the item was dropped.

vast raven
#

Using InventoryEvents and DropEvent.

eternal oxide
#

Spigot only knows an item is being dropped. It doesn't know the cause.

vast raven
eternal oxide
#

Pretty sure pressing Q will not trigger an InventoryClickEvent

vast raven
warm saddle
#

Hey is there a way to change the colour of the Glow Effect without using Minecrafts teams feature?

eternal oxide
#

Only packets

eternal night
#

grab the action, there is drop one and drop all

#

unlock dropping for the player with a timestamp or tick or something

#

and then on drop check if the player is allowed to drop the item

#

based again, on timestamp or whatnot

#

realistically, you should use server tick

eternal oxide
#

Theres no Click for pressing Q though

eternal night
#

no

#

Well

#

you mean pressing q in inv ?

#

because that is a click

eternal oxide
#

and no InventoryOpenEvent when opening the Player Inventory

vast raven
vast raven
vast raven
# eternal night inventory click is called before drop

The easiest way is to cancel the event in the drop event if that is the item, backing in the inv, if I drag out the cursor and I click with the cursor slot full of that item, I use the bukkit method to drop that item.

eternal night
#

or that

sand turret
#

permissions from Command Panels | Custom GUIs , help me pls

#

😉

eternal night
#

but I mean, should be very doable

sand turret
#

thx

vast raven
eternal oxide
eternal night
#

Yea but that is exactly what they want

eternal oxide
#

It is? I thought they wanted to prevent dropping a weapon no matter what

eternal night
#

no, just no dropping without opening the inv

#

so you don't accidentally drop it I guess ?

eternal oxide
#

So how is he going to detect just dropping without opening inventory? No event other than teh drop fires

untold jewel
#

Extremly long error when reloading the server