#help-development

1 messages · Page 1192 of 1

blazing ocean
#

correct

chrome beacon
blazing ocean
chrome beacon
#

You really don't want to shade Spring anyways

#

It will make the plugin 25MB

blazing ocean
#

hehe-

eternal night
#

fucking spring

blazing ocean
#

I've had bigger

tiny tangle
#

ItemMeta meta = customItem.getItemMeta();? this is the easy way?

blazing ocean
#

y-yes

#

it is the only way in fact

torn shuttle
#

that sounds like a challenge

tiny tangle
#

okay, omg

blazing ocean
#

Bukkit.createItemMeta exists I guess

torn shuttle
#

smh

#

lying to new devs

#

for shame rad

blazing ocean
#

i love our map manager's commit messages

remote swallow
#

and who

#

and pfps

blazing ocean
#

?

remote swallow
#

radstevee authored and ? committed

tiny tangle
#

is this the right path src/main/java/assets/minecraft/models/item ? , this is part of my gradle : ```
sourceSets {
main {
java {
srcDir 'myplugin/src/main/java'
}
}
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
shadowJar {
archiveClassifier.set('all') // Use 'all' classifier for the fat jar
}

blazing ocean
#

no

#

resource packs are not in your plugins source code

#

(if you are making it manually)

tiny tangle
#

oh, ahh, does it need to place on the main folder right ?

blazing ocean
#

no

#

it is completely seperate

tiny tangle
#

does it this directory file needs to be on the server folder?

river oracle
#

the answer to all of your questions and more is my favorite word "depends"

tiny tangle
#

haha, im looking a guide how to make the custom item as rad said to use the customItem.getItemMeta();, but cannot find any answers to where do i put the resourcepack.rar/zip or the directory folder

#

to be server side

river oracle
#

you have to make the resource pack and then ship it with either a service like dropbox or make your own

#

there is no "server side" file structure for a resource pack

tiny tangle
#

oh

#

but if I upload the resourcepack to a dropbox, then i need to use the @EventHandler public void onJoin(PlayerJoinEvent event){ event.getPlayer().setResourcePack( path ); } ?

#

alongside with the customItem.getItemMeta()

#

but this make me confuse

river oracle
#

you shouldn't be starting up and dealing with ports every time a player joins

#

you should provide a constant service

#

I think you're in far above your head for your current knowledge

#

its a URL and a hash

tiny tangle
#

oh, if i understood to manage the constant service does it need to be localhost with a port of the server , right?

river oracle
#

from the contex tI'm seeing that random code you pasted isn't even a real thing

#

I don't really think you have any clue what you're doing and maybe you should slow down take a step back and try and understand how things work

tiny tangle
#

yeah, im just want to try to "attempt" imitate the serverside backpack , to get to know how to do custom item

#

i didnt though it could be that complex

marsh hawk
#

Is there any way of stopping the player rotation, without the "teleport back" effect, and still have the server be able to read movement inputs (so no spectator)?

chrome beacon
#

Fun thing the client keeps sending movement while spectating

blazing ocean
#

yeah ^

chrome beacon
#

You'll just need a packet listener

blazing ocean
#

the server just kinda ignores them

eternal night
#

PlayerInputEvent vibes

blazing ocean
chrome beacon
#

Yeah that's how the world GUIs are made

marsh hawk
#

Wait, so I could spectate a mob and also know if the player is attempting to move?

chrome beacon
#

yes

marsh hawk
#

Could you perhaps hint me towards some resources that are helpful to learn more about that?

remote swallow
#

wait a minute

echo basalt
#

2 rads

remote swallow
#

@blazing ocean wtf?!

chrome beacon
#

Don't really have any

marsh hawk
chrome beacon
#

You just listen to the packet that the client sends using ProtocolLib or PacketEvents

blazing ocean
#

packetevents >>>

marsh hawk
chrome beacon
#

You mean wiki.v.g

#

.vg*

marsh hawk
#

yeah

blazing ocean
#

it's merged into the mc wiki

river oracle
#

its in the mc wiki now

marsh hawk
#

I cannot find the mc wiki version by googling, is it hidden?

river oracle
#

probably not hit good seo yet

blazing ocean
marsh hawk
chrome beacon
#

I'm not exactly sure which one it sends

#

but I know it's one of them

river oracle
#

It'd probably be Player Input packet no?

#

idk what protocol lib calls it

marsh hawk
#

Are you refering to WASD detection, or when the mob that is being spectated moves?

marsh hawk
river oracle
#

WASD detection

#

yes PlayerInputPacket should detect WASD presses

#

I'm not familiar with protocol lib so i can't help you figure out what they call it

marsh hawk
#

I found the packet on the wiki, but can't seem to find it in the api

river oracle
#

idk if protocol lib even wraps everything

#

so Shrug

marsh hawk
#

:c

blazing ocean
#

packetevents >>>

sly topaz
#

why is the player input packet called steervehicle

echo basalt
sly topaz
#

they take the packet names out of their ass

river oracle
#

this is pretty much useless tbh

echo basalt
river oracle
#

wtf this must be new

chrome beacon
#

It's pretty new yes

sly topaz
#

there's also Player#getCurrentInput

marsh hawk
#

I just saw the 1.21.4, mb

sullen marlin
#

It's in 1.21.3 too

#

Packet didn't exist before then

echo basalt
#

a vine boom just played in my head

marsh hawk
ocean hollow
#

Hello everyone, please help me. I saw a script on Denizen, where using text displays, spectator mode, and mount the player could spin around, but at the same time his camera was blocked.

#

how do I do this?

young knoll
#

Paging @blazing ocean

#

Some weird stuff with spectating an entity while riding an entity

ocean hollow
undone axleBOT
umbral ridge
#

🥴

#

god help

#

no debug messages? null checks with messages, exceptions, etc.*

#

code is like a woman, you have to fight for it and with it

young knoll
#

What on earth are you on about

river oracle
young knoll
#

Just kind of out of left field

#

You doing alright?

cedar saffron
#

Also why is your profile zoomed

#

And why are you no longer verified

ocean hollow
ocean hollow
kindred sentinel
#

Is it possible to make inventory bigger than 27 slots?

ocean hollow
#

oh, like this.

young knoll
#

And also some niche ones like 5 and 9 but in a square

marsh hawk
cedar saffron
#

Wait a minute

#

@blazing ocean

#

Yoooo

#

Bro who is you 😭 IMPOSTER

#

Everyone tryna be rad these days

echo basalt
#

he might look like rad but he isn't radical

cedar saffron
echo basalt
#

hell yeah

#

btw my homie's bringing my legos tomorrow

cedar saffron
#

What a beast

echo basalt
#

got a 900 piece set

cedar saffron
#

I might be able to call tmmrow :3

cedar saffron
echo basalt
#

it's a tiny car

#

but you build the engine

echo basalt
cedar saffron
#

Group lego meet Friday, be there or be bricked

#

Wait...

cedar saffron
young knoll
#

Real working Lego combustion engine

marsh hawk
#

Does anyone know if spectating without spectator mode is possible? Packets seem to also force you to be in spectator if you want to spectate an entity. Trying to get rid of the spectator hotbar, but it seems like there is no way around it 😔 .

young knoll
#

Rad said they just sent a gamemode change packet

#

Does that work

echo basalt
#

nuke it with a resourcepack

young knoll
#

.

marsh hawk
echo basalt
#

hm

marsh hawk
echo basalt
#

watching a build video this entire set is built with those circular studs

#

and it's hella complex it'll take me like 5 hours fs

cedar saffron
#

Lock in and it takes 1

marsh hawk
young knoll
#

Other way around I think

marsh hawk
#
    PacketContainer packet = protocolManager.createPacket(PacketType.Play.Server.GAME_STATE_CHANGE);
    packet.getGameStateIDs().write(0, 1);
    protocolManager.sendServerPacket(p, packet);

This is the only packet I found for gamemodes. There is also a:

    packet.getGameModes().write(0, EnumWrappers.NativeGameMode.ADVENTURE);

But I cant find a packet for this, since this one gives me write errors. And since the previous one is not giving me a write error, I'm assuming the structure is not wrong? In both cases, I'm still seing the spectator hotbar, so I'm probably misinterpreting something?

marsh hawk
worldly ingot
#

It's game state change you're looking for. Specifically (in 1.21.4) it's packet id 0x22, key minecraft:game_event. I believe game state ids (id 3) is correct in combination with integers

#

Actually technically it's a float in the packet

marsh hawk
#

I found online that game state change is apparently for some kind of "demo event" though?

worldly ingot
#

It can be used for that

young knoll
#

It does everything!

worldly ingot
#
PacketContainer packet = protocolManager.createPacket(PacketType.Play.Server.GAME_STATE_CHANGE);
packet.getGameStateIDs().write(0, 3); // 3 = gamemode change
packet.getFloat().write(0, 3); // 3 = spectator mode
young knoll
#

The magic packet

worldly ingot
#

That would be a game mode change

young knoll
#

Wha

#

Why is the game mode a float

worldly ingot
#

Because a float could be used for something else

young knoll
#

Isn’t that the point of the first id

worldly ingot
#
    private final PacketPlayOutGameStateChange.a event;
    private final float param;
#

It's defined as a float though

young knoll
#

To identify what the rest of the packet contains

worldly ingot
#

Well yeah but all of them just send an event and a value

young knoll
#

Wacky

worldly ingot
#
    public static final PacketPlayOutGameStateChange.a NO_RESPAWN_BLOCK_AVAILABLE = new PacketPlayOutGameStateChange.a(0);
    public static final PacketPlayOutGameStateChange.a START_RAINING = new PacketPlayOutGameStateChange.a(1);
    public static final PacketPlayOutGameStateChange.a STOP_RAINING = new PacketPlayOutGameStateChange.a(2);
    public static final PacketPlayOutGameStateChange.a CHANGE_GAME_MODE = new PacketPlayOutGameStateChange.a(3);
    public static final PacketPlayOutGameStateChange.a WIN_GAME = new PacketPlayOutGameStateChange.a(4);
    public static final PacketPlayOutGameStateChange.a DEMO_EVENT = new PacketPlayOutGameStateChange.a(5);
    public static final PacketPlayOutGameStateChange.a ARROW_HIT_PLAYER = new PacketPlayOutGameStateChange.a(6);
    public static final PacketPlayOutGameStateChange.a RAIN_LEVEL_CHANGE = new PacketPlayOutGameStateChange.a(7);
    public static final PacketPlayOutGameStateChange.a THUNDER_LEVEL_CHANGE = new PacketPlayOutGameStateChange.a(8);
    public static final PacketPlayOutGameStateChange.a PUFFER_FISH_STING = new PacketPlayOutGameStateChange.a(9);
    public static final PacketPlayOutGameStateChange.a GUARDIAN_ELDER_EFFECT = new PacketPlayOutGameStateChange.a(10);
    public static final PacketPlayOutGameStateChange.a IMMEDIATE_RESPAWN = new PacketPlayOutGameStateChange.a(11);
    public static final PacketPlayOutGameStateChange.a LIMITED_CRAFTING = new PacketPlayOutGameStateChange.a(12);
    public static final PacketPlayOutGameStateChange.a LEVEL_CHUNKS_LOAD_START = new PacketPlayOutGameStateChange.a(13);
    public static final int DEMO_PARAM_INTRO = 0;
    public static final int DEMO_PARAM_HINT_1 = 101;
    public static final int DEMO_PARAM_HINT_2 = 102;
    public static final int DEMO_PARAM_HINT_3 = 103;
    public static final int DEMO_PARAM_HINT_4 = 104;
    private final PacketPlayOutGameStateChange.a event;
    private final float param;
#

Listen man, I just work here

remote swallow
#

hold up

worldly ingot
#

(but you'll see demo is in there too, it's just event id 5)

young knoll
#

So this is Mojangs “uhh wtf do we use for this” packet

worldly ingot
#

lol yeah basically

remote swallow
#

choco works there?!?

marsh hawk
worldly ingot
#

Well, yeah, if you're being put into spectator mode

#

You have no hotbar lol

marsh hawk
#

Ig thats true

sharp bough
#

is it possible to run client side simulation on spigot nms 1.16+-1.20+? i.e. given entity E move it until XYZ location, with a single packet

  • set velocity wouldnt work for me as (from what i tested) it requires gravity and i need a straight line
  • multiple SET_POSITION or TELEPORT_ENTITY wouldnt work as i have a rather high expected volume of entities
  • REL_ENTITY_MOVE applies the movement distance in a single tick and i require longer distances (quote: "This packet allows at most 8 blocks movement in any direction, because short range is from -32768 to 32767. And 32768 / (128 * 32) = 8.")
  • custom nms entities (from what i understood) would be too expensive for my use case, since they would spawn server side? im not entierly sure

all entities are armor stands. any crazy ideas are welcome, thanks

young knoll
#

Well display entities can do movement interpolation

#

But those are 1.19.4+

sharp bough
#

yea i saw those, i might have to go with that if i cant find an optimal solution for this
i would reeeally like to support 1.16+ tho 😭

sly topaz
#

how many entities are you moving? Is it really a no-go?

hybrid spoke
sharp bough
sharp bough
#

thank you everyone

sly topaz
#

you can off-load the packet processing if ultimately necessary so that it doesn't affect normal gameplay, would just require some tinkering

#

my question was more towards as to why you need to do it, what are you doing with this?

ebon topaz
#

how would i go about making a command to not allow oped people to teleport to me?

proud badge
#

playerteleportevent

#

then cancel it

ebon topaz
#

so i looked at this event and i can see i can get the cause which would be command and the location its teleporting to but can i check who its teleporting to?

proud badge
short pilot
#

what are some of the most taxing functiosn in the API in terms of memory

#

and also big O i guess

#

i assume some big search ones like block related stuff

proud badge
#

InventoryHolder ive heard (in spigot)

#

getOfflinePlayer too from personal experience

short pilot
#

yikes

#
UUID kingdomUUID = resultSet.getString("kingdom") != null ?
                        UUID.fromString(resultSet.getString("kingdom")) : null;

For cases like these, what would be a better approach for an "invalid" UUID, ie something that remains constant to indicate

Kinda like how -1 is reserved a lot for special cases

#

or is setting it to null fine

#
public static final UUID INVALID_UUID = new UUID(0L, 0L);
#

maybe something like this?

remote swallow
#

id normally assume valid uuid inside a db, if a end user modifies it its on them to resolve the error

short pilot
#

is it best practice to make specific util classes; i started doing that to keep things organized

#

like this

#

oh shoot it's 12 am what the

shadow night
short pilot
#
    private static ChunkCoordinate getPlayerCurrentChunk(Player player) {
        Location playerLocation = player.getLocation();
        int x = playerLocation.getBlockX() >> 4;
        int z = playerLocation.getBlockZ() >> 4;
        UUID worldID = playerLocation.getWorld().getUID();
        return new ChunkCoordinate(x, z, worldID);
    }

this is redundant but i did a little function to mathematically get the chunk from coords lol

sly topaz
#

and not just player.getLocation().getChunk()

#

which apparently does just that:

hybrid spoke
#

if you just put everything in there, its definitely not best pratice, but at best static abuse

glad prawn
#

Utils

hybrid spoke
# glad prawn Utils

yeah sure, in my databaseutil i have all my database properties, all my database statements, connection utils, just.. a bit of database stuff

short pilot
#

;[p

#

lolllll

sterile breach
#

Hi what is the best way to seralize an inventory? Converting an Itemstack array with gson?

wraith delta
#

Is there a steal item from item frame event i can cancel?

#

PlayerInteractEvent cancel doesnt work for it, only prevents destroying the frame

sterile breach
sly topaz
#

and yes

#

then something like this to serialize the inventory/contents as a whole

sharp bough
#

thnaks

proper radish
#

Is the following cache structure and design efficient for storing generator data?

I am implementing a system in my minigame plugin where generators have properties based on different difficulties, types, and levels.
The structure is stored in a .YAML file and cached for faster access. I want to store the generator data in a cache for quick retrieval,
ensuring the getter method returns the generator with its relevant properties based on difficulty, type, and level.

**here is the design **

difficulties:
  easy:
    types:
      iron:
        levels:
          1:
            spawnInterval: 3
            maxItemsStack: 30
            imagePath: "iron-map-1.png"
            upgrade:
              item: IRON_INGOT
              cost: 48

here is my class ( Generator Object )

public class Generator {

    private GenProp properties;
    private Location genLoc;
    private Location picLoc;

    public class GenProp extends Generator {

        private GenType type;
        private int level;
        private int maxLevel;
        private double spawnInterval;
        private int maxStack;

        private boolean levelUp () 
        { 
            if (level >= maxLevel) return false;
            level++;
            // TODO: implement the item-frame changes.
            return true;
        }
    }

and here is my cache & getter method

    private static final Cache<GameDif, Map<GenType, Map<Integer, Generator.GenProp>>> cache = Caffeine.newBuilder().build();

    public static Generator get (GameDif difficulty , GenType type, int level) {
        // No Null Checks
        var types = cache.getIfPresent(difficulty);
        var lvl = types.get(type);
        var props = lvl.get(level);

        var gen = new Generator();
        gen.setProperties(props);

        return gen;

    }
ivory sleet
#

Why do you need a caffeine cache?

#

feels like a normal HashMap would do the trick

#

It all looks fine tho, but maybe try to name ur type rather than a nested Map type ^^

#

and yea the yml seems fine, normal orming in principle

quaint mantle
#

YAMLs are cached already

ivory sleet
#

yes but accessing a field directly is a bit faster

#

and free compile time type safety

short pilot
#
public class CustomWitherSkeleton extends WitherSkeleton {

    public CustomWitherSkeleton(Level world) {
        super(EntityType.WITHER_SKELETON, world);
        this.collides = false;
        this.expToDrop = 0;
        
        this.setInvulnerable(true);
        this.setCanPickUpLoot(false);
        this.setAggressive(false);
        this.setCustomNameVisible(true);
    }

}

made a custom mob but it still attacks people, any help?

#

i thought setAggressive gets rid of that

blazing ocean
#

don't implement the bukkit api

#

oh that's NMS

smoky anchor
#

You'd have to override the AI - Goals

short pilot
#

after adding

        this.goalSelector = new GoalSelector(world.getProfilerSupplier());
        this.targetSelector = new GoalSelector(world.getProfilerSupplier());

beforehand, it works

#

now...

#

how can i make it attack say

#

cows or something

#

and can each custom mob have their own instance variables? Like a spawn X Y Z to teleport back to

#
        this.targetSelector.addGoal(1, new NearestAttackableTargetGoal<>(this, Cow.class, true));

#

i tried using targetSelector but it just stood and did nothing ;-;

#

is it the setAggressive that is interfering, or is there more at hand?

blazing ocean
#

welp, check how vanilla does it

short pilot
#

;-;

#

is this actually how minecraft devs do it?

blazing ocean
#

yes

short pilot
#

dang i thought it was the api or plugin dev

blazing ocean
#

most people here don't know every little thing about nms lol

blazing ocean
short pilot
#

explain explain

blazing ocean
#

you are using NMS

ivory sleet
#

it just finds a target given the goals u added

short pilot
#

i got it workin

#

i added goals

#

it works on attacking cow mobs and nothing else, but upon serer restart it seems to reset the NPC AI

smoky berry
#

Hey, I'm currently working on an UHC Marvel plugin in 1.8 but there are some things I'm not good enough to work on it so I'm searching if some people are willing to help ^^'

ivory sleet
#

yea, tho usually u wna have target selector filled with goas that don’t occupy the other goal flags

#

and then the goal selector with physical goals that make the entity do sth

#

Altho GoalSelector is kind of outdated nowadays but yea

short pilot
#

how can i save in between instances of server; keep the custom mob persistent?

smoky anchor
#

You can probably check how Endermen target Endermites, take inspiration from there.

#

Now, I don't know the "standart" way of doing custom mobs.
But my approach would be: give your custom mob some PDC value as identifier (also store all your custom variables per mob in that PDC)
Now check each entity in some entity load event, if it has that specific PDC identifier, copy the PDC, kill that mob and paste the PDC.

proper radish
ivory sleet
#

Well its goofy because u’re enforcing extra thread safety, and memory safety when its not needed

#

slow that is

ebon topaz
#

ok so i got some code that checks if a message contains a string but how could i check if that message contains any string from a list<string>

chrome beacon
#

A for loop would be the easiest solution

#

Not super efficient but that might or might not matter

ebon topaz
chrome beacon
#

There are better ways

#

but usually not worth the effort

#

I assume your list is quite small

ebon topaz
#

yeah, most likely only 2 or 3 strings

sharp bough
marsh hawk
glad prawn
short pilot
#

how do you save custom npc behavior across server restarts?

short pilot
#

im not sure oop it's 9 aam and im a lil tired haha

#

all nighter during dead week

glossy laurel
#

is it guaranteed that when a player joins and I save their Player object it will be the same one as the one I can get when they leave the server?

short pilot
#

i tought ur answer was about Goals actually

glossy laurel
pseudo hazel
#

no

#

iirc when players die they also get a new player object probably

#

thats why you use uuids

glossy laurel
#

uh-huh

pliant topaz
blazing ocean
#

@glossy laurel no, don't store references to players

glossy laurel
#

im switching rn

blazing ocean
#

you can get some memory leaks if you don't do your shit properly with that

glossy laurel
#

dang

young void
#

is it possible to make your plugins decompilable?

glossy laurel
blazing ocean
#

every java app is decompilable

young void
#

is it possible to make it more challenging to do so??
im in a situation which i dont want people to decompile it

blazing ocean
#

why

pseudo hazel
#

there is no good reason

blazing ocean
#

your plugins code is not that advanced that you need to obfuscate it

pseudo hazel
#

if it was you wouldnt be asking this

blazing ocean
#

exactly

young void
#

im feeling they are gonna cut me off halfway and give it to another developer. i dont want the developer to write on my code. i dont want that to happen. simple as that.

blazing ocean
#

what

young void
#

yeah its not that advanced code

blazing ocean
#

then license it

#

well

pseudo hazel
#

what do you even mean

blazing ocean
pseudo hazel
#

if you have that feeling, then dont do anything

#

no one wants to work on decompiled code anyways

glossy laurel
blazing ocean
#

and trust me, it was bad

pseudo hazel
blazing ocean
glossy laurel
#

yeah ik

#

but ill have to cast them

#

ugh

pseudo hazel
#

what

glossy laurel
#

well

blazing ocean
#

you can't cast a uuid to a player lol

glossy laurel
#

yk

#

wim

pseudo hazel
#

right

#

you need to get the player object

#

too bad

glossy laurel
#

well, time to suffer for my bad coding practices

pseudo hazel
#

now you gotta write decent code

glossy laurel
#

😁 👍

pseudo hazel
#

tech debt coming in hot

glossy laurel
#

lol

#

alr chat

#

see you after 2 hours of suffering

#

toodles

pseudo hazel
#

if its only 2 hours you aint seen nothing yet

blazing ocean
#
fun Audience.forEachPlayer(block: (Player) -> Unit) {
    forEachAudience { audience ->
        Bukkit.getPlayer(audience.uuid())?.let(block)
    }
}

fun Audience.players() = buildList { forEachPlayer(::add) }
``` my entire system is built around audiences and their uuids where I'm never storing player references
#

you're gonna have to do a lotta Bukkit.getPlayer calls but it's much safer than storing player references

echo basalt
blazing ocean
#

what for

echo basalt
#

for (player in audience)

blazing ocean
#

and that only works for iterators

#

as far as I'm aware

#

audiences are not iterable

#

I don't see how the language could iterate over something just based off a contains function

#

But you're right, I could implement the contains operator function

#

I did make mapTeams, mapTeamsIndexed, forEachTeam, forEachEventPlayer, etc.

young void
#

but yeah obfuscation was what i was looking for

glossy laurel
#

average day of code nester

blazing ocean
young void
quaint mantle
#

Guys I want make my home plugin proprietary

glossy laurel
young void
young void
glossy laurel
#

I repeated the same checks like 3 times

#

cuz im sigma

blazing ocean
glossy laurel
#

and command builders too

#

💀

blazing ocean
# glossy laurel what are FIR trees

the kotlin compiler's frontend's immediate representation of source code segments, which get parsed into its backend's immediate representation

hybrid spoke
#

hold on, the red fir isnt actually red

#

gaslighting

glossy laurel
blazing ocean
worldly ingot
#

It isn't

#

Well that's just misleading advertisement >:(

young knoll
#

Wait until you learn that a pineapple isn’t pine or apple

quaint mantle
eternal night
remote swallow
#

do i not count to pineapple anymore

blazing ocean
#

no

vapid breach
#

Im copiling the begginer the simple plugin server possible but my the spigot server are not loading it idk why

#

what I should send here to provide engough information?

chrome beacon
#

Should be an error in your console

vapid breach
#

its compiling...

chrome beacon
#

You said your spigot server was not loading it

#

So I assumed you had a jar to run

vapid breach
#

Cannot find main class `org.example.TutorialPlugin.TutorialPlugin'

#

I found the error

chrome beacon
#

So you already did compile it

vapid breach
#

yes

chrome beacon
vapid breach
proper cobalt
#

plugin.yml

chrome beacon
#

Properly specify a main class

vapid breach
#

I made a typo? I cant find it lol

chrome beacon
#

Show your main class

#

?paste

undone axleBOT
vapid breach
#
package org.example;
import org.bukkit.plugin.java.JavaPlugin;


public class TutorialPlugin extends JavaPlugin{
    @Override
    public void onEnable(){
        getLogger().info("onEnable is called!");
    }

    @Override
    public void onDisable() {
        getLogger().info("OnDisable is called!");
    }
}
chrome beacon
#

Wrong package

#

org.example.TutorialPlugin.TutorialPlugin should org.example.TutorialPlugin

#

in your plugin.yml

#

alternatively move the class in to the org.example.TutorialPlugin package

#

(though fix the name to fit conventions (lowercase))

vapid breach
#

my package are only org.example

proper cobalt
#

i doubt this no offense

junior geyser
vapid breach
#

ok done let me test

umbral ridge
#

if ur first time in java you should do basic projects in plain java first

#

start with some basic

#

s

vapid breach
#

with sdl

proper cobalt
#

and a step by step youtube tutorial

chrome beacon
#

?learnjava

undone axleBOT
#

For Beginners:

Codecademy - Learn Java: Interactive Java programming course from basics to more advanced concepts. Perfect for absolute beginners.
https://www.codecademy.com/learn/learn-java
JetBrains Academy - Java Developer Track: Learn by doing with projects and challenges. It covers Java fundamentals to advanced topics.
https://www.jetbrains.com/academy/
Udemy - Java Programming Masterclass for Software Developers: Updated courses that cover Java 8 to Java 17 features. Suitable for those who prefer structured learning.
https://www.udemy.com/course/java-the-complete-java-developer-course/

For Intermediate to Advanced Learners:

Oracle Java Tutorials: The official guides by Oracle for Java programming—great for understanding the depth of Java.
https://docs.oracle.com/javase/tutorial/
Baeldung - Learn Java and Spring: Focus on Spring Framework and modern Java technologies. Best for intermediate learners aiming to expand their knowledge.
https://www.baeldung.com/

Practice and Hands-on Learning:

Exercism - Java Track: Solve exercises and get feedback from mentors. Great for practicing coding skills.
https://exercism.io/tracks/java
LeetCode: Practice your coding skills and prepare for technical interviews with Java.
https://leetcode.com/

Free Resources and Documentation:

Java Programming and Documentation: A comprehensive collection of Java programming guides, tutorials, and API documentation.
https://docs.oracle.com/en/java/

Community and Support:

Stack Overflow: A vast community of developers. Great for getting help with specific problems or understanding concepts.
https://stackoverflow.com/questions/tagged/java
r/learnjava on Reddit: Join the community of Java learners and get advice, share resources, and discuss projects.
https://www.reddit.com/r/learnjava/

Remember: Learning to program takes practice and patience. Don't hesitate to experiment with code and participate in community discussions. Happy coding! 🎉

low marlin
#

anyone that has a good tutorial of making a custom npc in 1.21?

chrome beacon
#

Do yourself a favour and use Citizens

#

There's no need to reinvent the wheel for the 100th time

low marlin
#

I would love to suffer

chrome beacon
#

Then don't look for a tutorial

low marlin
#

legit

chrome beacon
#

How to create NPCs hasn't really changed in quite a bit

#

The guide that everyone keeps copy pasting should work if you tweak it to use proper mappings

low marlin
#

should I use the mojang mapping version?

chrome beacon
#

Yes

#

or if you want to suffer you can skip that

low marlin
#

nah not that level of suffering xd

blazing ocean
#

that's a very different kind of suffering

chrome beacon
blazing ocean
#

use yarn

blazing ocean
chrome beacon
#

Yeah I just don't remember if the tutorial shows how or not

#

but since it's a common issue I assume not

blazing ocean
#

.

low marlin
#

The thing is this part doesn't exist in 1.21

blazing ocean
low marlin
#

yeah I see

#

Thanks

glossy laurel
#

how to find memory leak :3

blazing ocean
#

look at memory graphs

glossy laurel
#

fr

quaint mantle
sullen marlin
#

System.gc() // leak fixed

eternal night
#

someone should write a plugin that does this 5Head

blazing ocean
#

task timer every 5 ticks

chrome beacon
#

That's already been done sadly

blazing ocean
remote swallow
#

do the spigot way, rewrite it but better and with hookers and blow

lilac dagger
quaint mantle
worldly ingot
#

3 g's so people know we're serious

proper cobalt
#

DeluxeClearLaggg+++++ Premium 🗿

#

hate names like that 🤦‍♂️

pliant topaz
#

The leading Plugin in reducing lag, join today for FREE

#

-# *We will be collecting every little part of data we find and can collect, but that's purely for optimizing our software

proper cobalt
#

EventPriority.HIGHEST happens after EventPriority.LOWEST right

young knoll
#

Yes

proper cobalt
#

yerrrrrrrrrrrr

remote swallow
sly topaz
#

does anyone have plugins which make use of PDC extensively

#

like, creating custom data types and the like

#

I am in the process of making a library to automate PDT creation but I'd like to see more real world usage of it to have a clear picture on how to go about it

young knoll
#

You could look at MorePDC

#

?morepdc

undone axleBOT
young knoll
#

Bot is slow today

dense cairn
#

sorry if im butting in, but in a plugin i just rewrote a chunk of, i have a PlayerDeathEvent that fires.
I wanted to establish that Player p = event.getEntity() and Player k = p.getKiller() are the same.
so i tried to use p.getUniqueId().equals(k.getUniqueId()), and in all cases that condition would always be false.
if i use the player name string p.getName().equals(k.getName()) however, it works correctly. was there something i missed in the first attempt? or is getUniqueId not as persistent as it suggests?

remote swallow
#

the aussie internet isnt happy

sly topaz
#

that said, is there any reason you aren't just doing instance equality?

dense cairn
#

just wanted to get something working first

sly topaz
#

well, UUID equality should just work honestly, which leads me to believe the issue was somewhere else so who knows

#

if you can reproduce it consistently, then do mention it, maybe there's some bug in there

dense cairn
#

oh nope it mustve been my own silliness haha

#

wonder what i managed to do now in the first place

sweet pike
#

is there any technique whatsoever to prevent players from colliding with each other when they are both on boats, while keeping the players visible to teach other?

young knoll
#

Do boats work with scoreboard team collision rules?

pliant topaz
pliant topaz
young knoll
#

Separate entity to what

pliant topaz
#

ah wait, i think i misunderstood

#

do you mean adding the boat to the team too?

young knoll
#

Yeah

pliant topaz
#

hmm

#

just checked, seems like that only works for LivingEntity

young knoll
#

Ah, darn

sweet pike
#

but somewhere in the readme it states this

young knoll
#

Yeah I saw a bit of that

#

Boats are janky

#

Which is a shame because boat racing is cool

sacred cedar
#

hey, i was wondering on how to add custom permissions to my plugin
is it like normal plugins where i would add them to the spigot.yml but inside a bungeecord plugin just in bungee.yml
or do i need to do it in another way
with commands it works great but how do i add like custom permissions to my plugin?

chrome beacon
sacred cedar
chrome beacon
#

I assumed you were making a Spigot plugin

sacred cedar
chrome beacon
#

Can't really find a place to register them

#

But you could just try using them without doing so

chrome beacon
sacred cedar
sacred cedar
grizzled bridge
acoustic shuttle
#

I'm not sure if this is a help-dev or help-server but, I'm creating worlds for minigames and I keep getting this flooding the console:
https://paste.md-5.net/moxuzowuyu.cs

It's obv something with saving 'raid data' but I have no idea how to stop it.

acoustic shuttle
pliant topaz
magic schooner
sharp bough
#

show the reload command

magic schooner
#

Ah wait I get it

sharp bough
#

ConfigGUI is saving the old instance of config

magic schooner
#

I didn't reload the confirm config 💀

sharp bough
#

yup

#

just setting or saving a provider<YamlDocument> works

magic schooner
#

Yeah no way i spent like an hour trying shi

sharp bough
#

😭 it happens

quaint mantle
#

anyone familiar with ACF?

blazing ocean
#

?ask

undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!

quaint mantle
#

how do u make command arguments using ACF?

#

I read the github wiki a bit and cooked up this ```java
@CommandAlias("party|p")
public class PartyCommand extends BaseCommand {

@Subcommand("invite")
public void onInvite(Player player) {
    System.out.println(player.getName());
}

}

#

player seems to be the sender..I thought it would make it an argument

sharp bough
#

just an example from one of my projects

    @Subcommand("of")
    @Syntax("<target>")
    @CommandCompletion("@players")
    @CommandPermission("crates.keys.other")
    public void onKeys(Player sender, @Single @Flags("other") OfflinePlayer target) {
        PlayerKeysData.showTo(sender, target);
    }
quaint mantle
#

ah

#

slight confusing.

sharp bough
#

the first argument is always the sender

quaint mantle
#

oh

sharp bough
#

there

blazing ocean
#

I don't like annotation based command frameworks tbh

#

I prefer cloud's builders

quaint mantle
#

I didn't understand cloud really well...

#

nice

#
    @Subcommand("invite")
    @Syntax("<target>")
    @CommandCompletion("@players")
    public void onInvite(Player player, @Single Player target) {
        System.out.println(player.getName());
    }```
sharp bough
#

ACF is golden

quaint mantle
#

are you able to disable pluginname:command?

blazing ocean
#

nope

quaint mantle
#

D:

blazing ocean
#

bukkit thing

mortal vortex
#

Can't disable, but you can hide it, nah?

blazing ocean
#

don't believe so

quaint mantle
#

I remember disabling it but idk how

blazing ocean
mortal vortex
#

"ctx" eww this isnt a discord bot

blazing ocean
#

fym

quaint mantle
#

No 🧢 I hate builder format

blazing ocean
#

I'm not typing out context nor am I using c

quaint mantle
#

this just looks nice and neat

blazing ocean
mortal vortex
#

Yeah icl Annotations are sexier

#

builder... so much nesting

quaint mantle
#

erm why is the target..sender?

sly topaz
#

it's mostly the case of it being a tree-like structure

sharp bough
#

or kotlin

sly topaz
#

though I believe CommandAPI does a decent job at offering a builder-like approach

quaint mantle
#

kt

blazing ocean
#

kotlin and yes

sly topaz
#

annotations do look nice, but it ends up being annoying at times, mostly when it comes to completions

quaint mantle
#

why does it set target to the sender?

sly topaz
quaint mantle
#

the 2nd arg

quaint mantle
sly topaz
#

yeah, for simple commands that works

sharp bough
#

imo one of the strong points on ACF is its sub class design that allows to make a subclass as a subcommand of a base command

blazing ocean
sharp bough
#

idk if you can do that with clouds builder

sly topaz
#

you can do that with cloud

quaint mantle
#

no..my question is

#

why is it setting the value of target to sender

sharp bough
sly topaz
#

just the argument

sharp bough
#

also self made help command, default and catch unkonwn are useful

blazing ocean
#

cloud has help too

sly topaz
#

I believe both CommandAPI and cloud offer that kind of workflow

sharp bough
#

really

blazing ocean
#
  • with cloud you don't need to do argument parsing yourself
sharp bough
#

then i have to check them out

#

im outdated 💀

sly topaz
#

there isn't much difference in terms of features between these, rather just design choices that one might prefer over another

blazing ocean
sly topaz
sharp bough
#

what was the command to reverify here? i changed my username but i have the old one here

quaint mantle
#

erm can someone explain me how command args work with ACF..

blazing ocean
sharp bough
#

all the rest are arguments in the command

sharp bough
quaint mantle
#

yes but I just put random word in it and it still for some reason prints my name

sly topaz
#

it probably just fills in with the sender if no argument is valid, there's probably an annotation to make it not do that

#

I assume it is using the getPlayer method that matches the closest thing

sharp bough
blazing ocean
#

yup that's also one of the reasons I chose to move away from ACF

sharp bough
#

i think thats an ACF bug

sly topaz
#

I'd say that's rather unintuitive but not something I'd really mind honestly

#

just a gotcha

#

back when I cared to use command frameworks, I prefered CommandAPI or ACF because they were simpler

#

cloud is just too big and I can't make sense of it

blazing ocean
#

I like cloud

sly topaz
#

I don't dislike cloud, I just can't understand it properly, and I couldn't be bothered to push my way through its intricacies when other perfectly fine choices exist as well

blazing ocean
#

I made a few extension functions and systems around it and I find it really enjoyable to work with

quaint mantle
sly topaz
#

is unjoinable your name

quaint mantle
#
    @Subcommand("invite")
    @Syntax("<target>")
    @CommandCompletion("@players")
    public void onInvite(Player sender, @Flags("other") @Single Player target) {
        System.out.println(target.getName());
    }```
i did add @Flags("other")
#

yes

blazing ocean
#

this is what I meant with argument parsing in ACF

#

cloud handles all that

quaint mantle
#

chat

#

the problem is not what is better.

sly topaz
#

offline player would mean anything would match

sharp bough
#

its not finding the name so its defaulting to the one that was found

#

that i dont understand about acf

quaint mantle
#

i will have to go in ACF discord ig.

blazing ocean
sharp bough
#

kt 😭

blazing ocean
#

I LOVE KOTLIN

sharp bough
#

is it really that good

quaint mantle
#

yeh no

blazing ocean
#

yessssss

sharp bough
#

iv been using java for 3+ years and it feels like an affair to use kt

sly topaz
quaint mantle
#

no.

#

OfflinePlayer worked but

sly topaz
#

what about just making it @Optional

quaint mantle
#

its not optional tho

sharp bough
#

another way (uglier) is making target String and checking yourself for online players, keep the autocompletion

sly topaz
#

does it do that with anything you input to it? Even numbers?

quaint mantle
sly topaz
quaint mantle
#

like in-game chat msg

#

about invalid argument

sly topaz
#

isn't that what you want?

sharp bough
#

databaseTransaction {
is that a function or a custom keyword?

quaint mantle
#

yea but would OfflinePlayers add all the players who have played?

sly topaz
#

any function that has a closure parameter at the end can be used as well, a closure

blazing ocean
#

and of course: ```kt
object EventTeamPlayers : Table("event_team_players") {
val uuid = uuid("uuid")
val teamId = varchar("team_id", EventTeamMetas.LONGEST_ID)
}

sly topaz
#

I've always got mixed feelings about trailing lambdas

#

they allow for nice DSLs if anything

sharp bough
#

this@EventT 😵‍💫

blazing ocean
sharp bough
#

😯

quaint mantle
#

where is the Table class from?

blazing ocean
#

exposed

sly topaz
#

exposed I assume

#

took me a second to remember the name lol

blazing ocean
#

feels java-ish

quaint mantle
#

corroutines in kotlin are useful in plugins?

blazing ocean
#

they definitely are, provided you're using something like mccoroutine

sly topaz
#

there are some libraries that take advantage of them

#

but alone, they are not

blazing ocean
#

I like them

quaint mantle
#

I want to learn them

sly topaz
#

mcc even supports minestom that's crazy

sharp bough
#

they just a fancier new Thread().run(callback) ?

quaint mantle
#

I just know the runBlocking, the launch and yield

blazing ocean
#

they have a lot more features

sly topaz
sharp bough
#

hm

sly topaz
#

this talk does a good job at explaining the differences

blazing ocean
#

KotlinConf talks are really nice

sly topaz
#

I prefer the devoxx talks, kotlinconf doesn't really explore much of the JVM itself

nova notch
#

this guy looks like elon musk

#

but like ai generated

quaint mantle
#

Fr

summer scroll
#

Is learning kotlin worth it? Been considering it.

sharp bough
summer scroll
#

The code that rad paste looks confusing as fuck lmao.

dry hazel
#

which is why you need to learn the language

#

to understand it

old coral
#

Hey, just started doing my own plugins.
Whats is the best way of finding out what methods do and how to use them?

Tried to search for Dokumentation but couldn't really find something

dry hazel
#

?jd-s

undone axleBOT
old coral
#

Thanks

kindred quest
#

Hello, I am creating a Fireball plugin, and I have a 30-second cooldown for each use. However, I want to add a countdown timer on the material in the inventory to show the remaining time like a screen or smth I'm not sure how to explain the idea

#

how to do that?

chrome beacon
#

Or use the material version of that method if you want it for all of them

kindred quest
chrome beacon
blazing ocean
kindred quest
chrome beacon
#

^^

kindred quest
#

on cubecraft server

chrome beacon
#

also has it really been 7 years 💀

kindred quest
#

we met in 2018

#

6-7

quaint mantle
#

Time flies

young knoll
#

I remember playing eggwars back then

#

Wonder if I ever rekt you nerds

upper adder
#

Does anybody know if the "update" folder usually works for plugins on velocity?

#

Maybe I'm wrong here...

young knoll
#

You should ask paper

upper adder
#

Does the ."../plugins/update" even usually work on Spigot?

young knoll
#

Yes

#

But the jar names need to match iirc

upper adder
#

Oh okay, it also works for Paper servers, but I wondered if it also works for their proxy. Does it work on BungeeCord or are plugins not supported on there at all?

chrome beacon
upper adder
#

Thank you very much for your help @young knoll !
I checked the file names, I understand that they have to match.

young knoll
#

Bungee does support plugins

#

Tho idk if it has the update folder

upper adder
#

Oh okay, I noticed that on paper I think I had to create an update folder manually.

pseudo hazel
#

egg wars was goated

cunning solstice
#

oh nmv

#

im stupid

river oracle
#

Yea yes you are

blazing ocean
cunning solstice
#

it won't work if i'll use depend

blazing ocean
#

Yeah because it isn't a plugin 💀

cunning solstice
#

🙂

blazing ocean
#

Okay?

#

that's been in spigot for a while now lol

#

and isn't a plugin

cunning solstice
young knoll
#

Well, only the chat api is in spigot

blazing ocean
#

Yeah what else would you want to be using on spigot

azure zealot
#

what kind of bungeecord api do you use?

azure zealot
#

what classes of the api do you use

cunning solstice
#

i mean command

azure zealot
#

server command?

cunning solstice
azure zealot
#

/server is not part of the api

blazing ocean
#

that's for bungee

#

that API

azure zealot
#

also it is bungeecord api

#

it is made for use with bungeecord plugins

#

not spigot plugins

young knoll
#

Yeah that just won’t work

#

You use plugin messaging to communicate with bungee

#

?pmc

cunning solstice
#

guh

blazing ocean
#

what

azure zealot
#

ehm

#

I dont understand what you‘re doing

cunning solstice
azure zealot
#

Yes

#

It is bukkit api

cunning solstice
#

i like having 300 lines of code

blazing ocean
#

which will not work

young knoll
#

So you aren’t even using the bungee api

azure zealot
river oracle
#

How does one manage...

cunning solstice
blazing ocean
#

???

#

"terminal commands on top"?

cunning solstice
#

i use terminal command handler a lot when using custom commands ok?

#
  • this thing works
#

if u want i can demonstrate in vc

blazing ocean
#

wha-

cunning solstice
#

why i keep getting problems with on player join event

#

time to use skript if im bad

azure zealot
#

tf

blazing ocean
#

at this point I have no idea what the fuck you're saying

azure zealot
#

i dont get the context of terminal commands

cunning solstice
#

like in all lobbies

#

but i keep getting log errors

azure zealot
#

how do you get errors

#

show us the errors

cunning solstice
#

nty

#

i'd rather use skript instead of spigot

#

pain to understand

azure zealot
#

using the bukkit api will be much better

#

would not recommend to use skript

cunning solstice
#

why not?

#

fine if u say so

#

try to help me with this:

    @EventHandler
    public void onPlayerJoin(PlayerJoinEvent event) {
        Player player = event.getPlayer();
        handleAdminPrivileges(player);
        teleportPlayerToLobbySpawn(player);
        player.sendMessage("§eLobby rules: Block breaking/placing disabled for non-admins.");
    }
    private void teleportPlayerToLobbySpawn(Player player) {
        if (lobbySpawn != null) {
            try {
                player.teleport(lobbySpawn);
            } catch (Exception e) {
                getLogger().log(Level.SEVERE, "Failed to teleport player to lobby spawn", e);
                player.sendMessage("§cTeleportation to lobby spawn failed.");
            }
        } else {
            getLogger().warning("Lobby spawn not configured. Skipping teleportation.");
        }
    }

    private void configureLobbySpawn() {
        World world = Bukkit.getWorld("world");
        if (world != null) {
            lobbySpawn = new Location(
                    world,
                    1.0,
                    14.0,
                    88.0,
                    180f,
                    0f 
            );
        } else {
            getLogger().severe("Could not find a valid world for lobby spawn.");
            lobbySpawn = null;
        }
    }
sharp bough
cunning solstice
#

leme restart server coz i deleted logs

#

[16:01:59 ERROR]: [HawkStudios-lobby] Could not find a valid world for lobby spawn.

sharp bough
#

not really that complicated
World world = Bukkit.getWorld("world");
world is null

#

either loading too quickly or "world" doesnt actually exist in your server

sharp bough
#

i think Bukkit.getServer().getWorlds().get(0) returns the overworld

#

or Bukkit.getServer().getWorlds().getFirst()

cunning solstice
#

nope

sharp bough
#

System.out.println("Bukkit.getServer().getWorlds().getFirst() = " + Bukkit.getServer().getWorlds().getFirst());
Bukkit.getServer().getWorlds().getFirst() = CraftWorld{name=world}

#

it does..

cunning solstice
#

tbh my world name actually "lobby"

#

i changed and don't know why it doesn't work

sharp bough
#

error..?

cunning solstice
sharp bough
#

show code

sharp bough
#

you did update this
World world = Bukkit.getWorld("world");
right?

cunning solstice
#

changed world name with lobby

cunning solstice
#

"World world = Bukkit.getWorld("lobby");"

sharp bough
#

run this System.out.println("Bukkit.getServer().getWorlds() = " + Bukkit.getServer().getWorlds()); and show the output

cunning solstice
#

At line:1 char:57

  • System.out.println("Bukkit.getServer().getWorlds() = " + Bukkit.getSe ...
  •                                                     ~
    

You must provide a value expression following the '+' operator.
At line:1 char:58

  • ... rintln("Bukkit.getServer().getWorlds() = " + Bukkit.getServer().getWo ...
  •                                              ~~~~~~~~~~~~~~~~
    

Unexpected token 'Bukkit.getServer' in expression or statement.
At line:1 char:57

  • System.out.println("Bukkit.getServer().getWorlds() = " + Bukkit.getSe ...
  •                                                     ~
    

Missing closing ')' in expression.
At line:1 char:75

  • ... intln("Bukkit.getServer().getWorlds() = " + Bukkit.getServer().getWor ...
  •                                                              ~
    

An expression was expected after '('.
At line:1 char:88

  • ... Bukkit.getServer().getWorlds() = " + Bukkit.getServer().getWorlds());
  •                                                                    ~
    

Unexpected token ')' in expression or statement.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : ExpectedValueExpression

#

:/

#

u mean in server terminal or plugin?

sonic goblet
#

For loop over all Bukkit.getServer().getWorlds() and output their name

#

He means plugin

sharp bough
cunning solstice
#

how?

sharp bough
sharp bough
cunning solstice
#

im bad with terminal

#

xd

sharp bough
#

?learnJava

#

?learnjava

undone axleBOT
#

For Beginners:

Codecademy - Learn Java: Interactive Java programming course from basics to more advanced concepts. Perfect for absolute beginners.
https://www.codecademy.com/learn/learn-java
JetBrains Academy - Java Developer Track: Learn by doing with projects and challenges. It covers Java fundamentals to advanced topics.
https://www.jetbrains.com/academy/
Udemy - Java Programming Masterclass for Software Developers: Updated courses that cover Java 8 to Java 17 features. Suitable for those who prefer structured learning.
https://www.udemy.com/course/java-the-complete-java-developer-course/

For Intermediate to Advanced Learners:

Oracle Java Tutorials: The official guides by Oracle for Java programming—great for understanding the depth of Java.
https://docs.oracle.com/javase/tutorial/
Baeldung - Learn Java and Spring: Focus on Spring Framework and modern Java technologies. Best for intermediate learners aiming to expand their knowledge.
https://www.baeldung.com/

Practice and Hands-on Learning:

Exercism - Java Track: Solve exercises and get feedback from mentors. Great for practicing coding skills.
https://exercism.io/tracks/java
LeetCode: Practice your coding skills and prepare for technical interviews with Java.
https://leetcode.com/

Free Resources and Documentation:

Java Programming and Documentation: A comprehensive collection of Java programming guides, tutorials, and API documentation.
https://docs.oracle.com/en/java/

Community and Support:

Stack Overflow: A vast community of developers. Great for getting help with specific problems or understanding concepts.
https://stackoverflow.com/questions/tagged/java
r/learnjava on Reddit: Join the community of Java learners and get advice, share resources, and discuss projects.
https://www.reddit.com/r/learnjava/

Remember: Learning to program takes practice and patience. Don't hesitate to experiment with code and participate in community discussions. Happy coding! 🎉

cunning solstice
#

i use intelij bro

cunning solstice
sullen canyon
cunning solstice
sharp bough
#

lmfao

#

andri, first learn java, then learn bukkit and come back

cunning solstice
sharp bough
#

theres like a billion yt tutorial videos

#

watch a few

sharp bough
cunning solstice
#

online classes moment

#

i mean i took online classes at summer

#

so i forgot how to do some things

sharp bough
#

call 911

#

you got scammed

cunning solstice
#

no

#

i didn't code for so long so don't bully me

#

it was 1 yr ago since i took that lesson

#

rn im taking random mc plugin dev tutorials

sharp bough
#

thats fine but dont ask every tiny little question here

cunning solstice
#

fine

#

time to learn java again

#

😭

sharp bough
#

dw its like riding a bicycle

#

thats on fire

cunning solstice
#

okay nope ima use "for beginners"

chrome beacon
#

You really don't have to use Netbeans

#

or xp/older

shadow night
warm mica
pliant topaz
quaint mantle
#

Hi, how can I hide the a boosbar and show only the text of it?

blazing ocean
#

remove the background texture with a resource pack

quaint mantle
#

btw now I don't see sendActionBar() method in Player class

blazing ocean
#

what

#

use Player.Spigot#sendMessage with the action bar type

grim hound
#

spinning donut

#

animation ain't smooth

#

I'm left wondering

#

anyone knows what I might be doing wrong?

old coral
#

is there a way to convert a block into an container? I need the custom name from a container when a Player interacts with it, but the way I've tried it didn't work

block = event.getClickedBlock();
Container container = (Container) block;
chrome beacon
#

I hope you're not identifying blocks by their name

#

Anyways Container is part of the block state

old coral
#

Okay thanks, but how exactly do I access the block state? Sorry if it sounds silly but I've started with minecraft plugins yesterday

smoky anchor
#

Don't forget to do instanceof check for the container
If you're on newer version of Java, you can use pattern matching

old coral
#

allready did that thanks

wintry anvil
#
    @EventHandler
    public void onPlayerChatEvent(AsyncPlayerChatEvent e) {
        if (e.getMessage().contains(":skull:")) {
            e.setMessage(e.getMessage().replace(":skull:", "☠"));
        if (e.getMessage().contains(":heart:")) {
            e.setMessage(e.getMessage().replace(":heart:", "❤"));
        if (e.getMessage().contains(":star:")) {
            e.setMessage(e.getMessage().replace(":star:", "⭐"));
        }
    }}}

why does the replace only work on the skull?

glossy laurel
#

how to add minimessage to scoreboard?

glossy laurel
glossy laurel
wintry anvil
wintry anvil
glossy laurel
#

Anyways, how do I add components to scoreboard?

blazing ocean
#

objectives have display names nowadays

#

tho that does not accept components on spigot :')

#

unless... @ choco

glossy laurel
#

unless paper or what

blazing ocean
#

no

#

component PR

glossy laurel
#

what is that

blazing ocean
#

before asking "what is that" to everything I'd suggest thinking what it could mean :')

#

what could a component PR be doing

glossy laurel
#

well

#

idk what PR means

#

so

wintry anvil
#

Is there a way to get rid of the message that says that the message is edited by the server on hover?

blazing ocean
#

if you modify the messages, no

wintry anvil
#

So the only way is to cancel the message and let the server send it?

blazing ocean
#

yeah, that can cause problems on the client tho

glossy laurel
quaint mantle
#

Correct

wintry anvil
blazing ocean
#

no

#

it's how chat signing works

wintry anvil
#

hm, k. thx

glossy laurel
pseudo hazel
#

a pull request to get better component support into spigot

#

for things like the scoreboard objectives

silent slate
#

Hey, this is my first time working with SQL and SQL in Java, i heard that JDBC is the tool that opens the connection to the mysql server, now im left wondering why my server spams these errors every time I try to make an connection

[Server thread/WARN]: java.sql.SQLException: No suitable driver found for IP-ADRESS

This is how i get my connection if that helps

Connection conn = getConnection("IP-ADRESS:PORT", "USERNAME", "PASSWORD");

I also heard below version 4 you need to import some class, but im importing version 8, so this shouldnt matter for me, right?

Thanks in advance

chrome beacon
desert aspen
glossy laurel
#

how to use hex colors in scoreboards?

sharp cosmos
#
java.lang.IllegalStateException: Cannot create additional worlds on STARTUP```
What's the earliest I can create a world?
#

or rather, load them

pseudo hazel
#

probably onEnable?

sharp bough
old coral
#

how do I force a player to leave a container

chrome beacon
#

player#closeInventory

silent slate
chrome beacon
#

What database are you connecting to

silent slate
#

a mysql database

zealous scroll
#

What's the proper way to get a player's ping using PacketEvents?

chrome beacon
#

There are many different SQL databases

silent slate
#

i dont know, i really dont, its from java.sql.drivermanager

#

i dont even know if i use a driver, how to find that out?

chrome beacon
#

You would know before hand what you want to use

silent slate
#

mhh, but i dont, never worked with sql before until now

#

what do most people use for a mc plugin?

blazing ocean
#

SQLite is a common one

chrome beacon
#

Spigot bundles MySQL Connector

#

SQLite is also bundled

silent slate
#

but can i still use my code i have now?

#

what do i need to add?

chrome beacon
#

We don't know what code you have

silent slate
#

            PreparedStatement getMaintenanceStatement = conn.prepareStatement("SELECT * FROM server_settings WHERE UUID = '00000000-0000-0000-0000-000000000000'");
            ResultSet result = getMaintenanceStatement.executeQuery();```

Just an example
chrome beacon
#

Send us your actual code

#

?paste