#help-archived

1 messages ยท Page 173 of 1

frigid ember
#

anyone help

tough kraken
#

in 'string', line 615, column 9: item-name: '&9? ? ? &f&lNo Grief ... ^ expected <block end>, but found '<scalar>' in 'string', line 620, column 25: - '&bIf you don't have permission to' ^

its actually telling you everything you need

frigid ember
#

i dont get it

#

what does it telling me

#

So I have that

radiant pollen
#

The ' in don't is closing the quote of the lore.

frigid ember
#

when i remove 5 everything seems to be normal

#

but when I add 5 again the plugin stop working

#

because

#

the

#

'

#

in dont

#

closes the lore

#

Thanks

#

fixed

paper folio
#

@tranquil edge player.setMaxHealth(20.0);

#

have you tried doing a higher value then 20.0?

grim halo
#

Use the Attribute.GENERIC_MAX_HEALTH

#

player.getAttribute(Attribute.GENERIC_MAX_HEALTH).setBaseValue(100.0);

#

Yes. Like that. But this wont heal you player.

#

What do you mean by "can't register" does your ide say the method does not exist?

#

Are you on 1.8? -.-

#

No idea. its 6 years old. Maybe try what shawshark suggested. player.setMaxHealth(100.0)

#

Instead of default use getValue()

peak glade
#

hello

grim halo
#

No idea. The method setMaxHealth() is very old and doesnt exist in higher versions

peak glade
grim halo
#

@peak glade Is this message from essentials?

peak glade
#

yes

grim halo
#

Then go into essentials and disable it.

peak glade
#

i got it

#

this motod

grim halo
#

?

frigid ember
#

How do I make it so players do /(servername) instead of /server (servername)

grim halo
#

Write a command <name> that triggers another command.
So that
/<name>
runs
/server <name>
for the player

#

I think there are plugins out there that lets you create new commands with other commands as target

frigid ember
#

Do you know any in specific

#

Yeh but then I gotta do that for every server, I feel like there is a better way

grim halo
peak glade
#

hey

frigid ember
#

They're for bungee?

peak glade
#

where is deluexchat ?

#

but i need discord

grim halo
#

@frigid ember no idea i guess not.
@peak glade No idea what you are talking about...

peak glade
#

i need support deluxechat

drifting lichen
#

where can I edit mob damage modifier?

buoyant path
#

how can you make a chest play the open animation without actually opening the chest?

#

is there a bukkit way to do it or is it just a pakcet

#

packet*

grim halo
#

@buoyant path Only packets.

buoyant path
#

ok

grim halo
#

@drifting lichen You can edit mob damage modifiers on a lot of places. What are you trying to achieve?

drifting lichen
#

On my server

#

not a plugin

#

just either from spigot,paper or tuinity.yml

#

vanilla multiplier

#

@grim halo

marsh hawk
#

Is it possible to run a function with JSON text rather than send a command?

grim halo
#

Yes. AsyncPlayerChatEvent and check the message then parse as json.

marsh hawk
#

sorry i meant when clicked

grim halo
#

You can only:
show text, suggest a command, run a command or open a url.
What are you trying to achieve?

marsh hawk
#

damn, that sucks. I can work around it

#

just trying to add interactive dialogue

#

i can just run a command for it, no worries

pastel condor
#

You can have it run commands

#

I used to do that to troll people via command blocks

#

They would see a message and then be stupid enough to click it

marsh hawk
#

lmao

#

I forget, does the Action.RUN_COMMAND run on behalf of console or the player whom clicked?

tough kraken
#

hey, i want to make a pvp bot

a custom zombie (i think?) that attacks players like it would be a real player...well.. almost...

what would be the best way?

grim halo
#

@tough kraken This could be a huge task depending on how realistic the bot needs to be.

tough kraken
#

the best as possible

#

wow thats very huge... xd

grim halo
#

Ok the best...

  1. Extend NMS Zombie and become an expert in AI Goals, Target selection and pathfinding.
  2. Collect a ton of data from fighting players and filter it so you can use it in the next step.
  3. Set up a neural network and analyze the data.
  4. Create mutations and let the mutations fight against each other. Set proper rewards and goals and only let the best mutations evolve further.
tough kraken
#

that is too big haha

i actually meant for 1v1-games. so just a bot, that attacks the player like a normal player

it doesnt really have to learn anything with the time

grim halo
#

Then you only need to do step one and hardcode the behavior.

tough kraken
#

is there any "tutorial" for those pathfindergoals? never used them

buoyant path
#

theres a great one if you google it

#

I dont have the exact link

grim halo
#

I think by now some of the AI stuff is exposed in the API. Paper might be even further with that.

buoyant path
grim halo
#

I think this is very outdated

tough kraken
#

tried it, but the spawning zombie does exactly nothing

#

it stands there and is walking...

#

should be for 1.8 if possible

grim halo
#

Lol... then this can be considered brand new...

#

1.8...

tough kraken
#

tried it, but the spawning zombie does exactly nothing
@tough kraken but idk why it is'nt doing anything

buoyant path
#

Ive used this before for code so you must be doing something wrong

#

7smile people use 1.8 because the combat is better lol

#

newer combat is not very good

grim halo
#

You can say that you like the combat system more. Cant call it objectively better.

tough kraken
#

well i like the new combat, 1.8 combat one the most servers is only cps-based, but i am only using 1.16 for my survival server

#

i think both has their pros and cons

buoyant path
#

I think it should be in the middle

tough kraken
#

?paste

worldly heathBOT
tough kraken
buoyant path
#

did you not do the enum part?

#

oh

#

nvm im blind

marsh hawk
#

Hmm what's an efficient method to check if a player is within bounds of two locations.

ionic sun
marsh hawk
#

iirc "%2$s"

ionic sun
#

isn't there like a document describing it?

tough kraken
#

Hmm what's an efficient method to check if a player is within bounds of two locations.
@marsh hawk i would say, get minX, maxX, minZ, maxZ, and check if the players location is bigger than "min" and less than "max"

#

or if only one coord, just use one of them

marsh hawk
#

oh yeah that would be good

tough kraken
#

what the flying fuck is that? i literally hate these PathFinderGoals

stone ridge
#

What is the server address?

#

?

tough kraken
#

what the flying fuck is that? i literally hate these PathFinderGoals
@tough kraken is there any way around nms?

buoyant path
#

@tough kraken can you use citizens?

#

they have a pretty good API

#

I know being standalone is nice but with nms entities its really hard

sturdy oar
#

NMS is ez pz

#

I suggest everyone learns about it

tough kraken
#

nms is trash. it changes like every version lmao

sturdy oar
#

that's why you develop for 1.8.8

#

protocol 47 doesn't change anymore

tough kraken
#

i am using 1.8 normal

#

thats like bukkit... why are they renaming dye-colors?

#

why are mojang changing "gold_sword" to "golden_sword"? theres no cause

karmic sable
#

Is there a way to delete a world while the server is running, without using the multiverse api? (although I do have multiverse on the server)

I've tried several things, the latest attempt being:

    public static void deleteWorld(){
        String worldName = ResetWorld.getInstance().getConfig().getString("worldName");
        if(doesWorldExist(worldName)) {
            File worldFile = Bukkit.getWorld(worldName).getWorldFolder();
            Bukkit.unloadWorld(worldName, false);
            try {
                // create a stream
                Stream<Path> files = Files.walk(Paths.get(worldFile.toURI()));

                // delete directory including files and sub-folders
                files.sorted(Comparator.reverseOrder())
                        .map(Path::toFile)
                        .forEach(File::deleteOnExit);
                // close the stream
                files.close();
            } catch (IOException ex) {
                ex.printStackTrace();
            }
            System.out.println("World: " + worldName + " is now gone.");
        }
        else {
            System.out.println("No world exists with the name: " + worldName);
        }
    }

tough kraken
#

make sure no players are in it, unload it, and use FileUtils#deleteDirectory

#

but make sure it is really unloaded. or it spamms errors

marsh hawk
#

public abstract class SingleListener<T extends Event> implements Listener{
    
    @EventHandler
    public void main(T e) {
        execute(e);
    }
    
    public abstract void execute(T e);
}``` 
This should work right? my classes that extend this arent getting called, they are registered correclty
#

do annotations not transfer over

karmic sable
#

@tough kraken before executing my deleteWorld(); I do remove the warp from the world; teleport every player who's in it to spawn, and unload it (latter being in the deleteWorld() method) . I'm not getting errors with the current method, it just sort of reloads the world instead of getting rid of the files (and making new ones with a different method). I've tried FileUtils before, same results

tough kraken
#

fault of multiverse

#

multiverse is saving the worlds in the mv - worlds.yml - if there is one existing, it re-creates the same world

karmic sable
#

so I'd need to unload it from multiverse too?

tough kraken
#

would not really help

karmic sable
#

cycle through the world.yml file and take it out? ;p

tough kraken
#

if you really prefer to use multiverse on the Server, you would have to manually remove all world-related lines out of the config

i think

karmic sable
#

Context: I'm basically creating a plugin that resets a "resourceworld" every (Day/week/month depending on config) but I need it to be a different seed every time

tough kraken
#

well, just restart the server?

karmic sable
#

Well I want to be able to do it without restarting the server

#

automated

tough kraken
#

wait i am showing you how i am doing

gusty comet
#

Not really spigot related, but can i export my Plugin Jar with the commons lang as Referenced Library?

tough kraken
#

as my plugin is public, i have to check if the player is using bungeecord or not -

i am kicking the players, in the config i set a boolean to true, to make sure, it doesnt get resetted on normal /restart or reload,

in onEnable() i am deleting the worlds if the bool is true

then it automatically creates a new world, as no world is existing

multiverse probably would affect the reset

#

if that helps you

karmic sable
#

I'll take a look thank you very much

tough kraken
#

no problem

karmic sable
#

The onEnable basically checks if the world exists, and if it does, it sets "reset" to false in config?

ionic sun
#

is setting a class field to Bukkit.getWorld("world") once and using it over and over again the same as just using Bukkit.getWorld("world") over and over again?

tough kraken
#

yeah, to make sure, it doesnt get reset on restart or reload, as its the onEnable

#

and on /reset i set the boolean to true

#

after the reset to false

#

well if setting a field, probably it would be smoother, but there should be no performance difference

frigid ember
#

Hi

tough kraken
#

hello

frigid ember
#

can i make it async?

public class Map {

  private MapView map = Bukkit.getServer().createMap(Bukkit.getWorlds().get(0));

  @SuppressWarnings("deprecation")
  public Map(Image img) {

    map.setScale(Scale.FARTHEST);

    for (MapRenderer r : map.getRenderers()) {
      map.removeRenderer(r);
    }

    map.addRenderer(new Renderer(img));
    data = map.getId();
  }

  public final short data;

  public MapView getMap() {
    return map;
  }

  private static class Renderer extends MapRenderer {
    private Image img;

    public Renderer(Image img) {
      this.img = img;

    }

    @Override
    public void render(MapView mapView, MapCanvas mapCanvas, Player p) {

      mapCanvas.drawImage(0, 0, img.getScaledInstance(128, 128, Image.SCALE_AREA_AVERAGING));

    }

  }

}
tough kraken
#

uhmmm... another guy can say more xd

ionic sun
#

@tough kraken does that mean the field the world is stored to is a pointer to the object in memory? so that then, whenever the world object changes, the changes are also reflected in the field?

tough kraken
#

well in my knowledge, a field is just for accessing stuff without everytime typing it in again

specially for long methods.
like config access etc

ionic sun
#

also for keeping state though

tough kraken
#

yeah i think so

gusty comet
#

Not really spigot related, but can i export my Plugin Jar with the commons lang as Referenced Library?
Any ideas?

tough kraken
#

sadly not

gusty comet
#

aww

tough kraken
#

if i understand right, you want to add a library jar to the plugin, and export the library along inside the plugin jar?

gusty comet
#

Yeah. I've added the Commons Lang jar to the Build path and i can access it in the code with no problems but the functions i use are also using the commons lang methods and i get a ClassNotFoundException when exporting

limpid thistle
#

You mean shading?

gusty comet
#

Not when exporting but when using them in Bungeecord

#

You mean shading?
@limpid thistle ?

limpid thistle
#

Shading means putting certain depencies into the jar so you can use them at runtime

gusty comet
#

java.lang.NoClassDefFoundError: org/apache/commons/lang/StringUtils

#

Yeah

tough kraken
#

i know that in IntelliJ there is a way, for ex. to add the spigot.jar to the plugin build. but idk if thats the right what you want

gusty comet
#

Im using eclipse. You can do it that way when exporting a Runnable Jar but i don't want that

#

Because that won't work with spigot/bungee

tough kraken
#

well i think i am the wrong for such questions ๐Ÿ˜ฆ

limpid thistle
#

Do you use maven?

gusty comet
#

no

limpid thistle
#

oh

#

hmm

#

i dont use eclipse

tough kraken
#

same

gusty comet
#

hmm thanks

#

I can't even find anything on the Internet they all say "jUsT eXpoRt to a RuNnaBlE JaR"

#

But i need some kind of configuration script

#

and don't wanna export the Bungeecord jar lol

tough kraken
#

yeah that would be... large files

limpid thistle
#

when googling shading with eclipse it leads to some sun protection sites ๐Ÿ˜„

gusty comet
#

xD

tough kraken
#

lmao

naive mountain
#

Does anyone know what this means?
[WARNING] Error whilst handling query packet from /xx.xx.xxx.xxx:42652
java.lang.IllegalStateException: No session!
(Bungee)

tough kraken
#

lets protect from the sun guys!

limpid thistle
#

i would suggest using maven tbh

#

It has pretty convenient plugins

gusty comet
#

Yeah it looks kinda complicated xD

#

pom.xml bla bla

limpid thistle
#

which just make our lives easier

#

well

#

the ide does pretty much everything for you

gusty comet
#

ah ok

sturdy oar
#

no it's not complicated, and if you plan to continue using java you'll be forced to use it someday

naive mountain
#

java.lang.IllegalStateException: No session!
at net.md_5.bungee.query.QueryHandler.handleMessage(QueryHandler.java:95)
at net.md_5.bungee.query.QueryHandler.channelRead0(QueryHandler.java:56)
at net.md_5.bungee.query.QueryHandler.channelRead0(QueryHandler.java:22)
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:99)
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.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
at io.netty.channel.epoll.EpollDatagramChannel.read(EpollDatagramChannel.java:679)
at io.netty.channel.epoll.EpollDatagramChannel.access$100(EpollDatagramChannel.java:58)
at io.netty.channel.epoll.EpollDatagramChannel$EpollDatagramChannelUnsafe.epollInReady(EpollDatagramChannel.java:497)
at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:475)
at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:378)
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at java.lang.Thread.run(Thread.java:748)

gusty comet
#

aight ok thanks

sturdy oar
#

remove this message

#

don't flood god damn

tough kraken
#

use ?paste

naive mountain
#

Who?

tough kraken
#

?paste

worldly heathBOT
tough kraken
#

you...

sturdy oar
#

did you realize you flooded the chat

tough kraken
#

paste it there, and post the link

naive mountain
#

?paste

tough kraken
#

just use my link

naive mountain
#

No

#

Can someone at least fix bungee

tough kraken
#

then you won't get support lmao

#

wtf

#

bungee isnt the problem bro

naive mountain
#

Why give something away for free that has been so buggy for years

limpid thistle
#

is this a bungee internal bug?

naive mountain
#

This is a bungee problem...

limpid thistle
#

if you think it is a bug, you can report it on github

naive mountain
#

I don't know why it is so hard to write a proxy server without 1000's of unexplainable errors

limpid thistle
#

Then write your own one ๐Ÿ™ƒ

naive mountain
#

To much work

sturdy oar
#

Never had an error on Bungee

tough kraken
#

then dont hate on others

#

Never had an error on Bungee
@sturdy oar same

#

expect my mistakes

#

so if i get it right: you are coming here, just to flood the chat, and if told to paste it on hastebin you just begin to blame others, for things that MAYBE you can handle by yourself

is that right?

naive mountain
#

Lol

#

Flood the chat? You're taking in help about general stuff

#

You're the one flooding it

undone narwhal
#

Does someone ever used Factions API? Is it the same API for all forks (FactionsUUID, SavageFactions, ...) ?

tough kraken
#

if you mean asking and answering questions about maven, yeah you are right

#

for real, you can only be a troll

#

Does someone ever used Factions API? Is it the same API for all forks (FactionsUUID, SavageFactions, ...) ?
@undone narwhal i think so

naive mountain
#

I'm not a troll, I need help with an error.

tough kraken
#

then paste the error on the link that was sent, and everyone here will try to help

naive mountain
#

You should be able to paste in an error on a #help-archived chat don't you think? Or should I just do all of my messages in a pastebin lol? if my message is gonna be longer than 3 lines i'll put it in md5's pastebin.

tough kraken
#

?paste is not without cause

worldly heathBOT
naive mountain
sturdy oar
#

VGNC

#

don't mention

#

that damn message please

tough kraken
#

yeah sorry ๐Ÿ™‚

#

first of all, remove ip's etc from stacktraces or errors, its very unsecure,

#

and i will take a look at it, give me a moment

#

which bungeecord version are you using

sturdy oar
#

@naive mountain The player's session is null

#

or his challengeToken somehow ended being different than his session token

tough kraken
#

means just restart the client?

naive mountain
#

git:BungeeCord-Bootstrap:1.15-SNAPSHOT:2f54c94:1500 by md_5

tough kraken
#

tried it with the newest?

naive mountain
#

No, this only happens on this IP

#

It's another VPS of mine

tough kraken
#

wait a moment

naive mountain
#

That IP is prerouted. I suspect it's someone refreshing their serverlist?

tough kraken
#

so thats what bungeecord is doing:
if ( session == null || session.getToken() != challengeToken )
{
throw new IllegalStateException( "No session!" );
}

sturdy oar
#

i already told him that

tough kraken
#

so that means you session is null, maybe restart the client, or remove that VPS if possible

naive mountain
#

It's not a big problem right

tough kraken
#

so that means you session is null, maybe restart the client, or remove that VPS if possible
@tough kraken

naive mountain
#

Yeah I can't

#

the VPS routes traffic to the proxy

tough kraken
#

its probably because of that vps

naive mountain
#

Without it my players won't be able to play

tough kraken
#

is the problem only on your side, or can nobody join?

naive mountain
#

No, people can join, I can too. I just get that error message a lot and I don't know why.

tough kraken
#

then its definitely your vps, if you tried to restart your full mc-Launcher

naive mountain
#

Alright

#

But this can't crash bungee right?

tough kraken
#

i think

#

if it does, you will see

naive mountain
#

Yeah it's happening for a while and it crashes sometimes but I'm not sure if it's related to this.

#

But anyone could preroute traffic to my bungee

#

So it shouldn't crash it

tough kraken
#

idk

naive mountain
#

okey, thanks!

ripe ledge
#

I need help pls
How I can get a file that is in the resources folder?

rare prairie
#

JavaPlugin#getResource

ripe ledge
#

JavaPlugin#getResource
@rare prairie nope
Can't do that
File file2 = new File(plugin.getResource("BridgingArea.schem"));

naive goblet
#

What are you trying to do

livid spruce
#

What are you trying to do
@naive goblet do you mean me?

ripe ledge
#

What are you trying to do
@naive goblet Get a file that inside the resource folder

naive goblet
#

resource folder? You mean inside the jar?

#

Roader no but you could explain if you want

ripe ledge
#

resource folder? You mean inside the jar?
@naive goblet yeah inside the project

noble aurora
#

When i do the command /lands it just doesnt do anything

#

i dont even get a log

vernal spruce
#

Is creative inventory still heavly client sided?

frigid ember
#

who can help me make a server

#

the videos wont help me

frigid ember
#

dont do blocks.size() - 1

#

or make the sublist actually get the first 25 blocks

#

(right now it gets 26)

#

basically in your code if the blocks is exactly 25 the sublist would be getting a nonexistent 26th block

livid spruce
#

Okay

#

So I should remove -1 ?

#

@frigid ember

#

I have removed it.

#

But the error still comes.

frigid ember
#

code?

livid spruce
frigid ember
#

you didnt fix the sublist

livid spruce
#

?

#

How should I fix?

frigid ember
#

he just told you

smoky anvil
#

How do I remove blocks from a user? I accidentally let people use /acb.

frigid ember
#

right now it gets 26 blocks

peak glade
#

hello

livid spruce
#

yes

peak glade
#

but why its A ?

#

i want emoji ?

#

so problem ?

#

โžฆ

#

this

desert kraken
#

anyway to edit how raids work?

#

eg wave amounts, mobs spawned etc.

frigid ember
#

probably looking for RaidSpawnWaveEvent

livid spruce
#

right now it gets 26 blocks
@frigid ember So change it to 24 ?

frigid ember
#

there's also Raid and RaidEvent, take a look at those

karmic sable
#

How to add PlugMan as a Maven Dependency? Cannot find it anywhere.. EDIT: https://jitpack.io

frigid ember
#

and yes @livid spruce

balmy sentinel
peak glade
#

its not work

balmy sentinel
#

can you show your code?

livid spruce
#

Why 0,24?

#

Ahhhhhh

#

lost

peak glade
#

yes its not work

frigid ember
#

how to get class listener?

balmy sentinel
#

@peak glade can you take a screenshot of your code and send it?

livid spruce
#

It still not work @proud furnace @frigid ember

peak glade
#

k wait

#

\U2758

frigid ember
grim halo
#

@peak glade Do you have a resourcepack installed?

subtle blade
#

"How do I get an instance without an instance"

#

That's what you just asked

grim halo
frigid ember
#

-_-

peak glade
#

whar resourse pack ?

grim halo
#

@peak glade Any

peak glade
#

hmm ?

#

i have

#

its nothing

#

why ?

balmy sentinel
#

@frigid ember I donโ€™t know what youโ€™re asking, but if youโ€™re trying to register events you need the PluginManager.

frigid ember
#

I want to get the class instance itself listener

grim halo
#

There is no "instance itself" unless you designed it as singleton.

peak glade
#

hmmm

#

its not work

frigid ember
#

that is, you need to initialize it (this)?

grim halo
#

Do you want the class itself? Then its Listener.class

subtle blade
#

Let's start from square one. For what reason do you need an instance of your listener.

#

There should be nothing of importance in a class implementing Listener

frigid ember
#

functions are not visible and variables

balmy sentinel
#

@peak glade you need to show us your code if you want us to help

subtle blade
#

There should be nothing of importance in a class implementing Listener

#

Everything in a listener should be outsourced

#

I have no data held within these. Everything is pulled from other classes

grim halo
#

@frigid ember Methods and fields in a non static scope are only "visible" if you have an instance of a class. Thats OOP 101

peak glade
#

๐Ÿ˜ฆ

frigid ember
#

@frigid ember Methods and fields in a non static scope are only "visible" if you have an instance of a class. Thats OOP 101
@grim halo thank you

subtle blade
#

inb4 "Well okay! I'll just make everything static"

grim halo
#

@peak glade Minecraft doesnt escape unicode in chat. You can only do that with a String you have sent from a plugin.

#

send or sent here? <- pls help, fellow native english speakers ^^

subtle blade
#

sent

#

Past tense

grim halo
#

thx

lapis plinth
#

how do I create config files like this
this:
idk:
idk1:
idk2:

peak glade
#

hey

#

im so sad but how ?

noble aurora
#

I need help, I try to do /lands for a plugin but when i wanted to find the problem it just says I issued the command

#

It doesnt work

lapis plinth
#

contact the plugin dev

noble aurora
#

He asked me for a log

#

But it just says i issued the command

#

Instead of a fail

lapis plinth
#

then give him the latest.log of your server?

pastel needle
#

My spigot account was stolen. I have explained to the official. But they still did not respond...

balmy sentinel
#

@lapis plinth wdym how do you create config files like that?

lapis plinth
#

Like with parents and children idk what its called

#

Like it goes into the category of this, then into idk, then reads idk1

subtle blade
#

My spigot account was stolen. I have explained to the official. But they still did not respond...
You're responsible for your own account

balmy sentinel
#

Iโ€™m pretty sure you just get the config and then get the string or whatever it is at โ€œthis.idk.idk1โ€

lapis plinth
#

huh ok

pastel needle
#

You're responsible for your own account
๐Ÿ™

grim halo
#

@lapis plinth I think you want to create ne ConfigurationSections

balmy sentinel
#

@lapis plinth like if it was a string at idk1 that youโ€™re trying to get youโ€™d type getConfig().getString(โ€œthis.idk.idk1โ€);

wheat summit
#

Is there any method to restart a server?

lapis plinth
#

kk

frigid ember
#

Hello! I am looking to contribute to spigot and submitted the CLA a couple of days ago, but haven't received any response yet. Can anyone help me?

true raptor
#

hi. im kinda new to spigot. When I start my server, I get a message saying *** Error, this build is outdated ***
*** Please download a new build as per instructions from https://www.spigotmc.org/go/outdated-spigot *** but I am using spigot 1.16.1

subtle blade
#

Read that last line, please

#

The answer is literally staring you right in your face

true raptor
#

im using the latest version tho

subtle blade
#

You're not

#

If you were to do /version, I guarantee you you're a few builds out of date

true raptor
#

yea I tried that and it said im like 40 versions behind or something

subtle blade
#

im using the latest version tho

#

???

true raptor
#

like 1.16.1

subtle blade
#

Follow that link and its instructions

#

Spigot releases hundreds of builds every version of Minecraft

frigid ember
#

@true raptor he doesnt mean latest mc version, he's talking about latest spigot build

grim halo
#

@wheat summit Bukkit.shutdown() after properly configuring your start shellscript

true raptor
#

@frigid ember ohhhh

wheat summit
#

Ok thanks

subtle blade
#

BuildTools will help you build the latest version of Spigot every time

true raptor
#

im using this java -jar BuildTools.jar --rev 1.16.1

subtle blade
#

Yes, so run that again

true raptor
#

ok

subtle blade
#

You should be doing this frequently. Once every few days

peak glade
#

hey

#

can help me ๐Ÿ˜ฆ

lapis plinth
#

im still confused about configurationsections

#

xd

#

like how do i create them, and how do i read them etc

subtle blade
#

Configuration sections are dot separated

#

They're created automatically

#

config.set("Foo.Bar.Baz", 10); will result in

Foo:
  Bar:
    Baz: 10```
grim halo
#
    configuration.set("A.B.ValueInB", 100);
    
    or
    
    final ConfigurationSection sectionA = configuration.createSection("A");
    final ConfigurationSection sectionB = sectionA.createSection("B");
    sectionB.set("ValueInB", 100);
subtle blade
#

You don't need to create them yourself

#

You can, but you don't need to

grim halo
#

Its sometimes handy if you want to pass them to other objects for saving/loading

harsh anvil
#

is there a Title API in spigot?

frigid ember
#

yes

harsh anvil
#

what classes am i looking for?

#

i cant really find it

subtle blade
#

Player#sendTitle()

serene inlet
#

what's the best plugin to protect chests? I've installed EssentialsX, Vault and LuckPerms so if any of those offers this...

harsh anvil
subtle blade
#

Version?

harsh anvil
#

1.16 lol

subtle blade
#

Your IDE is broke lol

harsh anvil
#

actually nvm its still on 1.15 lmfao

#

lemme update

subtle blade
#

That was present in 1.15 too

#

It was present in like... 1.10

harsh anvil
#

the fok

#

its paret of the spigot api right, wtf

#

confusion

subtle blade
#

Yes, though it's a Player method. org.bukkit.entity.Player

#

Not Player.Spigot

harsh anvil
#

bruh moment

#

this getPlayer returns a human entity

#

no wonder its not working lmfao

#

wtf

subtle blade
#

That'd do it

wheat summit
#

Does anyone know how to stop rain through a plugin and not via gamerule?

frigid ember
#

Does anyone know how to deserialize A gui From config(Custom Guis).

#

set up a task for setting the weather to be clear

serene inlet
#

anybody? ๐Ÿ™‚

frigid ember
#

although the gamerule saves you from doing that so i dont get why you wouldnt use it

#

config mean yaml file

crimson sandal
#

How intensive is sendBlockChange()? I'm currently sending it to all online players every 5 ticks and loop over up to 100s of blocks to replace with Air. I'm not sure how performance would be with a large amount of players and blocks

frigid ember
#

๐Ÿง

lost siren
#

So I have a general question here, does Spigot not support entitydata or is there another way to do it?

I was trying to give myself the invisible item frame for 1.16. I had essentials running, so I thought that might have been the issue somehow. I tried it via command block, that didnt work either. I then went into a single player world and saved a copy to a hotbar. When I went back to my server though, it completely got rid of the nbt data of it, which I thought was weird because I had transferred other things with nbt data that way.

Any suggestions here?

crimson sandal
livid spruce
#

@harsh anvil

#

Whats your Intellij theme?

#

That looks really nicee

harsh anvil
#

its from the MaterialUI plugin

unborn jewel
#

what's the dependencie for 1.8.8 spigot

harsh anvil
#

ew

frigid ember
#
    <groupId>org.spigotmc</groupId>
    <artifactId>spigot-api</artifactId>
    <version>1.8.8-R0.1-SNAPSHOT</version>
    <scope>provided</scope>
</dependency>```
unborn jewel
#

no i need the CompileOnly

harsh anvil
#

bruh

frigid ember
#

just search up spigot gradle, its the first result

harsh anvil
#

stop being stuck in the stone age

nocturne wedge
#

there is something wrong with my server when ever i load up my server it loads up normaly but when i try to join it it shows cant connect to server

frigid ember
#

that can be for a lot of reasons

unborn jewel
#

i don't see 1.8.8 one

#

I see 1.12.2

frigid ember
#

then change the version...

#

why i'm have that error ?

unborn jewel
#

compile 'org.spigotmc:spigot-api:1.8.8-R0.1-SNAPSHOT'

#

like that?

frigid ember
#

yes

unborn jewel
#

do i need this testCompile

frigid ember
#

what testCompile

#

just copy the code from the spigot gradle page and modify it to your needs

unborn jewel
frigid ember
#

why i'm have that error ?

unborn jewel
#

i don't think its .spawn

frigid ember
#

.spawn exactily

livid spruce
#

It still not work
@livid spruce

wanton delta
#

@frigid ember you need to specify a location

frigid ember
#

a yes.

lapis plinth
#

@subtle blade so config.set("Foo.Bar.Baz", 10); creates "baz" as the final thing, what would I do if i wanted to create "baz2" and what'll be the method to read "baz" and "baz2"?

subtle blade
#

getInt(), getString(), so on and so forth

#

Same path

lapis plinth
#

how would I create baz2 if i wanted it right under baz?

naive goblet
#

baz.baz2 ?

lapis plinth
#

No i mean like

naive goblet
#

FileConfiguration#set

lapis plinth
#

Foo
Bar
Baz
Baz2

naive goblet
#

Foo.Bar.Baz2

lapis plinth
#

but then Baz2 would be inside of the baz section right?

#

OH

#

wait im dumb

#

ignore what i just said

naive goblet
#

Alg?

lapis plinth
#

ye

frigid ember
#

Is it possible to add like /mutechat:mutechat to skript instead of /mutechat

lost siren
#

@crimson sandal hate to tag you but I just wanted to thank you for answering earlier. Essentials was in fact the case causing the issue. I just have to use "minecraft:give" in order to obtain it. Kinda weird that the nbt data disappeared though from the hot bar. Again thanks.

naive goblet
#

@frigid ember skript?

frigid ember
#

@naive goblet yh

#

but its gonna sudo them to do /chatmanager:mutechat

naive goblet
#

Wth is that

frigid ember
#

Skript is designed to be a culprit
Change my mind

lapis plinth
#

skript is like making a plugin in YAML

peak glade
#

please help me ๐Ÿ˜ฆ

#

why not work code this but deluxechat not work emoji

lapis plinth
#

ask the plugin dev

balmy sentinel
#

@peak glade if youโ€™re still trying to get emojis and symbols to work in chat Iโ€™ve already told you we canโ€™t help unless you share your code with us so we can debug and figure out whatโ€™s wrong

frigid ember
#

how to load missing value in default config?

halcyon elm
#

Hey, I was wondering if anyone could help me with some issues im having making an inventory where you click an item and it goes into the correct slot. I have a video showcasing the glitches if anyone wants to look

#

i would also give my code, here's the video

#

wait one sec

frigid ember
#

public BucketEvents bucket = new BucketEvents(this);
public BoatEvents boat = new BoatEvents(this);

lapis plinth
#

Bukkit.getPluginManager().registerEvents(new BlockBreakListener(), this);
So i have ^ in my main class, and the class im trying to register has a constructor from another class
How would I fill in the new BlockBreakListner() with whatever im suposed to put?

frigid ember
#

how would I access these classes from my Main to another class?

lapis plinth
#

create a constructor

tiny dagger
#

and pass it by the constructor thoughout your plugin where needed

frigid ember
#

the constructor has to be made in main or the class in which I need it?

lapis plinth
#

whatever class you need it

tiny dagger
#

the class where needed

frigid ember
#

ok ty

balmy sentinel
#

@halcyon elm explain further?

frigid ember
#
         public DelayedItems plugin;

            public BucketEvents(DelayedItems plugin) {
                this.plugin = plugin;
            }```
#

so something like this

halcyon elm
#

I can't really explain, the video explains it well but I'm waiting for it to upload so i can post the link

frigid ember
#

but this will link this class w/ main right

balmy sentinel
#

Iโ€™ll take a look once you post it.

halcyon elm
#

there ya go

#

its supposed to be if you click a hammer, it goes into theslot on the left, and if you click a book it goes onto the slot in the right

#

but it's kinda buggy

frigid ember
#
         public DelayedItems plugin;

            public BucketEvents(DelayedItems plugin) {
                this.plugin = plugin;
            }```

@tiny dagger ?

tiny dagger
#

yes

#

like this

halcyon elm
#

if u want the code i will dm, I don't really wanna post it here cuz it's so long

tiny dagger
#

not sure why public

#

usually fields must be private

#

and just the methods public

frigid ember
#

and now how do I access the hashmap of the other class

#

I have 2 classes and main

tiny dagger
#

getters and setters

balmy sentinel
#

@halcyon elm from what I watched itโ€™s doing that? Only issue I saw was when you clicked the book it didnโ€™t return and said you were clicking an empty slot. That can be fixed in the InventoryClickEvent and making sure youโ€™re event.getSlot() is the right number that corresponds with that slot.

frigid ember
#

getters and setters
@tiny dagger wdym with getters and setters exactly searched around but idk how I would do that here :/ sorry

halcyon elm
#

Another issue is that if you click the hmmer when the book is already there, the hammer will go into the slot, but a duplicate hammer will appear. Same with if you click a book when the hammer's already there, a duplicate book will appear. @balmy sentinel

tiny dagger
#

you know

#

public Map<key, val> getHashmap() {
return hashmap;
}

#

@frigid ember

#

you're probabily seeing it thoughout the bukkit api

frigid ember
#

copy my hash from the other class?

tiny dagger
#

getsomething

#

setsomething

#

no don't copy

#

just make a get method

#

hashmaps don't even need a set method

#

in 90% of cases tho

frigid ember
#

So I only need to get it

tiny dagger
#

yes

#

from the class you defined and init it

frigid ember
#

uhh

#

in both classes?

tiny dagger
#

you should be learning java tho

frigid ember
#

only the one I need it in right?

tiny dagger
#

before going straight in

#

just the class

#

it has the field of the hashmap

#

then if you need it

#

classwithhashmap.getHashMap().put

#

whatever

balmy sentinel
#

@halcyon elm before a player clicks make sure that there isnโ€™t a book already in that slot or a hammer already in that slot. If there is just send them a message saying it there is already a book/hammer in the slot or just ignore it. I think your problem is youโ€™re not checking to see if something is already in the slot.

tiny dagger
#

or if you want something like this

halcyon elm
#

I did do that, actually.

#

It just cancels it and returns if that happens

wheat summit
#

Would anyone know why BungeeCord gives me this error? java.lang.IllegalArgumentException: Objective Rank already exists in this scoreboard I do set a scoreboard though am not sure since there is no Objective Rank

#

At least I think so ^

frigid ember
#

public HashMap<Location, Long> getHashmap() {
return boatLocation;
}

#

so this in the class with the hash

#

and in the class where I need to get it from

#

classwithhashmap.getHashMap().

balmy sentinel
#

@halcyon elm without code I donโ€™t know if I can help. Put it in a pastebin and send it here

#

?paste

worldly heathBOT
halcyon elm
#

ok

shell fog
#

Lazinq, return the hashmap's super interface (Map) instead of the direct implementation in order to comply with the liskov substitution principle

#

not a fix to your problem btw

#

just a tip

frigid ember
#

ty

#

but getHashMap() still is in another file? @tiny dagger

#

to access it I would still have to use static right?

#

and than the hashmap still will be used static

halcyon elm
frigid ember
#

so I probably did something wrong :/

grim halo
#

Also you generally dont want to pass datastructures around. Write methods in the class that maintains the map to manage its content.

shell fog
#

If you do have to pass it around, provide an immutable copy

frigid ember
#

me?

halcyon elm
#

Also @balmy sentinel feel free to alert me to any sloppy practices. I am relatively new to java

shell fog
#

first sloppy practice, using pastebin

halcyon elm
#

?

shell fog
#

I think you'll find that most people don't like pastebin, due to it's lack of a dark theme, unintuitive design, and ads

halcyon elm
#

What is wrong with it?

#

oh

#

ok

shell fog
#

use hastebin

frigid ember
#

?paste

worldly heathBOT
halcyon elm
#

Alright I will keep that in mind

shell fog
#

or any installation of hastebin, such as the one lazinq just linked

frigid ember
#

there are a lot of those made for coding

shell fog
#

they're all the same thing lazinq

frigid ember
#

yep

shell fog
#

like I mean the exact same thing

#

hastebin is open source

frigid ember
#

true

#

but

#
        public Map<Location, Long> getHashmap() {
            return boatLocation;
            }```
#

this should be in my class with the hashmap right ๐Ÿ˜

shell fog
#

Also you generally dont want to pass datastructures around. Write methods in the class that maintains the map to manage its content.

halcyon elm
#

@balmy sentinel I have to go, I'm very sorry. If you would like to help me further please accept the friend request I'm sending you and DM me. Thanks!

#

wat

simple spruce
#

Should Crate Key plugin Items be hard coded to the plugin or not? if someone's experienced with making one

halcyon elm
#

ok just send me a request I guess

shell fog
#

Should Crate Key plugin Items be hard coded to the plugin or not? if someone's experienced with making one
@simple spruce no, there's no reason for them to be

balmy sentinel
#

@halcyon elm I think youโ€™ll find it easier if you just switch(event.getSlot()) and then check per case. Thatโ€™s how Iโ€™ve always done inventory click events. Iโ€™m on my phone so it was somewhat hard to read the code but the error I believe is coming from your boolean values not be set properly.

simple spruce
#

What's the reason that they shouldn't be? @shell fog

halcyon elm
#

What do you mean "check per case" @balmy sentinel ?

shell fog
#

because it's so simple to make them not hardcoded, and extremely beneficial to have them not, as it gives you the ability to update it without having to recompile the plugin

balmy sentinel
#

switch(event.getSlot()) {
case 14:
//Whatever you want to do when a player click slot 14
break;
default:
}

vernal spruce
#

just slap a persistentdata in the item and boom

#

plugin unique item

halcyon elm
#

oh u mean a switch, ok thanks

#

bai

fossil shoal
#

What does PlayerInventory#getItemInOffHand return if there is no item there?

crimson sandal
#

@crimson sandal hate to tag you but I just wanted to thank you for answering earlier. Essentials was in fact the case causing the issue. I just have to use "minecraft:give" in order to obtain it. Kinda weird that the nbt data disappeared though from the hot bar. Again thanks.
@lost siren Ah yeah! Essentials replaces a lot of the vanilla commands still, which from experience do more than the essentials ones do now ๐Ÿคทโ€โ™‚๏ธ

vernal spruce
#

i think that was the bs one

balmy sentinel
#

@fossil shoal check the javadocs it should tell you.

fossil shoal
#

I did, it does not

vernal spruce
#

it returns NotNull so its air

#

i remeber something was bs with that specific method

peak glade
#

Its work

#

but why cant problem so

#

โ˜

dusk shard
#

Is there a reason why spigot uses short plugin channels?

peak glade
#

hey how are you ๐Ÿ˜„

#

so i need hide

#

plugin list hide

subtle blade
#

@fossil shoal

    @Override
    public ItemStack getItemInOffHand() {
        return CraftItemStack.asCraftMirror(getInventory().extraSlots.get(0));
    }```
#

Where getInventory() is net.minecraft.server.PlayerInventory, extraSlots is a NonNullList

#

So an ItemStack of type AIR

#

Unfortunately Bukkit is very inconsistent with where it returns air and where it returns null but it would be a breaking change to make that consistent

#

Or at least a change that might break plugin logic. As far as I'm concerned, ItemStacks pulled from vanilla should never be null but that's not always the case

fossil shoal
#

thanks for the detailed explanation

subtle blade
#

For future reference, CraftBukkit repo on the Stash you can find implementations of any method and see what they return

crimson sandal
#

Is there an event fired when a player tries to place a block where there already is a block? E.g I'm sending the player sendBlockChange() packets and replacing the block with Air, so the server won't let the player place anything there obviously, I'm just wondering if that fires any events because it doesn't seem to fire BlockPlaceEvent?

old elk
#

i updated my server to 1.16.1 and all players have default skins now I have no idea why

crimson sandal
#

You might have turned offline mode on by accident in the config

old elk
#

im using bungee cord I turned it on for that

crimson sandal
#

Ah, I'm not too familiar with bungeecord

peak glade
#

hello

subtle blade
#

Is there an event fired when a player tries to place a block where there already is a block? E.g I'm sending the player sendBlockChange() packets and replacing the block with Air, so the server won't let the player place anything there obviously, I'm just wondering if that fires any events because it doesn't seem to fire BlockPlaceEvent?
The block change is not on the server so the server can't possibly know that

#

Yes, there is an event if a block is placed where a block already exists, BlockPlaceEvent. It's called when a player places a block on, say, tall grass and replaces it. Though that does not get called for client-sided blocks. It can't

balmy sentinel
#

@peak glade we cant help if you donโ€™t tell us whatโ€™s wrong

peak glade
#

frog

balmy sentinel
#

that doesnโ€™t tell us anything

peak glade
#

symbol not work

#

but why ?

balmy sentinel
#

If youโ€™re talking about the symbols that were broken early Iโ€™ve already told you three times send us your code or we canโ€™t help. Iโ€™ve also already sent you a spigot thread that goes over that issue

crimson sandal
#

The block change is not on the server so the server can't possibly know that
@subtle blade So I'm replacing a sign with air and wanted to detect if the player tried to place a block in that air. How is that client sided? Surely the client sends a packet to replace the block and the server rejects it?

subtle blade
#

Because the server has no block to replace

#

The server responds with a packet saying "Hey, y'know there is a block here..."

#

When a player places a block, it isn't a demand. It's asking to place a block

crimson sandal
#

Yeah that makes sense, I was just wondering if there was an event that fires when the server gets that "ask" because it would be useful.

subtle blade
#

No, there is not

#

There's no change on the server so plugins don't need to listen to it

true raptor
#

Previously, when I tried to start my server, a message in cmd said that the build is outdated. After going to the spigot website and following the instructions to run build tools, I tried to change the directory of my build tools file, but cmd says "The directory name is invalid"

crimson sandal
#

I'm just wondering how else I could achieve it

rotund orbit
#

Hey everyone, I'm trying to create a custom spawn plugin for one of 16 spawns in my world. Players type /start and go through a process where eventually their spawn is set and they are teleported. When they die, though, they go back to the original world spawn set by Multiverse. Am I attempting to do this wrong?

@EventHandler
public void onSpawn(PlayerSpawnLocationEvent event) {
    if (playerSpawns.containsKey(event.getPlayer().getName())) {
        event.getPlayer().teleport(playerSpawns.get(event.getPlayer().getName()));
    }
}
balmy sentinel
#

@true raptor type โ€œcd โ€œ and then drag the buildtools into the command prompt

true raptor
#

@balmy sentinel thats what I did

crimson sandal
#

@rotund orbit for your map of player spawns you should be using players UUID's and not their names, to start, ideally.

rotund orbit
#

I use players' names for all my things o.o

crimson sandal
#

And secondly, you might want to try delaying the teleport command by a tick

#

What about plugins that change players names etc? UUID is the only thing that is unique for every player ๐Ÿ˜›

fossil shoal
#

I use players' names for all my things o.o
Players can change their name

crimson sandal
#

And that too

rotund orbit
#

ouch well

#

better fix that then haha

#

Got probably 7-8 custom classes that use names to find save files and such.

true raptor
#

@balmy sentinel This is what happened after I dragged the build tools jar file into cmd
C:\Users\g6355>cd C:\Users\g6355\Desktop\BuildTools\BuildTools.jar
The directory name is invalid.

rotund orbit
#

I'll try delaying the teleport, thank you.

crimson sandal
#

It's not that difficult to switch everything to UUIDs most of the time luckily ๐Ÿ˜› Just a lot of refactoring if you've already wrote a lot of code using it ๐Ÿ˜ฆ

rotund orbit
#

Yeah it'll be a lot of refactoring ๐Ÿ˜›

#

unless I just add a UUID field and check if its different every load

#

and then change the name if it is

crimson sandal
#

The UUID of a player wouldn't change, it's unique and the same always

rotund orbit
#

whoops sorry I meant if the name has changed but the UUID matches

crimson sandal
#

That wouldn't work for plugins that change player names though, it's not that much hassle changing it anyway ๐Ÿ˜›

balmy sentinel
#

@true raptor because BuildTools.jar isnโ€™t a directory. Delete that part of it so cd C:\Users\g6355\Desktop\BuildTools

crimson sandal
#

The easiest way to open a Command prompt in the BuildTools directory is to open the folder windows explorer and type "cmd" enter into the address bar ๐Ÿ˜›

crimson sandal
subtle blade
#

You can hold shift and right click in the directory as well to open a window there

lapis plinth
#
case STONE:
                        int currentStone = customConfig.getInt("IslandMissionStorage.MissionOne.Stone");
                        customConfig.set("IslandMissionStorage.MissionOne.Stone", currentStone + 1);
                        if (currentStone + 1 == stoneOne) {
                            customConfig.set("IslandMissionStorage.MissionOne.StoneCompleted", true);
                        }
                        customConfig.save(customYml);
                        break;
#

So i have this

#

and whenh I break a stone block, it sets the stone config to one, but when i break another, its still set to 1

wheat mirage
#

When using entity navigation, should the location they navigate to be the empty air space above the block or the block itself?

brisk barn
#

@lapis plinth whats inside customYml ? is that updated ?

lapis plinth
#

Wdym is that updated?

brisk barn
#

is that variable a path or the contents to save ?

#

other than that dont see anything wrong with the code tbh

wheat mirage
#

I'm having issues with Entity Navigation.

#

Using getNavigation#a(double, double, double, double)

#

leads to the entity stopping a block or two early, and never reaching it's actual goal. Does anyone know why?

#

Other minecraft behaviour uses the same functionality with no issues.

dusk shard
#

Fabric api has issues with connecting afaik with the limit

frigid ember
#

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

quartz trench
#

anyone know if it's possible to stop the text from getPromptText in Prompt (Conversation API) from printing? when I return null for getPromptText it sends me a message that says null. What im trying to do is use my own json messages instead of the conversation api ones. my messages work fine but the null/empty message is annyoing

frigid ember
#

how do i change the color of redstone particles in 1.15?

subtle blade
#

Pass DustOptions to the spawnParticle() method

frigid ember
#

I feel like I missed this somewhere but i figured I'd just ask. My account is rather new on SpigotMC and I just verified it through email. I still can't write reviews on plugins, am I missing something?

subtle blade
#

You'd have had to have downloaded the plugin first but aside from that, you should be fine

frigid ember
#

I've downloaded it a few times, no luck unfortunately

subtle blade
#

To my knowledge anyways. I don't think there's an account age minimum

peak glade
#

hello

mental glen
#

2 questions:

  1. Is it possible to force feed something to a player? Like pushing a button and it "feeds" them bread? Not heal - specifically feed.
  2. Is it possible to get an item's/material's (specially food) hunger and saturation? (how much they refill if eaten)
    Thx for the help!
frigid ember
#

Ah nvrm

#

Got it now

lapis plinth
#

@brisk barn File customYml = new File(path + "/" + user.islandID + ".yml");
System.out.println(user.islandID);
FileConfiguration customConfig = YamlConfiguration.loadConfiguration(customYml);

karmic sable
#

2 questions:

  1. Is it possible to force feed something to a player? Like pushing a button and it "feeds" them bread? Not heal - specifically feed.
  2. Is it possible to get an item's/material's (specially food) hunger and saturation? (how much they refill if eaten)
    Thx for the help!
    @mental glen 1) You could simulate this by recreating the values
  1. in code? You could just look it up
#

Whats the context, maybe I can provide better answers

mental glen
#

I'm basically trying to implement insta-eat

#

The moment a player right clicks with food in their hand it gets eaten - default values

karmic sable
#

If you're making a plugin, you could work this way:
Get a file (or hardcoded?) with the food values
-> Check or rightclickevent of a food type (or w/e u want to do to get the instaeat thing)
-> remove one item of the stack
-> generate the corresponding amount of healing
-> ???
-> profit

mental glen
#

That was my initial thought as well

#

But I thought there might be a "consume item" command (not event)

#

Instead of hardcodibg every single food value

karmic sable
#

there is like 40 foods to consider, I don't think it would be hard to create a .yml file with all the foods in it (so you could also edit it afterwards to "buff" or "nerf" a food)

#

if you want to, I can create the plugin tomorrow?

#

I'm not a seasoned coder but I think I could do it in a (few) hour(s)

mental glen
#

Nah no need, I want to do it myself - thx though

#

But small problem with the hardcoding

#

You need to consider the effects of each food as well...

vernal spruce
#

hmm let me see

mental glen
#

Like rotten flesh poisoning, and the different effects of each stew

vernal spruce
#
        APPLE(4,2),
        BAKED_POTATO(5,6),
        BEETROOT(1,1),
        BEETROOT_SOUP(6,7),
        BREAD(5,6),
        CARROT(3,3),
        COOKED_CHICKEN(6,7),
        COOKED_COD(5,6),
        COOKED_MUTTON(6,9),
        COOKED_PORKCHOP(8,12),
        COOKED_RABBIT(5,6),
        COOKED_SALMON(5,9),
        COOKIE(2,0),
        DRIED_KELP(1,0),
        MELON_SLICE(2,1),
        POTATO(1,0),
        COOKED_BEEF(8,12),
        SWEET_BERRIES(2,1),
        PUMPKIN_PIE(8,5),
        RABBIT_STEW(10,12),
        ROTTEN_FLESH(4,0),
        MUSHROOM_STEW(6,7),

        ;


        ;
        private Integer[] value;
        private Foods(Integer value,Integer saturation){
            this.value= new Integer[]{value,saturation};
        }
        public Integer[] getValue(){
            return value;
        }
        public Foods returnByName(String name){
            return Foods.valueOf(name);
        }

    }```
#

food/saturation

#

for most foods..

mental glen
#

Is that enum built-in or did you make it?

karmic sable
#

Thats not a big issue for the food poisoning, just give them a boolean "poisonchance" (or make it a double, and have it a percentage?)

vernal spruce
#

i made it

#

got the values from wiki and built it

karmic sable
#

^

mental glen
#

Nice, thx

#

But I'm really surprised there's no "consume" function

#

Oh well

#

Time to make one!

vernal spruce
#

and from that i simply use the items name Integer food[] = Foods.valueOf(item.getType().toString()).getValue();

mental glen
#

Yeah, figured :D

karmic sable
#

yo DMan, make your plugin public if it works, I might use it in the server I'm creating :)

mental glen
#

I'll try, pretty new with the whole plugins deal

#

But when I'm done I'll publish it

#

Will take a while with exams tho... :P

vernal spruce
#

oh you want to create force eat oh boy

mental glen
#

LooL yeah

vernal spruce
#

ur gonna have alot of fun triggering the eat animation lmao

#

that wall hit me in the face

#

right clicking the food doesnt activate anything but 1 interact event,the food eating is client sided

#

meaning you also have to handle item locking during the eating,so he cant just switch item mid-eating

karmic sable
#

I don't think that can be too hard?

#

rightclick once to insta eat -> switching doesnt matter as the event would already be called

#

holding rightclick is the regular eat animation, ignore it in that case

vernal spruce
#

thing is dont think we can acces the timer for eating

#

you cant know when a item was actually consumed unless ur willing to make a connection between lastclickeditem and the event

#

its so annoying to deal with i just didnt bother covering the animation

#

as i also made a instanteating plugin

mental glen
#

I'm pretty sure that the moment you click with an item in your hand the PlayerInteractEvent is shot, so even if you change or keep the button pushed, it wouldn't matter - it'll just be consumed

vernal spruce
#

more or less you can right click the food and not finish eating it

karmic sable
#

stellrow just check for the quick rightclickevent, and ignore anything else

#

this way a player can choose to cancel the instaeat by holding rightclick

#

or just use the regular animation

vernal spruce
#

the guy wanted delay for some foods lol

karmic sable
#

use delayed events for that?

unborn jewel
#

Occurrences found in comments, strings and non-code files (1 occurrence in 1 file)
im getting this when try putting a package in another package

vernal spruce
#

not delayed events,specific delay for insta eating a food

karmic sable
#

jtx ellaborate wdym putting package in another package.. do you want to import an api?

vernal spruce
#

so a steak wouldnt be instaeated but rather after 5 ticks or so

coarse island
#

best practice wit scoreboards?

  • unique objective per player
  • unique scoreboard per player
unborn jewel
#

Im trying to make put my api package in my other package

karmic sable
#

@unborn jewel do you use Maven framework? If so, you can add the dependency

unborn jewel
#

no

karmic sable
#

Gradle? Should also work

unborn jewel
#

I don't want to add a dependency

#

I want to put my package in another packge

karmic sable
#

Alright I'm not following, I'll leave it to someone else sorry

unborn jewel
#

do you know what a package is

mental glen
#

so a steak wouldnt be instaeated but rather after 5 ticks or so
For me it shouldn't matter what you eat - all food will be consumed instantly

karmic sable
#

a file directory

unborn jewel
#

i want to put a package inside a package

karmic sable
#

if you're in intelIJ you can just create a new package in the package I think

#

not sure

unborn jewel
#

i tried that and didn't work

zealous shore
#

Which ide r u using?

vernal spruce
#

@mental glen in that case you shouldnt bother with the animation

karmic sable
#

Maybe its not possible, why would you need a package in a package? You can just have a folder

unborn jewel
#

Intellij

vernal spruce
#

just consume 1 food at right click

mental glen
#

LooL yeah - that's the plan

pastel condor
#

Anyone know of any free maven repo hosting thatโ€™s reliable?

#

For some reason hosting my repo on GitHub isnโ€™t working

#

I get a 404 error

zealous shore
#

So you right click ur package > new > package

For example. If I had a package miqhtie.thing and I wanted to have miqhtie.thing.commands I would right click

miqhtie.thing > new > package > miqhtie.thing.commands.

#

@unborn jewel

unborn jewel
#

um

karmic sable
#

Stellrow thats what I've been saying :p

unborn jewel
#

doesn't work

karmic sable
#

fierceeo try JitPack to load your github repo; google JitPack

zealous shore
#

Wdym doesn't work.

#

What is not working

rotund orbit
#

What would be the least server-intensive way to make a timer? I want to make food expire after 24 hours. I've been using the getServer().getScheduler().runTaskLater() method, but these tasks don't get saved in the sever restarts I don't think.

tiny dagger
#

save them to a file

#

๐Ÿ‘Œ

karmic sable
#

Can't you give the food a timestamp; and compare to the current time?

mellow wave
#

^

rotund orbit
#

I was thinking of assigning the food a timestamp in its lore, but wouldn't I have to check every second for every food item that I've marked?

tiny dagger
#

^^ and save to a file for restarts

#

oh item

karmic sable
#

every second would work, but whats wrong with every minute? I doubt you care for 59 seconds too late

tiny dagger
#

use the containers

rotund orbit
#

That's fair, so every minute it would check...

grim halo
#

Also if you tag your items then you wont be able to stack them anymore

rotund orbit
#

@tiny dagger Containers confuse me :/

karmic sable
#

You could also check on food movement (inventory events?) or when player tries to eat it; either way, display a chat message as of why it dissapears

rotund orbit
#

That's an excellent idea

#

If I were to use a container to assign a food item a time stamp... what would that code look like?

#

The docs concerning the containers are hard to wrap my mind around.

karmic sable
#

also, I do not know your context of this plugin, but i'd have it "turn into" rotten flesh or something, instead of just deleting it

rotund orbit
#

I think that's a good idea yeah, turning it into rotten flesh.

#

Would two items with different time stamps be able to be stacked together if I used NBT tags instead of lore?

#

Or no matter what, do you lose the stacking ability?

karmic sable
#

probably always lose stack ability

rotund orbit
#

Is doing it through the lore a viable way?

karmic sable
#

It would work yes, but if the food is created one minute (or second, depending on how oyu create the timestamp) apart from each other, it wont be stackable anymore

#

You could put in the lore: "this food wil expire after: (stamp)"

#

and then just compare current time with (stamp), on usage/movement

rotund orbit
#

Alright great!

#

I'll give it a go, thank you for the help.

karmic sable
#

I'm sorry if it's not too useful

rotund orbit
#

No it is ๐Ÿ™‚

#

What is the event for when players move items between inventories?

mellow wave
#

InventoryClickEvent

grim halo
#

There are multiple. InventoryClickEvent, InventoryDragEvent.

mellow wave
#

^

rotund orbit
#

Thank you!

#

I'll do the Click one ๐Ÿ™‚

neat orbit
#

Does anybody know a way to make titles for LuckPerms? Currently each respective rank has a prefix. I want players that have collected different ranks to be able to display the prefix (title) of whatever rank they have.

karmic sable
#

dan could do both to be sure

#

sofilop add permissions to the titles

livid forum
#

Hello! I was wondering if it is possible to update from 1.15 to 1.16 my bungeecord server gives the following error: > 21:16:59 [INFO] [JustDriessen] disconnected with: Could not connect to a default or fallback server, please try again later: io.netty.channel.AbstractChannel$AnnotatedConnectException

#

There is nog other line in the console or the logs.

#

Server ip seems okay.

#

Done this a lot of times but this time it won't work.

grim halo
#

Yes it is possible to update from 1.15 to 1.16. Just make sure you update bungeecord and every target server.

livid forum
#

Still won't resolve the error I have.

#

Normally I just swap the .jars but that doesn't do the trick for me.

#

21:16:59 [INFO] [JustDriessen] disconnected with: Could not connect to a default or fallback server, please try again later: io.netty.channel.AbstractChannel$AnnotatedConnectException

#

Still get that error.

grim halo
#

Check your setup. This error occurs if you try to connect to a closed server.
Make sure your server is running and can be accessed manually. Then setup your bungeecord server with the correct IP.

frigid ember
#

if I do player.getVelocity(), the x and z are 0 if I'm not sprinting, is this supposed to happen?

lone marsh
#

Check your setup. This error occurs if you try to connect to a closed server.
Make sure your server is running and can be accessed manually. Then setup your bungeecord server with the correct IP.
Our bungee server and spigot (paper) server is on the latest version and the ip is correct in the bungee config and the spigot config is on bungeecord mode

subtle blade
#

spigot (paper)
Different software

lone marsh
#

same error with spigotmc, not paper

grim halo
#

If you want paper help use Waterfall and ask on the paper discord

frigid ember
#

Is there a way to get the direction a player is walking in

winged sparrow
#

player.getLocation().getDirection I think @frigid ember

subtle blade
#

That's look direction

frigid ember
#

^

subtle blade
#

Best option is to use the move event to calculate delta values

#

Normalize the resulting vector

frigid ember
#

Yeah I do be kinda bad at math doe

#

What's a delta lol

subtle blade
#

x2 - x1

#

lol

lone marsh
#

okay our problem has been fixen ๐Ÿ™ˆ
#stupidFirewallProblems

frigid ember
#

Oh

#

Okay ty

subtle blade
#

You have getFrom() and getTo(), can work from there

#

In fact, Location has a subtract() method iirc

#

from.subtract(to).toVector(), you have your movement vector

#

Ehm, to.subtract(from)

frigid ember
#

Wait so I would need my location and another vector to subtract from?

grim halo
#

PlayerMoveEvent has a Location "from" and a Location "to"

subtle blade
#

^ subtract from from to and call toVector(), you have your difference vector

frigid ember
#

Oh

subtle blade
#

Ideally you'd call this on the MONITOR priority in case any change occurs

frigid ember
#

Ty

grim halo
#

Just dont change any event parameter when using MONITOR priority

frigid ember
#

Okay

sturdy oar
#

what's org.bouncycastle

#

and why is Bukkit relocating it

subtle blade
#

Crytography API

#

It's possible that NMS depends on it

sturdy oar
#

i thought it was a plugin

#

the name is definetively funny

subtle blade
#

If you think encryption is fun, then yes!

sturdy oar
#

oh so mojang depends on that

#

and bukkit just relocates it

subtle blade
#

Bukkit relocates all of NMS, yes

sturdy oar
#

choco do you have any update for my issue

#

(my Discord username still hasn't updated automatically)

#

i think 7 days have passed now

subtle blade
#

Link me your account, I'll update it

sturdy oar
#

๐Ÿ™ ๐Ÿ™ ๐Ÿ™
thanks jesus

keen compass
#

Should be thanking Choco

sturdy oar
#

Should be thanking Choco
@keen compass I just called him jesus

subtle blade
#

Almost kicked you by accident lol

#

Saw a red button and went "ooooo shiny"

sturdy oar
#

!

#

Hello guys

#

I'm new to this server

#

๐Ÿคฃ

crimson sandal
#

Are Commands run on the main server thread btw? If I make a blocking web request after a command do I need to run it in a different thread?

sturdy oar
#

y e s

#

if you make a web request you always want to run it in a separate thread

crimson sandal
#

Yeah I know, was just wondering if commands got put on a separate thread ๐Ÿ˜› Guess it wouldn't make sense actually since you'd want to be calling bukkit apis

sturdy oar
#

imagine if minecraft used to do stuff on other threads

#

that'd be really funny

crimson sandal
#

Can you send players messages from separate threads? ๐Ÿค”

#

Lmao

sturdy oar
#

yes

subtle blade
#

Yes

sturdy oar
#

although

#

watch out

subtle blade
#

Packets are queued

sturdy oar
#

Choco WAIT >:( im answering

subtle blade
#

OKAY

crimson sandal
#

๐Ÿ˜„

sturdy oar
#

If you send a message from another thread to the console sender you will have the name of the thread which looks weird

#

like [thread.forkPool.common-worker2]: "message"

#

this however is not an issue with in-game chat

crimson sandal
#

Yeah I get you, I've had my fair share of headaches with multi-threading, for my 3rd year physics project I had to simulate 1000s of particle interactions in Java. Everyone else's was taking 10-20 minutes to run so I ended up multi-threading and getting it down to a couple minutes ๐Ÿ˜„ ๐Ÿ˜„

#

Xisumavoid tweeted the Multithreading performance post from the Minecraft Jira before, I can't imagine the headache it would give you trying to multithread Minecraft now

sturdy oar
#

I mean java is pretty fast on multithread

crimson sandal
#

It depends

#

If you're creating and destroying lots of threads over and over for small tasks it can be pretty poor, the time if takes to queue them can take longer than the task itself

neat orbit
#

@karmic sable I have added permissions. But, I want them to be able to change it themselves.

crimson sandal
#

Also, since getOfflinePlayer is deprecated, is there a preferred way to obtain UUID's from OfflinePlayer names from the Mojang API?

#

Oh and if you call getOfflinePlayer() does the server cache the player after it calls the api?

subtle blade
#

yes

crimson sandal
#

Should it get cached in usercache.json?

frigid ember
#

I have 2 classes (and 1 main so 3) but I need to access a hashmap out of another class(both classes not main) without using static. So I linked both classes to main in order to get the hashmap from the other class via main?

crimson sandal
#

Oh my Dev server runs in offline mode, I guess it won't be making any api calls lul

frigid ember
#

But how would I now link the hash to the other class

#

๐Ÿ˜

neat orbit
#

is anyone experienced with deluxetags? pls help me

keen compass
#

create a public method that references the hashmap @frigid ember

#
private HashMap<String, String> something = new HashMap<>();

public HashMap<String, String> getSomething() {
return this.something;
}

@frigid ember

frigid ember
#

In the class where I need it?

#

Yes ofc nvm

old elk
#

I have a bungee cord server and for some reason players skins will not show up on it I dont know how to fix this. my server is 1.16.1 and it started after i updated it. I tried to find fixes on reddit and other places but couldnt find much. setting the servers to online mode doesnt let players join and i thought it was an outdated plugin but that wasnt the case either