#help-development

1 messages · Page 1648 of 1

tall dragon
#

or no

fervent gate
#

ok wait

#

doesn't upload

#

lemme try different

tall dragon
#

yeya

#

thats 1.17

fervent gate
#

damn

tall dragon
#
<dependency>
            <groupId>io.papermc.paper</groupId>
            <artifactId>paper-api</artifactId>
            <version>1.17.1-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>

#

see that

fervent gate
#

I can't go lower than 1.12

#

idk

tall dragon
#

looks accurate

fervent gate
#

Should I use paper?

#

I'm using that on my server

tall dragon
#

you dont have to

#

it gives you a little bit more functionallity

#

but you rarely use the things it adds

#

paper is very good for server performance though

#

but when you use spigot it will work fine on paper servers

fervent gate
#

But I can develop in with another api?

#

okok

tall dragon
#

personally use this

<dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot-api</artifactId>
            <version>1.8.8-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
#
<repository>
        <id>spigot-repo</id>
        <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
    </repository>

and this repo

fervent gate
#

I can't go lower than 1.12 too with spigot

tall dragon
#

make sure you added the repo

fervent gate
#

in the lib?

tall dragon
#

in your pom

fervent gate
#

So I start in 1.12 and then change the repo?

#

I'm really inexperienced sorry

tall dragon
#

?paste

undone axleBOT
tall dragon
#

should look like this

fervent gate
#

@tall dragon getting error with new pom

tall dragon
#

what is it

fervent gate
#

I just started in with 1.17 and changed the pom, would that work?

tall dragon
#

are you getting errors in your code?

#

that would be normal as the api of 1.17 has some substancial changes from 1.8

fervent gate
tall dragon
#

oh

#

did you reload maven

fervent gate
#

would you say it would be better to develop in 1.17?

tall dragon
#

of course

#

but if your server runs 1.8 that plugin wont work

waxen plinth
#

Don't ever remove the api-version

fervent gate
#

yea ik, but for developing plugins, is it better or easier to do that in 1.17

waxen plinth
#

To support everything, use api-version: 1.13

tall dragon
#

@fervent gate yea

#

of course

fervent gate
#

another one, how do I install java 16

#

the latest I find is 8

fervent gate
#

it says from this website

tall dragon
#

why woulnt you use the website of the creator

fervent gate
#

idk

#

just done that

quaint mantle
#

Adopt is prefered over oracle

tall dragon
#

really

#

i have never used it before

sly trout
#

wth is adopt

#

my guy

quaint mantle
#
        
        @EventHandler
        
        public void onBlaze(EntityDeathEvent event) {
                if (event.getEntity().getType() == EntityType.BLAZE) {
                        }
                }
        }
}

How do i check if the killer is a player in this code?

#

Oracle JRE is paid and has a few other caveats

tall dragon
#

event.getEntity().getKiller() instanceof Player if im not mistaken @quaint mantle

quaint mantle
#

thats it tysm

tall dragon
#

np

fluid cypress
#

is there any place where i can physically see the uid of a world? in some file

quaint mantle
#

AdoptOpenJDK has also a larger usership here (given that almost cannot obtain Oracle JRE)

sly trout
#

erm

#

so I tried storing a HashMap<Integer, String> inside of YAML file

#

and retrieving it

#

but I'm guessing it's not as simple as that is it

eternal night
#

Maps are flattened in yaml

quaint mantle
#

How do you retrieve it?

sly trout
#

that's what I thot

#

F

quaint mantle
#

.getMap exists iirc

sly trout
#

Main.getData().getConfig().get() smth like dat

#

it does ? x/

quaint mantle
#

Yea

eternal night
#

getMap just unflattens it

#

Collects whatever is under the path

sly trout
#

erm

eternal night
#

And throws it into a hashmao

quaint mantle
#

It requires unsafe casts, but it is the way to Go here

sly trout
#

getMapList()?

quaint mantle
#

No, that is a list of maps iirc

sly trout
#

iirc

eternal night
#

I mean tbh you just get the configuration section and then parse it into a map

#

Not much effort

sly trout
#

then I can't find getConfig().getMap

quaint mantle
#

?jd

quaint mantle
#
        public void onBlaze(EntityDeathEvent event) {
                if (event.getEntity().getType() == EntityType.BLAZE && event.getEntity().getKiller() instanceof Player) {
                        
                        Player player = event.getEntity().getKiller().getPlayer();
                        player.sendMessage("HI");
                }
        }
}```
Any1 knpw the issue with this code? When i kill a blaze i dont get the message
tall dragon
#

did you register the event

quaint mantle
#

no

#

im dumb

tall dragon
#

you should :)

quaint mantle
#

& new to java my bad

sly trout
#

lol

unique halo
proud basin
#

loop through the map

unique halo
#

also

#

can't iterate through the set of keys since you can't tell if the name is loc1, or its the property loc1

lusty vault
#

How do I get a custom file in the main directory of a server?

unique halo
#

actually nvm i have an idea

proud basin
unique halo
#

i wanna get all the keys of Map2

main dew
#

how disable door, trapdoor, repeater etc click?

drowsy grotto
main dew
#

wg?

drowsy grotto
#

/region flag region name use deny

main dew
#

i thought something about plugins but maybe you're right

#

thanks

drowsy grotto
#

you are welcome

normal coral
#

how would I implement the dependency to use NMS in my IDE

somber hull
#
public static ItemStack getWateringCan(FarmingOverhaul plugin) {
        ItemStack wateringCan = new ItemStack(Material.CLOCK);
        ItemMeta canMeta = wateringCan.getItemMeta();
        List<String> lore = new ArrayList<>();
        PersistentDataContainer canData = wateringCan.getItemMeta().getPersistentDataContainer();
        
        canData.set(new NamespacedKey(plugin, "isWateringCan"), PersistentDataType.BYTE, (byte) 1);
        canData.set(new NamespacedKey(plugin, "waterLeft"), PersistentDataType.INTEGER, 10);
        
        canMeta.setDisplayName(ChatColor.DARK_BLUE + "Watering Can");
        
        lore.add("");
        lore.add(ChatColor.AQUA + "Hold shift near crops to water them!");
        lore.add("");
        lore.add(ChatColor.AQUA + "Held water: " + ChatColor.GRAY + "10/10");
        
        canMeta.setLore(lore);
        wateringCan.setItemMeta(canMeta);
        
        return wateringCan;
    }
#

Any idea why it has no NBT data?

#

i set its data for 2 tags

ivory sleet
#

because you're not setting it

somber hull
#

😳

ivory sleet
#

getItemMeta is missleading slightly

somber hull
#

No tutorials i found said i needed to set it

#

Im new to PDC

somber hull
#

I did that

ivory sleet
#

the name shoould be something like createNewItemMetaFromMaterial

somber hull
#

Oh

#

really?

ivory sleet
#

yes but you create another item meta instance and get the pdc of that one

wispy bridge
ivory sleet
#

wateringCan.getItemMeta().getPersistentDataContainer();

somber hull
#

i just saw that

#

😔

#

thank you lol

wispy bridge
ivory sleet
#

Idk

hasty prawn
somber hull
#

Well i think its working now

#

¯_(ツ)_/¯

ivory sleet
#

Yeah Dessie

#

iirc back in the days the meta used to be cached

#

then it changed

quaint mantle
#

how would i add a variable to that for everytime the player kills the blaze, it adds a number (int) to a variable

gleaming grove
#

do you know when player are braking stone to sound is triggered on the server or client side?

ivory sleet
#

Both I believe

#

Or no

#

Probably client sided

gleaming grove
#

meth the issue is even when i cancel the break block event the sound is played

ivory sleet
#

Yeah

gleaming grove
#

what if i send to player fake blockData?

#

is it possible to make block look like stone but acctually be for example glass?

ivory sleet
#

Yeah sure is

#

Tho Idk if it would solve the problem

gleaming grove
#

i hope so

cloud berry
#

😢

#

can some1 help me maek a NON-mc project

#

in intellij?

#

iv literly only evr coded plogens LOL

#

liek its missing stuff, i needs YamlConfiguration

#

FileConfituration

ivory sleet
#

Hmm

#

You could use something else Leo

#

Like a config library

#

Cuz that is bundled with spigot right

cloud berry
#

:IIII im usin java cuz im alredy used 2 th-

#

wait wut

#

file/yaml configuration is spiget...?

ivory sleet
#

Yes

cloud berry
#

coulda sworn it was java bruhb

ivory sleet
#

lol

hexed hatch
#

Doesn’t spigot use snakeyaml?

cloud berry
#

:I cn i use em still if i jus bundle th jar?

hexed hatch
#

Have you looked in to that library?

cloud berry
#

or will it break if it not a plogen

ivory sleet
#

Or course you could skid the Bukkit config classes

#

Yeah gizmo it does

#

I guess you could shade spigot or something

hexed hatch
#

Lol that’s such a disgusting solution

cloud berry
#

ehh ya ill try taht .-. it aint a rleese projkect or nothin

ivory sleet
#

Yeah

cloud berry
#

ty gais ❤️

ivory sleet
#

Ye (:

cloud berry
#

well fak

#

thers no maven in dis project LOL

ivory sleet
#

🥴

cloud berry
#

how tf do i add jar 😳 w/o mavin

ivory sleet
#

What do u use

cloud berry
#

i just did file>new>project

#

java tab, clkick next

#

wait i guess i cn try makin a maven 1

ivory sleet
#

Or gradle (:

hasty prawn
ivory sleet
#

Just mad

hasty prawn
#

maybe.

cloud berry
ivory sleet
#

Sure

cloud berry
#

😢

#

ok it works now but 4 som reson

#

autocomplet

#

dosent find it

#

igottat manual type out th hwole packege name

#

org.bukkit.configuration.file.FileConfiguration

quaint mantle
#

how do i add an integer to a variable?

#

so how would i add 5 to a variable called money

cloud berry
#

eyy 🥳

#

me main main

gleaming grove
#

wtf

cloud berry
gleaming grove
cloud berry
#

wait wat 🤣

somber hull
#

is there a way to check if a player right clicked water

#

like a bucket filling up

hasty prawn
#

PlayerBucketFillEvent

somber hull
#

thank you

#

wait

#

ill look at it

#

but does that only work with buckets?

#

Cause the item their holding is a clock

quaint mantle
#

ty

somber hull
#

@hasty prawn

hasty prawn
#

What are you trying to do

somber hull
#

PlayerInteractEvent works up until my final check check

#

if (!(block.getType() == Material.WATER)) return;

somber hull
olive valve
#

i got a little confused on this if (sender instanceof Player){ String rules = getConfig().getStringList("rules"); Player player = (Player) sender; player.sendMessage(rules); why wont it select the entire string list in the config? does anyone know?

cloud berry
#

@ivory sleet i... i cant run dis project 🤣 thers no maven buioild config

ivory sleet
#

Weird

somber hull
cloud berry
#

lameeeee

somber hull
#

and then send that new list as a message

ivory sleet
#

Lifecycle

olive valve
hasty prawn
cloud berry
ivory sleet
#

clean then install

cloud berry
#

o 😮

#

taht did somethin

#

lemme c if thers a jar

ivory sleet
#

Enchanting name btw

cloud berry
#

no main manifest attribute, in ToyTest2-1.0-SNAPSHOT.jar

#

👺

somber hull
cloud berry
somber hull
#

well

#

it wont let me add it t the raytrace thing

hasty prawn
#

What version of spigot are you using

somber hull
#

nvm

#

i think i spelled it wrong

#

sorry

ivory sleet
cloud berry
#

grrrrrr maven y u so stupid

#

jus run th fucken main methed

#

c++ been runnin main since 1980

#

wtf bruh

#

nvm ithink i found it

somber hull
#

...

#

this is giving me an NPE

#

if(rayTraceResult.getHitBlock() == null) return;

cloud berry
#

Exception in thread "main" java.lang.NoClassDefFoundError: org/bukkit/configuration/file/YamlConfiguration at io.github.leocab.ToyTest.<init>(ToyTest.java:8) at io.github.leocab.ToyTest.main(ToyTest.java:12) Caused by: java.lang.ClassNotFoundException: org.bukkit.configuration.file.YamlConfiguration at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522) ... 2 more @ivory sleet 👺

#

f*** dis LOL leme boot up dev-c++

ivory sleet
#

Send ur pom

cloud berry
#

wa-

ivory sleet
#

pom.xml

cloud berry
#

🤣 i lit5erly read porn LOL

ivory sleet
#

My bad iPhone just love to autocorrect every thing it can get its hands on

cloud berry
#

o LOLOLOLOLO

#

is md paste down...? say ssl error 4 me

ivory sleet
#

Remove scope

#

<scope>provided</scope> specifically

cloud berry
#

er- :fl;us

#

😳

#

how tf did i leave taht ther LOL

ivory sleet
cloud berry
#

fack 🤩

somber hull
#
    public static void refillWateringCan(PlayerInteractEvent event, FarmingOverhaul plugin) {
        Player plr = event.getPlayer();
        RayTraceResult rayTraceResult = plr.rayTraceBlocks(3, FluidCollisionMode.ALWAYS);
        NamespacedKey waterKey = new NamespacedKey(plugin, "waterLeft");
        NamespacedKey canKey = new NamespacedKey(plugin, "isWateringCan");
        
        //Check if player is holder watering can
        if (rayTraceResult == null) return;
        Block block = rayTraceResult.getHitBlock();
        if (event.getAction() != Action.RIGHT_CLICK_BLOCK) return;
        if (plr.getInventory().getItemInMainHand() == null) return;
        if (plr.getInventory().getItemInMainHand().getType() == Material.AIR) return;
        if (!plr.getInventory().getItemInMainHand().getItemMeta().getPersistentDataContainer().has(canKey, PersistentDataType.BYTE))
            return;
        if (block == null) return;
        if (!(block.getType() == Material.WATER)) return;
        
        
        //Player is holding watering can, get can data
        ItemStack can = plr.getInventory().getItemInMainHand();
        ItemMeta canMeta = can.getItemMeta();
        PersistentDataContainer canData = canMeta.getPersistentDataContainer();
        
        canData.set(waterKey, PersistentDataType.INTEGER, 10);
        canMeta.setLore(CanCreator.getLore(10));
        can.setItemMeta(canMeta);
        
        plr.sendMessage(ChatColor.AQUA + "Filled up bucket!");
    }
#

this runs twice

#

and its not from lifting up the mouse

#

i tested that

#

it sends that message at the bottom twice

ivory sleet
#

Where do u call that function?

somber hull
cloud berry
#

🤡 still same error... no yamlconfig class

#

ya screw dis 🤣 ill jus go c++ atleast i kno how 2 set up a basic ass project wit taht

olive valve
#

this doesnt work im kinda confused can someone explain this error? ```for(String rules : getConfig().getStringList("rules:")){

                Player p = (Player) sender;
                p.sendMessage(rules);
            }``` it doesnt send the config stringlist
somber hull
#

when he uses a : instead of a .

olive valve
#

ohhh

somber hull
#

you just gotta do .

#

also pretty sure

#

if theres nothing on top you can just do rules

#

with no .

#

just rules

olive valve
#

ok

olive valve
somber hull
somber hull
cloud berry
#

2014 spinoff ide > 2021 mainstrem ide

#

f*** java drops mike

ivory sleet
#

That’s the declaration of it

#

Not where you call it

#

/run it

somber hull
#

i figure out

#

if e.getHand() != EquipmentSlot.HAND return;

#

apparently it runs for your main hand and offhand

dusty kindle
#

Hello i am new to Java and i am trying to code a custom death messages but they are working only for players . How can i code them to work for entities too?

somber hull
#

so

#

uhh

#

EneityDeathEvent

#

not PlayerDeathEvent

#

that should answer all your questions

dusty kindle
#

oh yup

#

thx for help!

somber hull
#

HAHA, I HELPED SOMEONE

#

the teach-ed has become the teach-er

ivory sleet
cloud berry
#

;-; i didnt relize th conveneince of spigets yaml class till i cant use it

#

ima give eclips a try

#

taht snakeyaml shit suxx doe

#

o mi god bruh LOL

#

how is dis so fucken hard

#

some1 know how 2 set th main class in eclipse??

spiral dome
#

eclipse 😳

cloud berry
#

ya well i tryd intellij 1st

#

unusable jar

daring sierra
#

What was ur issue?

spiral dome
#

you didnt compile it right

daring sierra
#

can u link the message

cloud berry
#

well

spiral dome
#

META_INF/MAIFEST.mf

cloud berry
#

i import spiget jar in2 non-spiget project rite

#

it compiles n evrythin

#

but wen it runs it cant find YamlConfiguration class

#

it jus says classnotfoundexceptien or w/e its called

spiral dome
#

you tryna make soiet plugin?

cloud berry
#

but liek, i link it literally th same way i do it wit spiget projects :III in pom.xml

cloud berry
#

System.out.println type shit

spiral dome
cloud berry
#

but

#

YamlConfiguration ._. notfound

#

wat do

spiral dome
#

import spigot api

cloud berry
#

i did .____.

#

mavin pom

spiral dome
#

make a shaded jar

#

mave shade plugin

#

poogle

#

ull find the build tag for that

#

use it

#

then compile

cloud berry
#

o.? wat

spiral dome
#

just a sec

#

lemme poogle that for you

cloud berry
#

ukeep sayin poogl 🤣

arctic summit
#

how would i get started on creating kit data for each player? like if i wanted a plugin which saved player choices for weapons and armor, how would I save that data and access it?

daring sierra
cloud berry
#

wait @spiral dome r u talkin bout importin spigot-shaded.jar as a local depedency?? cuz ik how 2 do taht

spiral dome
#

wait nvm

#

its not same link

cloud berry
#

bruh idk wtf a classpath manefest is 🤣

#

im jus tryna import spiget api wit maven

spiral dome
#

use the plugin i linked to compile

#

then use the shaded jar

#

the page covers execution of the jar too (mby)

cloud berry
#

im past taht part

#

it jus

spiral dome
#

whats the scope for ur spigot depend?

daring sierra
cloud berry
#

dosent find a class ina dependency tahts
a) in pom.xml
b) detected by ide (eg. no errors)

cloud berry
spiral dome
#

<scope>include</scope>

cloud berry
#

<scope>include</scope>

#

liek tah-

#

o 😄 ty

spiral dome
#

you having errors when running the jar right?

cloud berry
#

yaa

daring sierra
cloud berry
#

🙏

daring sierra
#

🙏

cloud berry
#

aefjnhiaNfklsjnafkljngsklasng

#

package org.bukkit.configuration.file does not exist

#

dafuq

#

itsnot in red in th ide :IIII wtf

daring sierra
#

how are you running it, like an executable?

#

or a plugin

cloud berry
#

ya

#

exe

#

is not mc plogen

#

i jus need yamlconfiguratien 🤣

#

ok uhh leme try

#

local depedendcy

daring sierra
#

what ru trynna make anyways :l

cloud berry
daring sierra
#

for wot

spiral dome
#

jackson api better ngl

cloud berry
#

tbh i should b usin soem shit liek pythan or lua but 🤣 iaint used eithr of thohse in years LOL

daring sierra
#

whyd you need the spigot api for number crunching?

cloud berry
cloud berry
#

and

#

ilook up snakeyaml

#

n it sux ass

#

so :I

#

spiget api got literaly th best yaml api

daring sierra
#

it would probably be better than shading spigot imo

cloud berry
#

no 🤣 dat syntax... i h8 it

#

mattr of fact i h8 apache sites

#

in generel

#

but ya liek i jus need iteratien

#

cant evn iterate

daring sierra
#

i mean, it's not the best choice imo

cloud berry
daring sierra
cloud berry
daring sierra
#

uhh idk actually, i haven't used it much

cloud berry
#

dafuq

#

if im makin mi own file i/o class it gonnan b csv

#

not fucken yaml tahts hard LOL

daring sierra
#

might be worth a shot to use json instead of yaml, shit suxx to work wif ngl

#

if you need a json library i recommend gson (google's one)

spiral dome
#

leo try jackson

#

the api is actually better and json is nicer than yaml

cloud berry
#

ineed liek

#

iterate thru elments

daring sierra
cloud berry
#

ill switch 2 json if icn do taht

#

iter8 thru shit

#

eg.

daring sierra
#

i dont see any real benefits in using yaml, json is good

cloud berry
#
  elment1:
     papi: 3
   elment2:
      randemshit: 90
      foo: bar
    elment3: oi```
^ i wana iterate thru elments without me program knowin wat th elments need 2 b called
#

eg.

#

elment1, elment2, elment3

#

cn i do taht in gson wit th json equivelent file?

spiral dome
#

you can

cloud berry
#

gson?

spiral dome
#

jackson

daring sierra
cloud berry
#

@spiral dome cn u find doc? iv alredy found 2 tutoriels but tehy both deal wit class yamls only

spiral dome
#

sec

#

ill do

daring sierra
#

good luck with ur shit leo ima sleep

cloud berry
spiral dome
cloud berry
#

...ya tahts class yaml 🤣

#

no itratien

#

im try find gson iteratien

daring sierra
#

and that's not what leos looking for

#

🤣

cloud berry
#

NOW TAHT SHIT LOOK FAMILIER

#

key/value

#

yap 😄

#

ill lern gson

#

;-; i probs ahv 2 maek me own data conversien dont i

#

-_-

#

som1 let me ping md

hexed hatch
#

why do you type dysfunctionally

cloud berry
#

@worldly ingot cn u ping md 4 me mr choco 😳 is supr good idea ipromise

daring sierra
hexed hatch
#

maybe if you're a brainlet sure

cloud berry
daring sierra
cloud berry
hexed hatch
#

sug me nuts

daring sierra
#

damn ok that was fast

cloud berry
hexed hatch
#

gsonis vey ez

cloud berry
#

🤡

#

i cant i find any toutoriels taht arnt about fucken serializatien

#

for eithr json or yaml

#

o m fucken g

cloud berry
spiral dome
#

jerkson

hexed hatch
cloud berry
#

i need

hexed hatch
#

it's not hard

cloud berry
#

wen wat i need is ITERATING

#

2 diffrent worlds

spiral dome
cloud berry
#

ye jaksen

#

imean unless u cn find iterater in it

#

cuz icant :I

#

u kno wat im tired af ijus wanna code

spiral dome
cloud berry
#

notdeal w/ all dis stupid ide/depedency shit

spiral dome
#

?

hexed hatch
spiral dome
#

saw that?

cloud berry
#

nah it ok @spiral dome i gib up ill jus maek spiget project 🤣

hexed hatch
#

it kinda sucks but it's stupid easy

cloud berry
#

run dis in a mc sever

#

evn tho it aint mc related

spiral dome
#

dun giv up :(

cloud berry
spiral dome
#

:D

cloud berry
#

;-; i been atdis so long igot 3 diff project open 2 diff ides n idfk which 1 which anymor

#

guess ill try th maven 1

#

but 4 th record ithink yamlconfiguration not bein its own api is slap in th face of yaml

#

@spiral dome aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

#
Exception in thread "main" java.lang.NoClassDefFoundError: com/google/gson/Gson```
#

AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

#

WHYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY

spiral dome
#

okay

#

gimme what u wanna do

#

ill try for u later

cloud berry
#

ijust

#

wanna

#

import

#

gson

#

n

#

use

#

it

spiral dome
#

ur jar is definitely not including the depends

cloud berry
#

0 errors in ide

#

idfk wtf goin on

spiral dome
#

show ur pom

#

and u arent using the

#

shaded jar

cloud berry
cloud berry
spiral dome
#

open the maven sidebar

#

find "package" there

hasty prawn
#

Gson is built with Spigot isn't it?

spiral dome
#

right click and run

#

then u will have the shaded jar in ur targets folder

cloud berry
spiral dome
#

where shade?

cloud berry
#

neithr made shade jar

cloud berry
hasty prawn
#

Leo, you're just trying to use Gson?

spiral dome
#

but firdt include shade plugin in ur build

cloud berry
spiral dome
#

no

#

just add shade after it

#

keep the other plugin too

cloud berry
#

after wat :I

spiral dome
#

sec

#

ill rewrite that

#

gimme a minute

cloud berry
#

tysm ❤️

fervent gate
#

How can I make it so my farmland doesn't go to dirt and stays as dry farmland, so just cancel the transition

spiral dome
#

dont mind the bad indent

#

couldn't indent on mobile

cloud berry
spiral dome
#

just a sec

fervent gate
#

I'm googling too

hasty prawn
#

BlockFadeEvent maybe?

fervent gate
#

Yea, I was looking into that as well

cloud berry
#

@spiral dome not sure yet but it seem 2 b workin

#

it annoyin cuz

fervent gate
#

lemme try that, and what about when a player tramples a crop?

cloud berry
#

igotta clean

#

evry time -_-

#

n i gotta cd in n out th target folder manuelly

hasty prawn
cloud berry
#

@spiral dome ok it do work 🤩 🤩 tysm!!! tha tutorial json file is read

spiral dome
#

:D

cloud berry
#

;-; i still dk how 2 fully use it

#

eg. sectiens

fervent gate
cloud berry
#

ya im 2 fucken stupid

#

ill jus make plogen

#

spiget

spiral dome
#

.-.

#

i still dont get what u tryna make

cloud berry
#

ifinally got 2 dis point ;-; n i gottat look mor shit up

#

well

#

it ok

#

ill sho u yml code wen done

spiral dome
#

okay

cloud berry
#

im jus baffeld thers no YamlConfiguration equivlent outsid spiget api

#

liek wtf java world

spiral dome
#

meanwhile me

cloud berry
spiral dome
#

check the size

#

and the sped

#

9h 😟

cloud berry
#

o :IIIIII

#

fak LOL

spiral dome
#

im being tortured with kalis server speed

cloud berry
#

okok

#

how do i eg. iter8 thru top levl items .-.

spiral dome
#

i haven't used jackson in soo long either so ima have to poogle a bit

tidal skiff
#

how do i make a block immune to silk touch so when u break it with a islk touch pick it still does all the stuff from the breakblockevent but doesnt drop the block

cloud berry
#

tahts gson 😳

spiral dome
#

idek gson

quaint mantle
spiral dome
cloud berry
#

ya ill jus go 2 bed 🤣

#

hoep dis easier 2moro

#

cuz ill probs regret doin dis as mc plogen evn tho itll get me codin faster

#

iswear if i ahd started programmin in java iwould not b programmin rn

#

java always so hard 2 find docs on god dam

#

n i coem from c++... it should b th othr way around

spiral dome
#

i find java the easiest

tidal skiff
#

by create a copy of the item

#

oh

#

wait nvm

#

that seems kinda complicated is there a way to just not drop anything from the event

cloud berry
quaint mantle
#

event.setDropItems(false)

tidal skiff
#

o thats easy lmfao

spiral dome
tidal skiff
#

thx

cloud berry
#

also th ides r hell 2 work wit

#

both of em

#

jesus xrist

waxen plinth
#

How could you say that about my homeboy intellij

cloud berry
#

it so bloateddddd 🤣

#

n liek

quaint mantle
#

Eclipse doodoo

cloud berry
#

y cant i just

#

hav 1 screen wehr i cn add dependencys n just call it a day

spiral dome
cloud berry
#

no igotta go in pom... n if im not usin maven tehn im jus f'd 🤣

cloud berry
#

n evn if i add it in pom i add it rong

quaint mantle
#

dependencies tab

cloud berry
#

cmon bruh wat centryu r we in

spiral dome
#

that link covers everything-json in java

#

with jackson and gson too

cloud berry
quaint mantle
#

@waxen plinth tell leo unblock so we can truce

cloud berry
waxen plinth
#

Why'd he block you?

quaint mantle
waxen plinth
#

Leo, where are you from?

#

Poland right?

cloud berry
#

yesplz truce ❤️

waxen plinth
#

Lol

cloud berry
waxen plinth
#

Oh

#

I don't like that guy

#

Anyways where are you from

#

My second guess is ireland

quaint mantle
#

Korea...

spiral dome
#

boi what the hell boi

cloud berry
#

🇺🇸 😎

quaint mantle
#

No way

waxen plinth
#

Is English your first language

quaint mantle
#

Leo gotta be 7

cloud berry
spiral dome
#

leo cant be in korea

quaint mantle
#

Y

spiral dome
#

its day time there

quaint mantle
#

he has a korean girl as pfp

spiral dome
#

and leo goin sleep

#

so not in korea

cloud berry
spiral dome
#

5_5

cloud berry
quaint mantle
#

cap

waxen plinth
#

Hey anyways

#

Plugins amirite

quaint mantle
#

PES_CoolBiker Redempt asking questions

cloud berry
#

hug imagedev

#

i so happy 😄

waxen plinth
#

I do have a question

#

Nobody's been able to help me with it yet

#

Probably cause nms

cloud berry
#

nms 😱 🔫

quaint mantle
#

🤸
🏌️

spiral dome
spiral dome
#

im out

cloud berry
#

o ya 😳 ineed 2 eatb4 slep

#

no mor code 2nte

quaint mantle
#

they arent adding a pregnant man emojj

#

its biologically impossible

waxen plinth
#

How do you refresh lighting for a chunk in nms 1.17

spiral dome
#

they already added

cloud berry
quaint mantle
#

🤰

cloud berry
#

unicoded**

spiral dome
quaint mantle
#

not on my phone

waxen plinth
#

I have a library in development

quaint mantle
#

And

waxen plinth
#

Which would let you edit blocks fast without fawe

cloud berry
waxen plinth
#

But it needs to be able to do lighting updates

cloud berry
#

ithought it wass leak official discor

waxen plinth
#

I can't figure out how to do them for 1.17

spiral dome
quaint mantle
cloud berry
#

🐍

#

compotor snek

waxen plinth
#

Pybad

cloud berry
#

🤩 guys discor ahs ddr

waxen plinth
#

Yes

spiral dome
#

ddr?

#

those arrows can play moosic

cloud berry
#

discor dance revilutien

spiral dome
#

press arrow keys on ur kb

#

and make moosic

cloud berry
obtuse solstice
#

Hey there - general quick question. What's the best way to store data ephemerally within a Java spigot plugin? Basically just looking to store a string or bool, no need for it to stay across restarts.

waxen plinth
#

Wat

spiral dome
#

static

obtuse solstice
#

Just temp store data for the length that the server is online for

waxen plinth
#

If you don't need persistence

spiral dome
#

persistence

waxen plinth
#

Just store it in variables

cloud berry
#

no stay across restrat... so liek a varieble? 🤣

spiral dome
#

yea variables is the best way

obtuse solstice
#

Oh bother I'm stupid, thanks very new to this :P

spiral dome
#

its alright

#

everyone has been new

cloud berry
spiral dome
#

im so bad at speaking positivity

waxen plinth
#

Not me

obtuse solstice
waxen plinth
#

By the time I was born I had already written a parser

spiral dome
#

ur gods gift

cloud berry
#

ispent th past 3-4hrs trynn figur soemthin out

#

still not doen

quaint mantle
#

hey

#

Could someone help me with something?

#

I just submitted a new rescource and I think it was botted.

#

It wasn't me that botted it and I have no clue what to do.

#

It was at 35 downloads, I went out to a store, and now it's at 500.

waxen plinth
#

Why does it matter

tidal skiff
#

how random actually is threadlocalrandom

#

im making a lucky block plugin and im getting the same thing like 3 times in a row even with 16 possibilities

#

and is there a way to make a true actual random

waxen plinth
#

It's a seeded pseudorandom number generator

#

It's random enough for all purposes except security

#

For which you want SecureRandom

#

But that's also pseudorandom

#

Just harder to predict

tidal skiff
#

ok so im just really lucky getting a ton of stuff the same in a row

waxen plinth
#

Most likely yes

#

As for "true actual random"

#

Not feasible unless you have a geiger counter and some depleted uranium handy

tidal skiff
#

i do actually :D

#

lmfao

waxen plinth
#

Then you can program an arduino to make a true random number generator

tidal skiff
#

too ez

median anvil
#

does anyone know why this: EntityPlayer npc = new EntityPlayer(server,world,gameProfile,new PlayerInteractManager(world)); doesnt work

median anvil
#

says PlayerInteractManager requires an EntityPlayer and was given EntityWorld

waxen plinth
#

The EntityPlayer constructor doesn't need a PlayerInteractManager

median anvil
#

just the server , world, and game profile? but how do i get the npc to interact then?

waxen plinth
#

What are you expecting it to do

#

Behave like a normal player?

median anvil
#

yeah sure.

waxen plinth
#

You can't really do that

#

Because most of the behavior is handled clientside

stone sinew
#

Gotta use packets for that.

waxen plinth
#

The server just sends packets

#

Yeah

#

You need to send packets for whatever the npc is "doing"

median anvil
#

thats what im trying to do though, are you saying you dont need that manager to send packets?

waxen plinth
#

That's right

#

You just send packets like PacketPlayOutAnimation

median anvil
#

ok

sly halo
#

Id like to learn Java and Plugin developent. Are there any useful resources to learn with?

median anvil
tacit drift
#

?java

#

wait

#

how was that cmd

#

!java

#

frick

hybrid spoke
#

?learnjava

undone axleBOT
tidal skiff
#

how do i remove the ai from this entity?
Entity chicken = p.getWorld().spawnEntity(e.getBlock().getLocation(), EntityType.CHICKEN);

slim anchor
#

Can I use new EntityDamageEvent() to hurt player?、

hybrid spoke
#

Player#damage

slim anchor
#

OK thx

tidal skiff
#
            Location chickenLoc = chicken.getLocation();

            chickenLoc.setX(chickenLoc.getX() - 0.5);
            chickenLoc.setZ(chickenLoc.getZ() - 0.5);
tidal skiff
#

does seem to work

#

ill tr adding

#

doesnt work

#

adding does the same as doing nothing at all

hybrid spoke
#

show me your code

#

and the result

#

by adding the offsets

tidal skiff
#
    @EventHandler
    public void onBlockPlace(BlockPlaceEvent e){

        Player p = e.getPlayer();

        if(e.getBlockPlaced().getType() == Material.YELLOW_STAINED_GLASS){

            p.playNote(e.getBlock().getLocation(), Instrument.PIANO, Note.natural(1, Note.Tone.E));
            p.playNote(e.getBlock().getLocation(), Instrument.PIANO, Note.natural(1, Note.Tone.A));
            p.playNote(e.getBlock().getLocation(), Instrument.PIANO, Note.natural(1, Note.Tone.C));

            Entity chicken = p.getWorld().spawnEntity(e.getBlock().getLocation(), EntityType.CHICKEN);
            LivingEntity chickAI = (LivingEntity) chicken;

            Location chickenLoc = chicken.getLocation();

            chickAI.setAI(false);
            chicken.setInvulnerable(true);

        }

    }
hybrid spoke
#

also there is a Location#add method

slim anchor
hybrid spoke
#

LivingEntity chickAI = (LivingEntity) chicken; this is redundant

tidal skiff
#

the location is at e.getBlock()

hybrid spoke
#

Chicken chicken = (Chicken) p.getWorld().spawnEntity(e.getBlock().getLocation(), EntityType.CHICKEN); does the trick

hybrid spoke
tidal skiff
#

yeah thats without it

#

when i add the offsets it still does nothing

#

wait

#

let me do it with offsets

hybrid spoke
#
            chickAI.setAI(false);
            chicken.setInvulnerable(true);
```?
tidal skiff
#

ill send the code and the result

slim anchor
#

I only found EntityDamageEvent @hybrid spoke

hybrid spoke
tidal skiff
#

http://prntscr.com/1qcyxrv

    @EventHandler
    public void onBlockPlace(BlockPlaceEvent e){

        Player p = e.getPlayer();

        if(e.getBlockPlaced().getType() == Material.YELLOW_STAINED_GLASS){

            p.playNote(e.getBlock().getLocation(), Instrument.PIANO, Note.natural(1, Note.Tone.E));
            p.playNote(e.getBlock().getLocation(), Instrument.PIANO, Note.natural(1, Note.Tone.A));
            p.playNote(e.getBlock().getLocation(), Instrument.PIANO, Note.natural(1, Note.Tone.C));

            Entity chicken = p.getWorld().spawnEntity(e.getBlock().getLocation(), EntityType.CHICKEN);
            LivingEntity chickAI = (LivingEntity) chicken;

            Location chickenLoc = chicken.getLocation();

            chickAI.setAI(false);
            chicken.setInvulnerable(true);
            chickenLoc.setX(chickenLoc.getX() + 0.5);
            chickenLoc.setZ(chickenLoc.getZ() + 0.5);
        }

    }
tidal skiff
#

whats wrong

slim anchor
hybrid spoke
#

you are getting the location of the chicken which doesnt affect the chicken anymore

tidal skiff
#

why doesnt it affect it anymore? does livingentity cancel that

hybrid spoke
hybrid spoke
#
            Chicken chicken = (Chicken) p.getWorld().spawnEntity(e.getBlock().getLocation().add(0.5, 0, 0.5), EntityType.CHICKEN);

            chicken.setAI(false);
            chicken.setInvulnerable(true);

that would be the solution.

#

your current code is completely over the top

#

and your code wont work since you are getting the chickens current location, resetting the X and Z but never updating it.

#

instead you could just spawn it right away into the block

tidal skiff
#

that would

#

yeah

#

make more sense

hybrid spoke
#

and #getLocation is returning a clone of the current location so you just extracted the location out of the entity

tidal skiff
#

ohh thats why it wasnt working

#

yeah ok fair enough

#

ig you cant really set the location of nothing

hybrid spoke
#

wdym?

tidal skiff
#

cuz if its just the location of the chicken which isnt connected to the chicken anymore

#

u cant set htat

hybrid spoke
#

you can update it by teleporting the chicken f.e.

reef wind
#

wrong

#

channel

#

sorry

hybrid spoke
#

:(

#

i wanted to suggest you to recreate that

#

by doubletiming

#

make the video 2 mins

#

easy

tidal skiff
#

ok so now i have an entity inside the block on blockplaceevent, how do i remove() it when the block is destroyed? i think you get the block and get the nearest entity and kill it but idk how to get the nearest entity

vague oracle
#

I’m so confused

#

You would store it in a hashmap with the block as the key and chicken as the value

#

But why would you do what you are doing

tidal skiff
#

wait can hashmaps store a location that corresponds to an entity?

#

oh i thought they had to correspond to the same data type

#

ngl idk why i thought that but the hashmap worked nicely, ty

quaint mantle
#

is java same as js?

lost matrix
quaint mantle
#

lol

lime jay
#

Whats the best way to go about asyncing something like a teleport? I want to async this because i setblock (Usaing FAWE API) and once thats done i teleport the player there

quaint mantle
#

using

#

usaing

lime jay
#

Becase currently i
TP
SetBlock
and the server dies

quaint mantle
lost matrix
chrome beacon
#

FAWE edits are blocking if you use the WorldEdit examples

#

You need to call them async

hybrid spoke
quaint mantle
#

no

#

i sniff like poop

chrome beacon
#

NMS, look at how the data command does it

lost matrix
chrome beacon
lost matrix
#

NMS entities have a method save(NBTCompound)

#

The question is: Does FAWE return a Future<T> you can append on?

tidal skiff
#

alr @hybrid spoke so i have this slime
Slime slime = (Slime) p.getWorld().spawnEntity(e.getBlock().getLocation().add(0.5, 0.25, 0.5), EntityType.SLIME);
is there a way to set its size to 1 before it spawns? cuz its massive for a split second before the thing executes slime.setSize(1);

chrome beacon
plain scroll
#

how can i make it so & colors work in config messages?

chrome beacon
#

all I do is call things async then run the rest of the code after with a scheduler

#

Since the edit will block the thread that works perfectly fine

lost matrix
chrome beacon
#

and? I just want things to run after it

lost matrix
chrome beacon
#

Yes

lost matrix
#

Ah ok. Now it makes sense.

chrome beacon
#

-> async call FAWE edit -> back to main thread with scheduler -> code after edit is done

#

._. Look at the data command

lost matrix
hybrid spoke
lost matrix
#

Wait can you call FAWE methods async? Never used their API tbh

lost matrix
hybrid spoke
#

mh yeah makes sense

#

was confused since there is also a #thenRunAsync method

chrome beacon
#

It's a vanilla command /data

#

I hope you're not on a dead version now

#

Is it a tile entity

plain scroll
#

so i have this in one of my classes

#

but i wanna add it to another, but its a public void. Is that possable?

#

because i write it all out and i get a bunch of errors

lost matrix
#

Uh oh.

plain scroll
#

nvm

#

fixed it

hybrid spoke
lost matrix
opal juniper
plain scroll
#

oh i now get an error with this line

#

'BanInvListener(bangui.me.duke.Me.Duke)' in 'bangui.me.duke.Me.listeners.BanInvListener' cannot be applied to '()'

lost matrix
plain scroll
#

oh so this

lost matrix
# plain scroll oh so this

Yes. This is your constructor. And you defined it to have one argument which is of type Duke. Now if you want to
create a new instance of your BanInvListener you need to pass all arguments to the constructor.
In your case you just need to pass an instance of Duke.

#

Hint: You can reference the instance of the class you are currently in with the this keyword.

plain scroll
#

tyyy

#

idk why but this worked duke

vague oracle
#

because this is java

plain scroll
#

very very good point

lost matrix
#

Chests are tile entities

#

no. tile entity

#

i think its ok to call a tile entity a tile block or block entity

chrome beacon
#

Yeah that's NBT

#

Look at how that command does it

#

Yes

#

ofc it does

supple elk
#

Can I always cast from human entity to player?

chrome beacon
supple elk
#

I think this works

hybrid spoke
supple elk
#

oh

#

so I can just cast it then

lost matrix
supple elk
#

right

#

this is a human entity passed from an event tho

#

so it will always be a player

lost matrix
#

Why do you want to save a tile entity yourself anyways?

#

Why does he need to save a tile entity into a file?

smoky finch
#

So I had a similar issue https://www.spigotmc.org/threads/bossbar-problems.495229/

The boss bar itself will not cause the music to play, you would have to use the player.playSound(..)
But then what's the point of having that flag in the first place? I'm pretty sure it worked just fine without manually playing a sound in older versions.

restive tangle
#

what is a good way to do a queue system , im thinking having a list of players and adding the players when they click something , do something etc and remove if they die or leave , and i'd check if the queue length is bigger than (num) and start it when it is , is this a viable way to make a queue system

ivory sleet
#

I mean there’s literally a data structure for it

#

A plentiful amount of implementations actually

restive tangle
#

Queue<E>?

ivory sleet
#

Yes that’s the interface

restive tangle
#

alright i'll look into it , thanks

ivory sleet
#

Idk what you need here but maybe an ArrayDequeue is enough or LinkedList if you want your remove operations to be O(1)

grim ice
lost matrix
tepid monolith
#

willing to gift steam games for a modded version of optifine 1.8.9 with toggle sprint included
dm if interested

#

is this request allowed here?

eternal oxide
#

no

tepid monolith
#

oh mb

opal juniper
#

https://paste.md-5.net/bubulajuga.m

i have somethibg like this, and i need to deserialise it

what is the best way to get the entire file as potentially a string ? the b64 hash is often over several lines so there is no garuntee that it is gonna be one line per object

eternal oxide
#

a Base64 encoded object is alwasy a single line

opal juniper
#

hmm

#

what have i done wrong then xD

stone sinew
#

Thats a json array not just base64

opal juniper
#

myeah

#

ik

#

im talking about the contents

eternal oxide
#

I only see one Base64 encoded string in there.

#

which is a single string

opal juniper
#

yeah but it can be a list of then - depends on the contents of what you serialise

eternal oxide
#

Yoiu are serializing individual ItemStacks

opal juniper
#

yea?

stone sinew
opal juniper
#

oh right hm ok

eternal oxide
#

so each ItemStack will be in its own string

opal juniper
#

atm yes

#

so i should be passing several itemstacks into that method rather than just one?

eternal oxide
opal juniper
#

👍

old cloud
#

Hello, I'm trying to update the text on a sign in 1.17. Has anyone any idea why it does not work?

for(int i = 0; i < s.length; i++) {
    sign.setLine(i, s[i]);
}
sign.update();
```s is a String[] with 4 elements