#help-development

1 messages Β· Page 1428 of 1

wispy monolith
#

don't use System.out.println or what ever in spigt

mild kernel
#

my plugin.yml:

name: DontResetAttributes
version: 1.0.0
prefix: dra
author: krystejj
main: me.krystejj.dra.DontResetAttributes
api-version: 1.16

commands:
  dratoggleforplayer:
    description: Toggle DontResetAttributes for player
    permission: dontresetattributes.dratoggleforplayer
    usage: /<command>

permissions:
  dontresetattributes.dratoggleforplayer:
    description: Allows /dratoggleforplayer command
    default: op
  dratoggleforplayer.*:
    description: Allows everything
    default: op
    children:
      dontresetattributes.dratoggleforplayer: true
clear fable
#

@mild kernelwhich line is line 18?

mild kernel
#

System.out.println(args); //<-------- this causes an error

clear fable
#

tf?

#

how lol

wispy monolith
lofty mulch
#

did you shade deps @clear fable

wispy monolith
#

delete it

clear fable
wispy monolith
#

don't use System.out.println

lofty mulch
#

btw

#

jda has maven repo

clear fable
lofty mulch
#

?

#

you didnt shade

clear fable
#

no it works but deps are missing

#

ClassNotFound

mild kernel
clear fable
#

for all the jda deps

lofty mulch
mild kernel
#

just args is null and I don't know why

mild kernel
#

yes

wispy monolith
#

go to paper support

clear fable
#

@lofty mulchI'm already using shade bc it comes by default with the MC Dev spigot template

lofty mulch
#

just show me all

#

pom

clear fable
#

gimme a sec

lofty mulch
#

cuz I used JDA before, I had no problem with it

clear fable
#

I am making a spigot plugin to log joins and leave in my discord server. I use JDA for reading message history and a custom discord webhook solution to send webhook post reqs. When ever I send an http post req from my DiscordWebhook class, it causes this error to appear multiple times in the console. This makes no sense to me bc the post req has nothing to do with JDA but idek. For JDA I have a local jar for my IDE and on my server I am using JDASpigot. Here is my [main class] (https://pastebin.com/AC0ExLs2), my DiscorWebhook Class, and my pom.xml. Btw I am using paper build 654. The weird part is that it doesnt seem to interfere with anything (the code works as intended) but it throws hella errors

mild kernel
clear fable
#

@lofty mulch

lofty mulch
#

im reading

#

why did u use JDASpigot?

clear fable
#

I thought it would fix the error bc I heard it can be caused by a corrupted jar file

#

didnt do anything tho

#

so idr why I stuck with it

lofty mulch
#

shade jda

#

just do it

clear fable
#

I mean ok

#

I'll remove JDASpigot

lofty mulch
#

btw use JDA from maven

clear fable
#

I did but I got hella ClassNotFound

#

like gnu/smth smth

lofty mulch
#
<dependency>
    <groupId>net.dv8tion</groupId>
    <artifactId>JDA</artifactId>
    <version>4.2.1_253</version>
</dependency>
<repository>
    <id>dv8tion</id>
    <name>m2-dv8tion</name>
    <url>https://m2.dv8tion.net/releases</url>
</repository>
clear fable
#

thats what I used

lofty mulch
#

just use

clear fable
#

ok

lofty mulch
#

then run

#

give me back the logs

quaint mantle
#

how to get the number of people connected to the server at the same time without using a weird for loop

#

as an int

lofty mulch
#

getServer().getPlayers().size();

quaint mantle
#

it returns a list

clear fable
quaint mantle
#

no?

#

yay thanks

clear fable
#

Idk how to actually do it the right way so I include an extracted version from the Project Structure settings to avoid this

#

if I do then I get this:

chrome beacon
#

Shade it in to your jar

clear fable
chrome beacon
#

Yeah shade that too

lofty mulch
#

what

clear fable
#

how do I shade it correctly?

lofty mulch
#

you didnt use maven package

chrome beacon
#

oh yea lol

#

I just noticed

clear fable
#

wdym

lofty mulch
#

look at your right bar

#

there is a bar named Maven tasks

#

find "package"

clear fable
#

ok

lofty mulch
#

double click

clear fable
#

alr

lofty mulch
#

check the project dir

#

i forget where is it

clear fable
#

im so bad at maven xd

#

I only ever use gradle

sudden raft
#

u also need maven shade plugin

lofty mulch
#

then use gradle

sudden raft
#

I prefer gradle

clear fable
lofty mulch
#

gradle is hard in first time

#

just like maven

#

if that he/she knows maven

clear fable
#

ok I ran the "package" task now what?

lofty mulch
#

forget the path

#

ah "target"

clear fable
#

yeah that's there

lofty mulch
#

find the *-shade.jar

clear fable
#

mhm

#

do I just use that as my jar?

lofty mulch
#

yes

#

that's your final jar

clear fable
#

Is there a way to automatically put it in my plugins dir?

lofty mulch
clear fable
#

ty

lofty mulch
#

np

clear fable
#

ayooo

#

no errors πŸ™‚

lofty mulch
#

good

#

congratz

clear fable
lofty mulch
#

nahh just ignore it

clear fable
#

ugh that sucks then

#

bc I have to delete them every time

lofty mulch
#

dude the gradle done the same things

clear fable
#

I normally use the artifact thing built into intellij

#

only use gradle for mods

lofty mulch
#

use this

#

it will clean your target folder

#

after built

clear fable
#

ok ty

clear fable
#

I cant reload while running

#

it will tell me about ambiguous plugin names

lofty mulch
#

ah i forget\

#

jda things

#

wait did you change the jar name?

clear fable
#

ye

lofty mulch
#

dude

#

keep it

clear fable
#

wait wdym "change"

#

I have a different one set in the pom

#

but I didnt change the file after it made it

lofty mulch
#

so you keep the jar name with -shade.jar?

clear fable
#

ye

lofty mulch
#

weird

#

send me logs

clear fable
#

if the server is running, clean doesnt work

#

it doesnt delete the files

stark nimbus
#

hi who needs help :pleadig

#

πŸ₯Ί

lofty mulch
#

well the "clean" task only remove target jar

stark nimbus
#

oh you mean with maven?

lofty mulch
#

not the jar at output

stark nimbus
#

people do clean install

lofty mulch
stark nimbus
#

why?

#

well

lofty mulch
#

he doesnt want the fatjar still locate at target dir

stark nimbus
#

clean removes the files or the jar of which was exported before, install or package reintalls the jar, this way compiling won't glitch out or compiling will not bug out whilst doing it. I always suggest cleaning the target file first because I've glitched out so many times bcz of it

stark nimbus
lofty mulch
#

ah shiet

clear fable
#

I want to either only generate the shaded jar or remove the others automatically

lofty mulch
#

didnt know clean at last task doesnt do anything

#

just keep it

#

ignore

stark nimbus
lofty mulch
#

it

stark nimbus
#

inside of the poem.xml

#

if more than 1 jar is created

#

check if there are 2 plugins of which go for maven-compiler

#

if yes

#

then that will export you 2 different jars

lofty mulch
#

that took compiling longer

#

not worth

stark nimbus
#

if you want only the shaded jar, then check which plugin states shading and then just keep that and remove all other plugins

clear fable
#
<plugins>
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.8.1</version>
        <configuration>
            <source>${java.version}</source>
            <target>${java.version}</target>
        </configuration>
    </plugin>
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-shade-plugin</artifactId>
        <version>3.2.4</version>
        <executions>
            <execution>
                <phase>package</phase>
                <goals>
                    <goal>shade</goal>
                </goals>
                <configuration>
                    <createDependencyReducedPom>false</createDependencyReducedPom>
                    <finalName>${project.artifactId}-${project.version}-build</finalName>
                    <outputDirectory>D:/Adyo/Documents/Minecraft/Plugins/Server 2/plugins</outputDirectory>
                </configuration>
            </execution>
        </executions>
    </plugin>
</plugins>```
stark nimbus
#
<plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.2.4</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <createDependencyReducedPom>false</createDependencyReducedPom>
                            <finalName>${project.artifactId}-${project.version}-build</finalName>
                            <outputDirectory>path to plugins folder</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
#

like that it would just deploy the shaded jar

lofty mulch
#

he wants to delete the jars at target dir dude

stark nimbus
#

even though by removing the other plugin, you are no longer stating which java language you are using.

#

I want to either only generate the shaded jar or remove the others automatically

#

He just wants to compile in the shaded jar

lofty mulch
#

it still needed compiling the source jar first

#

then shade to the fatjar

clear fable
lofty mulch
stark nimbus
#

what the other plugin did

#

was state your jar language

#

hold up let me fix that for you

clear fable
#

ah

stark nimbus
#

can you send me your full poem?

#

@clear fable

clear fable
#

sure one sec

stark nimbus
#

thank you

clear fable
#

I thought <java.version>1.8</java.version> which I already have would define the java version but ig not

lofty mulch
#

it just define variable

clear fable
#

ohhhh

lofty mulch
#

a variable named java.version with value 1.8

clear fable
#

im dumb

lofty mulch
#

nah

clear fable
#

ye that makes more sense

lofty mulch
#

if you listened to the answer, ur not dumb

clear fable
#

no I'm tired lol I could have figured that out by looking at it for more than 5 seconds

#

works just like gradle

stark nimbus
#
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-plugins</artifactId>
                <version>34</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.2.4</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <createDependencyReducedPom>false</createDependencyReducedPom>
                            <finalName>${project.artifactId}-${project.version}-build</finalName>
                            <outputDirectory>********/plugins</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>
    </build>
#

try this out

clear fable
#

ok

lofty mulch
#

maybe: maven-compiler-plugin 3.8.1?

stark nimbus
#

nah that'll compile another ja

#

hmm

#

try changing up the version @clear fable

clear fable
#

to what?

stark nimbus
#

anything below 34

clear fable
#

33 doesnt work

stark nimbus
#

try this out

clear fable
#

30-32 dont work

stark nimbus
#
    <properties>
        <java.version>1.8</java.version>
        <maven.compiler.target>1.8</maven.compiler.target>
        <maven.compiler.source>1.8</maven.compiler.source>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.2.4</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <createDependencyReducedPom>false</createDependencyReducedPom>
                            <finalName>${project.artifactId}-${project.version}-build</finalName>
                            <outputDirectory>********/plugins</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>
    </build>
clear fable
#

worked

stark nimbus
#

gg πŸ™‚

clear fable
#

ugh ._.

#

it makes 2 jars

stark nimbus
#

what happened?

clear fable
stark nimbus
#

huh

lofty mulch
#

original ofc

clear fable
#

I ran it 2 times and it made 1 the first time and 2 the second time

stark nimbus
#

because you didn't clean it

#

on your run command

#

do

clear fable
#

I did

stark nimbus
#

clean package

#

or

#

clean install

clear fable
#

I have clean package clean

stark nimbus
#

are you sure it's cleaning it tho?

clear fable
#

I'll do it manually

stark nimbus
lofty mulch
#

remove clean at last

stark nimbus
#

just do

#

clean package

clear fable
#

k

stark nimbus
#

even tho i recommend install

#

but it's the same

clear fable
#

same thing

#

running 3 times makes 3 jars

stark nimbus
#

try remove the directory par

#

why do you want it to compile into a different directory when you can move it very easily?

clear fable
#

bc I would need to move it every single time I make a change to the code

#

normally I just build artifacts and I can reload confirm right away

stark nimbus
#

yeah i don't think maven supports that

clear fable
#

ugh

lofty mulch
#

it is

stark nimbus
#

i think to do that you'd have to artifcat it

lofty mulch
#

but paper

#

no

#

paper is not for developing plugin

clear fable
#

wdym

stark nimbus
#

?

#

wdym

#

it is

#

it has more libraries than the normal spigot

clear fable
#

huh?

lofty mulch
#

dude paper reload confirm is succ

stark nimbus
#

what

clear fable
#

i mean its not that bad

stark nimbus
#

nah

lofty mulch
#

it didn't reload my plugin

stark nimbus
#

paper is WAY more optimized than spigot

lofty mulch
#

so i decide to run spigot

stark nimbus
#

πŸ€”

lofty mulch
#

but developing plugin is bad

#

anyway

#

if you use spigot-api

clear fable
#

its fine lol idk what ur talking about

lofty mulch
#

run plugin with spigot

clear fable
#

also it has colored console

#

spigot has jank console

lofty mulch
#

you didnt get my word

#

Paper is better than spigot

#

ofc

stark nimbus
#

if you develop using the spigot apif

#

you can run it off any spigot

#

it doesn't matter which spigot you are using

lofty mulch
#

why dont use the original one

stark nimbus
#

because it's bad

clear fable
#

^

lofty mulch
#

pre-load lib is bad

clear fable
#

idk what u have against paper lol

stark nimbus
#

it has many wrongs in it

lofty mulch
#

whatever, i dont use bukkit anymore

#

just choose what you want xd

stark nimbus
#

@clear fable keep using paper spigot there is nothing wrong with it, but if you are developing a public plugin i'd recommend making it with the normal spigot that way it supports all spigots

lofty mulch
#

?

#

that's what I just said

clear fable
#

Its not a public plugin

lofty mulch
#

seems you guys understand wrong

stark nimbus
#

oh then make it with whatever you want πŸ™‚

clear fable
#

I just like paper

stark nimbus
#

yeah paper is cool

#

i'd recommend using forks of paper tho

lofty mulch
#

tuinity

stark nimbus
#

that way it's even way more optimized

#

you have flamecord and stuff like tht

lofty mulch
#

flamecord is bad

stark nimbus
#

flamespigot*

clear fable
#

maven is succ 😦

lofty mulch
#

no maven = no gradle

stark nimbus
#

honestly thinking of switching back to eclipse

#

the compiler was

#

pog

lofty mulch
#

eclipse compiler is pog

clear fable
#

wait I have an idea

lofty mulch
#

but

#

im gonna use intellij

stark nimbus
#

yes

#

it's auto completion api is cool

#

πŸ™‚

chrome beacon
#

So you want to compile with errors ;/

#

Also not everything compiles correctly with it

lofty mulch
#

just hated eclipse becuase it doesnt support gradle kotlin dsl

severe folio
#

sweats in Eclipse

severe folio
#

I prefer eclipse over intellij fsr

quiet ice
#

Eclipse doesn't like Kotlin in general

stark nimbus
#

Kotlin is ass

#

it's script java

#

i hate it

lofty mulch
#

kotlin is bad

stark nimbus
#

removes the fun of in-human java coding

lofty mulch
#

but the gradle buildscript is good

#

it just my thought about it

clear fable
#

guys

#

can I run a custom cmd command in the Command line section of the run config editor?

#

just like del "path to jar"

lofty mulch
#

just ignore it

#

im sure

#

i dont even care to the build dir since you only interact with src folder

quiet ice
#

wdym?

#

Do you mean starting a new process or something else?

clear fable
#

yeah

#

I want to run a cmd command after it finishes building

#

all I see is "Before launch"

#

I want to do smth afterwards

#

whatever

#

I'll just deal with the inconvenience

quiet ice
#

Where? In gradle?

#

If so you can make your custom task depend on build or make your custom task run after build. I do not have concrete examples but I guess some fabric or forge related repo should make use of them

outer sorrel
#

i have code on my usb and i opened it and it cant resolve symbol of any bukkit/spigot stuff
maven part

<dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot-api</artifactId>
            <version>1.16.5-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>

but it works if i change 1.16.5 to 1.13.2

<dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot-api</artifactId>
            <version>1.13.2-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
#

im using itellij

sage swift
#

you sure it works and isnt still downloading libraries

chrome beacon
#

Make sure you reload the POM after changing it

outer sorrel
chrome beacon
#

Send whole POM

outer sorrel
outer sorrel
#

it was working earlier today

#

it says

Library Maven: org.spigotmc:spigot-api:1.16.5-R0.1-SNAPSHOT has broken classes paths: Β Β C:\Users\prest\.m2\repository\org\spigotmc\spigot-api\1.16.5-R0.1-SNAPSHOT\spigot-api-1.16.5-R0.1-20210509.073748-70.jarΒ [Fix]

that in project structure problems thing

chrome beacon
#

Try deleting the org.spigotmc path and let it regenerate

outer sorrel
#

wait

#

i did file - invalidate cache / restart and it fixed

#

thanks anwyay

clear fable
#

oh ffs

#

its happening again

#

What causes this???

#

@lofty mulch Any other ideas?

lofty mulch
#

is it running?

clear fable
#

yes

#

as I said the code works fine but throws infinite errors lol

lofty mulch
#

only when execute?

clear fable
#

No

#

any time a discord event happens

#

the reason it was happening earlier was bc webhooks are events

#

for example GUILD_CREATE or GUILD_MEMBER_UPDATE are events

lofty mulch
#

well i have no idea

clear fable
#

I'm gonna ask the official discord guild for support

stark nimbus
#

or you've obfuscated it wrong

#

show me your JDA code @clear fable

clear fable
#

I asked in the official discord server for JDA

ivory sleet
#

Did discord bump their api or what lol

tribal holly
#

is it possible to disable end and nether during the plugin loading (onLoad) ?

ivory sleet
#

Probably but why

tribal holly
#

the question is not why but how

ivory sleet
#

My question was why

#

But I guess you might have to inject into the mapped config values before it’s red or smtng

tribal holly
#

yep but i don't understand why because i'm just asking how. For answer this context is not necessary

dusty herald
#

I mean you can disable those through server.properties and bukkit.yml manually?

#

I don't see why automation would be a need for something like this, but the files would be the best course of action

tribal holly
ivory sleet
#

You would touch the in memory version not the file

paper falcon
#

import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;

import net.md_5.bungee.api.ChatColor;

public class God implements CommandExecutor {

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        
        if(sender instanceof Player) {
            Player player = (Player) sender;
            player.setInvulnerable(true);
            player.sendMessage(ChatColor.RED + "GOD" + "" + ChatColor.GREEN + "" + " mode on");
            
            
            if(!player.hasPermission("god.use")) {
                player.sendMessage(ChatColor.RED + "" + ChatColor.RED + ChatColor.BOLD +"You don't have permission to use" + ChatColor.GREEN + ChatColor.BOLD + " God" +
             ChatColor.RED + ChatColor.BOLD + "!");
            }
            
            
        }    else {
            System.out.println("Sorry console, but only player can enter invincible state :)");
        }
        
        
        return false;
        
        
    }
    
    
}
``` I tried many things to add toggle system to this /god command which turns u invincible, but whenever I type /god it always turns god on, never off, like toggle system, do u guys know what should I add so whenever I type /god it turns on, then I type /god again it's gonna turn off and so on ?
glossy barn
#

You need to add the user to a list of players with god enabled, when they do /god again or leave, remove the god effect

paper falcon
#

I doubt I'll be able to do it

glossy barn
#

step 1: create a collection of players
step 2: in the code, create a condition that checks if the player is already in the collection
step 3: if they are, remove them and remove the effects
step 4: otherwise, enable the effects and add them to the list

#

If you don't know about collections, you need to read up on the Java Collections Framework (particularly ArrayLists) @paper falcon

paper falcon
#

oh, I'm familiar with ArrayList, thank you, I never thought of that

neon nymph
#

Be sure to utilize streams, it's much more efficient and cleaner compared to your usual for each loops

rain flint
#

Also, check if player has permission before effectively putting him on god mod, if not send message then return

minor garnet
#
    private void drop(final Player player) {
        final PlayerInventory inventory = player.getInventory();
        final World world = player.getWorld();
        final Location local = player.getLocation();
        Arrays.asList(inventory.getContents()).stream().filter(e -> e != null && e.getType() != Material.AIR)
        .forEach(item -> { world.dropItem(local, item); });
        Arrays.asList(inventory.getArmorContents()).stream().filter(e -> e != null && e.getType() != Material.AIR)
        .forEach(item -> { 
            world.dropItem(local, item); 
            inventory.remove(item);
            player.updateInventory();
            }
        );
        inventory.clear();
    }``` this method dont clear my armors contets but, drop..
rain flint
#

What do you want to achieve ! Remove armors from inventory ?

minor garnet
#

yes

rain flint
#

Well @paper falcon then you can just do player.setInvulnerable(!player#.isInvulnerable)

rain flint
#

You're litterally saying that you want to drop the item in your code

minor garnet
#

i want remi want remove all itens of player inventory and drop

rain flint
#

Oh ok you want both

minor garnet
#

i think ive fixed it

rain flint
#

doens't getContents also include armor ?

minor garnet
#

no

rain flint
#

Ok my bad

flint elk
#

How can I make a Anvil-Input?

solemn shoal
#

how do i enumerate all fields in all classes in jar files i load?

#
URLClassLoader child = new URLClassLoader(
        new URL[] {new URL("file://"+file)},
        Main.class.getClassLoader()
);
Enumeration<JarEntry> entries = jarfile.entries();
while(entries.hasMoreElements()){
    JarEntry je = entries.nextElement();
    String jern = je.getRealName();
    if(jern.endsWith(".class")) {
        ConUtil.println(je.getRealName());
        Class classToLoad = Class.forName(jern.replaceAll("/", ".").replace(".class",""), true, child);
        for(Field f : classToLoad.getDeclaredFields()) ConUtil.println(String.format("%s: %s",classToLoad.getName(), f.getName()));
        Method method = classToLoad.getDeclaredMethod("myMethod");
        Object instance = classToLoad.newInstance();
        Object result = method.invoke(instance);
    }
}```
#

thats my current code but it keeps throwing class not found

chrome beacon
#

I assume that's copy pasted from somewhere

#

or at least I hope so

solemn shoal
#

no

#

well, partially

vast quest
#

I didnt copy all I added the last ;

sinful kelp
#

Hey guys, my plugin has loads of GUIs. Clicking on different items has loads of different uses.

Is there a good way to code for each of these uses? Rather than if statement after if statement?

outer crane
#

there's probably some API that does it the sexy way

silver cove
#

or u can code it urself

young knoll
#

Doesn’t really take much

#

I have a hashmap and a custom inventory class that uses consumers

neon nymph
#

Haven't tried, but what about a hashmap<string, thread> where string is the localized name of the item

#

So when an item is clicked it'll do map.get(name).start()

young knoll
#

Just use the slot

#

Also why a thread

neon nymph
#

Dunno, just thought of a method

solemn shoal
#

inb4 switch statement lol

neon nymph
young knoll
#

Then use a pdc entry on the item

#

Or just change the connections when you change the inventory order

tribal holly
#

how to set FaceDirection of a block with BlockData ?

tribal holly
#

can it be tested as : instanceof Directional ?

#

cause the test don't pass

eternal oxide
#

yes

tribal holly
#
generated an exception
java.lang.ClassCastException: class org.bukkit.craftbukkit.v1_16_R3.block.impl.CraftRotatable cannot be cast to class org.bukkit.block.data.Directional (org.bukkit.craftbukkit.v1_16_R3.block.impl.CraftRotatable and org.buk
kit.block.data.Directional are in unnamed module of loader 'app')```
#
block.setType(material);
Directional data = (Directional)block.getBlockData();
data.setFacing(BlockFace.NORTH);
block.setBlockData(data);```
#

and the test block.getBlockData() instanceOf Directional don't pass

#

the block in question is a log

cinder thistle
#

does the block data implement it or does block

#

?jd

vast quest
#

someone giv idea to make plugin thanks please I appreciate it

cinder thistle
#

nah

#

do it yourself

vast quest
#

I cant find any ideas

#

:c

tribal holly
cinder thistle
#

does the Block class implement Directional or does BlockData

#

also make sure you imported the right directional

#

looks like there's 2 in spigot

tribal holly
#

import org.bukkit.block.data.Directional;

cinder thistle
#

looks right

tribal holly
#

me to but got this error while trying to change direction of the block

#

and a log is certainly a directional block

#

else i can't find how to change it direction

cinder thistle
#

what log class are you referring to?

tribal holly
#

a oak_log to be precise

cinder thistle
#

that's not a class

tribal holly
#

that's the material i know

#

but it's a Block

cinder thistle
#

Material.OAK_LOG?

tribal holly
#

as far as i know

cinder thistle
#

that's not a class at all

#

also it's Orientable not Directional

tribal holly
#

yep i know but it's a Block and Block is a class i'm wrong ?

cinder thistle
tribal holly
#

ho

#

well

cinder thistle
#

a material is a property of a block

tribal holly
#

yep sorry misunderstanding from my part

cinder thistle
#

u good

tribal holly
#

i'm testing

#

gonna kill my self

eternal oxide
#

If the original is a Block its Directional

drowsy helm
#

usually you can't cast nms to bukkit classes directly so thers something funky going on with that instanceof

cinder thistle
#

what in the world

tribal holly
cinder thistle
#

oh nvm I c

#

lots of casts make code hard asf to read

eternal oxide
#

Test the Block instanceof Directional, Cast and setFacing

tribal holly
#

the problem come from the last block is not correctly save. When a player break a block i respawn it after X time but the problem is when i'm getting the last blockData from the last block it's air

#

and not wood with orientable data

eternal oxide
#

How do you mean "the last block"? breaking multiple blocks?

tribal holly
#

when a plyer break a block i'm scheduling a task

#

and i send the "latest" block before replacement

eternal oxide
#

you can;t send the block as that is only a reference to the block in the world. By the time your code runs the block has already been replaced. You have to use BlockState.

tribal holly
eternal oxide
#

If you getState and pass just that you have everything you need. BlockData, Type, location

tribal holly
#

when i print axis it's right

#

but the block is not correctly oriented

#

maybe need an update ?

eternal oxide
#

yes you need to update if you apply a state.

#

if you use a state you don;t even need to do any of the directional code

eternal oxide
#
    @EventHandler
    public void onRightClick(BlockBreakEvent event) {
        
        final BlockState state = event.getBlock().getState();
        
        new BukkitRunnable() {
            
            @Override
            public void run() {
                
                state.update(true);
            }
        }.runTaskLater(plugin, 100);
    }```
tribal holly
#

but how i "apply" a state to a block

#

or the state is already the block ?

eternal oxide
#

the state already holds the block reference

#

The state is a snapshot of the block at teh time you obtained the state

tribal holly
#

yep but he don't hold the last block but the actual one ?

#

hoooo

#

but i don't understand your saying the state is a snapshot of a block at a time si i need to apply it to the new one

#

i think i don't understand

eternal oxide
#

one sec

tribal holly
#

ooookkkay

#

i understand

#

it work

eternal oxide
#

ok

tribal holly
#

thanks for your help

opal sluice
#

Hello, I was wondering if there was a way to know which key the player pressed

#

specifically here the forward/backward key

eternal oxide
#

no

#

You can guess by the change in the players velocity

opal sluice
#

For the backward I think I can get it

#

but the forward would be a bit tricky since when he does double w

#

he start sprinting

eternal oxide
#

The best you can achieve is a guess

opal sluice
#

I would like to implement a sort of dash mecanic

opal sluice
#

the forward though, I don't think so

eternal oxide
#

There are many events that can push/move the player. All of those would also trigger your logic to think a key was pressed

opal sluice
#

Sure, the problem is not the dodge by itself, it's the way it get triggered, I mean, if the player is sprinting, I would like he got the possibility to dash forward

eternal oxide
#

a decrease in velocity could mean the player pressed the back key, but it could also mean he just let go of the forwards key, or entered water.

opal sluice
#

don't he get a velocity in the opposite axis from where he looks ?

eternal oxide
#

not until he starts moving in that direction

opal sluice
#

Like, if I look at north, my velocity is positive on forward, and negative in backward

eternal oxide
#

as I said, the best you can achieve is a guess.

opal sluice
#

Oh! What if check for the toggle sprint event ?

#

Like, if he toggle the sprint twice fast enough he could dash

#

But that would work only on forward x)

crude charm
#

check

#

if the player is springing

eternal oxide
#

Yep, sprint is the only one that has an event

earnest junco
opal sluice
quartz panther
#

I have a question about plugin encryption, is there a tutorial on YouTube or other sites??

quartz panther
#

||google translator help||

opal juniper
#

Do you mean translate?

#

or obfuscate?

quartz panther
#

I did not translate this sentence from Polish, but my point is that you should not be able to open the .class file using, for example, luyten

#

My english su*ks

opal juniper
#

there is no way to encrypt it afaik because it has to be run. Any plugin can be put through a tool like fernflower - it is just how it is

eternal oxide
#

We can pretty much guarantee no code you write is going to be new or innovative enough that it needs protecting.

vast quest
#

How can I get a float from config

quartz panther
vast quest
#

trying to make it so u can customise the sound from config

#

seems like it needs float

eternal oxide
#

float value = (float) double;

vast quest
#

Inconvertible types; cannot cast 'double' to 'java.lang.Float'

#

oh

#

nvm u edited

eternal oxide
#

float not Float

spice juniper
#

Does anyone know how to make reload config command?

vast quest
#

Thanks!

eternal oxide
#

my edit was to remove a ;

vast quest
#

idk I swear I saw (Float)

quartz panther
spice juniper
#

It doesnt work

eternal oxide
spice juniper
#
        this.getConfig().options().copyDefaults(true);    
        
        if (this.getConfig().getBoolean("IronHorseArmor")) {
            this.getServer().addRecipe(recipeIronHorseArmor);
        }
        if (this.getConfig().getBoolean("GoldenHorseArmor")) {
            this.getServer().addRecipe(recipeGoldenHorseArmor);
        }
        if (this.getConfig().getBoolean("DiamondHorseArmor")) {
            this.getServer().addRecipe(recipeDiamondHorseArmor);
        }
        if (this.getConfig().getBoolean("Saddle")) {
            this.getServer().addRecipe(recipeSaddle);
        }
        this.saveConfig();

This is my onEnable

#

And this is my config file


IronHorseArmor: true
GoldenHorseArmor: true
DiamondHorseArmor: true
Saddle: true
#

and when I do /che reload it will do this.reloadConfig();

eternal oxide
#

why are you saving the config when you made no changes?

spice juniper
#

So do I have to remove this.saveConfig();

eternal oxide
#

its doing nothing. I would put (at the beginning) saveDefaultConfig();

#

Reloading your config is not going to run your onEnable code again.

spice juniper
#

Okay but how can I make a reload config command?

#

so when I change the config I can reload the config without reloadig the server

eternal oxide
#

reloadConfig() only reloads the values from file.

#

what do with that data is upto you

spice juniper
#

Okay but do you know how to make a command so if I change something in the config I can reload the config without reloading the entire server?

eternal oxide
#

You separate your code from your onEnable and call it as you need from the command

spice juniper
#

Could you help me with that?

wooden warren
#

How do i detect if a player is whereing any 2 pieces of my custom armour set

wooden warren
#

But how would it see if it has 2 pieces would i have to do if boots and legs and stuff

eternal oxide
#

you just loop the returned array and count the matches

fiery inlet
#

Whenever i do
player.sendTitle();
It just puts a line over, anyone know why?
Spigot 1.8.8, JDK 8

eternal oxide
#

what are you actually sending?

fiery inlet
#

Well no matter what it is, it puts a line over.

eternal oxide
#

a line over?

fiery inlet
#

ye 2sec ima do screenshot

eternal oxide
#

hover your mouse over it and you'll see why

fiery inlet
#

"is deprecated"

eternal oxide
#

use sendTitle("test", -1, -1, -1);

fiery inlet
#

u cant

#

it wants me to add player.

eternal oxide
#

player.sendTitle

fiery inlet
#

ye thats exactly what im doing

eternal oxide
#

no you are not

#

look at what you have and look closer at what I showed you

fiery inlet
#

it only accepts 2 strings

#

not 4

eternal oxide
#

those 3 are not strings

#

try player.sendTitle("test", "", -1, -1, -1);

fiery inlet
#

still putting a dash in

eternal oxide
#

show

fiery inlet
#

ur doing the confus

#

u want me to do what the link says

#

or what u says

eternal oxide
#

the code I showed you is the same as the javadoc.

fiery inlet
#

no matter what i write, it puts those lines in front of sendtitle

eternal oxide
#

it will only put lines if you are using the deprecated method or the method doesn;t exist

#

the single string method is deprecated. What error is it showing you with the code I provided?

fiery inlet
#

@Deprecated

eternal oxide
#

then you did not use the code I showed you

fiery inlet
#

i copy paste lol

eternal oxide
#

?paste to show your code

plain quest
#

How do i send PacketPlayOutRespawn in 1.16?

queen dragonBOT
plain quest
fiery inlet
#

ok

#
package me.barry.commands;

import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;

public class Equipcommand implements CommandExecutor {

    @Override
    public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
        if (!(sender instanceof Player)) {
            sender.sendMessage("Β§7[ Β§cEQUIP Β§7] Β§fThis plugin's command, is only usable by a player!");
            return true;
        }
        Player player = (Player) sender;
        if (cmd.getName().equalsIgnoreCase("equip")) {
            Inventory inv = player.getInventory();
            inv.clear();
            player.getInventory().setHelmet(new ItemStack(Material.DIAMOND_HELMET));
            player.getInventory().setChestplate(new ItemStack(Material.DIAMOND_CHESTPLATE));
            player.getInventory().setLeggings(new ItemStack(Material.DIAMOND_LEGGINGS));
            player.getInventory().setBoots(new ItemStack(Material.GOLD_BOOTS));
            player.getInventory().setItem(0, new ItemStack(Material.DIAMOND_SWORD, 1));
            player.getInventory().setItem(1, new ItemStack(Material.FISHING_ROD, 1));
            player.getInventory().setItem(2, new ItemStack(Material.BOW, 1));
            player.getInventory().setItem(8, new ItemStack(Material.ARROW, 32));
            player.sendTitle("test", "", -1, -1, -1);
        }
        return true;
    }
}
eternal oxide
#

PacketPlayOutRespawn is NMS and you need to use spigot dependency instead of spigot-api

eternal oxide
fiery inlet
#

Well it is

#

And im guessing its cuz im spigot 1.8.8

eternal oxide
#

hover over and check again

fiery inlet
#

still is

sleek pond
eternal oxide
#

^ litterally impossible for it to show as deprecated.

sleek pond
#

screenshot

fiery inlet
#

i did

#

imma send again

eternal oxide
#

ok, what you are actually seeing is a no method error. You are on 1.8

fiery inlet
#

i told you

#

(:

eternal oxide
#

It looks like 1.8 only has sendTitle(String title, String subtitle) and its deprecated

eternal oxide
# fiery inlet i told you

no you kept telling me it was deprecated. the method I gave you is not in 1.8 so its not deprecated its non extant

fiery inlet
#

well i told you im 1.8.8 spigot jdk 8 in the first message (:

eternal oxide
#

Yeah, no one supports 1.8 its half a decade old 😦

fiery inlet
#

pvp servers

eternal oxide
#

8%

fiery inlet
#

and im on a danish minehut that only does 1.8

#

sooo

#

and im not gonna make my own server with no players

#

(:

sleek pond
#

and does not support custom plugins I think

main dew
#

Where I can find metod to place block (by the player) in open source spigot?

fiery inlet
eternal oxide
#

to simulate a player placing a block is not easy

spice juniper
#

Guys I have this in my onEnable: https://paste.md-5.net/igolobafuh.cpp
And this config file: https://paste.md-5.net/jarobunefu.bash
I know have a command that does reloadConfig but it doesn't work
I want a command that reloads the config so whenever I change something in the config and I execute the command to reload the config it will reload the config file without reloading the entire server. How can I do this?

sleek pond
#

and then you can do Block.setMaterial to whatever you want

#

or something like that

sleek pond
spice juniper
sleek pond
#

what do you use the config for?

spice juniper
#

In the config you enable/disable recipes

neon nymph
#

Can you show the command you created

spice juniper
neon nymph
#

And when you use that, it'll send "reloaded"?

spice juniper
#

Yes

#

But if I set one to false in the config and use the command it still is craftable

neon nymph
#

Remove the saveDefaultConfig();

#

Then try again

spice juniper
#

I cant see my config file now

neon nymph
#

Oh my bad, didn't realize that's onEnable

neon nymph
spice juniper
#

You mean this command right? ^^

neon nymph
#

Hmm, I think I see the problem

#

It doesn't matter if you changed the boolean to false and reloaded the config, you already added the recipe in your onEnable

granite stirrup
#

why is the config getStringList function not working

neon nymph
#

So when you reload, you'll need to go through the check again

#

This time, add an else statement for false. I'm not sure if there's a removeRecipe method though

spice juniper
#

Corals one question

neon nymph
#

yes?

eternal oxide
# main dew Where I can find metod to place block (by the player) in open source spigot?

I've not tested it, but you could try this```java
public boolean placeBlock(Player player, Location loc, Material type) {

    Block block = loc.getBlock();
    BlockData blockData = type.createBlockData();
    
    BlockState replacedState = block.getState();
    replacedState.setBlockData(blockData);
    
    BlockPlaceEvent place = new BlockPlaceEvent(block, replacedState, block.getRelative(BlockFace.DOWN), new ItemStack(type), player, true, EquipmentSlot.HAND);
    plugin.getServer().getPluginManager().callEvent(place);
    
    if (place.isCancelled()) return false;
    
    block.setType(type);
    block.setBlockData(blockData);
    
    return true;
}```
young knoll
#

There is

spice juniper
# neon nymph yes?

so I just have to add else statements to the if statements in my onEnable?

#

with a remove recipe method

neon nymph
#

Hmm, better to create a method specifically for that

main dew
granite stirrup
#

so im using the config api getStringList method and its not working and its returning a empty List<String> and idk why the config.yml file has the String list in it getString method works tho ;-; does anyOne know how to fix

eternal oxide
neon nymph
#
private void checkArmor() {
    if (this.getConfig().getBoolean("IronHorseArmor")) {
        this.getServer().addRecipe(recipeIronHorseArmor);
    }
    if (this.getConfig().getBoolean("GoldenHorseArmor")) {
        this.getServer().addRecipe(recipeGoldenHorseArmor);
    }
    if (this.getConfig().getBoolean("DiamondHorseArmor")) {
        this.getServer().addRecipe(recipeDiamondHorseArmor);
    }
    if (this.getConfig().getBoolean("Saddle")) {
        this.getServer().addRecipe(recipeSaddle);
    }
}
public void onEnable() {
    saveDefaultConfig();
    checkArmor();
}
#

Something like that

#

Then add that method after the reloadConfig() as well

#
  • an else statement that removes the recipe
eternal oxide
young knoll
granite stirrup
unreal finch
#

I dont really know where to start here, was hoping for some advice

I’d like to change the texture of crop plants based on what carrot was used to plant the crop. For example, if the carrot was named Green or something, it’d be a different texture than the default carrot plant.

Is it possible to store a value inside the block and use that to change its texture?

granite stirrup
neon nymph
#
test:
- "test"
- "test2"
- "test3"
granite stirrup
#

k i try

main dew
spice juniper
#

Does anyone know how to remove a custom recipe?

granite stirrup
eternal oxide
neon nymph
granite stirrup
neon nymph
#
getConfig().getStringList("test").forEach(System.out::println);
#

Try that

granite stirrup
#

k wait a sec

granite stirrup
#

but idk why it isnt setting the list to it

neon nymph
#

What do you plan on doing with the list?

granite stirrup
#

sending it to the player

neat trout
#

Anyone knows how can we integrate Firebase for Minecraft Version 1.8. I have made it successfully on Server Version Paper 1.16.5.

[16:23:49 ERROR]: com.google.common.base.Preconditions.checkArgument(ZLjava/lang/String;CLjava/lang/Object;)V initializing AccountLinker v1.0 (Is it up to date?)
java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkArgument(ZLjava/lang/String;CLjava/lang/Object;)V

This is the error it gives

granite stirrup
#

but i have mutliple lists

#

i want to get

neon nymph
#

one by one? Are they all string?

granite stirrup
#

?

#

yeah there all strIng but it says the list is empty

neon nymph
#

Wdym by sending it to the player

#

As sendMessage?

granite stirrup
#

ye

#

but i want to get 3 lists using the thing but it isnt setting the list

neon nymph
#

If sending the strings as messages is your goal

#

This works perfectly^

granite stirrup
#

thats not what i want tho

#

i want to send in this send(player, getConfig().getString("help_prefix") + test3 + getConfig().getString("test_idk") + getConfig().getString("test_idk2_" + test2));

#

and i cant loop through the list cuz its empty

#

;-;

carmine ivy
#

How would I set a players gamemode with a Listener. At the moment nothing is happening except the sendMessage part. I'm not great at this but I hope you guys can help!
Code:

package Listeners;

import org.bukkit.*;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerRespawnEvent;

public class respawnListener implements Listener {

    @EventHandler
    public void onRespawn(PlayerRespawnEvent event){
        Player p = event.getPlayer();
        p.sendMessage(ChatColor.RED + "Oh no! You died.");
        p.setGameMode(GameMode.SPECTATOR);

    }

}
wraith rapids
#

changing the gamemode in the respawn event has no effect

carmine ivy
#

oh

#

So how would I work around that

granite stirrup
#

force console to run command?

#

idk

carmine ivy
#

Would that work

main dew
eternal oxide
#

Don't use plugins if they ignore the cancelled state of events.

neon nymph
young knoll
#

Or check your listener priority

wraith rapids
#

no, it would not work either

#

also running commands through the console to do things is stupid

neon nymph
wraith rapids
#

probably the only course of action

young knoll
quaint mantle
#

Hi! I got a weird issue with my plugin today and i can't seem to figure out what is wrong with it. It returns a negative number for the size of an linkedhashmap (wrapped around with String#valueOf()):

#

is there any reason for it to do this?

#

like that sounds like a very weird case to me...

#

have never seen maps having a negative number

wraith rapids
#

you're probably seeing things

carmine ivy
granite stirrup
quaint mantle
#

a user also saw that it went down to -4 for him

wraith rapids
#

show the relevant bits of code

neon nymph
quaint mantle
#

one sec. Would you prefer screenshots or pastes one by one?

wraith rapids
#

doesn't matter i guess

quaint mantle
#

k

neon nymph
granite stirrup
limpid lily
#

How can I transfer players through Bungee servers from a Paper instance? If I'll run a command as player will BungeeCord catch that or will it be like running the command from console?

quaint mantle
wraith rapids
#

bungeecord listens to commands on the network

#

running a command on the server will not be seen by bungeecord

neon nymph
wraith rapids
#

use a messaging channel yeah

granite stirrup
#

im on a bungeecoord and im using a normal plugin with command and it runs fine?

wraith rapids
#

it doesn't

granite stirrup
#

or do u mean transferring to servers

limpid lily
#

What about server's #dispatchCommand()?

wraith rapids
#

bungee listens to commands on the network

quaint mantle
wraith rapids
#

bungee will only see the command if it is sent through bungee

#

that is, sent by the player

#

through bungee

#

to the server

#

executing a bungee command on the backend server will not be seen by bungee

granite stirrup
wraith rapids
#

yes

#

the plugin uses a plugin messaging channel

#

to communicate with bungeecord

quaint mantle
wraith rapids
#

when the plugin's command is used

quaint mantle
#

^^^

granite stirrup
wraith rapids
#

sure but that's not how it works

granite stirrup
#

using the commandmap

lyric grove
#

Hi, i just imported my project again and i get this on my pom

wraith rapids
#

i don't know what you are doing, but bungee will not see you executing its commands on the backend server

sage swift
#

1.8

#

HAAHAHA

#

AHAHAHAHAA

granite stirrup
lyric grove
#

?

lyric grove
wraith rapids
#

not spigot
not supported
5+ years old

#

shoo

sage swift
#

im 5+ years old

wraith rapids
#

go ask in paper and get assraped by them for asking in paper

lyric grove
wraith rapids
#

you are trying to use the papermc artifact from the spigotmc repo

#

paper is not spigot

#

spigot is not paper

sage swift
#

<version>1.16.5-R0.1-SNAPSHOT</version> or do this

lyric grove
granite stirrup
#

paper is fork of spigot tho lol

#

but

wraith rapids
#

then why are you trying to use the fucking spigot repository

granite stirrup
#

u would have to import the repo for paper

#

;-;

wraith rapids
#

the paper api is not on the fucking spigot repository

granite stirrup
#

he probs got confused since its called paperspigot

lyric grove
#

i mean why complain about this, your not helping anyone

wraith rapids
#

i am

#

i'm telling you to use the correct repository

#

i'm literally telling you what's wrong

lyric grove
#

im not going to use 1.16

wraith rapids
#

i'm not telling you to use 1.16

sage swift
#

then you're on your own

granite stirrup
#

u still have to use the paper repo

#
    <id>papermc</id>
    <url>https://papermc.io/repo/repository/maven-public/</url>
</repository>```

```<dependency>
    <groupId>com.destroystokyo.paper</groupId>
    <artifactId>paper-api</artifactId>
    <version>1.8.8-R0.1-SNAPSHOT</version>
    <scope>provided</scope>
</dependency>``` @lyric grove
lyric grove
#

thanks

#

and i imported the repo

granite stirrup
#

did u import the repo

#

the paper mc one?

lyric grove
#

yeah

granite stirrup
#

show

wraith rapids
#

i don't know if the old paper api artifacts are on that repo

lyric grove
#

they are

sage swift
#

probably not lol

wraith rapids
#

they might not be publicly available or they might be on a different repo

sage swift
#

on their downloads api page they show down to 1.11

#

that's for waterfall, nvm

paper falcon
#

import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;

import net.md_5.bungee.api.ChatColor;

public class God implements CommandExecutor {

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        
        if(sender instanceof Player) {
            Player player = (Player) sender;
            if(!player.hasPermission("god.use")) {
                player.sendMessage(ChatColor.RED + "" + ChatColor.RED + ChatColor.BOLD +"You don't have permission to use" + ChatColor.GREEN + ChatColor.BOLD + " God" +
             ChatColor.RED + ChatColor.BOLD + "!");
                }
            
            
            player.setInvulnerable(!player.isInvulnerable());
            player.sendMessage(ChatColor.RED + "GOD" + "" + ChatColor.GREEN + "" + " mode on");
                
        }    
        
        else {
            System.out.println("Sorry console, but only player can enter invincible state :)");
        }
        
        return false;
                
    }
    
}

So I made it (with help of few people from the server) that whenever I type /god, /g, /invincible, God mode toggles on/off after each time I type /god.. But same message always pops up, "God mode on".. Where should I add player.sendMessage("God mode off"); so that "God mode off" message pops up after turning god mode off? Thanks in advnace, I;m begginer in spigot coding

wraith rapids
#

that's not paper-api

#

that's spigot-api

granite stirrup
lyric grove
#

yeah i was originally using spigot but you suggested to use paper

#

πŸ€¦β€β™‚οΈ

compact haven
#

player.isInvulnerable() ? "on" : "off" @paper falcon

wraith rapids
#

i did not

lyric grove
granite stirrup
#

to begin with

#

lol

wraith rapids
#

you were using paper

sage swift
#

no 1.9.4 is there lol

lyric grove
#

i was using spigot to begin with

granite stirrup
#

no u didnt

sage swift
#

i bet they removed 1.8 on purpose

wraith rapids
#

you were depending on paper

#

or, more accurately

#

trying to depend on paper

granite stirrup
#
        <repository>
            <id>spigot-repo</id>
            <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
        </repository>
    </repositories>
    <dependencies>
        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot-api</artifactId>
            <version>1.12.2-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>``` @lyric grove
#

sorry i included pLaceholder api in my project XD

paper falcon
compact haven
#

its a ternary

#

you use string concatenation

tepid willow
#

Hey ya'll, I was provided this snippet of code to use for running things 2 ticks after a client connects:

Bukkit.getScheduler().runTaskLater(plugin, new Runnable() {
    @Override
    public void run() {
        manager.addPlayer(player);
    }
}, 2);

but for some reason, unless im just having a brainfart, i cannot actually access anything in org.bukkit.Bukkit lol.

I have org.bukkit.Bukkit imported as well, but just can't do anything with it

granite stirrup
#

do u think im the only person who try catched IndexOutOfBoundsException

#

XD

lyric grove
#

this is definitely correct, matched it up with the repo

granite stirrup
wraith rapids
#

reimport and clear caches and all that jazz

granite stirrup
#

LMAO i dont think spigot support 1.8.8 to

#

cuz i changed mine to 1.8.8

#

it errored

#

your out of luck mate

#

u cant use 1.8.8

#

;-;

#

sorry

#

1.12.2 works tho

#

:)

lyric grove
#

what are you saying? i know loads of plugins that support it

granite stirrup
lyric grove
#

its obviously a project issue

vocal shuttle
#

Works for 1.8.8

granite stirrup
#

idk

vocal shuttle
#

They have 1.8

#

I use it lol

granite stirrup
#

oh wait they do

#

have 1.8.8

vocal shuttle
#

Yes lmao its the most used for version for servers

granite stirrup
#

lol weird cuz it doesnt work for me xd and pengu

eternal oxide
#

8% of servers run 1.8

paper falcon
#

@compact haven
my code looks like this now and works perfectly fine

package io.github.TunaJava;

import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;

import net.md_5.bungee.api.ChatColor;

public class God implements CommandExecutor {

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        
        if(sender instanceof Player) {
            Player player = (Player) sender;
            if(!player.hasPermission("god.use")) {
                player.sendMessage(ChatColor.RED + "" + ChatColor.RED + ChatColor.BOLD +"You don't have permission to use" + ChatColor.GREEN + ChatColor.BOLD + " God" +
             ChatColor.RED + ChatColor.BOLD + "!");
                }
            
            
            if(player.isInvulnerable()) {
                player.sendMessage(ChatColor.GREEN + "GOD" + "" + ChatColor.RED + "" + " mode off");
                player.setInvulnerable(false);
            } else {
                player.sendMessage(ChatColor.GREEN + "GOD" + "" + ChatColor.RED + "" + " mode on");
                player.setInvulnerable(true);
            }
            
                
        }    
        
        else {
            System.out.println("Sorry console, but only player can enter invincible state :)");
        }
        
        return false;
                
    }
    
}
```
vocal shuttle
granite stirrup
#

1.8 is rubbish

compact haven
#

thats unnecessary

eternal oxide
#

every spigot and plugin statistic

lyric grove
compact haven
#

but shrug

lyric grove
#

its the best version for performance

wraith rapids
#

it's not

lyric grove
#

(excluding 1.7)

wraith rapids
#

1.6 runs better

vocal shuttle
#

A lot of servers just use 1.8 for the pvp

granite stirrup
wispy fossil
#

alot of servers suck

#

real hard

eternal oxide
granite stirrup
#

because 1.12.2 has alot of features that matter

lyric grove
granite stirrup
#

and its performant still

wraith rapids
#

it also went downhill after RC1

#

and 1.2

#

and 1.6

vocal shuttle
wraith rapids
#

and 1.8beta

#

and basically every version since classic

lyric grove
#

i mean i use 1.7 on my server

granite stirrup
lyric grove
#

its a fork for hcf

granite stirrup
#

1.12.2 is good ;-;

wraith rapids
#

1.12 is literally the most useless version

wispy fossil
#

even hypixel is moving forward

eternal oxide
lyric grove
wraith rapids
#

at least the autoclicker sweats that stick with 1.8 have an excuse

#

what's the point for 1.12

granite stirrup
#

1.12 still gets performance tho ;-; and its got more features

lyric grove
granite stirrup
vocal shuttle
wraith rapids
#

unless you're running a 100+ player server there is little difference between 1.12 and 1.16

wispy fossil
#

not true
many hypixel servers have moved up to 1.12.2
and some to 1.14.4

granite stirrup
#

they use 1.12.2

vocal shuttle
#

Yea thats what im saying

wispy fossil
#

very really

granite stirrup
#

u can run 100+ on 1.12.2 smoothly

wraith rapids
#

you can run 100+ on 1.16 smoothly as well

lyric grove
#

you can run 1000+ on 1.7 smoothly

granite stirrup
vocal shuttle
wispy fossil
#

build battle

granite stirrup
wispy fossil
#

never pvp 😭

lyric grove
#

even default 1.8 spigot can run 200+ if you dont have stupid plugins

vocal shuttle
#

Since when

wispy fossil
#

awhile ago

#

last year i think

lyric grove
#

you wouldnt see that on any 1.9+ spigot

wispy fossil
#

for concrete mostly

wraith rapids
#

since when did a shitty minigame server become the defacto standard for how a sandbox game server should be run

lyric grove
#

hypixel do use 1.7 as base

granite stirrup
#

no they dont

#

they use 1.12.2

lyric grove
#

they use 1.7 wdym

wraith rapids
#

who gives a shit about what hypixel uses

granite stirrup
#

they DO USE 1.12.2

lyric grove
#

they have 1.8 pvp

granite stirrup
#

build battle uses 1.12.2

granite stirrup
#

idiot

lyric grove
vocal shuttle
#

They use 1.8 as the core some mini games are 1.12+

eternal night
#

pretty sure hypixel runs its own server implementation anyway xD

granite stirrup
eternal night
#

they choose what features to have in there and which not

#

so I don't see the point of this

vocal shuttle
#

I said 1.12+

lyric grove
#

yes? they dont use 1.12 or any version, they use a fork with added features from newer versions

wispy fossil
#

are you running a pvp server?
🀣 how did your life get so downhill so fast

granite stirrup
#

but anyway i need my problem fixed lol

#

for some reason List<String> test = getConfig().getStringList("test"); doesnt work

#

its makes it empty

#

;-;

granite stirrup
eternal oxide
#

show your config

granite stirrup
#
test:
- "test1"
- "test2"
- "test3"```
eternal oxide
#

thats all thats in your config?

granite stirrup
#

ye