#help-development

1 messages Β· Page 19 of 1

jade roost
#

now

chrome beacon
#

When working with NMS there's a lot you need to figure out yourself

#

There won't be a tutorial for everything

#

So some practice could be to take a look at some of the nms classes and see if you can understand what they do

peak jetty
#

hi im having problems with this code there are no errors but it doesnt work:

package net.plutocraft.minigame1;

import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.java.JavaPlugin;

import java.util.concurrent.TimeUnit;

public final class Minigame1 extends JavaPlugin {

    @Override
    public void onEnable() {
        getLogger().info("Minigame1 plugin enabled.");
    }

    @Override
    public void onDisable() {
        getLogger().info("Minigame1 plugin disabled.");
    }

    @EventHandler
    public void onBlockBreak(BlockBreakEvent e) {
        Block block = e.getBlock();
        Player player = e.getPlayer();
        if(block.getType().equals(Material.MANGROVE_WOOD)) {
            e.setCancelled(true);
            block.getDrops().clear();
            player.getInventory().addItem(new ItemStack(Material.MANGROVE_WOOD, 1));
            try {
                Thread.sleep(5000);
            } catch (InterruptedException ie) {
                Thread.currentThread().interrupt();
            }
            block.setType(Material.STONE);
        }
    }

}
chrome beacon
#

Why are you thread sleeping πŸ‘€

peak jetty
#

i need to wait 5 second

chrome beacon
#

You're pausing the server for 5000ms ever block break

#

You don't want to pause the server

#

?scheduling Use this

undone axleBOT
desert loom
#

use a scheduler and you also forgot to register your listener.

chrome beacon
#

^^

peak jetty
#

ok so how would i make it do:

e.setCancelled(true);
            block.getDrops().clear();
            player.getInventory().addItem(new ItemStack(Material.MANGROVE_WOOD, 1));

and then after 5 secs make it do:

block.setType(Material.STONE);
#

also how do i register the listener? thanks

desert loom
desert loom
tardy delta
#

thread sleeping is always fun

pseudo cradle
peak jetty
tender shard
#

?events

#

?eventapi

undone axleBOT
quasi sundial
peak jetty
#

its in the main class tho

tardy delta
#

there is a BossBar method that clears all the players of it

#

ah youre calling it

hard socket
#

I made this in 1.16 and it works but not 1.8

#

how do i make it work

chrome beacon
#

Looks like normalizeYaw doesn't exist

#

So create it

eternal oxide
#

wrong version

#

pre/post 1.13

drowsy helm
#

ah damn

#

trying to set the skull's signature without nbt any easy ways?

#

or can i use pdc

eternal night
#

you cannot use PDC

eternal oxide
#

which spigot?

drowsy helm
eternal oxide
#

yes

drowsy helm
#

1.19

eternal oxide
#

?paste

undone axleBOT
eternal oxide
drowsy helm
#

I'm able to use retextured heads to "render" a player's skin so theoretically i can generate my own signature and texture string and render anything i want right

eternal oxide
#

thats a sample class with making skulls

drowsy helm
#

ah so have to use reflection

eternal oxide
#

or look later

#

getHeadByProfile no reflection

drowsy helm
#

can id be random for getHeadByProfile?

eternal oxide
#

yes

drowsy helm
#

ah too easy

#

tyvm

eternal oxide
#

if you find a way to use your own embedded textures/signature let me know

#

I've not looked into it but it has to be possible

drowsy helm
#

yeah ill tell you how it goes

#

if its the case its a game changer

sterile token
#

Dumb question but its possible to render a QR on minecraft?

eternal oxide
#

yep

#

sorry that wasnt; to you

drowsy helm
eternal oxide
#

but yes you could in thoery render a QR to a map

sterile token
sterile token
#

And what about for creating it and parsing it?

drowsy helm
#

yeah

#

probably use some other library

#

get the pixels and render it to a map

sterile token
#

Allright thanks

#

Something like that right?

#

Just taken from a random plugin i decompile

drowsy helm
#

yeah

drowsy helm
#

this is whacky

old cloud
#

If I send a plugin message to a server (from proxy) how does the server know from which "player" it is coming from?

wet breach
#

therefore, all one has to do or really the server, is see which connection the plugin message is coming from

old cloud
#

Yea but I am sending it via ServerConnection or ServerInfo

#

That sounds like as if bungeecord would send it directly to a server

#

which doesnt work i know, but that would mean each server connection is just a simulated player?

wet breach
#

no, for plugin message channels to work, a player has to be connected to the server you want to send messages to

#

because it literally uses the players connection to the server to send the messages

old cloud
#

Yes I know

sterile token
old cloud
#

I mean why are the classes called ServerConnection or ServerInfo if its just the connection of a player to a server through the proxy

old cloud
#

So there can be multiple "ServerConnection's" to one server for each player on that server

#

the naming is just confusing me

sterile token
old cloud
#

I mean how would you do it otherwise? The servers dont even know that they are connected with a proxy right

sterile token
#

of couse they know hahaha

old cloud
#

no

wet breach
sterile token
#

That why there is a section called SERVERs on the proxy config

wet breach
#

I mean, not sure if you remember in the spigot.yml you have to set bungee to true and all

old cloud
sterile token
#

I agree that the packet should be sent from server to proxy thru a player connection but not for receiving it

wet breach
#

then, there is the connection from the server to proxy

#

which serves a different purpose and is not reliable for sending messages

sterile token
old cloud
#

sockets

eternal night
#

just use any form of pub sub lol

sterile token
old cloud
#

threads exist

sterile token
wet breach
sterile token
#

Why not all can afford!

sterile token
wet breach
#

otherwise it gets dc'ed

sterile token
#

I mainly did the player connect thru proxy and being redirected to server

#

But it joined as a normal player and them seconds like 40 get kicked

old cloud
#

I am pretty sure the player always connects thru the proxy

wet breach
#

yep, because you didn't send a keep alive packet and didn't respond to the servers ping packet

sterile token
wet breach
sterile token
#

Protocols should not change a lot on diff versions because them it mess working with it

wet breach
sterile token
#

πŸ˜‚

wet breach
#

If there is no update to the protocol, the most that happens typically is a minor version bump and that is about it

sterile token
old cloud
#

packet ids are constantly updated, even if the packets dont change at all

wet breach
#

it is the same between many versions, can't say it is the exact same in all versions

ivory sleet
#

Yeah I mean they remain the same unless justifiable reasons

sterile token
#

Sorry for being like thi

tardy delta
#

thicc

old cloud
#

So what do the ServerConnection and ServerInfo classes represent now?

sterile token
#

But i really want to achive my own aproach for making PMC better so i really get mad when protocols are diff because is even more work for us

wet breach
#

it got broken up into smaller parts

sterile token
old cloud
sterile token
#

I also dont really understand how the protocols are implement

#

Because they use 0x28 and varInt shits

#

instead of using normal numbers btw

old cloud
#

thats just a number in hex

wet breach
old cloud
#

and var int is pretty smart actually

sterile token
#

In fact i think im not really prepare for prtocols

wet breach
old cloud
sterile token
#

Also my big question is why big brains didnt thought about doing a good deign which doesnt require a player for PMC?

#

because they were/are big brains wokring there

#

πŸ˜‚

old cloud
#

Because pmc is part of the protocol which is designed to work Server <-> Player

sterile token
#

That doesnt join into my head

wet breach
# old cloud sending data to it but from which 'player'?

which ever is connected, typically utilizes the connection of the player that first connected or should say, which ever player has the oldest connection due to how lists and what not work. Haven't quite looked at the code for the proxy, but I don't think it really picks a random connection to utilize just which ever one is first.

eternal night
#

are you asking why mojang doesn't actively design their product for third party modifications ? xD

old cloud
#

true lol

sterile token
old cloud
#

then why dont you understand it

sterile token
#

Now that you tell that PMC was design for player communication its pretty more rasonable

wet breach
#

PMC was developed mostly with Forge in mind

sterile token
#

Okay so is there any mc protocol that you said oh wow that lib is amazing for protocol

wet breach
#

just to make them feel like they were in the loop, like bukkit was πŸ˜›

sterile token
#

I mainly look for one which implement the major versions not only shity new ones

#

Because that my personal opinion im mostly a 1.8 player

old cloud
sterile token
#

πŸ˜‚

wet breach
old cloud
#

no

sterile token
#

I also have seen 3 posbiltiies for doing that

  1. Modifying source code
  2. Making a fake client
  3. Injecting into proxy and server netty
wet breach
#

all of which are dumb

old cloud
#

For example if I want to do something with a player from the proxy, which by default the proxy is not able to do, can I utilize the connections to specify which player i want to perform the action on or should i include the player inside the plugin message's data

wet breach
#

you should include the players UUID in the message data

sterile token
#

The most better and simply would be the Netty because it just declaring your own channel, the handler, the protocol somethings extra and you are done

old cloud
ripe urchin
#

Hey I'm having issues with a command that is supposed to spawn an NPC.

public boolean onCommand(@NotNull CommandSender commandSender, @NotNull Command command, @NotNull String s, @NotNull String[] strings) {

        if (commandSender instanceof Player) {
            ServerPlayer sp = ((CraftPlayer) commandSender).getHandle();
            Location loc = ((CraftPlayer) commandSender).getLocation();
            MinecraftServer server = sp.getServer();
            ServerLevel level = sp.getLevel();
            GameProfile gameProfile = new GameProfile(UUID.randomUUID(), sp.getDisplayName() + "'s corpse");

            ServerPlayer npc = new ServerPlayer(server, level, gameProfile, null);
            npc.setPos(loc.getX(), loc.getY(), loc.getZ());

            ServerGamePacketListenerImpl ps = sp.connection;
            ps.send(new ClientboundPlayerInfoPacket(Action.ADD_PLAYER, npc));
            ps.send(new ClientboundAddPlayerPacket(npc));
        }

        return true;
    }

When running the command it just says "an unexpected error occurred"

#

nothing is printed to the console

eternal oxide
#

command not registered?

ripe urchin
#
commands:
  spawncorpse:
    description: spawn a corpse of yourself
    usage: /<command>
``` in the plugin.yml
#

and getCommand("spawncorpse").setExecutor(new CreateCommand()); in the main class

eternal oxide
#

then your plugin is not loading, or you didn;t remap using specialsource

ripe urchin
#

the rest of the plugin is working

#

the plugin itself is loaded

eternal oxide
#

did you remap?

ripe urchin
eternal oxide
#

you are using remapped classes ServerPlayer

#

those don;t exist on a live server

#

you need teh specialsource plugin in your pom to remap them

ripe urchin
#

oh i am using the remapped jar from maven

pine lake
#

Is there somehow to test the plugin without always need to build it and sending it to a server?

wet breach
#

hmmm

#

I forgot the command

#

?bootloader

eternal oxide
ripe urchin
#

okay i'm trying

eternal oxide
#

?bootstrap

undone axleBOT
#

Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or the entire contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.

Please read the release notes for further information: https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-1-release.534760/#post-4305163

wet breach
wet breach
ripe urchin
pine lake
wet breach
pine lake
wet breach
pine lake
#

Is it a sort of reload?

wet breach
#

jrebel is something that is already made to do such things, unfortunately costs money, there is free alternatives out there if you search for them, however I have no idea how good they are or if they work

wet breach
ripe urchin
wet breach
#

hotswapping, is where it swaps out the class files in the plugin that has changed without having to reload or stop the server

ripe urchin
wet breach
#

its not something for someone who is new with java as it is a relatively an advanced thing

#

Jrebel used to be free and cheaper and is an awesome pre-built tool that provided that functionality easily

pine lake
#

Ok thanks

waxen vapor
#

Hi, im completly new to plugin development. I was wondering how i would replace the block next to the block i just placed? Currently i have the functionality for checking if i place a sea lantern, and if so i return a message to the player. How would i replace the blocks around the sea lantern? I know the setType(), but i dont know how i would get the block surrounding the block i just placed. Can i get some help? Sorry for bad explaining, i can explain in more detail if anyone can help

ripe urchin
wet breach
#

you need to get a Location, which you can get from the sea lantern block object

tardy delta
#

event.getBlock().getRelative(BlockFace.SOMETHING).setType(Material.SOMETHINH)?

wet breach
#

from there, you can then modify the location object z and x axis as well as the y to get the blocks you are wanting

wet breach
#

would miss the blocks that are diagonal

waxen vapor
#

Yeah, and i wanna change the blocks above it too

wet breach
waxen vapor
#

Bassicly, my idea is that you place a sea lantern as a "generator". When you place the sea lantern block, it makes like a monument? so when i place it, it make a custom structure 3x3, so i need to know how to change the blocks above too

waxen vapor
#

I will try!

waxen vapor
tardy delta
waxen vapor
#

e.getBlock().getLocation()

tardy delta
#

not calling your parameter event 😒

waxen vapor
#

LMAO IM SRY

#

just easier :D

tardy delta
#

go to the shame corner

waxen vapor
rain mason
#

ServerListPingEvent for some reason doesnt get called

waxen vapor
rain mason
frosty tinsel
#

It must be registered

#

Do you have Bungedcord?

rain mason
#

i have it in my main JavaPlugin file

rain mason
frosty tinsel
#

You still have to register it

#

?events

#

?event

rain mason
#

Γ€lr, weird that AsyncPlayerChat events etc still work in JavaPlugin

frosty tinsel
#

Show whole class

rain mason
# frosty tinsel Show whole class
// import stuff

public final class OCMEssentials extends JavaPlugin {
    // onEnable, onDisable, etc...

    public int IJ = 0;

    @EventHandler
    public void onServerPingEvent(ServerListPingEvent e) {
        IJ += 1;
        System.out.println(IJ);
        e.setMotd(String.valueOf(IJ));
    }
}```shortened
waxen vapor
#

I DID IT!

rain mason
wet breach
waxen vapor
#

Also, if i wanted a custom item? How would i do that? Cause rn, i just have it set so if i place a sealantern it builds around that, but like what if a player just buys a sea lantern from the shop, they just get it. How would i create a custom item/block, that i can place?

rain mason
#

literally the only thing that doesnt work is the ping event lmao

frosty tinsel
#

Fix it yourself then, when you clearly know everything

rain mason
frosty tinsel
rain mason
gaunt relic
pine lake
#

Hello, how can I setup a server in the Development Env?

waxen vapor
gaunt relic
#

you can get the persistent data of the item with #getPersistentDataContainer

#

then use the #set method to add the key, and #has method to check if the item being placed has the key

waxen vapor
waxen vapor
#

WHY EVERYONE SO HELPFULL HERE LMAO

#

I love you all ❀️

wet breach
#

it is what a community is for

eternal night
#

WHY EVERYONE SO HELPFULL HERE LMAO
first time someone said that in the spigot discord xD

wet breach
#

yeah usually they are complaining of the opposite

rain mason
#

it's-a-me again, how would I change an ServerListPingEvent's MOTD after the event was resolved? I've seen a lot of people on spigotmc.org just delay event.setMotd using the scheduler, but that just doesnt work for me

eternal night
#

Well all because you don't tell me why my 1.8 server does not work with my outdated plugins !!!

#

the event def does not allow you to do that

#

generally no event is valid to modify a tick later

waxen vapor
# waxen vapor Butttttt, some objects dont work when i place them. Like glas panes, arent conne...

My problem bassicly is: Glas panes are not connected to the blocks next to it, and like how would i make the structure rotate towards me? Like lets say i have a chest in the the front, and around it i have dirt, EXCEPT the front of the chest, no dirt there. How would i make it so when i place the chest, it would face towards me, and it would not place the dirt infront of the chest, but the other sides

flint coyote
wet breach
rain mason
# eternal night generally no event is valid to modify a tick later

hmm, this is an example of someone's code, it worked for them for some reason ```java

@EventHandler
public void countDown(final ServerListPingEvent event){
if(gameHasEnded == true){ //if the game is in where it should countdown (lobby)
this.getServer().getScheduler().scheduleAsyncRepeatingTask(this, new Runnable(){
public void run(){
int countdown = 60; //count down for a minute (60 seconds)
if(countdown > 0){ //if the countdown isn't at 0
countdown--; //take one away from the countdown
event.setMotd("Next Game: " + countdown + " seconds"); //set the motd as the time until the countdown hits 0
}
if(countdown == 0){
gameHasEnded = false;
event.setMotd("A game is currently in session!");
//here you put your code to start the hunger games
}
}
}, 20, 20);
}
}

tardy delta
#

== true :(

eternal night
#

doubt

#

this can never work

#

that is not how the server executes/publishes events

waxen vapor
#

how do i make them connect to the blocks next to them when placed

tardy delta
#

declare the countdown before the runnable

rain mason
flint coyote
waxen vapor
#

lol

eternal night
#

Yea just look at frost, at best 2 days of experience Kapp

#

still beats me tho, just started my udemy course

deep sail
#

Anyone know why itemmeta is null even after assign one using bukkits item factory?

wet breach
eternal night
#

don't use the bukkit item factory

#

to create item metas

flint coyote
# waxen vapor lol

glad you try to figure things out alone and just ask for starting pointsβ™₯️
Nobody minds you asking questions as long as there's at least some self effort

deep sail
eternal night
#

what is the xy here

#

usually you get the item meta using getItemMeta on the item stack

wet breach
#

the xy is that z is missing

deep sail
rain mason
#

nah cuz why is everyone so scared of Β§

deep sail
#

using that method

rain mason
#

why does everyone jsut type \u00a7

eternal night
#

an item stack that does not return you an item meta does not support item meta

echo basalt
eternal night
#

specifically because that item stack is air

echo basalt
#

Might just be your IDE tho

rain mason
deep sail
#

ah that could be it since i'm getting random materials, i'll check thanks

wet breach
eternal night
#

Yea basically every item stack should return you a valid item meta instance when calling getItemMeta

#

beyond the different air types

small current
#

how can i listen for a dropped item hitting the ground?

eternal night
#

don't think there is an event for that

echo basalt
small current
#

what is that

echo basalt
#

uhh

#

grab the current position

eternal night
#

why raytrace ? xD

#

there is isOnGround

#

lol

echo basalt
#

then do gravity yourself basically

flint coyote
#

or just scheduler and a set lol

deep sail
small current
#

i have an idea

wet breach
#

java class files can be in other other character encodings other then UTF, therefore the character point for the section sign could be different if you use the actual character versus using the utf character code itself which guarantees java knowing its the section sign

small current
#

listen for a player dropping it

#

checking every 20 tick

wet breach
#

hope that clarifies the issue on that

warm mica
small current
#

if its on the ground

#

do my thing

warm mica
#

Worst way to do it

flint coyote
#

yup that works

eternal night
#

there should really not be any beyond air

#

unless I missed something

deep sail
#

yeah will do

eternal night
#

(maybe some other debug materials ? or block only materials)

flint coyote
#

sugar_cane_block or how it's called if that's still a thing

#

but then again it's not solid

ripe urchin
#

I'm trying to make a command that spawns an NPC (mostly to just mess around with both commands and NMS to learn how they work), but whilst running the command I just get "an unexpected error occurred" No errors are printed to console.

    public boolean onCommand(@NotNull CommandSender commandSender, @NotNull Command command, @NotNull String s, @NotNull String[] strings) {

        if (commandSender instanceof Player) {
            ServerPlayer sp = ((CraftPlayer) commandSender).getHandle();
            Location loc = ((CraftPlayer) commandSender).getLocation();
            MinecraftServer server = sp.getServer();
            ServerLevel level = sp.getLevel();
            GameProfile gameProfile = new GameProfile(UUID.randomUUID(), sp.getDisplayName() + "'s corpse");

            ServerPlayer npc = new ServerPlayer(server, level, gameProfile, null);
            npc.setPos(loc.getX(), loc.getY(), loc.getZ());

            ServerGamePacketListenerImpl ps = sp.connection;
            ps.send(new ClientboundPlayerInfoPacket(Action.ADD_PLAYER, npc));
            ps.send(new ClientboundAddPlayerPacket(npc));
        }
        return true;
    }

pom.xml: https://paste.md-5.net/atoheyahif.xml
Using both the normal and remapped .jar with no difference.

wet breach
#

you should make it a habbit to return false at the end of your commands, and return true in the various check block statements

ripe urchin
#

or wait is it because i'm not doing an if statement to check the command name?

wet breach
#

in this way, you will always know if your command actually didn't run

#

so in your example above, at the end in the if block

#

put return true

#

change the return true on the outer to false

ripe urchin
#
    public boolean onCommand(@NotNull CommandSender commandSender, @NotNull Command command, @NotNull String s, @NotNull String[] strings) {

        if (commandSender instanceof Player && command.getName().equalsIgnoreCase("spawncorpse")) {
            ServerPlayer sp = ((CraftPlayer) commandSender).getHandle();
            Location loc = ((CraftPlayer) commandSender).getLocation();
            MinecraftServer server = sp.getServer();
            ServerLevel level = sp.getLevel();
            GameProfile gameProfile = new GameProfile(UUID.randomUUID(), sp.getDisplayName() + "'s corpse");

            ServerPlayer npc = new ServerPlayer(server, level, gameProfile, null);
            npc.setPos(loc.getX(), loc.getY(), loc.getZ());

            ServerGamePacketListenerImpl ps = sp.connection;
            ps.send(new ClientboundPlayerInfoPacket(Action.ADD_PLAYER, npc));
            ps.send(new ClientboundAddPlayerPacket(npc));
            return true;
        }
        return false;
    }
wet breach
#

there you go

#

now, if that section for whatever reason doesn't run, the server will tell you the command didn't run πŸ˜›

ripe urchin
#

oh and should you be using the normal or remapped jar?

wet breach
#

normal jar for running the server

#

remapped is only for development purposes so you can compile your jar

ripe urchin
#

oh and one other quick side question, using /reload in development should work fine for commands?

#

or might they break?

wet breach
#

usually, but sometimes it still breaks for commands

#

just depends on whether or not the plugin is designed to handle such things

ripe urchin
#

i don't have anything special that i'm storing/doing so i should be fine

ripe urchin
wet breach
#

in other words, handle when certain things magically go null

ripe urchin
#

null checks are super important

wet breach
# ripe urchin

did you register the command in plugin.yml and the server?

flint coyote
ripe urchin
#
commands:
  spawncorpse:
    description: spawn a corpse of yourself
    usage: /<command>
public final class Corpses extends JavaPlugin {
    private Ticker ticker = null;

    @Override
    public void onEnable() {
        // Plugin startup logic
        PluginManager pm = getServer().getPluginManager();
        this.saveDefaultConfig();

        pm.registerEvents(new DeathEventListener(this), this);
        pm.registerEvents(new CorpseClickEvent(this), this);
        ticker = new Ticker(this);

        getCommand("spawncorpse").setExecutor(new CreateCommand());
    }
wet breach
#

this makes it easier development wise to know your commands are running and the appropriate check blocks are being ran

flint coyote
#

yeah the "not be encountered" part makes sense. The default message from spigot was the one I just mentioned^^

#

dunno if it still is

wet breach
#

probably is

#

But regardless super handy to see it when making plugin commands lol

#

especially if you get a command that is a bit lengthy code wise

ripe urchin
wet breach
#
            ServerPlayer sp = ((CraftPlayer) commandSender).getHandle();
            Location loc = ((CraftPlayer) commandSender).getLocation();
#

why are you using CraftPlayer here?

#

Just use the normal Player

ripe urchin
#

using NMS so i'm going to the mojang version (ServerPlayer)

wet breach
#

just because you are building against the server jar, doesn't mean magically you lose access to API stuff πŸ˜›

ripe urchin
#

in this case yes i could just use the normal spigot API version for what i'm doing, but i might do more with it that i need the mojang version

wet breach
#

you can just use normal player stuff there, only time it wouldn't make sense to is if you have some specific reason you need those NMS classes

wet breach
#

always stick with API unless you actually need NMS

#

otherwise you are just over complicating unnecessarily

ripe urchin
#

oh yeah wait i needed itfor the new ServerPlayer

#

that one requires NMS classes and not spigot API classes

wet breach
#

new ?

ripe urchin
#

ServerPlayer npc = new ServerPlayer(server, level, gameProfile, null);

#

it uses the NMS classes

#

it doesn't accept spigot API classes

wet breach
#

is that your class you made?

ripe urchin
#

nop that's NMS

wet breach
#

so ServerPlayer is Mojang then

ripe urchin
#

Using mojmapping yes

#

NMS/Level/ServerPlayer.class

sterile token
#

?entities

ripe urchin
#

but anyways still the command doesn't work for reasons

#

latest.log shows no error on loading either

tawdry finch
#

if i wanna check an item is a bed how can i do that? Bc bed now have all diffrent material types like Black_bed so how can i just have BED

sterile token
#

doesntwork?

tardy delta
#

what doesnt work3

sterile token
#

Where i can find all entities from mc 1.19?

tardy delta
#

watch EntityType enum?

sterile token
#

I cannot find a link which contains all mobs and animals

sterile token
tardy delta
#

google

sterile token
#

For example it doesnt contain the Skeeleton

#

πŸ˜‚

earnest forum
#

it does

sterile token
#

Where?

#

Hmn...

earnest forum
#

ctrl f

tawdry finch
#

ty

sterile token
tender shard
tender shard
#

you shouldnt use that

#

because it soon will no longer be an enum

echo basalt
#

True

tender shard
#

I think it was announced in 1.18 that one shouldnt use enumsets anymore, which is sad D:

sterile token
#

Just the mc id

echo basalt
#

I wonder how the protocol will adapt to that

sterile token
#

Should them uppear case?

echo basalt
#

namespaced keys are lowercase

sterile token
#

Hmn

echo basalt
#

but then again you're just wrapping NMS's EntityType

sterile token
#

Never heard about them btw

tender shard
#

fuck you intelliJ

echo basalt
tardy delta
#

damn bro

#

its a builder

echo basalt
tardy delta
tender shard
#

yeah it's only when ctrl+b'ing into the material class

tardy delta
#

finally i can run ij and minecraft together

echo basalt
tender shard
#

i never use middleclick because I had a mouse for 2 years where middle click was broken. so now I am used to not use it

visual tide
#

πŸ‘

echo basalt
tender shard
#

yeah my new mouse has 12 buttons on the side lol

echo basalt
#

decompiling the material class still doesn't that much from the cpu honestly

tender shard
#

my intellij always crashes

echo basalt
#

lol

#

Hardware benchmark: type new Player() and alt+enter like twice

tender shard
#

1 sec

sterile token
#

So how would i need to setup my enum to doing this:

for (String name : Entities.values()) {
  if (!event.getEntity().getType().name().equals(name)) return;
  event.setCancelled(true);
}
tender shard
#

first i gotta restart IJ

tardy delta
#

my intellij usually crashes when decompiling some spigot enum

ripe urchin
sterile token
tender shard
#

oh, IJ survived the material class this time

visual tide
echo basalt
sterile token
#

🀑

echo basalt
#

my man you probably have like 35 projects open

#

I only have 2 projects open

sterile token
#

2 projects?

ripe urchin
sterile token
#

How works that its weird

#

Intellij allow me to open only 1 project at the time

ripe urchin
tardy delta
tardy delta
#

i hate this, when buying a new pc they always switch the ctrl and fn key

echo basalt
#

desktop pc with external keyboard

tender shard
tardy delta
#

meh

#

i now have a numeric keyboard too

#

like i ever use that lmao

sterile token
#

hat the heck is a SQUID on mc?

#

πŸ˜‚

tardy delta
#

lmfao

glass mauve
echo basalt
sterile token
#

copilot auto complete this

sharp verge
#

Any way to make this more in a more efficient and simplified way?

echo basalt
#

there's a single key at the corner that locks the pc

ripe urchin
echo basalt
#

I got the logitech mx keys

sterile token
tender shard
echo basalt
#

just look at the layout

tender shard
#

oh wait

#

it's in my profile pic now too

ripe urchin
#

bold of you to assume i look at pfps

sharp verge
ripe urchin
#

anyways aahhhh why won't this command work or show me any useful error message

echo basalt
#

I hate that lol

ripe urchin
#

damn you NMS

sharp verge
tardy delta
#

bruh havent you simplified it yet?

sharp verge
#

i went to bed

#

And no, since im not sure how to :)

tardy delta
#

real programmers dont sleep

sharp verge
#

True statement

#

Guess im fake then ;)

tardy delta
#

dont use Enum#values()[index]

#

but EnuM.SOME_CONSTANt

#

smh this keyboard sucks

#

another month to get used to it

echo basalt
#
public void promoteTeamMember(UUID member) {
  Team playerTeam = teamRegistry.getTeam(member);

  if(playerTeam != this) {
    // Player is not in current team
    return;
  }

  TeamRole role = getTeamRole(member);

  if(role == LEADER) {
    // Player is already leader, can't promote
    return;
  }

  if(role == CO_LEADER) {
    // There is already a leader, can't promote
    return;
  }

  // Fall through
  memberList.put(member, TeamRole.CO_LEADER);
}
#

not much better but overall cleaner

sterile token
#

How would i cancel entities damage inside a claim/region/cuboid?

#

Without disabling damage in general

ripe urchin
tender shard
tardy delta
#

if (role == LEADER || role == SUS) hup another optimisation 🀀

tender shard
echo basalt
#

yeah

ashen quest
#

yo guys apparently maven thinks i m no longer cool so it exlcludes my resources folder from the jar

echo basalt
#

different error messages, fourteen

sterile token
tardy delta
#

mye hehe

tender shard
gaunt relic
tender shard
sharp verge
sterile token
#

😬

gaunt relic
#

then why are you askjng

real valve
#

how can i edit slime block jump power?

ashen quest
ashen quest
#

alex comin in for the save once again

ripe urchin
sterile token
#

because i cannot find a way of casting to Player object without getting the cast exception

#

πŸ˜‚

ashen quest
sterile token
ripe urchin
# tender shard .

i'm so used to IDEA just writing it for me it's difficult to remember manually lol

echo basalt
sterile token
sterile token
tender shard
tender shard
sterile token
sharp verge
tender shard
sterile token
tender shard
sterile token
#

Because i have a method like:

ClaimManager#getClaimAt(uuid)

ripe urchin
sterile token
tender shard
#

whut

waxen vapor
#

How do i add color to a message when i do player.sendMessage

tender shard
#

if at all, the claim should extend cuboid

sterile token
#

No no you dont understand or im bad wit henglish

tardy delta
sterile token
#

I explain again

tardy delta
tender shard
#

a claim is like a cuboid with an owner, etc etc

#

so cuboid should be the super class of a claim

tardy delta
#

or ChatColor.translateAlternatreColors('&', "&aHello")

tender shard
#

or "Β§cI'm into naughy stuff"

tardy delta
#

myes

sterile token
#
public class Cuboid {

    private String world;
    private double x1, y1, z1;
    private double x2, y2, z2;

    public Cuboid() { }

    public Cuboid(CLocation first, CLocation second) {
        this.world = first.getWorld();
        this.x1 = Math.min(first.getX(), second.getX());
        this.y1 = Math.min(first.getY(), second.getY());
        this.z1 = Math.min(first.getY(), second.getZ());
        this.x2 = Math.max(first.getX(), second.getX());
        this.y2 = Math.max(first.getY(), second.getY());
        this.z2 = Math.max(first.getZ(), second.getZ());
    }

    public boolean contains(Location location) { return this.contains(location.getWorld(), location.getBlockX(), location.getBlockY(), location.getBlockZ()); }

    public boolean contains (World world, int x, int y, int z) { return world.getName().equals(this.world) && x >= this.x1 && x <= this.x2 && y >= this.y1 && y <= this.y2 && z >= this.z1 && z <= this.z2; }
}```
#

Everything works hahaha

#

Just dumb with the damage event

tender shard
#

I'd just extend BoundingBox and add a world field

#

then call it WorldBoundingBox

#

or similar

sterile token
#

πŸ˜‚

sterile token
tender shard
tardy delta
#

1.13 smh

sterile token
#

So dont orry about my cuboid the class

tender shard
#

you are on even older versions you mean?

lavish robin
#

Is there any way I can make villagers act like vannila when it comes to curing?

sterile token
#

The thing is that works perfect

echo basalt
#

I hate that long contains method

sterile token
ashen quest
# tender shard do yo uhave sth like this in your pom?
<resource>
    <directory>src/main/java/resources</directory>
    <filtering>true</filtering>
</resource>

Do have that but still the plugin.yml doesnt exist in the jar

Also this might help, I dont think intelliJ detected that resources folder cause if it had, it would show a diff icon

tender shard
tender shard
#

does that change anything?

#

eeerm

#

I mean not sources root

#

but resources ofc

echo basalt
sterile token
ashen quest
sterile token
ashen quest
#

can agree

tender shard
echo basalt
ashen quest
#

I have learnt a lot of english from just workin on the code

echo basalt
#

I'm portuguese

#

it's literally not

tender shard
#

it should look like this

waxen vapor
#

How do i check if the block i place have a specific name? Like that its not just for example: dirt, but it have to be "dirt123" and if its that, then it execute the code

ashen quest
#

eyyyy alex you legend it worked

sterile token
echo basalt
#

pretty sure that's brazil

tender shard
peak depot
#

how can I set item in anvil?

sterile token
#

So dont care about the version and im annoyed because i need to protect damage in diff ways, first player pvp, secondly killing mobs, animals. So i have 3 diff flags, Combat, Animals, Mobs

tardy delta
#

lets compare items on pdc instead

tender shard
tardy delta
#

mye

tender shard
#

but

#

yeah that's probably a very rare occurance lol

#

using pdc > checking item name

sharp verge
#

?paste

undone axleBOT
tender shard
#

admins love this

waxen vapor
#

But does this work with color too? or does that not matter?

#

Does it matter if then name of the block is in green but its still dirt123?

tender shard
#

you should use the ItemMeta's PersistentDataContainer instead

#

it's like NBT tags

#

but using spigot API

waxen vapor
#

I started learning this today lmao

#

i think i know what you mean

echo basalt
#

I got a contracted job at a minigame network

#

we had a beta test round with 3 minigames made by another dev

tender shard
#

well otherwise, you'd have to do something like this

if(customName.equals(ChatColor.translateAlternateColorCodes('&',"&adirt123"))
echo basalt
#

it legit felt like there was a 1 in 100 chance of enderpearls actually throwing

waxen vapor
#

someone else said that too. Like a custom data tag for the block, so when i place a dirt, it checks if it have the data tag, and if so it will execute the code

echo basalt
#

and like a 1 in 5 chance of any of the features working

eternal night
#

thats how you keep the experience fresh xD

#

gotta have those little surprises

echo basalt
#

we meme

tender shard
#

the worst things are when you compile your plugin 10 times and it always fails to use an inputstream to read a resource with some weird ZipException. you check the .jar and the resource is there and perfectly readable. but when compiling the 11th time, it now works

waxen vapor
# tender shard you should use the ItemMeta's PersistentDataContainer instead

Okay so how would i do this lmao? You dont have to spoonfeed me with code, i need to learn it myself too. Bassicly right now, when i place a sea lantern it does the code i want it too, but i dont want it to be a normal sea lantern, have to be a custom one. So as you say, i need it to be a unique custom block kinda?

tender shard
#

?pdc

echo basalt
#

half of my compiles just say "Failed to clean up stale outputs"

eternal night
#

also a bunch of videos on youtube

tender shard
#

videos :X

eternal night
#

if you are more the visual learner

#

yo, learning from videos isn't too bad xD

waxen vapor
tender shard
#

well but you always have to watch 30 minutes to learn stuff that a 3 minute text could have explained

#

at least that's my experience with tutorial videos

eternal night
#

Well, text usually leads to people just copy pasting

#

and not understanding shit

#

at least in my experience

ripe urchin
#

Anyone by chance known with NMS for 1.19.1 who would know why this causes a command to fail with "unknown error"?

ServerPlayer npc = new ServerPlayer(server, level, gameProfile, null);
``` All values are not null (except the literal null). I verify this
eternal night
#

when you have to manually type it out that at least gets stuck in your head a bit better

tender shard
#

the last value obviously is null

#

what's the actual stacktrace?

ripe urchin
#

no stacktrace

tender shard
#

wrap it into a try / catch(Throwable t), then do t.printStackTrace()

ripe urchin
#

it just stops the command with "an unexpected error"

#

oh that might be an idea

tender shard
#

yeah on 1.19.1, commands do not print proper stacktraces

#

I also had this problem, so yeah try/catch it yourself

#

then you get a proper error message

tender shard
#

the console just doesn't print ANYTHING

ripe urchin
#

huh weird

tender shard
#

yeah I have no idea why this is the case

#

I've tried it yesterday on latest spigot, and latest paper o0

slate delta
#

any ideas?

ripe urchin
#

there we go now got a trace

[19:57:52] [Server thread/WARN]: java.nio.file.InvalidPathException: Illegal char <<> at index 137: .\world\stats\literal{sebkuip}[style={clickEvent=ClickEvent{action=SUGGEST_COMMAND, value='\tell sebkuip '},hoverEvent=HoverEvent{action=<action show_entity>, value='net.minecraft.network.chat.ChatHoverable$b@44062209'},insertion=sebkuip}]'s corpse.json
[19:57:52] [Server thread/WARN]:at java.base/sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:182)
[19:57:52] [Server thread/WARN]:at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:153)
[19:57:52] [Server thread/WARN]:at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
[19:57:52] [Server thread/WARN]:at java.base/sun.nio.fs.WindowsPath.parse(WindowsPath.java:92)
[19:57:52] [Server thread/WARN]:at java.base/sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:232)
[19:57:52] [Server thread/WARN]:at java.base/java.io.File.toPath(File.java:2387)
[19:57:52] [Server thread/WARN]:at net.minecraft.server.players.PlayerList.getPlayerStats(PlayerList.java:1238)
[19:57:52] [Server thread/WARN]:at net.minecraft.server.players.PlayerList.getPlayerStats(PlayerList.java:1224)
[19:57:52] [Server thread/WARN]:at net.minecraft.server.level.EntityPlayer.<init>(EntityPlayer.java:307)
[19:57:52] [Server thread/WARN]:at me.sebkuip.corpses.CreateCommand.onCommand(CreateCommand.java:41)
[19:57:52] [Server thread/WARN]:at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45)
[19:57:52] [Server thread/WARN]:at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:149)
[19:57:52] [Server thread/WARN]:at org.bukkit.craftbukkit.v1_19_R1.CraftServer.dispatchCommand(CraftServer.java:831)
[19:57:52] [Server thread/WARN]:at org.bukkit.craftbukkit.v1_19_R1.command.BukkitCommandWrapper.run(BukkitCommandWrapper.java:44)
[19:57:52] [Server thread/WARN]:at com.mojang.brigadier.CommandDispatcher.execute(CommandDispatcher.java:264)
...
echo basalt
#

BlockFormEvent

slate delta
#

yes but how can replace the block?

tender shard
#

Cancel the event, then set the block yourself I guess

peak depot
#

how can I set an item in anvil

echo basalt
#

AnvilInventory#setFirstItem

#

AnvilInventory#setSecondItem

#

AnvilInventory#setResult

eternal night
#

that seems pretty fucked

ripe urchin
#

and the gameProfile is defined as GameProfile gameProfile = new GameProfile(UUID.randomUUID(), sp.getDisplayName() + "'s corpse");

tender shard
#

Whats the players name?

slate delta
#

how set block ?

tender shard
#

You cannot have special chatacters in the name IIRC

echo basalt
tender shard
eternal night
#

use getName

#

not getDisplayName

slate delta
#

that ?

echo basalt
#

it's trying to fetch some files from your computer with color codes and all

ripe urchin
eternal night
#

spaces will also completely smack that

peak depot
echo basalt
#

is this dude trying to make a skyblock plugin without any prior experience

echo basalt
ripe urchin
tender shard
#

Just try asd as name

#

Just for testing

peak depot
echo basalt
#

πŸ₯£

tender shard
#

A fancy word for β€žforkβ€œ is β€žeating hookβ€œ

ripe urchin
#

NMS i will find you, and i will kill you

slate delta
ripe urchin
#

now it works just fine

ashen quest
#

brah i hate the fact that java 8 NPEs exist and that people use 1.8.9 for their servers

ripe urchin
#

oh wow i found out why. In NMS the ServerPlayer class has getDisplayName as a Component and not just a string....

slate delta
#

Why not work?

#

when break the cobblestone, no change, the bedrock don't place

ashen quest
#

Have you registered your event

slate delta
#

yes

delicate lynx
#

output something to make sure it's running the event

slate delta
#

okay

torn badge
ashen quest
#

?paste

undone axleBOT
slate delta
ashen quest
torn badge
peak depot
#

?paste

undone axleBOT
ashen quest
#

well well no

#

lemme install it

torn badge
#

Always put your dependencies in your plugin.yml

#

depend: [PlaceholderAPI]

tender shard
#

and upgrade your server, you're like 7 years behind

#

bug reports via youtube, I love it

peak depot
gleaming grove
#

Is there any better way to save a List<?> to yml file using FileConfiguration, I need to make itemStack property ignored

tender shard
tender shard
gleaming grove
#

i just make fileConfiguration.set("customSkins" ,new ArrayList<PianoSkin>())

torn badge
#

Make it implement ConfigurationSerializable

#

And then define how you wanna save it

gleaming grove
#

ok

#

and is there any way to replace ==: jw.piano.data.PianoSkin with custom name?

ashen quest
gleaming grove
#

fuck

torn badge
#

Only if you save it all manually

torn badge
ashen quest
#

yes i m sure af

torn badge
slate delta
#

That not work

torn badge
#

Then try cancelling it and then setting it to your block 1 tick later

slate delta
#

yes i missed setCancelled after setType

torn badge
ashen quest
#

oh ok

ashen quest
slender widget
#

How do I get the default world?

peak depot
ripe urchin
#

line 63 (which it shows in the error) is Gson properties = skindata.fromJson("properties", Gson.class);

#

oh i think i see why. You can't have Gson as the new type when doing fromJson

quaint mantle
#

Im new in Spigot so idk whats wrong tbh

worldly ice
#

you spelled yosoykute wrong in your spigot.yml

compact haven
#

why is Gson your type lol?

#

it's definitely not a Gson object that you're reading

worldly ice
#

because looking at your class structure, your main class is in com.yosoykute.kadete.KADETE

compact haven
#

you're reading a regular JsonObject

worldly ice
#

not com.yosoyute.kadete.KADETE

compact haven
#

@ripe urchin read up on how to use Gson, because you're doing it all wrong

fickle pine
#

yo, anyone know what I could use to show text on screen?

ripe urchin
fickle pine
#

globally*

ocean lion
#

Title

compact haven
#

you're attempting to read a Gson object and get it from fromJson

#

you will never have a Gson object serialized

#

that makes no sense

fickle pine
compact haven
#

you need to read a JsonObject, not Gson

ripe urchin
compact haven
#

Gson is the utility class for the library, JsonObject is the actual json

#

no

#

that's not what Gson (object) is

ripe urchin
#

wait so gson can't deserialize nested json as a new gson object?

ocean lion
ripe urchin
compact haven
#

it can

fickle pine
#

πŸ’€

compact haven
#

butr you're doing it wrong

fickle pine
#

knew I was confused about something lol

#

thank you

quaint mantle
ocean lion
fickle pine
#

why exactly?

ocean lion
compact haven
#
public static JsonObject readJsonFromUrl(String url) throws IOException {
    try (InputStream is = new URL(url).openStream()) {
        BufferedReader rd = new BufferedReader(new InputStreamReader(is, Charset.forName("UTF-8")));
        String jsonText = readAll(rd);
        return JsonParser.parseString(jsonText).getAsJsonObject();
    }
}

private String[] getSkin(UUID uuid) {
    String[] skin = skinCache.get(uuid);
    if (skin != null) {
        return skin;
    }

    try {
        JsonObject skindata = readJsonFromUrl("https://sessionserver.mojang.com/session/minecraft/profile/" + uuid.toString() + "?unsigned=false");
        JsonObject properties = skindata.getAsJsonObject("properties");
        String signature = properties.get("signature").getAsString();
        String texture = properties.get("value").getAsString();

        skin = new String[] {signature, texture};
        skinCache.put(uuid, skin);
        return skin;
    } catch (Throwable t) {
        t.printStackTrace();
        return new String[] {"", ""};
    }
}
#

compare that to what you were doing, try and figure out why it was wrong

compact haven
#

you don't use the Gson object to deserialize Json strings, not necessary

#

Gson object is meant for serialization & utility

#

Gson is not a JsonObject, two different classes with 2 different purposes

worldly ice
fickle pine
compact haven
#

Gson is a library, but also a class, and in the library we have a JsonElement which represents json objects, arrays, and primitives (string, int, etc). JsonObject is a json object ( { ... })

ocean lion
fickle pine
#

icic

#

thank you ❀️

ripe urchin
compact haven
#

btw if that code doesn't work it's because you have given me the wrong json schema represented in your old code

ocean lion
compact haven
#

then .getAsJsonObject() lol

#

I'm not an IDE

worldly ice
quaint mantle
worldly ice
#

it's in your pom.xml

compact haven
#

there I've updated the code

quaint mantle
compact haven
#

along with the correct schema because your old code was getting another property "skindata" which does not exist

worldly ice
river oracle
#

They probably aren't using anything

#

just good ol intellij

quaint mantle
river oracle
#

Please use maven or gradlew

worldly ice
#

^

quaint mantle
#

How

river oracle
#

Maven is better for spigot development

#

if you wannt develop with Paper iirc Gradlew is easier

ripe urchin
compact haven
#

I know, I ran it on my own uuid afterwards

#

I've edited my codeblock which'll work now unless i've forgotten a semicolon somewhere

echo basalt
#

the value is an encoded base64 string btw

compact haven
#

^

ripe urchin
#

i just called it "skindata" since it's data for the skin

quaint mantle
echo basalt
#

you decode it and it gives a json value

ripe urchin
compact haven
ripe urchin
#

but the server uses the base64 encoded string to display the skin for what i know

ripe urchin
echo basalt
worldly ice
#

unless there's an easy way to convert a project to maven that i don't know about

ripe urchin
#

i'll improve the skin cache too but right now just want skins working

compact haven
#

oh nevermind that's my fault

echo basalt
#

you can put unsigned skins

compact haven
#

you were reading "properties" (which is correct)

quaint mantle
echo basalt
#

feels like

quaint mantle
#

Like this?

echo basalt
worldly ice
#

if not i would install that

ripe urchin
#

ah there's one thing i didn't see in the data

quaint mantle
worldly ice
#

because it can create a brand new spigot plugin that already has everything in the pom

quaint mantle
#

Im new into java development, i came from other languages

ripe urchin
#

properties isn't just another object with name, value and signature

#

properties is an array with inside objects

worldly ice
#

you can also install straight from intellij

echo basalt
#

idk why

#

it's weird

quaint mantle
echo basalt
#

thing is

#

mojang uses sha1 with rsa

#

for encrypting skin data

worldly ice
echo basalt
#

and it's no longer considered a secure algorithm

worldly ice
#

new project -> minecraft plugin

#

and choose spigot

echo basalt
#

I wonder if we can crack the skin keys somehow

ripe urchin
compact haven
#

then do JsonObject properties = skindata.get("properties").getAsJsonArray().get(0).getAsJsonObject() (unsafe because we assume the array will always have just 1 element, but it's a pretty safe assumption)

#

yes

#

perfect

quaint mantle
worldly ice
#

group id would be what you put in before

ripe urchin
worldly ice
#

so com.yosoykute.kadete

quaint mantle
#

com.yosoukute.kadete?

#

K

ripe urchin
#

and artifactID is the name of whatever you're making

worldly ice
#

yep

ripe urchin
#

generally the name of the plugin

quaint mantle
#

And version?

#

Just put 1.16.5?

compact haven
#

no

worldly ice
#

keep it at 1.0-SNAPSHOT

ripe urchin
#

oh gosh the skin doesn't have the second skinlayer rip

quaint mantle
ripe urchin
compact haven
#

wdym

echo basalt
#

it's a bitmask

#

id field depends on the server version

#

but it's somewhere between 14-17 depending on the server version

eternal oxide
#

this.getEntityData().set(Player.DATA_PLAYER_MODE_CUSTOMISATION, (byte) 0xFF);

ripe urchin
#

1.19.1 in my case

echo basalt
compact haven
#

ah lovely

compact haven
ripe urchin
#

i do want all the extra layer ones, but that enum does not seem valid

compact haven
#

at least the bitmask is correct, dk about the API part

ripe urchin
eternal oxide
#

thats nms ServerPlayer

ripe urchin
#

yep i'm using NMS ServerPlayer

#

or wait nvm IDEA is just doing weird stuff again

compact haven
#

yeah it's not an enum, it's just a static field which is there in your screenshot xd

ripe urchin
#

wait elgar what's the Player class in yours?

#

because i can't find it

eternal oxide
#

import net.minecraft.world.entity.player.Player;

ripe urchin
#

don't mind the misspelling

ripe urchin
eternal oxide
#

I seem to be talking to two different peopel about the same thing

ripe urchin
#

wrong access apparently

eternal oxide
#

you have the wrong player import probably

compact haven
#

he's directly referencing the one you told him to lol

ripe urchin
#

npc.getEntityData().set(net.minecraft.world.entity.player.Player.DATA_PLAYER_MODE_CUSTOMISATION);

compact haven
#

he's using the fully qualified name and it's protected

eternal oxide
#

then do it In teh class that extends ServerPlayer

quaint mantle
ripe urchin
#

pom.xml for maven, resources for your plugin.yml (and anything else you might add later), and your main class

quaint mantle
#

Ye but, i need to modify anythign there?

ripe urchin
ripe urchin
eternal oxide
#

do you have a class extending ServerPlayer?

ripe urchin
#

if you wish to add more dependencies, do so in pom.xml, if you wish to add commands, add them in your plugin.yml, if you wish to go coding go to your main class

eternal oxide
#

then make one

#

thats part of mine

quaint mantle
#

Where to put events folder?

#

In kadete folder right?

delicate lynx
#

all caps :/

worldly ice
#

if you want to put events in it, yes

sterile token
quaint mantle
#

Why everything red

sterile token
ripe urchin
worldly ice
sterile token
#

I think you are new

#

πŸ˜‚

worldly ice
#

that name hurts my brain

#

KADETE

quaint mantle
worldly ice
#

vents

sterile token
quaint mantle
sterile token
#

I think he is new

quaint mantle
worldly ice
#

or KADET

#

Events

sterile token
#

That my question

#

You MUST follow class name conversions

quaint mantle
#

Tbh idk neither

boreal seal
#

I just started making utils for first time

#

Basically methods

#

Instant of writing the same thing for many times as I used to do

sterile token
boreal seal
#

I was thinking make an util for custom files it’s fine to do?

quaint mantle
#

Camel Case

worldly ice
#

it's like you're shouting the class name

#

IT'S

sterile token
worldly ice
#

MY

#

CLASS

#

NOT YOURS

sterile token
#

UpperCase = Camel case same thing