#help-development

1 messages Β· Page 1826 of 1

olive lance
#

yeah

ivory sleet
#

it will basically just loop thru every class and try to find the class which derives their base class

#

since its expected you wont have a spring library shaded inside that expansion

eternal needle
#

is it some one from norway that want to help me to learn java and make plugins?

ivory sleet
#

im from Sweden

eternal needle
#

that works

#

but do you want to?

ivory sleet
#

Idk, if you know English decent, then in principle

#

?learnjava

undone axleBOT
ivory sleet
#

^ might wanna check that out buddy

#

I probably need to update it

chrome beacon
#

I'm here too if you need any help

ivory sleet
#

but should be adequate

#

😌

eternal needle
#

thx

olive lance
ivory sleet
#

wym?

quaint mantle
#

so, i guess you have two jars: actual plugin and papi extension

ivory sleet
#

well you dont, but your expansion jar should (hopefully) be operating lazily

quaint mantle
#

Or do i miss something

olive lance
#

yeah thats it

#

i assume it will get put in the plugins folder

#

But i have no idea how loading plugins works

ivory sleet
#

well yeah idk also

#

might be the case papi loads the expansions when it bootstrap itself

quaint mantle
#

Make your papi extension a plugin too

ivory sleet
#

but instantiates the classes once startup has taken place

quaint mantle
#

in plugin yml make it depend on your main plugin

ivory sleet
#

actually let me go and look at papi source

quaint mantle
#

Oh wait

olive lance
#

I tried cant extend 2 classes

#

i could do another class ig

#

the tutorial didnt have any extension of javaplugin though

quaint mantle
#

Oh i didnt think about extensions you download from papi ecloud

ivory sleet
#

oh geegeetom

#

it tries to load on ServerLoadEvent

#

if ServerLoadEvent is not present (like the class, due to legacy version) then it will just schedule a task to run once startup has taken place

#

and that event ftr, fires once the startup has taken place

olive lance
#

ServerLoadEvent is when startup is complete?

ivory sleet
#

yes

olive lance
#

ah ok

ivory sleet
#

or after reload

olive lance
#

ty

ivory sleet
#

basically you're safe :p

olive lance
#

i am too lazy to make my plugin not break on /reload

#

so i just give a huge red message

ivory sleet
#

I mean I just implement whatever I can do as a plugin maintainer in onDisable

#

but if it still breaks

#

Idc

olive lance
#

yeah i have ondisable all good for normal server stop

#

but my onenable is set up for nobody being online

olive lance
#

so no one gets put in their faction

waxen plinth
#

It's really not hard

olive lance
#

its honestly such a easy fix

waxen plinth
#

And usually if a plugin isn't reload safe it means it's not doing something on shutdown that it should be

olive lance
#

nah just startup for me

#

if people relog it works

#

i just dont do anything with online players on enable

waxen plinth
#

Why

olive lance
#

idk

#

it would really take 1 line to fix

waxen plinth
#

Making a plugin reload safe is a huge plus

#

Easier testing

#

You can hotswap on a live server to update a plugin without restarting and players won't notice a thing

#

It has saved my ass so many times

olive lance
#

yea ill add it to my list

quaint mantle
waxen plinth
#

I almost never get that

#

Except when using my plugin manager to reload itself lol

grim ice
#

should I use MySQL for player auctions

waxen plinth
#

Does it need to sync across multiple servers?

#

Or just one

quaint mantle
#

Use what you want

waxen plinth
#

If only one then use sqlite

#

Otherwise use mysql

quaint mantle
#

sql is a standart

waxen plinth
#

Because MySQL is much heavier and slower

olive lance
#

me using flat file storage

grim ice
waxen plinth
#

It scales better and can be multithreaded though

quaint mantle
#

And much efficient when you operate on lots of data smh

waxen plinth
#

Yeah use sqlite

grim ice
#

well across multiple

#

its a bungeecord

#

network

waxen plinth
#

Ok then mysql

#

πŸ™ƒ

quaint mantle
#

It is not hard to maintain both

grim ice
#

thank you

waxen plinth
#

Be careful though

grim ice
#

Do I need good skills of MySQL btw

waxen plinth
#

Make sure you don't allow stuff like 2 players buying the same item at the same time and both getting it

#

Yes you should be good with mysql

#

It's not hard to learn though

quaint mantle
#

Learn the basics

solid cargo
#

yo what is a good way of getting rid of the long string of location to just the location: i wanna convert from what shown in the image to just simple ints. is that possible?

olive lance
#

the hardest part of database class was making an ER diagram

quaint mantle
#

sql is relatively simple

waxen plinth
#

Are you not able to just like

grim ice
#

Im following a tutorial to better my skills right now

olive lance
#

Location.getX

#

etc

solid cargo
#

ok thanks

grim ice
#

but its from 2017

waxen plinth
#

l.getWorld().getName() + " " + l.getX() + " " + l.getY() + " " + l.getZ()

solid cargo
quaint mantle
#

Sql is, like, from 1995

#

9r even older

olive lance
#

nah like 1975 i swear

#

or maybe older

grim ice
#

and hes using netbeans

#

im almost throwing up but this is how life works

chrome beacon
#

I used Netbeans in school

olive lance
#

1970

sharp badge
#

Can someone tell me the path to my main from here, I've tried everything and I can't get it to work lol. Main class is AutoMiner

I've tried:
net.test.autominer.AutoMiner
java.net.test.autominer.AutoMiner
https://i.imgur.com/sYfm2fu.png

waxen plinth
sharp badge
olive lance
#

i forgot how java worked for a sec wasnt sure if it would have that variable if i never instantiate an object of the class

hollow bluff
sharp badge
hollow bluff
#

there ya go

sharp badge
#

that's what it was, it didn't work lol

waxen plinth
#

You forgot net.

sharp badge
#

I've tried so many different things πŸ˜‚

hollow bluff
#

net.test.autominer.AutoMiner

sharp badge
#

sec, I think I tried that, I've been messing with it for a minute

hollow bluff
#

Make sure its spelled correctly and with the correct capital and lowercase letters

sharp badge
#

org.bukkit.plugin.InvalidPluginException: Cannot find main class `net.test.autominer.AutoMiner'

#

I've even gone up the hierarchy:
net.test.autominer.AutoMiner
java.net.test.autominer.AutoMiner
main.java.net.test.autominer.AutoMiner

#

Checking my build settings now

#

Maybe it's something related to that

trail lintel
#

Hey guys, so I have made a custom item, given it a custom recipe, and added an event listener for right click. Is there any way to make the item available to /give? It doesn't seem to be "registered" in any way

hollow bluff
sharp badge
hollow bluff
trail lintel
#

is that the only way?

#

would be nice to have it like a "real" item

sharp badge
#

You could make your custom items just variations of "real" items, ex: if it has a specific durability do x

trail lintel
#

Hmmm thats true, but then to get said item I would need to do some weird /give stick[durability=1000] <- psueduocode

sharp badge
#

If I'm not mistaken, you won't be able to add it to /give any other way

trail lintel
#

totally fair, I want it to be a craft only item anyway and quite expensive

#

was just curious =]

vernal thunder
#

This isn't showing all the classes for 1.17.1 for some reason

umbral spindle
#

Lets say I have a command
/Test
You run it and it sends you a message of whatever num is set to, how would I make it so it adds 1 to num every time the command is ran and it wont reset.

sharp badge
earnest tulip
#

for some reason when i try to cancel EntityAirChangeEvent it doesnt work

visual tide
#

?maven

undone axleBOT
visual tide
#

neat i just guessed that would be a command

vernal thunder
#

That doesn't include NMS?

visual tide
#

use buildtools for nms

umbral spindle
vernal thunder
#

I did

visual tide
#

run buildtools for your version

sharp badge
vernal thunder
#

I ran Buildtools

visual tide
vernal thunder
#

got myself the jar, put it in the /lib/ folder

visual tide
#

noono

vernal thunder
#

ah

visual tide
#

make sure youve run it for the proper version

dusty sphinx
#

With hikari, do I need to release connections back to the pool somehow?

sharp badge
vernal thunder
#

That's a good sign i guess

visual tide
#

does that exist in 1.17.1?

earnest tulip
visual tide
#

?paste

undone axleBOT
earnest tulip
#

oh ty

vernal thunder
#

@visual tide This is what someone else used

#

idk how gradle works tho

crisp forum
#

I need to use database to store basic datas, what is the most basic option?

visual tide
#

ngl im not sure how to do that in newer version

vernal thunder
#

Dangit

visual tide
#

@ivory sleet

#

how reobfuscate nms in 1.17

visual tide
#

to transform it back into obfuscated nms

vernal thunder
#

dangit

visual tide
#

but idk which plugin it is

tardy flame
#

What do you mean?

solid cargo
#

im asking here since the skript api thing is dead as a dessert: do i need the curly braces for the variable?

#

to get the variable ofc

tardy flame
vernal thunder
visual tide
tardy flame
#

^^

minor garnet
#

is there any method or better away to get to catch the entity the player is seeing?

vernal thunder
#

kk, i'll try it out

#

That worked @visual tide

#

Thank you bro

earnest tulip
#

EntityAirChangeEvent event.setCancelled(true) not working

minor garnet
#

yes but how i detect if ray trace hit an entity?

crisp arch
#

maven special sources is only generating 3 jars, anyone know why/

#

i need the remapped.jar, not the remapped-obf.jar

minor garnet
#

is there a way using nms to detect if a ray3d hit a bouding box

tall dragon
#

@minor garnet im pretty sure you can just use World#rayTraceEntities

minor garnet
tall dragon
#

ah

minor garnet
#

I'm trying to find a way to do this

hybrid spoke
minor garnet
#

I would do something similar to be able to detect the bouding box and get the player

#

I would use this for two projects, one for weapons and one for ground loot

tall dragon
#

?paste

undone axleBOT
minor garnet
minor garnet
tall dragon
#

i did that for myself

#

wut

minor garnet
#

what exactly do you did

minor garnet
tall dragon
#

yea i proposed this too ^

minor garnet
#

im trying using nms classes, vec3d and bouding box

sharp badge
#

How would I go about getting all chunks in a cuboid?

minor garnet
tall dragon
tardy delta
mellow gulch
#

i noticed that sqlite update statements (prepared statements) are a lot slower in 1.18.1 in my plugin, does anyone know what might have changed or steps i should take to rewrite my code?

crisp arch
#

anyone know how to change the build location of specialsources?

golden turret
#

how could i detect if the player deleted an item using the creative mode

tidal hollow
#

How can I make a blaze immune to projectile damage?

mellow gulch
# waxen plinth Do you have autoCommit on

thanks for the response.
ya, while i was waiting for a response i started playing around with autocommit. so far it seems like that's the cause of the slowdown.
for whatever reason autocommit is just a lot slower now than it was in 1.16.X.

golden turret
#

get the damage event

#

and cancel?

rough drift
#

Can you set max health/health of offline players or nah?

golden turret
#

no?

#

but you could store their health when they log off

waxen plinth
#

Just disable it entirely and commit every 5 minutes or so, that's what I do

#

SQLite with autocommit off is blazing fast

mellow gulch
waxen plinth
#

You can just do commit() you know

mellow gulch
#

ofc

#

this just seemed like the least intrusive patch to my plugin

hybrid lake
#

Hey πŸ‘‹
Is possible to handle spaces between arguments in command?
For example: /command arg arg

fast onyx
#

there are an existing api that supports send titles with 1.12-1.18?

#

ig no one supports 1.18

mellow gulch
fast onyx
#

searching for an api ifs posibble

chrome beacon
#

Spigot is an api

#

Why not use it

fast onyx
#

i didn't mean that

opal juniper
#

spigot has a title api ?

chrome beacon
#

Yes

mellow gulch
#

2 of them right there, i recommend not using the deprecated one

unkempt peak
hybrid lake
earnest tulip
#

can someone help me, i made a thread but no one responded πŸ₯²

fast onyx
#

i can see that the deprecated one is the same as 1.8 so if i use it then 1.8 and 1.18 versions will work with the title?

mellow gulch
chrome beacon
mellow gulch
#

i see, ok then

unkempt peak
hybrid lake
#

yeah

unkempt peak
#

Ok is it the last argument?

hybrid lake
#

yeah, now i have this String.join(" ", args)

unkempt peak
#

As long as the text is the last argument all you have to do is loop from the starting arg to the length of args - 1

#

and add each arg to a string with a space between each arg

hybrid lake
#

/command arg arg = still 2 args

unkempt peak
#

So if your text starts at args[1] you could do something like

for (int x = 1; x < args.length;x++) {
if (x == 1) text = args[x];
else text += " " + args[x];
}
hybrid lake
#

but in a bukkit, space does not count as an argument

#

:/

unkempt peak
#

yes

#

that's why you add a space between each arg in the string text

hybrid lake
#

yeah i know, but i need more than one space

#

for example

#

/command text with two spaces, now with one space

unkempt peak
#

unfortunately I don't think there is really an easy fix for that

mellow gulch
#

you could have the command expect " text to be in quotes"

mellow gulch
#

darn

unkempt peak
#

I don't think that solves anything it would still not count the extra spaces as args

#

only solution i can think of is using _ for space

#

so /command text text__with__two__spaces

#

And then just grab the arg and do String.replace("_", " ")

hybrid lake
#

but when i want to send message this is character _?

mellow gulch
#

\_?

hybrid spoke
#

you wont get far with it. you only get the already modified arg strings

unkempt peak
#

Use an escape symbol like java does

#

/_

hybrid spoke
#

you will have to go deeper.

#

maybe the commandpreprocessevent will give you the exact string after the command

unkempt peak
#

Yeah actually there is a getMessage method in that event

#

So maybe you could store the current comand message in a yml and then onCommand for each player get that message and use it

hybrid lake
#

but i need to handle command from console, but preprocessevent is only for players

mellow gulch
#

what are you actually trying to do with the command?

unkempt peak
#

broadcast a message with multiple spaces in-between words

young knoll
#

Can’t you just join all the args to get the message you want

mellow gulch
#

spigot/bukkit doesn't support "" as an arg does it? hmm

unkempt peak
#

No becasue they want to support multiple spaces

hybrid spoke
hybrid lake
#

bukkit handles multiple spaces only as one space

#

/command a b c = /command a b c

mellow gulch
#

you could perhaps do some sort of syntax like _#_ where # is the number of spaces you want then parse those args to composite your message together

hybrid lake
#

but i need it user friendly, i think replacing chars isnt user friendly

mellow gulch
#

but that's really nonsensical

#

ya

#

idk, i think using _ and \_ for _ literals is probably the best option

young knoll
#

I know brigadier supports commands using β€œ β€œ

#

But I don’t think spigot does

flat kelp
#

Can someone please help i don't know where i am going wrong with this
Why does this:
String id = String.valueOf(auction.getAuction().getString("auctions." + playerId + ".itemID."));
System.out.println("ID: " + id);
Output this:
[AtlanticPrisons] [STDOUT] ID: MemorySection[path='auctions.f86f501a-0c94-4aa6-8753-e96373406046.itemID', root='YamlConfiguration']

unkempt peak
#

Maybe if you really want it to be user freindly you can use the preproccess event for players and the _ method for console

young knoll
#

Try a command framework that hooks brigadier

granite burrow
#

so I was looking into making custom blocks, and I made my own model that works on the blocks, however when I try to assign it to a special block using:
{"predicate": {"custom_model_data":1234567}, "model": "block/creeper_totem_pole"} it doesn't seem to work. I tried to use meta.setCustomModelData(1234567); and it doesn't seem to do anything, any ideas?

young knoll
#

Blocks do not support custom model data

granite burrow
#

oh, how can I give a block a custom data value?

young knoll
#

The only way to make custom block textures is to replace states of existing blocks

#

Noteblocks and mushroom blocks are the common choice

granite burrow
#

so I cant have a new block?

young knoll
#

A brand new block, no

#

You can also use armor stands or spawners, but that is much laggier

#

Noteblocks are generally the way to go

granite burrow
#

dam that sucks

worldly ingot
#

noteblocks and mushrooms, yeah

#

They have the most states

young knoll
#

Noteblocks have like 800

#

Mushroom blocks have 160 ish?

worldly ingot
#

Mhmm

granite burrow
#

I don't wanna change any existing block, ill have to figure something out

young knoll
#

Origin realms has shown that tripwire and leaves can work too

waxen plinth
#

How could I make my sources jar include the sources of libraries I depend on?

echo basalt
waxen plinth
#

I've got RedLib, which shades RedCommands

echo basalt
#

the armorstand would have the custom block on its head

#

πŸ€”

young knoll
#

Yeah the armorstand or spawner method works great for like, custom machines

#

But not building blocks

waxen plinth
#

I want people to be able to view docs of RedCommands in their IDE if they are depending on RedLib

#

But currently that's not happening, and I think I need to include RedCommands' sources in the RedLib sources jar

echo basalt
#

you could also use blocks that no one uses

#

like sponge

young knoll
#

There are technically 2 unused blocks in vanilla now iirc

echo basalt
#

or structured blocks

young knoll
#

Maybe 3? A few of the ores only appear in one form

#

But both exist as blocks

waxen plinth
#

Show config

flat kelp
# waxen plinth Show config
auctions:
  auctionID:
  - f86f501a-0c94-4aa6-8753-e96373406046
  f86f501a-0c94-4aa6-8753-e96373406046:
      qgKb07:
        amount: 1
        cost: 5
        expiresIn: 1
        sellerName: Optic7409
        meta: rO0ABXcEAAAAAXNyA```
waxen plinth
#

I don't see any itemID property in here

flat kelp
#

ah see i removed it as that was from a bit ago lemme get the newest

#

and i am just outputting id

#

but its showing as ID: MemorySection[path='auctions.f86f501a-0c94-4aa6-8753-e96373406046.itemID', root='YamlConfiguration']

flat kelp
karmic grove
#

how do you change a players skin server side only

#

like nick on hypixle

dusty sphinx
#

How can I add Map to a List in a configuration? java final @NotNull List<Map<?, ?>> existingList = this.getConfig().getMapList("channels"); // Not thread safe! existingList.add(chatChannel.asHashMap()); this.getConfig().set("channels", existingList);

#

this is my code rn but it doesnt work

#

it throws a nullpointer whenever i try to read it back

#
public record ChatChannel(@NotNull String name, boolean sameWorld, int distance) {
    public ChatChannel(final @NotNull String name, final boolean sameWorld, final int distance) {
        this.name = name;
        this.sameWorld = sameWorld;
        this.distance = distance;
    }

    /**
     * Constructs the {@link ChatChannel} as a {@link HashMap} that can be added to the configuration.
     *
     * @return A {@link HashMap} representing the {@link ChatChannel}.
     */
    public @NotNull HashMap<@NotNull Object, @NotNull Object> asHashMap() {
        final @NotNull HashMap<@NotNull Object, @NotNull Object> hashMap = new HashMap<>();
        hashMap.put("name", this.name);
        hashMap.put("sameworld", this.sameWorld);
        hashMap.put("distance", this.distance);
        return hashMap;
    }
}
#

this is the ChatChannel class btw

somber hull
#

so im still a little new to the idea of an API for my plugin. But if i want to make an API for my plugin while hiding all the actual plugin code, how would that be done?
I assume you would just not include the stuff you dont want people seeing, but then wouldnt it just give errors since its trying to use code it doesnt have access to?
Or would that not happen?

lavish hemlock
#

Use interfaces to define API and then use classes implementing those interfaces for your plugin's implementation.

#

You can then only give the user the interfaces, as long as those interfaces don't depend on the implementation classes.

somber hull
#

got it

#

i think

lavish hemlock
#

e.g.

// Accessible to plugin devs/API users.
public interface User {
    String getName();
}
// Accessible to only contributors.
public class UserImpl implements User {
    private final String name;

    public UserImpl(String name) {
        this.name = name;
    }

    @Override
    public String getName() {
        return name;
    }
}
somber hull
#

got it

#

so just copy every class over?

#

does that include the main class?

lavish hemlock
#

You probably shouldn't do that for classes that don't need to be part of the API.

lavish hemlock
#

I actually don't know if it's a good idea to apply it to main class, as you'd likely need to use static or depend on the implementation in order to use it.

somber hull
#

Wait but doesnt it need the main class to be seen

#

Cause when you get the "plugin" isnt it getting the main class?

lavish hemlock
#

Yeah

#

I believe Spigot has a system for services though

somber hull
#

Ok

#

Thank you

#

I wont be needing to use this for a while, i was just curious

lavish hemlock
#

^ this can be used to provide API-specific classes

somber hull
lavish hemlock
#

You can use Gradle modules to separate API and plugin

#

I don't know how to do the same with Maven tho

somber hull
#

Yea, i dont use gradle

lavish hemlock
#

The reason for doing this is that it allows you to build two separate jars

#

One for API, which you can give to API users, and one for the plugin, which will also depend on the API and is given to server owners.

somber hull
#

thanks again lol

granite burrow
somber hull
#

Is there any reason why i shouldnt have this in the top of my main class?
public final NamespacedKey entityTypeKey = new NamespacedKey(this, "bs.entityType");

somber hull
#

Items yea totally

granite burrow
#

dang, cuz I want a custom block for my plugin but I can't get it into the game and I want it to be a physical block

somber hull
#

Pretty sure its just items tho

granite burrow
#

is there a way to give someone a conditional chain command block?

#

I can give a chain command block but im not sure how to make it conditional

karmic grove
#

Cant they change it when they place

buoyant viper
#

^

sterile token
#

Its possible to obfuscate only some clases using Superblaubeere obfuscator?

#

Or do you recommend another obfuscator?

upper niche
#

Duplicate drops on BlockBreakEvent

karmic grove
wooden fable
#

How to get the recent tps? Because ```java
MinecraftServer.getServer().recentTps

doesn't exist.
sterile token
karmic grove
sterile token
#

Any free obfuscator recommendation?

mellow gulch
#

would be neat to try doing custom obfuscation using an old scrabble set, a hat, and refactor/rename lol

robust forge
#

ExecutorService cant run submitted task for some server

earnest tulip
#

can someone help me i made a thread

sterile token
earnest tulip
sterile token
tidal hollow
#

How can I make a blaze immune to projectile damage?

sterile token
earnest tulip
#

cant u just listen to the event and cancel if its for instance an arrow

sterile token
#

Wouldnt that consume more resources rather than changing the properties?

earnest tulip
sterile token
earnest tulip
#

my mistake
what you were referring to was an example of NMS right?

sterile token
#

In other words dont talk with hard words :P

earnest tulip
#

i did not realize NMS was better on resources

#

but it makes sense

sterile token
#

I think every entity have properties

#

I will have to check

trail lintel
#

hey guys, is there a way to set custom model data from the java / spigot api side? I have a custom item I have made, and a resource pack to texture it, but I don't know how to tell the ItemMeta, or whatever is responsible, to use the specific model data I want

quaint mantle
#

nbt

#

custom model data is nbt

#

tho idk if spigot have support for that already

trail lintel
#

Hmmm I see, nbt being like resource packs and all that right

quaint mantle
#

no.

#

enchantments on items means that items have a enchantment nbt on it (if i remember right)

#

nbt will be handle by servers

#

the full name of it is uhh

trail lintel
#

So to do what I need here I will have to somehow edit the nbt of the item when it is crafted (I'm added a crafting recipe with Bukkit.addRecipe())

sterile token
#

use black google

quaint mantle
#

i use dark discord

#

but black google doesnt look fit to me

sterile token
#

I have all dark

#

Dark google, dark discord, dark windows, btwww

quaint mantle
#

wait itemmeta have this

#

spigot have this built in

#

so check it out

trail lintel
#

Ohhh looks like ur right!

#

Lemme see what I can do here

#

meta.setCustomModelData(10); thats all I needed!

#

I think my custom item will look right for my friends now πŸ˜„ thanks a bunch

earnest tulip
#

i think the Spigot API itself is bugged, ive been searching and it looks like this is an actual problem, people arent able to cancel the EntityAirChangeEvent in general

#

which sucks a lot

#

idk how u would report this

quaint mantle
#

jira

earnest tulip
#

?

quaint mantle
#

spigot has jira

#

bug tracker or something

#

on the dev hub

#

report it

earnest tulip
#

ohh

golden turret
#

not development related but, how do i override an item texture using the custom model data?

#

nvm, just forgot the parent

quaint mantle
median vine
#

How do I use spigot version 1.17 in my pom.xml file?

rough basin
#

What should i do to disable specified "LivingEntity" not drop items?

#

My snowman have Villager spawn egg in this head, and i dont want to drop it

golden turret
#

how do i add transparency to a texture?

#

how this is possible with the glass

hexed hatch
#

what are you using to make your assets

#

just put some transparent pixels in there by changing your brush opacity?

golden turret
eternal oxide
#

Alpha channel in your color

trail lintel
#

Any resource pack bois know what I'm doing wrong here? Trying to have a custom texture when an item has a given custom_model_data, but its just appearing as a purple and black cube.

ender_eye.json

{
  "parent": "minecraft:item/generated",
  "textures": {
    "layer0": "minecraft:item/ender_eye"
  },
  "overrides": [
    {
      "predicate": {
        "custom_model_data": 10
      },
      "model": "item/ender_bag.json"
    }
  ]
}

ender_bag.json

{
  "parent": "item/generated",
  "textures": {
    "layer0": "item/ender_bag"
  }
}
golden turret
#
{
    "parent": "item/generated",
    "textures": {
        "layer0": "item/cocoa_beans"
    },
    "overrides": [
        {
            "predicate": {
                "custom_model_data": 10
            },
            "model": "item/essences/low_essence"
        }
    ]
}```
#

try removing the minecraft:

#

and remove the .json

trail lintel
#

ohhh good idea! lemme give that a shot

drowsy bramble
#

where do i get the mongodb download or whatever?

#

cause the dependency isnt working for me

trail lintel
#

@golden turret That was it! the .json I have been struggling with this for nearly an hour you are a hero

golden turret
lethal coral
#

How can I use spiget (yes, the api) within my plugin?

somber hull
#

im getting a unsupported class error

#

with intellij

#

leme get it

#

this is when shading inventory framework into the plugin

#

my java version is 16.0.2

eternal oxide
#

wrong java version

somber hull
somber hull
quaint mantle
#

prob that framework

eternal oxide
#

You are probably trying to build for java 8

somber hull
#

let me find my settiungs

eternal oxide
#

If your framework is built for 16 you can;t shade it into a java 8 build

somber hull
eternal oxide
#

well, you can, but you can;t use it

somber hull
#

well, i beleive its in java 16

eternal oxide
#

whats in your pom?

somber hull
#
    <properties>
        <maven.compiler.source>16</maven.compiler.source>
        <maven.compiler.target>16</maven.compiler.target>
    </properties>
lethal coral
#

https://prnt.sc/23cn5k6
whenever I put this dependency in its own dependencies it doesn't yell at me but the moment I put it with the rest of them it goes red. (can't have two <dependencies> fields)

eternal oxide
#

show the full error

somber hull
trail lintel
#

doesn't mc require java 17 now?

ancient plank
#

1.18

somber hull
#

its a 1.16.5 plugin but i plan to update to 1.18 later

trail lintel
#

ahh gotcha

somber hull
#

its for my server

ancient plank
#

serber

somber hull
somber hull
#

when packaging

eternal oxide
#

I don;t use Intelij so I'd not see these errors

#

it clearly a version issue though

somber hull
#

what do you use lol

#

eclipse?

eternal oxide
#

Eclipse

somber hull
#

man, i used to use eclipse but i can never go back

turbid oasis
#

How do I create a void world?

somber hull
eternal oxide
turbid oasis
#

nothing I found online worked

somber hull
#

like i found stuff online

turbid oasis
#

oh

somber hull
#

so theres something out there

#

i gtg

turbid oasis
#

ok

#

thx

ancient plank
#

google is indeed a good skill to have

turbid oasis
#

anyways, how can I make a duels like system where the server teleports you into different worlds like Hypixel?

turbid oasis
#

nevermind

somber hull
lethal coral
turbid oasis
#

I edited the message sorry

sullen marlin
lethal coral
quaint mantle
#

that could be why LOL

lethal coral
quaint mantle
#

because, you may ask why, it didnt done resolve the dependency

#

you didnt reload the maven

#

so it is red

lethal coral
#

something isn't right here πŸ€”

somber hull
lethal coral
#

it's a rest api for spigot

somber hull
#

so it quto-updates to the latest spigot version?

lethal coral
#

it's used to get a ton of stuff from the spigot site (resources, information about the resources including authors, etc.)

#

doesn't really have to do with the server version

lethal coral
lavish hemlock
lethal coral
somber hull
#

i am still getting

#

everything is on java 17

lethal coral
somber hull
#

nvm

#

aha

#

i removed all others beside 17

earnest tulip
#

how does one directly increase swim speed for the player

lethal coral
#

I had an issue where it said needed version 52 and I had 60 or something I'm not sure

somber hull
#

damnit

#

same issue

#

now everything is on java 17 tho

#
    <dependencies>
        <!--This adds the Spigot API artifact to the build -->
        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot-api</artifactId>
            <version>1.16.5-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.github.stefvanschie.inventoryframework</groupId>
            <artifactId>IF</artifactId>
            <version>0.10.3</version>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.2.4</version>
                <configuration>
                    <dependencyReducedPomLocation>${project.build.directory}/dependency-reduced-pom.xml
                    </dependencyReducedPomLocation>
                    <relocations>
                        <relocation>
                            <pattern>com.github.stefvanschie.inventoryframework</pattern>
                            <shadedPattern>me.silent_program.inventoryframework</shadedPattern>
                        </relocation>
                    </relocations>
                </configuration>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
trail lintel
#

are you using intellij?

somber hull
#

ye

trail lintel
#

press ctrl+alt+shift+s to open project settings

#

go to modules

#

what SDK is your module using

#

you want to specify it there as well

somber hull
#

@trail lintel language level?

trail lintel
#

that one as well, and then the third tab Dependencies

#

both should be on java 17

#

for module SDK

somber hull
#

its set to project sdk

#

and i deleted everything but java 17

trail lintel
#

does it say 17 next to project sdk?

somber hull
#

yea

trail lintel
#

aight yeah you good there

somber hull
drowsy helm
#

whats the usecase?

lavish hemlock
#

just use binary 😎

#

DataInputStream/DataOutputStream makes it really easy

#

tip: include a versioning number

drowsy helm
#

yeah binary is the best you will get

waxen plinth
#

Why flatfiles

#

If you have that much data then a database is a better solution

drowsy helm
#

depends on the usecase

lavish hemlock
somber hull
#

it is still broken

waxen plinth
#

You're trying to run java 16 on a lower-versioned JVM

somber hull
#

Meaning that my actual computor has the wrong java version?

waxen plinth
#

Potentially

#

Or you're just running it with the wrong version

somber hull
#

my pc is running java 17

#

everything i have found is java 17

#

@waxen plinth

#

it has to do with a dependency'

#

without it it works fine

#

its the maven shade plugin

waxen plinth
#

Dunno then

somber hull
#

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

#

AMAzing

#

maven shade plugin doesnt support java 16

lethal coral
#

you sure?

somber hull
#

yep

#

fixed it with 3.3.0-SNAPSHOT

#

now im getting this

#
[19:56:14] [Server thread/ERROR]: Could not load 'plugins\BetterSpawners-1.0-SNAPSHOT-shaded.jar' in folder 'plugins'
org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml
        at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:170) ~[server.jar:3096a-Spigot-9fb885e-af1a232]
        at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:144) ~[server.jar:3096a-Spigot-9fb885e-af1a232]
        at org.bukkit.craftbukkit.v1_16_R3.CraftServer.loadPlugins(CraftServer.java:381) ~[server.jar:3096a-Spigot-9fb885e-af1a232]
        at net.minecraft.server.v1_16_R3.DedicatedServer.init(DedicatedServer.java:224) ~[server.jar:3096a-Spigot-9fb885e-af1a232]
        at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:928) ~[server.jar:3096a-Spigot-9fb885e-af1a232]
        at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$0(MinecraftServer.java:273) ~[server.jar:3096a-Spigot-9fb885e-af1a232]
        at java.lang.Thread.run(Thread.java:831) [?:?]
Caused by: java.io.FileNotFoundException: Jar does not contain plugin.yml
        ... 7 more
#
name: Better_Spawners
main: me.silentprogram.betterspawners.BetterSpawners
version: 0.0.1-SNAPSHOT
api-version: 1.16
description: lal

commands:
  open:
    description: test
young knoll
#

It’s not being moved to the right place when building

#

Or it’s not being included at all when building

somber hull
#

for why

somber hull
young knoll
#

Not sure, I don’t really use maven

somber hull
#

😒

mighty sparrow
#

I wanna make so when a player dies, his inventory is stocked in a static hashmap

#

When I will restart the server, the static hashmap will be lost right

young knoll
#

Yes

#

Also why static

mighty sparrow
#

Because there will be only one InventoryHashmap <UUID, Inventory>

#

So why not

young knoll
#

Because random static is bad

#

It could just as easily be a instance variable in your listener class

#

Generally you only have one instance of those

mighty sparrow
#

True

#

There will not be multiple instances of it

#

static is useless in this case

#

So to not lose the HashMap content, I must parse the content into a json file and when the server is restarted, I load the content of this json file into the hashmap

#

Is there another way than creating a json file ? (easier way)

somber hull
#

yaml

young knoll
#

Not really, gson is fairly easy to work with

somber hull
#

lol

tall dragon
#

json is probably your best option

somber hull
#

json is best

young knoll
#

Yaml exists too, but it’s not really meant for data

somber hull
#

but you can use a data.yml

somber hull
young knoll
#

Of course another option is SQLite

somber hull
#

but worse

somber hull
mighty sparrow
#

dude, im not making a databaseeee

#

json will be faster

somber hull
#

i havent worked with it

mighty sparrow
#

yeeees it is

somber hull
#

but

mighty sparrow
#

but ?

somber hull
#

idk

mighty sparrow
#

So when OnServerStop (idk the name of the event), how could I create a new json file in his own folder in the plugin directory, where the plugin is located

tall dragon
#

you could

mighty sparrow
#
plugins
  myPlugin.jar
  myPlugin
    inventory.json
tall dragon
#

but you have to consider the server could crash

mighty sparrow
#

Why would it crash ?

tall dragon
#

idk

#

lots of reasons it could

#

you dont know whats gonna happen

young knoll
#

I would advise you save it regularly

#

Say every 5-10 minutes

#

Actually you can probably just save it whenever someone dies

mighty sparrow
#

Ok I see, I do this in a thread with a sleep of 10 minutes

young knoll
#

Nah

tall dragon
#

or just use a runnable

young knoll
#

Just use runTaskTimer

young knoll
#

Actually, you can do runTaskTimerAsyncronously

drowsy helm
#

huh

#

why would you do that

#

then its always empty lmao

young knoll
#

No?

drowsy helm
#

are you saying save ALL players whenver any player dies

#

or save the inventory of the player who died

young knoll
#

No

mighty sparrow
#

no

young knoll
#

Save whatever is currently in the map

#

Speaking of, what’s the use of this map

mighty sparrow
#

But if multiple player dies, they will all write in the file at the same time

#

eum

drowsy helm
#

just use a timer or whenever inventory is changed with a buffer

mighty sparrow
#

It doesnt take 1 hour but

mighty sparrow
drowsy helm
#

like a minimum time before next save

#

so it doesnt do 20 saves in 1 second

young knoll
#

Their inventory is added to the map when they die

#

When is it removed

mighty sparrow
tall dragon
#

whats even the purpose of having this data?

young knoll
#

No, when is it removed from the map

mighty sparrow
#

It is removed from the map when the "tombstone" is destroyed

young knoll
#

Okay, so it isn’t just keep inventory, got it

mighty sparrow
#

i make the plugin in kotlin, idk if its important to say

young knoll
#

Yeah you can write it to the file immediately to ensure nothing is lost in a crash

#

No one likes to lose items in a server crash

mighty sparrow
#

true

proud basin
#

go little rockstar

mighty sparrow
tall dragon
#

i see

mighty sparrow
#

I must set the keepInventory gamerule to true so the items will not be duplicated

young knoll
#

Pretty sure you can also just clear the dropped items in the death event

mighty sparrow
#

just clear his inventory thats all?

tall dragon
#

well he loses his stuff when he dies

#

but you can remove the drops

#

so nothinf will be dropped

young knoll
#

Yeah there is a mutable list of drops iirc

dense geyser
#

Do metadata tags assigned to players reset when they die or change world?

mighty sparrow
#

I already saw a question like this about html

#

and it was a yes

#

but forget about what I said

young knoll
#

Best way would be to test it

dense geyser
#

if thats directed at me, entity metadata and html are different

mighty sparrow
#

there are metadatas in html

#

but forget about it

#

no link

dense geyser
tall dragon
#

how are you assigning said metadata

young knoll
#

I would imagine via the method for adding metadata?

mighty sparrow
#

everything is so simple with kotlin maaaan. I recommend yall to use it for plugins

tall dragon
#

well he could use PersistentDataContainer

mighty sparrow
#

random thought

tall dragon
#

in which case it would be persistent

dense geyser
#

Entity#setMetadata(String, FixedMetadata(Plugin, String))

dense geyser
tall dragon
#

ah

#

yea

dense geyser
#

besides it doesn't need to be permanent, I just need to make sure it doesn't go away under any circumstance other than them leaving

fervent panther
#

I'm making a plugin that adds some custom items and I'm making a /givecustom command for getting them. Is it possible to have the custom items I have created show up like they do with vanilla /give?

mighty sparrow
#

Like seeing the list content with tab

#

?

dense geyser
#

you could always copy the code of the command where the external jars are decompiled in your ide

#

afaik there are unsafe bukkit methods that do it

tall dragon
young knoll
fervent panther
young knoll
#

Create a copy of the command that also includes your items

fervent panther
#

I mean I'm making the command be /givecustom

young knoll
#

So you want the possibilities to show up?

mighty sparrow
#

in minecraft when you do /give, you can see all the items

#
            ...
            custom4
            custom3
            custom2
            custom1
/givecustom
fervent panther
#

yeah

young knoll
#

I thought they wanted to add their items to the vanilla give command

fervent panther
#

I've been trying to get a screenshot for the last few minutes but it won't paste lmao

young knoll
#

If you just want them to show in your command, implement TabCompleter

fervent panther
young knoll
#

Also you cannot send images unless you verify

fervent panther
#

ohh

mighty sparrow
fervent panther
mighty sparrow
#

implement is for interface in java right?

tall dragon
mighty sparrow
#

christmas vacations started, I feel my brain going away

tall dragon
#

well have a good vacation

#

mine has started too

mighty sparrow
#

Someone has an idea how to broadcast a message to all players with paper ?

tall dragon
#

uhm

mighty sparrow
#

it's different and I have no single clue

tall dragon
#

why would it be different

#

paper is built on spigot

young knoll
#

They use adventure

#

Anyway, ask paper

mighty sparrow
#

they have no documentation

young knoll
#

Ask their discord

tall dragon
#

they are telling you why its deprecated

mighty sparrow
young knoll
#

Also adventure has documentation

mighty sparrow
tall dragon
#

in favour of Server.broadcast

#

so then want you to use this instead

young knoll
#

You can still use the deprecated one anyway

mighty sparrow
#

the ide put like every style possible to make it fckin weird

#

broadcast

#

same color as the background

#

lol

mighty sparrow
#

or live

young knoll
#

Hmm?

mighty sparrow
#

Im curious, do you have a portfolio or a place with your projects ?

young knoll
#

They’re on my GitHub

mighty sparrow
#

omg ur pfp haha

tall dragon
#

i see you have a customcropcreator @young knoll thats quite a cool little project

mighty sparrow
#

You said to me to use task, could I use Kotlin coroutine instead @young knoll

young knoll
#

No idea

mighty sparrow
#

If you want a new project idea, try doing a plugin 100% made in kotlin.

buoyant viper
#

scala 😼

young knoll
#

Not really interested in Kotlin

rough basin
#

How do I get the attacker from EntityTargetLivingEntityEvent ?

#

GetEntity() seems to get targeted entity

mighty sparrow
#

the one that attack the entity ?

#

or the entity that attacks

rough basin
#

Entity Who targeted another entity

tall dragon
#

getEntity should get the targetter

#

getTarget returns the targetted

#

as seen here

rough basin
#

hmm

#

then what i have wrong..

#

Anyways thanks

tall dragon
#

show us what youve got

rough basin
tall dragon
#

is the entity not null?

young knoll
#

Not all entities have a custom name

tall dragon
#

which causes the nullpointer

waxen plinth
#

Jeez

#

for (int x = 0 ; x < ( config.getStringList(event.getEntity().getCustomName()).toArray().length); x++ ) {

#

You really should not be doing this

#

entityType = (EntityType) config.getStringList(event.getEntity().getCustomName().toString()).toArray()[x];

#

Your loop is O(n^2) for no reason

#

Store it in a variable at the very least

young knoll
#

How does that even work

#

You can’t just cast a string to an entitytype

waxen plinth
#

You also can't cast to EntityType from String

#

Yea

#

You need to do EntityType.valueOf

mighty sparrow
young knoll
#

And handle the exception

waxen plinth
#

What exactly are you trying to do?

#

Also why would you call toString() on a String

mighty sparrow
#

.toString().toString().toString().toString().toString().toString().toString()

olive lance
#

Any time complexity ppl wanna look at my plugin

mighty sparrow
#

go

young knoll
#

Player.getPlayer().getPlayer()

olive lance
#

Ignore Venmo plug

young knoll
#

Get him!

waxen plinth
#

Ok let's see

waxen plinth
#

I am made of complex time

#

Got any specific parts I should look at?

#

I don't feel like looking at the entire plugin

mighty sparrow
#

same

sterile token
#

Its amazing always when I use:

JarOutputStream output = new JarOutputStream(new FileOutputStream(new File("C:\User\Usuario\Desktop\File.jar")));

I get: An error was thrown while executing run method. Reason: java.io.FileNotFoundException: C:\User\Usuario\Desktop\Lunar-Out.jar (The system could not find the route)

Any idea?

buoyant viper
#

i think ur missing the jar file

noble lantern
#

why not use ZipFile

sterile token
buoyant viper
#

wait those file names dont even match up

#

File.jar Lunar-Out.jar

noble lantern
#

^

mighty sparrow
#

It looks for Lunar-Out.jar

noble lantern
young knoll
#

Lul

noble lantern
#

isnt ark c++ tho

sterile token
#

No no

noble lantern
#

okay then im clearly out of my element, sorry goodbye 🀣

young knoll
#

In this case ASM stands for

#

Actually I have no idea

noble lantern
#

Ive only know it to stand for ark server manager

buoyant viper
#

ass sat mad

sterile token
#

Its related to bytecode

buoyant viper
#

idk i use javassist

#

lol

mighty sparrow
#

idk I use github copilot

young knoll
#

Apparently it just stands for ASM

mighty sparrow
#

ASM stands for ASM ?

young knoll
#

Specifically ASMifier tool

sterile token
#

I explain, im reading a jar

buoyant viper
#

we got that

#

wait

#

reading?

#

u need the JarInputStream

#

not Output

sterile token
#

When reading/writing i got that the system cannot find the file

mighty sparrow
#

its writing

sterile token
#

Yeah i now

#

But no matter if i read/write it get that error

mighty sparrow
#

if only the problem was just that

buoyant viper
#

have u made sure the files exist

#

and the paths r correct

sterile token
#

I have the file on desktop

#

And they are there

#

Im going to debug again

mighty sparrow
#

Try going in the official java server

#

im braindead atm

#

im always braindead btw

sterile token
#

Nooo

#

I have found the error

#

Btw

#

Its: C:\Users\

#

And i was writting C:\User\

#

Im an idiot

mighty sparrow
#

HAAHAHAH

#

typo errors are the hardest man

#

I would have never find it

rough basin
#

I just realized that I didn't check if it was an entity with a CustomName.
So a WARN would have occurred, but still the code doesn't apply to entities with names :(

mighty sparrow
#

Is it possible to update the plugin without making people download a new version

#

like

#

I execute something and the plugin is modified

floral pier
#

How do you mean? For those that have downloaded your plugin or specifically for the server it's on?

mighty sparrow
#

the server it's on

young knoll
#

What?

floral pier
#

/unload-/load(?) but this can and will break the plugin unless it's set up to repopulate necessary data fields such as online players. Since for example PlayerJoinListener will not be called again.

robust forge
#

Can I save entities to a file with UUID? I tried to save an armorstands UUID but after restarting and trying to get the Entity from the UUID I saved the Entity was null.

young knoll
#

The entity would have to be loaded to get it

robust forge
young knoll
#

Make sure it’s loaded

mighty sparrow
#

if(!=null)

robust forge
#

Do you mean that the chunk must be loaded?

#

Ye but I need to add it to an hashmap

#

So I can use it

young knoll
#

Yes the chunk must be loaded

mighty sparrow
#

About my plugin I talked about, the best moment to update the json file would be at each 10minutes with a coroutine or at each time someone dies ?

#

question like this. Im thinking

young knoll
#

I would go with the later

robust forge
mighty sparrow
young knoll
#

Yes, the later of the 2 options, aka the second one

mighty sparrow
#

oooooh, I never heard this term, im sorry

young knoll
mighty sparrow
#

hahah thanks for your opinion

young knoll
#

Or use the chunk load event to add it to your map when the chunk loads

mighty sparrow
#

for the event handlers, do the function name maters

#

or I can put whatever I want

young knoll
#

Whatever you want

mighty sparrow
#

I thought it was like android studio

#
@Override
void onResume()...
#

but its event handler not override

#

so im dumb dumb

#

Json is only for string

#

HashMap<UUID, Inventory>

#

how could I parse this into json

fair sand
mighty sparrow
#

Explain what leaded to this error

#

show some code

worldly ingot
#

Presumably either some issues with mappings or you're just putting in the wrong name, because the actual class name is EntitySkeletonWither, not WitherSkeleton

mighty sparrow
#

thats what I was about to say ngl

fair sand
worldly ingot
#

Yeah then you're probably using SpecialSource or something like that to use Mojang mappings

fair sand
#

Yeah

mighty sparrow
#

WitherSkeleton is an interface

#

not a class

#

wtv

fair sand
#

Oh ok

#

thx

#

So how do i et the class ?

mighty sparrow
#

Its a skeleton entity

fair sand
#

import org.bukkit.entity.Skeleton;

#

this ?

mighty sparrow
#

Yes

fair sand
#

Sorry i didn't mention this before but it's for a custom entity

mighty sparrow
#

I think this thread is exactly what youre looking fkr