#development

1 messages · Page 112 of 1

lyric gyro
#

Keep in mind they are still being sent a shit ton of particle packets

vivid summit
#

can those packets be prevented, like with the use of plib?

proud pebble
#

an anticheat but instead of banning you just lags out your game with a bunch of particles

#

or just chunk bans you

dusky harness
#

you can create a counter

#

btw do u mean sharpness particles?

vivid summit
#

nope, just the damage particles itself

#

the dark red hearts

dusky harness
# vivid summit the dark red hearts

assuming this is 1.18 (or recent), u can do something like this: ```java
// im typing this in discord so i dont think this is 100% correct

private final Map<UUID, Integer> particles = new HashMap<>();
private final int LIMIT = 10; // particles sent per tick

// particle listener
ProtocolLibrary.getProtocolManager().addPacketListener(
new PacketAdapter(PacketType.Play.Server.WORLD_PARTICLES) {
@Override
public void onPacketSending(PacketEvent event) {
onSend(event);
}
}
)

private void onSend(PacketEvent event) {
final PacketContainer packet = event.getPacket();
final Player player = event.getPlayer();
if (packet.getNewParticles().read(0).getParticle() != Particle.DAMAGE_INDICATOR) { // I think that's what the particle is? if this doesn't work, try printing out the particle
return;
}
final int originalAmount = packet.getIntegers().read(0);
final int storedAmount = particles.getOrDefault(player.getUniqueId(), 0); // particles already sent
if (storedAmount >= LIMIT) {
return;
}
final int amountLeft = LIMIT - storedAmount; // amount of particles left that can be sent this tick
final int amount = Math.min(amountLeft, packet.getIntegers().read(0)); // amount of particles to send, limiting it to amountLeft
if (amount <= 0) { // no particles
event.setCancelled(true); // no point in sending a particle packet if there are none
return;
}
Bukkit.getScheduler().runTask(plugin, () -> {
final int current = particles.getOrDefault(player.getUniqueId());
particles.put(player.getUniqueId(), current - amount);
}); // put the counter down next tick
if (amount == originalAmount) {
return; // nothing to change
}
event.getIntegers().write(0, amount); // set the new particle amount
}

summer ingot
#

how does one host a discord bot for free?

#

i know there's ways but i have no clue how to do it

cinder forum
summer ingot
#

Java

cinder forum
#

well

#

i think you can use Oracle VPS free tier for hosting anything

summer ingot
#

i can't really figure that out

#

i tried but it's real confusing

cinder forum
#

Have you ever used Linux terminal?

summer ingot
#

i have not

#

i was following a tutorial for the oracle hosting but when i got to uploading SSH keys i didn't know what to do

#

i don't have any of those

warm steppe
#

like the server works and all

#

but it seemed like certains ports are blocked

cinder forum
#

then amazaon vps ig

#

they have free tier too i think

river solstice
#

what's the real way to get player ip on join?

warm steppe
river solstice
soft solar
#

What version are you on?

#

Anyway i'd suggest you take a look at the Javadocs

grizzled prawn
#

i am a beginner at java so whats override and subclass i tried searching it up but google gave me answer i didnt understand

graceful hedge
#

a subclass is a class which extends another class, which gives the subclass the same methods and variables as the super class (not private or package private ones)

#

then you also get some other cool properties such as that an instance of your subclass can be assumed as just the type of the super class

#

thus something like:
Superclass variable = new Subclass();
is possible

grizzled prawn
#

.

#

wtf

#

um thanks for definition

severe heath
#

Hey guys where can i find nbt data for items in a players inventory?

grizzled prawn
#

also whats override?

severe heath
#

Anybody know where nbt item data is stored?

graceful hedge
#

In regards to overriding...

class IAmTheSuperClass {
  
  void printTen() {
    print(10);
  }
}
class Sub extends IAmTheSuperClass {
  @Override printTen() {
    print(11);
  }
}

class Main{
  public static void main(String... args) {
    new Sub().printTen() //would print 11
    new IAmTheSuperClass().printTen() //would print 10
  }
}```
severe heath
#

@graceful hedge u seem to know what you're doing. Where is nbt item data stored?

graceful hedge
#

Stompyblue
mainlevel/playerdata/uuid.dat

severe heath
graceful hedge
#

here

#

that folder

#

where world is the level entered in server properties

severe heath
graceful hedge
#

wym

severe heath
# graceful hedge wym

Im using nitropanel. Its got all the folders as shown there, but i dont know how to access those folders on the server using my plugin?

severe heath
severe heath
graceful hedge
#

1 please stop pinging me in every reply of yours

#

2 get the primary world by Bukkit.getWorlds().get(0)

#

3 get the folder of that world

severe heath
graceful hedge
#

4 locate the playerdata folder

severe heath
graceful hedge
#

if you shift click reply, it wont turn on ping by default

broken elbow
#

🩴

graceful hedge
#

👲

broken elbow
#

📂

graceful hedge
#

📕

dusky harness
#

so

#

🙃

broken elbow
#

🟪

graceful hedge
#

🟥

dusky harness
#

oops

#

2 hour late

broken elbow
#

⏱️

dusky harness
#

lol

robust flower
#

Every time I start my waterfall plugin, these messages are printed in red because I think waterfall/bungeecord doesn't like having other loggers being used

[19:17:09 ERROR]: [main] INFO com.github.secretx33.dependencies.friends.hikari.HikariDataSource - HikariPool-1 - Starting...
[19:17:09 ERROR]: [main] INFO com.github.secretx33.dependencies.friends.hikari.HikariDataSource - HikariPool-1 - Start completed.```
Logger used
```kt
runtimeOnly("org.slf4j:slf4j-simple:1.7.32")```
But I just put it there because otherwise Hikari prints a huge complain about operating in "no-op" mode or whatever. Is there a way to make Hikari use Waterfall default logger, and if so, how can I do that?
severe heath
graceful hedge
#

pog

warm steppe
summer ingot
#

is IntelliJ Idea Ultimate just a premium version of IntelliJ?

robust flower
#

yes, with more features

summer ingot
#

Will I be okay with the community edition as a beginner

robust flower
#

yes

summer ingot
#

okee dokie thanks!

warm steppe
summer ingot
#

yeah i don't plan on paying for anything yet until it's something i really wanna do

warm steppe
#

nono the community version is ok

#

i think that nobody is paying for ij ultimate here lol

summer ingot
#

santa mitten

#

lol

#

but yea i dont need it

#

is eclipse = intellij?

#

they both do the same thing right

warm steppe
#

nonon

#

eclipse... welp forget about it

summer ingot
#

i thought it was like eclipse = intellij and maven = gradle

warm steppe
#

i mean

summer ingot
#

but the new better thins to use are ij and grdl

warm steppe
#

they're both ide's

#

but yeaj use ijtellij + gradle

summer ingot
#

IDE stands for..?

warm steppe
#

integrated development environment

summer ingot
#

gotcha

#

i'm gonna try some java courses

#

been trying to learn and keep getting stuck absolutely lost

warm steppe
#

yeah and also we should move to #dev-general because otherwise some support nerd is going to kick our asses

summer ingot
#

oh yea lol woops

fiery pollen
#

So i am coding this ticket bot and i want to make like a transcript when someone closes the ticket. So i have all the messages in that ticket stored, where should i put them, in like a file? or in like a pastebin?

compact cypress
#

#carl #yag #DoWeReallyNeedAnyMore 😂

dusky harness
#

pastebin api ez

#

or no

#

ez

summer ingot
#

What does the error

Class 'MyFirstPlugin' is never used:5```
mean? This is my code:

```yaml
package com.magnummc.myfirstplugin;

import org.bukkit.plugin.java.JavaPlugin;

public final class MyFirstPlugin extends JavaPlugin {

    @Override
    public void onEnable() {
        System.out.println("Hello, world!");

    }

    @Override
    public void onDisable() {
        System.out.println("Goodbye, world!");
    }
}
#

Trying to learn my errors little at a time.

dusky harness
#

btw use ```java
// code here
```

summer ingot
#

gotcha

#

makes sense

dusky harness
#

👍

#

btw

summer ingot
#

also, does this main class name look right?
"com.magnummc.myfirstplugin.MyFirstPlugin"

dusky harness
#

it just means that you're never using that class
this doesn't mean that spigot isn't using it :)

summer ingot
#

alrighty !

#

now, it's time to learn how to actually build it

dusky harness
#

gradle 😋

summer ingot
#

i've got gradle and intellij installed

dusky harness
#

can you show me ur build.gradle?

summer ingot
#

and im using the mcdev plugin on intellij

dusky harness
#

ah

summer ingot
#

my only concern, does the plugin only support 1.15 because I see no higher.

dusky harness
#

in build.gradle, where you see 1.15.2 just change that to whatever version

#

this is how u build

#

then the jar will be in build/libs/ProjectName-Version-all.jar

#

if shadowJar isn't there, then go to build -> build instead

summer ingot
#

hm yours looks a little different than mine.

#

one s

dusky harness
#

i got some cool stuff installed

#

:))

#

if u want i can list them

#

lol

summer ingot
#

org.bukkit:bukkit:1.15.2-R0.1-SNAPSHOT
this is the only 1.15 i see in my build.gradle

#

is that right?

dusky harness
#

bukkit thonking

#

can u show entire build.gradle?

neat pierBOT
#
FAQ Answer:

Paste Services
When asking for help with a config/menu/code issue please use our paste bin:
(we prefer it over pastebin.com)
HelpChat Paste - How To Use

summer ingot
#

i was in between servers, another group of ppl told me to use bukkit

dusky harness
#

that doesn't include the spigot api tho

#

just use what it originally was - org.spigotmc:spigot-api:1.18.1-R0.1-SNAPSHOT i think

summer ingot
#

in place of the 1.15.2 part i sent?

dusky harness
#

but

#

still

dusky harness
#

in place of org.bukkit:bukkit:1.15.2-R0.1-SNAPSHOT

summer ingot
#

thats what i meant but yea

dusky harness
#

true

#

true

dusky harness
#

yea

summer ingot
dusky harness
#

then double click the build button in there

summer ingot
#

gotcha

#

so how do i export this

dusky harness
#

once u clicked the build button

#

it should do a bunch of stuff

summer ingot
#

yep ive got the jar

dusky harness
#

ye

#

then put it in plugins folder

#

then

summer ingot
#

inside build and whatnot

dusky harness
#

kaboom

summer ingot
#

okaee

#

ill test

#

first lines of code ive ever written and ran

dusky harness
#

if u want the same theme and stuff i have:

plugins:

  • .ignore
  • Atom Material Icons
  • Discord Integration (although i personally don't use it much now 🤡)
  • Material Theme UI Lite (Or you don't need Lite if you're a student, you can email the author with proof)
  • Minecraft Development (at least have it disabled, it still does things even when disabled.. lol such as plugin.yml checking)
  • Rainbow Brackets ( 🌈 )
  • Statistic
  • WakaTime (shows how much you're procastinating 😎)

settings:

  • Editor -> Color Scheme -> Color Scheme Font -> Fira Code Medium (or any font that supports ligatures) and enable ligatures, makes everything look nice
  • Appearance -> Theme: Atom One Dark (Material)
  • Appearance -> Material Theme UI -> Settings -> Advanced Settings: Features -> Striped Tool Windows

|| jeez why do I have so much ||

summer ingot
#

jesus what is your wpm

dusky harness
#

🤣

summer ingot
#

thanks btw :)

dusky harness
#

i wrote this before

#

so

#

but i found it

summer ingot
#

oh gotcha

dusky harness
#

:))))

summer ingot
#

its still fast af

dusky harness
#

lol

summer ingot
#

so, i can only run the plugin ona server version identical to the one I made the code on right

#

so for example, only spigot 1.18

dusky harness
#

well

#

sort of

#

for now

#

just think of it like that

#

🙂

#

oh also

#

in plugin.yml

#

add ```yml
api-version: 1.18 # not 1.18.1

summer ingot
#

yeah, multiple versions has gotta b confusing

#

lmao thx for the edit

#

i just put 1.18.1

dusky harness
#

🥲

summer ingot
#

that means i need to rebuild right

#

since i didnt do that b4

#

would it be the same process as before?

dusky harness
#

yep!

#

also

#

with the power of gradle (and intellij)

#

u can build and copy the server and start the server in one click

#

:))

summer ingot
#

sounds kinda confusing ngl

dusky harness
#

lol

#

yea, for now lets keep it simple

summer ingot
#

a server on text editor???

#

🤯

dusky harness
#

intellij is IDE, not text editor 😉

summer ingot
#

right

#

internet developing ecoding

#

👍

#

integrated development environment right

dusky harness
#

yea

dusky harness
#

👀

summer ingot
#

lol i honestly didnt know for a sec

#

it'll stick eventually

dusky harness
#

i mean as long as you have the basic idea it's fine 🙃

summer ingot
#

i need more monitors

#

discord, minecraft, intellij, google, youtube

dusky harness
#

lol

#

5 monitors

#

:))

summer ingot
#

ill need another gpu

#

hello world is produced into the console right?

#

wait dont tell me

#

ill see soon

dusky harness
#

👀

summer ingot
#

spawn is takin quite a long time to load

#

it's stuck at 0%

dusky harness
#

uhhhh

#

thats

#

not a very good sign

summer ingot
#

actually thats probably bcuz my memory is limited

#

minecraft was turning on

#

IT WORKED

#

[22:33:41 INFO]: [PluginOne] Enabling PluginOne v1.0-SNAPSHOT
[22:33:41 INFO]: Hello, world!

#

YES

#

yea but 85s to finally load

#

lol woops

dusky harness
#

PoG

dusky harness
summer ingot
#

and my plugin said goodbye to me!

#

so kind :D

dusky harness
#

🙂

#

then build off ur plugin from there

#

maybe like a /hello command

#

yk

summer ingot
#

I'd like to make a greetings plugin

#

Something simple

#

seperate from essentials

#

but IDK how to setup playerjoinevents yet or anything like that

dusky harness
#

you'll learn soon 😉

lyric gyro
summer ingot
#

thats exactly what it feels like

summer ingot
#

If I choose Paper for my plugin type will it be exactly the same thing I just have to change the snapshot thingey

proud pebble
#

what those for loops are for handling retroactive items, so if i decide to do my own handling of an enchant then i can remove vanilla enchants from said item, if i decide that i dont want to handle an enchantment anymore its vanilla version will be readded to the item, something i need to do later is check if said enchant is actually allowed to be vanilla, if not then dont.

summer ingot
#

the question is does it work

summer ingot
#

holy it worked :O

summer ingot
#

how do i setup a config file for my plugin?

#

all i can find are outdated videos that are not using intelliJ

bright pier
#

(Mind blank noob question time)
What's the best way to check if a player is falling when they log in (using the PlayerJoinEvent) (spigotapi, not paper)

round sail
#

Either velocity or move event checking from and tyo

#

to*

bright pier
#

I tried player.getVelocity().getY() < 0 but it didn't work

rigid mountain
#

Question, so im using mongo db and i have a collection with documents that have something like number: 1 and number: 2 and so fourth, how can i get the highest number?

summer ingot
#

I'm going to bed, so I'll just leave this here, but I'm curious as how to create a custom config file for my greeting plugin.
I'd like to make a config where the join/leave message would be edit-able through this config, but I'm just not sure where to start.
https://github.com/MrCow98/MilkyGreet This is the plugin I created if you'd like to look through the code.
Just looking for all the help possible! A short example config relative to what I'm doing would be nice, but a good ol' explanation works just fine.
(Please ping me, I'm asleep by the time this gets a response)

river solstice
#

how do I get player's IP address? (1.16.5)

#

PlayerLoginEvent#getAddress().getHostName()
PlayerLoginEvent#getRealAddress().getHostName()
PlayerLoginEvent#getHostName()?

#

so many confusing methods

lyric gyro
#

Probably get host name

lyric gyro
river solstice
#

Well I just need their IP as string.

marble nimbus
#

Heyy, What is the easiest way to make a time"listener"? I want to run some methods once its 00:00 on the specified Timezone. aka when its a new day

lyric gyro
#

How can you ask for help with something so simple and not even test it

river solstice
#

Laziness

lyric gyro
#

Odd excuse

dense drift
molten wagon
#

Is it any create way to make getWord#isChunkLoaded() use less resources or more precisely ways to use other methods to achieve same thing?

Is that method some use most buy fare inside my plugin (it almost 50% of the plugins resources). I thinking on cache not loaded location and after x time clear it do make it updated (but will add some extra delay).

dusky harness
# summer ingot I'm going to bed, so I'll just leave this here, but I'm curious as how to create...

gg on the join/leave! 😄
so, for the config, first you'll have to create the default config
So go to the resources folder (same place as plugin.yml) and create a config.yml file
That'll be the default config.yml that will be created

But spigot wont automatically detect that file, so we have to tell spigot to move that file over to plugins/YourPlugin/config.yml:

public void onEnable() {
    saveDefaultConfig();
}

Now, let's say this is our config.yml: ```yml
startup-message: "Hello from my first plugin!"
stop-message: "Bye!!"

To get the data, we have to do this: ```java
getConfig().getString("startup-message");
```and to put it in a variable: ```java
String startupMessage = getConfig().getString("startup-message");
```and to print it out: ```java
System.out.println(startupMessage);
```(note that the variable isn't required, you could just do `System.out.println(getConfig().getString("startup-message"));`)

Same goes for the `stop-message`

If you had a number or something else besides a string in the config, ex ```yml
countdown: 10
damage: 5.5
enabled: true
```you could do ```java
getConfig().getInt("countdown");
getConfig().getDouble("damage");
getConfig().getBoolean("enabled");

But what if the user changes the file? We'd have to reload the config to check for the new data ```java
// reload command
reloadConfig(); // updates the config to the new data
sender.sendMessage(ChatColor.GREEN + "Successfully reloaded!"); // being friendly :)

dusky harness
summer ingot
dusky harness
#

in the github it showed as separate

#

so

summer ingot
#

I don’t have listener in their name but the events package is in the groupid thingy

#

wadk

dusky harness
#

package :))

summer ingot
#

i was having trouble sharing it last night

#

and i was really tired so i did what i could quickly and passed out

dusky harness
#

lol

#

did u create the repo and stuff through intellij or through github?

summer ingot
#

IntelliJ

dusky harness
#

ah nice

summer ingot
#

VSC > Share to github

dusky harness
#

👍

#

then to update the code on github

#

just commit & push

summer ingot
#

oh neat

dusky harness
#

i think its ctrl k

summer ingot
#

but you said the repo was messed up or somethint?

#

whats not there that should b

#

so i can fix it

dusky harness
#

so u can just drag the events package to the main package

#

then commit and push

summer ingot
#

i thought i was supposed to put it with my com

dusky harness
#

com.magnummc.milkygreet is where everything should be (to keep it separate from other plugins and stuff), so the events package should also be in there, making it com.magnummc.milkygreet.events instead

summer ingot
#

i’ll test out the config creating when i can

#

hurt my eye from two nights in a row on the computer

#

for quite some time

queen plank
#

I made a little function for generating a random number in a set range. It works fine for negative numbers, example: %Random:-10|10% can turn into -5. But if the result is positive the following will happen: %Random:-10|10% can turn into 5|5. It always happen for positive numbers and never for negative ones. Can some help me spot the error? https://paste.helpch.at/yowazasage.http

summer ingot
#

events was in the java package

dusky harness
#

mhm

summer ingot
#

because even if i should idk how to rename them

broken elbow
#

smh dkim

dusky harness
#

wait

#

sry for ghost ping lol

summer ingot
#

all g

summer ingot
#

is that written back in the main class or inthe config

dusky harness
summer ingot
#

so instead of the print i'd put

getConfig().getString("startup-message");```
#

if that's what i wanted to do

#

was a startup message

dusky harness
#

yes: ```java
System.out.println(getConfig().getString("startup-message"));

summer ingot
#

oh gotcha.

#

if i want to write a note do i use
'//' or '#'

summer ingot
#

:) thanks

dusky harness
#

np

#

oh it was a 5 minute late response 🥲

#

lol

summer ingot
#

no worries

#

hmm

#

this will be tough

#

how do i insert the player name into the config

#

i know how i can get the actual players name but how do i write it into the config for that

#
join-message: "Welcome %player%"
quit-message: "Goodbye %player%"```
this doesn't look right.
#

i don't have a placeholder or anything

dusky harness
# summer ingot ```java join-message: "Welcome %player%" quit-message: "Goodbye %player%"``` thi...

that looks good - but you'll have to replace %player% with the code

so
Let's say the join message is just Welcome ```java
player.sendMessage(getConfig().getString("join-message"));


But if it's `Welcome %player%`, the player will also see `Welcome %player%`
So we'll have to replace `%player%` with the player's name: ```java
player.sendMessage(getConfig().getString("join-message").replace("%player%", player.getName()));
summer ingot
#

so i'm just a bit confused, where exactly would i be writing that in? is it in my main class or am i making a new class orr

#

sorry.

dusky harness
#

hmm, well if you want this in the join listener, then you can't just do getConfig()

summer ingot
#

well where would you have put it

dusky harness
#

the join listener is the only place you can put it, you'll have to use something called Dependency Injection (DI) to be able to call the getConfig() method from another class

#

it's a bit confusing at first since iirc you're new to java, but if you want I can try explaining it

#

but in the end you'd be able to do ```java
plugin.getConfig() // plugin is a variable of the main class, getConfig() is a method in the main class

summer ingot
#

well i mean if its my only option to making this work then ig i have to know

dense drift
#

Does anybody know if adventure has a way to get all sounds available for the current mc version?

round sail
#

i remember when the term dependency injection scared the hell out of me when i was semi new, only to learn I’d been doing it naturally anyways and it felt like common sense after working with it.

summer ingot
round sail
#

It doesn’t really live up to its name in complexity, once you’ve done it youll realize it’s just sort of the practice of passing parent variables in to bring necessary information

dusky harness
# summer ingot well i mean if its my only option to making this work then ig i have to know

https://paste.helpch.at/yijawupoju.java <- Example

Dependency Injection is a way of providing objects with the objects they need ("dependencies"). This is usually done with a constructor, but can also be done for individual methods
(HelpChat's explanation, but imo if you don't have the basic idea of objects and constructors, it's difficult to understand 🤷)

Remember:

  • Methods are functions that are "blocks" of code that can be executed, and they can also have parameters that pass data
    lmk if you want extra info on methods, since below I talk about constructors and stuff which is a special type of method
  • Variables hold data, and there are two types of variables: local variables and fields, fields which belong to a class and local variables which belong to a method

A constructor is a "method" used when creating a new instance/object of a class
For example, when you do java getServer().getPluginManager().registerEvents(new PlayerQuit(), this); you're creating a new instance of PlayerQuit, and since all methods have () (for parameters), and a constructor is a method ("behind the scenes"), that's why when you do new PlayerQuit(), there are parenthesis
And to make constructors even easier to identify, you always have to have new in front of it (since you're creating a new instance of the class)

With objects/instances, you can also store them in a variable: ```java
PlayerQuit playerQuit = new PlayerQuit();
getServer().getPluginManager().registerEvents(playerQuit, this);

#

But what's the point of the constructor?
It can be used to:

  • run code when the instance is created (since remember - it's a method)
  • give the class extra data (which is what we're trying to do - we're trying to give the join listener our plugin instance to get the config) - because methods can have parameters

So to create a constructor: ```java
public class JoinListener {
public JoinListener() {

}

}
```this doesn't do anything since the parameters are empty and there is no code inside the {}

If we do this: java public class JoinListener { public JoinListener() { System.out.println("Created JoinListener instance!"); } } now, whenever we do new JoinListener(), it'll print out Created JoinListener instance!

But we need the plugin instance to be able to do getConfig(), so we pass it through a parameter and create a variable/field: java public class JoinListener { private final MilkyGreet plugin; // final just means the variable can't be changed public JoinListener(MilkyGreet plugin) { this.plugin = plugin; // this. just means that we're accessing a field instead of the parameter // If this. is confusing, then think of that as this: // pluginField = pluginParameter; } } then since we have a MilkyGreet instance, anywhere in JoinListener, we can use plugin: ```java
@EventHandler
public void onPlayerJoin(PlayerJoinEvent e) {
Player player = e.getPlayer();
String message = plugin.getConfig().getString("join-message").replace("%player%", player.getName()); // get the config message and replace %player% with the player's name
player.sendMessage(message);
}


Now that the constructor has a `MilkyGreet` parameter, we need to fill that in in the main class: ```java
new PlayerJoin(this); // it's "this" because the class we're writing this in is MilkyGreet

Since you're pretty new to java, this might be confusing, so feel free to ask :))

summer ingot
#

wow thank you sm

#

i'll read and lyk

dusky harness
summer ingot
#

so int, which stands for integer, is a variable?

#

or it isnt itself a variable but it stands for a variable?

dusky harness
summer ingot
#

so should i create two new classes for the join and quit listeners

dusky harness
#

you already have them created

summer ingot
#

oh i didnt know if i needed new ones

#

okay

dusky harness
#

nope, you're current ones will work fine

summer ingot
#

can i have more than one event handler

dusky harness
#

yes

summer ingot
#

and what is the difference between

    @EventHandler
    void onPlayerJoin(PlayerJoinEvent e){
{```
and 
```java
    @EventHandler
    public void onPlayerJoin(PlayerJoinEvent e){
}```
#

what does the public do in this case

dusky harness
#

spigot does some cool magic called reflection so it can bypass it

summer ingot
#

so can i just leev it

dusky harness
#

but if it didn't use reflection, it would have to be public

#

yes

summer ingot
#

cool

dusky harness
#

and for ex onEnable has to be public

#

or else it'll error

summer ingot
#

i'm not gonna lie, you explained it but i'm lost.

dusky harness
summer ingot
#

just where do i even start to begin creating it

#

all i'm trying to do riight now is setup the config, but in order to have the players name said when they join, we are doing all this fancy stuff

dusky harness
#

the other stuff goes in the JoinListener class

#

and since a constructor is a type of method, it goes in the same place another method would go

summer ingot
#

i tried just going word for word and got a few errors

#

for example in the code you sent me you have only

public class JoinListener {
// code here
}```

but mine is 
```java
public class PlayerJoin implements Listener {
// code
}```
if i remove implements listener i get errors
dusky harness
#

yea

#

add implements Listener

#

mb

summer ingot
#

all g

#

aswell as this

#

you put

        getServer().getPluginManager().registerEvents(new PlayerJoin(this), this);```
but if i put that with two this' then i get errors
#

my original one only has the second this

dusky harness
#

or else it'll error

summer ingot
#

oh i havent done that

#

lemme go look at ur msg agin

#

aw i got no picture perms

#

it still shows error but theres an option to click this time

neat pierBOT
#
FAQ Answer:

You won't be able to upload images here directly to avoid spam, so please use https://imgur.com/ to upload images/screenshots.
You can also use a screenshot service like gyazo or jinx and post those links here.

summer ingot
#

cool

#

thats what it shows me

#

i made the constructer tho

dusky harness
#

now im guessing you have new PlayerJoin() instead of new PlayerJoin(this)

#

show both classes

neat pierBOT
#
FAQ Answer:

Paste Services
When asking for help with a config/menu/code issue please use our paste bin:
(we prefer it over pastebin.com)
HelpChat Paste - How To Use

summer ingot
dusky harness
#

ah

#

well, now you have a constructor but without any parameters and stuff (I explain that later in the message, but just taking it step by step)

atm it'll print out Created PlayerJoin instance! whenever you create the instance - so in onEnable

summer ingot
#

uhh

#

i did it

dusky harness
#

😮

summer ingot
#

neat

#

no more errors :D

dusky harness
#

gg :)

summer ingot
#

i gotta learn how to read first then ill learn to code

#

sometimes i jus read to fast and blow ovr stuff

cinder forum
#

is the warning useless or should I do it other way

rugged bane
#

you haven't used the variable

#

so I'd just do new WorldMnager(); instead

cinder forum
#

oh yeah 🤦‍♂️ thank you

rugged bane
#

hha np we've all been there

#

Very handy tip I use a LOT btw, if you do need to make a variable, append .var to the end and press enter

#

E.g. new WorldManager().var it'll create a variable you can type straight away

cinder forum
#

👍 thx

pulsar ferry
#

Tbh that could be just a static util method lol

icy shadow
#

Side effects in constructors 😵‍💫 😵 🤧 💀 😖

pure crater
#

i love my side effects

#

😍

icy shadow
#

you're going to hell

cinder forum
#

Hi, how to get safe spawn location location of world? 🤔

#

and Bukkit#getWorlds#get(0) is always world in server.prop?

pure crater
#

😍

#

ok and? 😄

proud pebble
#

if you want a random safe location then just do the check but with 2 randoms for x and z

summer ingot
# dusky harness gg \:)
    @EventHandler
    public void onPlayerJoin(PlayerJoinEvent e) {
        Player player = e.getPlayer();
        String message = plugin.getConfig().getString("join-message").replace("%player%", player.getName()); // get the config message and replace %player% with the player's name
        player.sendMessage(message);
    }``` what is this?
#

and where do i put it?

#

i dont see it in the code you sent to me so i'm just a little confused as to what it is

#

wait nvm im blind sorry for the ping

#

also, now that i have the config all setup, do i need to still have this?

        e.setJoinMessage(ChatColor.GRAY + "[" + ChatColor.GREEN + "+" + ChatColor.GRAY + "] " + ChatColor.GOLD + ChatColor.BOLD + player.getDisplayName());```
proud pebble
#

if you have many color codes you could just use the chatcolor.translatecolorcodes thing

summer ingot
#

alright i think my code might be done :O

#

complete for now atleast ;p

#

what do you usually specify as your commit message

#

second commit? :P

round sail
#

"aaaaaaaaaaaaaaaaa"

#

or sometimes "fuck this bug" Pepega

summer ingot
#

lol

#

it was not bug

#

just update!

#

?imgur

neat pierBOT
#
FAQ Answer:

You won't be able to upload images here directly to avoid spam, so please use https://imgur.com/ to upload images/screenshots.
You can also use a screenshot service like gyazo or jinx and post those links here.

summer ingot
#

got a warning

#

am i good to ignore it?

round sail
#

technically

summer ingot
#

👍

#

cool beenz

broken elbow
broken elbow
summer ingot
#

yea i believe so.

broken elbow
#

then add a null check for message before sending it

#

because if the join-message option was removed from config.yml, spigot will return null and when a player joins you'll get an NPE

summer ingot
#

ill look up what a null check is first and then if i cant figure it out i'll ask but i'll try and figure it out myself first

#

thanks :)

broken elbow
#

yes. I have words. I have the best words

summer ingot
#

that makes sense

#

it just checks if it's null and if it is then i assume exit means it shuts down the plugin?

broken elbow
#

no

#

return;. you just exit from that method

#

so you don't execute the code after which is player.sendMessage(message);

clever relic
#

Anyone know of an API that gets news with certain key words?

broken elbow
#

it has keyword or phrase searching

#

and a few other search types

#

or filters

#

whatever you want to call em

clever relic
summer ingot
#

im in error land

broken elbow
#

lol

summer ingot
#

apparently my "s" is an error

broken elbow
#

if you want help share code and errors

hard wigeon
#

Using fabric & brigader,

#

Any clue why this command just isn't registered?

        CommandRegistrationCallback.EVENT.register((dispatcher, dedicated) -> {
            LiteralCommandNode<ServerCommandSource> dimensionHunterNode = CommandManager
                    .literal("testcommand")
                    .build();
            LiteralCommandNode<ServerCommandSource> setNode = CommandManager
                    .literal("set")
                    .then(argument("player", EntityArgumentType.player()))
                    .executes(this::setCommand)
                    .build();
            LiteralCommandNode<ServerCommandSource> removeNode = CommandManager
                    .literal("remove")
                    .then(argument("player", EntityArgumentType.player()))
                    .executes(this::removeCommand)
                    .build();
            dispatcher.getRoot().addChild(dimensionHunterNode);
            dimensionHunterNode.addChild(setNode);
            dimensionHunterNode.addChild(removeNode);
        });

I run it in my onInitialize
and it's just not there when I start the game

summer ingot
#

weird, looks like it's working now

#

all i did was switch the notes i made from "//" to "#" and it worked lol

#

^ for the config

hard wigeon
#

YAML uses # for comments

summer ingot
#

damn i thought so

#

i didn't clarify earlier when i asked

#

so they probably assumed i was making notes on a java class

dusky harness
#

i thought you were talking about java 🥲

lyric gyro
hard wigeon
#

yup

#

it just doesn't register

lyric gyro
#

also the other two cmds are wrong btw lol

hard wigeon
#

oh?

#

explain

lyric gyro
#
            LiteralCommandNode<ServerCommandSource> setNode = CommandManager
                    .literal("set")
                    .then(argument("player", EntityArgumentType.player()).executes(this::setCommand))
                    .build();
            LiteralCommandNode<ServerCommandSource> removeNode = CommandManager
                    .literal("remove")
                    .then(argument("player", EntityArgumentType.player()).executes(this::removeCommand))
                    .build();

add/remove newlines as you like, but you're adding the execute to the set/remove nodes, not the player nodes

hard wigeon
#

aha

#

anyways, why won't it register? :p

lyric gyro
#

does that code run at all?

#

I mean i can't really help much with just that, that by itself will work

#

so err, like, try debugging, lol

hard wigeon
#

fair

summer ingot
#

do i need to do something special somewhere else?

dusky harness
#

show full code

summer ingot
#

the reloadConfig(); goes in onEnable right?

#

but where does the 2nd part go

hard wigeon
#

I'm in singleplayer, and this is the server entry, could that matter?
I assumed singleplayer ran it's own server

summer ingot
#

?paste

neat pierBOT
#
FAQ Answer:

Paste Services
When asking for help with a config/menu/code issue please use our paste bin:
(we prefer it over pastebin.com)
HelpChat Paste - How To Use

dusky harness
summer ingot
#

hm

dusky harness
#

so the command

lyric gyro
#

Fred can you show any more code, and/or the fabric.mod.json?

#

Also any errors or something? either in the latest.log or you can keep the log thingy open from the launcher

hard wigeon
#

in console I see nothing

summer ingot
#

^ main class

dusky harness
#

well

#

delete line 14 and 15

#

those are just for a reload command

summer ingot
#

okay

#

i'm just unsure where you put those lines since it's not like they can go into a config

hard wigeon
broken elbow
#

fred. is that paste hosted on cloudflare?

#

kek

hard wigeon
broken elbow
#

just asking. I know you mentioned it before. I need to set that up as well

broken elbow
hard wigeon
#

there is

#

you just go into the KV namespace

#

and delete it

#

in the CF workers dashboard

broken elbow
#

oh. ok. that's ocol

#

yeah. I saw this. you sent before

#

I Just didn't realise you have control over the paste bins

#

well. then I'm going to think about making my own soon

#

™️

#

just like last time

#

oh one more thing

#

what theme do you use for haste bin

#

is it custom?

summer ingot
broken elbow
#

also is it just me or does your side scroll not work? or whatever it is called

dusky harness
summer ingot
#

yeah but where should i be putting the reloadConfig(); and other

dusky harness
#

in the command, dw about it for now

hard wigeon
#

that I manually copied assets from

broken elbow
#

ah. alr

#

but your scroll isnt working

lyric gyro
#

lol

hard wigeon
hard wigeon
#

Btw emily, might it be because it's the server entrypoint?

#

and I'm in single player?

lyric gyro
#

i don't know if environment server is exclusive to dedicated servers or if it includes the integrated server as well

#

so yeah it might be, lol

hard wigeon
#

any clue how to make it work on the integrated one?

lyric gyro
#

just use * for env

hard wigeon
#

okay

#

@broken elbow I fixed scrolling, it'l rebuild

summer ingot
#

now i'm getting two join messages, i get one which matches my config but i'm also getting the vanilla joined game message, how do i remove that?

broken elbow
broken elbow
hard wigeon
#

so I'm gonna convert mine soon

summer ingot
hard wigeon
#

and maybe make a one-click deploy version

summer ingot
#

i used to have this in it

        e.setJoinMessage(ChatColor.GRAY + "[" + ChatColor.GREEN + "+" + ChatColor.GRAY + "] " + ChatColor.GOLD + ChatColor.BOLD + player.getDisplayName());```
but i removed it since it would post both that and my message that's in the config.
#

if i could somehow have that message right there listen to the config then it would be fixed

broken elbow
#

remove this player.sendMessage(message);

#

and add this:

hard wigeon
#

@broken elbow it's rebuild & fixed 🙂

broken elbow
broken elbow
#

nvm. its not broken. Its just slow af

#

when giving it quite a bit of text

#

kek

summer ingot
#

okay, now i just need to add a null check, i know @ blitz you told me the things to type for a null check but this is my second plugin ever and idk where i'm supposed to put that code?

summer ingot
#

hm

#
        e.setQuitMessage(message);
        if (message == null) {
            return;
        }```
#

cool?

broken elbow
#

no

hard wigeon
broken elbow
#

before. lol

summer ingot
#

hm

#

oh

broken elbow
summer ingot
#

right

#

duh

hard wigeon
#

and the other part is guessing what language it is

broken elbow
summer ingot
#

now for reload command

#

do i need another class for a reload command?

broken elbow
#

yeah. will add it to my inexistent todo list

queen plank
#

I want to remove some characters from a string, and would like to avoid 2 replaceAll(). The characters I want to replace are every non word character \\W and the "word" @E. I tried something like [@E&&\\W] and @E&&[\\W] but don't really know how patterns work. Is it possible to do what I am after, and if so, how?

lyric gyro
#

avoid replaceAll how?

#

like, what alternative are you using?

queen plank
#

Avoid 2 of replaceAll*

lyric gyro
#

oH

#

@E|\\W, you want to replace if it matches one or the other, a single match will never be both :d

summer ingot
#

@ Blitz im still getting that error, and now i get
"Condition 'message == null' is always 'false'"

broken elbow
summer ingot
#

that worked thanks a ton

#

is it possible for me to make it so you can use color codes in the config and they'll format in-game?

cinder forum
# summer ingot i used to have this in it ```java e.setJoinMessage(ChatColor.GRAY + "["...

btw if u dont want to type long ChatColor... everytime you can use color codes
create utils package
make ColorHelper (or smth like that) class
create static method in it

public static String translate(String uncolorized) {
    return ChatColor.translateAlternateColorCodes('&', uncolorized)
}

Then you can use
e.setJoinMessage(ColorHelper.translate("&7[&a+&7] &6&l" + player.getDisplayName()));

summer ingot
#

so thats actually really similar to what i just asked

#

i'm no longer using what you replied to but can i make it so that when someone changes the config file to "&6Welcome" it'll actually turn gold?

#

will it be pretty similar to what you just sent? looks similar to an old forum thread i found

cinder forum
#

player.sendMessage(ColorHelper.translate(config.getString("welcome-text"));

summer ingot
#

i'm sorry, but i still don't really know where things go, so where would i put a line of code like that? i'm just trying to learn still where each individual thing might go and how they're related

#

because like i have my main class, and then my two listener classes

#

i would have thought that would go in my listener class

cinder forum
#

it should look like that

broken elbow
#

Paint 😌

cinder forum
#

yez

summer ingot
#

import class? is that okay to do

cinder forum
summer ingot
#

okay cool

cinder forum
#

btw your twitter reply scares me

summer ingot
#

whatttt

summer ingot
cinder forum
#

I remember when I had same experience as you
its nice to see the progress xd

summer ingot
#

well if you ever needed to you could become an artist

#

that was an amazing artistic explenation

cinder forum
summer ingot
#

a lot of the stuff i read in the code is kinda just empty words to me but ive slowly started to understand it

#

well i wouldnt say understand yet

#

but memorize lmao

#

for example i'll probably keep making greeting plugins and perfecting them/making them faster/with no help until i understand every aspect of it

#

also, when i go to create a reload command for the plugin that needs a seperate class right?

cinder forum
#

usually you don't need separate class but you want it because of organization etc.

#

so yeah create new class 😄

summer ingot
#

okay imma try nd figure this out now

summer ingot
# cinder forum it should look like that

this caused some issues, now it sends two welcome messages, one message has color and the %player% placeholder is broken one message has no color and %player% placeholder is working

#

but idk how to include

message = message.replace("%player%", player.getName());```
into the 
```java
player.sendMessage(ColorHelper.translate(message));```
broken elbow
#

can you show the entire code please?

summer ingot
broken elbow
#

don't send the player.sendMessage anymore

#

that sends a message just to the player

#

all you have to do is set the join message

#

and translate the colors in the join message as well

queen plank
summer ingot
#

like this?

        e.setJoinMessage(ColorHelper.translate(message));```
queen plank
#

Sry for the ping btw, forgot to turn them off

summer ingot
#

and then only have that

#

so it should look liek this for my event handler

broken elbow
queen plank
#

Wat?

broken elbow
#

and add - in there as well

queen plank
#

Yeah, but how do I add that to the pattern?

broken elbow
#

@E|[^a-zA-Z0-9_-]

queen plank
#

Ahh, I see. Thanks :))

broken elbow
summer ingot
#

awesome

#

thanks!

queen plank
#

I thought you had to do something like (@E|\W)&^-, like an if statement

broken elbow
#

I mean I'm not that good with regex so maybe that also works

queen plank
#

It didn't...

#

I tried before asking

cinder forum
summer ingot
#

appreciate the tip :)

#

everything counts

broken elbow
cinder forum
#

nono

summer ingot
#

:O

#

dam

broken elbow
#

kek

cinder forum
broken elbow
#

ok. good

cinder forum
#

and i didnt say its cleaner

summer ingot
#

let's go my plugin works and it has colors :O

broken elbow
#

I personally use brackets as much as I can. you might say its clean until you have 5 of them go 1 after another

cinder forum
#

just not so pain

summer ingot
#

now i just gotta make a commands thingy or however i even do that

broken elbow
#
if (something == somethingElse) Do Something Random;
if (abc = 2525525) Another wtf thing random;
if (!boolValue) KGLAJ54252;
#

ugly af

broken elbow
#

how tf is that more readable/

cinder forum
#

i use it just for returning

broken elbow
#

then where's the consistency?

cinder forum
#

🤦‍♂️

broken elbow
#

you see, that's my problem rn. I can't keep just 1 style for the entire project. I don't have a style. and that is not good

hushed badge
#

🥴

broken elbow
#

it is what it is... I try my best but usually I start working on something then come back even weeks or months later

cinder forum
# broken elbow how tf is that more readable/
if (!player.getWorld().contains("tt")) return;
if (item.getItemMeta().getName().equals("hi")) return;
if (player.getName().equals("Notch")) return;

doSomething();
if (!player.getWorld().contains("tt")) {
  return;
}
if (item.getItemMeta().getName().equals("hi")) {
  return;
}
if (player.getName().equals("Notch")) {
  return;
}

doSomething();
#

for me it is

#

🤷‍♂️

broken elbow
#

no. its 100% not cleaner

#

brackets are nicer

cinder forum
#

personal preference

pulsar ferry
#

Nah, small things are fine to be inlined

broken elbow
#

idk man. its not like the code changes but I just prefer brackets

#

and I still use inline stuff. especially since I'm a kotlin user so I usually just do ?: return bcz yeah

icy shadow
#

Skipping the braces is a bad idea

cinder forum
#

why

hushed badge
#

squabbling over 2 characters being missed 🙄

broken elbow
#

and 3 new lines

#

smh kaliber

cinder forum
#

!!!

broken elbow
#

Also I guess you can say I've been indoctrinated into using brackets. bcz in highschool the final exam was on paper and some teachers are very very very very very very very very very very very very dumb and take away all your points for 1 missing bracket. bz the program wouldnt run if you were to put it in a compiler...

cinder forum
#

so u dont like it because of dumb teachers

#

why writing code on paper tho whats the point

summer ingot
#

what is an identifier

mental cypress
#

In terms of?

cinder forum
summer ingot
#

hm okay

#

thanks

#

where could i go to learn how to add a reload command to my plugin ive been searching on google for a bit and the newest piece of help i can find is a year old with the next in line being 3 years old. even with the 1 yr old one i can't seem to get it to work for myself

mental cypress
#

What all are you trying to reload?

summer ingot
#

my config file

mental cypress
#

Just use reloadConfig()? It's built in to JavaPlugin iirc.

summer ingot
#

someone already told me that but i've never touched java before idk where that goes

#

there's a million places i could put that and i don't know it

broken elbow
#

you make a command

dusky harness
#

rn I have a bunch of kits, but I want to sort them by price, but if a kit is the same price as another, then sorted alphabetically (so that they're always in the same spot)

I have this: ```kt
classes.entries.sortedWith { o1, o2 ->
o1.key.compareTo(o2.key)
}

broken elbow
#

make your own sorter. ez

dusky harness
#

oh wait

#

i can just make an if statement

#

if its equal

#

then sort by name

#

🤦

broken elbow
#

kek

dusky harness
#
classes.entries.sortedWith { o1, o2 ->
            if (o1.value.points == o2.value.points) {
                o1.key.compareTo(o2.key)
            } else {
                o1.value.points.compareTo(o2.value.points)
            }
        }```
#

😌

broken elbow
#

nah man. just make your own sorting algorithm

dusky harness
#

uhhhhhhh

broken elbow
#

I implemented like 4 or 5 different sorting algorithms today

dusky harness
#

idk how to

#

tho

broken elbow
#

you learn

dusky harness
#

but

broken elbow
#

butt

summer ingot
broken elbow
#

lmao

#

did you read the create a simple command page?

summer ingot
#

no i was reading through creating a config file

broken elbow
#

you should probably go thru all of those at least once

#

maybe not the database ones

#

for now

summer ingot
#

fair enough, sorry for bothering. :) thanks for the info

broken elbow
#

all good.

obtuse mauve
#

All I have to do is make my placeholder extend PlaceholderExpansion, right?

#

If I wanna make my own

mental cypress
#

The class, yes.

#

And then register the expansion.

icy shadow
#

it's arguably ok if you're returning but it's still error-prone

#

it's more readable and maintainable

broken elbow
#

OMG. Santa actually agreeing with me? so I'm smart then

cinder forum
#

im talking only about returning

summer ingot
broken elbow
#

did you add the command to your plugin.yml?

summer ingot
#

yep

broken elbow
#

show the command and where you register it

summer ingot
broken elbow
#

and your plugin.yml please

summer ingot
summer ingot
#

any luck @ blitz?

atomic echo
#

args[0] is null

broken elbow
#

oh hi. I'm back

#

lol

#

yes as death realms said args[0] is null bcz the command itself is reload

#

not an argument

queen plank
#

Hi again Blitz, quick, why does this [^a-zA-Z0-9_-\\:] not work?

broken elbow
#

might want to escape that -

queen plank
#

Huh?

broken elbow
#

[^a-zA-Z0-9_\\-\\:]

queen plank
#

Ahh

#

The - works tho?

#

The problem is the :

broken elbow
#

well no. the regex is not really good you know bcz - is a keyword in regex

queen plank
#

Ok, that makes sense lol

broken elbow
#

you see it thinks that the parts before - and after are a range

queen plank
#

Ahh

#

Yup works, thank you!

broken elbow
#

no problem

dense drift
#

could replace a-zA-Z0-9_ with \w btw

broken elbow
#

that's what they had before but I hanged it kek

#

but yeah. It could be this @E|\W|[\-\:]

summer ingot
broken elbow
#

well usually I recommend you make your own command instead of having it be reload

summer ingot
#

i have it as milkygreet reload

broken elbow
#

so when you register it, register it as something like greetings or whatever

summer ingot
#

did i specify that wrong

broken elbow
#

well no

#

you have it as reload

summer ingot
#

i thought you cant put spaces in the Command part

broken elbow
#

this.getCommand("reload").setExecutor(new ReloadCommand()); when registering it here register it as milkygreet

#

you can't. but you will make reload be an argument

summer ingot
#

oh thatt part

broken elbow
#

bcz milkygreet:reload is basically pluginnname:command

summer ingot
#

i would have liked it to be /milkygreet reload

#

not :

#

i was wondering why it did that

broken elbow
#

you need to register the command to be milkygreet

#

same in plugin.yml

summer ingot
#

so for example when i do

commands:
  reload:```
should i instead do 
```java
commands:
  milkygreet:```
broken elbow
#

yeah

#

because that will be your main command

summer ingot
#

and then also the public boolean onCommand()

broken elbow
#

reload will just be an argument to that command

summer ingot
#

okay, and for my args i'm putting reload

#

gotcha

broken elbow
#

you have it already

#

in the code you sent

summer ingot
#

do i?

broken elbow
#

well yeah you have a check if args[0] == "reload"

summer ingot
#

i thought i put args[0]

broken elbow
#

yeah. args[0] doesn't return the command itself

summer ingot
#

hm okay

broken elbow
#

just the arguments

#

well args

#

in general

#

that's the label

summer ingot
#

can my string label stay the same

broken elbow
#

well that will be whatever you register the command as

summer ingot
#

milkygreet

#

my if statement has an empty body

#

never happened before i did something wrong

broken elbow
#

show code please

summer ingot
#

i only touched that one part "Command"

broken elbow
#

well yes bcz you haven't added any code in there

summer ingot
#

i guess i am unaware of what to add in there, i'll keep searching online

broken elbow
#

well the reload

orchid otter
#

Is there a listener that listens to just entities killed by the player?

summer ingot
tight junco
#

might just go back to this

#

although i will say, your executor should never be null and neither should the getCommand method

orchid otter
#

I can probably do EntityDeathEvent, but i dont see a way to get the reason why the entity was killed in the docs

tight junco
#

well you see

#

getLastDamageCause returns EntityDamageEvent

#

wait no im stupid

hushed badge
#

EntityDeathEvent getEntity().getKiller()

tight junco
#

or that

#

you can tell i haven't done plugins in 3 weeks

orchid otter
#

alright thanks

storm crow
#

so i have my local server running
but when i try to join localhost in the direct connect panel of mc

#

it doesn't let me join ):

#

"Connection refused: no further information"

#

same thing happens when i try localhost:25565, 0, 127.0.0.1, 127.0.0.1:25565

#

nothing is logged in the server console

hushed badge
summer ingot
#

oh i didn't realize that was a reply to me. thanks! :)

summer ingot
hushed badge
#

u dont need to fix the warnings technically. it will still compile

summer ingot
#

when using my reload command it just spits the reload command back at me

#

curious

slim vortex
#

Can you send the code

summer ingot
#

yea np do you just want everything

slim vortex
#

Only the command

summer ingot
slim vortex
#

Try returning true

#

Because it was successful in execution

summer ingot
#

Okay ill lyk

summer ingot
slim vortex
#

send the new code

#

changing that line doesn’t do that

summer ingot
#

ill send my plugin.yml too

slim vortex
#

check console for errors or something

summer ingot
#

nothing

slim vortex
#

changing to true doesn’t cause the command to not register

#

what command did you type

summer ingot
#

i think i found my mistake

#

under onEnable where the command is it's only milkygreet with no reload

#

but the command is milkygreet reload

slim vortex
#

remove the reload part from the plugin yml and also the main

broken elbow
#

ugh

slim vortex
#

you don’t need reload

broken elbow
#

you'resetting the executor

#

to this

#

instead of the command class

summer ingot
#

well no because then the cmd is only milkygreet

slim vortex
#

instantiate the subclass command executor

#

arguments =/= command

#

the command is milkygreet

broken elbow
#

this should be new ReloadCommand()

slim vortex
#

reload is an argument

summer ingot
#

hm okay so

#

args are tuff

#

lemme go thru spigot and see if they have anything helpful and if not ill ask

slim vortex
#

not really it’s just a java concept

summer ingot
#

kinda wouldve expected to find atleast one forum relating to what i need but ig not

#

or im a shitty googler

tight junco
#

always recommend learning and understanding basic java before going straight into plugins clueless

slim vortex
#

👍🏻

summer ingot
#

i guess that would be smart.

#

i can pick this back up later on

tight junco
#

codecademy is free CB_fingerguns

broken elbow
#

don't

#

let

#

me

#

down

pure crater
#

arguments are a general concept

#

its not something you learn that is java specific

summer ingot
#

never known how to set them up though

#

i'll just go thru some basic java stuff first

pure crater
#

arguments aren't "something you setup"

#

its just a general term lol

summer ingot
#

what would it be called then if i want to make "reload" as an arguement

#

what might someone call that action

pure crater
#

No, i am just saying that arguments are a very general concept, and its not like something you learn, if that makes sense. like program arguments, method arguments, command arguments, etc

#

And also i think what you are referring to is a literal

tight junco
#

fun information about developers and asking for help with stuff

#

they're gonna give you the most vague answer you can imagine

#

enjoy CB_fingerguns

pure crater
#

yep

#

cause its a general term, so i cant give a proper definition lol

#

can be many contexts

broken elbow
#

much money

tight junco
#

well they're talking about command arguments in this context

half gate
#

I'm having an issue with publishing my lib to jitpack using gradle with shadow plugin. I really don't know what's wrong with this, since I got it to work on past projects, but now for some reason it doesn't.

My goal is that people can use the repository as a shadowed lib on their projects, but for some reason, it doesn't build correctly, or it only builds the sources. Here's my build.gradle -> https://github.com/AleIV/Model-Tool/blob/1.17/build.gradle

lyric gyro
#

shitpack

broken elbow
#

man. why yall hating on jitpack?

lyric gyro
#

Because it's literal ass

broken elbow
#

please explain

lyric gyro
#

I can't think of a single person using it more than once that hasn't encountered an issue with it

#

Sometimes it just straight up doesn't work

#

Sometimes you have issues with the java version or with the Gradle version or with the whatever version or whatever

#

It don't work

#

@half gate for publishing shadow libs instead of doing from(components.java) do project.shadow.component(it)

slim vortex
dusky harness
#

😃

#

although i dont use it anymore

#

lol

broken elbow
dusky harness
#

jitpack just isn't the best

lyric gyro
dusky harness
#

lol