#help-development

1 messages · Page 173 of 1

serene sigil
#

oof

drowsy helm
#

It’s easy to implement anyway

lost matrix
#
    public enum Action
    {
        /**
         * Open a url at the path given by
         * {@link net.md_5.bungee.api.chat.ClickEvent#value}.
         */
        OPEN_URL,
        /**
         * Open a file at the path given by
         * {@link net.md_5.bungee.api.chat.ClickEvent#value}.
         */
        OPEN_FILE,
        /**
         * Run the command given by
         * {@link net.md_5.bungee.api.chat.ClickEvent#value}.
         */
        RUN_COMMAND,
        /**
         * Inserts the string given by
         * {@link net.md_5.bungee.api.chat.ClickEvent#value} into the player's
         * text box.
         */
        SUGGEST_COMMAND,
        /**
         * Change to the page number given by
         * {@link net.md_5.bungee.api.chat.ClickEvent#value} in a book.
         */
        CHANGE_PAGE,
        /**
         * Copy the string given by
         * {@link net.md_5.bungee.api.chat.ClickEvent#value} into the player's
         * clipboard.
         */
        COPY_TO_CLIPBOARD
    }

This is all you get

drowsy helm
#

Just have a map with a consumer

serene sigil
#

and if u execute a command this way its gonna be executed via console?

drowsy helm
#

No

#

On players behalf

serene sigil
#

alright, thx

eternal oxide
vague kite
#

Can I use bungeecord to link to my Paper servers?

#

or do they have to be spigot servers

lost matrix
#

both work

vague kite
#

great

onyx fjord
#

is gitk built in in git or im tripping and i forgot installing it?

quiet ice
#

what is gitk?

onyx fjord
#

git gui

quiet ice
#

Probably not built into git by default

onyx fjord
#

i dont remember installing it tho

#

and git wiki has info about it

serene sigil
#

also is there a way to make a crafting table gui open for a player?

#

(with a command)

quaint mantle
#

for my installation at least..

serene sigil
#

how?

drowsy helm
#

Decompile a plugin with the crafting table cmd and youll see

serene sigil
drowsy helm
#

I think you cna just create a regular crafting inv

serene sigil
#

oof

sterile token
#

I mean if its something you dont know

#

Look into source codes from github

eternal oxide
#

Player#openCrafting... or somethign close

sterile token
#

No no

#

That doesnt exists

#

What versión are you talking?

serene sigil
#

why does this gimme an error?

sage patio
serene sigil
sage patio
#

that inventory you want to open for player is null

#

i don't know much about inventories btw its null

serene sigil
serene sigil
drowsy helm
#

Can you paste on paste site

serene sigil
#

i fixed it

#

and how do u cancel itemtakeevent if u run a command?

sage patio
#

you can't do that in the command

#

you should check in listeners

#

InventoryClickEvent iirc

serene sigil
#

how u check if its that inventory

drowsy helm
#

Use some sort of id system

#

Most people use custom inventory holders

#

Or keep a map of each active inventory

serene sigil
#

can i make a listerer in the same class as the command?

drowsy helm
#

Sure

vague kite
#

How can I access a config file from another server on my bungee cord network?

sage patio
#

you can, better do not

drowsy helm
#

It’s not good practice though

drowsy helm
#

Or a shared file

#

Or just use a db

vague kite
#

is db the easiest

drowsy helm
#

Yeah id say so

grim ice
#

not really

#

a database is the best though

vague kite
#

my panel has a sql db with it but I can't read the db with a program or anything with a user friendly view

grim ice
#

depends on your use case

vague kite
#

I just want to store 1 string per player UUID

#

actually I would also need to store maybe 3 other values like 2 more strings and an Integer

drowsy helm
#

Yeah if you have access to a db always use it over config files

#

Config files suck

vale ember
#

does ItemMeta#getLore return mutable or immutable list?

drowsy helm
#

Pretty sure it’s mutable

serene sigil
#

its set true if u get the inventory

drowsy helm
#

No lol

#

That would be called for any inventory

serene sigil
#

oof

#

ye i suspected it

#

what would work tho?

serene sigil
#

how does that work?

drowsy helm
#

Have a class which extends InventoryHolder

#

Then in the listener you can check if the holder is this

serene sigil
vague kite
#

I have good experience in coding spigot/paper plugins but new to BungeeCord networks. My goal is to create a minigame server with a lobby that when 4 people join a queue, they are moved to 1 of 4 match servers.

Are there any resources that will help me with the lobby side of things? I saw MinigamesLib (https://www.spigotmc.org/resources/minigameslib.1899/) but it looks like it was discontinued

serene sigil
#

kk

#

brb

drowsy helm
#

Could be a standalone master or the proxy could be it

vague kite
#

I will read into redis now

#

WHat do you mean by a master server

drowsy helm
#

Well there needs to be something to control everything

vague kite
#

Could I not use the lobby for that

drowsy helm
#

I mean yeah but what if you have multiple lobbies

#

Or the lovby needs to restart while the minigame servers are live

#

A proxy master is more reliable

vague kite
#

I was thinking the lobby would control queues and sending players to the match servers, and the match servers would control the match and resetting

#

I see

drowsy helm
#

Yeah pretty much same thing just depends where you want the controller to be

vague kite
#

I am slightly confused on how the servers will work together with this

#

would I need to create a different plugin for each server type

#

one for lobby and a different one for match

drowsy helm
#

Ideally, yes

vague kite
#

Okay and how can redis help with this?

drowsy helm
#

It’s just a fast messaging system between servers

#

Redis pubsub*

#

You could use default bungee messaging but it’s a pain

#

Plus redis could communicate to external sources

drowsy helm
#

Have you ever tried using it?

#

It’s just hard to use lol

vague kite
#

I've not hahah

#

not even sure what it's use for

#

by messaging system do you literally mean player messages?

#

or a different kind of info between servers?

drowsy helm
#

Nah info between servers

vague kite
#

what kind of info?

drowsy helm
#

Uuh idk depends on your usecase

#

If you have a network you are going to have to send data between servers eventually

vague kite
#

I thought thats what the db would be for

#

like saving the selected kit in the db in the lobby

#

then the match server would find the kit from the db

drowsy helm
#

Db is super inefficient for messaging

#

Would you rather me talk to you directly, or wait for mail to show up in your mailbox

#

Db isnt for messaging, just saving data

vague kite
#

I see okay

#

Thanks for the info

#

Will look into redis now

#

assuming it's this RedisBungee plugin?

drowsy helm
#

No, jedis

#

Or an equivalent redis library for java

#

Redis bungee was discontinued iirc

vague kite
#

it looks like it was picked up by someone else

drowsy helm
#

I mean you could but im not sure of it’s limitations

minor garnet
#

location#getBlockX, Y, Z return the middle location of a block?

river oracle
#

Actually wait no

#

It gets one of the corners

drowsy helm
#

returns the int value

#

So floor

serene sigil
drowsy helm
#

They show you in that post you sent me

#

Did you even read it lol

serene sigil
#

i did

drowsy helm
#

Very last code block of the response

serene sigil
#

u mean this?

drowsy helm
#

Yeah

#

getHolder == this would be better tjo

minor garnet
#

how i get the width and height from a aabb?

drowsy helm
#

Yeah it’s not intended, like I said before keeping an instance would ve ideal

#

But they aint changing it any time soon

#

Why?

#

Then you cant have multiple instances

#

May aswell be static at that point

lost matrix
minor garnet
#

src?

lost matrix
serene sigil
drowsy helm
#

Yup

lost matrix
serene sigil
#

ohh

#

i understand now

#

alr

minor garnet
#

i was meaning github code

drowsy helm
#

Src is on spigot hub

lost matrix
#

?stash

undone axleBOT
minor garnet
serene sigil
#

the second one is the command

drowsy helm
#

Yeah like that

#

That bottom code looks a lil@whack

serene sigil
#

and what was the event that detects if u right/left click?

#

basically i want to make it so u cant get those items in the gui

drowsy helm
#

InventoryClickEvent

#

Get the action

serene sigil
#

i canceled it but it only doesnt work for shift click

drowsy helm
#

Yeah you need to check top inventory

#

Theres a few usecases you newd to cover

serene sigil
drowsy helm
#

Are you testing in creative

#

It’s sorta fucky in creative

serene sigil
#

no survival

#

i think its best if i send u the full code

#

?paste

undone axleBOT
serene sigil
drowsy helm
#

You need to set the holder of the inventory

#

You are setting it to player

#

Not the new holder

serene sigil
#

wdym?

drowsy helm
#

Look at the forum post you sent

#

How they do Bukkit.createInventory

serene sigil
#

u mean this?

drowsy helm
#

No in the code in the answer

serene sigil
#

oh

#

kk fixed it

#

works!

#

ty

ashen lynx
#

Hi

#

I have that:

File f = new File(plugin.getDataFolder().getAbsolutePath(), "Cargo" + ".yml");
            FileConfiguration c = YamlConfiguration.loadConfiguration(f);

Object items = c.get("inventory.content");
#

How can I convert the items to an ItemStack[] array?

#

How?

#

If I print the items I got this:

[ItemStack{PAPER x 1, UNSPECIFIC_META:{meta-type=UNSPECIFIC, display-name={"extra":[{"text":" "}],"text":""}, custom-model-data=10067}}, ItemStack{PAPER x 1, UNSPECIFIC_META:{meta-type=UNSPECIFIC, display-name={"extra":[{"text":" "}],"text":""}, custom-model-data=10067}}, ItemStack{PAPER x 1, UNSPECIFIC_META:{meta-type=UNSPECIFIC, display-name={"extra":[{"text":" "}],"text":""}, custom-model-data=10067}}, ItemStack{PAPER x 1, UNSPECIFIC_META:{meta-type=UNSPECIFIC, display-name={"extra":[{"text":" "}],"text":""}, custom-model-data=10067}}, ItemStack{PAPER x 1, UNSPECIFIC_META:{meta-type=UNSPECIFIC, display-name={"extra":[{"text":" "}],"text":""}, custom-model-data=10067}}, ItemStack{PAPER x 1, UNSPECIFIC_META:{meta-type=UNSPECIFIC, display-name={"extra":[{"text":" "}],"text":""}, custom-model-data=10067}}, ItemStack{PAPER x 1, UNSPECIFIC_META:{meta-type=UNSPECIFIC, display-name={"extra":[{"text":" "}],"text":""}, custom-model-data=10067}}, ItemStack{PAPER x 1, UNSPECIFIC_META:{meta-type=UNSPECIFIC, display-name={"extra":[{"text":" "}],"text":""}, custom-model-data=10067}}, ItemStack{PAPER x 1, UNSPECIFIC_META:{meta-type=UNSPECIFIC, display-name={"extra":[{"text":" "}],"text":""}, custom-model-data=10067}}, ItemStack{PAPER x 1, UNSPECIFIC_META:{meta-type=UNSPECIFIC, display-name={"extra":[{"text":" "}],"text":""}, custom-model-data=10067}}, ItemStack{PAPER x 1, UNSPECIFIC_META:{meta-type=UNSPECIFIC, display-name={"extra":[{"text":" "}],"text":""}, custom-model-data=10067}}, ItemStack{PAPER x 1, UNSPECIFIC_META:{meta-type=UNSPECIFIC, display-name={"extra":[{"text":" "}],"text":""}, custom-model-data=10067}}, null,   null]
rotund ravine
#

It is probably a list

#

look up list to array java

quaint mantle
#

Does anyone know or have an yaml reader / writer which works like the spigot one?

rotund ravine
#

Snakeyaml

ashen lynx
#

I just can show it with link sorry

#

It's says it's a object, not list

rotund ravine
#

Is it a single item or more items set in a config?

#

Just cast it to List<ItemStack> iirc

ashen lynx
#

So i think more items

rotund ravine
#

A list ya

ashen lynx
rotund ravine
#

Can’t open it

#

On my phone

#

?paste

undone axleBOT
rotund ravine
#

L8

ashen lynx
#

List<ItemStack> items = c.get("inventory.content");

lost matrix
#

What do you mean by that?

rotund ravine
ashen lynx
lost matrix
ashen lynx
#

Tried to

#
List<?> items = c.getList("inventory.content");
                ItemStack[] content = Objects.requireNonNull(items).toArray(new ItemStack[0]);
                inv.setContents(content);
#

Tried this

rotund ravine
lost matrix
#

If you just set the block to air then nothing drops. I dont understand your problem.

rotund ravine
#

Oh not an entity

lost matrix
#

A better way to achieve what exactly?

rotund ravine
#

List<ItemStack> ll = (List<ItemStack>) gett

ashen lynx
#

I did this

#
List<ItemStack> items = (List<ItemStack>) c.getList("inventory.content");
                ItemStack[] content = Objects.requireNonNull(items).toArray(new ItemStack[0]);
                inv.setContents(content);
#

But the code stop

#

no error

fluid river
#

tho you don't need new ItemStack[0]

ashen lynx
#

after that is a p.openInventory(inv);

#

but it don't open the inv

fluid river
#

if you store itemstack in sections then you need old good for loop

If list, then you need to cast

fluid river
#

event.getDrops().clear

rotund ravine
#

SetContents take an array

rotund ravine
fluid river
lost matrix
#

If you want to change the drops of a Block then you can simply use the BlockDropItemEvent

fluid river
#

what's the point on new ItemStack[0]

rotund ravine
#

Just how that stupid method work

fluid river
#

as toArray parameter

#

tho you can do toArray with no params

lost matrix
lost matrix
rotund ravine
#

Object[] -> ItemStack[]

ashen lynx
fluid river
pastel relic
#

hey, so I use

if (player.getWorld().getEnvironment().equals(World.Environment.NETHER))

to check if the world is = to the nether but I check the world type using the cmd executor, aka. the players environment. I need to use this in a utility file that doesn't have an implemented cmd executor. Does anyone know how I can do this?

fluid river
#

bro what

#

Pass player to static util method

wary topaz
#

((Player) sender).setInvulnerable(sender);

'setInvulnerable(boolean)' in 'org.bukkit.entity.Entity' cannot be applied to '(org.bukkit.command.CommandSender)'
lost matrix
fluid river
lost matrix
wary topaz
#

No

ashen lynx
#
Object[] content = ((List<ItemStack>) c.get("inventory.content")).toArray(new ItemStack[0]);
inv.setContents(content);
p.openInventory(inv);

I tried this, but this does nothing

wary topaz
#

Oh thanks smile

pastel relic
fluid river
#

explain yourself better then

pastel relic
#

I think I was clear enough.

lost matrix
eternal oxide
#

clearly not

fluid river
#

what is your method

#

which you can't pass a player to

#

what exactly is your problem

lost matrix
undone axleBOT
#

"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.

ashen lynx
#

Not open the inventory

#

The code just stop

#

Even if I put a print after that, I can't see the print

fluid river
#
public boolean onCommand(blah) {
    Player p = (Player) sender;
    if (UtilClass.isInNetherEnvironment(p)) {/* your code */}
}```
lost matrix
fluid river
#
public class UtilClass {

    public static boolean isInNetherEnvironment(Player player) {
        return p.getWorld().getEnvironment() == World.Environment.NETHER;
    }

}```
wary topaz
#

((Player) sender).isInvulnerable();

#

@lost matrix

lost matrix
#

Yes...

wary topaz
#

It doesnt work..

#

The true sign doesnt work either

lost matrix
undone axleBOT
#

"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.

lost matrix
#
((Player) sender).setInvulnerable(true);
wary topaz
#

ty

fluid river
#

BRUH

#

isInvulnerable as setter

pastel relic
eternal oxide
#

A util class is stateless. Thats not really a util class, its just a lot of statics

#

You have also been told how to check if you are in the Nether

pastel relic
#

ok, how do I check if its the nether though?

#

cuz I can't check the players environment

eternal oxide
#

where do you want to check? the Location?

pastel relic
#

if the place the command is executed from is = to the nether.

eternal oxide
#

You are checking the World environment, not teh players

pastel relic
#

oh, right-

eternal oxide
#

all you need is a Location

#

it has a World

pastel relic
#

well ig that's what I need

#

so?

#

how would I check for the world type?

eternal oxide
#
return location.getWorld().getEnvironment() == World.Environment.NETHER;```
fluid river
#

exactly

pastel relic
#

how do I define location though?

eternal oxide
#

all of your methods have a location

pastel relic
#

cuz it says it can't be resolved?

eternal oxide
#

where precisely are you trying to check the environment?

pastel relic
#

I wan't to wrap all methods

quaint mantle
#

?paste

undone axleBOT
eternal oxide
#

that is stateless, it has no world assignment

wary topaz
#

Any way I can set a players hunger level?

eternal oxide
#

your bad_blocks is just a Collection of blocks

pastel relic
#

Here's the thing, I'm making a random tp plugin (well updating it) and I wan't it to check if the world is = to the nether change the x, y, z to find a safe location and then do the same for the overworld

eternal oxide
#

if you want it per world type you need a map<Environment, Set<Material>>

quaint mantle
pastel relic
#

no, I don't need to do anything with the materials-

eternal oxide
#

then you don;t need to test the environment in that method

pastel relic
#

uh, w-

eternal oxide
#

only where you have a Location/Player

pastel relic
#

what?

#

oh wait

#

I think I got it-

pastel relic
#

let me try smth

#

yeah, I think this will work I just have to test it, thx @eternal oxide

quaint mantle
#

Because I like how the file is build with FileConfiguration etc

#

If you know what I mean

eternal oxide
#

If you are working in Spigot just extend FileConfiguration.

quaint mantle
#

I'm not that's the reason why I am looking for an alternative

eternal oxide
#

Then no, you will need to work with Snake and do your own implementaion

quaint mantle
#

Alr thx

civic apex
#

is it possible to make a player see another player with a different skin (doesnt have to be w/ API)

blazing flare
#

I'm attempting to set the display name of an item using NMS, and I'm close. I'm basically needing to correctly serialize the compound tag containing the name. I tried using CompoundTag#getAsString but this results in {text: "Scythe"} when it needs to be {"text": "Scythe"} for it to be recognised in game. How would I go about serializing it in a recognisable way?

jaunty crag
#

is there any way to set a players skin

#

well i know there is i just am not sure how to do it

#

i am trying to set it to a bufferedimage of a skin

hazy parrot
#

show getPlugin method

quaint mantle
hazy parrot
#

plugin is null lol

#

you never gave it a value

wary topaz
#

Any way I can make a onplayerhungerchange event?

#

What value is it?

quaint mantle
#

thank you very much bud!

#

now its workin

wary topaz
wary topaz
#

o

#

ty

chrome beacon
#

?jd-s

undone axleBOT
wary topaz
#

Cannot resolve method 'getPlayer' in 'FoodLevelChangeEvent'

noble forge
#

I recommend consulting the docs next time

chrome beacon
wary topaz
#

?

#

I'm on the latest version

chrome beacon
#

Time for doc

hazy parrot
#

what ?

quiet ice
#

Or well - bukkit since spigot didnt exist at that point

lavish wing
#

CB 1000

#

Stop

#

or CB 1060

#

im forgot

#

its 1000

quiet ice
#

jesus that is ages ago

lavish wing
#

yeah

wary topaz
#

wait I had to add @EventHandler
nvm

jaunty crag
#

how can i change somebodies skin to an existing BufferedImage

wary topaz
#

?

#

wdym

jaunty crag
#

i want to change the players skin to a bufferedimage

#

i dont really know how else to put that

lost matrix
#

You can use an api like Mineskin which use a couple of accounts to generate skins.

jaunty crag
#

will it work quickly

lost matrix
#

Sure. Takes a couple of seconds.

jaunty crag
#

i mean like can i call it from my code

#

i am trying to make someones skin grayscale when they die

lost matrix
#

But you can locally cache the signature.

lost matrix
jaunty crag
#

where would i cache the skin

lost matrix
#

Wherever you like

sterile token
#

Its posible to disable player auto kicking via code?

lost matrix
#

What is "auto kicking"?

sterile token
#

I mean im doing an afk plugin

#

But if the player stay like more than 5m afk the server kick it out

lost matrix
#

Then dont?

sterile token
#

I mean it cannot manage that

#

The server itself take them out

lost matrix
#

Thats not a feature of minecraft

sterile token
#

Yes

#

🤔

eternal oxide
#

spigot inactivity timeout?

sterile token
#

I have tested it on 1.8, 1.12 and 1.19 and stil ltake the player out when have success more than 5 minutes

sterile token
lost matrix
#

I can just log in and stay on my server inactive for weeks if i wanted to...

chrome beacon
#

^

jaunty crag
#

yeah

eternal oxide
#

Yep. I know of no timeout. I can stay online for hours with no activity

jaunty crag
#

does anyone know how some servers get that "translucent" effect when someone is invisible

#

is that like a teams thing?

chrome beacon
#

Yeah it's teams

eternal oxide
#

player-idle-timeout=0In server.properties

tardy delta
#

tf was i doing a few months ago

jaunty crag
wind tulip
#

Does anyone know why the particle enum doesn't contain all particles? Stuff like minecraft:rain, minecraft:underwater and the elder guardian particle aren't there

chrome beacon
wind tulip
#

they are though

#

you can trigger them with /particle

chrome beacon
#

🤔

#

I guess they have a different name then in the particle enum

wind tulip
#

I mean you'd think so but I looked for it and I don't think it's there

#

I wish there was a list of the particle enums and their respective particles

#

or at least enum -> mc name

jaunty crag
#

cant u just go to that class?

wind tulip
#

the particle class?

jaunty crag
#

yeah

wind tulip
#

I did

#

and I searched through the enums

#

well more like skimmed through

jaunty crag
#

try all the ones that have something to do with water and maybe you get what your looking for

vivid skiff
#

How can i send a list saved in a yaml file to a player, like /gang list returns all the existing gangs

tardy delta
#

just send each element

twilit lynx
#

Is there any way to check if server instance has bungeecord enabled in spigot.yml?

tardy delta
#

with a stringbuilder probably

lost matrix
tardy delta
#

he means you shouldnt get your stuff from persistent storages on runtime, cache it before

lost matrix
lost matrix
lost matrix
grim ice
#

do you need the template @rough drift

#

for the website

junior magnet
#

hi guys,my spigot acc get steal by narfman24@gmail.com,but i don't know how to get it back and my english so worse.i am malaysian,can somebody help me?

junior magnet
#

i have buy ecoboss,ecoitem and residence at spigot

junior magnet
#

where i can get help

#

email?

chrome beacon
#

?support

undone axleBOT
junior magnet
#

i try now

#

where can i contact residence and eco plugin owner

#

i think need to tell they

eternal oxide
#

they have no control over your account

#

get your spigot account back and it will be sorted

junior magnet
#

i have send email to spigot now,but i don't sure they can solved this problem or not

#

i have bill to prove i buy that plugin

quaint mantle
#

is there an event that triggers when an inventory collects an item, not only from the ground but also by /give or inventory#addItem?

grim ice
#

just

#

idk make the event urself

#

since there probably isnt

quaint mantle
#

'probably'

#

xd

#

yeah ok

jaunty crag
#

i have a really complicated idea and i need a lot of help with it because i have no idea where to start

#

i am trying to make a world on my server where everything is on the player

#

like everyone is technically in the same spot but if they kill mobs on their end, the mobs are just normal on anothers

#

almost like singeplayer

#

but on a server

crimson terrace
#

a single world for each player?

jaunty crag
#

sort of but thats difficult

#

i want everyone to be on the same world

crimson terrace
#

Hypixel had the right idea doing it with skyblock

jaunty crag
#

its difficult to explain im gonna make a thread

#

do you want me to add you?

crimson terrace
#

no thanks, I think that wont have a good solution

jaunty crag
#

oh alright

crimson terrace
#

at least none I can help with

#

you would have to do a lot with packets, and even then there would be problems i think

jaunty crag
#

idk i just want something similar to how wyncraft does singleplayer quests

#

a world for each player would be fine for now i guess

crimson terrace
#

havent played wynncraft in a while

#

you would have to make sure that the worlds you create are light weight

jaunty crag
#

i just want them to be a few chunks

#

they can be either deleted or replaced sort of like how hypixel skyblock does it

floral drum
jaunty crag
#

w.hat do u mean

floral drum
#

Basically, you can create a "virtual" entity by doing something like this: "new Server/EntityZombie(...)"

#

And you can send a packet to specific players

#

to display that entity

#

or to hide it

jaunty crag
#

i want that entity to interact with the player aswell

#

like i want the player to fight it

#

and be able to take damage and stuff

floral drum
#

If you want to implement that, you only have very limited options. You can either create your own entity like I showed above and handle your own physics and pathfinder for it. Or, not sure if this will work, create an attack pathfinder so the zombie/enemy only targets that one player, and hide the zombie from everyone else by sending a "PacketPlayOutDestroyEntity" or whatever it's called.

#

@jaunty crag

jaunty crag
#

hm

#

would it be easier to just somehow create copies and different spawn locations for different people

#

can I add you to a thread

#

Make different entities for different players

civic apex
#

is it possible to make a player show a different skin to different players? (packets/non api)

#

why would blockbreakevent be triggered

#

falling blocks are entities

#

maybe try using EntityDeathEvent

midnight shore
#

Probably Physics Events

civic apex
#

idk if there's a more specific event

#

ooh

floral drum
#

hiii elgarr

#

how are you

eternal oxide
#

hi

ionic crest
#

how do i prevent a mob from despawning when it's too far away using nms?

tardy delta
#

im doing weird things lol

#

just saw i need a way to compute the T object

floral drum
ionic crest
#

i found removeWhenFarAway(double arg0) under the Mob/EntityInsentient class but not sure what the double represents

remote swallow
#

double = 0.00

ionic crest
#

bet, will try

remote swallow
#

probably distance in blocks

floral drum
eternal night
#

that param is distanceSquared

#

but yea

ionic crest
tardy delta
#

making everything generic goes brr too

floral drum
#

c# generics are weird

#

why can't there be an anonymous type generic 😭 <?>

eternal night
tardy delta
#

like bruh

eternal night
#

There is also LivingEntity#setRemoveWhenFarAway

ionic crest
eternal night
#

I just have the server source checked out locally

ionic crest
#

ok i just set the param to a ridiculously high number but the mobs still despawn after moving a few blocks away

eternal night
#

no 😅

tardy delta
#

generics 💀

eternal night
#

that method is called to determine if the entity should be removed

#

its not a "set this to a number"

ionic crest
#

ohh

#

is there any other way besides ((LivingEntity) this.getBukkitEntity()).setRemoveWhenFarAway(false);

eternal night
#

any reason why that line is an issue

ionic crest
#

since "this" extends entitycreature, a nms class, i felt like there was a more elegant way to do it thru nms

floral drum
#

this.persist

eternal night
#

nah that is a different thing

#

setPersistenceRequired()

floral drum
#

oh?

eternal night
#

is a method on nms's Mob

ionic crest
eternal night
#

that is the method setRemoveWhenFarAway calls

#
@Override
public void setRemoveWhenFarAway(boolean remove) {
    if (this.getHandle() instanceof Mob) {
        ((Mob) this.getHandle()).setPersistenceRequired(!remove);
    }
}
rigid loom
#

how would i make a for loop that loops through all players in a map?

vocal cloud
#

You use entryset

rigid loom
#

its a dependency based map btw which is why its not caps

tardy delta
#

no

vocal cloud
#

What

#

Dependency based map?

quaint mantle
#

why isn't inv set?

#

broadcasts nothing

floral drum
#

fucking hell code bomb

#

?paste

undone axleBOT
quaint mantle
#

sorry xD

floral drum
#

lmaoo

quaint mantle
tardy delta
#

ill think about my code when in bed lol

rigid loom
#

it was made by hempfest on the spigot forums for a plugin he made

tardy delta
quaint mantle
#

i've tried alot of things

#

idfk

floral drum
#

Did you register the event?

quaint mantle
#

yep

#

and the command

#

ofc

floral drum
#

How did you register them both?

eternal night
#

most likely creating two instances

#

yea

rigid loom
floral drum
#

haha lynx

#

sniped

echo basalt
#

purple go back to work

floral drum
#

shut up

rigid loom
#

thats the main class for the map thingy

floral drum
#

sorry illusion, love you ❤️

quaint mantle
#
getCommand("enchant").setExecutor(new miningGUI());```
vocal cloud
#

They're in the same class?

quaint mantle
#

yeah, i usally split them up

#

i can do that right now

floral drum
tardy delta
#

where conventions

floral drum
tardy delta
#

this isnt c++ kekw

vocal cloud
#

Convention is for the birds

floral drum
tardy delta
#

i am a fucking bird mate

vocal cloud
#

I don't even think for the birds is a common phrase anymore

floral drum
#

🐤

#

me

#

birb

quaint mantle
#

all im asking is why inv isn't set

#

but im clearly setting it

tardy delta
#

thats a baby chick

rigid loom
tardy delta
#

dont create two different objects

quaint mantle
#

alr

floral drum
#
// Instance of the object here
getServer().getPluginManager().registerEvents(miningGUI, this);
getCommand("enchant").setExecutor(miningGUI);```
#

not spoonfeeding! L @tardy delta

remote swallow
#

?spoon

undone axleBOT
#

Spoonfeed a newbie for a day and they'll come back with more questions. Teach them to find their own answers and you'll both be better off: you won't get stuck answering the easy questions and they'll be much more productive than before.

tardy delta
#

im very proud of my fancy code ive written today but it does exactly nothing

rigid loom
#

whatre the params for a for loop?

#

i cant remember exactly

floral drum
#

foreach or

rigid loom
#

for()

floral drum
#

ok

#

well

#

that's both still

tardy delta
#

?learnjava

undone axleBOT
tardy delta
#

thank me later

floral drum
#

hi fourteen

#

how old are you agane

tardy delta
#

🤔

#

18

floral drum
#

lets date

quaint mantle
#

ah that worked

#

i feel stupid now

#

but thanks

#

xD

tardy delta
#

lets not date ig

floral drum
rigid loom
#

i say he's 14--

tardy delta
#

i dont want to get into the basement of some old man

floral drum
#

I'm 18 ;3

tardy delta
#

thats what he says yes

#

yes yes yes..

#

ive seen ya face mate, you werent 18

floral drum
#

where did that 40 year old spigot developer & DJ go

rigid loom
#

a for() {

floral drum
rigid loom
#

}

#

btw

echo basalt
floral drum
#

omg

tardy delta
#

smh bonk my head

floral drum
#

yes

#

that guy is cool asf

remote swallow
#

isnt akair like 48

tardy delta
#

date with illision man

echo basalt
#

no he isnt

tardy delta
#

both happy

echo basalt
#

magma is 28 and likes to threaten me

floral drum
#

illusion wanna date

tardy delta
#

just say yes and dump him pls

#

huh

floral drum
#

D:

zealous osprey
#

What did I come back to XD

remote swallow
tardy delta
#

well gn ig

vocal cloud
echo basalt
zealous osprey
remote swallow
echo basalt
floral drum
#

wtf

echo basalt
#

yeah I like him

floral drum
#

do you like me

echo basalt
#

no

floral drum
#

Fuck

zealous osprey
#

plottwist

remote swallow
#

@floral drum rn: PepeCryHands

floral drum
remote swallow
floral drum
zealous osprey
#

Ebic preparing for manslaughter

remote swallow
#

shhh

echo basalt
#

I wanted to come home and eat russian food

remote swallow
#

just charge at him with a diamond sword

echo basalt
#

first thing I see is the fuckin backrooms

floral drum
echo basalt
#

apparently we had a painter over

echo basalt
remote swallow
floral drum
#

woah

#

is it nice

echo basalt
#

yeah

#

think of a calzone

floral drum
#

omg give it

echo basalt
#

but instead of tomato sauce

#

and cheese

#

and all those topics

#

it's pure oil

#

and meat / cheese

floral drum
#

oh

echo basalt
#

you bite into it, it's soft

#

and salty

floral drum
#

omg

#

stop it

#

I'm hungy

remote swallow
#

any of you want pizza

echo basalt
#

you let it cool down

#

but then you warm it up in the microwave

#

and now it's properly soft, slightly soggy

#

instead of a sharp saltiness, it's subtle

floral drum
#

😭

echo basalt
#

The egg that has been mixed with the cheese starts popping out, giving you the nutrients and proper flavor

remote swallow
floral drum
#

dude stop

#

I'm getting hunry

#

LMAFO

remote swallow
#

do you want pizza

echo basalt
#

epicebic

floral drum
#

I want food

echo basalt
#

I've been eating fuckin

#

fast food

#

every day

#

for the past like year

remote swallow
#

thats not healthy

echo basalt
#

stop offering more

remote swallow
#

but i would do the same

#

its a frozen pizza not takeaway

echo basalt
#

this is my way of flexing I got cash

floral drum
#

don't die illusion pls

echo basalt
#

frozen pizza is... a fruit sure

floral drum
#

we need you at emerald

echo basalt
#

purple

floral drum
#

hi

echo basalt
#

you do realize I'm not gonna get much money from emerald lol

floral drum
#

oh

#

rip

echo basalt
#

it's a 4 hour task that needs like 10 hours of learning the core

floral drum
#

hm

brave goblet
#
    public Inventory GUI(String current) {
        Inventory gui = Bukkit.createInventory(null, 36, "Ranks");
        ItemStack glassEmpty = new ItemStack(Material.PURPLE_STAINED_GLASS_PANE);
        ItemMeta metaEmpty = glassEmpty.getItemMeta();
        glassEmpty.setItemMeta(metaEmpty);
        ItemStack previousRanks = new ItemStack(Material.HONEY_BLOCK);
        ItemStack currentRank = new ItemStack(Material.EMERALD_BLOCK);
        ItemStack lockedRanks = new ItemStack(Material.REDSTONE_BLOCK);

        for (int i = 0; i <= 9; i++) {
            gui.setItem(1, glassEmpty);
        }
        gui.setItem(17, glassEmpty);
        gui.setItem(18, glassEmpty);

        for (String group : previousGroups(current)){
            ItemMeta metaPrevious = previousRanks.getItemMeta();
            metaPrevious.setDisplayName(ChatColor.GOLD + group);
            previousRanks.setItemMeta(metaPrevious);
            gui.addItem(previousRanks);
        }

        ItemMeta metaCurrent = currentRank.getItemMeta();
        metaCurrent.setDisplayName(ChatColor.GREEN + current);
        currentRank.setItemMeta(metaCurrent);
        gui.addItem(currentRank);

        for (String group : lockedGroups(current)){
            ItemMeta metaLocked = previousRanks.getItemMeta();
            metaLocked.setDisplayName(ChatColor.RED + group);
            lockedRanks.setItemMeta(metaLocked);
            gui.addItem(lockedRanks);
        }

        gui.setItem(26, glassEmpty);
        gui.setItem(27, glassEmpty);
        gui.setItem(28, glassEmpty);
        gui.setItem(29, glassEmpty);
        gui.setItem(30, glassEmpty);
        gui.setItem(31, glassEmpty);
        gui.setItem(32, glassEmpty);
        gui.setItem(33, glassEmpty);
        gui.setItem(34, glassEmpty);
        gui.setItem(35, glassEmpty);
        return gui;
    }

My code shows this gui

#

But i would like it to look like this

vale ember
#

is there a way to use PDC on anvil?

hasty prawn
zealous osprey
brave goblet
brave goblet
hasty prawn
#

He's also referring to the 1 instead of i

brave goblet
#

Oh- right right

hasty prawn
#

Change it to i and it should look right catyes

brave goblet
#

yup yup

#

Is there anyway i could further improve the code? like a method to fill all empty spots

#

For now i have to go thanks for the help guys! :D

hasty prawn
#
        gui.setItem(26, glassEmpty);
        gui.setItem(27, glassEmpty);
        gui.setItem(28, glassEmpty);
        gui.setItem(29, glassEmpty);
        gui.setItem(30, glassEmpty);
        gui.setItem(31, glassEmpty);
        gui.setItem(32, glassEmpty);
        gui.setItem(33, glassEmpty);
        gui.setItem(34, glassEmpty);
        gui.setItem(35, glassEmpty);

that could also be replaced with a loop

brave goblet
zealous osprey
echo basalt
#

you have reached the stage where you need to make some GUI util code

hasty prawn
#

Yep

#

Luckily that is easy to do

brave goblet
hasty prawn
#

Your encoding is probably wrong, although ideally you should probably use & and translateAlternateColorCodes.

echo basalt
#

for example, I made a "menu chain"

hasty prawn
#

Well a basic one is easy

echo basalt
#

oh shit it breaks with the menu.hold code fuck fuck

hasty prawn
#

wtf is a menu chain

#

and did you just realize that your code is broken KEKW

echo basalt
#

fixed it with a single if statement

echo basalt
hasty prawn
#

Oh I made that too!

#

They're kinda fun to make tbh

echo basalt
#

the logic between them is simple

hasty prawn
#

Yup

echo basalt
#

Opening menu:

  • Assign last element in the list as the "last closed" element
  • Open target GUI (closes current one, "last closed" matches current one so we don't clear the chain)

Going back:

  • Assign current menu as the "last closed" element
  • Open the second last element

Cleaning the clain:

  • If the last closed element is not the same as the menu that has been closed, then the chain should snap
#

The last closed element is basically just indicates what menu you're about to close, assuming you're doing valid hops

fresh timber
#

I am making a command for my BungeeCord server, "/lobby". I am making them run /server hub when they run /lobby so they can do it easier and quicker. It knows /lobby is a command because it is in the options for the command when I start to type it. That means the command is messed up. My command is registered and set with the right executor and in the spigot.yml.

public class Lobby implements CommandExecutor {

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {

        if (!(sender instanceof Player)) {
            sender.sendMessage("§cOnly players can use this command.");
            return true;
        }

        ((Player) sender).performCommand("/server hub"); // I have tried " ...preformCommand("server hub") " and I get the same result

        return true;
    }
}
echo basalt
#

If they don't match, it means you're closing the gui manually

#

yes

hasty prawn
#

Mine works slightly differently than yours but I think the premise is basically the same

hasty prawn
#

Because BungeeCord plugins don't have access to Player iirc

#

Should be ProxiedPlayer or something

echo basalt
#

worst case scenario we link a gui to another

#

and if people spam click enough, the server crashes

hasty prawn
#

That seems like a pretty bad worse case

fresh timber
hasty prawn
#

Did you put it in the plugin.yml?

fresh timber
#

yea

hasty prawn
#

Send your onEnable and plugin.yml

fresh timber
#

mk

#

Spigot.yml:

name: WildGamesBCE
version: '${project.version}'
main: wildgamesbce.wildgamesbce.WildGamesBCE
api-version: 1.19
authors: [ BeatThis101 ]
commands:
  lobby:
    description: Moves the player to the lobby.
    aliases: [hub]

onEnable:

    @Override
    public void onEnable() {
        // Plugin startup logic
        getCommand("lobby").setExecutor(new Lobby());
    }
hasty prawn
#

spigot.yml or plugin.yml?

fresh timber
#

oh plugin.yml

#

yea its plugin.yml

floral drum
#

If you want the player to be transferred

#

to the hub server

fresh timber
#

its a spigot plugin

floral drum
fresh timber
#

its a spigot plugin on a paper server

#

but u connect to it though bungeecord

floral drum
#

Okay, and you can't do "performCommand("/server lobby")" on the spigot side

fresh timber
#

I cant?

#

what should I do

floral drum
#

Because bungeecord doesn't detect the player executing a command

#

only the spigot server

#

if you do it that way

fresh timber
#

mk

#

no no this is not what im talking about

#

this is only on the spigot server and im trying to make the player run /server hub

dire gulch
#

https://prnt.sc/bornevAjYSVq
My problem is that the proxy is always pinged by a single person and this crashes the servers. I've been sitting there for 5 days and can't find a solution, does anyone have an idea?

fresh timber
#

because when they do that it teleports them to the hub

#

all I want is for /lobby to make the player execute /server hub

#

@floral drum

floral drum
#

But that's not possible on a spigot-sided plugin

fresh timber
#

and its saying its a unknown command

#

it isn't?

#

why is it a spigot method then

#

to make the player run a command

floral drum
#

Bungeecord doesn't detect the player executing the command "/server lobby" if it's done through "performCommand"

fresh timber
#

oh

floral drum
#

You have to use what I sent above

echo basalt
#

Bungeecord is just a proxy server - it routes packets

fresh timber
#

yeah ik

echo basalt
#

Spigot API methods run on spigot's jvm, it doesn't send any packets to the client asking it to reply with a command packet

fresh timber
#

I thought it would think it was a command tho

echo basalt
#

it simply pretends like a command packet has been received and it executes it

fresh timber
#

hm

echo basalt
#

It skips the bungee layer

fresh timber
#

but like is there a way to tell the bungeecord that the player ran /server hub so it will send it to hub like it happens when you run /server hub normally in game besides this or do I have to set up all of this just to do a /lobby command

echo basalt
#

or you can make a bungee plugin

fresh timber
#

yeah thats what I dont want to do

eternal oxide
#

When the player types it it goes from teh client through bungee. When the server executes it, it never leaves the server so Bungee never sees it

fresh timber
rigid loom
#

CraftPlayer{name=deemmooo}
why does this output when i use Bukkit.getPlayer(args[1]);?

eternal oxide
#

because you did a sysout

rigid loom
#

Player target = Bukkit.getPlayer(args[1]);

eternal oxide
#

you used System.out.println(target);

rigid loom
#

i didnt

eternal oxide
#

yes you did

rigid loom
#

ik what ur saying but i didnt

#

player.sendMessage(ChatColor.WHITE.toString() + ChatColor.BOLD + target + ChatColor.RED + ChatColor.BOLD + " is already in a kingdom");

eternal oxide
#

yes, target

#

you are tryign to print an Object

#

specifically a Player

rigid loom
#

how i do it correctly?

#

so it displays just their displayname

eternal oxide
#

Player is an object, so target.getName()

#

getDisplayName()

balmy valve
#

So im having some problems, I am using java entity.setVelocity(new Vector(0, 3, 0))
and it will launch an iron golem up, but it won't launch say a cow up

#

I dont know why

#

Anyone have any ideas?

flint coyote
#

Doesn't sound right. Probably your code doesn't even get called?

balmy valve
#

I know it does through printing messages, and if It didnt then why would the iron golem get launched

flint coyote
#

Well. I wouldn't know whether you try to launch both in the same or in seperate functions

balmy valve
#

its inside of an entity damage entity event

fresh timber
#

Hey, quick question. I am making a BungeeCord plugin on IntelliJ IDEA. How do I save the project to my files so I can put it on my server? Like, I want to do the same thing as building the artifacts on a Spigot plugin I just have no idea how to do this on a bungeecord plugin. I am using Maven.

#

just wait

#

ppl will respond when they can

#

they have lives too

#

m ok

fresh timber
#

I didnt run a command

remote swallow
#

how are you building then

fresh timber
#

I just hit this but I can no longer use it

#

which is probably a command

#

but I cannot use that now

remote swallow
#

press control twice then type mvn clean package

fresh timber
#

mk

#

still not avalible

#

oh wait]

remote swallow
#

mvn clean package is a build command

fresh timber
#

yea

#

I feel stupid now

obsidian drift
fresh timber
#

mk

#

thx

balmy valve
next stratus
remote swallow
#

they said they were using maven

#

i was using build as a general term

#

example: "mvn clean package builds the project to a jar file to be used on a server"

sterile token
#

mvn install - Install the artifacts into local repo
mvn deploy - Deploy the artifacts into remote repository

fresh timber
#

I am using maven and it worked to build my project, @next stratus

next stratus
#

Gradle is far more up to date than maven, I don't know why it's the most used thing in spigot sadly.

fickle mist
#

Hi all! I have a question how to make a randomizer and not just a randomizer that takes some numbers, but numbers / symbols
which are taken from the config (as shown in the picture)

jaunty crag
#

this is more of a java question but is there any way to get all the outputs in a hashmap except the output to one specific input

quiet ice
#

Or rather said it does not make sense to make such a comparision

echo basalt
echo basalt
#

Little confused towards what you're tryna do?

next stratus
jaunty crag
quiet ice
#

However for the things that gradle and maven share (i.e. the ability to created jars), they are almost the same

echo basalt
quiet ice
#

Gradle is a bit worse in that it does not support FTP and SFTP (using keys) repos

jaunty crag
echo basalt
#

I honestly prefer gradle over maven

#

it's like 10x smaller

quiet ice
#

However once you go to the API it is an entirely different story - maven is easier to learn but requires a lot more workarounds than gradle

echo basalt
#

and it uses a java-like style where maven is closer to html (based off a markup language)

quiet ice
#

The java-like style becomes something I don't like about gradle however as it isn't actually java

echo basalt
#

just pretend it's javascript

quiet ice
#

oh no

junior geyser
#

Any one know I way I could check for line of sight between 2 locations? If an entity was standing a certain spot, could it see a certain location

quiet ice
#

Raytracing I guess

junior geyser
#

there is a hasLineOfSight method, bit I need to use a location

quiet ice
#

?jd-s spigot has an API for that, lemme look it up

undone axleBOT
junior geyser
quiet ice
quiet ice
junior geyser
quiet ice
#

If you can find a decent site hosting J8-style javadocs for 1.8.8 I could check

junior geyser
#

I believe this exists in 1.8

quiet ice
#

If it exists you could probably use that yeah

glossy venture
sterile axle
#

You could probably just do the ray tracing yourself (if needed)

glossy venture
#

you can include one common file to configure your module as well

junior geyser
next stratus
#

gradle init 🙂

quiet ice
glossy venture
glossy venture
quiet ice
#

Some is an underexaggeration

glossy venture
#

its another jvm language too

#

so you have the class library too

glossy venture
next stratus
#

?

glossy venture
#

so not too much to learn

quiet ice
#

There are a lot of rather huge quirks that it is better to just write the stuff in java proper

glossy venture
#

only thing is the gradle API is quite big and shit

quiet ice
#

And the documentation is fucking shit

glossy venture
#

looks much better for configuration than it would in java

quiet ice
next stratus
#

I wonder if kids find the tutorial on how to install spigot see the maven one then never change

quiet ice
#

He uses FTP

next stratus
#

lol

quiet ice
#

Gradle does not support FTP

next stratus
quiet ice
next stratus
#

Sure buddy if you say so.

quiet ice
#

I have checked, using FTP for maven repos is near-impossible

#

Unless you want to code it yourself

#

At which point you might as well shoot yourself in the head if maven can already do it

glossy venture
next stratus
quiet ice
#

As I said, I already checked

next stratus
#

???

#

Plugins don't upload via ftp?

quiet ice
#

Gradles argument is basically "FTP is unsecure you shouldn't use it lol"

next stratus
#

Use external plugins then

quiet ice
#

    <distributionManagement>
        <repository>
            <id>jeff-ftp</id>
            <url>ftps://ftp.jeff-media.de/maven2</url>
        </repository>
    </distributionManagement>