#help-archived

1 messages · Page 160 of 1

frigid ember
#

Cheese sticks >:O someone did some modding and redistribute it without sticking to the license

lapis plinth
#

Is there a way to get a users username based on their UUID?

nimble stump
#

mojang api

lone fog
#

Online or offline?

lapis plinth
#

Online

#

like getUserFromUUID(string uuid) or something like that

lone fog
#

Bukkit.getPlayer(uuid).getName()

lapis plinth
#

kk

clever bobcat
#

Is there an API to create clickable messages? Aka send a message to a player which will, if clicked, execute a command?

lone fog
#

Yes

#

ChatComponent API I believe it is called

clever bobcat
#

Awesome, thanks a bunch, I'll check it out

lone fog
#

Can be used with player.spigot.sendMessage

cerulean gust
#

TextComponent

small bobcat
#

is clearlagg helpful?

lone fog
#

Yes TextComponent is one of them

#

Eh it depends

small bobcat
#

alright

#

also is there a way to reduce entity lag

lone fog
crimson sandal
#

Anyone know how to use NMS in travis ci builds? I'm guessing you run BuildTools for each version being used but how do you cache the repos and prevent them it from running BuildTools every commit?

opal heron
#

Can you get a past skin from a user?

#

let's say i want the player skull of a user. I want his previous skin. Is there a way to get it?

#

i don't mess with UUID that much so idk

neat oxide
#

@crimson sandal you can't really it's quite difficult

#

You can try run build tools hope it installs to maven correctly then build

marsh thicket
#

for some reason skeletons and zombies without head armor in clear weather during the day are not burning up

#

anybody have this issue?

bright forge
#

Hi, is there a resource section in the forums to publish bungeecord forks? Because last time i checked i didn't found any

old barn
#

what would you recommend to host around 150 players?

marsh thicket
#

depends on what you plan to run on your server

old barn
#

Factions, with around 50 plugins

odd knoll
#

On the PlayerFishEvent, how can I tell if a player has hooked an item on the ground or gotten it out of the water? Is there any way other than tracking who has their hook in water?

bright forge
#

@old barn 4 cores 3 ghz 2gb ram depends on the plugins tho i run fully custom and optimized on ram usage so i dont have to assign much

old barn
#

VPS?

bright forge
#

as i said, 4 cores with 3ghz or better 2gb ram or more

#

vps tends to have less ghz than dedicated which is bad for minecraft hosting

#

and make sure your hosting has antiddos and + 500mbps bandwidth

old barn
#

Do you have a dedicated one?

bright forge
#

yeah

#

i run 300 players

old barn
#

Is there a lot of price difference for a vps?

bright forge
#

yes

#

vps is cheap but is trash

#

dedicated is expensive but really worth it

#

if it is a serious project and you are going to invest your money get a dedicated

#

OVH

old barn
#

Do you recommend me where I can buy a dedicated one?

bright forge
#

its the one i personally prefer

#

vps is only good for small applications

odd knoll
#

^^

I use Hetzner for testing (testing ONLY, the have bad ddos prot) then go to OVH or so you start depending on how much ddos prot or performance I need for production.

old barn
#

When installing a minecraft server on dedicated, is it difficult?

bright forge
#

no

#

just put the jar on a folder and do
cd <folder>
java -jar <jarname>.jar

odd knoll
#

And screens.

bright forge
#

if you want to run different instances you can use screens

odd knoll
#

On the PlayerFishEvent, how can I tell if a player has hooked an item on the ground or gotten it out of the water? Is there any way other than tracking who has their hook in water?
btw from earlier ^^

bright forge
#

Create or enter a screen
screen -x <nameofscreen>
Leave a screen
control + a + d
Remove a screen
screen -k <nameofscreen>

#

screens are like windows were you have different "console terminals"

#

but they arent really windows

crimson sandal
#

Hmm how come BuildTools isn't installing CraftBukkit 1.16.1 to my local maven repo?

old barn
#

And this dedicated, would it support a bungeecoord?

bright forge
#

yes

old barn
#

I'm new to this, would you recommend a website to buy a dedicated one?

harsh anvil
#

Ovh, digital oceaan

#

Dedis aren't cheap tho

old barn
#

@bright forge Have I seen your server, does your dedicated handle the entire server, or do you have more than one dedicated?

bright forge
#

I have only one dedicated

#

but remember that i code my own plugins

#

so i can run a bunch of stuff

#

because its prepared and optimized to my likes

#

some servers prefer using more ram to prevent cpu usage

#

others prevent using less ram and more cpu

#

and me i prefer having a middle ground

odd knoll
#

Cache it all. Yum

odd knoll
#

I've already looked.

lone fog
#

Caught entity is for hooking anything that is already spawned

odd knoll
#

I only accept CAUGHT_FISH and CAUGHT_ENTITY for catching fish and enchant books.

#

Caught entity is for hooking anything that is already spawned
from my testing not at least.

lone fog
#

I mean that’s what it says

#

public static final PlayerFishEvent.State CAUGHT_ENTITY
When a player has successfully caught an entity. This refers to any already spawned entity in the world that has been hooked directly by the rod.

odd knoll
#

Hmm. wtf lol

#

Wait, caught_fish isn't necessarily a fish loll

#

Ok, thx. My code should be good now.

crimson sandal
#
[ERROR] Failed to execute goal on project ChestsPlusPlus-Master: Could not resolve dependencies for project com.jamesdpeters.minecraft.chests:ChestsPlusPlus-Master:jar:1.5-BETA-3: Failure to find org.spigotmc:plugin-annotations:jar:1.2.3-SNAPSHOT in https://oss.sonatype.org/content/repositories/snapshots/ was cached in the local repository, resolution will not be reattempted until the update interval of sonatype-snapshots has elapsed or updates are forced -> [Help 1]
``` Anyone any idea what's causing this on my travis build? Hmm
patent monolith
#

Is there a way to reopen an issue on Jira?

woven whale
#

Hi friends, is the spigot documentation down? I was able to load everything yesterday but now I keep getting 404 error for all members pages

hardy cedar
#

@hardy cedar You can try java Bukkit.getScheduler().scheduleSyncDelayedTask(<plugin>, <Runnable>, <timeInTickToDelay>);
@lofty meadow didn't work :/

lofty meadow
#

Did I sent you a further message below it?

hardy cedar
#

No

#

I wasn't on after bc my internet has finished

#

.___.

lofty meadow
#

Ohh, yeah right. It already

#

What the error?

hardy cedar
#

It doesn't even work on eclipse lop

#

Lol*

#

I mean by that

#

The runnuable field

#

0of my internet took time to send that

wet bronze
#

Guys

#

Is there a plugin to find the location of chunks that are straining the server?

lofty meadow
#

At <Runnable> do 'new Runnable() {...}' and then you will get an @Overwite funtion, everything in than function will run in the next <timeInTickToDelay>

wet bronze
#

Because my server is getting immense TPS lag from a large chunk and I can't find it.

hardy cedar
#

What about the plugin field@lofty meadow

#

?

lofty meadow
#

Your main class

wet bronze
#

Somebody help I have a large community and my server is unplayable.

hardy cedar
#

Because my server is getting immense TPS lag from a large chunk and I can't find it.
That's weird lol

wet bronze
#

I can send you the error log.

#

Here are two instances.

hardy cedar
#

Did you change the server version

wet bronze
#

Yes but over a week ago.

#

The server was fine literally an hour ago.

hardy cedar
#

Your now on 1.16

wet bronze
#

Yes.

#

The issue is not coming from 1.16 though.

hardy cedar
#

Idk i can't figure out the problem.
There's no info lol.

#

@lofty meadow i did a public static Plugin plugin

#

What else can i do

#

The scoreboard class can't resolve the variable 'plugin'

crimson sandal
#

Oh sweet I just wrote a script that checks the travis cache if BuildTools has already installed craftbukkit. I think I'll make a forum post on it later

hardy cedar
#

Ok fixed this still not working 😒

spiral gale
#

im new to spigot what should i download for 1.16

lone fog
#

?bt

worldly heathBOT
spiral gale
#

thank you

#

oh its a bot

restive elk
#

how do i change the lore of an anvil result itemstack?

buoyant path
#

when you do java config.set("test", itemStack); will it save the NBT?

lone fog
#

PrepareAnvilEvent#setResult

lofty meadow
#

Ok fixed this still not working 😒
@hardy cedar Hmm, I don't know

hardy cedar
#

I feel scammed bc of java

			public void run() {
				p.setScoreboard(b);
			}
			
		}, 20L, 3);```
#

Lol

#

I did a repeat task

#

AND wow

#

Also did not work

#

Awesome

#

👍

lone fog
#

Not sure setScoreboard is safe to run async

hardy cedar
#

I don't get any errors in the console

lone fog
#

Hmm maybe it is then

#

Not sure why you need to keep setting the board though, just update it

hardy cedar
#

Wait what's difference

#

?

lone fog
#

You can just set the score or change team prefixes or whatever without setting the scoreboard again

spiral gale
#

ok... u have no idea what im doing

#

i*

hardy cedar
#

You can just set the score or change team prefixes or whatever without setting the scoreboard again
Also didn't work

#

@spiral gale u have a host?

spiral gale
#

no

halcyon snow
#

@buoyant path it should yes.

hardy cedar
#

@spiral gale so find a good Minecraft host with good rams

lone fog
#

“Good rams”

#

CPU is generally more important

hardy cedar
#

“Good rams”
Enough* duuh

#

CPU is generally more important
I was typing

#

:(

buoyant path
#

@halcyon snow hopefully

#

I dont wanna store goddamn serialized shit in my code lol

lone fog
#

I mean that just sets the same value every time it runs

#

So of course you won’t see a change

hardy cedar
#

Wdym there is placeholders that doesn't update

#

Tho

#

It updates on other action i did with GadgetsMenu

#

When i open the menu

#

And it's fine

#

by setting the scoreboards

#

So there's no way to fix it

#

That's just kewl thx java

lone fog
#

I mean making a scoreboard plugin isn’t that hard

#

But I’m not sure what you’ve done for yours

hardy cedar
#

Wanna see the full class

#

?9

#

It's not big

#

That's it

#

I spammed giving the scoreboard in many different ways

#

But I’m not sure what you’ve done for yours
I believe that java hates me all that entire time but it doesn't want to show that for anyone 😭 😂 😂 😂

marsh hawk
#

Does my proxy need to point to a public IP? currently have it pointing to a local IP which is port forwarded

hardy cedar
#

Wdym a public ip? Like a domain?

marsh hawk
#

your public ip..

#

like external ip

hardy cedar
#

It doesn't matter that much i mean both work right?

marsh hawk
#

idk thats why im asking lol

#

it works fine for me but thats because im on the lan

hardy cedar
#

U must point to your ipv4

frigid ember
#

Is there a villager trade event?

marsh hawk
#

i had it pointing to my fqdn but since i got my router i haven't setup a nat hairpin yet so it doesn't work

#

thus why i need to point it to my local ip

hardy cedar
#

Ok i found some thing confusing me rn

#

I just found that

#

When i update the scoreboard

#

by setting it

#

It just makes everything (placeholder) 0

#

even if I updated it

#

With another event

#

Lol

#

My brain cells are destroyed

#

👍 😂

woven whale
#

Hi guys, may I know how I can get the tone number for a noteblock? The getTone() method only returns something like ABCDEF, but I want an integer ranging from 0 to 24. Thanks!

hardy cedar
#

Idk if that's possible but u can do that if the value is ABCDEF u can return it to what ever u want

#

If it's not

woven whale
#

Problem solved by using reflection XD. Thanks anyway bro

hardy cedar
#

Oh xd

frigid ember
#

how come when i use build tools latest it doesn't install 1.16.1 it creates a 1.15.2 spigot

lone fog
#

--rev 1.16.1

frigid ember
#

why does it not do it with --rev latest

lone fog
#

1.15 is still marked as latest until 1.16 is considered stable

frigid ember
#

ah ok

#

thanks

#

is it still pretty unstable or just some small problems

candid prawn
#

where to go for the list of latest spigot updates for build?

frigid ember
candid prawn
#

I think so, but looking for a list of what the latest build updated specifically? Already downloaded it, just want to see what exactly is changed from build to build

frigid ember
#

Oh

#

Hmm

quartz trench
#

CraftBukkit Bukkit and Spigot

frigid ember
#

oo

candid prawn
#

@frigid ember thank you

frigid ember
#

Yw

frigid ember
#

hello

magic onyx
#

is there any way to check the armor defense attribute immediately after equipping armor? (same tick)

tiny dagger
#

doubt

#

really annoying how the attributes need a second

#

to catch up

#

very hard to just do checks lol

magic onyx
#

welp

knotty karma
#

is there an event that fires when a respawn anchor/bed is used, that could be cancelled to prevent an explosion?
or would i need to use BlockExplodeEvent and PlayerInteractEvent independently?

magic onyx
#

can you grab the armor defense points/toughness from anywhere

finite belfry
#

is there any plugin that you can hide nametags?

sharp storm
#

hm, if you mean player name plates you might be able to use packets

#

also

#

question about resource packs, gang

#

I have a resource pack which is set in 1.15.2 and some blocks seem to be bugging out at random

#

right now it does not seem to have a pattern - the redstone ore and cobblestone wall are the famous pink/black block, and I have not modified the textures or models for either of these

#

kinda confused as to what i can do as I have not modified anything related to these, is it just some sort of corruption?

proper cairn
#

Can somome run me through this onclick function cant really figure out the logic

dark shuttle
#

you didnt register your listener

proper cairn
#

Well yes I know that haha

#

Player player = interact.getPlayer() im finding that weird im used to creating objects by Player player = new player() but it works different when working with this API so basically what is the player reference doing?

hot girder
#

Why are you using Swing? xd

proper cairn
#

I just realized that I must've accidentally imported

hot girder
#

What are you trying to do?

#

sorry for my bad english xd

rotund orbit
#

How do I remove a # of items from a player's inventory?

#

Trying to do it with 'player.getInventory().remove(main.getCurrency(amount));'

#

maybe its removeItem()...

#

it was removeItem()

stark oxide
#

I am trying to do a plugin for manhunt, and to test things I created a really simple plugin that just reacts to one command. When I start my server, the console says mapping values are not allowed here, and there is a pointer pointing to the colon after commands. What is wrong?

main:com.steeric.manhunt.Manhunt
name:Manhunt
version:0.0_Alpha
author:Steeric

commands:
  test:
inland oxide
#

spaces after colons?

stark oxide
#

that´s what i initially thought, but no

inland oxide
#

add them and for version put in single quotes

stark oxide
#

oh so you need spaces after colons?

inland oxide
#

name is usually first

stark oxide
#

okay, lets try it

inland oxide
#

also you could add a description: field to the command test

rotund orbit
#

my plugin.yml has name, version, author, main and api-version

bleak cipher
#

you need spaces after colons @stark oxide \

#

this is not a valid yaml syntax

#

@inland oxide order doesn't matter

inland oxide
#

just setting good habits

#

make sure you have something under the test:

stark oxide
#

okay, I'll try that too, but now I think it loaded the plugin successfully

#

yeah, it works now, thanks

rotund orbit
#

How would one color certain sections of a map based on chunks? I want to show my players what chunks they've claimed near them but I'm not sure what they best way to do this would be.

wraith thicket
#

You need to convert the world coordinates to the map coordinates and then render using a MapRenderer

lofty meadow
#

Anyone can help me install java 11 on linux, ubuntu manually? I've done from almost every help on internet, but when I execute command java -version it always say java: error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory

wraith thicket
#

Perhaps that'll be of help?

frigid ember
#

how would I make "+plugin.counter.Count.get(uuid)+" to a $steps variable for in the config

wraith thicket
#

What?

frigid ember
#

p.sendMessage(applyCC("&cHello you currently have "+plugin.counter.Count.get(uuid)+"!"));

#

I want the message to be configurable in the config.yml

#

but I don't want them to have to say "+plugin.counter.Count.get(uuid)+"

wraith thicket
#

YAML will not be able to execute java methods for you

frigid ember
#

nah

#

but thats not my question

#

I still have to make it a custom message

inland oxide
#

so you need to read the string from the config, and in that string, have a placeholder that you would replaced with the count when you send the message

wraith thicket
#

Sure - make a custom message. Have it in the config with a placeholder for the info that you want to be in there.
And when you use, it replace the placeholder.

frigid ember
#

ok ty

neat oxide
#

@frigid ember dumb question is this even your own source code?

frigid ember
#

it is

#

but idk how to make a placeholder of it

#

but ill search around

dull gate
#

hey I've setup bungeecord and when I type /server it doesnt work but when I type /server <name of any server it works>

#

I basicly cant see server listing

#

and I get an error and kicked if I do /server

naive goblet
#

@frigid ember are you trying to make config placeholder?

frigid ember
#

basically yes

naive goblet
#

Use a formatter

inland oxide
#

Was thinking I might make something that checks the Spigot version

#

but looks like the VersionCommand stuff doesn't hav an API interface

#

would be nice to get not only the spigot version, but the the version that is released (not necessarily installed), the number of commits back, and maybe somethign like an isCurrent() method.

#

That way, in a beta plugin for a new major release like 1.16.x, I could set a warning if they are not on the latest version, etc. and disable that message if the plugin is a release plugin

#

maybe someone could rewrite VersionCommand to add that functionality to the Spigot API??

#

ok, well sleep time.

unique oyster
#

Hi,
is there a tutorial how i can program a pvp bot in minecraft?

torn robin
#

I would strongly recommend you learn the basics before attempting to learn how to create a PVP bot.

unique oyster
#

i can program

torn robin
#

What have you tried?

unique oyster
#

i look up in the spigot forums but i found only a solution where it does not walk

#

or one from protocollib

#

but it isn't walking too

#

like a fake player

#

or should i use citizens?

cold wharf
#

Is it possible to transfer spigot data to paper? Like if I want to change my server to paper how will I do that?

#

I want all the players data to be in paper

tiny dagger
#

just change it

#

there is nothing that will break

wraith thicket
#

A few plugins might (but very few)

tiny dagger
#

yeah

#

probabily plugins

#

but it's not something you can't revert

#

if they wouldn't work propely on paper

cold wharf
#

So like how? remove spigot jar and put paper jar?

tiny dagger
#

yes

#

that simple

torn robin
#

and make backups

cold wharf
#

oki ty

untold knoll
#

hey y'all so my email program eowked a few days ago and it's still working

#

but so many people are joining and i'm adding so many university emails that well, the config file has grown from a fe bytes to 7KB

#

Should I rewrite the system to do SQL?

sturdy oar
#

are you saving stuff into YAML?

#

I hope that's not the case

untold knoll
#

yes, yaml

#

i started it small for testing

#

then a bunch of people joined and verified their uni

#

so I want to switch that out.

sturdy oar
#

yeah you could use MySQL

#

it's already bundled by Spigot server

untold knoll
#

sweet

#

yeah i'm planning on that

#

i'm working on it rn

#

plus probably going ot learn to maven shade specific plugins

sturdy oar
#

yeah you definetively want to learn how to use Maven

naive goblet
#

Gradle ffs

sturdy oar
#

maven is easier for noobs

naive goblet
#

Wouldn’t say that

sturdy oar
#

I'm a noob so I would say that

naive goblet
#

I am also a noob

#

Maven is like Windows and Gradle is like Linux peepoFAT

bitter haven
#

Hey i can't run data packs on spigot why is that?

forest plaza
#

does anyone have an up to date guide how to listen to packets?

wet matrix
#

if I use setDisplayName with 8 or more color sections, the name now resets to the default minecraft name, but this is not documented.
example a: setDisplayName("§ca§9b§cc§9d§ce§9f§cg") -> colored name "abcdefg"
examble b: setDisplayName("§ca§9b§cc§9d§ce§9f§cg§9h") -> "Polished Andesite"

#

I use chatcolor, but for the sake of the example I wrote it out here.
Any ideas?

tiny dagger
#

hook into the netty pipeline

#

👌

forest plaza
#

but how?

tiny dagger
#

access entityplayer's network manager

forest plaza
#

if i knew how to do that i wouldnt need a guide

wraith thicket
#

Or, you could use ProtocolLib - they've got an example up on their github I'm pretty sure

forest plaza
#

thanks, i will look into it

frigid ember
#

how to check an integer amount that is in config.yml

wraith thicket
#

ConfigurationSection#getInt

wet matrix
#

am I doing something dumb in the above example, or this a new behavior?

manic raptor
#

Hi guys, what's the simplest way to allow Players(non-ops) to use a command I have made for my plugin?

#

(Without using a permissions manager plugin?)

naive goblet
#

Permissions would be great but otherwise use a map or smtng

#

If you want only certain players to be allowed

#

Else just don’t check permission?

manic raptor
#

I'm kind of new to this, I just have a really simple /swapworld command however currently only ops can use it.

#

Whenever a non-op runs it they get the default message "I'm sorry, but you do not have permission to perform this command..." etc

#

Is there a file that I can simply append this command's name "swapworld" to that will allow all users to use it?

naive goblet
#

How’s your plugin.yml looking

wraith thicket
#

I really don't see why you wouldn't use a permission manager plugin?

naive goblet
#

That’s irrelevant?

manic raptor
#
name: JaymaicanSurvival
main: com.jaymaican.jaymaicansurvival.JaymaicanSurvival
version: 1.0
api-version: 1.16
commands:
  swapworld:
    description: Teleports the player to the other world.
    aliases: [sw]
    permission: dualworld.swapworld
    usage: "Usage: /<command>"
#

This is for an absolute bare-bones plugin for me and my friends to play. The command simply swaps the player between survival and creative.

naive goblet
#

Add this

permissions:
  dualworld.swapworld:
    default: true
#

iirc

manic raptor
#

THANKYOU!

naive goblet
#

That should make everyone has permission by default

paper ember
#

When i try to spawn firework, i get this exception:

Caused by: java.lang.IllegalArgumentException: Cannot spawn an entity for org.bukkit.entity.Firework
    at org.bukkit.craftbukkit.v1_16_R1.CraftWorld.createEntity(CraftWorld.java:1781) ~[paper.jar:git-Spigot-758abbe-2b00831]
    at org.bukkit.craftbukkit.v1_16_R1.CraftWorld.spawn(CraftWorld.java:1806) ~[paper.jar:git-Spigot-758abbe-2b00831]
    at org.bukkit.craftbukkit.v1_16_R1.CraftWorld.spawn(CraftWorld.java:1393) ~[paper.jar:git-Spigot-758abbe-2b00831]
    at org.bukkit.craftbukkit.v1_16_R1.CraftWorld.spawnEntity(CraftWorld.java:645) ~[paper.jar:git-Spigot-758abbe-2b00831]
    at net.codingarea.challengesplugin.manager.ServerManager.playEndEffect(ServerManager.java:111) ~[?:?]
    at net.codingarea.challengesplugin.manager.ServerManager.handleChallengeEnd(ServerManager.java:86) ~[?:?]
    at net.codingarea.challengesplugin.manager.players.ChallengePlayerManager.handlePlayerDeath(ChallengePlayerManager.java:34) ~[?:?]
    at net.codingarea.challengesplugin.listener.PlayerDeathListener.onPlayerDeath(PlayerDeathListener.java:34) ~[?:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_211]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_211]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_211]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_211]
    at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:315) ~[paper.jar:git-Spigot-758abbe-2b00831]
    ... 33 more

Code:

for (Player currentPlayer : Bukkit.getOnlinePlayers()) {
            currentPlayer.getWorld().spawnEntity(currentPlayer.getLocation(), EntityType.FIREWORK);
        }
#

Only in 1.16

sturdy oar
#

paper

paper ember
#

i dont have paper

naive goblet
wraith thicket
#

I've seen that for the longest time, too

naive goblet
steep orbit
#

Anyone got like a player data reset plugin. Which resets someone’s player data on a server?

#

So be like /pd reset (player) and resets everything

frigid ember
#

how would i switch from spigot 1.15.2 to 1.16.1

vernal spruce
#

@steep orbit what you mean reset everything?

steep orbit
#

Like stats to make it like they’re new

vernal spruce
#

@frigid ember unless the server host provides you a one click install(most should),download the BuildTools,download the 1.16.1 version then ur good to go

steep orbit
#

Resets inventory stats mcmmo and all that

vernal spruce
#

every plugins has its own stuff,there is no one for all

frigid ember
#

would you know if mcmyadmin does that

vernal spruce
#

you have to manually do a wipe all for each,if you simply have to wipe the server

steep orbit
#

Well that’s gonna be pain later on

vernal spruce
#

delete all data folders or simply just delete all folders

steep orbit
#

Thank you

vernal spruce
#

just be carefull to not delete any config files that you worked on

#

so you dont have to reconfigure them..

steep orbit
#

Done that before was pain... but we learn from our mistakes

vernal spruce
#

@frigid ember mcmyadmin?

#

ahh i see

#

Well it doesnt provide anywhere on it the possible version,so unless you can choose 1.16 when you install it,then you have to manually do it yourself

frigid ember
#

you cant choose, its sort of dumb

vernal spruce
#

most host provides(unless theyr mainly minecraft) dont rush updating the versions...

#

shouldnt rly matter though,its quite easy to get 1.16 and upload it urself

frigid ember
#

do i just replace the old.jar with the new one

vernal spruce
#

yeah that should work

#

just be carefull as sometimes plugins break when switched to 1.16

#

so do a backup before..

sturdy oar
#

Is spigot 1.15.2 development finished?

vernal spruce
#

you mean 1.16?

sturdy oar
#

Like it will stop getting updates

vernal spruce
#

yes

sturdy oar
#

Rip

vernal spruce
#

unless there is like a major bug/exploit it wont rly be touched much

frigid ember
#

hey anyone know what i am doing wrong?
Manager.class.getResourceAsStream(FILE_PATH);
i have file in plugins folder

regal siren
#

Yes Ik what ur doing wrong

frigid ember
#

what

regal siren
#

You dont get a file like that

#

You have to do

frigid ember
#

but in jave you can get file like this

regal siren
#
File file = new File(getDataFolder(), "credentials.json");```
frigid ember
#

i mean input stram

#

hmm

regal siren
#

Well, File is kinda outdated, you can also use Path which is more to date

#

But its ur choice

#

¯_(ツ)_/¯

frigid ember
#

but why the error tho

regal siren
#

What is FILE_PATH

frigid ember
#

String

regal siren
#

There is no reason to use that method lol

frigid ember
#

/plugins/credentials.json

regal siren
#

getResourseAsStream is used for the map resource iirc

frigid ember
#

this is inside that string

regal siren
#

Just use what I've sent

frigid ember
#

iirc?

#

okey

regal siren
#

if I recall correctly

fluid marlin
#

I got an async task that pulls data from an SQL DB and puts it into an objectwrapper i made.
this code is run in a function that returns a boolean if a row in a table exists.
problem is the function returns the boolean prior to the async task setting the objectwrapper.

frigid ember
#

well,i cant get stream

#

its gives me file

fluid marlin
#

Code:

public boolean tableExists(String table) {
        ObjectWrapper<Boolean> exists = new ObjectWrapper<>();
        new BukkitRunnable() {
            @Override
            public void run() {
                try {
                    ResultSet result = metaData.getTables(null, null, table, null);
                    exists.set(result.next());
                } catch (SQLException e) {
                    e.printStackTrace();
                }
            }
        }.runTaskAsynchronously(plugin);
        return exists.get();
    }
#

Anyone knows how to solve this?

wraith thicket
#

@fluid marlin Use CompletableFuture

fluid marlin
#

Whats that

wraith thicket
fluid marlin
#

damn i didnt know google's domain has a java object

#

pog

vernal spruce
#

is that a r/woosh?

#

im not sure

wraith thicket
#
CompletableFuture<Boolean> getBoolean() {
CompletableFuture<Boolean> future = new CompletableFuture<>();
runTaskAsync(() -> {
   boolean b = true; // something async
   runTask(() -> future.complete(b)); // go back in sync
});
return future; // return future
}
// when using
getBoolean().whenComplete((b, err) -> {
// do stuff
});
vernal spruce
#

ford with the spoon 😂

wraith thicket
#

I couldn't help myself, sorry

fluid marlin
#

i was joking about the google's domain m8

#

I'm currently reading bout it

#

but thanks ❤️

fossil shoal
#
CompletableFuture<Boolean> getBoolean() {
CompletableFuture<Boolean> future = new CompletableFuture<>();
runTaskAsync(() -> {
   boolean b = true; // something async
   runTask(() -> future.complete(b)); // go back in sync
});
return future; // return future
}
// when using
getBoolean().whenComplete((b, err) -> {
// do stuff
});

Or use CompletableFutute#supplyAsync

#

(Instead of the bukkit scheduler)

silent kiln
#

hello does anyone here know the Entity Status byte in protocol that makes mobs do there attacking animation. specifically a wither skeleton when he swings his arms to attack (in 1.15.2)

sturdy oar
silent kiln
#

yea ive looked

#

idk if im blind or somethin

#

there's a list detailed below but reading through everything i cannot find this darn number

sturdy oar
#

i think status was not the right section

#

ID should be '0' i guess

silent kiln
#

oh nice i think this is it

#

thanks

#

(:

sturdy oar
#

Do you use ProtocolLib?

silent kiln
#

like the tiniest bit

#

im slowly learning

#

why?

sturdy oar
#

idk I've never understood how to create packets myself

#

I think it's difficult to do it without an external library

silent kiln
#

ive just been spending time reading a lot of resources and tutorials

#

its a shame there is no real protocollib tutorial series that really opens up to explain a lot of the easy to understand sections

sturdy oar
#

I mean ProtocolLib is way easier to use than NMS and netty\reflection

silent kiln
#

and then a more in depth based section that goes more into protocol and understanding the different aspects of mc

#

oh yea for sure

#

its an amazing library

frigid ember
#
            if (Counter.Count.get(uuid) == this.plugin.getConfig().getInt("stepcommands.steps")) {
                 System.out.println("stepcommands.commands");
             }```
stepcommands:
  steps: 10
  commands:
  - time set night

Im making a configurable config which executes a command after x steps;     public static final HashMap<UUID, Integer> Count = new HashMap<>(); This is my hashmap but its not working. Are the parts above right?
#

the added steps etc are all right and added after walking

sturdy oar
#

may I ask why static

frigid ember
#

I use it in other classes

sturdy oar
#

what do you mean by "the hashmap is not working"?

frigid ember
#

not the hashmap

#

The above part

#

srry xd

sturdy oar
#

the commands are not executing?

#

what error do you get

frigid ember
#

no error

fossil thorn
#

Remove all those static to start off with
@naive goblet ok

frigid ember
#

it just doesnt set it in the console

#

e9d30742-403e-4726-8b0f-de85903ede35: 19

#

while my amount is above 10

#

so it has been on 10

sturdy oar
#

Hello, i coded a Backpack Plugin, but if i try to build it. I get this Error Message and i don't get what i did wrong..

Information:javac 1.8.0_251 was used to compile java sources
Information:7/4/2020 15:30 - Build completed with 2 errors and 0 warnings in 1 s 508 ms
J:\development\backpack\src\main\java\de\yaquza\backpack\utils\Config.java
Error:(39, 20) java: unreported exception java.io.IOException; must be caught or declared to be thrown
J:\development\backpack\src\main\java\de\yaquza\backpack\commands\BackpackCommand.java
Error:(22, 33) java: non-static method get(java.lang.String) cannot be referenced from a static context

@fossil thorn I guess you missed a try & catch?

fossil thorn
#

wym?

frigid ember
#

Counter.Count.get(uuid) This will get the Int data of the hashmap right? Fendi

sturdy oar
#

that's what the error is saying

#

you aren't handling the IOException somewhere in your code

#

and you are improperly using static methods

#

Counter.Count.get(uuid) This will get the Int data of the hashmap right? Fendi
@frigid ember it will get the integer associated with the given UUID, if present

#

otherwise null i think

frigid ember
#

UUID uuid = p.getUniqueId();

#

idk it should work right

#

this should get the data

sturdy oar
#

maybe send full code

#

on pastebin or something

fossil thorn
#

@sturdy oar could i write you per dm?

sturdy oar
#

for what

#

no

#

I don't have DMs

frigid ember
#

[INFO] stepcommands.commands @sturdy oar

#

got it working but now it doesnt do the path which is logic cuz I print it

#

How should I print it than xd

sturdy oar
#

you're printing a list?

#

with sout?

frigid ember
#

stepcommands:
steps: 10
commands:

  • time set night
sturdy oar
#

try list.forEach(System.out::printLn)

frigid ember
#

im printing stepcommands.commands

sturdy oar
#

if i remember correctly, printing a list directly will only result in its memory address or something

#

someone correct me if I'm wrong

fossil thorn
#

Hello, i coded a Backpack Plugin, but if i try to build it. I get this Error Message and i don't get what i did wrong..

Information:javac 1.8.0_251 was used to compile java sources
Information:7/4/2020 15:30 - Build completed with 2 errors and 0 warnings in 1 s 508 ms
J:\development\backpack\src\main\java\de\yaquza\backpack\utils\Config.java
Error:(39, 20) java: unreported exception java.io.IOException; must be caught or declared to be thrown
J:\development\backpack\src\main\java\de\yaquza\backpack\commands\BackpackCommand.java
Error:(22, 33) java: non-static method get(java.lang.String) cannot be referenced from a static context
naive goblet
#

Send code

fossil thorn
#

import org.bukkit.configuration.file.YamlConfiguration;

import java.io.File;
import java.io.IOException;

public class Config {

    private static File file;
    private static YamlConfiguration config;

    public Config() {

        File dir = new File("./plugins/backpack/");
        if(!dir.exists()) {
            dir.mkdirs();
        }

        file = new File(dir, "config.yml");
        if(!file.exists()) {
            try {
                file.createNewFile();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }

        config = YamlConfiguration.loadConfiguration(file);

    }

    public static boolean contains(String path) {
        return config.contains(path);
    }

    public static void set(String path, Object value) {
        config.set(path, value);
        config.save(file);
    }

    public Object get(String path) {
        if(!contains(path)) {
            return null;
        }
        return config.get(path);
    }
}
#

this is my code

naive goblet
#

Remove all those static to start off with

frigid ember
#

conclure I need to print the command in stepcommands.commands

#

;p

#

stepcommands.commands is a part of config.yml

fossil thorn
#

Remove all those static to start off with
@naive goblet ok

fluid garden
#

Hey, I'm a Java developer with more than 5 years of experience. I offer you good and performant Spigot and Bungeecord plugins for little money! If you are interested, just write me a direct message on Discord 🙂

frigid ember
#

how would I print the commands itself

naive goblet
#

CodeChickrn wrong place

frigid ember
#

is there a plugin that makes that dirt didn't become grass

#

worldguard does that JoHe

fluid garden
#

@naive goblet no they told me i should post it here

naive goblet
#

Lqzinq printing a List<String>

#

They?

undone narwhal
#

Who?

frigid ember
#

look

#

stepcommands:
steps: 10
commands:

  • time set night
fluid garden
#

qbasty

#

idk

frigid ember
#

I have this in config.yml

#

I need to print the commands at commands:

naive goblet
#

you want to print the array from commands?

frigid ember
#

the - (.....)

#

so now time set night

fossil thorn
#

Remove all those static to start off with
@naive goblet Information:java: Errors occurred while compiling module 'plugin' Information:javac 1.8.0_251 was used to compile java sources Information:7/4/2020 16:13 - Build completed with 3 errors and 0 warnings in 4 s 762 ms J:\development\backpack\src\main\java\de\yaquza\backpack\commands\BackpackCommand.java Error:(21, 18) java: non-static method contains(java.lang.String) cannot be referenced from a static context Error:(22, 33) java: non-static method get(java.lang.String) cannot be referenced from a static context Error:(24, 19) java: non-static method set(java.lang.String,java.lang.Object) cannot be referenced from a static context

#

now i get this error

naive goblet
#

FileConfiguration#getStringList(String)#forEach(System.out::println)

frigid ember
#

lazinq can you name me the region flag?

#

uhhh

naive goblet
#

@fossil thorn did you remove all the static?

frigid ember
#

not out of my head srry

#

send a picture of all

fossil thorn
#

@fossil thorn did you remove all the static?
@naive goblet ```package de.yaquza.backpack.commands;

import de.yaquza.backpack.main;
import de.yaquza.backpack.utils.Config;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.inventory.Inventory;

public class BackpackCommand implements CommandExecutor {

private Inventory inventory;

public BackpackCommand() {

    int slots = 27;

    if(Config.contains("command.backpack.slots")) {
        slots = (int) Config.get("command.backpack.slots");
    } else {
        Config.set("command.backpack.slots", 27);
    }

    this.inventory = Bukkit.createInventory(null, slots, "§6Rucksack");
}

@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
    if(sender instanceof Player) {
        Player player = (Player)sender;
        player.openInventory(inventory);
    } else {
        sender.sendMessage(main.getPrefix() + ChatColor.RED + "Dieser Befehl kann nur als Spieler ausgeführt werden.");
    }
    return false;
}

}

naive goblet
#

That’s another class?

fossil thorn
#

wym

naive goblet
#

Well you made your config nonstatic so you can’t use those methods as if they still are static

frigid ember
#

FileConfiguration#getStringList(String)#forEach(System.out::println)

#

System.out.println(this.plugin.getConfig().getInt("stepcommands.commands"));

fossil thorn
#

what do i have to do?

frigid ember
#

I need it to be something like this

#

but this prints the indexes of all commands

undone narwhal
#

@frigid ember grass-growth if I well remember

frigid ember
#

something like that yes

naive goblet
#

Make an instance of Config by invoking it’s constructor and then pass it to different classes with dependency injection

#

getInt?

frigid ember
#

but this prints the indexes of all commands
@frigid ember

naive goblet
#

Thought you wanted the list lmao

frigid ember
#

yes I do

naive goblet
#

then getStringList

frigid ember
#

just print the list in console

fossil thorn
#

Make an instance of Config by invoking it’s constructor and then pass it to different classes with dependency injection
@naive goblet im sorry, but im new to coding and i don't understand many 😦

frigid ember
#

all ur #'s are fault

#

says eclipse

#

:p

naive goblet
#

Start with learning the basics on sololearn or something @fossil thorn

#

Did you paste the that lol

frigid ember
#

I have to go

#

fuck

naive goblet
#

It would be in your case plugin.getConfig().getStringList(“commands”).forEach(System.out::println);

frigid ember
#

uhh

#

lemme see

#

real quick

#

should it be commands or stepcounter.commands? @naive goblet

naive goblet
#

second

frigid ember
#

ok

#

ty

#

bye

#

I have to go :/

naive goblet
#

Cya

candid flame
#

Hey, my server has continued to crash multiple times and have been directed here by my hosting company, is there any solution to this bug?

fluid garden
#

Hey, I'm a Java developer with more than 5 years of experience. I offer you good and performant Spigot and Bungeecord plugins for little money! If you are interested, just write me a direct message on Discord 🙂

vernal spruce
#

Not here dude...

naive goblet
#

CodeChicken wth someone told you like 5 min before that this is the wrong channel

sturdy oar
#

Your code may be good and all, but please don't self advertise your services here

tight rain
#

hi when i open my server with the .bat, my ports doesn't open. When i open my server with the .jar my ports is open but obly the server have 1g

sturdy oar
#

what do you mean "your ports don't open"

#

have you done port forwarding?

vernal spruce
#

there isnt rly such a thing a not opening

tight rain
#

if i open the server with the .jar all works correct and the ports in open and my friends can play

#

if i open with the .bat (to have more ram on the server) the ports doesnt open and i only can play offline

#

my english is really bad

#

have you done port forwarding?
@sturdy oar yes

vernal spruce
#

What you mean have more ram

#

You place how much ram it uses

#

java -Xmx2G <---This -jar server.jar -nogui PAUSE

tight rain
#

if i open the server with the .jar i only have 1g in the server

vernal spruce
#

this is a start.bat

tight rain
#

i know

sturdy oar
#

because the jar just opens it with java -jar <file>

#

so you have no access to heap assignment

vernal spruce
#

Its mostly tied to default maximum memory

tight rain
#

but if i open the server with the start.bat my friends can't play

vernal spruce
#

wich i think java has 1g default

tight rain
#

i don't know why

vernal spruce
#

what error it says

tight rain
#

wich i think java has 1g default
@vernal spruce yeha

#

what error it says
@vernal spruce no error

sturdy oar
#

"no error"

#

if they can't join, they have an error

vernal spruce
#

There is no difference in using the bat rather than the java

tight rain
#

i check the ports and i say close

#

and if i open with the .jar ports says open

#

and my friends can play

vernal spruce
#

start the server then copy everything from the console and paste it here

#

!paste

tight rain
#

Okay

vernal spruce
#

damn bot not feeling like working i guess

tight rain
#

Is work find but my friends can't play

vernal spruce
#

well thing is ur not using spigot

#

though

tight rain
#

if i do the same thing with the .jar my friends can play

#

wait

sturdy oar
#

god knows why he's using Bukkit

tight rain
#

tha is spigot

vernal spruce
#

is the same port on both?

#

and the ip

tight rain
#

yes

#

if i open with the spigot.jar it work find

#

but only the server has 1G

vernal spruce
#

there shouldnt be a difference on it though hmm

tight rain
#

i know

#

past me your .bat

#

paste

vernal spruce
#

java -Xmx2G -jar server.jar -nogui PAUSE

#

renamed the spigot-1.16.1.jar file to server.jar

tight rain
#

ok

vernal spruce
#

cse lazyness to reedit the bat every time..

tight rain
#

the same

neat oxide
#

OMG i dont like this im trying to make it possible for someone to define a custom loottable for the piglin bartering system and it way more complicated than i anticipated

vernal spruce
#

i mean once you get the base down to read from config,you should be good

#

thats how i often think to a system that can receive as many loottables as possible

#

hard at beggining,but they get easyer towards the end

neat oxide
#

@vernal spruce you dont understand im actually making the API in the spigot code

#

it doesnt exist yet im making it RN

vernal spruce
#

well just be carefull how you structure ur config files

neat oxide
#

...... its not a plugin its spigot

vernal spruce
#

oh you actually want to make a spigot default api

neat oxide
#

I told you im a madman

vernal spruce
#

Im leaning towards wasting time but if u like it go for it

neat oxide
#

i have made thing for spigot before

vernal spruce
#

did they get in or just suggestions?

neat oxide
#

they did

#

i just noticed im in the wrong chat

#

like a idiot

stark oxide
#

I am kind of stuck. I am working on a manhunt plugin (for those who don't know, manhunt is a game mode where x number of players try to complete Minecraft while y number of players are trying to prevent this from happening). The game mode basically needs three unedited worlds to start the game with. My approach was to give the player who creates the game two options, either use the current world and the nether and the end of that world, or create new overworld, nether and end. The first option works fine, the plugin just starts the game in the current world. The latter one not so much, at least for me the plugin crashed my localhost test server while creating worlds with WorldCreator. I am very very new to making plugins, so does anyone have any kind of improvements to the main concept as to how this plugin would function, considering the requirements of the game mode?

#

I am not sure if the discord server is the correct place to ask for this, or if I should post this on the forums

naive goblet
#

I mean just do something like a player can "start a game" and as well as choose a worldname. If the world exists it will ask if the player wants to use it. If not create a new world. Also I'd suggest make a wrapper class for each set of worlds.

stark oxide
#

okay, sounds good, but do you think creating worlds on the fly will be a problem for more powerful servers?

naive goblet
#

Yes, creating a world can be a heavy process

vernal spruce
#

i think it still depends

#

after all it will create the starting region rather than alot of chunks

naive goblet
#

I mean he can do it async on another thread but it

vernal spruce
#

still wanky..

naive goblet
#

yeah

vernal spruce
#

also that ideea is so abused rn

#

because of youtube

stark oxide
#

yeah, sure is

#

but thanks for helping me!

vernal spruce
#

if you meet any problems along the way just ask here or on forums

#

if you dont know to work with worlds n such

stark oxide
#

I think a good idea would be to let the server admin decide if casual players should even be able to create new worlds

#

in config.yml

naive goblet
#

or just make it permission based

#

but default op

stark oxide
#

well yeah, that is a good idea too

normal flume
#

i know this is a bit off topic, but i'm using a spigot server for this so here goes, i have a rasberry pi 4 that i would like to use as a minecraft server, problem is, if i go above 2G of allocated RAM for the server, it says it can't allocate that amount of RAM, and i assume this is because it's a 32bit system, is it possible to increase this limit because i know that i have free RAM space

wanton delta
#

unsure of how well a raspberry pi would work

sturdy oar
#

isn't Raspberry Pi4 64Bit?

#

I'm pretty sure it was

pastel condor
#

It is

sturdy oar
#

Broadcom BCM2711 should have a 64bit architecture in fact

pastel condor
#

Just the os is 32

sturdy oar
#

yeah but there is a beta for raspbian 64-bit

pastel condor
#

Yeah

#

Never tried it though

normal flume
#

yh i get a kernel error every time i install drivers for my 7 inch screen tho so it's a no-go for me

odd trellis
#

I'm quite new to this; I'm some 80 versions out of date, what do I need to run in order to get the latest version of Spigot with fixes?

vernal spruce
#

you use the buildtools

odd trellis
#

Thank you!

kindred summit
#

Hi, I'd like to get ItemStacks of both items when you try to stack two different items in inventory. How could I achieve that?

vernal spruce
#

@kindred summit listen to click event

#

then you have getCursor and getCurrentItem

#

this will return the item holding in the click,and the item clicked in the inventory

kindred summit
#

Oh thx

kindred summit
#

I think this is exactly what I was looking for

vernal spruce
#

if ur looking for that kind of plugin where you can stack paper(money)

#

yeah

kindred summit
#

it has a similar concept

#

i'm trying to make when you "apply" a custom item to an enchanted item, it will sort the enchants

vernal spruce
#

actually not a bad ideea

heavy venture
#

if any one wanna some plugin or anything ( DM )

shadow drift
#

Do you guys have any idea why holograms are full white instead of colorful? Like I used the codes and they are still being white. I don't have any plugins installed apart from Holograms Plugin

frigid ember
#

hey

#

/restart only stops the server

sturdy oar
#

because there is no startup script set?^

frigid ember
#

if its a command then it should restart

heavy venture
#

you must have script for it

sturdy oar
#

restart uses the script defined in the spigot.yml if i remember correctly

frigid ember
#

oh!

heavy venture
#

and if you type /stop it will restart automaticaly

static echo
#

How i give a permission for a player using luckpermsAPI?

vernal spruce
#

you checked theyr wiki?

forest plaza
#

how would i make a gliding player boost like the firework boost?

vernal spruce
#

i think adding to theyr velocity should do the trick

forest plaza
#

id prefer if it there was a rocket and dont really want to simulate particles etc

cerulean musk
#

İs there any code or plugin, start automatic server after closed? İ have egg wars plugin but when match is over, server going to close.(sorry for my bad English)

forest plaza
#

you might want to work with lobbies?

karmic sable
#

Whats up guys, I'm trying to add worldguard as a dependency in a maven project, but it keeps giving me the "Could not find artifact" error.. I've tried plenty of things.

wraith thicket
#

Did you add the repository?

karmic sable
#

I did, yes

wraith thicket
#

?paste

worldly heathBOT
wraith thicket
#

You could show your pom

karmic sable
#

I mean, the current dependency and repo arent the one I used at first; but I've been trying several things I've seen on forums and all. Pasted my Pom on that link; I'm new to that code sharing link ;p

wraith thicket
#

You put the code there - it'll generate a unique link - you paste the link here

karmic sable
wraith thicket
#

You're using the wrong dependency

karmic sable
#

yeah that website is the first one I ever tried, and gave me the same error. Like I said, I've changed it up to try several things I've seen on fora so far; with no succes

#

This is with the things from that website, with LATEST as version

wraith thicket
#

You should use the one in the link and use 7.0.3 (for 1.15) or 7.0.4-SNAPSHOT (1.16) for the version

karmic sable
#

Even with 7.0.3 as a version number, the error persists as shown in the image above, sadly

#

I managed to get rid of the error in the pom-file by rightclickinging "dependencies" and downloading them, and then reloading the maven project, but there still seem to be some errors left..

wraith thicket
#

Looks like you're depending on the latest WG which depends on 1.16 rather than 1.15. Use 7.0.3 as the version instead

frigid ember
#

Which of the playsound methods plays it for the location rather than just the player?

wraith thicket
#

The one you call from the world

frigid ember
#

gotchya

karmic sable
#

I don't think you read what I wrote @wraith thicket

wraith thicket
#

I did read it

#

You're depending on WG 7.0.4-SNAPSHOT, which depends on 1.16.1, yet your own dependency is for 1.15.2

karmic sable
#

Alright well I wrote that I already tried the version numbers, inclusing 7.0.3 and all that several times. Anyways right now I only have the errors in the maven project on the side, and not in the actual file anymore so we'll see how it goes when I try to compile somewhere tomorrow. Thanks anyway

wraith thicket
#

You wrote the "I've tried 7.0.3" message 8 minutes before. I assumed you changed something in the middle of that.

karmic sable
#

Even with 7.0.3 as a version number, the error persists as shown in the image above, sadly
@karmic sable No, I've taken a nap.

wraith thicket
#

In any case, if you're using 1.15, you'd need to depend on 7.0.3 and not 7.0.4-SNAPSHOT

karmic sable
#

Anyway new update; I tried 7.0.3 now and reloaded the whole maven project, that seemed to take away all the errors everywhere

#

so I'm guessing the key solution is to reload the maven project completely after adding a new dependency

wraith thicket
#

The key was probably the fact that you had to actually run maven for it to download the dependency

#

I never tust my IDE - I just run the commandline and see what it thinks 🙂

forest plaza
#

fireworks have a BoostedEntity getter, but no setter, where would i do that?

karmic sable
#

Thanks for your time btw drives a ford

wraith thicket
#

I do aim to please

#

And if that fails, I drive a Ford

still wing
#

@forest plaza what are you trying to achieve?

subtle blade
#

Oh we got our reactions back? Did someone bother md enough about it last night? lol

forest plaza
#

@still wing i want to boost the player on SprintToggle while hes in the elytra

naive goblet
soft saddle
#

Anyone know a good alternative to Ultimate Moderation by Songoda? I'm currently removing all the plugins by songoda from my server cause well f em

native sleet
#
        public void getPlayerCount() {
        ByteArrayDataOutput output = ByteStreams.newDataOutput();
        output.writeUTF("PlayerCount");
        output.writeUTF("ALL");

        Player player = Iterables.getFirst(Bukkit.getOnlinePlayers(), null);
        player.sendPluginMessage(this, "BungeeCord", output.toByteArray());

Noobish question, but. Is it possible to use this snippet of code to get the total amount of players in a network, if this specific server has no players? (aka. player == null)

#

sendPluginMessage() just throws a NPE if there aren't any players on the server

fluid marlin
#
    public boolean tableExists(String table) {
        CompletableFuture<Boolean> future = new CompletableFuture<>();
        new BukkitRunnable() {
            @Override
            public void run() {
                try {
                    ResultSet result = metaData.getTables(null, null, table, null);
                    future.complete(result.next());
                } catch (SQLException e) {
                    e.printStackTrace();
                }
            }
        }.runTaskAsynchronously(plugin);

        return translateFuture(future);
    }
#
    public <T> T translateFuture(CompletableFuture<T> future){
        ObjectWrapper<T> t = new ObjectWrapper<>();
        future.whenComplete((b, err) ->{
            try {
                t.set(future.get());
            } catch (InterruptedException | ExecutionException e) {
                e.printStackTrace();
            }
        });
        return t.get();
    }

the t.get(); returns null

#

anyone knows why

wraith thicket
#

You don't seem to understand how the completable future works

fluid marlin
#

o

wraith thicket
#

The entire idea of the object is that you let it be completed in another thread and then look at the completion when it's done being completed

#

The lambda in #whenComplete gets run only when the future is completed

#

That's way after all these functions have returned their values

fluid marlin
#

so how do I make this function return my boolean

#

only after the boolean is set

wraith thicket
#

You return the CompletableFuture

#

And where ever you expect a response, you use the #whenComplete method

fluid marlin
#

@wraith thicket so there I wont have a problem with that too?

#

I'll give an exmaple hold on

wraith thicket
#

I spoonfed you an example a few hours ago

fluid marlin
#

yeah

#

I'll show you what I mean

frosty cave
#

i think im doing a small brain move, can anyone help me with this

public static setAFK(Player player) {
        AFKList.add(player.getName());
        Bukkit.broadcastMessage(ChatColor.LIGHT_PURPLE + player.getName() + " is now AFK.");
    }```
#

netbeans says "invalid method declaration; return type required"

wraith thicket
#

You need a return type

#

i.e void

forest plaza
#

void

frosty cave
#

oh

#

lmao

#

i havent done java in a long time

forest plaza
#

maybe try kotlin?

fluid marlin
#

@wraith thicket Do i have just have to do something like this for each function I want to run async

#

is there not an easiest way to have the function return a String?

wraith thicket
#

That's the gist of it. However, unless you're fine with the #whenComplete method being run on an async thread, you'd need to return to the main thread before completing the future

#

There's no way to simply return a value from "the future"

#

So returning a CompletableFuture is the best you're going to get

#

With that said, you don't need to use BukktiRunnables, you can simply use lambdas. But it won't change your situation much.

#

Although taking a closer look, I'm not entirely sure when the nested future will be completed. It's possible that's already in sync

fluid marlin
#

Ah true, I still had that function as async from beforer

#
        CompletableFuture<String> future = new CompletableFuture<>();
        CompletableFuture<ResultSet> resultFuture = getData("Name FROM PlayerData WHERE UUID='" + uuid.toString() + "'");
        resultFuture.whenComplete((b, err) -> {
            try {
                ResultSet result = resultFuture.get();
                if (result.next())
                    future.complete(result.getString("Name"));
            } catch (SQLException | InterruptedException | ExecutionException e) {
                e.printStackTrace();
            }
        });

        return future;
    }```
#

so this is the best I could get

#

--
so if I want to create a new Profile per say and my profile consturctor needs UUID and their Name that are both stored in an SQL DB

#

I'll get CompletableFutures from both and have the whenCompletes run inside eachother?

#

or there could I already do something like the code below since it runs on the main thread?

Code:

String name = "";
CompletableFuture<ResultSet> resultFuture = getData("Name FROM PlayerData WHERE UUID='" + uuid.toString() + "'");
 resultFuture.whenComplete((b, err) -> {
            try {
                ResultSet result = resultFuture.get();
                if (result.next())
                    name = result.getString("Name");
            } catch (SQLException | InterruptedException | ExecutionException e) {
                e.printStackTrace();
            }
        });
#

@wraith thicket

visual berry
wraith thicket
#

You can run database queries on the main thread. But that just means that your server will wait for a response will be guaranteed to lead to many performance issues

dense escarp
#

@fleet crane How Hypixel Works! ?

#

bungeecord

fluid marlin
#

@wraith thicket
Yeah I know but i wasn't talking about database queries

wraith thicket
#

You said it all ran on the main thread, though

fluid marlin
#

so if I want to create a new Profile object per say and my profile consturctor needs UUID and their Name that are both stored in an SQL DB
I'll get CompletableFutures from both and have the whenCompletes run inside eachother?

or there could I already do something like the code i put above since it runs on the main thread?

#

I think I didn't really make clear what I'm asking re-reading what I said, Basically I'm asking if I can do this and it'll work:

#
String name = "";
CompletableFuture<ResultSet> resultFuture = getData("Name FROM PlayerData WHERE UUID='" + uuid.toString() + "'");
 resultFuture.whenComplete((b, err) -> {
            try {
                ResultSet result = resultFuture.get();
                if (result.next())
                    name = result.getString("Name");
            } catch (SQLException | InterruptedException | ExecutionException e) {
                e.printStackTrace();
            }
        });
#

Will String name be null here if I return it after this code

#

getData() is an async function that gets a ResultSet CompletableFuture

wraith thicket
#

When you return it, it'll be "" just like you set it to be

#

Again - you cannot get stuff from the future now

fluid marlin
#

so this
name = result.getString("Name");
wont work

#

I'll have to run all my code inside the whenComplete?

wraith thicket
#

Think of it this way:
You put $1000 in an investment for 3 months.
They tell you they expect you to gain on average 3% intereset per month.
And then right after you invest, you ask "How much money do I have after the investemnt"?
You can't tell unless you sit there and wait the 3 months.

fluid marlin
#

So the code will keep running and not wait for the whenComplete to do its shit?

wraith thicket
#

the #whenComplete will be run at another time - that is, when the future is completed

#

That is - again- way after your method has returned its value

fluid marlin
#

is there a way for me to make my method wait for the value to be returned

wraith thicket
#

Of course, but that's just freezing the server.

fluid marlin
#

or do i just have to do all my code inside whenCompletes

#

oh yeah I dont want to do that lol

wraith thicket
#

The way this works:
You have a method.
That method creates a CompletableFuture instance
It schedules an async task that runs at a later data
It returns the CompletableFuture object

#

Now, once the server's done with the tick, the scheduler runs the task on another thread.

#

And that triggers the completion of the future object

#

Which, in turn, runs whatever's passed to the #whenComplete method

fluid marlin
#

Alright

#

so if I had something like

public Profile(String name, UUID UUID)```
and i wanted to create a new profile and I have a function to get a name and uuid completablefuture from the DB i'll need to have two `whenCompletes` inside eachother that create a new Profile object once both are completed using the objects that they store?
wraith thicket
#

You'd most likely want to fetch both in one CompletableFuture - wrap them in a simple object if you must

fluid marlin
#

Gotcha

fiery girder
#

Hello, i got a small question: Can someone tell me what this Error means/ how i can avoid it (if possible)? My Server works perfect, its just that this is sometimes in my log...

vernal spruce
#

Hmm you have any plugin wich can screw around with pathfinders?

fiery girder
#

one second, ill give you the /plugins content...

frigid ember
#
        if (Counter.Count.get(uuid) == this.plugin.getConfig().getInt("stepcommands.steps")) {
            plugin.getConfig().getStringList("stepcommands.commands").forEach(System.out::println);
        }```
How would I make it actually execute the path in the console instead of say what the path is in the console
fiery girder
#

Those are all my Plugins...

#

@vernal spruce Is one of them maybe "screwing around" with pathfinders?

fervent sorrel
#

[22:53:12] [Server thread/ERROR]: Cause of unexpected exception was
java.lang.ClassCastException: net.minecraft.server.v1_16_R1.EntityEnderPearl cannot be cast to net.minecraft.server.v1_16_R1.EntityPlayer
at net.minecraft.server.v1_16_R1.TileEntityEndGateway.a(TileEntityEndGateway.java:160) ~[spigot.jar:git-Spigot-758abbe-2b00831]
at net.minecraft.server.v1_16_R1.TileEntityEndGateway.tick(TileEntityEndGateway.java:67) ~[spigot.jar:git-Spigot-758abbe-2b00831]
at net.minecraft.server.v1_16_R1.World.tickBlockEntities(World.java:676) ~[spigot.jar:git-Spigot-758abbe-2b00831]
at net.minecraft.server.v1_16_R1.WorldServer.doTick(WorldServer.java:418) ~[spigot.jar:git-Spigot-758abbe-2b00831]
at net.minecraft.server.v1_16_R1.MinecraftServer.b(MinecraftServer.java:1104) ~[spigot.jar:git-Spigot-758abbe-2b00831]
at net.minecraft.server.v1_16_R1.DedicatedServer.b(DedicatedServer.java:354) ~[spigot.jar:git-Spigot-758abbe-2b00831]
at net.minecraft.server.v1_16_R1.MinecraftServer.a(MinecraftServer.java:1007) ~[spigot.jar:git-Spigot-758abbe-2b00831]
at net.minecraft.server.v1_16_R1.MinecraftServer.v(MinecraftServer.java:846) ~[spigot.jar:git-Spigot-758abbe-2b00831]
at net.minecraft.server.v1_16_R1.MinecraftServer.lambda$0(MinecraftServer.java:164) ~[spigot.jar:git-Spigot-758abbe-2b00831]

#

My server is crashing bcz of this, could it be the spigot ?

subtle blade
#

Run /version in game, then come back

#

(RE: BlaD3)

#

@frigid ember Bukkit has a method to execute a command from the console (as I presume that's what you're trying to do)

#

Where the sender is Bukkit#getConsoleSender()

frigid ember
#

yep someone already helped me thanks;)

subtle blade
#

o/

zinc ingot
#

o7

fervent sorrel
#

will do

subtle blade
#

89 versions behind?

fervent sorrel
#

oof i am 89 version behind @subtle blade

#

yep

subtle blade
#

Yeah I know. lol

#

Don't use mirror sites

#

?bt

fervent sorrel
#

help xd

subtle blade
#

Thanks CafeBabe. Super handy

worldly heathBOT
subtle blade
#

Oh

#

THANKS

fervent sorrel
#

the bot dead

zinc ingot
#

you only had to thank it

#

bots have feelings, too

fervent sorrel
#

how do i use these build tools

#

i'm kinda new to that

#

xd

subtle blade
#

That wiki explains exactly how to use it

fervent sorrel
#

i use this code

#

in a notepad?

#

ok imma read i t

subtle blade
#

Yes lol

#

Please

wheat summit
#

Would anyone know why when I place leaves they won't decay automatically though when a tree grows and I break the logs down it'lll decay?

subtle blade
#

That's vanilla behaviour

wheat summit
#

I don't have anything in my code messing with that

#

Oh ok

#

is there a way I can cancel that?

subtle blade
#

I mean, you can assign the persistence block state for the leaves when you place them if you'd like

wheat summit
#

Would I have to check if the block placed is an instance of a leave then convert it to Bukkits leaves?

wheat summit
#

I should also say I'm in 1.8

subtle blade
#

Yeah that's a different story

wheat summit
#

Yeah I saw BlockData there in the Javadoc

subtle blade
#

That was all handled with different byte data and I don't know what they all were. Was a shitty system

wheat summit
#

Ok

#

Thanks anyways

subtle blade
#

Suppose you have the option of Leaves MaterialData instead

wheat summit
#

Ok thanks

#

It doesn't look like that's a function, is it 1.9+?

subtle blade
#

It's 1.8

#

In fact, it's pre-1.13

wheat summit
#

Oh ok

#

I'm not getting anything in my IDE, here's what I have using

#
        if(event.getBlock() instanceof Leaves) {
            Leaves leaves = (Leaves) event.getBlock();
        }
subtle blade
#

Block will not be an instance of Leaves. Its MaterialData will

wheat summit
#

Quite simple though that should be casting it to an instance and be working...

#

Oh ok

subtle blade
#

Listen for a BlockPlaceEvent. If it's leaves, get its MaterialData (block.getState().getData())

#

Re-set it using BlockState#setData(MaterialData) again

buoyant path
#

is it possible to make block changes on an async thread with threadlocks?

wheat summit
#

Ok thanks

subtle blade
#

No. Bukkit & async aren't friendly with one another

buoyant path
#

not even with a threadlock? lol

subtle blade
#

Minecraft wasn't meant to be written to asynchronously

buoyant path
#

Damn, im writing some code for custom mining (uses packets to show block break damage, and custom enchants that can change the speed)

#

Was hoping I could set the block type in async

#

obviously I can with packets but thats not ideal

subtle blade
#

Right, that's about most of what you can do asynchronously and even then, the packets are only queued and still sent on the server thread

neat oxide
#

Choco bad we don't support 1.8 anymore remember

#

Forbidden words

fossil thorn
#

I coded a Timer Plugin, but everytime i get this error message: Error:(57, 50) java: no suitable method found for a(java.lang.String,byte) method net.minecraft.server.v1_15_R1.IChatBaseComponent.ChatSerializer.a(net.minecraft.server.v1_15_R1.ChatModifier,com.google.gson.JsonObject,com.google.gson.JsonSerializationContext) is not applicable (actual and formal argument lists differ in length) method net.minecraft.server.v1_15_R1.IChatBaseComponent.ChatSerializer.a(net.minecraft.server.v1_15_R1.IChatBaseComponent) is not applicable (actual and formal argument lists differ in length) method net.minecraft.server.v1_15_R1.IChatBaseComponent.ChatSerializer.a(java.lang.String) is not applicable (actual and formal argument lists differ in length) method net.minecraft.server.v1_15_R1.IChatBaseComponent.ChatSerializer.a(com.google.gson.JsonElement) is not applicable (actual and formal argument lists differ in length) method net.minecraft.server.v1_15_R1.IChatBaseComponent.ChatSerializer.a(com.mojang.brigadier.StringReader) is not applicable (actual and formal argument lists differ in length) method net.minecraft.server.v1_15_R1.IChatBaseComponent.ChatSerializer.a(com.google.gson.stream.JsonReader) is not applicable (actual and formal argument lists differ in length)
i don't understand it

subtle blade
#

I can at least point in the direction of MaterialData so they're not using byte data in source

neat oxide
#

Ok fine

frigid ember
#

is there an event for a piglin being distracted by gold on the ground?

subtle blade
#

EntityPickupItemEvent should be called when they actually pick it up, but no, an event is not called for when they first realize there is gold on the ground

frigid ember
#

aw rats

subtle blade
#

You're welcome to create one and pull request, or create a ticket on the JIRA

frigid ember
#

lol i have no idea how to make an event

neat oxide
#

@frigid ember Im currently writing events and methods for piglin and bartering what exactly would you like

frigid ember
#

oh i was just trying to make them not target gold on the ground

#

so like i would cancel the event

neat oxide
#

So you want it to be cancellable

#

I can do that (if I can find where they get distracted in the code)

frigid ember
#

thats pretty cool

#

im pretty new to this type of thing so i have no idea how to make an event lol

neat oxide
#

Trust me this might take a bit as I'm gonna be putting it in the same pr as my other changes also the piglinai file is quite large and complex

#

No issues this is quite advanced level stuff if you don't know how to use NMS I would not even try and touch raw spigot

frigid ember
#

oh ive worked with nms a bit

#

just a tiny bit

neat oxide
#

Trust me think nms but it's all NMS your just working off obfuscated named methods

#

Nightmarish

frigid ember
#

i can imagine

neat oxide
#

@frigid ember if you want updates on this make a jira suggestion and I'll subscribe to it and keep it updated

fossil thorn
#

I coded a Timer Plugin, but everytime i get this error message: Error:(57, 50) java: no suitable method found for a(java.lang.String,byte) method net.minecraft.server.v1_15_R1.IChatBaseComponent.ChatSerializer.a(net.minecraft.server.v1_15_R1.ChatModifier,com.google.gson.JsonObject,com.google.gson.JsonSerializationContext) is not applicable (actual and formal argument lists differ in length) method net.minecraft.server.v1_15_R1.IChatBaseComponent.ChatSerializer.a(net.minecraft.server.v1_15_R1.IChatBaseComponent) is not applicable (actual and formal argument lists differ in length) method net.minecraft.server.v1_15_R1.IChatBaseComponent.ChatSerializer.a(java.lang.String) is not applicable (actual and formal argument lists differ in length) method net.minecraft.server.v1_15_R1.IChatBaseComponent.ChatSerializer.a(com.google.gson.JsonElement) is not applicable (actual and formal argument lists differ in length) method net.minecraft.server.v1_15_R1.IChatBaseComponent.ChatSerializer.a(com.mojang.brigadier.StringReader) is not applicable (actual and formal argument lists differ in length) method net.minecraft.server.v1_15_R1.IChatBaseComponent.ChatSerializer.a(com.google.gson.stream.JsonReader) is not applicable (actual and formal argument lists differ in length)
i don't understand it

neat oxide
#

Did you use NMS

#

Or are you using reflection carelessly

inland oxide
#

Any idea what this error means?

#

[Netty Server IO #2/ERROR]: java.lang.IllegalArgumentException: Component loop

neat oxide
#

Because correct me if I'm wrong but from judging from the error your trying to put a square in a round hole

#

@inland oxide longer stack trace?

inland oxide
#

don't have

#

from a user

neat oxide
#

Then I can't help not enough info

inland oxide
#

There is no stack

#

[16:58:50] [Server thread/INFO]: RaptorBoy_TNT issued server command: /ah sell 5000
[16:58:50] [Netty Server IO #2/ERROR]: java.lang.IllegalArgumentException: Component loop
[16:58:54] [Server thread/INFO]: RaptorBoy_TNT issued server command: /ah

#

dont think it's related to the plugin

neat oxide
#

Not it's not

#

1 moment

inland oxide
#

Just curious what it means

#

if it's just a network issue

neat oxide
#

It's a hardware error

inland oxide
#

interesting

neat oxide
#

Does this happen often

#

It means the driver caused a loop which was terminated automatically

cerulean musk
#

is there any code or plugin , start server after crash ?

neat oxide
#

@cerulean musk excuse me what

cerulean musk
#

sorry for my bad english

neat oxide
#

If you mean automatically start after crash in spigot.yml there are options for that

inland oxide
#

spigot should be able to in spigot.yml

cerulean musk
#

oh