#help-archived

1 messages · Page 223 of 1

marsh hawk
#

anyone know how to host a webserver on a port within a plugin (similar to how dynmap does)

naive goblet
#

pls nitpick me smile x}

grim halo
#

not primitives unless you got something like FastUtils, Trove or GoldmanSachs

naive goblet
#

I mean

#

double[]

#

int[] etc

rigid nacelle
#

@marsh hawk I'm not sure if sparkjava is just for REST apis, but otherwise... 🤷‍♂️

grim halo
#

Sure but you cant have a List<int>

#

or a Map<int, long>

marsh hawk
#

eh i only need a rest api

#

ill give it atry

naive goblet
#

yeah

grim halo
#

@marsh hawk Do you just want to listen on a port for http requests?

marsh hawk
#

yeah precisely

grim halo
#

Then you can just use a ServerSocket. Let me write you an example

#

So this is basicall a really simple web server that listens on a port for a server shutdown:

public class WebManager {

  private static final int PORT = 11017;

  public WebManager(final JavaPlugin plugin) {
    this.plugin = plugin;
    CompletableFuture.runAsync(this::listenForRestart);
  }

  private final JavaPlugin plugin;
  private final String responseOk = "HTTP/1.1 204 OK\r\n\r\n";
  private final String responseDeny = "HTTP/1.1 403 Access denied\r\n\r\n";

  private void listenForRestart() {
    try {
      final ServerSocket serverSocket = new ServerSocket(PORT);
      while (true) {

        final Socket socket = serverSocket.accept();

        final BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(socket.getInputStream()));
        final OutputStream outputStream = socket.getOutputStream();
        final String line = bufferedReader.readLine();
        final String[] args = line.split(" ");

        if (serverSocket.getInetAddress().getHostAddress().equals("127.0.0.1") && args[0].equals("POST")) {
          System.out.println("§aHTTP shutdown initialised.");
          Bukkit.getScheduler().runTask(this.plugin, Bukkit::shutdown);
          outputStream.write(this.responseOk.getBytes(StandardCharsets.UTF_8));
          break;
        }

        socket.getOutputStream().write(this.responseDeny.getBytes(StandardCharsets.UTF_8));
        socket.close();
      }
    } catch (final IOException e) {
      e.printStackTrace();
    }
  }

}

And only one IP can use a POST request for this. (Its not really safe as someone could tinker the IP)

marsh hawk
#

jeez that's it?

#

thats super simple

grim halo
#

I mean this very boilerplaty and there are frameworks that can do more but for simple requests this is pretty fine.

marsh hawk
#

ill give it a try thankyou 🙂

grim halo
#

Btw if you want to respon with json then a HttpServlet would probably be the better approach

unkempt ridge
#

okay so I have an API, but I want to be able to use it with other projects and potentially let other people use it as well how would I go about setting it up so other people can use it? I've only ever done this when it was in the same project folder. (Using Maven)

grim halo
#

So for maven you would need to host your own maven repository.
When you use maven dependencies you will often not only get the <dependency> but also the <repository>
Im using the Sonatype Nexus Repository Manager for example

mellow wave
#

You can upload the project to github and use JitPack to grab it as a repo

grim halo
#

Or you can use JitPack...

#

But i think a nice setup with Jenkins and a dedicated maven repo is also desirable

half marsh
#

Hey so fun story about me trying to save resource folders

unkempt ridge
#

<repository> <id>sonatype</id> <url>https://oss.sonatype.org/content/groups/public/</url> </repository>
is that what this is

grim halo
#

push to github -> webhook to jenkins -> upload to maven repo

half marsh
#

it works just with a simple saveResource(folder name)

#

i just didnt include the folders in the jar yet

#

:)

grim halo
#

...

#

does spigot actually support folders for resources now?

half marsh
#

i guess so lol

#

god im fucking retarded

unkempt ridge
#

so is there a tutorial on how I can learn to webhook with jenkins and upload to a maven repo?

#

I've never done it before

grim halo
#

You dont need that... it took me a bit to set that up. But there are some tutorials out there.

unkempt ridge
#

I'll take a look now thanks

nova badge
#

when is ItemMeta null?

#

like is it possible to have a null ItemMeta while having a valid ItemStack?

rigid nacelle
#

IIRC, it will be null vanilla-based.

#

I.e if you craft an item, find one in a shaft etc.

nova badge
#

okay, thank you.

mellow wave
#

ItemMeta can be null if the item is AIR

bold anchor
#

AIR is null

#

Oh sniped

#

Everything but air has itemmeta

rigid nacelle
#

Technically, but no.

#

No.

bold anchor
#

Yes

rigid nacelle
#

Not vanilla items.

bold anchor
#

They do

#

Lol what are you on about

rigid nacelle
#

They don't.

bold anchor
#

They do

rigid nacelle
#

Oh lord.

orchid badger
#

Just tell which one doesn't then. Solved 😂

mellow wave
#

They do everything but AIR has item meta with getItemMeta()

rigid nacelle
#

nu

#

Unless that changed in 1.16 ofc.

bold anchor
#

That has always been a thing

#

ItemMeta is literally the bukkit implementation of the nbttag

#

And everything but air has nbt data

rigid nacelle
#

I even remember choco mentioning that vanilla doesn't.

#

Anyhow, you're making me insecure about my respond now, I'll have to check again.

bold anchor
#

Okay, so after a quick look all items with an nbttag has itemmeta

#

Those without don't

#

So some vanilla have some don't

rigid nacelle
#

Soo.. Uh... What's the necessity of a null check on getItemMeta?

bold anchor
#

It probably won't generate for air

rigid nacelle
#

Well, yeah.. But for actual items, I mean.

bold anchor
#

hmm

#

who knows

#

just do the checks

rigid nacelle
#

So everything.

bold anchor
#

So yeah

#

Air

rigid nacelle
#

watf

alpine yoke
#

What is maximum player's setExp()?

#

like so the bar is 100%?

hollow thorn
#

how do i implement the physics of a car plugin

bold anchor
#

So ehm ,i was partly correct

hollow thorn
#

What is maximum player's setExp()?
@alpine yoke probably the max 32 bit or 64 bit interger

rigid nacelle
#

I am curious about this so I actually gotta check, Jan.

hollow thorn
#

then it will probably go into the minus

#

and go oof

alpine yoke
#

Ikr, i just want to make a countdown so the LEVEL goes down and the bar goes down too

formal nimbus
#

yo

rigid nacelle
#

If you're fetching it from a vanilla source, it most likely will not have meta

lone fog
#

No

#

It’s a float

#

1 is a full bar

formal nimbus
#

would Math.floor(3/2) return 1?

rigid nacelle
#

^ @bold anchor That's from choco.

bold anchor
#

But it seems it creates one?

#

I'm too lazy to test it

rigid nacelle
#

I'm going to, give me a second.

hollow thorn
#

Maximum experience value can be gained by /experience command is 2147483647 which is (231 - 1). This is likely due to experience being stored as a signed Java-standard 32-bit integer.
Maximum level of XP players can get legitimately is 21863,[more information needed] but they can get up to 2147483647 using commands, in this case, the experience bar may disappear and reappear.[3]

#

-gamepedia

lone fog
#

setXp is only for the fullness of the bar

alpine yoke
#

yes, I do have the level countdown done

#

every 20 ticks it sets level to countdown int

#

and once game starts it puts the level to 0

#

but I wanna make the XP though

lone fog
#

1f is full 0f is empty

alpine yoke
#

hmm

#

oh

#

then its ez

tepid dawn
#

does annyone know a good crate plugin thats not too hard to config, and can let me use heads from Headsdatabase as a head?

alpine yoke
#

CrazyCrates

#

should work

#

idk if u can use hdb though

tepid dawn
#

i need one that can use hdb

alpine yoke
#

custom ;)

tepid dawn
#

there has to be one that can use hdb

rigid nacelle
#

@bold anchor It seems you're right actually..

#

So, technically a null check for itemmeta is unnecessary in terms of events?

bold anchor
#

No, cause they might be air

#

and air is bad

rigid nacelle
#

So just check the type. 🤷‍♂️

bold anchor
#

There is 3 types of air

rigid nacelle
#

:p

bold anchor
#

Oh wait there is mat.isAir

blazing burrow
#

is there documentation for scheduler

#

oh there is

#

my abd

#

bad*

marsh hawk
#
private void startsrv() {
        try {
          Thread.currentThread().setName("OAuth2 MC Thread");
          final ServerSocket serverSocket = new ServerSocket(port);
          System.out.println("server started");
          while (true) {

            final Socket socket = serverSocket.accept();

            final BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(socket.getInputStream()));
            final OutputStream outputStream = socket.getOutputStream();
            final String line = bufferedReader.readLine();
            final String[] args = line.split(" ");

            System.out.println("recieved");
            
            if (args[0].equals("POST")) {
              System.out.println(args[1]);
              
              break;
            }

            socket.getOutputStream().write(this.responseDeny.getBytes(StandardCharsets.UTF_8));
            socket.close();
          }
        } catch (final IOException e) {
          e.printStackTrace();
        }
      }
``` any clue why this isnt responding? If i send a post request it just loads forever
grim halo
#

You need to send a 200 something response

#

socket.getOutputStream().write(some 200 response)

marsh hawk
#

oh right im dumb lol

#

weird im not even getting the "recieved" string in console though

sturdy oar
#

Are you using http requests?

marsh hawk
#

yeah

sturdy oar
#

I think there's an API for them

grim halo
#

HttpServlet

#

i think

marsh hawk
#

ill check that out

sturdy oar
#

Although in my opinion JavaScript is much better for this kind of stuff

marsh hawk
#

its within my plugin

#

so can only use java

sturdy oar
#

Rip

marsh hawk
#

i tried spark just before but its way too many jars i need to shade

#

its very enticing though

pseudo crown
#

anyone know why intelliJ builds such large jar files for such a small amount of code ?

#

and how can i tweak this so i don't have massive plugin files

#

i know why - because i decided to also build spigot.jar 😄

lone fog
#

My plugin has spigot so it can run without spigot

mellow wave
#

oh no

lofty meadow
#

Hello! This does not work, it not store. Any help to store custom data in an item?

    ItemStack itemStack = player.getInventory().getItemInMainHand();
    ItemMeta itemMeta = itemStack.getItemMeta();
    if (itemMeta != null) {
        PersistentDataContainer persistentDataContainer = itemStack.getItemMeta().getPersistentDataContainer();
        NamespacedKey namespacedKey = new NamespacedKey(this.plugin, "key");
        persistentDataContainer.set(namespacedKey, PersistentDataType.STRING, "value");
    }
    itemStack.setItemMeta(itemMeta);```
mellow wave
#

@marsh hawk You can use Rhino to load javascript in java. https://developer.mozilla.org/en-US/docs/Mozilla/Projects/Rhino

marsh hawk
#

seems like alotta overhead

sturdy oar
#

Deno best JS

mellow wave
#

Probably but it's up to you

marsh hawk
#

HttpServlets are aids holy shit

sturdy oar
#

Java Is generally a bad language when it comes to http request

marsh hawk
#

yeah definitely

sturdy oar
#

It also isn't ideal for web development

marsh hawk
#

just need a rest api for my plugin

#

ill see how dynmap does it

sturdy oar
#

You probably need to use some library

#

The stuff provided by java is basically bad

marsh hawk
#

yeah definitely

#

interesting

#

they use HttpServlets

sturdy oar
#

I will need something similar for my plugin as well

#

If you find something good tell me

mellow wave
#

or create an easier to use API for the rest of us :)

sturdy oar
#

There is "Jersey"

marsh hawk
#

thats glassfish right

#

renamed

mellow wave
#

Yeah it got transfered to the eclipse foundation

frigid ember
#

hm

marsh hawk
#

some very efficient coding here

 if (permissions == null)
            permissions = bPermPermissions.create(getServer(), "dynmap", perdefs);
        if (permissions == null)
            permissions = PermBukkitPermissions.create(getServer(), "dynmap", perdefs);
        if (permissions == null)
            permissions = NijikokunPermissions.create(getServer(), "dynmap");
        if (permissions == null)
            permissions = GroupManagerPermissions.create(getServer(), "dynmap");
        if (permissions == null)
            permissions = LuckPermsPermissions.create(getServer(), "dynmap");
        if (permissions == null)
            permissions = LuckPerms5Permissions.create(getServer(), "dynmap");
        if (permissions == null)
            permissions = VaultPermissions.create(this, "dynmap");
        if (permissions == null)
            permissions = BukkitPermissions.create("dynmap", perdefs);
        if (permissions == null)
            permissions = new OpPermissions(new String[] { "fullrender", "cancelrender", "radiusrender", "resetstats", "reload", "purgequeue", "pause", "ips-for-id", "ids-for-ip", "add-id-for-ip", "del-id-for-ip" });
odd knoll
#

wtf is that.

mellow wave
#

...

marsh hawk
#

its in dynmap lmao

mellow wave
#

lol

odd knoll
#

Did they refuse to use curly brackets?

#

But then they did to make a string array.

mellow wave
#

I meant it's just to check if the previous permission integraton failed but still

marsh hawk
#

could be some easier way to do it lol

naive goblet
#

wth

mellow wave
#

Yeah there are better ways

marsh hawk
#

I have no clue how they create the HttpServlet

odd knoll
#

I hate HTTP in Java.

#

As soon as I need to do something like that, I run to JS.

marsh hawk
#

yeah probably java's weakest point

#

thats why all my http services are in other langs

#

i literally use redis to communicate to those non-java services to do http reqs

lofty meadow
#

Any help on storing custom data in an item please?

marsh hawk
#

its easier lmao

mellow wave
marsh hawk
#

cant have duplicates in hashset

mellow wave
#

hashmap

marsh hawk
#

just use map

#

easier to deal with

frigid ember
#

ok

naive goblet
#

well

marsh hawk
#

so how does it get instantiated?

naive goblet
#

a hashset is a list that aims to reduce duplicates. for instance a HashSet<Integer> cant have two 1's in it.

marsh hawk
#

We have no clue what you're talking about lol

#

seeing code would be good

mellow wave
#

Yeah he's been asking us to spoon feed him code all day

sharp bear
#

hi gays

naive goblet
#

hi gay

formal nimbus
#

uh oh

#

I've done something to crash my server ;-;

#

I triggered an event and it's just frozen xD

mellow wave
#

You probably did a loop too large

formal nimbus
#

ah

mellow wave
#

or maybe an infinite one

formal nimbus
#

hmm well there is one loop

marsh hawk
#

just yell at it

#

maybe that will fix

formal nimbus
#

I do this

#

which shouldn't be that many itterations right?

mellow wave
#

That feels like way too many

formal nimbus
#

oh ;-;

#

crud

marsh hawk
#

what are you trying to achieve with the function

mellow wave
#

It will probably not crash but it's deffiently not efficient

marsh hawk
#

it can probably be cut down

formal nimbus
#

right, so I have a crate object

mellow wave
#

^

formal nimbus
#

it stores a bunch of ItemStacks

#

I have a list of Inventories

#

I want to display all of the items across multiple pages

#

the list of Inventories is to store each page

#

this function is for removing an ItemStack

marsh hawk
#

i have a paged inventory class if you want

formal nimbus
#

oh?

#

I'd like to look at it plz

marsh hawk
#

but you are doing a double for loop

#

and each iteration is 2 new inventory variables

#

thats alot

formal nimbus
#

the firsst loop is to itterate through all the pages

#

and each iteration is 2 new inventory variables
@marsh hawk but they should get deleted after the loop?

#

by java clean up

marsh hawk
#

you shouldn't rely on gc

formal nimbus
#

the second loop it to itterate through each item

#

you shouldn't rely on gc
@marsh hawk gc?

mellow wave
#

Garbage Cleaner

formal nimbus
#

this is moving all the items along

marsh hawk
#

garbage collector

formal nimbus
#

oh

mellow wave
#

or collector

#

I mean

formal nimbus
#

the loops are moving all the items along, so that a hole isn't left

#

ty

marsh hawk
#

excuse my messy code this was a while ago

formal nimbus
#

i'll see if I can take 'inspiration'

marsh hawk
#

literally all i do is store all items in an array

#

and calculate amount of pages needed

formal nimbus
#

ok but how do you handle an item being removed?

#

you need to shunt all the items along

#

that's what I'm trying to do

marsh hawk
#

get item at x in array

#

remove

#

clean up array (remove empty item)

#

refresh inv

formal nimbus
#

refresh inv?

marsh hawk
#

re-open it

formal nimbus
#

but when do you fill the hole which was left?

#

or do you you just put all the items back in from slot one, using the updated list

marsh hawk
#

yeah just 're-render' the inventory

formal nimbus
#

oh ok

marsh hawk
#

it's better to iterate through say 100 items in an array of itemsw

#

than to iterate over 10 inventories 56 times

formal nimbus
#

I guess that makes sense

#

alright thx 🙂

mellow wave
#

Don't store players in a list

#

Store their UUID

marsh hawk
#

^^

#

data leaks

mellow wave
#

and when you're opening the inventory you're not even using the map

frigid ember
#

mk

marsh hawk
#

yeah why have the Inventory inv variable

#

if its stored in a map anyway

#
        p.sendMessage("bruh bruh 69 " + event.getRawSlot());```
#

now this is programming

mellow wave
#

Yeah

frigid ember
#

lol

marsh hawk
#

this is a menu right

#

and doesn't need to persist each time you open?

#

so say for example i put a dirt block in it

#

next time i open it will the dirt block be in it

#

or will it be fresh each time

#

Because imo, if it's just a menu i wouldn't store it anywhere

frigid ember
#

so i need to store it

marsh hawk
#

eh

#

unless you're saving actual items you don't need to

frigid ember
#

?

marsh hawk
#

didnt come out good lol

#

but for example with my menus i just pull data from elsewhere and create a new inv each time

#

just saves mem

#

gc will pick it up

hoary cove
#

hello guys

#

i need help

marsh hawk
#

what's up

hoary cove
#

mysq connection a bit confuse

#

new to spiggot plugin

marsh hawk
#

what

hoary cove
#

public class Test extends JavaPlugin {

#

because it extends on JavaPlugin

sturdy oar
#

What

hoary cove
#

database connection

sturdy oar
#

Yeah what's up with it

marsh hawk
#

What exactly is the problem

sturdy oar
#

Spigot has MySQL drivers shaded

hoary cove
#

do you have a link please?

sturdy oar
#

For what

hoary cove
#

"Spigot has MySQL drivers shaded" about this

sturdy oar
#

There's no link about it, they're just inside the server jar

hoary cove
#

because i was referring to this guide

sturdy oar
#

That tutorial is bad to be honest

#

Learn how to use HikariCP

hoary cove
#

that's a good idea thanks

sturdy oar
#

Actually that tutorial is really bad, I think it should be completely removed from Spigot or rewritten because it confuses beginners

hoary cove
#

@sturdy oar is this possible

#

what i am thinking is making a login here on this database connection and put as plugin in spiggot?

sturdy oar
#

Yes?

hoary cove
#

ow i see

sturdy oar
#

You know you have to encrypt the passwords with salt and hashing right

hoary cove
#

thanks for the tip 🙂

sturdy oar
#

Just look at AuthMe code they're doing this

autumn pendant
#

Can somebody help me a need a small plugin but i don't know how to find it

hoary cove
#

@sturdy oar yup my frnd recommend that plugin is this already making a datbase?

sturdy oar
#

I don't understand

hoary cove
#

AuthMe is a plugin right?

sturdy oar
#

Yes

#

AuthMe reloaded

hoary cove
#

me in my position what i want is to make a database to handle data. do auth me has a physical database like mysql?

autumn pendant
#

I have diferent area's (arena's) and i would like to have sign teleport but that i can set a maximum of players in the area so if i set the max to 2 players 2 player can join but a third wouldnt tp if they click the sign, does anybody know a plugin for this or anything?

sturdy oar
#

Yes AuthMe can use MySQL and saves all the data in encrypted format

#

You can specify the algorithm

#

Default is SHA256

#

I think

hoary cove
#

ahh so i will provide the database and insert the encrypted data

#

thanks 🙂

sturdy oar
#

AuthMe is a login plugin

#

You register and he saves password on MySQL

hoary cove
#

great! i will take a look the algorithm

lofty meadow
#

This not work for me, please help!

ItemStack itemStack = player.getInventory().getItemInMainHand();
ItemMeta itemMeta = itemStack.getItemMeta();
if (itemMeta != null) {
    NamespacedKey namespacedKey = new NamespacedKey(pluginInstance, "mykey");
    itemStack.getItemMeta().getPersistentDataContainer().set(namespacedKey, PersistentDataType.STRING, "myvalue");
}
itemStack.setItemMeta(itemMeta);```
mellow wave
#

@lofty meadow You're overriding the tag you added

#

You add the tag then remove it

lofty meadow
#

Ohh, what?

mellow wave
#

Instead of using itemStack.getItemMeta() use itemMeta as you defined above

#

Line 5

stoic shell
#

Could anyone update Spigot to Combat Test 6 as a test version?

lofty meadow
#

Ahh

#

Thanks!

ionic hound
#

why does my dependency not show up when i have imported it?

rare prairie
#

you should build your project

mighty herald
#

Hey, so im opening a new server, and I wanna use Spigot's plugins.
so I downloaded them into a folder called "Plugins" but nothing happened.
there is no folder with .conf file after restart at the "config" Folder.
Im sure I missed something..

rare prairie
#

.conf? You sure? You using Sponge?

mighty herald
#

yes, but I saw that Sponge is ok with Spigot, only with Bukkit it is a problem.

rare prairie
#

no

#

Bukkit/Spigot/CraftBukkit etc != Sponge

mighty herald
#

all of them cannot be together with sponge?

mellow wave
#

Sponge can run with Forge

tiny dagger
#

wasn't that the whole point of sponge?

mellow wave
#

There was an attempt to make Spigot plugins compatible with sponge once but it got discontinnued

proud sierra
#

Sponge got a really nice API

tiny dagger
#

i have no idea how to use sponge's api

mellow wave
#

I've never tried using it

tiny dagger
#

very very different than what bukkit has

rare prairie
#

lot of builders

tiny dagger
#

prob it's better with time invested

#

but jeez

proud sierra
tiny dagger
#

at first glance it's not easy to get into

proud sierra
#

It's not really hard to

#

The Docs are pretty nice

alpine yoke
#

Hey. is there a way to send player title with 5 ticks fade in, 40 ticks stay and 10 ticks fade out?

trail hare
#

I'm trying to make a plugin that gives a player a virtual furnace. My plan was to just spawn an invisible one under the world (nobody has access to bedrock level in this map) and open the furnace gui at a distance. Any obvious issues with this?

#

(alternatively fill level 1 of the spawn chunk with them and assign them via an array)

maiden oyster
#

@alpine yoke sry i beatrey you im in verified Team 😦

alpine yoke
#

gg

maiden oyster
#

😦

#

and you

hollow hedge
alpine yoke
#

Im 1.8.8

hollow hedge
#

Welp, I haven't messed with title packets.

#

So

#

Gl.

alpine yoke
#

rip for me

naive goblet
#

@alpine yoke

#

I know how to do it nms wise

alpine yoke
#

O

naive goblet
#

So basically you need a PlayerConnection which you can get by casting Player to CraftPlayer and then call CraftPlayer#getHandle().playerConnection.

#

Then

#

You gonna need to send 2 packets iirc

#

I think it’s called PacketPlayOutTitle or something

alpine yoke
#

and how can I make the title like colored?

naive goblet
#

§

#

Would work fine

alpine yoke
#

just?

#

ok

#

cool

#

thank you somuch

#

ill try to do it now

naive goblet
#

Yeah

#

Check out the packet class

#

It has 2 main different constructors

#

One for setting fade in, duration and fade out

#

And one for initiating type of title

#

And the title content

subtle bison
#

hey if i coded a plugin for 1.15.2 and works on spigot 1.16.1 but doesnt work on spigot paper 1.16.1 do you think that the problem is paper?

naive goblet
#

Yeah that might be

alpine yoke
#

Wooow it works

#

yay

#

thank you Conclure

#

do u know how was the actionbar thing called to send msg?

#

PacketPlayOutChat ?

hollow hedge
#

Yup.

#

That's the one

alpine yoke
#

nicey

lone fog
#

You can do it without packets in newer versions

naive goblet
#

1.8.8

alpine yoke
#

I know right, but Im on 1.8.8 cuz skywars

ancient ridge
#

@subtle bison doubt (X)

lone fog
#

ah

formal nimbus
#

this is my attempt at a GUI reloader but it doesn't seem to be working?

#

I might be passing in a different instance of the inventory or something, so maybe that's why it's not working

#

I don't think that is the issue though as I just tried this :/

#

which should paass in the exact instance of the inventory they're looking in

naive goblet
#

Wait you’re reopening the inventories

#

?

formal nimbus
#

yes

#

I make a change to the inventory

#

but because inventories don't update

#

I reopen it

naive goblet
#

What change?

formal nimbus
#

uhh

#

I removed an item form it

#

*from it

alpine yoke
#

Conclure 1 more question

#

how do I make new line?

naive goblet
#

Doesn’t Inventory#update or something works as well?

alpine yoke
#

lolxd is supposed to be subtitle

formal nimbus
#

o?

#

didn't know that was a thing

naive goblet
#

It’s another enum element for that

#

I think it’s the title type SUBTITLE or smtng

alpine yoke
#

true

#

like this

#

PacketPlayOutTitle subtitle = new PacketPlayOutTitle(PacketPlayOutTitle.EnumTitleAction.SUBTITLE, chatTitle);

#

thanku

naive goblet
#

Yeah

formal nimbus
#

yeah conclure I don't see an option to update ):

naive goblet
#

Let me see

formal nimbus
#

ty

naive goblet
#

Oh I know

#

You’d do something like looping the viewers because it seems like Player has the method and it’s called updateInventory()

formal nimbus
#

ah

#

ok ty

#

hmm

#

is it just Player?

#

or does HumanEntity have it too

#

as I can't see it for human entity

#

can u cast from HumanEntity to player?

naive goblet
#

Player

#

My friends framework, might be helpful

formal nimbus
#

I think this is the ticket

naive goblet
#

Yeah

formal nimbus
#

it still doesn't work ;-;

bold anchor
#

do it a tick later then

formal nimbus
#

how do I delay it>

#

bukkit runnable?

#

or scheduler?

pseudo crown
#

anyone have tutorials or just advice on how to debug/read nms code effectively ?

#

@formal nimbus a bukkitrunnable would work fine

formal nimbus
#

right

#

I'll see if I can get that working then

naive goblet
#

I’d recommend BukkitScheduler cuz of lambdas

formal nimbus
#

o

naive goblet
#

No pls

formal nimbus
#

xD

#

I dunno how to do lambdas ):

karmic sable
#

Eyo, how can i make my custom vexes NOT go through walls?

                                e.setCollidable(true);

didn't do the trick...

formal nimbus
#

IT STILL DOESN'T WORK!!!!

#

AHHHHHH*

lone fog
#

That's for entity collision with other entities

naive goblet
#

First of all

#

Task timer

#

?

formal nimbus
#

uhhh

#

yeah I need to change that

karmic sable
#

That's for entity collision with other entities
@lone fog yeah I figured.
Any ideas on how to have it for walls/blocks?

formal nimbus
#

that should still work though right>

#

what I wrote should still delay it by a tick

raw arch
#

Is this not right? Console says it isn't a command but I'm pretty sure it is a command. Bukkit.dispatchCommand(Bukkit.getServer().getConsoleSender(), "lpb user " + sender.getName() + " meta setprefix 10" + args[0] + " ");

naive goblet
#

lpb

#

That’s a bungee command?

raw arch
#

It can be run on spigot servers, I've done lp and it still doesn't work.

naive goblet
#

It can but it’s still ran from the proxy

#

Jet why would you delay that?

formal nimbus
#

why would I delay what?

#

the player.updateInventory() function?

naive goblet
#

Yes

formal nimbus
#

do it a tick later then
@bold anchor he recommended delaying

#

and I thought it made sense

naive goblet
#

public void update() {
inventory.clear();
populateGui();
for (HumanEntity viewer : new ArrayList<>(inventory.getViewers())) ((Player) viewer).updateInventory();
} this should work (What my buddy is using)

karmic sable
#

Alright I'm asuming no one knows about removing vex ability to go through walls then

naive goblet
#

Well

formal nimbus
#

what does populateGui() do?

naive goblet
#

Re adds the items

formal nimbus
#

right

#

well I already do that

#

and I already clear it

#

so I just need the for loop?

naive goblet
#

Try

#

@karmic sable probably done through nms

raw arch
#
Bukkit.dispatchCommand(Bukkit.getServer().getConsoleSender(), "lp user " + sender.getName() + " meta setprefix 10" + args[0] + " ");
sender.sendMessage(colorize("&7Prefix &9> &7Prefix succesfully set to &c" + args[0]));
}```

this runs as an unknown command, @naive goblet I changed it to the spigot command rather than the bungee one and it still doesn't work. Is my command layout correct?
hollow hedge
#

@karmic sable there is a noClip boolean for entities, might be worth messing around with that. in NMS...probably should mention that.

spare tiger
#

is there a more efficient way to store information about a block than just using an h2 database

#

this database will be checked every time BlockBreakEvent is called

hoary cove
#

is their anyone can help me with this

spare tiger
#

@hoary cove what's your problem

hollow hedge
#

try that again

pseudo crown
hollow hedge
#

but with less caps.

formal nimbus
#

AHH

#

@naive goblet

#

still doesn't work lol

naive goblet
#

@raw arch did it throw you an error?

hoary cove
#

[AuthMe] the server is shut down as defined in the configuration

formal nimbus
#

I must be doing something else wrong

naive goblet
#

Yeah

formal nimbus
naive goblet
#

@spare tiger tbf a h2 should be fine

hoary cove
#

all what i need is database name; username; password and it all right it still has this persis error

naive goblet
#

You wiped the inventory and readded the items as well?

spare tiger
#

@hoary cove is there any other errors around that

formal nimbus
#

I'll show you what I did

spare tiger
#

like an exception

#

@naive goblet thanks

formal nimbus
#

ok so I do this

#

tracker keeps track of a player's history

spare tiger
#

what is better for saving a database as a file? h2 or sqlite

formal nimbus
#

goBack moves them back to the last inventory they were viewing

hoary cove
#

@spare tiger do i have to used paste bin?

#

mysql

formal nimbus
#

and removed the inventory they were viewing from their history

spare tiger
#

you can use hastebin instead of paste bin

#

hastebin might be easier

formal nimbus
#

then I will show the crate.removeItem function

spare tiger
formal nimbus
spare tiger
#

@hoary cove paste you error there click save give me link

formal nimbus
#

removes the item from the list

#

calls the updateContents() function

hoary cove
formal nimbus
#

then for every inventory in the list of inventories the crate has, it should update them

raw arch
#

@naive goblet No error, just unknown command

#

That means /lp user isn't even registering

formal nimbus
#

anndddd

raw arch
#

Tho if I do it myself it works

formal nimbus
#

I think I just realised the issue

#

I'M A DUMB ASS

#

I make a new list

#

so all the inventories change

#

but that doesn't change the inventory in the player's history

#

so it shows them the out dated copy

#

ughhh

#

right

#

time to fix

naive goblet
#

Oh lol

formal nimbus
#

oh god

#

this makes it complicated

spare tiger
#

@hoary cove try getting a newer version of the plugin

#

or a older version

naive goblet
#

Nook hm I don’t know what is going wrong really did you register the command executor? Else you might try use LuckPerms api directly

spare tiger
#

get an older version if there is no newer version

hoary cove
#

@spare tiger yes i already tried it

spare tiger
#

hm

hoary cove
#

wait i will give the version

spare tiger
#

what do you have in your config? any confidential information like ips or passwords or username just put like four stars

#

i know nothing of the version

#

put your config on hastebin just censor your database info

hoary cove
#

okey

naive goblet
#

Wth how does AuthMe handle errors

raw arch
#

Nook hm I don’t know what is going wrong really did you register the command executor? Else you might try use LuckPerms api directly
@naive goblet Other commans work for this dispathCommand

formal nimbus
#

so this should now edit the existing inventories

naive goblet
#

And if you were to use luckperms instead of lp ?

formal nimbus
#

not create new ones

naive goblet
#

Lol

formal nimbus
#

😮

#

it almost works

#

it updated

hoary cove
#

@spare tiger do i have to include all config?

formal nimbus
#

but it got rid of a bunch of other stuff too

#

so I need to fix that

#

but it's updating!

#

which is the important thing

#

big thank

hoary cove
raw arch
#

@naive goblet I'll try it

fading frost
#

is there any way to get more than 6 inventory rows?

#

or open a second inventory somehow?

sturdy oar
#

Not really

#

9x6 is the limit technically

bold anchor
#

There is, but the inventory will look super fucked

sturdy oar
#

Just make pages

fading frost
#

not an option here

#

what will the inventory look like?

sturdy oar
#

Really bugged

pseudo crown
#

@fading frost bugged

sturdy oar
#

Try and place 3 chest near each other with WorldEdit and you'll get it

pseudo crown
#

probably to stop the bug

#

omd that was the shit where you glitched 2 chests into each other lol

sturdy oar
#

Yeah basically

#

That's bugged inventory

#

Maybe go tell mojang to make a new inventory gui

fading frost
#

they'll respond immediately for sure

frigid ember
#

help me spanish please

fading frost
#

Hm I'll make adjustments then

#

thanks

spare tiger
#

@hoary cove definitely seems like a bug with that version of the plugin

#

try an older version

hoary cove
#

okey i will make another try

hollow hedge
#

There was a bug report on the Authme github that said to use a newer version of the plugin

#

Unsure if that applies to what ever Nasuku is experiencing.

hoary cove
#

i already used the updated version still has issue

sturdy oar
#

What bug

hollow hedge
#

Might be worth post a bug report if it still doesn't resolve itsself.

hoary cove
#

im still checking the later later version of it

hybrid path
#

I'm trying to spawn a invisible slime as a mount but when it spawns it is visible for a split second.

final Slime slime = (Slime)location.getWorld().spawnEntity(location, EntityType.SLIME);
slime.addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, 1000000, 10000, false, false));
#

Any way to improve that?

mellow wave
#

Why do you want to spawn a slime as a mount?

#

and an invisible one

formal nimbus
#

cause he wants an invisible slime mount duh

mellow wave
#

If you want to force player to sit on stairs or simillar it's better to use an arrow

formal nimbus
#

players can ride arrows 🤔

mellow wave
#

Yes isn't that fun

formal nimbus
#

Logic: ONE HUNDRED

quick arch
#

when it spawns it is visible for a split second.
Consumers

frigid ember
#

Can I talk to Spigot staff about my account ?

celest current
#

When I do player.setHealth(player.getHealth() - 4); it works fine until I get to low health. Once there is less than 4 hp left I get this error:

        at org.bukkit.craftbukkit.v1_16_R1.entity.CraftLivingEntity.setHealth(CraftLivingEntity.java:112) ~[spigot-1.16.1.jar:git-Spigot-0509002-6b95d59]
        at net.xubels.zipcore.listeners.CustomItemsListener.onPlayerInteractEvent(CustomItemsListener.java:46) ~[?:?]
        at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source) ~[?:?]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_251]
        at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_251]
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:315) ~[spigot-1.16.1.jar:git-Spigot-0509002-6b95d59]
        ... 21 more```

How can I make it just kill the player instead of sending this error?
rare prairie
#

you should set the health level to 0D instead of minus value. Your current value is: -1.9999651908874512, which is impossible.

strange forge
#

or use Math.max

celest current
#

so player.setHealth(player.getHealth() - 0D); would take 0 dmg then kill at 0?

strange forge
#

do java player.setHealth(Math.max(player.getHealth() - 4, 0));

halcyon snow
#

that would just set the players health to his current health.

#

the one that reflxction posted is the right way to do it I believe.

rare prairie
#

or there is a better way, damage the player with Player#damage

strange forge
#

^

#

beware that #damage triggers the EntityDamageEvent which allows plugins to intrude it (i think?)

rare prairie
#

yep

frigid ember
#

yo noob question cause I forgot

#
/punish <something> <something2>``` which is args 0?
rare prairie
#

something1 is args0 sg2 is args1

frigid ember
#

aight ty

hoary cove
#

@spare tiger AuthMe-5.6.0-SNAPSHOT.jar i used this version

raw arch
#

Is there anyway I can add quotation marks to args[0]? I'm trying to make it execute a command which uses " " around the args when the player runs it

hoary cove
#

anything else shutdown's

sturdy oar
#

Can I talk to Spigot staff about my account ?
@James.#8380 you can try the spigot support email. What has happened (if you can tell here).?

pseudo crown
#

args[0] is a string anyway @raw arch what do you mean

#

ah.

#

just out of curiosity Nook why does the command args need quotes around it ?

raw arch
#

to create a space after

lunar widget
#

how to send actionbar message?

mellow wave
#

You can use player.spigot.sendMessage()

frigid ember
#

player.spigot().sendMessage()

lunar widget
#

interesting, thanks

plush nexus
#

is it possible to create a fake Player so i can execute a give command for that fake player?

balmy sentinel
#

why would you want to give something to a player that doesn't exist?

plush nexus
#

many plugins have commands to give items to a player

#

i'd like to be able to generate those items without a player

quick arch
#

You can generate items with your plugin 🤔

balmy sentinel
#

^^

#

Just create an ItemStack, I don't see why you need to give it to a fake player.

mellow wave
#

^^ Yeah there's no reason

plush nexus
#

for other outside plugins that don't have a way to create the item other than giving it to the player

balmy sentinel
#

okay

#

lets start here what are you trying to do?

mellow wave
#

Not sure what you mean

plush nexus
#

i could probably just save the ItemStack that I want in-game and then just generate that

balmy sentinel
#

yup

mellow wave
#

Yeah that's what you should do

plush nexus
#

ok thank you :)

quick arch
#

It could also be generated from yaml files

dusky sigil
#

would changing the block below the players each tick be extremely laggy?

lunar widget
#

how to send an actionbar message, spigot().sendMessage() doesn't seem to work

dusky sigil
#

actionbar is a title, thats all i know

lunar widget
#

would changing the block below the players each tick be extremely laggy?
@dusky sigil you could change the block when the player moves event

dusky sigil
#

Good godarn idea.

lunar widget
#

iq 200

#

how to send an actionbar message, spigot().sendMessage() doesn't seem to work
@lunar widget

dusky sigil
#
     
        IChatBaseComponent chat = IChatBaseComponent.ChatSerializer.a("{\"text\": \"" + message + "\"}");

        PacketPlayOutChat packetPlayOutChat = new PacketPlayOutChat(chat, ChatMessageType.GAME_INFO));
     
        CraftPlayer craft = (CraftPlayer) player;
     
        craft.getHandle().playerConnection.sendPacket(packetPlayOutChat);
    }
}```
#

yeeted from the spigot forums

mellow wave
#

No don't it's better to use the API

lunar widget
#

the api with no NMC something like that?

mellow wave
#

player.Spigot.sendMessage(ChatMessageType.ACTION_BAR, <insert text component>)

#

Do that

dusky sigil
#

NMS and im sure there is

lunar widget
#

im getting an error

pseudo crown
#

@raw arch ive been doing some testing and it turns out spaces count as args in 1.16 (if that's the version you're using) so you can StringBuild the args and you'll have the args + spaces

lunar widget
#

I need to eat dinner brb

raw arch
#

@pseudo crown I'm using 1.14.4 unforunately

pseudo crown
#

such a shitty system :/

#

so im assuming args don't count spaces in 1.14 ?

mellow wave
#

Also what spigot version are you compiling against? @lunar widget
(Ping me when you're back)

raw arch
#

I'm not sure if they do I have this right now and spaces aren't being counted for the args part

#

"luckperms user " + sender.getName() + " meta setprefix 10 " + args[0] + " ");

mellow wave
#

You making quick commands for LuckPerms?

raw arch
#

I am making a command for a dono perk

#

Which can allow the player to change their prefix

mellow wave
#

ah I see

raw arch
#

And I need a space after the prefix

#

and the only way to do that is to "prefix "

mellow wave
#

Yeah

bold anchor
#

That looks shady

mellow wave
#

I mean if it's for private use it's fine

#

Also why not just use the LuckPermsAPI @raw arch

raw arch
#

Yeah it's not being distributed lol

#

I thought about that but I thought this method would be more efficient

mellow wave
#

Anyway you can force a space with:
"luckperms user " + sender.getName() + " meta setprefix 10 \"" + args[0] + " \""
(Going from memory right now, no pc)

raw arch
#

oh isn't it \n

mellow wave
#

\n is for new line

raw arch
#

Right

#

Okay I'll try this

#

Thanks

mellow wave
#

" is to use " inside a string

#

add \ discord removed it

lunar widget
#

Also what spigot version are you compiling against? @lunar widget
(Ping me when you're back)
@mellow wave 1.16.1

mellow wave
#

Alright what I showed should work

lunar widget
#

ok

mellow wave
raw arch
#

That works, thanks @mellow wave

bronze acorn
#

nook u can also just do a space and &r

#

i think

frigid ember
#

can someone please tell me how to update configs with bungeecord config api? Its really dumb that i can't manage to get it working

#

I litterally tried looping through every entry

toxic crow
#

How can I change the direction in which the fake player looks? I've tried a lot of things found on the internet, but nothing seems to work.
Thanks

       
        MinecraftServer server = ((CraftServer) Bukkit.getServer()).getServer();
        WorldServer world = ((CraftWorld) location.getWorld()).getHandle();
        GameProfile skin = new GameProfile(uuid, name);
       
        String[] textures = texture.split(",");
        skin.getProperties().put("textures", new Property("textures", textures[0], textures[1]));      
               
        EntityPlayer npc = new EntityPlayer(server, world, skin, new PlayerInteractManager(world));
       
   
        npc.setLocation(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch());
        for (Player p : Bukkit.getOnlinePlayers()) {
            PlayerConnection connection = ((CraftPlayer)p).getHandle().playerConnection;
            //connection.sendPacket(new PacketPlayOutEntityDestroy());
            connection.sendPacket(new PacketPlayOutPlayerInfo(EnumPlayerInfoAction.ADD_PLAYER, npc));
            connection.sendPacket(new PacketPlayOutNamedEntitySpawn(npc));
            Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(Main.getInstance(), new Runnable() {
                public void run() {
                    connection.sendPacket(new PacketPlayOutPlayerInfo(EnumPlayerInfoAction.REMOVE_PLAYER, npc));
                }
            }, 10);
        }
    }```
rare prairie
#

Are you trying to load the configuration?

frigid ember
#

but im not able to make it recrusively

proper rune
#

Could anyone compile the newest 1.16.1 build for me?

rare prairie
#

Could anyone compile the newest 1.16.1 build for me?
use buildtools

proper rune
#

BuildTools doesn't work for me...

frigid ember
#

Are you trying to load the configuration?
@rare prairie no... Im trying to update it

rare prairie
#

So you want to save?

frigid ember
#

what do you mean with saving?

#

i want to update config entries

#

if they are missing

rare prairie
#

Update can mean by saving or loading the file, these are the method you can use.

frigid ember
#

how would i do that if i am planning to make a multi config file plugin?

rare prairie
#

new file -> load the file with ConfigurationProvider -> save (if you use any command that sets some values) -> done

#

its the same thing like on bukkit

frigid ember
#

ok, but as an example: My plugin finds this file:

entry1: value
entry2: value2

But what i want to have when loading the plugin:

entry1: value
entry2: value2
entry3: value3
#

how would i get my plugin to adding keys?

#

if they are missing

rare prairie
#
Configuration conf = ConfigurationProvider.getProvider(YamlConfiguration.class).load(file);
if (!conf.contains("entry1")) {
    conf.set("entry1", "value");
    // ..
}

conf.save(file);
frigid ember
#

ok

#

is there a way to load a resource as a template file and edit the server file with its default values?

#

yeah i think this got a xy

#

?xy

worldly heathBOT
rare prairie
#
File file = new File(folder, "bungeeconfig.yml");
if (!file.exists()) {
    InputStream in = getResourceAsStream("bungeeconfig.yml");
    Files.copy(in, file.toPath());
    in.close();
}
#

w

frigid ember
#

but what IF the file exists?

rare prairie
#

load the file

frigid ember
#

but

#

when its outdated

#

i get null exceptions

pseudo crown
#

you want to add defaults ? @frigid ember

frigid ember
#

yes

pseudo crown
#

1 sec

frigid ember
#

idk if you know it, but im using bungeecord

#

spigot api won't work

#

cuz of different configuration systems

pseudo crown
#

fuck

lunar widget
#

😮

frigid ember
#

sry that this was late

pseudo crown
#

ahaha

#

does bungeecord use bukkit api at all or no ?

frigid ember
#

no

pseudo crown
#

well what a waste of time .

frigid ember
#

i think md_5 wrote it from skretch

lunar widget
#

who?

frigid ember
#

the main developer

#

he owns spigot

lunar widget
#

ohhh

#

ye I knew that

frigid ember
#

@rare prairie what do i need to do if i want something like bukkit config defaults in bungeecord?

#

ok maybe i should ask in the forums

jagged torrent
#

bungee supports default values

#

see the javadoc

void hawk
#

im trying to give a votingplugin reward from a command block to the closest player. is this not possible?

#

/adminvote GiveReward VoteReward @p

jagged torrent
#

target selectors are not supported

#

a dev has to manually implement em

void hawk
#

:////

#

is there a similar plugin i can have just give people randomised predetermined items from a redstone command?

twin cosmos
#

im new to java coding and i want to make a plugin that informs staff members when someone do /help

and i wrote this but i got stuck and i didnt know how to continue

    public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
        
        if (label.equalsIgnoreCase("help")) {
            Player player = (Player) sender;
            if (sender instanceof Player) {
                if (player.hasPermission("help.p")) {
                    // and if server does contain staff members
                    
                    player.sendMessage(ChatColor.DARK_RED + "a staff member will join you in no time");        
                        
                    }
                    else {
                        player.sendMessage(ChatColor.DARK_RED + "there is no staff memeber online");
                    }
                
                        
                }
                
            }
        
        
        
        
        return true;
    }






frigid ember
#

@jagged torrent ok after inspecting the api i found out that

  1. The javadocs are broken and always show javascript is disabled
  2. There is something called "default", but its only when loading. Does that do what i want? And i need to save it then manually?
lunar widget
#

Valid, so when a player types the command /help, you send a message to a palyer ("Staff nickname")

#

?

twin cosmos
#

no

pseudo crown
#

you would need to loop through all the players on the server, and check if they have the permission (check if they are staff), if they do then you can send them the message! For example: Java```
// fancy for loop that i recommend you remember
for(Player pl : Bukkit.getOnlinePlayers()) {
if (pl.hasPermission(permission) {
pl.sendMessage("Assistance Needed!");
}
}

#

correct me if i misread your intentions 🙂

twin cosmos
#

@pseudo crown ty

#

@lunar widget

lunar widget
#

lol

twin cosmos
#

i wanted to say if a player have a moderator helper ... ect rank

#

but

#

the perm idea is easier

#

and

#

better

lunar widget
#

yeah do that

twin cosmos
#

ty for support

pseudo crown
#

usually if a player is staff they would have a permission tied with it; np

#

anyone know how to do formatting with code blocks on discord? forgot .

lunar widget
#
test
#

like that?

pseudo crown
#
Idiot me = this.johnny;
#

yeah i got it.. thanks.

lunar widget
#

ok johnny

pseudo crown
#

man im so bored i just want to make some plugins for people - but not impossibly large or with big amounts of nms because im shit at nms.

lunar widget
#

help me, Idk how to send an actionbar message

twin cosmos
#

@pseudo crown does it bother u if ask u some questions sometimes ??

quick arch
#

player.spigot().sendMessage()

twin cosmos
#

about plugins ofc

pseudo crown
#

i do 😄 it's using nms though.. meaning you need to use abstractation or reflection if you wanna support different versions.. @lunar widget

#

@twin cosmos not at all, this chat is specifically for asking questions, just hit me

lunar widget
#

rip

quick arch
#

you don't need nms for action bar above 1.12.2 iirc

twin cosmos
#

ok ty

lunar widget
#

player.spigot().sendMessage()
@quick arch on what versions does that work?

mellow wave
#

Didn't the method I sent work?

hybrid path
#

If you want to force player to sit on stairs or simillar it's better to use an arrow
@mellow wave How come it is better to use an arrow? Any instantly noticable advantages?

pseudo crown
#

ive actually never heard of spigot method to show actionbar.. i guess because ive been using bukkit

quick arch
#

1.12+ I believe

lunar widget
#

Olivo, I importet and idk

mellow wave
#

@hybrid path It's smaller and won't be vissible

jagged torrent
#

@frigid ember I stand corrected, in BungeeCord you can use a fallback configuration, but you can't copy all missing values to the config directly with the provided API, you have to do that yourself

quick arch
#

oh it's 1.13+

#

nice

lunar widget
#

I never used BaseComponents

quick arch
#

There's a method to get legacy text

hybrid path
#

@hybrid path It's smaller and won't be vissible
@mellow wave Heck ok, can I just use the same code and replace it with EntityType.ARROW instead?

mellow wave
#

Yes

hybrid path
#

k i'll look

pseudo crown
#

i know in minecraft modding you can do something like: new IChatBaseComponent() i think you can do something similar in spigot as well ?

mellow wave
#

Just use new TextComponent(<insert message here>);

pseudo crown
#

yep 😄

lunar widget
#

oohh

pseudo crown
#

does it support enum colour codes ? (i don't see why not).

lunar widget
#

ok

mellow wave
#

I hope I remember things I don't have access to my pc

quick arch
lunar widget
#

oof

mellow wave
#

Not really

quick arch
#

Just use fromLegacyText or something

pseudo crown
#

nah that's fucking sick no ?

quick arch
#

Time consuming

pseudo crown
#

that's really good, you can just set the shit easily

mellow wave
#

Yeah just put the usual message in th the method I sent and it should convert

pseudo crown
#

no i disagree, it gives you perfect control over the message you want to make

quick arch
#

<red><bold>Hello world</bold></red>

#

That's done with MiniMessage Text (Adventure)

#

😏

pseudo crown
#

does it also support command execution (so i guess <href src xD>?

lunar widget
#

rainbow seems cool

quick arch
#

command execution?

pseudo crown
#

that does look sick yeah

#

yeah so click me to /kill ! and when you click it you die because it runs /kill

quick arch
#

yeah

pseudo crown
#

that's kinda pog to be honest.

quick arch
#

It supports all the component types

#

:D

pseudo crown
#

that's a really cool api 😄 i hope 1 day i can program something great like that

lunar widget
#

will this send an actionbar?

blazing burrow
#

Hey guys, so i just downloaded vs code (i use standard vs and eclipse) and if i want to be able to work on my pre existing and new mc plugin projects i need to install the "maven for java" extension right

quick arch
#

that's a title

#

vscode isn't an ide

#

get a proper ide for Java (Eclipse/IntelliJ/Netbean)

blazing burrow
#

Damn okay then thanks

quick arch
#

nick go away

rustic glade
#

vscode isn't an ide
get a proper ide for Java (Eclipse/IntelliJ/Netbean)
@quick arch wrong. that's what the Java extension is for. It literally uses Eclipse's code to do code-suggestion and other cool stuff

quick arch
#

no one called you

mellow wave
#

@lunar widget That will send a title

lunar widget
#

yeah i know

mellow wave
#

Just use text components from legacy text with the message you want to send

lunar widget
#

ok

mellow wave
#

And send it with the spigot sendMessage

rustic glade
#

Damn okay then thanks
@blazing burrow You can use VSCode just fine. And yes, that is the extension you want to install. Just make sure you install the Language Support for Java extension too

blazing burrow
#

Okay sure

#

Thanks

pseudo crown
#

im looking at the spigot api and if this occurs does it actually mean it's not supported ? ```Java
public void sendMessage(@NotNull BaseComponent component) {
throw new UnsupportedOperationException("Not supported yet.");
}

rustic glade
#

No

#

The jar file that you're depending on is a barebones file

#

The actual implementation exists and is on the actual spigot jar that you use to launch the server.

pseudo crown
#

so if i use buildtools and get the source i can see the real method ? either way thanks.

mellow wave
#

Yes

pseudo crown
#

cheers.

rustic glade
#

so if i use buildtools and get the source i can see the real method ?
yes, although the idea is to abstract (read: not using) the server source

frigid ember
#

is the bungeecord getkeys recrusive?

#

hello. is there a plugin that forces the player to use optifine when in the server?

quick arch
#

hello. is there a plugin that forces the player to use optifine when in the server?
no

frigid ember
#

hm thx

quick arch
#

That would be very dangerous if they could do that

pseudo crown
#

thanks a lot Nick

quick arch
#

Just tell them to use Optifine

frigid ember
#

is the bungeecord Configuration getkeys recrusive?

rustic glade
#

That would be very dangerous if they could do that
Most likely forcing, as in "use or get kicked"

frigid ember
#

cause i want to force my players to use shaders

rustic glade
#

cause i want to force my players to use shaders
that's impossible

quick arch
#

^

frigid ember
#

ok, thanks anyway 🙂

mellow wave
#

@frigid ember It is possible to deny connections without optifine. To do this you will need a custom plugin and all players using forge. And there is no force shaders option. That would just be stuipid

twin cosmos
#

@pseudo crown how can i add a sonor effect like notification anyone just to pay attention to the player

#

??

quick arch
#

all players using forge
Seems useless

mellow wave
#

No it sends a handshake packet with all mods. No other way to detect the optifine client

#

hm maybe you can detect it with the player login packet

quick arch
#

no

rustic glade
#

I don't think Optifine is a forge mod.

mellow wave
#

It can load with forge

quick arch
#

It's a client side mod and version

rustic glade
#

Forge might just inject the jar file on the classpatch

mellow wave
#

as a mod

frigid ember
#

@frigid ember It is possible to deny connections without optifine. To do this you will need a custom plugin and all players using forge. And there is no force shaders option. That would just be stuipid
@mellow wave hm i knew that u just cant force clients to use shaders, even if they have optifine

pseudo crown
#

@twin cosmos sorry i don't understand what you mean, try to elaborate please also remember there are lots of other people here than can help you probably way better than me, but ill still try :p

mellow wave
#

That was just my thoughts I have no idea if that's actually possible

twin cosmos
#

np\

mellow wave
#

You can just send them a pitched sound if you want to annoy them

#

(Asuming they have sound on)

#

You could probably also send a title covering the screen

pseudo crown
#

oh

rustic glade
#

It can load with forge
Forge mods require(d) a mcmod.info file inside the jar. Optifine does not have it. Just because you see it load, doesn't mean it's a mod. Forge just injects it into the game

mellow wave
#

As I said it was just my thoughts

#

I

frigid ember
#

Are you guys talking about it's not possible to allow certain clients in general on a server?

mellow wave
#

I have no access to a pc atm

quick arch
#

Are you guys talking about it's not possible to allow certain clients in general on a server?
Someone wanted all of their players to use Optifine for shaders

mellow wave
#

omg please stop chromebook... It's so annying it messes up my typing

quick arch
#

They suck

mellow wave
#

I have no other alternative atm

#

Maybe my phone but that's slower

frigid ember
#

Oh alright. I was just saying that because that's what Lunar Client does. A server can only allow people who have Lunar Client.

quick arch
#

You can detect that with packets

#

You can't detect Optifine

frigid ember
#

mhm

mellow wave
#

Yeah they send a handshake packet

#

A few mods and clients does that

pseudo crown
#

which you could probably fake if you knew the packet right ?

rustic glade
#

yes

mellow wave
#

WorldDownloader, VoxelMap, Schematica and WorldEditCUI is just a few that uses the plugin messaging channels to send information to the server

rustic glade
#

These are basically special packets recognized by the client and the server. They are named (channels) and can include any kind of data

pseudo crown
#

that's really cool

mellow wave
#

They're handy if you want to make an optional mod and want to send information to the client from the server.

frigid ember
#

Ah, so you can write a plugin that detects the mod/client, and if that player has that mod/client, then they can join into a certain gamemode, queue or server.

mellow wave
#

Yes

#

That's also how the ForgeModDetector plugin works. It reads the forge handshake packet containing what mods a player is using

#

(Not sure about the plugin name can't remember)

frigid ember
#

But you could also implement that into the spigot source code itself, right?

mellow wave
#

You could implement anything you want in to your own fork

rustic glade
#

But you could also implement that into the spigot source code itself, right?
yes, but why would you?

frigid ember
#

yeah custom patches

#

just preference and opinions I guess, for this situation however, I do agree a plugin would be easier.

#

How do I get a player from a command? Like if I did /command @p mymod:myItem 2 the 2nd argument is meant to be a player. How would I get the actual player, assuming target selectors were allowed?

lunar widget
#

can I use title packets to send an actionbar?

pseudo crown
#

yes @lunar widget

lunar widget
#

does it work on version 1.16.1 and 1.89

#

1.9*

balmy sentinel
#

@frigid ember check if the player is online Player player = Bukkit.getPlayer(args[0]);

#

or if you don’t need the player online String player = args[0];

subtle blade
#

Bukkit#selectEntities() to use entity selectors

#

returns a List<Entity> (because it can return more than just players). Do the filtering you need to do

frigid ember
#

Thx for the fast reply. 😄 I'm in a hurry so this helps a lot