#help-development

1 messages · Page 2164 of 1

granite owl
#

its not namespaced but i have faith in you that you can handle the namespace yourself

quiet ice
#

But you can also use the tarball and run maven through ./apache-maven-3.8.5-bin/apache-maven-3.8.5/bin/mvn with the proper maven stuff

worldly ingot
#

getType().getKey(), but yes

celest nacelle
#

Does that have the minecraft: or would I need to add that?

celest nacelle
#

and is it lowercase?

quaint mantle
#

What should I do now?

granite owl
worldly ingot
#

It does. It returns a NamespacedKey object which, when toString()'d, will return the namespace:key format

quiet ice
#

Don't know what? Unpacking tarballs?

celest nacelle
#

Ah thanks

granite owl
#

i mean i dont use it like this

quaint mantle
#

yes

#

i only have the command for .deb files

granite owl
#

@worldly ingot i only use item types like this

#
public void onInventoryCloseTransmuteSmithing(InventoryCloseEvent event)
    {
        if (event.getInventory().getType() == InventoryType.ANVIL)
        {
            if (event.getInventory().getItem(1) != null)
            {
                ItemWrapper item = new ItemWrapper(event.getInventory().getItem(1), null);
                
                if (!item.getOriginalMaterial().equals(""))
                {
                    item.getItemStack().setType(Material.valueOf(item.getOriginalMaterial().toUpperCase()));
                    event.getInventory().setItem(1, item.getItemStack());
                }
            }
        }
    }
``` xD
quaint mantle
#

also on the website it says to extract the file

#

or maybe thats what you meant

granite owl
#

to make other crafting materials but vanilla ones be able to be used as smithing material

quaint mantle
#

@quiet ice there certainly has to be something wrong here. I got the same error again...

#
[ERROR] Error executing Maven.
[ERROR] java.lang.IllegalStateException: Unable to load cache item
[ERROR] Caused by: Unable to load cache item
[ERROR] Caused by: Could not initialize class com.google.inject.internal.cglib.core.$MethodWrapper
#

I cd-ed into the folder and did mvn clean install

#

and I got this error

#

actually i'll just google it

quasi patrol
#

How do I add a custom tag to an item stack?

chrome beacon
#

?pdc Use PDC for custom tags

harsh totem
#

So I have this and it doesn't break the item ItemMeta meta = item.getItemMeta(); Damageable damageable = (Damageable) meta; damageable.setDamage(Integer.MAX_VALUE); item.setItemMeta(meta);

#

why isn't it

crimson terrace
#

you have to manually reduce the amount

crimson terrace
#

ItemStack#setAmount(ItemStack#getAmount - 1)

harsh totem
#

but -1 repairs it

crimson terrace
#

if the health of the item is below 0 you have to do that

#

its setAmount, not setDamage

harsh totem
crimson terrace
#

I did specify ItemStack

harsh totem
#

it want it to break

crimson terrace
#

which is the same thing

harsh totem
#

no

crimson terrace
#

in what way is it different?

#

the sound is the only thing

harsh totem
#

the sound and animation

#

and there is also a condition that should reduce the durability and not break the item entirely

#

so I need to know this

chrome beacon
crimson terrace
quiet ice
crimson terrace
#

spawning particles and playing sounds is easy

harsh totem
#

how do I use public static final EntityEffect BREAK_EQUIPMENT_MAIN_HAND

#

i dont understand

quaint mantle
#

geol sorry if i was a bit difficult but things finally worked out and i have a functioning plugin so yeah... thanks

quiet ice
#

oh good to know

quaint mantle
#

time for me to get into plugin development and learning java

#

generics, lambdas and that good stuff

quiet ice
#

There is no standard way to install tarballs

quaint mantle
#

I found instructions in a .txt file inside the archive

quiet ice
#

Ah nice

quaint mantle
#

I wasn't sure how to follow the instructions but it worked out somehow

#

now i have latest version of maven and it works

harsh totem
#

why does it say Cannot resolve method 'playEffect(Location, EntityEffect)

quaint mantle
#

because that method doesn't exist

twilit roost
#

BungeeCord
How to check if section contains a key?
I want to check if it contains "permanent"

                for(String s : Main.getPlugin.discord.config.config.getSection("roles").getKeys()){
                    if(Main.getPlugin.discord.config.config.getSection("roles").contains(s+"permanent")){
                        Main.getPlugin.getLogger().info("Not NULL");
                    }else Main.getPlugin.getLogger().info("NULL");
                }
worldly ingot
#

Well those are lists, not sections

quaint mantle
#

that takes an entityeffect, not a location and an entityeffect

harsh totem
#

oh

twilit roost
worldly ingot
#

Correct

#

getStringList()

twilit roost
#

Solution for those having same issue:

for(String s : Main.getPlugin.discord.config.config.getSection("roles").getKeys()){
                    if(Main.getPlugin.discord.config.config.getSection("roles").getList(s).contains("permanent")){
                        Main.getPlugin.getLogger().info("Not NULL");
                    }else Main.getPlugin.getLogger().info("NULL");
                }
worldly ingot
#

getStringList() is probably more appropriate, but yeah getList() works too

twilit roost
#

it contains Long , String

quaint mantle
harsh totem
quiet ice
#

It does not break the item, but it will play the effect as it it broke. To actually break the item, just set the material to air or something like that

harsh totem
#

ok

tardy delta
coarse shadow
#

can some1 help me about nms

#

i did everything i needed but i cant still use it in my code

chrome beacon
#

Sounds like you didn't do everything you needed. Are you using maven or gradle and what version of Minecraft are you targetting

coarse shadow
#

maven and 1.18

#

i installed buildtools

#

did the maven stuff

#

but still

chrome beacon
#

How do you know it's not working

#

What are you testing

coarse shadow
#

use any class of it

chrome beacon
#

Also send your pom in a paste

#

?paste

undone axleBOT
coarse shadow
#

aight

chrome beacon
#

I recommend using 1.18.2

#

1.18 is outdated

#

Also have you run BuildTools

coarse shadow
#

ye

#

i've checked the repo folder in disk C and i have the needed jars

chrome beacon
#

So what class are you trying to use

coarse shadow
#

serverplayer for example

#

heres the jar repo

chrome beacon
#

Open 1.18-R0.1-SNAPSHOT

#

And send what's in that

coarse shadow
chrome beacon
#

Rerun BuildTools with the --remapped flag

coarse shadow
#

how do i do it with the flag

chrome beacon
#

java -jar BuildTools.jar --rev 1.18 --remapped

#

I still highly recommend updating to 1.18.2

coarse shadow
#

ima do it when i fix the issue

#

aight worked rn thanks

rough drift
#

If I use Bukkit#getOfflinePlayer on an online player id, it should still return the offline player and when I do getPlayer I should get the online player?

chrome beacon
#

Yes

rough drift
#

alr, don't use that method from a while lol

crisp steeple
vague swallow
#

What event gets triggered if a player is blocking with a shield?

crisp steeple
#

playerinteractevent?

tardy delta
#

will the exceptionally only run when the sout("finished") throws an exception?

vague swallow
crisp steeple
#

?

tardy delta
#

i figured out

crisp steeple
#

you can check if the action was a right click, and if the item used was a shield

iron palm
#

Whats PathFinderPetGoal name in mojang mappings?

patent horizon
#
    public static String getString(ItemStack item, NamespacedKey key) {
        return item.getItemMeta().getPersistentDataContainer().get(key, PersistentDataType.STRING) == null ? null : item.getItemMeta().getPersistentDataContainer().get(key, PersistentDataType.STRING);
    }``` i'm getting an npe in console when i try using this method on certain items (which is expected). how can i prevent the npe while still allowing null as a passable object?
tardy delta
#

dont allow passing a null value lol

lost matrix
patent horizon
#

yeah it used to be just return item.getItemMeta().getPersistentDataContainer().get(key, PersistentDataType.STRING) but i thought adding the extra bits would fix it

lost matrix
#

PS:

if(item == null) {
  return null;
}
eternal night
#

people that add brackets to early-returns Sadge

lost matrix
#

People that dont PES2_SadGeRain

tardy delta
#

best thing

lost matrix
#

Google code style

tardy delta
#

:(

lost matrix
#

Every statement needs a body

steep cove
patent horizon
steep cove
#

Just because you can shorthand something doesn't mean it should be

quaint mantle
#

Jesse

steep cove
#

Hello

lost matrix
steep cove
#

Ah. At least my name is affiliated with a good show about paying taxes

eternal night
#

I do prefer my early returns without brackets, it is just too much bloat for me

#

or just give me elvis operator

patent horizon
#

another question, what's the Object type i put into my method param for me to just pass PersistentDataType.type

lost matrix
tardy delta
#

that code doesnt make sense lol

#

if its null return it but when its not null also return it

eternal night
#

smile looking for the spoon

lost matrix
# patent horizon uhuh

I would prevent null values wherever possible.
Using Optionals will help you write code thats more null safe.

  public Optional<String> getString(Entity entity, NamespacedKey key) {
    return Optional.ofNullable(entity.getPersistentDataContainer().get(key, PersistentDataType.STRING));
  }
quaint mantle
#

disgusting creature

tardy delta
#

i hate using Optionals in java

#

in rust they are chill

quaint mantle
tardy delta
#

rust has no null 😂

#

best thing

patent horizon
#

i wanna do something like the following:

lost matrix
#

In addition you can use intellijs annotations to get better code analysis.

  public Optional<String> getString(@NotNull Entity entity, @NotNull NamespacedKey key) {
    return Optional.ofNullable(entity.getPersistentDataContainer().get(key, PersistentDataType.STRING));
  }
patent horizon
#

so that i dont have to make a method for each type

eternal night
#

wat

#

what would be the point of that method

patent horizon
#

good question

#

quirky aesthetics tbh

eternal night
#

Aha

patent horizon
#

ima just leave now before more damage is done

tardy delta
#

is Persistentdatatype generic?

eternal night
#

Yes

lost matrix
tardy delta
#

ah

#

ah ye i remember

#

it stores constants

lost matrix
#

Which for me mostly means <String, AnythingICanThrowIntoGson>

tardy delta
#

kek

eternal night
#

Those are the baselines yea

#

Sad I never pushed native support for Lists

tardy delta
#

lets go from an integer to an integer ;/

eternal night
#

Hm ?

#

Oh the fact they are mapping to themselves

tardy delta
#

ye

eternal night
#

I mean, makes sense tho doesn't it ? 😅

tardy delta
#

no

eternal night
#

I mean, yea you could have used a different system for custom data types and primitive ones

#

but two systems are meh

humble tulip
#

U made pdc?

#

:o

tardy delta
#

i was thinking of putting it as a field in the StorageType enum

eternal night
#

Definitely possible

#

could also just do a registry style approach

tardy delta
#

dont like manual switch

eternal night
#

no just Map<String, Function<ConnectionProvider, Database>>

#

Like with enums you'd most likely have to do some conversion anyway to get the user supplied value to the actual enum name anyway

#

and beyond that the enum does not really have any benefit over a simply registry

humble tulip
#

Oh god

#

Didn't know atomicreferences were a thing

#

That would've solved so many of my problems

#

I used concurrenthashmap instead

tardy delta
#

i was thinking of putting the database class in the enum as an extra field but that would probably give problems getting the right constructor parameters from somewhere

patent horizon
#

how would i go about making a class that just stores a bunch of hashmaps

eternal night
#

stores ?

patent horizon
#

i havent used enums much, would that work?

humble tulip
#

What would the hashmaps be storing?

patent horizon
#

custom items

#

rarities

#

chances of obtaining

#

etc

tardy delta
#

then each enum constant would have to store a map

eternal night
#

why would that be different maps tho

golden turret
#

what will happen if i cancel an already cancelled task?

eternal night
#

aren't all of those part of the item itself

tardy delta
#

nothing

humble tulip
patent horizon
tardy delta
#

multiple plugins can cancel an event

golden turret
#

i dont want to see bugs happening

patent horizon
#

ig i'd also need a main map for all the items too

humble tulip
tardy delta
#

the one with the highest priority wins

humble tulip
#

Why don't you create a customitem class

eternal night
#

^^

humble tulip
#

That stores all the data abt that item

patent horizon
tardy delta
#

actually

#

could use it

patent horizon
#

also do you mean like 1 item per class?

tardy delta
humble tulip
humble tulip
#

and store in a map

patent horizon
#

oh ok

humble tulip
#

like Map<ItemStack, CustomItem>

patent horizon
#

how would i fill each one up

#

like map.put("key", new CustomItem(itemstack, int, int))?

tardy delta
#

looks kinda sus

#

actually im wondering if i can achieve the same thing with a Function<Xkingdoms, HikariDatasource> as with this?

grim ice
#

you should change ur class naming to

#

XKingdoms

tardy delta
#

hmm ye

grim ice
#

and i would recommend

#

either extending Supplier<I, O>

#

which has the method

#

O get(i i);

#

or changing ur interface to that and making the datasourcesupplier

#

to a class

tardy delta
#

supplier only has one generic type

grim ice
#

Yes

#

thats why i said make one

#

or

tardy delta
#

but would it work with that function?

grim ice
#

extend a function

grim ice
wanton remnant
#

Is it possible to regenerate a chunk that has been inactive for some time? if yes how i can do it ? thx

tardy delta
#

Chunk#load?

#

@grim ice i guess there's a better way

#

dunno why you told me to create a Supplier<I, O> but its literally the same as a Function

ivory sleet
#

Probably the name

tardy delta
#

lol

wanton remnant
humble tulip
#

what do you mean by "inactive"

tardy delta
#

not loaded probably

#

as chunk activity loads the chunk

wanton remnant
#

not loaded for one week, for exemple

tardy delta
#

why would you do that btw

#

that would load all the unloaded chunks

humble tulip
#

U wanna regen the chunks?

#

I'm not sure how to delete a chunk but I'll tell you how to do the one week part

#

Just store a timestamp every time the chunk is loaded

tardy delta
#

a world contains thousands of chunks lol

wanton remnant
humble tulip
#

Cache it and then store to a file every x mins

tardy delta
#

that were ever loaded tho

wanton remnant
humble tulip
#

Don't save the file every time a chunk is loaded tho

humble tulip
#

U cna use sqlite

wanton remnant
#

but I don't know how to retrieve the necessary information ^^'

humble tulip
#

Use sqlite

#

Store it in a table with 4 columns, world, chunkx, chunkz, lastloaded

#

Then select * from table where lastloaded < now-1week

#

Then u have all the chunks that meed to regen

tardy delta
#

h2 for the win

humble tulip
#

I've never used h2

wanton remnant
tardy delta
#

h2 has the same syntax as mysql but its an embedded database and thus faster

sacred mountain
#

whats the best way to get a player's active potion effects and put them in a list, but set the time of those effects to 60 seconds?
thsi is what i have rn

List<PotionEffect> effectList = new ArrayList<>(player.getActivePotionEffects());
effectList.forEach(potionEffect -> potionEffect = new PotionEffect(potionEffect.getType(), 1200 /* 1 minute */, potionEffect.getAmplifier()));
Kit kit = new Kit(irrelevantArg, irrelevantArg, irrelevantArg, irrelevantArg, effectList, irrelevantArg, irrelevantArg);```
wanton remnant
humble tulip
#

I already told u

humble tulip
sacred mountain
#

oh hi minion

humble tulip
#

Wait what mc version are u using?

wanton remnant
# humble tulip Here

Yes but before putting them in sqlite. What is the function to know if a player has entered the chunk ^^'

humble tulip
#

You can use player move event but why do u wanna know when they enter

#

Why not regen it when the chunk loads?

humble tulip
#

Chunks have a persistent data container so u don't have to use sqlite

wanton remnant
#

Because I watch when the player enters, I note the TimeStamp in SQlite and I check each time the plugin starts each chunk to know if there is one where no player has entered for 1 week

sacred mountain
#

whtats the best way to convert a collection to a list? new ArrayList(collection)

wanton remnant
#

if no one has entered for a week, I regen

wanton remnant
#

1.18

humble tulip
#

Wjy do u wanna regen when the player enters and not when the chunk loads

humble tulip
wanton remnant
#

I tell myself that if the player enters it, he loads it, but thinking about it... not quite ^^'

humble tulip
#

Yeah chunks load around a player before they enter them

wanton remnant
#

yeah

#

I'm not very experienced ^^'

humble tulip
#

Also store the value when the chunk unloads

wanton remnant
#

ok, i'll try it :p

humble tulip
tardy delta
#

im sorry 500fps

sacred mountain
tardy delta
#

pog

ivory flume
#

question

#

uh

#

Player#performCommand can run bungeecord commands right?

#

say I add a command through bungeecord plugin

sacred mountain
ivory flume
#

can that method in player run it?

vague swallow
tardy delta
#

stfu

sacred mountain
#

wtf

tardy delta
#

just die

sacred mountain
#

:((

tardy delta
#

jump

ivory flume
#

ok but what about my question

sacred mountain
crisp steeple
sacred mountain
#

like holding down to mine i think

#

or holding down a fishing rod or sum

vague swallow
ivory flume
#

do i have to use bungeecord plugin channels instead of player#performCommand with "server [servername" as an arg

humble tulip
ivory flume
#

bc it's not working rn

#

it says it doesn't even recognize the command

humble tulip
#

U have to use plugn messaging channel

ivory flume
#

oh k ty

crisp steeple
#

theres no event just called "holdingdownrightclick"

#

its just playerinteractevent

tardy delta
#

finally my onenable method is compiling

sacred mountain
#

lmfao

tardy delta
#

very clean

#

🤤

humble tulip
#

This is how I store data

vague swallow
# crisp steeple yes?

you're blocking with the shield if you are holding the click but if you are clicking only one short time you're only blocking for that short time. I want to check if the player is currently blocking so if he is holding the right click

humble tulip
#

Nowehere as clean as your setup

sacred mountain
#

f

#

well im using it so f for me too

vague swallow
# crisp steeple yes?

the PlayerInteractEvent only gets triggered if the player starts blocking not when he IS blocking

tardy delta
humble tulip
sacred mountain
#

why do things need to be async

tardy delta
#

ah im making the same principe

#

because database slow and lags the game

humble tulip
crisp steeple
vague swallow
#

thanks

#

that helped me alot

crisp steeple
#

np

humble tulip
#

Didn't know abt atomicreferences so i create data snapshots to save

sacred mountain
#

whats atomic stuff

humble tulip
#

Thread safe

#

I think

sacred mountain
#

oh is that why it asks me to use an atomic when im looping async?

#

in a scheduler

ivory sleet
sacred mountain
#

is player inventory clientside? or can i create something that will open a different GUI when opening inventory

chrome beacon
#

Player inventory is client side

buoyant viper
#

pretty sure its clientside since u can open it instantaneously even when u have hella lag

mint reef
#

Hey - I've got a bit of a question but due to the nature of it I'm unable to ask in a public forum and would require to talk to some staff in private. I don't want to be the guy who just sends unsolicited DM's so I'm just wondering if I'd be able to talk to someone (It isn't some dumb development question, it makes a bit more sense with context)

chrome beacon
#

You aren't staff 🙃

drowsy helm
#

oh lmao staff

#

oops

#

why this in help dev

chrome beacon
#

I have no idea

mint reef
#

It's related to development, just unsure if something aligns with guidelines and I'd like an explicit answer since it's kind of in blurred lines/vague

humble tulip
#

Bruh I'm so curious😂

river oracle
#

if its so bad you can't post it here its probably not allowed lmao

mint reef
#

It isn't bad - the previous version md_5 authorised

river oracle
#

this discord is lax as fuck with rules

mint reef
#

I'd just rather it didn't get out

ivory sleet
#

Ollie I’m only a moderator on the discord so Idk if I am to much help here, but try Choco, he’s usually available :3

river oracle
# ivory sleet No?

bruh most other public discords banning you for saying something slightly off hinge

ivory sleet
humble tulip
#

I wanna get a players skin offline but I'll only be getting the skin of players that player before. Should I just save thw textures to a database on login?

humble tulip
river oracle
#

for players skulls yea?

#

if you have UUID stored somewhere you could prob grab it

#

if your making some like top 5 balances and stuff you can just store that as all of it is determined while the player is online

grim ice
#

well ik this prob isnt the right place to ask

humble tulip
#

Well ye

grim ice
#

but how does

#

ai work

river oracle
#

well what a broad question lol

chrome beacon
#

^

grim ice
#

ik

#

but like

ivory sleet
#

What type of ai?

river oracle
#

what kind of AI

humble tulip
#

It's for friends lost

grim ice
#

Machine learning

river oracle
#

its a bunch of liner algebra

#

uhm one second there are algorithms

grim ice
#

uhhh do u know a place to learn from

regal anchor
river oracle
grim ice
#

well i wanna do it with java

river oracle
#

uhm

#

have fun

#

lmfao

ivory sleet
#

Sure do

grim ice
#

is that bad

river oracle
#

do people make AI in java even?

grim ice
#

YEAH

ivory sleet
#

Tho yeah there’s a lot more material covering it in py

river oracle
#

i thought that was a C/Python thing lmao

grim ice
#

DEFINITELY DUDE

#

ive seen many libraries for it

#

its just that

#

i have a skill issue called not understanding

river oracle
#

I mean python and C are going to be inherently better for machine learning

#

good start is there

grim ice
#

i dont even know python dude

#

i have to learn a whole language for that?

river oracle
uneven fiber
#

yo im trynna make it so that if a player opens their inventory an item is added to it, but its not working? Thoughts 🧐

quaint mantle
#

Hello! is it possible to trigger a console command in an asynchronous methid?

ivory sleet
#

It takes 20 minutes to learn python at maximum assuming you know Java already

river oracle
#

^

#

its so insanely easy you will be like why was i worried about learning this

drowsy helm
grim ice
#

fine but how am i supposed to

#

find a tutoria

#

that covers a ton of stuff in 20 mins

quaint mantle
chrome beacon
river oracle
grim ice
#

usually i just watch tutorials on 2x speed

#

but 2x isnt enough for this

drowsy helm
quaint mantle
chrome beacon
#

?scheduling

undone axleBOT
river oracle
uneven fiber
#

yes

drowsy helm
grim ice
#

ON SPOT

#

WOA

uneven fiber
#

i thought it would lol RIP

drowsy helm
#

yeah its clientside

grim ice
#

btw

uneven fiber
grim ice
#

isnt like

#

NEAT or whatever

#

an easier option

drowsy helm
#

it does trigger interact event tho sorta sucks

uneven fiber
#

Yeah I just thought intuitively it was talking about the player lol my b

river oracle
#

idk I only use scikit

drowsy helm
#

like when clicked

river oracle
#

I made an AI to fully predict my school lunch schedule

grim ice
#

can u give me an example

#

of how could it wor

#

k

uneven fiber
#

would using click event work?

#

wait acutally nvm

drowsy helm
#

yes but you have to wait for them to click it lol

river oracle
# grim ice can u give me an example

tbh I have no clue of the quality of this video but its short and if your cramming there is no time wasted especially if you only got like 20 minutes lmao any knowledge is useful for you at this point

#

🔥Start learning today's most in-demand skills for FREE: https://www.simplilearn.com/skillup-free-online-courses?utm_campaign=Skillup-AWS&utm_medium=DescriptionFirstFold&utm_source=youtube
This Scikit-learn tutorial will help you understand what is Scikit-learn, what can we achieve using Scikit-learn and a demo on how to use Scikit-learn in Pytho...

▶ Play video
uneven fiber
drowsy helm
#

nope

#

other inventories like chests etc, yes but not player inventory

uneven fiber
#

ok actually disaster let me find an event that would work

grim ice
#

tw

#

btw

#

if i wanna do smth like

#

rock paper scissors ai

#

i need to learn how to do

uneven fiber
#

public void onOpenInventory(InventoryOpenEvent event) {
if (event.getInventory().getType() == InventoryType.PLAYER)
}

#

thoughts?

grim ice
#

model selection

#

right

drowsy helm
#

you can do it but it will never trigger

uneven fiber
#

y

chrome beacon
#

Client side

uneven fiber
#

oh yeah

drowsy helm
#

opening the inventory just doesnt call any event

#

at all

uneven fiber
#

you said this lol

#

rip 😢

chrome beacon
#

Server has no idea if the player is in the inventory or not

regal anchor
#

except when you click in it

chrome beacon
#

Yeah

uneven fiber
#

savage 🤟

drowsy helm
#

would be very nice if mojang sent a packet for it

#

amongst many other things

uneven fiber
#

Im actually really suprised there isn't one

#

seems very useful

chrome beacon
#

They really don't need one for the game

uneven fiber
#

fair

drowsy helm
#

yeah but for devs specifically

regal anchor
#

you need to find another time to add your item to the inventory

drowsy helm
#

they do stuff for modders all the time

ivory sleet
#

Meh

ivory sleet
#

More like for datapack developers

drowsy helm
#

well in the past years moving more towards them yeah

regal anchor
tardy delta
uneven fiber
#

make it so that if a player opens their inventory an item is added to it

regal anchor
#

you already said that

uneven fiber
#

when they open their inventory for example a berry or block or whatever is put into their inventory

#

thats it

regal anchor
#

can't you add the item at another time like before that ?

drowsy helm
#

i mean if its always gonna bethere when they open their inventory

#

just make it permanently in their inventory

regal anchor
#

yes

uneven fiber
#

oh i see

regal anchor
#

unless there's a situation you don't want the item to be in the inventory, which is why I wanted more explanation

uneven fiber
#

so your saying for go the event entirley and just add it

drowsy helm
#

yeah pretty much

#

but have a way so they cant modify or move the item

#

then you should be good

uneven fiber
#

ok thanks twins 🤞

regal anchor
#

if the item has to be in the inventory the all time you can add it in the PlayerJoinEvent

uneven fiber
#

Here is the entire task i was told to do

#

the way it was worded im assuming it is when they open the inventory

#

but im not sure

drowsy helm
#

to me that sounds like make a chest gui

regal anchor
#

"an inventory"

uneven fiber
#

holy shit lol your right

#

LMFAOOO

drowsy helm
#

lmao

uneven fiber
#

thanks twins

regal anchor
#

you probably missed it cause it's number 13

#

bad luck

uneven fiber
regal anchor
#

can't wait to see the fourteenth task

tardy delta
#

uh

drowsy helm
uneven fiber
#

Develop a plugin where if you shift 10 times in 5 seconds(after 5 seconds it expires), you will explode.

#

thats number 14 lol

drowsy helm
#

what sorta plugin is this lmao

tardy delta
#

just a runnable

uneven fiber
#

idk he gave me fifteen tasks and was like do these and i'll hire yo ass so im doing them 💯

regal anchor
#

I'm guessing it's not very well paid

drowsy helm
#

Or not paid at all

uneven fiber
#

idk im just bored during the summer so im doing this 💯

#

better to have some coding stuff on my resume if im applying to a computer science program for college

regal anchor
#

"Minecraft, level : expert"

uneven fiber
drowsy helm
#

i have like 4 java jobs behind my belt and they didnt accept me into uni lol

uneven fiber
#

do u live in america?

#

it may be more competitive where your at

drowsy helm
#

Do yoy have a mediocre meme for every situation

#

Nah australia

regal anchor
#

where I am it's less competitive there either is uni that accepts everyone or the schools that just look at math grades

#

also uni is free

grim ice
#

ok so

#
  1. what iis a multilayer config
  2. what is a seed
  3. what is a l2
  4. what is it XAVIER or weightInit
  5. what is adam or an updater
  6. what is a convolution layer and what is a stride and a nOut
  7. what is an activation
    8, what is a kernelSize
    9 what is a softmax or a lossfunction
regal anchor
#

easy

#

xavier and adam are names

tardy delta
#

whats that

grim ice
uneven fiber
#

when i open the chest added to the player inventory

#

oh shit a brotha using the wrong event 🤦‍♀️

#

used an inventory open instead of click

vague swallow
#

What event get's triggered if you put an item into your offhand IN your inventory?

tardy delta
#

inv click probably

quaint mantle
#

what would I put in place of "plugin" here?

tardy delta
#

your plugin's instance

#

?di to get it

undone axleBOT
regal anchor
humble tulip
#
@EventHandler(priority = EventPriority.HIGH)
    private void onRightClick(PlayerInteractEvent event) {
        if (event.getAction() != Action.RIGHT_CLICK_AIR && event.getAction() != Action.RIGHT_CLICK_BLOCK)
            return;

        event.getPlayer().sendMessage(event.getAction().toString());
        event.getPlayer().sendMessage(String.valueOf(event.getItem()));
    }
#

why doesnt this get called when the action is right click air?

#

and it's called twice when it's right click block

#

1.18.2

#

built abt a week ago

#

it does

fallow violet
#

my bad

humble tulip
#

i figured it out

fallow violet
humble tulip
#

right clicking air with nothing doesnt call playerinteractevent

regal anchor
#

air with nothing means no interaction so not an interactevent ?

fallow violet
#

he already got it...?

humble tulip
#

still calls it twice when i right click a block tho

fallow violet
#

you have 2 messages?

humble tulip
#

yep

#

for 1 click

#

ill output the time in millis

#

1 sec

fallow violet
#

2 messages

humble tulip
#

no i mean

fallow violet
#

ah

humble tulip
#

when i have an item i see

fallow violet
#

only one time if you have an item?

humble tulip
#

yes

#

but 2 with nothing

fallow violet
#

and no item twice?

#

weird

humble tulip
#

yep

#

u can test it for urself the code is there

fallow violet
#

i'll copy code and try to find the mistake

humble tulip
#

ye

fallow violet
#

java 17 or 18?

humble tulip
#

um not sure

#

but would that matter?

#

i think 17

fallow violet
#

i dont think so

buoyant viper
# fallow violet 2 messages

i was abt to joke about how u had a toString and then a String.valueOf until i realized its probably for null safety

regal anchor
#

omg is java 18 a thing lol

regal anchor
humble tulip
#

that's what i thought

fallow violet
#

same after that

humble tulip
#

did u run it?

fallow violet
#

i must craete a project real quick

humble tulip
#

literally called 1 ms apart

fallow violet
#

xd

#

one tick

humble tulip
#

no 1 ms

fallow violet
#

well yes

humble tulip
#

that's in the same tick

fallow violet
#

yeah i got it

#

im about to create my Main class

humble tulip
#

ok ty for testing for me

#

im so confusion

fallow violet
#

creating lsitener...

#

your welcoem

wind tulip
#

Anyone know how to get an item's nbt?

fallow violet
vague swallow
#

What is the int of the offhand slot?

wind tulip
#

index 40

vague swallow
#

ty!

fallow violet
#

good to know actually

#

alright

humble tulip
#

so...

fallow violet
humble tulip
#

so a bug?

fallow violet
#

well maybe

#

but maybe there is a dumb solution for us xd

humble tulip
#

gonna throw exceptions ig to see where it's being called from

fallow violet
#

i know why

humble tulip
#

why?

fallow violet
#

If you do this without an item it will trigger for Main and Offhand

humble tulip
#

OH

#

that makes sense

fallow violet
#

2 Seconds of google lmao

#

but i cannot use #getHand()

humble tulip
#

i fixed it by doing a hand check as the pic says

fallow violet
#

how did you do the handcheck?

humble tulip
fallow violet
humble tulip
#

playerinteractevent?

fallow violet
#

yes

humble tulip
#

1.18?

fallow violet
#

yes

humble tulip
#

idk then

fallow violet
#

wow xd

#

do you use maven?

vague swallow
#

For me it's working with maven

fallow violet
#

wait

#

i found the issue

vague swallow
#

what was it?

fallow violet
#

BUT HOW its still working?

humble tulip
#

how is what working?

fallow violet
#

i installed 1.8.8 spigot

#

how the f*** is it working in 1.18?

humble tulip
#

was the server 1.8.8

#

because those methods are still there in 1.18

fallow violet
vague swallow
fallow violet
#

kinda funny

#

here is it

naive loom
#

anyone know how to fix not being able to see another player when teleported to another world?

fallow violet
#

What do you mean?

regal anchor
#

I'm trying to start a server that's a c/p of an example server but it c/p another server (which is in a different directory)

#

if someone has an idea I would appreciate it

fallow violet
#

what is the problem?

regal anchor
#

copy paste

#

I have two servers, server 1 and server 2 that have different maps

fallow violet
#

yes...?

regal anchor
#

the debug at the beginning shows me it's server 1 path being copied

#

but when I log in it's server 2 map

fallow violet
#

well maybe its like a plugin. If you delete it while the server is running, it still works. Because the server make a temporarily backup of it and runs that.

#

You need to restart the server after that maybe

#

but if you restart the server will maybe override your 1 map to the 2 map

regal anchor
#

restart what server ? I don't understand

fallow violet
#

well its a plugin right?

regal anchor
#

yes a BungeeCord plugin

#

copying spigot servers

fallow violet
#

yes

#

and the server is offline while that?

regal anchor
#

both example servers 1 and 2 are off

fallow violet
#

and its copied?

regal anchor
#

it's always copying server 2 map regardless the path I'm putting

#

if I put server 1 path it copies servers 2 if I put server 2 path it copies server 2

fallow violet
#

maybe it never copies?

regal anchor
#

I tried starting manually server 1 btw and it works

fallow violet
#

wait what?

#

its working now?

regal anchor
#

if I start manually server 1 and log, it's server 1 map so no problem

#

if I start with the code it's server 2 map even tho debug says server 1 path

vague swallow
#

is there a way to view the inventories of offline players?

regal anchor
fallow violet
regal anchor
#

yea that will be tough to solve

#

I can add to the github if anyone is interested

fallow violet
#

sure

regal anchor
#

what's your github username ?

fallow violet
#

Fluffeliger

vague swallow
vague swallow
fallow violet
#

xd

regal anchor
#

is KN your profile pic ?

fallow violet
fallow violet
regal anchor
#

done

wind tulip
fallow violet
#

nope

fallow violet
wind tulip
#

what does it return then

fallow violet
#

An EquipmentSlot

#

like it is there

fallow violet
regal anchor
fallow violet
#

wait

#

ah sorry

#

im dumb

wraith marsh
#

how do i disable Objects.requireNonNull

fallow violet
#

wdym?

wind tulip
fallow violet
#

we solved it

wind tulip
#

lol rip

#

anyway, anyone know how to get the nbt of an ItemStack?

fallow violet
wraith marsh
#

in intellij when you type something that can create a null it annotates it

#

example:

fallow violet
#

you can it just warns you

#

but its better to have

wraith marsh
#

but how do i disable it

#

its pretty annoying

fallow violet
#

wait let me just open IntelliJ

wraith marsh
#

i disabled everything that has RequireNonNull in annotations and inspections

#

and nothing worked

fallow violet
#

oh

#

well

#

i cannot help then

wraith marsh
#

this should be it but it doesnt disable it

fallow violet
#

idk

wraith marsh
#

oh well i just got another problem that actually has to do about development

#

when i put more than 3 commands in onEnable the commands after just return the description of the command rather do what it has to do

fallow violet
#

do you put them in the plugin.yml?

wraith marsh
#

ye

wraith marsh
fallow violet
#

show me the plugin.yml please

#

?paste

undone axleBOT
wraith marsh
#

wait i didnt put some of the commands in plugin.yml

#

one sec

fallow violet
#

lmfao

wraith marsh
#

ironic

fallow violet
#

:>

wraith marsh
#

still doesnt work

#

i did add it in plugin.yml before

#

none of the commands work anymore?

fallow violet
#

show me it

wraith marsh
#

oh error

fallow violet
#

nevermind

wraith marsh
#

ironic x2

fallow violet
#

xd

wind tulip
fallow violet
#

wait let me open IntelliJ the 1.000 time

wraith marsh
#

ok so im getting an error: java.io.IOException: No such file or directory
im gonna paste the onEnable code and the file class in a minute

fallow violet
#

sure

fallow violet
#

And the error?

wraith marsh
#

yeah its a runtime exception

#

in the oneneable method

fallow violet
fallow violet
wind tulip
#

I need it as a string

fallow violet
wind tulip
#

the nbt

#

I need the nbt as a string

wraith marsh
wind tulip
#

can I just parse it directly?

wraith marsh
#

its in the link

wind tulip
#

(to a string)

fallow violet
wind tulip
#

I figured, but I'm asking what it is called, because I can't find it in the docs somehow

fallow violet
#

i dont know exactly just try it

wind tulip
#

imma just try .toString()

fallow violet
#

i cannot find an error

wraith marsh
#

runtimeexception at lin 41

#

21*

#

thats what causing the error

#

so its something in the file class

#

but i cant figure out what

fallow violet
#

what is line 21?

wraith marsh
#

i sent you 2 links

fallow violet
#

yes

#

wich of this is line 21

wraith marsh
#

first one is main class and second one is the file class

#

and the main class at line 21 throws the error

fallow violet
#

oh

#

got it

#

please send me the whole error

#

from start to end

crude estuary
fallow violet
#

what?

wraith marsh
#

yes

crude estuary
#

oh

fallow violet
#

there is your mistake

#

thats why the whole error can help :)

fallow violet
#

yeah

#

so your problem is =>

#

Exactly

#

no file or directory

wraith marsh
#

yes

fallow violet
#

yes

crude estuary
#

then Fix it

wraith marsh
#

but im creating it in acces.setup()

#

but it doesnt seem to be working

fallow violet
#

do you see your file yourself in your explorer?

wraith marsh
#

playerdata = file class
dinnerchad = main class

fallow violet
#

what? No

#

i mean do you see your created file

wraith marsh
#

wdym explorer?

fallow violet
#

this little thing on windows

#

where you can see your files

wraith marsh
#

yes im uploading it to my server

fallow violet
#

then your server

wraith marsh
#

thats why i get an error

#

lmao

fallow violet
#

okay go to your server plugin folder

#

look if there is the file

#

is it?

crude estuary
fallow violet
crude estuary
#

Just Install Arch

#

i use Arch btw

wraith marsh
#

im not a toddler i know what im doing
ive been coding for a week and everything has gone perfectly
i am simply asking for help for this one error im getting that i cant figure out why it throws an error in the first place

#

not being aggressive btw lol

fallow violet
#

Maybe @crude estuary has an answer :>

crude estuary
#

Maybe but i'm Busy Stealing Club Penguin Assets to Make my Own

fallow violet
#

Love it

wraith marsh
#

this clearly isnt a help for development channel

fallow violet
#

okay okay

#

im sorry

#

so

crude estuary
#

It is, we do what we Can

fallow violet
#

your problem now => Your file isnt there? Right?

wraith marsh
#

alright lemme rephrase everything ive been writing

fallow violet
crude estuary
#

catly i love Cats

fallow violet
#

xd

fallow violet
wraith marsh
#

so im getting an runtime error: no such file or directory
im basicaly trying to create a file called "playerdata.yml" in the file class i sent
the main class is calling the setup() method in the file class but still throws an error

#

and also if the plugin file was not in the plugins folder it would not give an error

fallow violet
#

im not sure but maybe its because you done a "," ?

wraith marsh
#

no

#

its to name the file so i can create it

crude estuary
#

Watermark. just use md5's Paste

fallow violet
#

?paste

undone axleBOT
wraith marsh
#

lmao ill just ask on the spigot website

fallow violet
#

alright my lord

crude estuary
#

Good Luck

#

?learnjava

undone axleBOT
fallow violet
#

PbtGamer what are you stealing right now?

crude estuary
#

The Fair FLAs

desert loom
wraith marsh
#

i also thought of that

crude estuary
wraith marsh
#

any way i can create it?

fallow violet
#

ouf

crude estuary
#

if you want to keep Talking, tell me on General

desert loom
#

you can get the parent file of the file and call mkdirs on it.

#

that should work I believe

wraith marsh
#

the actual folder of the plugin doesnt exist yet

#

should i just put getConfig().options().copyDefaults(); saveDefaultConfig(); before the custom file?

desert loom
#

yeah

wraith marsh
#

alright ill try

wraith marsh
wraith marsh
#

thanks

#

that looks pretty useful thanks for the link :D

desert loom
#

np

wraith marsh
#

and my plugin seems to be working thanks for helping me out

wind tulip
#

@fallow violet do you know how to do it with NMS?

fallow violet
#

do what? @wind tulip

wind tulip
#

I don't want nbt tags

#

I want pure nbt

fallow violet
#

pure nbt? Like if you run the /data command?

regal anchor
quaint mantle
#

Hey, I want to break a block for only one player and still make sure that player can move through the broken block, what's the easiest way to do this?
I've been looking at using ProtocolLib but I'm a total noob and have no clue how to and no threads online seem to have the perfect answer for me

crude estuary
fallow violet
quaint mantle
#

Yes but also passable, like when using sendBlockChange and setting the block to air the player can not move through the block

fallow violet
#

so its only gone for him?

kind hatch
quaint mantle
#

Yeah

regal anchor
#

Simple installation and still arch

lethal python
#

has anyone used h2 database with spigot

#

i need some help :x

fallow violet
#

i have

crude estuary
fallow violet
#

i use it right now

lethal python
#

ok is it ok if i send you a screenshot of a question i put in another server

fallow violet
#

sure

#

you can also dm me if you want to

quaint mantle
#

hello! I was wondering how I could acess the main class (Banevade) in this schedular. This is not an event class that implements listener.

fallow violet
#

in your main class make a static variable with hte instance and set it in the onenable. Then you can do Main.instance

kind hatch
#

Or pass an instance of your main class through via dependency injection.

quaint mantle
#

Ill give it those methods a shot

quaint mantle
sullen dome
#

basically

quaint mantle
#

Yes

fallow violet
#

you can make it private and make a method. Looks better

humble tulip
#

does anyone have a config updater utility something that i can quickly steal?

sullen dome
#

would be good to make it private and create a getter tho

#

so people don't annoy you about it

fierce swan
#

I'm coding a plugin for a 1.12 server and I'm attempting to use Player#teleport to teleport a player between two identical worlds. (Don't ask why, long story)
My biggest problem is if someone is crouched between two blocks you couldn't normally get in between without crouching, or in the case of closed fence gates or sometimes with vines or such, they get teleported to the lowest "safe point" above where they're standing, which people can abuse to get out of the map.
I'm not sure if this is an Essentials thing or if it's something spigot does but Player#teleport will not allow players to teleport to places it deems "unsafe" and I want that not to happen. Is it Essentials messing with it or is it an inbuild Spigot thing, and if so, how do I fix it?

#

There's really no code to show because the problem lies in the teleport function itself and how to handle it but

kind hatch
#

Pretty sure that's an essentials thing.

fierce swan
#

I'm assuming I'd have to take this over to #help-server then? Because I need to figure out how to override it and remove that feature

sullen dome
#

spigot itself doesn't block any teleports

fierce swan
#

I figured as much, because that would be kind of silly

sullen dome
#

exactly

#

if you like to, you can teleport a player to y500000000000000000

#

which will most likely crash the client, but you get the point

kind hatch
sullen dome
#

doesn't essentials have a discord?

fierce swan
#

Do they?

sullen dome
#

i mean

#

every big plugin has i guess

kind hatch
#

Is it essentials or essentialsx?

bright jasper
#

I've seen some plugins do this thing where it will automatically rotate the players head slowly to look at a point (also the screen fades during this) and prevents the player from turning their head away while an interaction is going on. How would this be implemented

kind hatch
#

Cause I think essentialsx only supports back to 1.16.5 and is about to drop that soon anyways.

regal anchor
#

What does essentials have to do with the spigot teleport function you use in another plugin?

fierce swan
#

I think it messes with the PlayerTeleportEvent

#

I just found the teleport-safety option in Essentials and I'm gonna try to see if that'll fix it

#

I just wanted clarification that it's 100% not spigot and it seems like it's not from your guys' reactions so

sullen dome
#

ngl, if essentials messes with teleports from other plugins, thats kinda dumb

regal anchor
#

Why do u use essentials as a developper