#help-development

1 messages Β· Page 81 of 1

agile anvil
#

You're too quick

quaint mantle
#

:)

#

I find these conversations pretty funny because some time ago I was just like this

iron glade
#

we all been there

#

SomeClassName

#

someVariableName

agile anvil
#

someCoolVariable

quaint mantle
#

camelCase for fields and methods, PascalCase for classes

agile anvil
#

thisMethodWillDestroyYourComputer

ancient plank
#

when in doubt just send them the java conventions page

quaint mantle
#

and whoever names their generics lower case is doing war crimes

mighty aurora
#

Quick question. Would the best way to make a sort of dash ability for a player be to use velocity? Also if I wanted that to do damage to entities in the pathway of the dash ability without also damaging the player what would the best method be?

quaint mantle
#

yes

iron glade
#

?naming

quaint mantle
iron glade
#

don't we have something like that

agile anvil
quaint mantle
#

Don't most IDEs these days warn people about naming conventions?

agile anvil
#

And check PlayerMoveEvent to damage players

iron glade
#

even checks spelling

agile anvil
quaint mantle
#

Lol

ancient plank
tardy delta
#

ij isnt saying anything

iron glade
#

nice!

quaint mantle
#

yes

tardy delta
quaint mantle
timid jetty
#

so i know we wanna shit on bad code design, any chance I can interrupt and ask if anyone knows of a way to move a player a few blocks without teleporting, like a push so it doesnt look as weird

mighty aurora
# agile anvil And check PlayerMoveEvent to damage players

I wouldn't be damaging the player I want to damage the entities in its path. Would that require setting up a listener for damage and setting up a method of determining whether they are using the dash ability at that time and then cancelling said event?

ancient plank
#

vector math go brr

timid jetty
#

linear algebra boutta go off

agile anvil
timid jetty
iron glade
#

yea

quaint mantle
#

If there is one thing I could take from C# and use in java, it would probably the ability to define custom operators on classes.

mighty aurora
quaint mantle
ancient plank
#

just apply some force and something moves

quaint mantle
timid jetty
#

ah okay

#

ty

agile anvil
quaint mantle
#

It would be optional.

ancient plank
#

but then I can't name my String string

#

smh

quaint mantle
#

lol

tardy delta
#

define custom operators

quaint mantle
#
string @string;

^ is valid naming

quaint mantle
ancient plank
#

cringe

quaint mantle
#

for parameters at least

#

I usually just go with good ol' ```cs
string str;

#

what I would take from C++ to Java is removing OOB

lime jolt
#

does anyone know how to save file information
like I made a txt file that has all the info
but when the server resets
so does the txt file
that holds all the data

quaint mantle
#

or something in code

#

why a txt

lime jolt
#

idk I thought that was the only way

undone axleBOT
lime jolt
#

there is a lot of code

#

all the info is in a txt file

agile anvil
#

The text file part

tardy delta
#

lets just use yaml

lime jolt
#

oh wait I know why

quaint mantle
#

YAML is da best

lime jolt
#

Its cause I am dumb

#

at the very begigng of my code I do this

#
            FileWriter myWriter = new FileWriter("areas.txt");
            myWriter.close();
        }
        catch(Exception e){}```
#

clearing everything in the fi;e

#

file

#

lmao

#

ima try fixing that

tardy delta
#

you arent even writing

agile anvil
tardy delta
#

also use try with resources

quaint mantle
lime jolt
#

oh lol

#

does anyone know how to check if a file exists

quaint mantle
agile anvil
quaint mantle
#

new File(path).exists() or something like that

agile anvil
quaint mantle
#

lolol

quaint mantle
#

lets count

#

I'm gonna try now

#

anybody have a question here? pls????

#

xd

agile anvil
#

πŸ˜‚πŸ˜‚

desert frigate
#

Can someone tell me how they made this? A custom minecraft graphical user interface.

agile anvil
#

Custom resrouce pack with unicode texture

#

On title or action bar

desert frigate
#

Ohhh

#

So it's just a title

#

But how come they said they didn't use any packs

quaint mantle
#

bruh

leaden knot
#

Do i come here for help lmao

agile anvil
#

Read again lmao

quaint mantle
desert frigate
#

Oh πŸ₯±

leaden knot
#

Hope so πŸ˜‚ so my mc server has aurelium skills my max health goes up but i dont regen anything what can i do

vivid skiff
#

How can i create a book with multiple text lines in it?

agile anvil
quaint mantle
iron glade
#

Don't see a comment

quaint mantle
#

I do

#

what are you trying to achieve

iron glade
#

bruh use // for comments wth this <

quaint mantle
#

An interact event might not have an item.
You can get the Hand the player used, and set the item using the player inventory accordingly

onyx fjord
#

is there some formula to create particle shapes?

onyx fjord
#

i suck at math

quaint mantle
#

formula ;-;

mighty aurora
#

How do I calculate a vector/how do I put the vector in the setVelocity piece? I'm setting the players velocity to move them forward a specific distance and I'm not totally sure how I calculate the velocity for the first value of setVelocity

agile anvil
quaint mantle
thick scarab
#

How to get item on cursor in creative?
Player#getItemOnCursor always returns air

quaint mantle
quaint mantle
quaint mantle
thick scarab
quaint mantle
#

oh

mighty aurora
quaint mantle
#

always air? what?

thick scarab
#

Yes, in creative it shows as air

agile anvil
#

normalize it and multiply to scale

quaint mantle
onyx fjord
#

realtalk what particle looks good

quaint mantle
agile anvil
onyx fjord
#

idek

#

just looking shiny

agile anvil
#

x)

quaint mantle
# quaint mantle

this is the documentation, idk anything else why it would be Air

agile anvil
#

The crits are great

onyx fjord
#

(below 1.19 btw)

chrome beacon
onyx fjord
#

wait when was glow squid added

chrome beacon
#

The client essentially tells the server what to put where

agile anvil
quaint mantle
#

why is that not in the docs

ancient plank
#

creative mode inventory is client side

lime jolt
#

I created a txt file to hold all my data, but idk where it is created when I run the jar??? Can I just not acess it?

agile anvil
#

Cause mc protocol is funny, you have to experience it urself

ivory sleet
#

lol

ancient plank
#

it's very janky so I just don't allow most of my stuff to work in creative mode

lime jolt
#

wait nvm I found it

quaint mantle
boreal seal
#

using packets..

#

i think editing existing gmod is really limited

mighty aurora
# agile anvil normalize it and multiply to scale

Ok I'm sorry for asking so many questions I know very little about vectors. I'm trying to get the vector and currently I am trying to use this to calculate the vector(Sorry I haven't done this before) Vector.normalize(Player#getDirection); but it tells me that I can't use that in a static environment when I try and place that inside my event.

boreal seal
#

better just make some guis remove health bars, and etc using packets..

quaint mantle
boreal seal
#

bruh Wolf

#

the docs about vectors are really clear

mighty aurora
tender robin
#

1.16.1 is 1.16 right?

mighty aurora
#

no

boreal seal
#

very clear

#

whats not clear here

#

tell me please

quaint mantle
boreal seal
#

which part you didnt understand?

boreal seal
#

that person cant understand docs

ancient plank
#

mondays hit different for evanmclever

#

shoelaces don't work

boreal seal
#

not sure what he will understand from the line you gived him

tender robin
boreal seal
#

its like 1.8 versions

#

you will be fine

quaint mantle
#

That seems a bit rude to put it like that. Not everybody immediately understands something just by reading up a little on it. It's unfair to assume that.

tender robin
#

but it'll work on 1.16 right

boreal seal
#

or math homeworkk

#

vectors docs are very clear

#

maybe the person have no clue what are vectors as well in first place

#

;l

ancient plank
#

in vanilla 1.16.1 players cannot connect to 1.16 servers, the only version to do that is 1.16.5 to 1.16.4 servers iirc

agile anvil
quaint mantle
boreal seal
#

its about person who googles how to

#

basically X Y...

#

he will ask how to do this when he doesnt know how to do the other thing in first place

mighty aurora
boreal seal
#

you understand

boreal seal
#

to understand some concepts

agile anvil
boreal seal
#

spigot is bukkit fork

#

for god sake

agile anvil
#

Yeah

boreal seal
#

_Rolyn how old are you

#

if u was 11

#

how now

agile anvil
#

But the Vector comes from Bukkit didn't they ?

boreal seal
#

everything comes from bukkit..

#

almost

agile anvil
boreal seal
#

im confused bruh you should be familiar with bukkit then

agile anvil
boreal seal
#

back then in 1.2.5 bukkit was the only thing out there

ancient plank
#

alright old man go back to bed

quaint mantle
boreal seal
#

nah man

#

i think its just a waste of time

quaint mantle
#

Learning takes time

boreal seal
#

you know how many idiots come here

#

like for real

#

XYProblem..

#

thats the issue

#

im here to support

#

link docs

#

he dont understand english

quaint mantle
boreal seal
#

send him to english class

boreal seal
#

wait no

#

i actually learned java first

#

and then the api

mighty aurora
boreal seal
#

only

quaint mantle
#

that is a good idea.

#

yes

boreal seal
#

i dont think a person who cant understand docs learned java

#

the docs are written in the most clear way in the world

quaint mantle
# boreal seal true

Alright, well you can have your opinion and stick to it i guess, I will still try to help when I can. lol

boreal seal
upper vale
#

I learned by copy pasting from YouTube videos

boreal seal
#

you will code his plugin

quaint mantle
mighty aurora
upper vale
#

Yeah

#

Control C control v

boreal seal
#

you did it

#

for sure

#

he is joking

#

...

quaint mantle
boreal seal
#

brb i bring a lighter

quaint mantle
# boreal seal you will code his plugin

Explain the best you can with the info you are given and tell them how they could be asking the question better, this is usually what I try to do. I don't code plugins for people without payment lol, all I did was write one line of code which summarizes the idea.

boreal seal
#

they answer on his questions

#

all you do is read it and explain it to him

#

in different way

#

he should understand the docs

#

or not use the function at all

#

im not here to unmotivate people and etc

#

i just try to put them on the right way

#

he cant take shortcuts...

quaint mantle
#

Like I said, sometimes people need a little extra help understanding, it's not fair to just say "Oh well, you can't code I guess because you can't understand something that most people can."

ancient plank
#

I think this is a silly argument

quaint mantle
#

Let people who are helping just help their way -_- even if it's the hard way

agile anvil
boreal seal
#

not yet

#

i might get later

#

i think like in 5-10 years

mighty aurora
#

Can we please just end this argument? Also other question. What value do I need to put in as a velocity? Based on the docs the setVelocity requires two inputs, a vector and the velocity. I tried putting a int and double but neither are working and I don't see things in the docs explaining this.

boreal seal
#

when i get an house

agile anvil
boreal seal
#

not really

#

Rolyn you dont know how it works then

mighty aurora
boreal seal
#

if a kid will never eat chocolate he will never want

#

learn some psychology

#

what you say seems funny

tardy delta
#

i wanted to say smth but i wont

#

πŸ€“

quaint mantle
#

I think he is just trolling at this point lol

boreal seal
#

im very friendly person either

quaint mantle
#

look at the channel name and if you don't see #arguing just stop or leave
reply to Mc Lever

#

Copium?

mighty aurora
quaint mantle
#

Evan

#

Anyways, we should probably get back on topic lol

agile anvil
# boreal seal Rolyn you dont know how it works then

I think you just don't understand how to live in a community. I'm a mathematician, I like logical stuff, I like when things are true or false so your teaching method is the one I like. But there are others in that world. You're not the only one in that planet, not everybody thinks like you.
So stop imposing your mindset, it's maybe good for some, but not for others.
If you're not happy with how Wolf teach, just ignore

boreal seal
#

your brains are less devoloped

#

its pointless...

#

thats logic

#

a kid will be not sad

quaint mantle
#

omg

boreal seal
#

he will be used to it

quaint mantle
#

stop

#

with the fricking useless talk

boreal seal
#

timar this is what you do when your parents argue?

#

thats the point of discord

#

useless talk

quaint mantle
#

I thought the point of discord was to discuss topics in the proper channels because those are the rules of the server

boreal seal
#

do message u a msg

#

since u dont accept strangers

#

lol

agile anvil
boreal seal
#

i wanted to say its pointless

#

the guy with vector issue still didnt get an answer

#

and each question leads to different question

#

@mighty aurora

#

do you mind to answer some simple questions to me?

#

ill write a simple code

quaint mantle
boreal seal
#

and tell me what it used for

mighty aurora
#

I can try

#

I literally already stated that I am still learning Java

boreal seal
#
    private void init() {
        hostname = plugin.getConfig().getString("hostname");
        port = plugin.getConfig().getString("port");
        database = plugin.getConfig().getString("database");
        username = plugin.getConfig().getString("username");
        password = plugin.getConfig().getString("password");
    }
#

now why this method is private

#

and what does "void" means here

#

its really simple

#

you have 30 seconds.

#

no one dont answer please.

iron glade
#

tf?

boreal seal
#

if he gives correct answer i will apologize..

agile anvil
boreal seal
#

stop stop

#

hold on

agile anvil
#

so please stop and go out

boreal seal
#

no man you help man who didnt study java even

mighty aurora
#

Private is so that you can't access it elsewhere as it contains data you only want accessed here. Sorry but right now I can't remember what void means.

agile anvil
#

drink some water, breath some fresh air

boreal seal
#

he dont remember what void means

#

for god sake

#

Void it what it retursn

#

if it was private String

#

it would return a string

#

now guys

#

go help him

#

its pointless

#

let him learn java first

iron glade
#

11/10 teacher skills

mighty aurora
#

My brain forgets things ok

boreal seal
quaint mantle
boreal seal
#

i honestly think you googled

#

what it means

mighty aurora
#

no

boreal seal
#

took you way too much time

mighty aurora
#

because I was typing...

boreal seal
#

man

quaint mantle
#

Not everybody is gonna go to college to learn java to make minecraft plugins, lmao what?
How do you expect him to learn? If you are just basically making him look like a fool because he is new?
All you are doing is scaring him away? The learning space needs less of that energy.

boreal seal
#

typing this for 1 min

boreal seal
#

simple know eldge

#

its the basics

mighty aurora
#

I had to rewrite a section because I messed up

boreal seal
#

@quaint mantle

#

im wrong?

mighty aurora
#

Doesn't matter anyway people will believe what they want to believe.

boreal seal
#

lavaking i just suggest you to learn java first

#

you wont understand shit later

#

if u dont learn java first

#

u will write static jebbrish

#

you dont want it

quaint mantle
#

Again, if people are willing to help, just let them

agile anvil
#

That's it, just say that, it's good, now stop

boreal seal
#

its alright guys

#

i prooved my self

quaint mantle
#

You don't need to understand the entirety of java, just learn it bit by bit like I did. For me it was easier that way.

boreal seal
#

who wants can help him

#

WOlf

#

he doesnt know why Void was here

#

are you serious

#

its like basics of basics

mighty aurora
#

i literally said I forgot...

agile anvil
#

stop

boreal seal
#

you cant forget that

agile anvil
#

guys stop

quiet ice
#

...

boreal seal
quiet ice
#

Okay why the hell ghost-print vagdedes?

mighty aurora
quiet ice
#

That was like the REALLY wrong choice to do

quaint mantle
#

Indeed

#

I have a problem with how it seems like you are publicly shaming him right now, he is learning, it takes time to learn to program. It's a complicated subject, the only thing you are doing is deterring him...

mighty aurora
#

I can't believe I just caused this large of an argument

ancient plank
#

shhhh

mighty aurora
#

over a question

ancient plank
#

go back to development help question answer stuff

#

discontinue the argument stuff

agile anvil
#

break;

quaint mantle
tardy delta
#

wheres context

quiet ice
#

?jd-s

undone axleBOT
iron glade
#

new ItemStack(material)

quiet ice
quaint mantle
#

no, it's a new item stack with that material

quiet ice
#

But uh why would you do that?

quaint mantle
#

He's trying to ask how to set an item stack to the current item, not a material

quiet ice
#

And what do you want to do?

#

With the itemstack reference that is?

agile anvil
#

@quaint mantle just fetch the player inventory to set the itemstack, the event is not the instance to use

iron glade
#

All I know is you are using PlayerInteractEvent, give more context

mighty aurora
#

What value do I need to put in as a velocity? Based on the docs the setVelocity requires two inputs, a vector and the velocity. I tried putting a int and double but neither are working and I don't see things in the docs explaining this. Or is it that its one value and I need to incorporate the speed in the vector? This was asked earlier but lost in the argument.

quaint mantle
#

you can get the material from an ItemStack using getType()

quaint mantle
ancient plank
#

vector

quaint mantle
#

Are all of your brackets matched properly?

#

What IDE do you use?

quiet ice
#

Nah, he misinterpreted (Vector velocity) as being two args

mighty aurora
#

ok thanks. now how do I determine the actual speed at which the player will be moving after having set the velocity?

quiet ice
#

Vector being one type and velocity being the other

quaint mantle
#

Ah, Vector is the type. velocity is the name

mighty aurora
ancient plank
#

vect: Vector moment

agile anvil
quaint mantle
#

The length of the vector is the speed. Which is why you normalize the vector (reduce it's length to 1) and scale it to the speed you want

quiet ice
#

You likely need to normalise the vector

mighty aurora
#

I already normalized it

#

And the speed is meters per TICK right?

quaint mantle
#

And now you scale it

quiet ice
#

But uh I never did much of the vector buffoonery

mighty aurora
#

meaning if I wanted it to be less than 1m/t 20m/s then I would need to scale it down?

quaint mantle
#

I would think that velocity would be per second, but I'm not sure

quiet ice
#

Just try it out I guess

mighty aurora
quiet ice
#

Then it probably is that

agile anvil
mighty aurora
#

I'm working in 1.19

quaint mantle
agile anvil
#

I mean from which class?

quiet ice
#

Entity class

mighty aurora
#

Yeah

quiet ice
#

this can be unreliable especially on laggy servers

#

And is more complicated either way

quaint mantle
mighty aurora
#

I sincerely hope I didn't mess up anything I wrote. Also I was trying to use one of the tutorials to learn/make a cooldown system but it doesn't appear to work. Tutorial in specific is https://www.spigotmc.org/wiki/feature-command-cooldowns/ Does anyone know if this still works? If so would someone be willing to help me troubleshoot it?

quiet ice
#

Assuming that 20 ticks = 1 second

agile anvil
quiet ice
#

Why would it not work?

quaint mantle
quiet ice
#

And if so, how does it not work?

quaint mantle
#

Not the current tick speed my bad

agile anvil
quiet ice
#

Nah, they usually cannot

#

At least not on spigot/paper

mighty aurora
#

Yeah and you store that value in a hashmap usually right?

quaint mantle
#

In that case, it would be safer to assume that 20 ticks is a second, yes.

quiet ice
#

Hence there will not be target tickspeed method

agile anvil
mighty aurora
#

Can you explain?

tardy delta
#

rendering moment

quiet ice
#

Generally you'd want to use a hashmap

#

Or at least a map of some sorts

chrome beacon
tardy delta
#

tbh i have no idea what that is

chrome beacon
#

Community made mappings for parameter names

tardy delta
#

uh oh

#

πŸ’€

quiet ice
#

Rendering the main reason I stay strictly on CLI & Serverside development

tardy delta
#

πŸ˜…πŸ‘

quiet ice
#

It's just not my cup of tea

tardy delta
#

i wanted to do some rendering in rust but its so long ago that i did rust

chrome beacon
#

Yeah I remember when I did rendering in my forge mod

#

I forgot to pop the matrix stack

#

Whole world rendering got messed up

tardy delta
#

oh god

vivid skiff
#

How can i create multiple configs, like a config.yml and a playerdata.yml

chrome beacon
#

?configs

undone axleBOT
chrome beacon
#

Slow bot

tardy delta
#

delegates go brrr

#

hmm me not closing reader

mighty aurora
#

Vectors are numbers right

#

Like if you were to print one it would show up as a number

tardy delta
#

does calling CompletableFuture.runAsync(() -> {}, Runnable::run) has the same effect as CompletableFuture.runAsync(() -> {}).join() by both blocking the thread it runs on?

#

not talking about whatever overhead

mighty aurora
#

Is their a way to give players a sort of thorns ability without enchanting their armor or otherwise? As in they will deal damage to anything they touch. By the same way how do I cancel any damage reflected back at them

onyx fjord
#

i found this precious chunk of code

    public static List<Location> getSquare(Location corner1, Location corner2, double particleDistance) {
        List<Location> result = new ArrayList<>();
        World world = corner1.getWorld();
        double minX = Math.min(corner1.getX(), corner2.getX());
        double minY = Math.min(corner1.getY(), corner2.getY());
        double minZ = Math.min(corner1.getZ(), corner2.getZ());
        double maxX = Math.max(corner1.getX(), corner2.getX());
        double maxY = Math.max(corner1.getY(), corner2.getY());
        double maxZ = Math.max(corner1.getZ(), corner2.getZ());

        for (double x = minX; x <= maxX; x+=particleDistance) {
            for (double y = minY; y <= maxY; y+=particleDistance) {
                for (double z = minZ; z <= maxZ; z+=particleDistance) {
                    int components = 0;
                    if (x == minX || x == maxX) components++;
                    if (y == minY || y == maxY) components++;
                    if (z == minZ || z == maxZ) components++;
                    if (components >= 2) {
                        result.add(new Location(world, x, y, z));
                    }
                }
            }
        }
        return result;
    }

what do i do with the result?

#

i tried looping thru array items

#
                for (Location loopLoc : getSquare(location.add(1, -1, 1), location, 1)) {
                    receiver.spawnParticle(Particle.valueOf(config.getString(configValue)), loopLoc, 5);
                }
#

like this

mighty aurora
#

What are you trying to do?

onyx fjord
#

im tryna spawn particles in cube shape

#

error says java.lang.IllegalArgumentException: The provided key for the custom value was null

mighty aurora
#

That would mean that its not giving a result

quaint mantle
#

What line?

sterile token
#

Hi if im using Mongo pojo's do I need to make a codec serializer for the pojo class?

lost matrix
tardy delta
#

lol first looping to compute the result and then looping over the result

#

πŸ€“

sterile token
viscid ember
#

Idk if i need to explain this but...

sterile token
#

That why I having data errores when sever get restart es

quaint mantle
#

Not Color

sterile token
#

Color is from Java

quaint mantle
#

Color is not from bukkit

#

Yeah

sterile token
#

Tomar do you have mongo docec experience?

onyx fjord
lost matrix
quaint mantle
sterile token
#

But mongo doesnt have an Interface like Codec something

#

πŸ€”

viscid ember
lost matrix
#

I personally use my own codec implementation which is simply backed by Gson

tardy delta
#

void loopBlocks(Location firstCorner, Location secondCorner, double particleDistance, Consumer<Location> locationConsumer) @onyx fjord

sterile token
#

Smile, so you are just saving a Json string ob mongo right?

tardy delta
#

i remember the time someone was saving json in a mysql database

lost matrix
sterile token
#

Ohh ok

#

I didnt know you can do that

lost matrix
#

Its literally just

Document bson = Document.parse(jsonString);
sterile token
#

I will keep that answer

#

Thanks smile you are one of the ubiques that use mongo pojos

small current
#

i want to change a nether star with a custom texure data's texture to another how can i do that in the resource pack side

tardy delta
small current
#

i did this

tardy delta
#

it basically allows you to pass in some kind of action

small current
#

and the file is here

#

no

#

if anyone actually worked with custom models please reply

#

blockbench πŸ’©

zealous osprey
small current
#

🧠 yes

#

wait

#

its crystal

lost matrix
#

Example for an acacia boat.
\minecraft\models\item\acacia_boat.json:

{
  "parent": "minecraft:item/generated",
  "textures": {
    "layer0": "minecraft:item/acacia_boat"
  },
  "overrides": [
    {
      "model": "minecraft:item/acacia_boat/1",
      "predicate": {
        "custom_model_data": 1
      }
    }
  ]
}

\minecraft\models\item\acacia_boat\1.json

{
  "parent": "item/generated",
  "textures": {
    "layer0": "acacia_boat/1",
    "particles": "acacia_boat/1"
  }
}

The image is located in
\minecraft\textures\acacia_boat\1.png

charred blaze
#
    public void execute(CommandSender sender, String[] args) {
        if(args[0].equalsIgnoreCase("antivpnreload") || args[0].equalsIgnoreCase("avpnreload")) {
            if (sender.hasPermission("chat.reload")) {
                data = new File(dir, "whitelist.yml");
                saveC();
                sender.sendMessage(ChatColor.translateAlternateColorCodes('&', "&aWhitelist reloaded!"));
            } else {
                sender.sendMessage(ChatColor.translateAlternateColorCodes('&', "&cYou dont have permission to execute that command!"));
            }
        }
    }```

it says command not found
lost matrix
#

@SuppressWarnings("deprecation") is often a bad sign

agile anvil
charred blaze
#

onEnable does it needs to?

#

ah

#

what if i need that command's code in my main class?

small current
#

whats wrong

lost matrix
#

Yes you need to register commands in your onEnable. You need to apply the CommandExecutor to a command.
The only exception is if your JavaPlugin class overrides onCommand()

small current
lost matrix
mighty aurora
lost matrix
lost matrix
small current
#

ok what is wrong then!!!

lost matrix
small current
#

what do you mean

#

i have 2 files

#

i need more ?

lost matrix
charred blaze
#

how to make multiple extends?

lost matrix
charred blaze
lost matrix
#

Your "main" class (which should never be named Main btw) should only extend JavaPlugin

tardy delta
#

extends JavaPlugin implement CommandExecutor

lost matrix
lost matrix
#

The JavaPlugin will be automatically registered as a CommandExecutor for every command defined in your plugin.yml

#

Which is just dirty

small current
#

models\item\nether_crystal.json:

{
  "parent": "item/generated",
  "textures": {
    "layer0": "item/nether_crystal"
  },
  "overrides": [
    {
      "model": "item/heart_item",
      "predicate": {
        "custom_model_data": 1563587
      }
    }
  ]
}

models\item\heart_item.json:

{
  "parent": "item/generated",
  "textures": {
    "layer0": "is this guy my png name in assets ???",
  }
}

@lost matrix

lost matrix
#

Yes that is the path to a texture you want to add. Usually you just have one layer called "layer0"

#

No they werent. They were missing a whole file. And inside this file he needs the layer.

small current
#

still missing texture

#

i got this

lost matrix
#

You are missing a 't'

small current
#

still missing

#

no wait

#

still missing

ancient plank
#

Doing custom models and textures makes me hurt internally

lost matrix
#

I just wrote a generator once and now all i have to do is throw images in a folder and write one line of code which defines how the model looks like

small current
ancient plank
#

I used to make custom 3d models for people with block bench and put them into resource packs for them

#

Very long process very annoying

small current
#

i just need ONE png

mighty aurora
#

Quick question. If a player isn't moving is their velocity 0 or null?

small current
#

whats wrong now

#

??

#

there is no tutorial for it

lost matrix
#

Ah i see a problem. In your heart_item.json there is a colon after "...heart_item"

ivory sleet
#

Wow thats a cool pfp

#

Also kacper I saaaw u sus

lost matrix
#

I have generated it using DALL E 2. I got in as a developer for open AI open source projects πŸ˜›

ivory sleet
#

Congratulations (:

mighty aurora
#

I'm not seeing how I can determine the entity/player that is damaged using EntityDamageByEntityEvent. Anyone know how?

small current
tardy delta
#

resourcepack moment

lost matrix
#

Congratulations

mighty aurora
delicate lynx
#

it returns 1 entity

mighty aurora
#

It gets the Entities Invovled

#

It returns the damaged entity not the damaging entity right

delicate lynx
#

correct

#

if you want the entity that did the damage, do as stated earlier, event.getDamager()

lost matrix
#

EntityDamageByEntityEvent can provide both the defender and attacker

small current
#

anyone got any idea for the resource pack thing ?

mighty aurora
#

I'm trying to use this to prevent a player from taking damage when they are doing something specific. Also by the same extension I want it to also damage entities that attempt to damage the player in this time. I can't seem to figure out how to set the damagee. Or do I need to do something else to damage the entity? It won't let me do entity.damage btw

#

getEntity()

novel ocean
#

hello does anyone know how to properly disable using number keys to move items inside inventories bc checking if getClick == ClickType.NUMBER_KEY doesn't work

mighty aurora
#

Then why does it say here I can damage entities...

#

Thats on the docs

worldly ingot
#

That's on the docs of LivingEntity

viscid ember
#

Just started making plugins again and i have made a wand that shoots a particle in a line for 10 blocks i want to make it so if there is a entity within that 10block it takes damage.

How can i detect if there is a entity within the particle line

public class WandEvents implements Listener {

    @EventHandler
    public static void onRightClick(PlayerInteractEvent event) {
        if (event.getAction() == Action.RIGHT_CLICK_AIR) {
            if (event.getItem() != null) {
                if (event.getItem().getItemMeta().equals(ItemManager.wand.getItemMeta())) {
                    Player player = event.getPlayer();

                    Location origin = player.getEyeLocation();
                    Vector direction = origin.getDirection();
                    direction.multiply(10);
                    Location destination = origin.clone().add(direction);

                    for (int i = 0; i < 10 /* range */; i++) {
                        Location loc = origin.add(direction);
                        loc.getWorld().spawnParticle(Particle.SWEEP_ATTACK, destination, 1);
                    }
                }
            }
        }
    }
}```
worldly ingot
#

Well you have a position for each point, no? loc?

viscid ember
worldly ingot
#

Right but you have each point between those positions too

#

That's what your loc variable is

viscid ember
#

yes i guess within the for loop i do

worldly ingot
#

Ignore the player if you want as well, else it will hit them too ;p

onyx fjord
#
    public static void getSquare(Location corner1, Location corner2, double particleDistance, Player player) {
        World world = corner1.getWorld();
        double minX = Math.min(corner1.getX(), corner2.getX());
        double minY = Math.min(corner1.getY(), corner2.getY());
        double minZ = Math.min(corner1.getZ(), corner2.getZ());
        double maxX = Math.max(corner1.getX(), corner2.getX());
        double maxY = Math.max(corner1.getY(), corner2.getY());
        double maxZ = Math.max(corner1.getZ(), corner2.getZ());

        for (double x = minX; x <= maxX; x += particleDistance) {
            for (double y = minY; y <= maxY; y += particleDistance) {
                for (double z = minZ; z <= maxZ; z += particleDistance) {
                    int components = 0;
                    if (x == minX || x == maxX) components++;
                    if (y == minY || y == maxY) components++;
                    if (z == minZ || z == maxZ) components++;
                    if (components >= 2) {
                        player.spawnParticle(
                                Particle.REDSTONE, new Location(world, x, y, z), 1);
                    }
                }
            }
        }
    }
mighty aurora
#

i saw

onyx fjord
#

it ends up half undone

chrome beacon
#

Particle distance too large maybe

worldly ingot
#

How low you talking? Could very well be a specificity issue

#

e.g. if you're working with a distance of 1.5 on each axis, but your particleDistance is, say, 1, you're going to have a rough time

#

Event handlers can only have one parameter, the event

#

You get everything from the event

#

Right. instanceof check and cast

onyx fjord
waxen plinth
#

Check first

#

Then cast

onyx fjord
#

i cant ss but it has this shape

#

(it should be square outline

#

like a box

worldly ingot
chrome beacon
#

Well that's not what you want

waxen plinth
#

Use block coordinates

#

Ints

worldly ingot
#
if (x == minX || x == maxX) components++;
if (y == minY || y == maxY) components++;
if (z == minZ || z == maxZ) components++;```
onyx fjord
#

oh

worldly ingot
#

I guarantee you the == maxX isn't true

#

(or y or z)

onyx fjord
#

ye i found the code somewhere on forums

waxen plinth
#

It's not great

onyx fjord
#

i suck at math badly

worldly ingot
#

Right, so going back to

e.g. if you're working with a distance of 1.5 on each axis, but your particleDistance is, say, 1, you're going to have a rough time

onyx fjord
#

do you know any better code that can do what i want?

waxen plinth
#

Get the corners of the region

#

Draw lines between all corners that share a coordinate

tardy delta
#

just work with ints instead of doubles

#

lmao

waxen plinth
#

Because the current way you're doing it, you iterate over every block in the region

tardy delta
chrome beacon
#

That still won't work

waxen plinth
#

It's very inefficient

tardy delta
#

no you listen

onyx fjord
waxen plinth
#

Not sure what you mean by that

tardy delta
#

i gave you a link to look at

waxen plinth
#

@quaint mantle don't thumbs down that

#

Don't expect people to explain things to you that have been explained a thousand times

#

We're not here to coddle you

#

Read

#

It's part of life as a developer, you will need to read docs and guides

tardy delta
#

i think he wants to stop developing now

onyx fjord
#

okay guys this is weird

#

it seems to work fine if distance is 1 or 0.25

tardy delta
#

another one to add to the blocklist

tardy delta
#

havent really been following so idk

boreal seal
#

kacper you know whats wierd

#

few hours ago there was a guy

vivid skiff
#

how can i storage data in a file like userdata.yml where it saves like:

Players:

  • Player, 200, hey1
boreal seal
#

who didnt know what public "void" < void means...

#

and i told him learn java first

#

and got muted for an hour

waxen plinth
#

Read what was linked to you

onyx fjord
#

it means the thing below End dimension

boreal seal
#

it means it returns nothing lol

onyx fjord
#

i know bro im joking

boreal seal
#

bruh xd

onyx fjord
#

but did i lie? no

boreal seal
#

but 1 hour mute fr

#

btw i asked what is private as well he manange to find an answer at google

#

we came to it afterwards he said he cant understand what docs are saying...

onyx fjord
#

k why are END_ROD particles feaking out

viscid ember
onyx fjord
#

its like, there are partcicles and after few ticks poof

#

explosion

ancient plank
boreal seal
#

hold my beer

onyx fjord
#

wait

#

do particles have velocity?

boreal seal
tardy delta
chrome beacon
#

Not all entities can be damaged

mighty aurora
#

That would do what exactly? Check to see if the player does the damage and then set the players health to 0?

waxen plinth
tardy delta
#

looking thro the code of supervanish

boreal seal
#

Player player = event.getplayer

mighty aurora
#

I was reading that and was like "da frick"???

boreal seal
#

player.sethealth(0)

mighty aurora
#

yeah

boreal seal
#

@onyx fjord i leave the chat 2digits citizens are back..

mighty aurora
#

The whole goal was damage an entity. That code wouldn't damage an entity it would kill the player...

viscid ember
waxen plinth
#

Nonliving ones

chrome beacon
#

^^

viscid ember
#

πŸ’€

waxen plinth
#

Go damage an arrow

tardy delta
#

you better be kiddin me

waxen plinth
#

Those count as living

viscid ember
quaint mantle
#

Zombie implements LivingEntity

tardy delta
#

ye i will paste gh code for sure

#

lmfao

viscid ember
#

yh zombie is still "living entity"

#

and even after i check if its living entity it doesnt answer my question of how do i damage it

#

nvm

#
                        for(Entity e : near) {
                            if (e.getLocation().distance(loc) <= radius) {
                                if (e instanceof LivingEntity) {
                                    ((LivingEntity) e).damage(3);
                                }
                            }
                        }```
quaint mantle
#

I don't think there is a damage method, I think you need to get it's health, subtract from it and set it back.

tardy delta
#

check instanceof before calculating disatance

quaint mantle
viscid ember
viscid ember
#

Ik its bad practice but is there a way to just live reload my plugin with out constantly stopping my server

quaint mantle
mighty aurora
chrome beacon
mighty aurora
viscid ember
quaint mantle
#

Why would live reloading be "bad practice"?

small current
#

im creating a custom item
i want to set the texture to the heart texture for particles

#

what should i put

tardy delta
#

google it

viscid ember
#

thats resource packs...

small current
#

google got nothing

quaint mantle
#

Unless you are live reloading in a production environment, I don't think live reloading could be considered bad practice.

small current
#

i know its resource pack

#

but a little help

onyx fjord
tardy delta
#

ah youre spawning particles

#

nvm then ig

small current
#

no

round finch
#

it CustomModel Data

#

json

small current
#

the particle texture

#

i want to use it for the item

mighty aurora
tardy delta
round finch
small current
#

i want to use this texture

tardy delta
#

refers to the textures/item folder iirc

small current
#

im not doing any java

#

im making a resource pack

round finch
#

ah

small current
#

this is what is changes to

#

it can change in to a gold ingot

#

but when i do particle/heart

#

not working

waxen plinth
#

Is particle/heart a real particle

#

Didn't it get renamed

small current
#

it works

small current
small current
mighty aurora
#

attempted to register an invalid EventHandler method signature "public void us.newrealms.timebounditems.darkMist.damage(org.bukkit.event.player.PlayerMoveEvent,org.bukkit.event.entity.EntityDamageByEntityEvent)" in class us.newrealms.timebounditems.darkMist I just got this error. What exactly does it mean?

waxen plinth
#

Why are you trying to take 2 events in one method

chrome beacon
#

^

chrome beacon
small current
#

what model should i point it to

old geyser
#

!paste

chrome beacon
old geyser
#

/paste

delicate lynx
#

?paste

undone axleBOT
small current
#

there is no tutorial for it
its all blockbench

#

for changing it to a big ass sword or whatever

chrome beacon
#
{
  "parent": "minecraft:item/generated",
  "textures": {
    "layer0": "minecraft:item/iron_nugget"
  }
}

for example

small current
chrome beacon
#

Try minecraft:particle/heart

tardy delta
#

when i was trying to make my own cf like class

mighty aurora
# waxen plinth Why are you trying to take 2 events in one method

I'm creating a dash ability and its meant to detect when the player is dashing and also if the player takes damage. This is so that I can cancel damage done to the player. I also want to do damage to the entities the player collides with so because I don't know how to detect entity collision I am simply making it so anything that attacks the player takes damage. To do this I needed to listen to both events. Unless it would be better to instead have it listen for damage check the players velocity(to determine if they are dashing) and then if they pass the check to do all of what i said before(cancel damage and then deal damage back).

small current
waxen plinth
#

Take two events in one method, I mean

mighty aurora
delicate lynx
#

when the player is in a "dash," somehow track that

waxen plinth
#

That's the best solution

mighty aurora
#

I check that by checking their velocity

waxen plinth
#

Keep a map or set

delicate lynx
#

then when they try to take damage, see if they are on a list and cancel based on that

waxen plinth
#

They could just be falling really fast

#

Don't use velocity

small current
#

yay thanks

waxen plinth
#

Track it properly

round finch
mighty aurora
#

The dash is supposed to last less than a second...

#

So basically I would be adding something(say a pdc) to the player wait 1 second and then remove it again

worldly ingot
#

At that point it doesn't need to be a PDC entry

#

The P in PDC is persistent

quaint mantle
tardy delta
#

the P in PDC lmao

#

πŸ₯²πŸ”«

#

im sorry

waxen plinth
#

Use a set or a scoreboard tag

round finch
#

persistent data dashing is temporary?

#

fr?

waxen plinth
#

Scoreboard tag is also persistent though

#

So a set is probably best

tardy delta
#

hehe i once added pdc entries to a player and wiped the server world files to reset the world and then i wondered why the player data was gone πŸ€”

quaint mantle
#

oof

#

Sounds like something I would do lol

round finch
#

why not add them to some sort of list?
if it is temporary memory

quaint mantle
round finch
#

ahhh so spam attack?

#

if it is multiple attacks oof

quaint mantle
#

It guarantees that an item cannot be evaluated more than once in a foreach loop.

mighty aurora
delicate lynx
#

do not use wait

tardy delta
#

^^

delicate lynx
#

use the bukkit scheduler

tardy delta
#

wondering why youre using wait tho

#

?scheduling

undone axleBOT
round finch
#

thanks for that information

#

me having a bunch of ifs

#

what happens if you do add same thing to set?

#

ignores it?

quaint mantle
#

In c# the add method would return false, in java it might be the same or it throws an exception...

opal juniper
#

it returns a boolean

#

true if successful

quaint mantle
#

Yeah, so probably returns false if it was ignored

round finch
#

would it throw error?

opal juniper
#

no

delicate lynx
#

it does return a boolean, that is neat to know

old cloud
#

Any idea why Material#matchMaterial(String) works fine in my IDE but will return null on the server?

quaint mantle
#

Are the strings uppercase?

old cloud
#

yes but that shouldn't matter anyway

round finch
quaint mantle
#

What input are you providing it?

#

The first and most obvious reason could be that the material you are trying to reference doesn't exist on the server

rough drift
#

How do I use the database: true in the plugin.yml

opal juniper
#

thats a thing?

rough drift
#

yeah

#

I just don't know how to access it

opal juniper
#

ask choco

delicate lynx
rough drift
#

That is true

#

just for bukkit only

#

So you know

rough drift
opal juniper
#

if you want him to read it, ping him. if you dont want to ping him, ask in paper. the devs of that intellij plugin are in there

rough drift
#

I'll ping him hoping that he doesn't get mad

rough drift
worldly ingot
#

It was removed. Doesn't exist anymore

rough drift
#

Oh

#

Thanks

opal juniper
#

im a genius

#

got you that answer real fast

worldly ingot
#

Plugins used to be able to use a NoSQL Ebeans database but we removed the dependency because practically nobody at all used it

rough drift
#

Okay

opal juniper
worldly ingot
#

Yeah, believe it or not, all CraftBukkit servers had a local database lol

rough drift
#

Would've made life easier, however I got an idea for a work around:

Use local file unless db is specified

worldly ingot
#

JavaPlugin#getDatabase() ;p

rough drift
#

Yeah

old cloud
opal juniper
worldly ingot
#

Yeah it was removed a little bit ago

#

I want to say around 1.10?

rough drift
#

Ah so a couple of years

winged anvil
#

does anyone know of good examples of plugins that manage a lot of messages in config

#

or have any ideas on how to manage hella messages

timid jetty
#

AttributeInstance armor = player.getAttribute(Attribute.GENERIC_ARMOR);
armor.setBaseValue(bonusToughness);

just making sure this is how I would add bonus armor to a player right. and wearing armor is additive to this value?

worldly ingot
rough drift
#

Can I technically run my own Ebean server then

#

would that be a good thing or a bad thing

worldly ingot
#

I mean Ebean was just an ORM

#

You can shade and use Ebean if you want

rough drift
#

Should I? or should I just add a config for db

worldly ingot
#

You would need to do both. Again, Ebean is an ORM. It's basically a way for Java to map an object to an SQL supported structure

#

Hence ORM, Object-Relational Mapping

rough drift
#

oh

#

Well I meant more start up a lightweight DB within the plugin itself

worldly ingot
#

You could use SQLite or something. Whether or not you prefer using Ebean is up to you. I personally hate ORMs. I find them clunky. But others swear by them

#

But Ebean on its own is nothing. It needs a database

rough drift
#

Oh ok

worldly ingot
#

If you Google for a bit of Ebean documentation you'll kind of get what I'm saying a bit more

reef lagoon
#

Pro tip: Press Insert to enhance user experience on intellij

worldly ingot
#

Insert has its uses. I'm just to stubborn to take advantage of it :))

rough drift
#

I now have another question: How would I be able to start a lightweight db within my plugin? Could I just use a .db file and JDBC driver for it?

waxen plinth
#

SQLite yeah

rough drift
#

Alright, thank you! :D

waxen plinth
#

SQLite is good for if you need to store data that's not cross-server

#

It's fast but only supports single thread access

rough drift
#

Yeah, btw still haven't added brigadier support, sorry xD

waxen plinth
#

I started on it

#

Got it like 90% done

rough drift
#

Oh, nice

waxen plinth
#

Scrapped it because I hate brigadier

chrome beacon
#

Brigadier is nice

waxen plinth
#

It's pretty terrible

#

No optional arguments, no flags

rough drift
#

brigadier has optional args?

waxen plinth
#

Trying to build abstractions on it is a nightmare

waxen plinth
#

Well

rough drift
#

I remember it did

waxen plinth
#

It only has nodes

rough drift
#

Oh well yeah

waxen plinth
#

You can create optional arguments

rough drift
#

you can make it yourself

waxen plinth
#

But the way you do it sucks

#

Here's the code I wrote for brig support if you want to try your hand

#

I'm probably not going to bother

#

The benefits aren't worth it

opal juniper
#

lol

waxen plinth
#

Don't

#

Obfuscation is dumb seriously just don't

#

I promise your code isn't special and people aren't gonna steal it

rough drift
#

^

waxen plinth
#

My guy

#

I don't need to steal your code

rough drift
#

I was also like that, however I realized my code is shit and has been done countless times

waxen plinth
#

I much prefer to write it myself

rough drift
#

Since them I am depressed, but at least I have no problems sending stuff

serene onyx
#

But i wanted to steal it!

waxen plinth
#

No reason to be depressed about it

rough drift
waxen plinth
#

Ok

serene onyx
#

lol

waxen plinth
#

100% serious

rough drift
#

My code be like: Random operators go brrrrr please get the right numbber

waxen plinth
#

Most of my code is just on github

serene onyx
#

One day ur code will be mine😈

waxen plinth
#

With MIT license

#

I basically encourage people to steal it

#

Credit is appreciated but not required

rough drift
#

Today I just had no idea what do to, so I just put stuff at random and came up with x * maxY + y + (1 * (x + 1)), somehow it works perfectly

opal juniper
#

hmm, i always wondered how that whole gpl inheritance thing actually worked

waxen plinth
#

It doesn't if it's not enforced lol

opal juniper
#

i usually go with MIT, but i think my MC plugins are sometimes GPL as well

waxen plinth
#

If they really get annoyed that my library isn't GPL I will change it

#

But I like MIT a lot better

#

And nobody's gonna say shit about it lol

opal juniper
#

i mean yeah, its basically the bare minimum tbh

waxen plinth
#

Free and open information is the best kind

#

On the spigot stash

rough drift
#

?buildtools

undone axleBOT
rough drift
#

Or there

#

buildtools gives you the source iirc

waxen plinth
#

Yeah it does

rough drift
#

The stash is only needed if you contribute

#

Good luck buddy

waxen plinth
#

Good luck