#help-archived

1 messages · Page 212 of 1

tough kraken
#

yeah true

sturdy oar
#

I wish all players would have <50ms ping and server always 20tps

tough kraken
#

then good luck

sturdy oar
#

But no some people like to join american servers from africa

tough kraken
#

start at germany

tiny dagger
#

start with italy internet

tough kraken
#

we have one of the worst internet worldwide lol

#

just because the politic guys dont want to stay on their promise)

tiny dagger
#

what's your speed?

tough kraken
#

but hey, german politics... could tell romans about that

#

16mbps download, but i really have one of the worst possible

tiny dagger
#

or just stability

sturdy oar
#

I literally pay 40€ a month for 1gbps/300mbps + landline

#

Italy is best

tiny dagger
#

woa

tough kraken
#

lol

tiny dagger
#

300 up?

tough kraken
#

i pay even 20€ for my mobile 5gb, idk whats your prices for mobile internet

sturdy oar
#

Yes

#

300 upload max

tiny dagger
#

then good on you 👀

tough kraken
#

so viper, what was the mistake for my generator now

#

i dont get it... how can the int even become -255 WTF

tiny dagger
#

int can be -2^31-1 actually

tough kraken
#

no i mean

how can a random int with bound 100 get -255

tiny dagger
#

oh

#

it can't

#

pretty sure most random implementations can't go below 0

tough kraken
#

whats wrong with my code

#

just tell me lol

#

aren't the wiki tutorials working in most case? lol

#

dont think thats an 1.16 problem

hollow root
#

what's your code?

river cradle
#

Hi there, I'm trying to change the skin of an NPC, but for some reason they still appear as Alex of Steve skins. What am I doing wrong?
Code: https://paste.md-5.net/aberasexer.java
Both value and signature strings seem to be correct (I've printed them out), so I assume my error must be at line 51, but I don't see what I'm doing wrong...

tough kraken
#

its saying, that x and z are out of range, its giving about -255 to 255... idk why

#

at line 22

gilded compass
#

@hollow root Using .spigot gives me a stringified/serialised version of the textconponent object

#

It's bizzare

hollow root
#

let me check one of my plugins, 1 min

#

@gilded compass this is how I did it for a clickable link:

            TextComponent text = new TextComponent("");
            TextComponent tc = new TextComponent("[X] ");
            tc.setBold(true);
            // TODO: Make color configurable
            tc.setColor(net.md_5.bungee.api.ChatColor.DARK_RED);
            tc.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/besttools blacklist remove "+mat.name()));
            TextComponent link = tc;
            TextComponent name = new TextComponent(mat.name());
            name.setColor(net.md_5.bungee.api.ChatColor.GRAY);
            text.addExtra(link);
            text.addExtra(name);
            p.spigot().sendMessage(text);
#

the "[X] " is the clickable link

#

it's quite messy because I also had some troubles with the link not being clickable at all, so I just left this how it is right now. actually it was also split up into two methods but I combined them to send it here

#

maybe it's easier to open a thread at the spigot forum, the messages kinda get lost here

frigid ember
#

I have a problem

#

With spigot servers

#

i get ths error when im tring to run.bat

#
operable program or batch file.
Press any key to continue . . .```
#

Does anyone know how to fix?

tough kraken
#

whats in your bat file

frigid ember
#

run.bat

tiny dagger
#

see what java help tells you

#

maybe you don't have it on your path

#

but probabily you messed up the init line

wicked plume
#

Hi there, does anyone know why buildtools always makes me add the -Xmx1024M argument?

spark phoenix
#

Because it needs at least 1gb assigned in order to run successfully

wicked plume
#

It says that this can happen if I'm on a 32-bit system or low ram. I've got 64-bit windows and 16 gigs of ram

spark phoenix
#

Prob you installed 32bits java instead of 64bits

wicked plume
#

Will try that. thanks

spark phoenix
#

np

dry horizon
#

Is it possible to make a fully working match making system (like Hypixel BedWars for example) using a BungeeCord network, with a Spigot Plugin?

tiny dagger
#

doubt anyone had time to make match making

#

👀

#

not hard tho

dry horizon
#

Its possible?

tiny dagger
#

why not

vernal spruce
#

well i guess it depends how complex you want that match making to be

tiny dagger
#

you need some database/socket work

#

or even better

vernal spruce
#

if you also keep count of elo,who joined first,who has priority and shit

tiny dagger
#

bungee messaging

dry horizon
#

Nope ill be checking for required players in the queue and thats it

#

Its 2v2 so i need 4 playera

#

S

tiny dagger
#

what like starting from the player 'rank score' then expanding based with time to wait?

dry horizon
#

Nope. Nothing

tiny dagger
#

then that's not matchmaking

dry horizon
#

I want it to work like this: you click on an npc, you get added to a queue, once there are 4 players, no matter the level or rank, they are sent to a server

frigid ember
dry horizon
#

I have never worked on something like a queue so im kind of scared to start coding

#

Especially cuz its my first time working with Bungee

frigid ember
#

I DIDIDID

#

'java' is not recognized as an internal or external command,
operable program or batch file.
Press any key to continue . . .

#

This eroror

radiant pollen
#

You need to make sure your PATH has an entry for Java.

hollow root
#

yeah, either adjust your path or provide the full path to your java executable

bold anchor
#

Install java

hollow root
#

e.g. instead of java use C:\Program Files\Java\jdk-13.0.1\bin\javaw.exe

#

(or where ever your java executable is living)

#

Install java
@bold anchor
I DIDIDID
@frigid ember

frigid ember
#

have JAVA

hollow root
#

read what I wrote ProMaxxed...

frigid ember
#

Ik

hollow root
#

adjust your PATH environment variable or provide the full path to the java executable

frigid ember
#

how

hollow root
#

where did you install java?

lone fog
#

google

frigid ember
#

In my program files x82 java jre1.8.0_261

vapid laurel
bold anchor
#

The usual shenanigans

river cradle
#

Hi there, I'm trying to change the skin of an NPC, but for some reason they still appear as Alex of Steve skins. What am I doing wrong?
Code: https://paste.md-5.net/aberasexer.java
Both value and signature strings seem to be correct (I've printed them out), so I assume my error must be at line 51, but I don't see what I'm doing wrong...

vapid laurel
river cradle
#

Yep, I followed that tutorial but it doesn't work and I can't spot my error

vapid laurel
#

join his discord

river cradle
#

Well I guess I did something different, I used another API to convert a skin PNG to a value and signature string

#

Well I just did, but I don't see why they could help me more than you guys could haha

#

I mean it's very much a Spigot question

vapid laurel
#

dude i cant code more then a print command

river cradle
#

Haha we all were there once

vapid laurel
#

i mean the only problem i can see is using the different api. maybe its outdated or something. make sure everything is your version

fringe shore
#

gydfbiudvnueu9vf8-hvhrygfyhf-8ypfhu[vg'b

bold anchor
#

Ok

sturdy oar
#

Damn

#

That was deep

river cradle
#

i mean the only problem i can see is using the different api. maybe its outdated or something. make sure everything is your version
@vapid laurel I don't think that's the problem, as the value and signature returned seem valid... I think it has to do with the way I'm applying it but I don't see the error

noble patrol
#

@jagged torrent I have recently made a account under the wrong email for the forums. Is there anyway you can reset it?

visual kiln
#

hi

#

could anyone help me compile the hypixelapi?

jagged torrent
noble patrol
#

Ok.

#

With the tmp or not?

jagged torrent
#

with the tmp

noble patrol
#

Ok.

alpine yoke
#

[20:39:18 ERROR]: [PlaceholderAPI] LeonCat is currently using a deprecated method to hook into PlaceholderAPI. Placeholders for that plugin no longer work. Please consult [Marcelektro] and urge them to update it ASAP.

#

why

#

:(

#

I used EZPlaceholderHook

jagged torrent
#

so don't use deprecated API lel

#

that's been deprecated for ages

alpine yoke
#

rip

#

xdddd

#

Do you know what is the new way to do this?

jagged torrent
alpine yoke
#

Tank you

cinder monolith
#

hey i need help

paper compass
#

?ask

worldly heathBOT
#

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.

cinder monolith
#

I went more than 6000 blocks in end dimension and didnt find any end city.

#

I'm playing on server

visual kiln
#

dude

#

thats literally

#

the most unrelated question

#

ever

cinder monolith
#

and I am unable to use ender pearl on endcity gateway

visual kiln
#

dumb server then

cinder monolith
#

is this related to minecraft or server setup?

#

@visual kiln so do you know what's the issue?

visual kiln
#

no

#

its just unrelated to this discord

tranquil aurora
#

If I own a premium resource, can I manually give people access to it?

tiny dagger
#

ye

#

add buyer

tranquil aurora
#

Oh cool, is it by username?

tiny dagger
#

however you have no control over them after

tranquil aurora
#

What do you mean

#

Like I can't remove them?

tiny dagger
#

there is no edit button

#

ye

mellow bobcat
#

was about to ask a question here then i just forgot to add a single symbol at the end of the line ;

tiny dagger
#

you can't remove them

tranquil aurora
#

Ah that's fine

mellow bobcat
#

god damn it java

tiny dagger
#

not when you're chargebacked by one

dreamy glacier
#

Someone know how create custom entity in 1.16.1 ?

vernal spruce
#

Be more specific

#

I think a google might prove more helpfull

frigid ember
#

hey guys, weird bug - I am attacking a friendly player in my testing

#

I expect to see the entityattackentityevent to be thrown, but instead the playerinteractevent is being thrown

#

Does anybody know why this happens?>

#

is there a plugin for using an item to execute a command?

wicked plume
#

Hi there, can anyone help tell me what is causing the error to be thrown? It's whenever a player joins https://pastebin.com/PSJnbkcg Any help is appreciated. Thanks

fossil shoal
#

It's an error in a plugin called FogusCore

sturdy oar
#

Imagine having a sword

#

That when you attack

#

does /restart

sage summit
#

So im just starting a basic survival server for 1.16 with maybe 20 plugins or less and maybe 10 players or so, I'm wondering how much ram I would need for it

sturdy oar
#

I recommend at least 6

#

1.16.1 is real bad

#

That's the sad truth

wind dock
#

hey guys, so for some reason, even though I set tab-complete to -1 in spigot.yml, people in 1.15.2 can still tab complete. any fix?

neat oxide
#

Mojang hates making stuff lag less it seems and spigot currently have other focuses

sage summit
#

yeah, im doing a survival one, my minigames and stuff will be 1.8 or 1.12

neat oxide
#

@wind dock report on jira someone will take a look and fix it

#

?jirsa

#

?jira

worldly heathBOT
wind dock
#

er

neat oxide
#

I wont fix nothing with no corresponding JIRA ticket

frigid ember
#

What is max ram for minecraft server?

tiny dagger
#

i don't think there is a max limit for minecraft

winged sparrow
#

Is anyone here good at custom nms entities? If so, could you tell me a method for removing all the original pathfinder goals for the entity?

crimson sandal
#

Maybe a dumb question but can you add @EventHandlers to abstract methods?

winged sparrow
#

I tried some sort of reflection method from an old spigot post but it didn't work.

tiny dagger
#

depends gizmo

#

do you have a custom entity class extending the og?

#

or just trying to modify it from the outside

#

there is this:
EntityInsentient creature = (EntityInsentient) e.getHandle(); creature.goalSelector = new PathfinderGoalSelector(((CraftWorld)en.getWorld()).getHandle().getMethodProfiler()); creature.targetSelector = new PathfinderGoalSelector(((CraftWorld) en.getWorld()).getHandle().getMethodProfiler());

winged sparrow
#

It extends a entityVillager

tiny dagger
#

but complex entities like villagers have other stuff that still gives them some sort of ai

#

oh

#

then you also need
Field field = EntityLiving.class.getDeclaredField("bo"); field.setAccessible(true); field.set(creature, new BehaviorController(ImmutableList.of(), ImmutableList.of(), new Dynamic(DynamicOpsNBT.a, new NBTTagCompound())));

#

this is for 1.15

#

it keeps changing each version quiet a lot which is annoying

winged sparrow
#

Is this supposed to work out of the box? I threw it in a try catch and it's giving me red lines.

tiny dagger
#

the whole method looks like this

#

you don't need the silent part

bronze acorn
#

arent the fields accessible now

#

lol

tiny dagger
#

not that one

#

i'm sure

winged sparrow
#

I think I'm in over my head here, god I wish I could see the source for what I'm messing with here

lone fog
#

Get a decompiler plugin for you IDE

#

Or use something like InteliJ with it built in

tiny dagger
#

ye

winged sparrow
#

Well I tried out that deobfuscator software I saw on spigot

#

mcdeob or something

#

I ran the process but never opened it

tiny dagger
#

wait for what?

#

spigot is deobfscated kinda

winged sparrow
#

no for nms I believe.

tiny dagger
#

well

#

you just gotta mess with it as it

#

or use the minidigger library

#

🤔

#

he did one

#

but i never found it usefull since i can just look

bronze acorn
#

disciple

#

wdym

#

if u right click a class click find usages

#

and it'll tell u how to call it

tiny dagger
#

i think he means that the nms has weird names from obfuscation and he is trying to get rid of them

winged sparrow
#

No no

#

I just haven't really looked at the source code

#

decompiled minecraft server jar

west gull
#

How do I get @prisma viper bot for my own server? (if at all)

lone fog
west gull
#

thank you

scenic osprey
#

Hi, I made a plugin that drops the player's head when they die, but when the player changes their skin and place down their head it changes to their previous skin, why?

#

And it's the a new head when they die, not the old one

frigid ember
#

anyone know what alt code name is

bronze acorn
#

an asterisk?

quick arch
tough crown
#

but when i do e.getBlock() then getType() it works

frigid ember
#

anyone know the problem

balmy sentinel
#

?paste

worldly heathBOT
balmy sentinel
#

delete that and post it in the haste bin

frigid ember
balmy sentinel
#

is that your plugin or someone else’s? I mean if you read the error it says right there onDisable there is a null pointer exception.

frigid ember
#

someone else

balmy sentinel
#

talk to the developer

frigid ember
#

lmao ok

quick arch
balmy sentinel
#

@tough crown why are you casting to player and block? You don’t need to do that

tough crown
#

probably IntelliJ imported the wrong thing for me

quick arch
#

what

#

IntelliJ did import the wrong Block class

#

You don't need to do that either

balmy sentinel
#

just do Block block = e.getBlock();

tough crown
#

but how can i get the name of the block

#

can't find any tutorial about that

balmy sentinel
tough crown
#

ohh thanks

#

looks like they have changed it to getBlockData()

quick arch
#

Blocks don't have names unless they're Tile Entities

lone fog
#

Does IntelliJ not complain about unnecessary casts

balmy sentinel
#

IntelliJ will just turn it gray and say it’s redundant

tough crown
quick arch
#

what

tough crown
#

doesn't work....

#

err the tutorial didn't teach me tooo

balmy sentinel
#

Don’t tell us it doesn’t work tell us why it doesn’t work

#

What are you even trying to do?

tough crown
#

i am trying to detect block placing

#

found why it's not working because i missed a "S" after registerEvent

frigid ember
#

yo do you guys know why in my main class

package me.athlete.score;

import org.bukkit.plugin.java.JavaPlugin;

public class SCore extends JavaPlugin {
}```
it says class Score never used?
balmy sentinel
#

my advice don’t name classes after already existing Bukkit/Spigot API classes. You’ll also need to provide more information than that.

frigid ember
#

anyone know where to get those sort of alt codea

#

that's the name of my plugin?

quick arch
quick turtle
#

wdym

#

You mean a gray thing when u hover the class name @frigid ember ?

frigid ember
#

hmm yeh

#

I guess I have to change the name since its conflicting

tough crown
#

btw if itemOnHand is deprecated what should i use

elder lark
#

you should get the player inventory and then from that get itemOnMainHand

subtle wedge
#

Any good Plugin Managers?

pastel condor
#

plugman

quick arch
#

no

frigid ember
#

hmm

#

it does the same for ServerCore

pastel condor
#

no
it's good when you're testing plugin and you're too lazy to keep restarting the server

#

you just do /plugman reload (plugin name)

subtle wedge
#

Plugman isn't that good

quick arch
#

and then get a bunch of memory leaks 😬

frigid ember
#

let me show you a screenshot hold on

#

oh wait you cant paste images

dusty topaz
frigid ember
#

smh

#

but yeh the name is basically dark gray in intellij, and when you hover over it, it says Class ServerCore is never used

fleet crane
#

btw if itemOnHand is deprecated what should i use

#

the javadocs always tell you what to use

#

read them 😐

quick arch
#

md_5, why do you expect people to read the javadocs 😐

dusty topaz
#

How would you make an async response for placeholder API?

tough crown
#

now separated to mainHand and offHand

dusty topaz
#

I need to fetch the placeholder from a database - is there a way to do that without freezing

quick arch
#

CompletableFuture

dusty topaz
#

papi expansions return a string

quick arch
#

oh

#

Fetching stuff from databases have to be async

#

CompletableFuture can be async and return stuff

dusty topaz
#

yup im aware

quick arch
#

is this custom placeholders

spring coyote
#

How can I get the attack damage (Ex: Diamond sword has 7 attack damage) of an item?

quick arch
#

You have to calculate that, it's hardcoded in

#

I'm pretty sure it is

spring coyote
#

ok

#

Usually I would just get the generic attack damage attribute of the player that is holding it but i cant do that rn

mental vortex
#

Is there a list somewhere of all items which cannot be dropped using dropItem on a world? I know that the air types cannot be dropped using this method, but are there more?

plush nexus
spare frost
#

getPlayer().getVelocity().multiply(0.4)

#

does this work?

#

or do i have to make a new vector and do setvelocity

lone fog
#

You have to setVelocity

#

You don’t necessarily need a variable though

spare frost
#

so like this getPlayer().setVelocity(getPlayer().getVelocity().multiply(0.4));

lone fog
#

Yes

quaint sinew
#

you guys know of any good way to crash my own server so I can test auto restart?

#

I was thinking tnt but last time I exploded over 20k and it seemed like it handled it like a champ tbh

lone fog
#

Make an infinite loop or something

frigid ember
#

yo is it possible to list all the plugins in alphabetical order, when you do /pl?

lone fog
#

Don’t think the default implementation of /pl does

#

But you can make a custom one

frigid ember
#

yeh that's what I mean.

#

how would I do that?

lone fog
#

Look at the current implementation

quick arch
#

you guys know of any good way to crash my own server so I can test auto restart?
Thread.sleep(Integer.MAX_VALUE) 😏

lone fog
#

And you’ll probably just need to copy it with a list.sort

quaint sinew
#

what do u mean by an infinite loop?

lone fog
#

A loop that never exits?

quick arch
#

Integer.MAX_VALUE loop

quaint sinew
#

i mean yeah but like a loop of what

quick arch
#

or... Double.MAX_VALUE >:)

quaint sinew
#

and how

frigid ember
#

hmm alright will do

lone fog
#

while (true) {
}

quick arch
#

Just be like Slimefun and use nested BukkitRunnables

pastel nacelle
#

fucking slimefun

nocturne crane
#

does anyone know a plugin where you can have luckperms roles above a players head (other than tab)?

frigid ember
#

yo how do you get if the player has max health & max food level

quick arch
#

Attributes for max health

#

max food has a method

#

getMaxHunger()

#

probably that

frigid ember
#

I see getmaxhealth not hunger

lone fog
#

Hunger is fixed

#

So you can just check if it’s 20

sage summit
#

whats some good free and paid anti cheats?

ember ibex
#

Warden

#

I'm having trouble checking if a tree was bonemealed by a dispenser rather than a player in the StructureGrowEvent but e.isFromBoneMeal() returns false when a dispenser grows the tree. Are there any easy fixes?

#

@EventHandler
public void treeGrowEvent(StructureGrowEvent e) {

    if (e.getPlayer() != null) {
        Player p = e.getPlayer();

// p.sendMessage(mainRef.pluginPrefix + ChatColor.GREEN + "You have just grown a " + e.getSpecies().name());

        Object customTrees = mainRef.getConfig().get("players." + p.getUniqueId() + ".enabletrees");

        if (customTrees == null) {

            customTrees = true;

            mainRef.getConfig().set("players." + p.getUniqueId() + ".enabletrees", customTrees);
            mainRef.getConfig().set("players." + p.getUniqueId() + ".name", p.getName());
            mainRef.saveConfig();
        }

        if ((boolean) customTrees) {
            // intervene and spawn a custom tree...
            spawnCustomTree(e, p); //event, player
        } else {
            // regular spawning do nothing
        }
    } else {
        // if its from bonemeal, then regular tree
        // otherwise grow a custom tree.
        if(!e.isFromBonemeal()) {
            spawnCustomTree(e, null); //event, no player to pass through
            
        }
    }
}
sage summit
#

How would I set the gamemode to what is specified in the config when an event is run?
I have
String gamemode = getConfig().getString("gamemode-on-death");
player.setGameMode(GameMode.gamemode);

pastel nacelle
#

well

#

you can start by learning java

#

but what you're probably looking for is the Enum#valueOf method

#

remember to try-catch and print an informative warn message in console if the string doesn't correspond to a game mode

sage summit
#

🤦‍♂️ ok I seriously dont know how i forgot that, i have used to so many times before

frigid ember
#
                    .durability(3)
                    .owner("")
                    .name("§eClans online")
                    .lore("§7 Listar os clans online.")
                    .build());```
Is there any way to set a custom skull from the website "minecraft-heads.com" on there?
fossil burrow
#

can you help me?

atomic nova
#

@frigid ember you can try where is says owner put the players name there to see if it will work

#

@fossil burrow help you with what ?

frigid ember
#

Ye, it works with players names, but i want to make it with custom heads from minecraft-heads.com, and as i know these heads do not have names

#

Or yes?

fossil burrow
#

is that I connect a host to my bungee and when trying to enter it takes me out to the lobby

@fossil burrow help you with what ?
@atomic nova

grave terrace
#

Probably a common question, but I am referencing spigot-1.16.1.jar yet apparently CompassMeta is not in org.bukkit.inventory.meta, which is should be per the docs. (Can I safely paste my docs link?)

sharp cradle
#

is there any way to make the server not load world, world_nether and world_the_end?

frigid ember
#

World nether and the end yes, but world i think no

#

You must have at least one world

fossil burrow
#

@fossil burrow help you with what ?
@atomic nova "the server you were previously on went down, you have been connected to a fallback server"

frigid ember
#

nether & end you just disable them on bukkit.yml and spigot.yml

sharp cradle
#

okay, thanks! :)

frigid ember
#

No problem 😉

grave terrace
#

@sharp cradle I would guess no for world, maybe mess with Bukkit.getWorlds()?

fossil burrow
#

removing the option that brings the spigot.yml "bungee: false" lets me enter normal with the ip

grave terrace
#

Anybody know an open source plugin with a working nether compass?

frigid ember
#
                    .durability(3)
                    .owner("")
                    .name("§eClans online")
                    .lore("§7 Listar os clans online.")
                    .build());```
Is there any way to set a custom skull from the website "minecraft-heads.com" on there?

somebody knows?

grave terrace
#

SoyTermo, sounds like that would depend entirely on how those heads are used. It doesn't sound like a Mojang supported website.

#

How do you use one outside code?

nocturne crane
#

does anyone know a plugin where you can have luckperms roles above a players head (other than tab)?
. And also is there a plugin other than Chat Manager that can do per world chat?\

#

for 1.16 ofc

atomic nova
#

well the normal Heads are easy as you would just put the player name in the Owner slot but the custom ones are generated code that i wouldnt know how to add

frigid ember
#

I want to set a head that is all green, its just a texture

#

But as i know, it does not have any name

#

I know that its possible to do that, but i don't know how :I

fossil burrow
#

help :c > [01:53:47 INFO]: Mark_VR[/181.197.114.153:51602] logged in with entity id 420 at ([lobby]9.883297353712956, 108.5, 47.525309221546635)

[01:53:47 INFO]: Mark_VR lost connection: Internal Exception: java.io.IOException: Error while write(...): Connection reset by peer
[01:53:47 INFO]: ╥﹏╥ Mark_VR.
[01:53:49 WARN]: [VoidGenerator] Task #1474 for VoidGenerator v1.5.1 generated an exception
java.lang.NoSuchMethodError: org.bukkit.entity.Player$Spigot.sendMessage(Lnet/md_5/bungee/api/ChatMessageType;[Lnet/md_5/bungee/api/chat/BaseComponent;)V
at me.xtkq.voidgenerator.a.b$1.run(PlayerLoginListener.java:43) ~[?:?]
at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftTask.run(CraftTask.java:59) ~[server.jar:git-PaperSpigot-"4c7641d"]
at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:352) [server.jar:git-PaperSpigot-"4c7641d"]
at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:783) [server.jar:git-PaperSpigot-"4c7641d"]
at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:378) [server.jar:git-PaperSpigot-"4c7641d"]
at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:713) [server.jar:git-PaperSpigot-"4c7641d"]
at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:616) [server.jar:git-PaperSpigot-"4c7641d"]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_212]

pastel nacelle
#

outdated plugin or something

fossil burrow
#

01:53:47 [SEVERE] [Mark_VR] <-> DownstreamBridge <-> [lobby] - encountered exception
java.lang.IllegalArgumentException: Team viaversion already exists in this scoreboard
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:191)
at net.md_5.bungee.api.score.Scoreboard.addTeam(Scoreboard.java:73)
at net.md_5.bungee.connection.DownstreamBridge.handle(DownstreamBridge.java:210)
at net.md_5.bungee.protocol.packet.Team.handle(Team.java:124)
at net.md_5.bungee.netty.HandlerBoss.channelRead(HandlerBoss.java:105)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)

pastel nacelle
#

duplicate teams

atomic nova
#

@frigid ember can you DM me a link to the head you want and i will see what i can find to make it easier

pastel nacelle
#

iirc skulls can hold texture blobs

#

you can write the texture to the skull yourself probably

sharp cradle
#

@frigid ember from the FAQ on minecraft-heads.com

A custom head is a skull, linked to a texture stored on the servers of Mojang. In contrast to player heads, custom heads don't use playernames. Since the commands you use to get those heads neads NBT-Tags from Minecraft 1.8, you can't use them in earlier versions of the game. Since the skull is directly linked to files on the Mojang servers, the texture will never change.

frigid ember
#

But i don't know how to add it on my plugin

sharp cradle
frigid ember
#

Ahh, yes

#

I agree with u on that

#

Somebody told me to use HeadDB API, but i don't know how to add it on my plugin

#

@frigid ember can you DM me a link to the head you want and i will see what i can find to make it easier
Sent

sharp cradle
spring coyote
#

in survival mode, the reach of a player is 3 blocks, but in creative, it is 4 blocks. Is there a way that I can give a player the reach of a creative player? (Out of curiousity)

buoyant path
#

"Because of how lambda grabs context locally, (copy not reference), you can't use it for things where you need to change the state of the object you're including"

#

Is this true

#

and if so Im not sure how to fix it

#

I really do want to use lambda

keen compass
#

lambda isn't meant to be used for everything

#

nor is it to replace the normal java conventions either

buoyant path
#

@keen compass I’m using functional interface to change stages in my animation and do it in much less code

keen compass
#

and my statement still applies

#

it might be less code to read, but it doesn't mean the amount of things being done are any less either

#

all lambda does is basically hides methods or underlying mechanisms. But it still doesn't change the fact that lambda isn't meant to change java conventions or that it is designed to replace everything because it isn't

humble spoke
#

how can i cast ItemStack to CraftItemStack because i've noticed that when i use getItem in the InventoryClickEvent method getClickedInventory it provides me a CraftItemStack

naive wyvern
#

Hello, for some reason whenever i download a custom dimension datapack, it works in vanilla 1.16 servers and singleplayer, but it doesn't work in spigot, whatsoever

fleet crane
#

@humble spoke why do you need to do that

#

@naive wyvern theyre not supported, this is stated in the release notes

naive wyvern
#

will they be supported soon?

#

or ever?

humble spoke
#

im trying to compare two items, and for some reason it saved one items as ItemStack, and the ones that i get from the event are CraftItemStack

fleet crane
#

no idea

#

@humble spoke you can still .equals them

humble spoke
#

oh

#

heh i was just doing a simple item1 == item2

#

probably not the smartest idea

fleet crane
#

== wouldnt work even if they were both itemstack

#

only use == on numbers unless you know what youre doing

humble spoke
#

ah okay

#

thanks

naive wyvern
#

Could I possibly use like multiverse plugin to use custom dimensions?

fleet crane
#

yes

naive wyvern
#

ok thanks

neat oxide
humble spoke
#

how could i "refresh" an inventory, because when i set an item on the InventoryClick event, the item in the slot i want it to update wont appear unless i do another InventoryClick event to somehow "refresh" the inventory

vernal spruce
#

Dont you have inventory.update?

humble spoke
#

doesnt seem so

vernal spruce
#

nvm thought of something different

humble spoke
#

player.updateInventory is deprecated aswell

vernal spruce
#

but i think grabbing a instance of the inventory involved

#

and calling set item should modify it

humble spoke
#

that's what i do, call setItem

#

unlessi gotta do it twice

#

and the item in question is null usually

sage summit
#

whats better for minigame servers? 1.12 or 1.8?

#

like whats less lagg

#

y

wise badger
#

How do I make pvp like 1.8 on a 1.16 server?

ripe narwhal
#

Is there any plot plugin that uses the y axis too?

nocturne crane
#

yes

#

playerplot

ripe narwhal
#

?

#

no it does nt

#

it claims the hole thing from 0 to 256

nocturne crane
#

idk then

#

that's the only plot plugin

ripe narwhal
#

oh ok

nocturne crane
#

😦

strong lantern
#

I need help

#

java.lang.IllegalArgumentException: plugin source cannot be null

#

how do i fix this?

#

I think I made a mistake in this

public class command implements CommandExecutor {

    public static String lobby = "lobby";
    private Bungeecord warpTool = new Bungeecord();
    private String noPermissions = "§cI'm sorry, but you do not have permission to perform this command. Please contact the server administrators if you believe that this is in error.";
    @Override
    public boolean onCommand(CommandSender player, Command command, String s, String[] args) {
        if (player instanceof Player){
            Player playertmp = (Player) player;
            if (command.getName().equalsIgnoreCase("lobby")){
                playertmp.sendMessage("warping...");
                Game plugin = Game.getInstance();
                try{
                    warpTool.Connect((Player) player,"lobby");
                }catch(Exception e){
                    player.sendMessage(e.toString());
                }
            }
        }
        return true;
    }
}

#

anyone? help

#

HELP

#

?help

#

HELP?

#

anyone???

past basalt
#

and this is the crash-report i get

strong lantern
#

idk

midnight lichen
#

Hello anyone able to help with command blocks on spigot. The command block does not detect a named item for being shifted around in my inventory on a spigot server but is able to do so a vanilla single player. The command block is only able to detect shifted items on spigot provided it is not named at all. The paste bin below is the item I am trying to test using the execute command in the command block on spigot

strong lantern
#

hmmm apparently not

ripe narwhal
#

does anyone knows a good minigame plugin?

gilded compass
#

thats very unspecific

ripe narwhal
#

I mean

#

just events you know

gilded compass
#

Still not specific

ripe narwhal
#

...

#

idk how to explain

gilded compass
#

then idk how to help

ripe narwhal
#

oof

strong lantern
#

java.lang.IllegalArgumentException: plugin source cannot be null

#

what could this mean

fleet crane
#

Hello anyone able to help with command blocks on spigot. The command block does not detect a named item for being shifted around in my inventory on a spigot server but is able to do so a vanilla single player. The command block is only able to detect shifted items on spigot provided it is not named at all. The paste bin below is the item I am trying to test using the execute command in the command block on spigot
@midnight lichen I already told you above, spigot changes the json slightly when you shift click it

#

look at what the new json is and change to using that

wicked cape
#

@strong lantern spamming won’t get you help.

strong lantern
#

@wicked cape I don't need dismissal, I need answers

#

I can't spell

wicked cape
#

And have you noticed how no one has gave you an answer?

midnight lichen
#

How do I look at the new json @fleet crane

strong lantern
#

@wicked cape why, becuase nobody knows?

#

@wicked cape I only sent it twice and u call it spamming.

frigid ember
#

I'm making a plugin which stores information about player deaths it should send all the deaths located in the HashMultimap maximum of 3, but it just sends the first information and nothing more than that

vernal spruce
#

is hashmultimap even a thing lol

frigid ember
#

it is

vernal spruce
#

oh lmao com.google.common.collect.HashMultimap;

frigid ember
#

can store multiple values for a key

vernal spruce
#

but you have a object storing

#

why would you even need more values

#

for same key

#

oh lmao

frigid ember
#

so you have multiple

vernal spruce
#

you store only 1 death inside just noticed

#

so how is this better than simply doing HashMap<UUID,List/Set<Data>> ?

frigid ember
#

I need to store 3 deaths and keep the information about those

#

until a fourth death of the player 'happends' and the last one is removed

#

thats how it should be at least

vernal spruce
#

that didnt rly answer my last question though

frigid ember
#

regular hashmaps cant store info about last 3 deaths?

#

when you put the info in thee last info is removed

vernal spruce
#

a hashmap can store a list or a set or pretty much everything

#

you simply make a set/list holding 3 datas

frigid ember
#

Then I'll do that

#

fuck HashMultimap xd

vernal spruce
#

tbh never heard of it till now

#

oh actually not much difference i guess

#

@frigid ember you can also go bit longer and lazy way

#

have a hashmap holding a object that stores the 3 datas inside them

#

lol

frigid ember
#

nah I will make a set

#

but to put this in java dataMap.put(uuid, new Data(e.getEntity().getLocation(), e.getDeathMessage(), System.currentTimeMillis()));

#

how am I supposed to fit this in since its a set now? new Data(...)

vernal spruce
#

well i would have a method for it as there are some conditions now

#
  Set<Data> deaths = new HashSet<>();
deaths.add(new Data(location,death...);
dataMap.put(uuid,deaths);

}```
stoic spindle
#

how do i make a spigot egg for my pterodactyl servers?

vernal spruce
#

wut?

frigid ember
#

store location, deaths, time apart?

#

via a hashset

vernal spruce
#

you store

#

a instance of the object "Data"

frigid ember
#

yes

vernal spruce
#

a Set is basically a list of them

#

wich keeps count to never have same object

#

to avoid duplicates

frigid ember
#

ok ima try it ty

vernal spruce
#

shouldnt be that hard to get into maps theyr rly usefull

halcyon snow
#

you should use the computeIfAbsent method for Maps.

humble spoke
#

how do i check if the cursor is holding an item in an InventoryClick event?

vernal spruce
frigid ember
#

no, since im storing 3 values basically

halcyon snow
#

@frigid ember I meant like this:

public class Main {

    public static void main(String[] args) {

    final Main main = new Main();

    main.addObject("test", new Object());
    main.addObject("test", new Object());
    main.addObject("test", new Object());

    System.out.println(main.objects.get("test")); // prints the 3 objects that were just added.

    }

    private final Map<String, List<Object>> objects = new HashMap<>();

    public void addObject(String key, Object object) {
    objects.computeIfAbsent(key, (unused) -> new ArrayList<>()).add(object);
    }

}
humble spoke
#

yeah i know that method but

frigid ember
#

ahh

#

ok

humble spoke
#

when i debugged and found out its simply an empty air itemstack and i tried to compare it to it with equals it just didnt work

halcyon snow
#

With the above, it should function similar to that hashmultimap.

humble spoke
#

oh wait the amount was like 0 i think

#

stupid me

vernal spruce
#

@humble spoke you can always check currentitem before checking cursor

#

to know if he clicked on a item

humble spoke
#

ah the thing is that inventoryclick for me runs before the item gets actually put into the thing

#

which is not preferred for me

vernal spruce
#

its a bit wanky using the event i saw inconsistency

humble spoke
#

so i just make a new item array with the chest ,and the replace the clicked item slot with the item i nthe cursor so i get the updated chest

vernal spruce
#

in some thing

humble spoke
#

interesting

ripe narwhal
#

can I have protocolib and viaversion on the same server

vernal spruce
#

test it and find out

ripe narwhal
#

I dont wanna destroy my server

#

thats why Im asking lol

humble spoke
#

If stuff goes wron just remove the plug in

ripe narwhal
#

fine

vernal spruce
#

i have a better ideea

#

simply do a local server lol

#

like everyone else testing stuff

frigid ember
#
        if(!dataMap.containsKey(uuid)) {```
#

@vernal spruce

#

but I have to store multiple

#

and doing this in my event doesnt make sence?

vernal spruce
#

basically its a simpler way to check if a set exists

#

if yes,take it and add it to the list

frigid ember
#

ohh

#

ok

vernal spruce
#

dataMap.get(uuid).add(new Data(stuff));

#

you can also simply do dataMap.get(uuid).size() to get the size of the set

#

so you can limit it to 3 as you wanted

frigid ember
#

and how do I remove oldest so 4th one when the player died 4 times

vernal spruce
#

also are you saving them somewhere?

frigid ember
#

wdym restart/reload save?

#

into .yml

#

ima do that when everything is finished

vernal spruce
#

to get oldest its a bit tricky

#

you can loop through all entrys in the set and stop at first

#

as it should be the 3rd in the newest

#
Set<Data> deaths = dataMap.get(uuid);
for(Data death : deaths){
death.remove(death);
break;
}
subtle bison
#

any idea why do i get:The method sendMessage(BaseComponent) in the type CommandSender.Spigot is not applicable for the arguments (ChatMessageType, TextComponent)

#

i worked for me normally

#

and still works in other plugins

#

is it because its an entity and not a Player?

frigid ember
#
        if(!dataMap.containsKey(uuid)) {
            Set<Data> death = new HashSet<>();
            death.add(new Data(e.getEntity().getLocation(), e.getDeathMessage(), System.currentTimeMillis()));
            dataMap.put(uuid, death);

        if(dataMap.containsKey(uuid)) {
            Set<Data> deaths = dataMap.get(uuid);
            for(Data deathts : deaths) {
                death.remove(deathts);
                break;
            }
            }
        }```
vernal spruce
#

it will always

frigid ember
#

but I still have to get the amount of times something is stored

vernal spruce
#

trigger the 2nd if

#

return at the end of first condition

#

i already told you dataMap.get(uuid).size() will return how many "Data" objects is in that set

frigid ember
#

ojj yea

subtle bison
#

anyone anything on my problem please?

vernal spruce
#

try casting it to a player

#

((Player)player).spigot()...

frigid ember
#
            Set<Data> deaths = dataMap.get(uuid);
            for(Data deathts : deaths) {
                death.remove(deathts);
                break;
                }```
vernal spruce
#

yep

frigid ember
#

and this will remove all info about the player?

vernal spruce
#

that should remove the oldest

#

death

frigid ember
#

ohh oldest

#

perfect

#

thanks

#

ima try it

vernal spruce
#

as it goes in a row

#

0-1-2 so 0 will go first in the loop

#

then 1 becomes 0 and so on

frigid ember
#
        if(dataMap.containsKey(uuid)) {
            Integer uuidsize = dataMap.get(uuid).size();
            if (uuidsize == 4) {
                Set<Data> deaths = dataMap.get(uuid);
                for(Data deathts : deaths) {
                    death.remove(deathts);
                    break;
                }
            }
            }```
#

result

fringe shore
#

Hello i am coding a minecraft plugin and here is the code it is for 1.15 using java 1.8 ``` package me.EpicGamese.HelloWorld.Events;

import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerMoveEvent;

public class EventsClass implements Listener {

@EventHandler
public void onMove (PlayerMoveEvent event) {
    System.out.print(1);
}

}

frigid ember
#

ok

fringe shore
#

and when i move it says can not find org.bukkit.event.Listener but it is there as u can see

vernal spruce
#
        if(dataMap.containsKey(uuid)) {
            Integer uuidsize = dataMap.get(uuid).size();
            if (uuidsize == 4) {
                Set<Data> deaths = dataMap.get(uuid);
                for(Data deathts : deaths) {
                    death.remove(deathts);
                    break;
                }
            }
            }```

@frigid ember you can shorten it

subtle bison
#

Stellrow thx works perfectly now!:)

vernal spruce
#

simply do if(dataMap.get(uuid).size()>=4{stuff}

humble spoke
#

is there like a post inventory click event that fires after the item gets put into the inventory or something like that?

frigid ember
#

ahhh ok

#

true

#

thanks

vernal spruce
#

@humble spoke normally it should also fire again

#

like puttin a item from a chest to inventory shouldbe 2 events

humble spoke
#

it doesnt seem to fire twice for me

vernal spruce
#

yeah its bit inconsistent

#

maybe the inventory check is wrong?

#

i often forgot that once clicked in player inventory a inventorycheck above wont trigger

humble spoke
#

wdym

vernal spruce
#

if(event.getclickedinventory.equals(specificinventory))

humble spoke
#

ah

#

well i only need to focus on the top inventory

#

so if that woulnt run i wouldnt be missing out too much

#

also yeah it doesnt seem to fire twice

#

the event

frigid ember
#

still only sends the oldest info

#

so which is stored first

fringe shore
#

can i havse some help

frigid ember
#

ohh wait ima try somet

fringe shore
#

???

vernal spruce
#

?ask ..

worldly heathBOT
#

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.

fringe shore
#

when i move the player it says it is unable to find org.bukkit.event.Listener; but here in the code it is there package me.EpicGamese.HelloWorld.Events;

import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerMoveEvent;

public class EventsClass implements Listener {

@EventHandler
public void onMove (PlayerMoveEvent event) {
    System.out.print(1);
}

}

#

import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerMoveEvent;

public class EventsClass implements Listener {

    
    @EventHandler
    public void onMove (PlayerMoveEvent event) {
        System.out.print(1);
    }
}
vernal spruce
#

did you also registered the event?

fringe shore
#

yep here is the main.js file

#

import org.bukkit.plugin.java.JavaPlugin;

import me.EpicGamese.HelloWorld.Events.EventsClass;
import net.md_5.bungee.api.ChatColor;

public class Main extends JavaPlugin {

    public void onEnable() {
        getServer().getConsoleSender().sendMessage(ChatColor.GREEN + "\n\nHelloWorld has been Enabled!\n\n");
        getServer().getPluginManager().registerEvents(new EventsClass(), this);
    }
    
    public void onDisable() {
        getServer().getConsoleSender().sendMessage(ChatColor.RED + "\n\nHelloWorld has been Disabled!\n\n");
    }
    
}

vernal spruce
#

wait doesnt find the import?

#

you got the right api?

fringe shore
#

yep

#

it doe find org.bukkit.event.Listener;

#

that is what it says in console

#

cant find import org.bukkit.event.Listener

vernal spruce
#

post the console error

fringe shore
#

will do

vernal spruce
#

hmm looks like its typed in there ngl

fringe shore
#

its no but ok

vernal spruce
#

Also why you want to work

#

with moveevent its the most delicate thing you can test on..

#

as it called a huge amount of times

fringe shore
#

i dont know i wanted to see if i could crash my server

vernal spruce
#

well that might be why is it even stopping you

fringe shore
#

with my own plugin

#

ok well i will create somthing else with it and see if it comes up with the same error bye and thanks for the help

subtle bison
#

there isnt EntityMoveEvent but is there anything similar to that?

vernal spruce
#

nope

#

if there is one is simply hidden

#

as tracking the movement of 50k entities will kill pretty much everything

#

you might be able to do a workaround though

#

what you trying to do

subtle bison
#

im trying to stop the entities

#

ive thought of bukkit runnable

vernal spruce
#

might work

#

you could loop all entities in the world and check locations

subtle bison
#

i only wanna stop hostiles so yeah that might make it less laggy

vernal spruce
#

i mean you cant rly track entities that easly

#

you might even be able to do it async

subtle bison
#

ohhh

#

true

north hamlet
#

I need help with voting plugin and get it 2 work, it dosen't give out rewards 20$ to whoever has the time today 2 help out.

frigid ember
#

StellRow

vernal spruce
#

?

frigid ember
#

it only sends the first one

vernal spruce
#

yeah i was afraid of that

#

time to simply change to list

#

as it has the methods ,get(index),remove(index),set(index)

#

so you can simply go to that entry

#

set sadly lacks

frigid ember
#

.get(uuid) will get the info

half badge
#

What are you trying to do?

frigid ember
#

but not all

#

not all 3

vernal spruce
#

post how you created the hashmap

frigid ember
#

private final HashMap<UUID, Set<Data>> dataMap = new HashMap<>();

vernal spruce
#

good,also that final is not really needed

frigid ember
#

main

opal heron
#

whats the papi for a date that doesnt have time?

vernal spruce
#

@frigid ember switch the set to a list

opal heron
#

My papi holds y/m/d 1:00 something and i want it to get rid of the time

vernal spruce
#

have you checked papi wiki at least?

opal heron
#

Yep

#

most of the LocalTime expansion arent working

#

im using %localtime_time%

frigid ember
#
            List<Data> death = new HashSet<>();```
#

what should I change HashSet to

halcyon snow
#

likely ArrayList

frigid ember
#

since its not a set anymore

#

ok

vernal spruce
#

there you go a object wich does what you need

#

now simply make a HashMap<UUID,PlayerDeaths>

#

this should be loaded/created when a player joins the server

bold anchor
#

He can just use an ArrayListMultiMap

vernal spruce
#

i think he would have the problem again with that

#

he wants to get oldest entry

undone dome
#

Hello, is there a way to find out from which direction a block is mined (so not just where the player is standing relative to it but what side of the block is attacked)?

vernal spruce
#

@undone dome well you will have to make a connection between blockbreak and interactevent

#

as only interactevent holds the face clicked

undone dome
#

thank you

vernal spruce
frigid ember
#

no stellrow

#

I need the 3 newest entries

#

oldest can be removed

#

idc about those

#

when a newer one joins in the newdeath->0 0->1 1->2 3->removeddeath

vernal spruce
#

And thats what i said,you need to know wich one is the oldest that its gonna be removed when the limit reaches

frigid ember
#

so this?

subtle bison
#

what is the bukkit name for hostile mobs?

vernal spruce
#

instanceof Monster

subtle bison
#

lmao new to bukkit

#

oh ty

vernal spruce
#

@frigid ember yes,now you have acces to index numbers(entrys)

#

The list should fill up from 0 meaning 0 will always be the oldest

#

So when the size is more than 3 simply call .remove(0)

subtle bison
vernal spruce
#

You should raise that timer a bit

#

This will be called 20 times a second..

tiny dagger
#

field names should start with a lowercase

subtle bison
#

i know but if i do like 4 times it already makes the mobs able to move a bit

dusky sigil
#

So i want to make it so if the player enters a command it asks the player if he's sure and the player needs to enter the command again. How do i do that?

tiny dagger
#

@subtle bison that's not very good imo

subtle bison
#

instead of having the player type the command 2 times you could make them click the message to confirm

#

Ronsiv

dusky sigil
#

Good idea

#

thanks

vernal spruce
#

@subtle bison you want every hostile mob to not be able to move?

subtle bison
#

yeah lmao

vernal spruce
#

You can listen to creaturespawnevent and set the base movement speed to 0

subtle bison
#

ohhhh

frigid ember
#
        if(!dataMap.containsKey(uuid)) {
            List<Data> death = new ArrayList<>();
            death.add(new Data(e.getEntity().getLocation(), e.getDeathMessage(), System.currentTimeMillis()));
            dataMap.put(uuid, death);

        if(dataMap.containsKey(uuid)) {
            if (dataMap.get(uuid).size()>=4) {
                List<Data> deaths = dataMap.get(uuid);
                //for(Data deathts : deaths) {
                    deaths.remove(0);
                    //break;
                    //}
                }
            }
        }```
#

Stellrow?

vernal spruce
#

Return after first condition

frigid ember
#

return;?

tiny dagger
#

try instead

dusky sigil
#

how can i set the ClickEvent of a message to call a method?

#

or do i have to make a command?

tiny dagger
#

List<Data> something = dataMap.get(uuid);
if (something != null && something.size >= 4) {
//do your thing
}

#

save performance 👀

#

and clean the code a bit

subtle bison
#

Ronsiv you have to make a new TextComponent

frigid ember
#
                    for (Data data : dataMap.get(uuid)) {
                            player.sendMessage(applyCC("&6World:&f " + data.getLocation().getWorld().getName()));
                        this.cooldown.put(player.getUniqueId(), now);
                        System.out.println("1");
                        return true;
                    }```
#

what do I do to print the info about the whole list instead

#

well

#

message

#

not print

subtle bison
#

TextComponent something = new TextComponent(yourString);
something.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "your command"));

(doesnt have to be RUN_COMMAND)

#

@dusky sigil

#

you will figure out how to add hover event etc.

vernal spruce
#

stellrow did you mean it this way?
@subtle bison LivingEntity liv = (LivingEntity)event.getEntity(); liv.getAttribute(Attribute.GENERIC_MOVEMENT_SPEED).setBaseValue(0);

#

No need for a runnable here

frigid ember
#

stellrow :p

subtle bison
#

okay didnt know that was a thing

blazing burrow
#

how would i access an item in getDrops()?

#

because it returns a collection

frigid ember
#

collection of items

subtle bison
#

you want to set a drop?

frigid ember
#

which event

subtle bison
#

probably EntityDeathEvent

blazing burrow
#

nope i just want the drop

#

like what it would drop

frigid ember
#

event?

blazing burrow
#

and get its type

subtle bison
#

maybe do getDrops().toString()

#

or toArray()

frigid ember
#

@vernal spruce How would I send info about the whole list to the player

#

instead of first thing stored

blazing burrow
#

new ItemStack(event.getBlock().getDrops()., ThreadLocalRandom.current().nextInt(1000) what would i put after the getDrops(). ?

subtle bison
#

new ItemStack(event.getBlock().getDrops().toString(), ThreadLocalRandom.current().nextInt(1000)
may be your new line

#

thats my only idea its probably not gonna work tho

blazing burrow
#

yeah it doesnt

#

itemstacks first param needs the type/material

subtle bison
#

wait

#

why are you putting the getBlock()

#

i dont think that should be there

#

just event.getDrops()

#

if your event is BlockBreakEvent

blazing burrow
#

its BlockBreakEvent

#

oh ook

north hamlet
vernal spruce
#

@frigid ember make a mehod inside the data class wich returns the full info "location death reason" the simply loop through all entrys in the list and send that info to the player

blazing burrow
#

@subtle bison no you need to do get block it doesnt let me do event.getDrops()

subtle bison
#

yeah just tested it too

frigid ember
#
    public Data(Location location, String reason, long time) {
        this.location = location;
        this.reason = reason;
        this.time = time;
    }```
#

so Data

#

@vernal spruce

blazing burrow
#

how do u select an element in a collection then?

subtle bison
#

@blazing burrow you could get the block type and then get the drops of that block type

#

if you still wanna get the drops

blazing burrow
#

but dropItemNaturally() needs a type tho

#

which is the function im using

subtle bison
#

so what do you need the list of drops for then

#

you can create a new itemstack if you want custom drops

frigid ember
#

what Atin?

#

just use an itemstack indeed

#

dropItemNaturally(new ItemStack(), loc)

dusky sigil
#

Why is this not working? java dismessage.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/f disbandabcttyejs")); dismessage.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder("Click Here to disband").color(ChatColor.GRAY).italic(true).create())); p.spigot().sendMessage(dismessage); factionname = args[1]; and than: java if (label.equalsIgnoreCase("f disbandabcttyejs")) { cfgtotal.set("faction." + factionname, null); p.sendMessage(ChatColor.GREEN + "Your faction has been disbanded. So long!"); try { cfgtotal.save(filetotal); } catch (IOException e) { e.printStackTrace(); } }

#

also factionname is a public string

#

I click the message and nothing happenes

subtle bison
#

any errors?

dusky sigil
#

nope

frigid ember
#
                    for (Data data : dataMap.get(uuid)) {``` I'm already looping through all info? @vernal spruce
subtle bison
#

is /f disbandabcttyejs the correct command?

dusky sigil
#

yeah

#

i copied it

subtle bison
#

player.sendMessage(ChatColor.GRAY + "World " + ChatColor.WHITE + worldName + ChatColor.GRAY +
" doesn't exist. Please specify and existing world.");
TextComponent worldOffer = new TextComponent("Click here if you would like to create a new world " + worldName);
worldOffer.setColor(net.md_5.bungee.api.ChatColor.GRAY);
worldOffer.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/newworld " + worldName));
worldOffer.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/newworld " + worldName));
worldOffer.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT,
new ComponentBuilder("Click here to create a new world " + worldName).color(net.md_5.bungee.api.ChatColor.YELLOW).create()));
player.spigot().sendMessage(worldOffer);
return true;

#

this is my code

#

works fine

umbral dirge
#

How do i kick a player if he sends an explicit message

dusky sigil
#

@subtle bison the message gets sent, when i click nothing happens

subtle bison
#

@umbral dirge player.kickPlayer(playerName);

frigid ember
#

& when you hover?

dusky sigil
#

yeah, works too

blazing burrow
#

no what im trying to do is whenever a player breaks a block it drops a block and the drops are randomly from 0 to 1000

umbral dirge
#

nvm

blazing burrow
#

ItemStack drop = (ItemStack) event.getBlock().getDrops().iterator().next();
would this work

umbral dirge
#

got it

frigid ember
#

no

#

tf is that

#

ohh

lone fog
#

Use blockDropItemEvent

frigid ember
#

why would you format it like that

subtle bison
#

@dusky sigil then the problem probably isnt with the clickable message but with your code

#

the code u use to disband a faction

blazing burrow
#

idk man i looked online and thats what they suggest with java collections

dusky sigil
#

the code to disband a faction is very simple

#

and it still should send a message

lone fog
#

Maybe remove the /

#

Don’t remember if you need it or not

dusky sigil
#

i tried now

#

and

#

well

#

it kinda sudo's you lol

#

its prob a problem with my code hold on

subtle bison
#

yeah if you remove it its like player.chat

frigid ember
#
                    for (Data data : dataMap.get(uuid)) {``` I'm already looping through all info? @vernal spruce

@frigid ember but maybe this only gets the first info somehow?

dusky sigil
#

maybe i cant set a config key to null?

subtle bison
#

@blazing burrow ItemStack is = new ItemStack(Material.DIAMOND, 64)

frigid ember
#

which would be weird

subtle bison
#

@dusky sigil yeah thats probably the problem

blazing burrow
#

@subtle bison what

subtle bison
#

thats how you create an itemstack

blazing burrow
#

yeah no i know that

dusky sigil
#

oh

#

i know whats the problem

#

it is so stupid it must not be told

blazing burrow
#

what im trying to do is using an item stack cast to get the first element in the collection of items returned by getDrops()

frigid ember
#

dropItemNaturally(new ItemStack(e.getDrops()), e.getPlayer.getLocation());

odd knoll
#

You can probably to .toArray on the collection.

subtle bison
#

i told him and it probably dint work

lone fog
#

dropItemNaturally(new ItemStack(e.getDrops()), e.getPlayer.getLocation());
No

odd knoll
#

ItemStack first = event.getDrops().toArray()[0]

Although I don't see a that practical use to it.

subtle bison
#

oh

blazing burrow
#

no @frigid ember itemstack needs a type getdrops returnd a collection

frigid ember
#

.getType()

lone fog
#

Is e.getDrops.get(0) not valid

blazing burrow
#

yo

#

guys

frigid ember
#

if you can do that atleast

blazing burrow
#

i tried my thing it works XD

odd knoll
#

get(int index) only exists on lists IIRC.

blazing burrow
#

ItemStack drop = (ItemStack) event.getBlock().getDrops().iterator().next();
this made it work

silver pewter
#

Hello, what's the best way to look trough a folder to grab all the files and find the correct data thanks

frigid ember
#

Coll

lone fog
#

It should exist in other collections I assume

frigid ember
#

my main class

lone fog
#

Not HashSet though

odd knoll
#

Files.walk(Path path) works. There's also a list files method on a File IIRC.

subtle bison
#

@silver pewter i dont think its hard you can look it up

frigid ember
#

I need to send the player info about his last 3 deaths

#

but it isnt working

silver pewter
#

I've done this java for (File file : new File(plugin.getDataFolder().getAbsolutePath() + File.separator + "GuildsData").listFiles()) { YamlConfiguration conf = YamlConfiguration.loadConfiguration(file); return new ConfigManager(conf.getString("name") + ".yml", plugin.getDataFolder(), "GuildsData", plugin); } but It's returning null

frigid ember
#

it only sends info about the first storement

lone fog
#

I’m surprised that works at all

frigid ember
#

;?

lone fog
#

Ah wait no that makes sense

odd knoll
#

Files.walk(plugin.getDataFolder().toPath().resolve("GuildsData")) if you don't mind a stream

lone fog
#

Remove the return true; from inside the loop that prints deaths

silver pewter
#

I don't mind a stream lol

odd knoll
#

I'm on mobile so lemme go screen some code rq.

#

Stupid GitHub says no coz you can't resize 😐

frigid ember
#

ok

#

ill try

silver pewter
#

Haha thanks for this I've never got all the files before so It's something new

frigid ember
#

still only sends whats stored first @lone fog

blazing burrow
#

okay guys i have a problem, now if i break grass blocks it drops dirt which is fine that was the problem i was trying solve earlier, but if i break spruce logs, it drops oak logs?

lone fog
#

Are you in old version

frigid ember
#

1.16

blazing burrow
#

1.16

lone fog
#

Weird

silver pewter
#

I'm using 1.8.8

subtle bison
#

@blazing burrow try setting and api-version maybe

blazing burrow
#

wait what

frigid ember
#

code 1.16 and make it compatible with 1.8.8

#

😉

silver pewter
#

It works better if you code 1.8 then it works with 1.16

dusky sigil
#

last thing didnt really work, but i have this config: ```yml
factions: ''
players:

  • dfac08af-af88-42ff-8509-8f441bca858b
    factionnames:
  • test
    faction:
    test:
    leader: dfac08af-af88-42ff-8509-8f441bca858b
    Members: 1
    MemberNames:
    • dfac08af-af88-42ff-8509-8f441bca858b
      and im doing this: cfgtotal.set("faction." + factionname, null); i looked it up and it SHOULD delete all of the test: making the config look like this:yml
      factions: ''
      players:
  • dfac08af-af88-42ff-8509-8f441bca858b
    factionnames:
  • test
    faction:
frigid ember
#

@lone fog

lone fog
#

You aren’t adding to the list if it already exists

subtle bison
#

@dusky sigil can we see the code in which you are removing it?

frigid ember
#

ohh

dusky sigil
#

you already saw it but sure java cfgtotal.set("faction." + factionname, null); p.sendMessage(ChatColor.GREEN + "Your faction has been disbanded. So long!"); try { cfgtotal.save(filetotal); } catch (IOException e) { e.printStackTrace(); } }

lone fog
#
            List<Data> deaths = dataMap.get(uuid);
            if (deaths.size() >= 4) {
                deaths.remove(0);
                /*for(Data deathts : deaths) {
                    break;
                    }*/
                }
            }
        }```
dusky sigil
#

factionname should be correct

lone fog
#

That part

frigid ember
#

I see :/

silver pewter
#

What's his issue?

frigid ember
#
        if(dataMap.containsKey(uuid)) {
            death.add(new Data(e.getEntity().getLocation(), e.getDeathMessage(), System.currentTimeMillis()));
            List<Data> deaths = dataMap.get(uuid);
            if (deaths.size() >= 4) {
                deaths.remove(0);```
#

so this should fix it

#

ima try

lone fog
#

No

#

Add it to the deaths list you get

frigid ember
#

ok

lone fog
#

And then map.put it again

dry horizon
#

I know this isnt coding but with the /server command, can you send other players? Like /server lobby glassykiller

frigid ember
#

yes

odd knoll
#

It has a separate command iirc, so I don't think it works with /server (might tho). /Send.

blazing burrow
#

@subtle bison wdym setting and api version

dry horizon
#

Thank u

subtle bison
#

@blazing burrow in plugin.yml put
api-version: 1.13

#

@dusky sigil i think i see your problem

dusky sigil
#

Im listening

blazing burrow
#

name: RandomMC version: 1.0 author: AtinChing main: me.atin.rand.Second commands: random: aliases: [randomit]
so would it be before or after version or what @subtle bison

frigid ember
#

now it sends the first info twice

subtle bison
#

it doesnt matter ating

#

fe after

blazing burrow
#

ok

subtle bison
#

@dusky sigil wait is it stored in config.yml?

lone fog
#

Change the second if to an else if

dusky sigil
#

@subtle bison nope

#

file's called factionsandplayers.yml

subtle bison
#

of then im not sure

dusky sigil
#

i watched it obvs

#

it also wont help

frigid ember
#

works coll

#

tysm

subtle bison
#

ronsiv you just need to get into your filed and then do
.getStringList("faction").remove("test");

dusky sigil
#

hmm

#

ill try that

#

wait

#

no

#

i just add test

#

its not an ArrayList

subtle bison
#

well i know

#

but thats what im assuming it would look like base on this.getConfig()