#help-development

1 messages · Page 1507 of 1

steep nova
#

if he's just copying the code word for word

quiet ice
#

It is exhausting to see someone complain that something does not work only to not know what does not work

steep nova
#

there's no hope

quiet ice
#

And what it should really do and what it actually does

onyx shale
#

i mean i think 2 learnjava cmds were used

chrome beacon
onyx shale
#

plenty of links to learn java

daring maple
lunar schooner
#

So just curious, how expensive is World#getHighestBlockAt()? It's specifically this call that is giving some very heavy performance issues.

lean gull
#

plugin is red

steep nova
quiet ice
#

Did you use EnumSet?

chrome beacon
daring maple
onyx shale
#

like you should be able to spam it with little to no effect

chrome beacon
#

Please learnjava

lunar schooner
lean gull
#

idk what's enumset nor instance

chrome beacon
steep nova
quiet ice
daring maple
steep nova
daring maple
#

He does not

steep nova
#

bruh

lunar schooner
onyx shale
#

i hink the problem is he is trying to learn java through plugin making

#

wich is an awful ideea

daring maple
#

The guide he is following assumes you know how to create an instance of your main class, which he doesnt.

onyx shale
quiet ice
#

There is nothing wrong at it's core (of learning java with bukkit), but asking other people every time is wrong

lunar schooner
#

Hm fair point. Not sure if World.getHighestBlock at does too though

#

actually, I could probably just scrap it alltogether

onyx shale
#

you could grab snapshot of chunk

#

then work with it async

lunar schooner
#

Hm, could you explain that further?

lean gull
onyx shale
#

a snapshot will give you a full copy of the selected chunk

lean gull
#

in main i have

    public String ifConfigValueIsSet(String ConfigValue) {
        return this.getConfig().getString(ConfigValue);
    }```
onyx shale
#

so no more api related to it,meaning you can do async

daring maple
#

I mean, I got into programming because of Bukkit. 🤷‍♂️

onyx shale
#

on it

chrome beacon
steep nova
lean gull
#

right 1 sec

steep nova
quiet ice
#

Please use StackOverflow

onyx shale
#

1sec

quiet ice
#

Do not ask us, it only wastes YOUR time

steep nova
#

bro fr you won't be able to do this w/o learning java

lean gull
lunar schooner
daring maple
#

bruh

quiet ice
ornate heart
#

Can someone explain to me why you shouldn't name your plugin's main class "Main?" I'm trying to explain to a friend why they shouldn't, but don't entirely know the specifics.

daring maple
steep nova
#

isnt main with a lowercase m a protected word?

chrome beacon
quiet ice
lean gull
steep nova
daring maple
#

nowhere

lunar schooner
iron condor
#

can I compare getOpenInventory() with a custom inventory?

steep nova
#

learn basic coding first

lean gull
#

ok if you're gonna hate / say "learn java", i will block you :P

onyx shale
stone sinew
#

@onyx shale Material.matchMaterial() was causing the lag. Material.getMaterial() works right

daring maple
#

Welp good luck finding any help then

iron condor
chrome beacon
steep nova
ivory sleet
#

Floofsys block list extends beyond infinity soon lol

#

Anyways floofsy what was the issue

stone sinew
#

I mean the whole method is still laggier then on my test plugin but meh...

lean gull
#

conclure just look up in here

ivory sleet
#

Yeah but what were you trying to do?

onyx shale
lean gull
#

make a stored variable thing

quiet ice
ivory sleet
onyx shale
#

plese click that link

lean gull
#

well on memory

steep nova
lean gull
#

i want on a file

ivory sleet
#

Sure

#

What you got now then

onyx shale
#

also

#

?spoon

undone axleBOT
#

Spoonfeed a newbie for a day and they'll come back with more questions. Teach them to find their own answers and you'll both be better off: you won't get stuck answering the easy questions and they'll be much more productive than before.

lean gull
#

again, just look up in here

#

i'mma just block stellrow and theevilist

ivory sleet
#

Mind resending, cba scrolling up in this chat 🥲

onyx shale
#

why are you doing such a heavy operation so fast?

stone sinew
chrome beacon
stone sinew
onyx shale
stone sinew
onyx shale
#

i mean not for the arrow

#

for the checks

stone sinew
#

I'm trying to match the speed

#

They are using the exact same checks xD

#

Thats why I'm so confused lol

shadow gazelle
#

Okay, so, I'm making a crafting thing where you drop a custom book and chestplate on the ground and get the enchantment on the chestplate that was dropped. I have the code for removing the custom book if it was dropped with a chestplate, but I now need to edit the dropped chestplate. I don't know how to access the chestplate from what I have here, can anyone at least point me in the right direction?
https://paste.md-5.net/ojasapetad.cs

daring maple
daring maple
#

Whoops, meant to tag Conclures message

onyx shale
shadow gazelle
#

Oh

#

Wait, what?

onyx shale
#

idk why

shadow gazelle
#

Loads for me

daring maple
#

For me too

chrome beacon
quiet ice
#

Strict browser settings

shadow gazelle
#

Any ideas on how to get the item and edit it?

lean gull
quiet ice
#

Highly browser dependent if it works or not

onyx shale
#

post the code m8

#

..

chrome beacon
#

Malwarebytes does flag paste md5 as a trojan

#

;/

shadow gazelle
onyx shale
#

i do have malwarebyte active..

#

well im the one willing to help

#

so idk

chrome beacon
shadow gazelle
#
    @EventHandler()
    public void onItemDrop(PlayerDropItemEvent event) {
        Player player = event.getPlayer();

        if (event.getItemDrop().getItemStack().getType() == Material.DIAMOND_PICKAXE || event.getItemDrop().getItemStack().getType() == Material.NETHERITE_PICKAXE || event.getItemDrop().getItemStack().getItemMeta().getDisplayName() == ChatColor.LIGHT_PURPLE + "Telepathy Core") {
            for (Entity entity : player.getNearbyEntities(5, 5, 5)) {
                if (entity instanceof Item && event.getItemDrop().getItemStack().getItemMeta().getDisplayName() == ChatColor.LIGHT_PURPLE + "Telepathy Core") {
                    entity.remove();
                    
                }
            }
        }
    }
onyx shale
#

hmm beside ur problem i see some bad things

#

you should use the dropped item the pickaxe as the main entity the loop will be done

#

not the player

chrome beacon
#

Use an EnumSet

onyx shale
#

also u are working with entities

chrome beacon
#

Will look much cleaner

lean gull
#

this is the new code for the Main class:

    public boolean ifConfigValueIsSet(String ConfigValue) {
        if (this.getConfig().getString(ConfigValue) != null) {}
        return true;
    }```
onyx shale
#

so you should be able to simply do Item chestplate = (Item) entity;

shadow gazelle
lean gull
#

no red lines, but the second class still has red lines

chrome beacon
dusk flicker
undone axleBOT
onyx shale
daring maple
chrome beacon
#

Ye

lean gull
#

oh yeah 1 sec

stone sinew
#

I hate that you can post more then one attachment

onyx shale
#

so nms block checking fkin ya?

lean gull
#

fixed it,

    public boolean ifConfigValueIsSet(String ConfigValue) {
        if (this.getConfig().getString(ConfigValue) != null) {
            return true;
        }
    }```
onyx shale
#

afaik there are like 5-6 ways each with different speeds

stone sinew
onyx shale
#

hmm strange

daring maple
#

it wont compile

shadow gazelle
lean gull
#

for some reason the last curly braces are with red line below them

daring maple
#

yes because you dont always return something

onyx shale
#

i wouldnt rely on the drop event

lean gull
#

fixed it

    public boolean ifConfigValueIsSet(String ConfigValue) {
        if (this.getConfig().getString(ConfigValue) != null) {
            return true;
        } else {
            return false;
        }
    }```
ivory sleet
#

btw floofsy this.getConfig().isSet(String path) exists

onyx shale
#

i would instead check every X ticks,each entity in the world,check if theyr items,check the type,check the nearby(a max range of 1),remove both,get location drop ur item

#

so this way if a item is alrdy on ground from a while

#

and you come and drop the rest

#

it will work

shadow gazelle
#

eh

lean gull
onyx shale
#

rather than locking yourself to

#

the drop event

lean gull
#

i mean red line below it

shadow gazelle
#

hm

onyx shale
#

hopefully makes sense

lean gull
#

oh nvm fixed it

#

why does ifConfigValueIsSet have a red line below it? if (Main.ifConfigValueIsSet(uuid)) {

chrome beacon
#

..

onyx shale
#

does it

daring maple
ivory sleet
#

Floofsy what about yeeting every static in your plugin

onyx shale
#

?basics

undone axleBOT
onyx shale
#

?spoon

undone axleBOT
#

Spoonfeed a newbie for a day and they'll come back with more questions. Teach them to find their own answers and you'll both be better off: you won't get stuck answering the easy questions and they'll be much more productive than before.

lean gull
daring maple
onyx shale
#

m8..

#

why do you keep spooning him ffs

lean gull
#

was just about to say "i don't even know what static is ¯_(ツ)_/¯"

chrome beacon
#

Now take the advice and learn Java basics please

#

We're not here to write you a plugin

onyx shale
#

the harsh truth

lean gull
#

also i can't help but notice that people that are blocked for me are talking (about this, i assume) and you guys do realize you're blocked which means i cannot see your messages, right?

burnt current
#

Hi, I have a quick question: What is the best way to store a PlayerInteractEntityEvent that is passed in a method in a variable that can be accessed throughout the class? I know I can do this somehow with public but I don't know how exactly to do it because everything I've tried has given me an error message. I also know that this is part of the basics in Java but although I have learned it, I unfortunately have no idea how to do it right now.
Thanks in advance

onyx shale
#

i mean soon

#

you will be kicked

#

if you continue

novel lodge
#

Is there an armor euip event?

quiet ice
#

You do realize that you deny help for other people by your presence

onyx shale
chrome beacon
daring maple
#

doesnt have to be public

quiet ice
#

I sense static abuse otherwise

onyx shale
shadow gazelle
#

If I use Bukkit.getOnlinePlayers, would I have to getPlayer before I can check a player for something?

onyx shale
#

getonlineplayers will return a collection wich you can loop

shadow gazelle
#

So I don't need getPlayer?

onyx shale
#

for(Player player : Bukkit.getOnlinePlayers())

shadow gazelle
#

I mean for something like this

                Player player = (Player) Bukkit.getOnlinePlayers();
                for (Entity entity : player.getPlayer().getNearbyEntities(3, 3, 3)){

                }
onyx shale
#

nope

#

not gonna work

#

you need to do a loop over the collection

shadow gazelle
#

So I don't need getPlayer?

quiet ice
#

no

quiet ice
#

getPlayer basically returns the player instance

lean gull
quiet ice
#

the implementation is probably

public Player getPlayer() {
  return this;
}
shadow gazelle
#

...

shadow gazelle
vital ridge
#

Getting the block player is looking at needs raytracing right?

quiet ice
#

You are casting a Collection<Player> into a Player

daring maple
quiet ice
#

Which will CCE

ebon siren
#

you have to state the skull's owner, aka which user's head will be rendered on the skull

vital ridge
#

I mean i need to use raytracing for smthing

burnt current
# onyx shale what is the outcome ur looking for?

I wanted to create a villager where, when you click on it, an inventory opens in which you can change various settings by clicking on items. One of them should be that this villager is killed.
On another Discord server I got the suggestion (because the PlayerInterActEntityEvent is in a different method than the one I need) to store the PlayerInteractEntyEvent in a variable and then call it at the respective place.

vital ridge
#

so i basically need to add bunch of numbers to the players direction x y z

#

and then getting the block at that x y z?

quaint mantle
#

You can copy client code tho and implement it

#

Into your plugin

vital ridge
#

Id just like to learn raytracing myself lol

quaint mantle
#

That will teach you

#

You can optimize it how you wish

quaint mantle
#

Don’t be passing your event around

#

Store data based off the event @burnt current

#

Then you can access it in other places

vital ridge
#

Thats why i thought bout raytracing

#

i need to check if player is clicking water

#

I watched few tutorials and I think I got some kind of understandment of how raycasting works

#

so i just wanted to ask here

quaint mantle
#

Yea just do the raytracing it’s ez

#

I recommend

vital ridge
#

So raytracing is just adding a specific number to players direction x y z and then getting block at that x y z?

burnt current
quaint mantle
#

No you can store in memory

#

And @vital ridge look at the client it’s your best source of knowledge

vital ridge
#

You mean minecraft src?

quaint mantle
#

Either the client or the server

chrome beacon
#

Not sure why he's recommending that

quaint mantle
#

??? Why wouldn’t you go look at where all the knowledge sparks

vital ridge
#

How should i find raytracing snippets tho

burnt current
vital ridge
#

if i click on water it returns nothing

chrome beacon
#

Use the FluidCollusion setting

vital ridge
#

Okay but im just wondering

vital ridge
#

cuz i watched bunch of videos

lean gull
#

i still need help

chrome beacon
burnt current
chrome beacon
burnt current
#

yes but how exactly?

daring maple
shy mortar
#

Is there a way to apply a BaseComponent to the name of an itemstack?

#

I can't see a method for it

dusk flicker
#

Why do you need to?

#

Just use a string

shy mortar
#

because I'm converting from Adventure a minimessage parsed component into basecomponents, which can't be changed into strings

chrome beacon
shy mortar
#

paper 1.17 isn't out

#

hence why I asked

chrome beacon
shy mortar
#

bruh

chrome beacon
#

Spigot API is a bit lacking with text components

burnt current
lean gull
#

can somebody please help

chrome beacon
#

?learnjava

undone axleBOT
shadow gazelle
#

Uh

#

what

dusk flicker
#

This is an english only server

chrome beacon
#

Hence the link to a Java tutorial

#

Now this is an english only server

burnt current
#

sorry but I've already learned the Java basics but for whatever reason I just can't figure out how exactly to store this variable from the method so that I can use it in other methods. I don't want you to write my plugin, I'm just looking for help for this one line of code.

paper viper
#

learned the Java basics

#

can't figure out how exactly to store this variable from the method

#

these two don't go well together

#

sorry

#

¯_(ツ)_/¯

granite stirrup
#

LMAO it says Outdated server! Im still on {0}

#

when viaversion isnt loaded yet

burnt current
#

I don't want to argue with you now either. Thank you for your help

dusty herald
gaunt hatch
#

oOOOo switch expression are nice

#

Good stuff going form 8 to 16

dusty herald
#

switch expressions are awesome

daring maple
#

switch expressions were also in 8

granite stirrup
gaunt hatch
#

i never saw then in 8 or never recommended them

dusty herald
#

that's not what they meant beast

#

or not

#

you can directly put it into a variable iirc

gaunt hatch
#

Either way they are pretty 🙂

daring maple
gaunt hatch
#

time to re-code some stuff lol

dusty herald
#

I've just started to use ResourceBundles

#

😳 I like them

gaunt hatch
#

omg my OCD!!!

#

its on the left ugh!!!

unreal quartz
#

tilt your monitor vertically then

#

now it's on the top

gaunt hatch
#

hahahaha

#

or change the location in the GUI

unreal quartz
#

i prefer my method

proud basin
#

nice one

somber patio
#

Yes hide the evidence, nobody needs to know 😛

proud basin
#

?snipe

gloomy edge
#

I'm tireddd

#

lol

#

Ok, so my code looks like this but it makes this

#

But

#

I don't want that I want

gaunt hatch
#

Bro pre-increment, please.

paper viper
#

that is why its every 2 blocks

#

like the second block, 4th block etc

#

Instead, check that it isnt the first or last row, and not the first or last column

#

like for example

#

actually i cant give an example atm i dont got my ide open 😦

gloomy edge
#

I'm trying to comprehend this

paper viper
#

Well lets write the logic

#

here you know what maybe writing it would make more sense

#
for (int i = 0; i < 3; i++) { // column
  for (int j = 0; j < 3; j++) { // width
    if ((i == 0 || i == 2) && (j == 0 || j == 2)) {
      setdiamondblock stuff;
    } else {
      setironblock stuff;
    }
  }
}
#

as an example

gaunt hatch
#

pre-increment, its faster on the loop

paper viper
gaunt hatch
#

for (int i = 0; i < 3; ++i) { // column

paper viper
#

The performance is negligible

somber patio
#

How is that any faster?

gaunt hatch
#

the way its grabs the value and returns it

somber patio
#

I can almost guarantee that the JVM optimises it to be the same

gaunt hatch
#

it does double the work on post then pre on the value increase

paper viper
#

the JIT does it for you

#

there is no point of doing it tbh

gaunt hatch
#

it doesnt lol

paper viper
#

even so, it is a negligible difference

paper viper
gaunt hatch
#

Google it

paper viper
#

for the JIT not optimizing it

somber patio
gaunt hatch
#
++i increments i and evaluates to the new value of i.

i++ evaluates to the old value of i, and increments i.
paper viper
#

Ah i see, I will be wasting 1 nano second

#

Mhm

#

this isnt even a micro optimization lol

gaunt hatch
#

it all adds up

dusty herald
#

one nanosecond?? ARE YOU CRAZY??

somber patio
#

but the value isn't ever used, so it just won't bother doing it

paper viper
#

ikr

#

one NANOSECOND

#

omg

regal dew
#

if i++'s return value is not directly used then it can be optimized, which is like 99.99% of the time

eternal night
#

but how does that prove the JIT doesn't optimise it o.O

dusty herald
#

it's so un optimized omg

eternal night
#

yea, I'd expect the JIT to just optimise it away

dusty herald
#

are u even a developer! No!

regal dew
#

the difference is with i++ the old value has to be copied, before it can be returned

#

but you really shouldnt care about this lol

paper viper
#

and also people who use ++i are actually cursed

#

for loops

granite stirrup
#

who cares??

quaint mantle
#

^

dusty herald
#

++i; looks so fucking wrong

granite stirrup
#

if u want to use ++i so then use it if u want to use i++ doesnt matter it isnt gonna be a big difference

somber patio
#

Also, you could argue that i++ gives better developer performance since it's more ubiquitous which is generally something that companies care a lot about

paper viper
#

And also you are using ++i in the wrong place anyways lmao

#

it makes other people think you arent using it correctly and/or dont know what it does

granite stirrup
#

i personally think i++ looks more nicer

paper viper
#

cause nobody writes code like ++i

#

in a loop

dusty herald
#

if it was that evil I bet my sonarlint would scream at me

granite stirrup
#

yeah whoever uses ++i is probs gonna be mojang

dusty herald
#

it screams at me for everything

paper viper
#

lmao

#

like pretty often too

granite stirrup
#

lol

paper viper
#

i aint kidding if you look at their NMS

somber patio
#

Didn't someone need actual help before this tangent?

paper viper
#

you find a ton of public fields

granite stirrup
#

im not saying ur kidding

dusty herald
#

🤷

granite stirrup
#

im just saying that its pretty funny

granite stirrup
dusty herald
#

was it you Ivan?

regal dew
#

nothing wrong with public fields

granite stirrup
#

i just came here

regal dew
#

non-final public fields are a bit cursed though ;-)

granite stirrup
dusty herald
#

private final void

paper viper
#

for the context of class properties

#

you shouldnt use public lol

granite stirrup
#

i like to use getter and setters

#

other than public

paper viper
#

only for singletons or utility methods

#

or class definition

#

use public

#

tbh

dusty herald
#

I usually have private shit for my secret classes

#

😉 😉

gaunt hatch
#

nothing is secret

eternal night
#

just as a heads up, the i++ and ++i generate the same bytecode

dusty herald
#

yes it is

eternal night
#

lmao

dusty herald
#

yeah but one nanosecond

#

apparently

eternal night
#

inside the forloop end

somber patio
granite stirrup
#
package;
public class Jochyoua {
  private final String isSlow = "yes";
}```
dusty herald
#

my cars into some kinky shit

granite stirrup
#

what if u have a private class

#
package;
private class Jochyoua {
  private final String isSlow = "yes";
}```
dusty herald
#

if you reflect into my classes I will be angry

gaunt hatch
#

reflection is a killer lol

granite stirrup
#

i cant since 16 made reflection harder

dusty herald
#

bullshit?

#

is that bullshit

#

please tell me it is

granite stirrup
#

yeah u need a flag to use reflection?

paper viper
#

Nah hes not kidding

#

you cant modify final fields anymore

dusty herald
#

fuck java

#

😦

granite stirrup
#

lol

eternal night
#

well, only final fields

paper viper
#

thats why retrooper is pissed lmao

eternal night
#

also only static final fields

paper viper
#

cause his packet events i think

#

uses reflection

eternal night
#

which you couldn't even edit prior because they can/might have been inlined

dusty herald
#

have I reached heaven

granite stirrup
#

theres one fix to it isnt there but ur not allowed to use it really

#

also it might get removed

paper viper
granite stirrup
#

cuz isnt there that flag

paper viper
#

lmao

dusty herald
#

someone just called me "hello ma'am good day" -fucking ends the call-

granite stirrup
#

joch whAt country?

paper viper
#

just take the whole damn thing

dusty herald
paper viper
#

just take the whole thing

#

lol

dusty herald
#

oh

#

local store

granite stirrup
#

lol take all of them

dusty herald
#

I want to but I don't have any spare cash atm

granite stirrup
#

XD

#

u should come back there later

#

and take the whole lot then

dusty herald
#

they're like 4$

granite stirrup
#

f

dusty herald
#

I'm gonna apply at subway

#

get that crisp 7$ an hour

granite stirrup
#

does mc donalds do worse?

#

or better

dusty herald
#

better

paper viper
#

that whole thing costs 69 dollars

#

all the chick file sauce

#

no cap

dusty herald
#

Thats not too bad

#

I could sell it on the streets for 4.50

paper viper
#

each one 4 bucks, then 4 * 2 = 8. Then 8 * 4 rows = 32. Then 32 * 3 shelves

#

= 69

#

lmao

granite stirrup
#

thought it was $104

#

cuz i counted each of one in that picture

#

and thats 26 i saw

#

my mom has sunburns

#

on her skin

#

:(

#

poor her

#

they really bad to

daring maple
paper viper
#

Oh shoot

#

Uhhhhhhh

#

Yeah nobody say nothing

granite stirrup
#

96

paper viper
#

I meant 96 obviously

#

lmao

daring maple
#

so close lmao

paper viper
#

lol

granite stirrup
#

he flipped the numbers

#

oh wait

#

he must of looked the wrong way

#

while using the calculator

#

and he thought he saw 69

#

@paper viper is that correct?

last sleet
#

How are item lore stored? String, array...?

granite stirrup
last sleet
#

Thanks.

granite stirrup
#

i think

paper viper
granite stirrup
#

lol

young knoll
#

So with modern java you can no longer change private static final fields with just reflection, correct?

ivory sleet
#

I mean true constants could never be changed in the first place since they're inlined at compile time

young knoll
#

It's a map

#

I was hoping I could hook into Mojang's structure system with just a plugin, but alas it appears I cannot

rich topaz
#

Hey can anyone tell me if the Hexcolor codes work in 1.17 it doesn't work for me but there is also no error showing

young knoll
#

Are you using the spigot format

#

Or the common format other plugins use

quaint mantle
#

?paste

undone axleBOT
rich topaz
#

nevermind im dumb

#

xd

quaint mantle
#

Idk, Item Durabiloty dosen?T work :c

Knowes somone an alternative for a repair command?

quaint mantle
quaint mantle
#

1.16.5

young knoll
#

Cast your meta to that

quaint mantle
cinder timber
#

is there anyway to detect a players version?

proud basin
#

how come if the player doesn't have permission they can still break blocks ```java
public void onBreak(BlockBreakEvent e) {
Player player = e.getPlayer();
if (!player.hasPermission("volzo.build")) {
e.setCancelled(true);
} else {
return;
}
}

quaint mantle
#

Could somone please help me?

rich topaz
#

something like this

#

ah no setDamage()

#

got the wrong import

eternal oxide
proud basin
#

It's registered

#

getServer().getPluginManager().registerEvents(new BreakBlock(this), this);

eternal oxide
#

then its no annotated with EventHandler

proud basin
#

what he said

eternal oxide
#

the only other thing then can be is you are oped

proud basin
#

testing with an alt

#

and they don't have op

#

also my annotated you mean @EventHandler correct

eternal oxide
#

then the final two things. They have the permission or your plugin is not on the server

eternal oxide
paper viper
#

send code

#

like your full code

sage swift
#

right here, right now

paper viper
#

mhm

#

real time

#

right now

#

a tiempo

sage swift
#

dont put it in ?paste

paper viper
#

ahora mismo

#

lol

stone light
#

I keep getting this error when running my plugin
[Server thread/ERROR]: Could not load 'plugins\TerrorGamesTest9.jar' in folder 'plugins'
org.bukkit.plugin.InvalidPluginException: java.lang.UnsupportedClassVersionError: ``me/TerrorGames/SurvivalGames/Main has been compiled by a more recent version of the Java Runtime (class file version 8243.8224), this version of the Java Runtime only recognizes class file versions up to 59.0
This error only shows up for my Main.class and all my other classes are working fine, also I compiled it in java 1.8 I don't know if there is anything else I need to add but thats pretty much it

young knoll
granite stirrup
#

theres no such thing as 8243.8224

stone light
#

no everyone thinks it is and thats why I'so confused

#

yeah ik

granite stirrup
#

unless ur in like 8080

sage swift
#

java 8000 when

young knoll
#

I assume you have tried recompiling it

stone light
#

I've looked through the entire thing and those numbers never show up anywhere

last citrus
stone light
paper viper
#

and idk how, but you must have some corrupt jdk

#

or something

#

lmao

stone light
granite stirrup
young knoll
#

Following the current version system, class file version 8243 would be java 8190

paper viper
#

lol

last citrus
random wedge
#

assuming 6 month release periods how many years into the future would that be lol

granite stirrup
gloomy edge
somber patio
paper viper
#

Yeah mb

#

i meant || there

#

lmao

last citrus
granite stirrup
#

ima go

last citrus
#

ok

stone light
gloomy edge
#

Thanks! @paper viper && @somber patio

somber patio
#

@stone light are you 100% sure that you're compiling with java 1.8?

paper viper
#

np

stone light
young knoll
#

Fix the build path error

stone light
somber patio
#

Also I'm not sure if that proves that you're using java 1.8 to build. To be honest I have pretty much no experience with programming Java in the context of MC mods, but that looks like a project Java version which I think maven probably doesn't use.

young knoll
#

You have a red X on the project itself

#

Which usually indicates a build path error

stone light
#

oh okay any clue how I can fix that? This is my first time ever trying to make a plugin

young knoll
#

Check the problems window in eclipse

stone light
#

okay I'll look at it

hardy valley
#
if (SkyPremium.getPlugin().getConfig().getConfigurationSection("Users." + e.getPlayer().getName()).contains(String.valueOf(e.getPlayer().getUniqueId())))) {
            ConsoleCommandSender console = Bukkit.getServer().getConsoleSender();
            String command = "/authme forcelogin " + e.getPlayer();
            Bukkit.dispatchCommand(console, command);
        }

I would like to make like a /premium system but I am not sure if this condition works. Is it correct?

granite stirrup
#

that seemss dangerous

#

like someone could take someones name

#

and if they have premium

#

they could just auto login

regal parcel
#

So what is the proper way to make a Goat ram something? Are we just calling the setTarget() on it or the attack() or is there some kind of "ramming" API that is planning to be added?

proud basin
#

how could I use PlayerMoveEvent with a command?

granite stirrup
#

idk

#

what are u trying to do??

proud basin
#

So if someone had typed /blblab and they moved wihtin 50 seconds the command is cancels

young knoll
#

Add their uuid to a set and then check that set in the move event

proud basin
#

ok thanks

stone light
#

okay I think I figured out the whole time traveling into the future thing so now this is the only error I get and I don't know what I need to do
Syntax error on token "module", interface expected
This is the code causing it:
module TerrorGames {
}

upper vale
#

how can i knockback all players in a radius away from a location

#

with the velocity decreasing as they are further awar from the loc

somber patio
vital swift
#
        ItemStack item = new ItemStack(Material.LEATHER_CHESTPLATE);
        ItemMeta meta = item.getItemMeta();
        ArrayList<String> lore = new ArrayList<String>();
        lore.add(ChatColor.GRAY + "Health:§c +" + "35");
        meta.setLore(lore);
        meta.setDisplayName(ChatColor.DARK_PURPLE + "Chestplate");
        item.setItemMeta(meta);
        ShapedRecipe recipe = new ShapedRecipe(item);
        recipe.shape("F F", "FFF", "FFF");
        recipe.setIngredient('F', Material.ROTTEN_FLESH);
        Bukkit.addRecipe(recipe);
    }```
Is it possible to use custom ROTTEN_FLESH? like custom ItemMeta **named**, how?
young knoll
#

RecipeChoice.ExactChoice

stone light
#

I don't know how or why but somehow my code was compiled by major class version 8243 still

somber patio
#

How do I go about submitting a change to a NMS patch? I want to change nms-patches/net/minecraft/server/players/SleepStatus.patch, but the documentation I've found doesn't explain how to do that. Maybe I'm just being thick though.

granite stirrup
#

theres probs like a patch file editor or something

#

idk

eternal oxide
last citrus
eternal oxide
#

INFO java.lang.NoClassDefFoundError: net/dv8tion/jda/api/hooks/ListenerAdapter

paper viper
#

you need to shade it in

eternal oxide
#

you are missing a dependency

vital swift
#

i think you need maven or gradle

last citrus
#

How do I shade

vital swift
#

Do you use eclipse?

eternal oxide
#

You may not have to shade. All depends on what the lib is

last citrus
#

I use Intelij

vital swift
#

Love the video or need more help...or maybe both?
💬Join us on Discord: http://discord.gg/invite/fw5cKM3
Thank you for tuning in to this episode of TheSourceCode! ❤️

If you enjoyed this video make sure to show your support by liking , commenting your thoughts, and sharing for all your friends to see and learn!

All code is available on Github:
...

▶ Play video
#

and then watching the next episode

#

It shows how to use JDA and etc

#

Love the video or need more help...or maybe both?
💬Join us on Discord: http://discord.gg/invite/fw5cKM3
Thank you for tuning in to this episode of TheSourceCode! ❤️

If you enjoyed this video make sure to show your support by liking , commenting your thoughts, and sharing for all your friends to see and learn!

All code is available on Github:
...

▶ Play video
last citrus
#

Intelij is putting warnings on these what should i do?

somber patio
#

(And to actually answer your question, change the 2 to 2.0 (or I think 2f should also work)

last citrus
#

A dev made me the plugin. Here is the source code. I had to compile it. Maybe I did it wrong?

somber patio
#

The developer probably should have shown you how to actually use their code. Is this something you paid for?

last citrus
#

They showed me how to use it. I just think im doing something wrong. They sent me a java lib to import so I imported it. I dont know if I did it right though

#

How to plugin works is when someone in discord does !normal {message here} it will build it in game. It wont connect to the bot though

somber patio
#

Are you actually getting any compilation errors? Warnings should be fine to ignore.

last citrus
#

No

#

Just these errors i think

somber patio
#

So you have a .jar file that you can put in the plugins folder? What happens when you open the server with the plugin in the plugins folder?

#

It should print out "Plugin Starting" at some point

last citrus
somber patio
#

OK again I have very little experience with this but I think you might have to install the JDA plugin.

gaunt hatch
#

well that is a first i have npc's spawning for npc's lol

granite stirrup
#

i think what he needs to do is shade jda into his jar

last citrus
#

Idk how to shade

#

I didnt make the plugin

granite stirrup
#

maven shade plugin ?

last citrus
#

I paid a dev to make it for me

#

They said I needed to compile it and add the discord bot token to the code

#

I did both but I get that console error

granite stirrup
#

well jda isnt a lib in mc

#

so u do need to somehow get it into there

#

like it cant find the jda classes

#

so u probs need to shade them into your plugin jar

somber patio
#

Do other plugins use libraries? How are those added to servers? For forge mods you just copy the library's jar file into the mods folder, are bukkit/server libs the same?

indigo iron
granite stirrup
#

jda isnt a mc plugin

last citrus
#

I have no other plugins on the server I am trying to use it on

granite stirrup
#

its a lib for java

last citrus
somber patio
#

Oh you're right I really am just being thick.

granite stirrup
#

actually idk

#

thats not how u do things

dusty herald
#

your class also needs to extend CommandExecutor and that method needs to be @Override

#

it's very messy but it would work

last citrus
indigo iron
dusty herald
#

King, make multiple classes for each command

granite stirrup
#

^

dusty herald
#

well one class for each command

eternal oxide
granite stirrup
#

thats easier to handle to

#

and u wont get confused which command is which

last citrus
#

I added the JDA lib. Now what

dusty herald
lean gull
#

can someone help?
https://i.imgur.com/vWRHSs5.png
(in Main)

    public boolean ifConfigValueIsSet(String ConfigValue) {
        return this.getConfig().isSet(ConfigValue);
    }```
eternal oxide
#

it is automtically registered to your main class if you don;t redirect it

somber patio
granite stirrup
#

or something

somber patio
last citrus
#

oh

#

how do I add it

lean gull
#

i do not know what an instance is / static abuse

#

i have

#

i have watched a long tutorial and i am following the code academy java tutorial

somber patio
vast sapphire
last citrus
granite stirrup
#

and do mvn package

last citrus
lean gull
granite stirrup
#

click the maven tab

#

and find the package command

last citrus
#

?

indigo iron
#

ty so much guys ❤️

vast sapphire
granite stirrup
#

i learn from forums

last citrus
#

Ok

vast sapphire
#
    @EventHandler
    public void onFireballHit(ProjectileHitEvent event) {
        Fireball fireball = (Fireball) event.getEntity();
        Player player = (Player) fireball.getShooter();
        ItemStack item = player.getInventory().getItemInMainHand();
        ItemMeta meta = item.getItemMeta();
        String name = meta.getDisplayName();
        Location fireballLocation = fireball.getLocation();
        World world = player.getWorld();
        if (name.equals("§6CUSTOM STICK")) {
            if (item != null) {
                world.createExplosion(fireballLocation, 10, true, true);
                world.playEffect(fireballLocation, Effect.MOBSPAWNER_FLAMES, 10);
                world.playEffect(player.getLocation(), Effect.BLAZE_SHOOT, 10);
            }
        }
    }``` should I have ProjectileHitEvent for this?
granite stirrup
#

click on the copyright in mc and hold space and ctrl lol

lean gull
#

it's unlikely, but a player can switch a world between the time they fire the fireball and when the fireball lands

#

which could cause some big problems to your world

vast sapphire
#

what event should I have?

granite stirrup
vast sapphire
#

ah ok

lean gull
#

isn't he already doing that by setting the variable fireball to the proiectile parsed as a fireball?

#

how so

#

yes but he is parsing it as a fireball

vast sapphire
#

true

lean gull
#

um i don't know java and you clearly do but isn't he just setting a variable to the entity and parsing that variable to a fireball?

vast sapphire
#

alright i got the fireball to cause the massive explosion however only when i fire two fireballs

#

if I fire a single fireball it causes a normal explosion

gaunt hatch
#

hmm do the spigot java doc have more then this?

lean gull
#

PXXD another problem, a more likely one, the player can switch held items between the time they fire and when the fireball hits

last citrus
lean gull
#

all g 👍

last citrus
plucky comet
#

Hey I come from python and i use sql in python. Im watching a tutorial and it says i need varchar(int) but in python i can do TEXT just wondering if this is accurate.

last citrus
#

ok

nimble lichen
#

java: cannot access su.nexmedia.engine.hooks.HookState
bad class file: /C:/Users/Mark/Documents/SkyWars 2020/2021/NETWORK/servers/skyblock/plugins/NexEngine (1).jar!/su/nexmedia/engine/hooks/HookState.class
class file is invalid for class su.nexmedia.engine.hooks.HookState
Please remove or make sure it appears in the correct subdirectory of the classpath.

does anyone know how to fix this issue? I am trying to change two lines of code in GoldenCrates, but the developer doesn't use maven so I have to add dependency jars manually. This error occurs when I try to compile the golden crate fork that I made. I tried two different versions of the NexEngine.jar but this errors keeps happening. (using intellij)

lean gull
#

btw i still need help :/

last citrus
#

OK

#

ok

#

It works! Thanks so much

plucky comet
#

Hey I come from python and i use sql in python. Im watching a tutorial and it says i need varchar(int) but in python i can do TEXT just wondering if this is accurate.

lean gull
#

can someone plz help

vast sapphire
#
    @EventHandler
    public void onFireballHit(ProjectileHitEvent event) {
        Fireball fireball = (Fireball) event.getEntity();
        Player player = (Player) fireball.getShooter();
        ItemStack item = player.getInventory().getItemInMainHand();
        ItemMeta meta = item.getItemMeta();
        String name = meta.getDisplayName();
        Location fireballLocation = fireball.getLocation();
        World world = player.getWorld();
        int randomExplosionPower = (int) Math.ceil(Math.random() * 20);
        if (name.equals("§6CUSTOM STICK")) {
            if (event.getEntity() == fireball) {
                if (item != null) {
                    world.createExplosion(fireballLocation, randomExplosionPower, true, true);
                    world.playEffect(fireballLocation, Effect.MOBSPAWNER_FLAMES, 10);
                    world.playEffect(player.getLocation(), Effect.BLAZE_SHOOT, 10);
                    player.sendMessage(String.valueOf(randomExplosionPower));
                }
            }
        }
    }``` Explosion happens per two fireballs which means the explosion activates when the fireball hits another fireball, why is this going on?
#

yep

gaunt hatch
#

So it looks like it is hitting a fireball entity

#

Might need a check to validate the entity hit is not a fireball also

vast sapphire
#

i already have spawn fireball in another function

#

ok

gaunt hatch
#

i hate concurrent errors lol the worst to fix

vast sapphire
gaunt hatch
#

one sec

lean gull
#

someone pretty plz pls help

gaunt hatch
#

There should be a object in that event that will let you get who you hit, then you check that class isntance to see if its a ball or w/e you want to check

vast sapphire
#

ok

somber patio
#

@lean gull I think we're gonna need more than just that code

#

Specifically it would be nice to know what's in Main

spiral roost
#

Anyone know if you can color the SPELL_MOB particle in 1.15.2?

vast sapphire
spiral roost
vast sapphire
#

oh ok

spiral roost
somber patio
spiral roost
vast sapphire
#

just a simple fireball stick with stronger fireballs

plucky comet
#

Hey im wondering does anyone have a good sql class to create tabeels get values insert and update

ivory sleet
#

I mean isn't that quite basic?

dusty herald
gaunt hatch
#

something like this

dusty herald
#

very messy but here

plucky comet
ivory sleet
#

Ah do you know sql itself?

gaunt hatch
#
    @EventHandler
    public void onFireballHit(ProjectileHitEvent event) {
        
        if (event.getHitEntity() != null && event.getHitEntity() instanceof Fireball)
        {
            
        }
        
    }
dusty herald
plucky comet
#

no

gaunt hatch
#

You check if the hit is not null and is fire ball check

north ridge
#

If you dont want to deal with sql directly. Give any ORM a try.

ivory sleet
#

A good tip would be to learn SQL first before learning how to use it in Java

gaunt hatch
#

you can adjust the if checks

north ridge
#

Ayy, you got accepted.

north ridge
#

Object Relational Mapping

gaunt hatch
ivory sleet
#

Yeah very pog ty 🙂

#

got me thinking of korm

#

😌

north ridge
#

Is he still working on it?

ivory sleet
#

Uh no he pretty much abandoned everything when leaving the community I believe

north ridge
#

rip

ivory sleet
#

yeah it had such potential

vast sapphire
# gaunt hatch Do you get what its doing?

I can pick it out, you are getting the hit entity and making sure it's not equal to nothing (which is what null is ig) and you are making sure that it is not an instance of fireball

hardy swan
gaunt hatch
#

that is why i said he can change it

hardy swan
#

oh

gaunt hatch
#

sometimes you need to give a little error so they can learn lol

torn shuttle
#

round 2: is there a hard limit on how often a mob can damage different entities (not the same entity) within a tick?

gaunt hatch
#

yes : damage frames

torn shuttle
#

that applies to non-player entities?

gaunt hatch
#

everything that can be damaged

#

LivingEntity:setNoDamageTicks

torn shuttle
#

but hang on

#

that's for the entity getting damaged, surely

vast sapphire
#

can I change projectile speeds?

torn shuttle
#

is noDamageTicks for the damager or for the damaged?

gaunt hatch
#

damage frames are a time limit where the entity can take no damage at all

torn shuttle
#

right so that's specifically what I excluded in my question

gaunt hatch
#

Your not getting it

somber patio
#

Does BuildTools set git user.name globally, or am I going crazy?

gaunt hatch
#

EVERYTHING!! there is no one person limit it everything or nothing

torn shuttle
#

round 3: is there a hard limit on how often a mob can damage different entities (not the same entity) within a tick?

gaunt hatch
#

no, cause its everything

torn shuttle
#

what

#

are you just not reading the question

gaunt hatch
#

once its hit buy one entity the damage frames are enabled and nothing can damage it

torn shuttle
#

I'm asking for the damager

#

not the damaged

gaunt hatch
#

....

torn shuttle
#

as in

#

a zombie that hurts 5 different players in the same tick

#

is there a limiter on that

gaunt hatch
#

oh that is not how that is worded lol

torn shuttle
#

yes it is

north ridge
#

I dont think theres a limit on that Magma

vast sapphire
gaunt hatch
#

is there a hard limit on how often a 'single' mob can damage different entities at the same time. (not the same entity) within a tick?

#

that would make sence to what your asking

#

I do not think there is a limit

north ridge
gaunt hatch
#

Yea that does not read the same for me, sorry lol

hardy swan
north ridge
#

lol

torn shuttle
#

well not how often, you can do it as often as you want, I am asking specifically within a tick

gaunt hatch
#

i dont think so

hardy swan
#

i mean, there is sweeping edge

#

so....

gaunt hatch
#

yea i coded that out day 1 lol

torn shuttle
#

I have some code that iterates through players in a range and damages them but for some reason it keeps only picking up the first player

glossy scroll
#

where can i find the changes to java reflection from 1.8 to 1.16?

#

what version did those changes take place?

vast sapphire
north ridge
torn shuttle
#
    private void doDamage(EliteMobEntity eliteMobEntity, double range1, double range2, double range3) {
        for (Entity entity : eliteMobEntity.getLivingEntity().getNearbyEntities(range1, range2, range3))
            if (entity instanceof LivingEntity)
                BossCustomAttackDamage.dealCustomDamage(eliteMobEntity.getLivingEntity(), (LivingEntity) entity, 1);
    }

sure

vast sapphire
#

I'm going to spend some more time learning java

#

are videos a good learning source?

torn shuttle
#

no

vast sapphire
#

I use pluralsight

hardy swan
#

oracle has a pretty awesome tutorial site

north ridge
#

Pluralsight is great

hardy swan
torn shuttle
#

?learnjava

undone axleBOT
vast sapphire
#

I do have a java book

torn shuttle
#

link #4 was submitted by me

hardy swan
#

trust me, go for the last one

#

it would take much longer, but with less misconceptions

torn shuttle
#

this is really annoying to diagnose, I can't even tell if it's working or not

plucky comet
#

If only there was a program that converted python code to java

ivory sleet
#

hmm pretty sure a py -> java transpiler exists somewhere

#

but its probably not very good

torn shuttle
#

they do

#

they aren't

#

fuck this

#

as far as I can tell this works 10/10

#

idk why some people report it not working

#

there's hardly any code to it too

gaunt hatch
#

it looks fine

#

unless something is calling it werid.

torn shuttle
#

it isn't

gaunt hatch
#

yea the loop looks fine

torn shuttle
#

I can test it with zombies and this doesn't run any different, aside from a check to see if they're in creative or spectator mode

gaunt hatch
#

8 point grid

vagrant stratus
torn shuttle
#

north_east is 8 point north_north_east is 16 right

ivory sleet
#

@quaint mantle

gaunt hatch
#

yea 16 my bad

quaint mantle
#

Ahh that helps visualize

torn shuttle
#

did you not have geography classes

gaunt hatch
#

oof

ivory sleet
#

I didnt learn this in my geography class lol

quaint mantle
#

Last time I had geography was probably 5-10 years ago

torn shuttle
#

you'd think they'd teach compasses in geography classes

fickle helm
#

what is the correct way to run a task on the main thread that is currently inside an async thread?

torn shuttle
#

last time I had geography was 12 years ago but I still remember the stuff that was vaguely useful

gaunt hatch
#

call back to the main thread

ivory sleet
#

Bukkit.getScheduler().runTask(plugin, () -> {

});

fickle helm
#

I tried this:

        Bukkit.getScheduler().runTask(main, runnable);```
ivory sleet
#

nono

gaunt hatch
#

omg no

ivory sleet
#

BukkitRunnable is capable of scheduling itself

#

no need to use the scheduler to schedule it

gaunt hatch
#

look into SynchronousOperation from a async thread

#

you can call a await with a SynchronousOperation and have it call back and wait for a response or not and have it just go.

ivory sleet
#

is there even something called SynchronousOperation?

gaunt hatch
#

i might have called it that one sec let me check lol

#

oh yea oops lol

#

its the idea of it

#

Yes the idea is call SynchronousOperation

#

you can google that to see

fickle helm
#

the main issue is I have an async repeating tasks that calls this:
for (final Player player : Bukkit.getOnlinePlayers()) {
which works great in 1.16 but on 1.17 I get:

java.lang.IllegalStateException: Asynchronous Chunk getEntities call!
        at org.spigotmc.AsyncCatcher.catchOp(AsyncCatcher.java:14) ~[spigot-1.17.jar:3124-Spigot-66f9d3c-384e116]
        at net.minecraft.server.level.WorldServer.getEntities(WorldServer.java:1795) ~[spigot-1.17.jar:3124-Spigot-66f9d3c-384e116]```
ivory sleet
#

yup

#

u cant do that async

hardy swan
fickle helm
#

nope, just need a reoccuring task

hardy swan
#

oh then just lag the server out

#

lmao

fickle helm
#

ideally it'd be async but looks like I can't enumerate all players that way

hardy swan
#

for cant enum async

#

I believe you are looking for parallel streams

fickle helm
#

it is deprecated apparently. I get an error also

hardy swan
#

Try runnable.runTask()

fickle helm
#

that was the first thing I did and I still get the Asynchronous Chunk getEntities call! error

oblique mural
#

I am trying to get the block that was hit by a snowball, and looking at the javadoc, ProjectileHitEvent should have a #getHitBlock() method, however in my IDE this does not appear to be the case. What am I doing wrong?

fickle helm
fickle helm
#

yup

#

I'm using 1.17 and have it. Not sure what version they added that function in.

oblique mural
#

Oh, whoops. I'm adding this to an old project that has 1.14 imported

#

I'll update it real quick I'm sure thats the problem

granite stirrup
#

all i know that its defiantly in 1.16.3 api

#

it might of been added in 1.15?

#

i also know it didnt exist in 1.13.2

#

also now we know its not in 1.14

ripe marlin
#

any1 know how to export to intellij with recaf

granite stirrup
oblique mural
#

Yup, updated to the latest buildtools build and all is well. Thanks guys

ripe marlin
#

im tryna put some1s jar file into intellij

granite stirrup
#

yeah idk

#

this is for spigot stuff

ripe marlin
#

the jar im tryna put there is a spigot plugin

vagrant stratus
#

You'll have to make a project & move the decompiled source to it, assuming intellij doesn't have some built-in method

granite stirrup
ripe marlin
#

it has like no export function for whatever reason

#

the export just gives me another jar

granite stirrup
#

use that

#

it has export

ripe marlin
#

ok

granite stirrup
#

it export as a jar tho

#

so u have to extract the decompiled code

#

out of the jar

#

by using something like winzip

ripe marlin
granite stirrup
#

.jar files a legit .zip files

#

lol

#

theres a plugin for it for intellij to

#

dont think its official

#

i mean doesnt intellij already decompile jars?

ivory sleet
#

might be adding another decompiler u can choose

#

iirc intellij uses fernflower be default

granite stirrup