#help-development

1 messages Β· Page 2223 of 1

wet breach
#

you can however look at jar files to inspect for classes though as long as you know the jar file name

#

since all plugins are loaded from the same place

#

I think your only problematic ones which are rare to see, are ones that are not actually plugins

#

and are strictly API's

fathom cobalt
#

yeah, and jar file name should be easy enough to find I guess

wet breach
#

if you have a plugin that extends PluginBase I think it is, spigot will not attempt to load any classes from it πŸ˜‰

fathom cobalt
#

yeah, I have my own PluginBase class that extends JavaPlugin

wet breach
#

but those are really rare to see since most people who make API plugins really don't make use of that as they should lol

#

mainly because they don't know they can do that lol

fathom cobalt
#

I'm working on my own plugin library in Kotlin, and I try to solve as much of the repetitive stuff within the library πŸ˜›

wet breach
#

anyways, hopefully you find a work around for your problem. At least you came out with a greater understanding then you did before instead of just still not knowing what it is going on πŸ˜‰

fathom cobalt
#

yeah, that is true! thanks for confirming that for me πŸ™‚

restive mango
#

Alternatively, if anyone knows how to make a projectile pass through solid blocks, let me know.

zenith gate
#

What's a way to separate items from one another? I would assume their name but it's not working. I have a Listener that waits for the arrow to hit something then it would TP me to the arrow location. That's the Teleport Bow.

But,
I have another bow called the Lightning Bow, As you'd assume it summons Lighting onto the arrow striking it. But that bow blinds me and slows like the Teleport one does.
They all have different names, which is how I was setting up the listeners. could the be conflicting with eachother?

restive mango
#

@zenith gate post listener code here plz

zenith gate
#

wait wrong

#
if (e.getEntity().getShooter() instanceof Player p) {

            ItemStack itemInMainHand = p.getInventory().getItemInMainHand();

            if (itemInMainHand.getItemMeta().getDisplayName().equalsIgnoreCase(ChatColor.GOLD + "Lightning Bow")) {

                Location location = e.getEntity().getLocation();

                p.getWorld().strikeLightning(location);
                p.playSound(p, Sound.ENTITY_LIGHTNING_BOLT_THUNDER, 1.0f, 1.0f);



            }

        }
zenith gate
restive mango
#

ugh dont remind me

#

i need to change all my metadata to PDCs

#

Someone let me know if you figure out how to give a vex's properties to a snowball. I just want to make it so some projectiles pass through solids Dx

winged anvil
#

how do people create lists in configs that are prefixed with a -

proper notch
winged anvil
#

like Messages: - - -

#

yea

kind hatch
#

String list

#

ConfigurationSection#getStringList()

winged anvil
#

wurdd

wild marten
kind hatch
#

Or… just set the snowball as a passenger.

wild marten
#

can you have snowballs as passengers?

kind hatch
#

But that may not even work.

#

I mean, you can put players on arrows. I don’t see why it wouldn’t be possible for other entities/projectiles to also be the passenger.

wild marten
#

look the docs just say a passenger is an entity so I think it might be possible

restive mango
#

The issue is, if it's a passenger, then it is just wholely noncollidable.

#

I'd be interested in having it collide ONLY with entities, and not blocks.

ornate patio
#

for some reason my java decompiler can’t decompile the getTarget function in the Zombie class

#

which other decompilers can I try? I need to figure out how to tell if the entity can reach a particular location or not

waxen plinth
#

because Zombie is an interface and CraftZombie is the implementation

#

but even so you still might not find setTarget in the CraftZombie class because it could be a default method

#

you often won't see a method that a class offers defined explicitly in the class due to inheritance

wild marten
# restive mango Someone let me know if you figure out how to give a vex's properties to a snowba...

I have figured out the part of being able to shoot the snowball and it pass through walls, however it uses vex's physics and gravity so it is more like a straight shooting spectral shot. It doesn't include the collision detection but it should be to hard to add a check to see if the snowball has another entity in a small radius then hitting that entity and removing the vex and snowball @EventHandler public void onShoot(ProjectileLaunchEvent e){ Projectile pro = e.getEntity(); if(pro.getShooter() instanceof Player && e.getEntity().getType() == EntityType.SNOWBALL){ Vex vex = (Vex) pro.getWorld().spawnEntity(pro.getLocation(), EntityType.VEX); vex.setAware(false); vex.addPassenger(pro); vex.setVelocity(pro.getVelocity()); vex.setInvisible(true); vex.getEquipment().clear(); } }

#

or you could kill the vex which would cause the snowball to behave normally and hit the entity

sharp flare
#

You can try #getNearbyEntities while the projectile is in mid air

#

By doing a repeating task

#

To check for entity collision

wild marten
#

yea i was just seeing if the spectral snowball was possible

#

everything else shouldnt be too hard to figure out

sharp flare
#

Once it hits an entity u can cancel the task

ornate patio
sharp flare
ornate patio
#

I'm trying to look at the getTarget method in NearestAttackableTargetGoal

#

this is the method I need but my decompiler can't figure it out πŸ˜”

#

I really need to figure out how to tell if a position is reachable

wild marten
sharp flare
#

Yeah I thought it was like spectral arrow

ornate patio
#

howw

#

in every case the mob knows where to go

#

even though the villager on the right is closer to the zombie, the zombie goes to the villager to the left because it can actually reach that one

#

i'm trying to implement the same thing but I have no idea how

tawny jay
#

Can someone help make a free plugin

desert loom
#
        final ItemStack result = new ItemStack(Material.DIRT);
        final ItemStack ingredient = new ItemStack(Material.DIAMOND);

        final StonecuttingRecipe recipe = new StonecuttingRecipe(new NamespacedKey(this, "testing"), result, new RecipeChoice.ExactChoice(ingredient));

        Bukkit.addRecipe(recipe);

Anyone have an idea why this recipe doesn't work in-game?

#

running that in my onEnable for testing purposes and the recipe doesn't work in-game in a stonecutter.

humble tulip
#

is there any humming sound?

#

like a dial tone

#

in mc ofc

tawny jay
#

Can someone help make a free plugin

ornate patio
eternal oxide
ornate patio
#

well if its 7am there im gonna be sleeping when they're awake rip

#

10:30pm here

#

you think its fine if i ping them rn so they can respond later

eternal oxide
#

7smile7 is usually around in another 5 hours

ornate patio
#

yeah ill be sleeping in 5 hours

eternal oxide
#

They are not online at the moment so a ping would be fine

ornate patio
#

alright

ornate patio
# ornate patio

@lost matrix I have heard you have the knowledge to answer this sorry for the ping

#

I've created a custom path finder goal to make horses drink water from the nearest water source

#

problem is the horse cant tell if it can actually reach the water source

#

so it ends up hugging the wall with the water on the other side until it dies of thirst, even though there's an available water source 10 blocks in the other direction

brave sparrow
#

level.getNearestEntity

#

That goal is for finding an entity to attack, not pathing

ornate patio
#

oh wait

crisp steeple
undone axleBOT
brave sparrow
#

yes but the method you were trying to decompile isn't for that

ornate patio
#

nvm i didnt see what u were replying to my bad

#

it looks like the entity is smart when pathfinding to other entities

#

but not to blockpos's

restive mango
#

@wild marten what i can do

#

is use a bukkitrunnable which repeatedly gets previous locations of the balls and does a raytrace

#

for collision detectio

#

detection

sage merlin
#

how to get any player that has not logged on to your server before?

eternal oxide
#

query Mojang

ashen quest
#

only if u let me open source it and let me host it on spigot

earnest forum
#

not sure

quaint mantle
#

Bukkit

#

hasPlayedBefore

earnest forum
#

that

quaint mantle
#

nvm

#

Bukkit.getOfflinePlayer(...).hasPlayedBefore()

earnest forum
#

yeah

quaint mantle
#

how do i remove this warning?
Not annotated parameter overrides @NotNull parameter

#

Its giving on onCommand interface

#

add org.jetbrains:annotations:23.0.0 to your pom or gradle build file

#

then let quick fix do the work

#

okay

quaint mantle
#

dependency

#

kk

wet breach
#

and then with said mesh, iterate their intended path and look to see if their path is blocked by 2 blocks above

#

if it is, tell the horse to go to the other water source instead

ornate patio
#

sry im really tired i think ima sleep rn and get back to this tomorrow

wet breach
#

there is different kinds

#

mesh is another way of saying matrix, but matrix isn't really an accurate term to use since a mesh is generally malleable

#

you can use BFS or DFS for this problem of yours

#

BFS is breadth first search and DFS is Depth first search

#

then you have Dijkstra and then A* which basically builds on Dijkstra. Then you also have random walk or also known as walktrap

#

each one is good at doing something πŸ˜‰

#

navmesh is another good one

#

D* can be used too but most freelancers are unaware of it

eternal oxide
#

?paste

undone axleBOT
wet breach
#

useful if your route can vary over time

eternal oxide
#

I never put it into use but it gives you an example

wet breach
#

this looks something similar to DFS

eternal oxide
#

it is, a tree search

wet breach
#

@ornate patio pinging you so you know where to come back to read πŸ™‚

eternal oxide
#

Just a note, run it async

ornate patio
formal bear
#

I want to make command to auto complete /command target2 /command target1 target2. I'm confused

    public List<String> onTabComplete(CommandSender sender, Command command, String label, String[] args) {

        if (!(sender instanceof Player)) {
            Bukkit.getLogger().info(notPlayer);
            return null;
        }

        if (args.length == 1) {

            List<String> playerNames = new ArrayList<>();

            for (Player player : Bukkit.getOnlinePlayers()) {
                playerNames.add(player.getName());
            }

            return playerNames;

        }

        else if (args.length == 2) {

            List<String> playerNames = new ArrayList<>();

            for (Player player : Bukkit.getOnlinePlayers()) {
                playerNames.add(player.getName());
            }

            return playerNames;
        }

        return null;
    }
if (args.length == 0) {
   player.sendMessage(IridiumColorAPI.process(prefix + notCorrect.replace("%command%", label)));
   return false;
}

Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0

humble tulip
#

first of all

#

it already does player names by default

#

so if ur gonna autoccomplete player names, just return null or something

eternal oxide
#

That error does not come from that code. You never access args

formal bear
humble tulip
#

well arg.length == 1 will only be true if there is /command <somethinghere>

#

if u have /command <something> <something> else, arg.length will be 2

#

and not 1

quaint mantle
#

Why is the Racing plugin not public ;w;
I really need it

formal bear
#

welp i just assigned target before the if nvm

humble tulip
#

are u trying to autocomplete player names?

#

if so just return null, because the server does that by defualt

earnest forum
#

unless you've disabled that

humble tulip
#

people disable that?

#

how do u even disable that?

earnest forum
#

server settings

#

i dont actually know exactly how ik its possible

humble tulip
#

i doubt servers actually turn that off

digital rain
#

Love you ;)

vocal cloud
#

What would yours do that others don't already?

clever brook
#

Bro

#

Having some err in bungee

humble tulip
#

nice to know

autumn olive
#

Hi there, I come with a question. Overall I'm doing a plugin and I'm having a little problem with it. I would like to change the color of the player's nickname only above his head and I don't know how to do it. If anyone could help by sending an API or showing the code how to do it, I would be very grateful

earnest forum
#

says ur a likely spammer

humble tulip
sand rune
#

Can any one give me java Learning resources

earnest forum
#

?learnjava

undone axleBOT
humble tulip
#

?learnjava

undone axleBOT
humble tulip
#

damnit

#

u beat me to it

vocal cloud
#

rekt

earnest forum
#

ez

vast raven
#

It gives me back error.

quaint mantle
#

how do I make a reload config command?

humble tulip
#

are u usng a bukkitrunnable?

#

or regular runnable

vast raven
#

BukkitRunnable.

humble tulip
#

just use super.getTaskId

#

or this.getTaskId

#

doesnt matter

#

but the method is getTaskId

earnest forum
#

you dont need to do super right

humble tulip
humble tulip
vast raven
humble tulip
#

i see getScheduler

#

that means ur not using a bukkitrunnable

quaint mantle
autumn olive
vast raven
humble tulip
vast raven
#

Sorry.

quaint mantle
#

uh okay

earnest forum
#

send certain scoreboard team packets to one player, and other packets to another player

humble tulip
quaint mantle
#

oh

humble tulip
#

which they should already

quaint mantle
#

no I dont

eternal oxide
#

Thats just Teams

humble tulip
#

well your'e fine

quaint mantle
#

by values u mean in YAML ?

vast raven
earnest forum
#

i personally would use packets for nametags and use the player scoreboard for sidebar

humble tulip
#

no i mean like in ur code do u have any variables/feilds that store config values

eternal oxide
#

Why does it keep saying this guy is a spammer?

quaint mantle
#

no

humble tulip
#

well you're fine

quaint mantle
#

then what should I do

earnest forum
#

my old account got hacked and someone used it for botting people

#

inviting them to servers

humble tulip
earnest forum
#

and it said that for me

humble tulip
formal bear
eternal oxide
#

ah

autumn olive
quaint mantle
humble tulip
#

when u schedule with the scheduler, it returns the task id as well

vast raven
humble tulip
humble tulip
humble tulip
undone axleBOT
quaint mantle
#

okay gimme a sec

vast raven
earnest forum
#

doesnt a bukkit runnable return a BukkitTask?

humble tulip
#

ye

earnest forum
#

should use that

humble tulip
#

but if he wants to work with taskids its whatever

#

same thing tbh

humble tulip
quaint mantle
humble tulip
#

can i see where u use your config then?

quaint mantle
#

like?

humble tulip
#

where you do getConfig.getStuff

earnest forum
#

reading/writing to config

quaint mantle
#

oh

#
@Override
    public void onEnable() {
        Metrics metrics = new Metrics(this, 15492);
        // Plugin startup logic
        Bukkit.getLogger().info("[MOD] MeltedOresDrop Enabled");
        saveDefaultConfig();
        new OreBreak(this);
        new BlockBreak(this);

    }```
humble tulip
#

no

#

where you do getConfig

vast raven
earnest forum
#

casting a runnable to runnabl

#

feel like thats an intellij hint thing

vast raven
quaint mantle
humble tulip
#

u do BukkitTask task = new BukkitRunnable.schedule();

quaint mantle
#

But I didnt do getConfig

humble tulip
#

then task.cancel

humble tulip
vast raven
quaint mantle
#

Ohhh

humble tulip
#

doesnt matter

quaint mantle
#

damn! I'm dumb Wait

earnest forum
quaint mantle
#
String tool = plugin.getConfig().getString("Breaking-tool");```
earnest forum
#

you can use the int to get the BukkitTask

quaint mantle
#

I use like this in my events class

humble tulip
#

can you please paste the entire class?

quaint mantle
#

yes sure wait

humble tulip
#

it should look more like this

quaint mantle
humble tulip
#

make an orebreak variable in your main class

#

something like this

quaint mantle
#

I see okay, I'm still learning so I was practicing by making this plugin

humble tulip
#

and make a getter

#

so in your command class, you do plugin.getOreBreak.loadValuesFromConfig

#

there is a better way of doing this tho

#

making a class that has all the config values in it, and let the other classes get the values from that class

quaint mantle
#

ah well I'm a beginner lol so I want to keep it as simple for now

humble tulip
#

for now u can do the first way

#

so in u command class after reloadconfig

#

you do plugin.getOreBreak.loadValuesFromConfig

#

the changes i made to orebreak, you'll have to make similar changes to other classes that read from the config

#

?tryandsee

undone axleBOT
humble tulip
#

yes why is your command MANAGER a command itself?

#

huh??

#

pretty sure u have to do bukkitCommand.register(commandMap)

#

if that doesnt fix it, you may have to put the command into the knownCommands map yourself

naive drift
#

Sorry if it is in a wrong channel but i want to help with maven.

I have a system where I active a "install" lifecycle and this will build and upload it trough FTP, now i want to create a own lifecycle or if profile is active. Is it possible ?

mortal hare
quaint mantle
#

yes I know that

tender shard
#

πŸ˜—

smoky oak
#

whats the arg to get jdocs from buildtools again?

eternal oxide
#

--generate-docs

smoky oak
#

thanks

tender shard
#

too late

#

fuck uuuu elgar

smoky oak
#

im asking that every single time

tender shard
#

well just do --help once πŸ˜„

eternal oxide
#

I wasn;t fast, you were like molasses

tender shard
#

but

#

I didnt know it myself

#

and had to check it first

#

and then I not only attached a fancy screenshot, no

eternal oxide
#

I had to open my build script to copy/paste πŸ™‚

tender shard
#

I also selected the argument in question

eternal oxide
#

it would be nice if it did actually make the jar the help says it will

smoky oak
#

correction, they should really add the --remapped flag to the spigotmc blog

#

im aware theres one arg thats not in the buildtools list there

#

but i always forget which one

tender shard
#

quite a few IIRC

west crag
#
public void onBlockBreak(BlockBreakEvent event, LivingEntity livingEntity, PotionEffect potionEffect)

ig here something wrong

#

but dunno what

smoky oak
#

event handlers only take the event they're calling as arg iirc

#

you cant pass them extra args

tender shard
smoky oak
#

since they have a set structure

tender shard
#

I mean, how would spigot even know what to pass as livingEntity or as potionEffect?

#

Youl cannot just add new parameters and expect spigot to know what to pass there lol

smoky oak
#

actually

#

you cant add any parameters at all

#

its @Override

tender shard
#

no

#

event listener methods are not derived from a super class

west crag
#

then what to do?

smoky oak
#

only have the event in args

#

and get the entities / effects otherwise

tender shard
smoky oak
#

I'd suggest grabbing the block PDC library and storing the entity in that

west crag
#

and what about livingEntity?

tender shard
#

neither I, nor spigot knows what living entity you expect there

smoky oak
#

^

tender shard
#

so what living entity is that supposed to be?

smoky oak
#

if you mean the entity that broke the block theres a method in event for that

smoky oak
#

persistent data container

tender shard
#

why do you need NMS for that?

west crag
#

like see

#

here i want to do this

tender shard
#

especially not a living one

eternal oxide
#

unless he's talking about silverfish

west crag
#

when player break a block then random mod will spawn(even blocks)

tender shard
smoky oak
#

can't you intercept right clicks and use vector math to see where on the sign you clicked

west crag
tender shard
#

this is getting confusing. you should take a look at a basic java tutorial @west crag

#

?learnjava

undone axleBOT
tender shard
# west crag ik java

you don't. you have added new parameters to your event listener just because, idk. The error message clearly explained that this won't work and you didn't understand that.

smoky oak
#

if there's one thing i learned about spigot is that the only thing it wont register are right/left clicking with an empty hand at nothing

#

ie air

#

you can definitively grab a right click on a sign

tender shard
#

and lastly, I still wonder where you expected this magic livingEntity and potionEffect object to come from

#

you cannot just add parameters to your method signature and expect that some black magic will pass exactly the objects you were looking for

grim ice
#

anyone has a coding idea?

smoky oak
#

oh not again

#

why do people always ask that

tender shard
#

a sign input GUI lib without NMS

steel swan
#

hey, i have that error when i start the server, anyone knows why?

smoky oak
#

mojang screwed up id say

tender shard
steel swan
tender shard
#

are all other servers you tried cracked?

steel swan
smoky oak
#

check if you block outwards request

tender shard
#

then idk

smoky oak
#

possible you're doing that with a firewall

#

idk which port mc uses for auth tho

steel swan
#

if anyone has an idea, tell me !

digital rain
smoky oak
acoustic pendant
#

why is this not working? it only reaches the second if

digital rain
#

Id use .equals :)

west crag
smoky oak
acoustic pendant
# smoky oak check if the key exists

@EventHandler
public void onShoot(EntityShootBowEvent e) {
if (itemConsumed.isSimilar(TestArrow.getInstance().arrows.diamond)) {
arrow.getPersistentDataContainer().set(TestArrow.getInstance().getKey(), PersistentDataType.STRING, "ARROW");
}
}
}

smoky oak
#

no idea then

#

wtf are you trying to accomplish

visual tide
#

making a circle in an inventory maybe?

wet breach
#

making circles with squares? that is always fun

smoky oak
#

theres a much simpler solution

wet breach
#

what is wrong with it, is that there is a maximum size an inventory can be, thus making your code inefficient since the dynamics are just not there really

smoky oak
#

just hard code the three/six possible circle numbers

wet breach
#

^

#

oh so you like inefficient methods for no reason

smoky oak
#

my thought exactly

#

doing anything but addition is an 'expensive' computation

#

so hard coding it might add what

#

1 kb

#

for doing it 90% faster

wet breach
#

well in this case, there is really no reason for dynamic code since its not like the inventory sizes are just going to be some arbitrary size lol

smoky oak
#

its literally a list of how far it's shifted, and limitations for where that list can start

#

for example

#

the starting slot of a size 6 circle in a double chest

#

must be a) modulo 9 between 0 and 3 (inclusive)

#

and b) lower than 3

#

first is so that the circle isnt split

#

second so that it is fully present

#

for 5 numbers would be 0,4 and lower than 13

wet breach
#

moterius is on a role here in proving why dynamic code isn't efficient in this case πŸ™‚

smoky oak
#

also i worked a lot with trigonometry back in school

quaint mantle
#

hi, is there a better way to do this?

#
 private Rank convertToRank(RankType rankType) {
        switch (rankType) {
            case OWNER:
                return ranks[0];
            case ADMIN:
                return ranks[1];
            case MODERATOR:
                return ranks[2];
            case HELPER:
                return ranks[3];
            case MVP:
                return ranks[4];
            case VIP:
                return ranks[5];
            default:
                return ranks[6];
        }
    }```
smoky oak
#

unless you have a rank->number in another place i dont think so

#

switch is the best option for 'multiple ifs on same condition'

quaint mantle
#

so there isn't a way?

wet breach
#

there is always another way

smoky oak
#

just not a better one

eternal oxide
#

well you could use the ordinal

smoky oak
#

you can pull a yanderedev ofc

wet breach
#

you could also use a linkedlist or even a normal list as long as you have a way to guarantee the ordering

smoky oak
smoky oak
#

return ranks[number(rank)] then

eternal oxide
#

gives the index of the enum

wet breach
#

yep

#

so that is 2 other ways that are probably just as efficient

#

but the switch method is just as good though

#

so really down to preference or what they are comfortable with

smoky oak
#

eh I'd use switch

#

easier to read

eternal oxide
#

return ranks[rankType.ordinal()];

quaint mantle
#

what ordinal() method do

smoky oak
#

look at what elgar linked

#

its the index of the enum

#

enum{ BLUE, RED}

#

blue = 0

#

red = 1

quaint mantle
#

oh nice

alpine urchin
quaint mantle
wet breach
#

the only downsides to ordinal and switch is you lose dynamicity

alpine urchin
#

yeah, OWNER has the index/ordinal 0

#

ADMIN has the ordinal/index 1

#

etc

#

thats why ranks[rankType.ordinal()]

#

would work

quaint mantle
#

Is this better than switch thing?

smoky oak
alpine urchin
#

yes

quaint mantle
#

I see, thank you for help

alpine urchin
#

id say its better than his switch

#

but

#

be careful if you change your enum

#

or your design

#

thats when it could have downsides

#

like frostalf is pointing out

wet breach
smoky oak
#

i think i know what you mean

wet breach
#

so, when pulling from a config, as long as you always read it the same way, the order is guaranteed to whatever the order in the config is

smoky oak
#

i dont think a config is always handled in the order its written though

#

arent lists read in from config random

wet breach
#

you wouldn't read it as a list

#

you would parse it as a string

smoky oak
#

ah

#

and then split at colon or smth

wet breach
#

yep

small current
#

how can i get a skull value

#

by a skin texture

eternal oxide
#

expand what you are asking

small current
#

a skull value

#

head value

#

skin value

#

the value and signature

smoky oak
#

you cant

#

a skull is a skin

small current
#

i remember i did

eternal oxide
#

um, you have a texture and want a skull with that texture?

smoky oak
#

not a player uuid

small current
#

i have a skin

small current
#

i have the file

#

there was an api for it iirc

eternal oxide
#

no clue what you mean by "value"

small current
#

value and signature

#

for a skin

#

you know what it is ?

smoky oak
#

skull has something innate, where the texture is saved

#

thats the reason skulls dont change if player skin does

#

he probably wants that

small current
#

dude

#

wait

#

texture value

#

of a skull

smoky oak
#

yea that. I dont have my ide open right now so i cant be more specific

small current
#

nvm i will set it to a premium user

eternal oxide
#

We have no idea what "texture value of a skull" means

small current
#

of a skin

visual tide
#

its the url of the texture and some json encoded in base64

eternal oxide
#

you have a skull and you want to pull the texture?

wet breach
#

are you trying to set the skull texture?

eternal oxide
#

?paste

undone axleBOT
eternal oxide
smoky oak
#

that a 1.19+ thing?

eternal oxide
#

yes

smoky oak
#

i know its possible in 1.16 tho

wet breach
#

that works for items, does it persist if you place it as well?

eternal oxide
#

and a texture eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYTlmMTFjMGQ0OTdmMjI3MDg5Y2JmNjE0NjAxMTA5Y2FmNjE1NDUzOTQwZWY1ZjY0ZWJiMTc3OTU3ZTRmYTZlNSJ9fX0=

eternal oxide
#

yes its placed as well

wet breach
#

cool

#

I have code for both, guess I don't need the other anymore πŸ˜›

#

well maybe I still do

#

in case I am just changing blocks and not items XD

eternal oxide
chrome beacon
wet breach
#

what he means, is what you needed to do before 1.18

#

not that it wouldn't still work

eternal oxide
#

yep, the new one is the preferred way. No reflection

smoky oak
eternal oxide
#

Nope, I'm too lazy to blog

smoky oak
#

someone in here has one

#

thought it was you

#

eh whatever

eternal oxide
#

that would be mfnalex

smoky oak
#

ah right

eternal oxide
#

search github for Jeff media

smoky oak
#

k

eternal oxide
#

his blog is linked

tender shard
eternal oxide
#

he was looking for your blog

tender shard
coarse adder
#

how do i upload my plugin to spigot resources section? there's no "add resource" button or anything

eternal oxide
#

if I remember it was annoying to find the upload button

coarse adder
#

literally

tender shard
#

you are logged in, right? πŸ˜›

coarse adder
#

i try to go to the "resources/add" link but it says i do not have permission

coarse adder
tender shard
#

how old is your account?

coarse adder
#

not even a week old

tender shard
#

maybe they now require a minimum age

coarse adder
#

well i would be grateful if it could be actually known lol

smoky oak
#

dunno i could upload quickyl

eternal oxide
#

isn;t there a minimum post count to upload or soemthing?

smoky oak
#

i did upload a plugin

#

only thing i did

#

so i doubt it

tender shard
#

I pinged optic in #general, lets see what he says

coarse adder
#

thx

rough sonnet
#

I uploaded mine with no posts

tender shard
#

have you verified your mail address @coarse adder ?

rough sonnet
#

there is a min post count to upload premium resources, though

smoky oak
#

bleugh

tender shard
#

then idk

coarse adder
#

and added 2FA

coarse adder
lost matrix
#

Wait only 80 posts and 3 resources? Wasnt that higher at some point? You get that in like a week by just spam updating your 3 resources...

near night
#

hello my plugin is runing commands and i dont want them to show in chat is there a way to hide them? and cant use the api coz i have a text file with commands in them

tender shard
#

it was the same limit when I uploaded my first premium plugin (about 1.5 years ago)

tender shard
near night
eternal oxide
#

unless you are using dispatchCommand

tender shard
#

the permission you have defined for that command

near night
eternal oxide
#

then its better to use teh API than issue commands

near night
#

ok tysm guys

onyx fjord
#

maybe thats the thing

coarse adder
eternal oxide
#

Spigot just hates you then

coarse adder
#

😭

onyx fjord
#

Weird asf, because when i suggested minimum account age it got rejected

#

wtf

eternal oxide
#

try asking in general. and perhaps ping Optic in there

coarse adder
#

mr optic has been pinged

near night
eternal oxide
near night
onyx fjord
#

u shouldnt do it

#

thats bannable

tender shard
#

then you can expect both accounts to get blocked now

onyx fjord
#

having multi accounts isnt allowed

coarse adder
#

i haven't created a new account

tender shard
coarse adder
#

well this is spigot so i guess i can't delete my account right

tender shard
#

you could message support to get your account deleted

coarse adder
#

ok ty

tender shard
#

don't give your players permissions for those commands

near night
#

but its running base minecraft commands

tender shard
near night
#

ok tysm

near night
acoustic pendant
#

why is this not working in this event?

#

and working here

eternal oxide
#

Killer is a Player or null

acoustic pendant
#

oh

eternal oxide
#

not an Arrow

acoustic pendant
#

and how can i get if the killer is an entity?

#

so it can check if it is an arrow

eternal oxide
#

isn;t there a getLastDamager or something?

#

or lastDamageCause

acoustic pendant
#

yea

#

there is

grim ice
#

but that wont mean he died by it btw

earnest forum
#

its entity death event

acoustic pendant
grim ice
acoustic pendant
#

so this is not going to work, as i'm trying to use #getKiller() to see if it is an arrow... how can i solve that?

opal juniper
#

why wouldn’t that work

tender shard
#

getKiller returns a Player

acoustic pendant
#

yea

mortal hare
#

one simple question, can multiple players interact with the same villager at the same time?

acoustic pendant
#

and i want to return an entity

tender shard
#

check getLastDamageCause and then see there what entity it was

eternal oxide
acoustic pendant
#

Entity entity1 = e.getEntity().getKiller();

opal juniper
#

also you don’t need to Objects.equals for enums, just use ==

acoustic pendant
#

i need this to be an entity

tender shard
eternal oxide
#

Killer is always a Player or null

acoustic pendant
#

i mean

mortal hare
acoustic pendant
#

yea

tender shard
eternal oxide
#

try as I just showed above

mortal hare
#

that's a bummer, but i think i know how to fix this

eternal oxide
#

if the arrows still exists you should be able to get it

#

getLastDamageCause, see if its instanceof EntityDamageByEntityEvent, cast it and getDamager()

acoustic pendant
#
        if (Objects.equals(entity.getLastDamageCause().getCause(), EntityDamageEvent.DamageCause.PROJECTILE) &&
                entity1.getPersistentDataContainer().has(TestArrow.getInstance().getKey(), PersistentDataType.STRING) &&
                Objects.equals(entity1.getPersistentDataContainer().get(TestArrow.getInstance().getKey(),
                        PersistentDataType.STRING), "ARROW")) {

Check entity1... that is supposed to be the arrow

tender shard
acoustic pendant
#

idk

tender shard
#

and do not nest all your if things

#
    @EventHandler
    public void onDeath(EntityDeathEvent event) {
        EntityDamageEvent damageEvent = event.getEntity().getLastDamageCause();
        if (damageEvent == null) return;
        if (!(damageEvent instanceof EntityDamageByEntityEvent) return;
        EntityDamageByEntityEvent damageByEntityEvent = (EntityDamageByEntityEvent) damageEvent;
        Entity damager = damageByEntityEvent.getDamager();
        if(!(damager instanceof Projectile)) return;
        Projectile projectile = (Projectile) damager;
        // Do stuff
    }
acoustic pendant
#

some guy told me not to use ==

tender shard
#

bullshit

#

for enums you should always use ==

acoustic pendant
#

okay, thanks

mortal hare
#

You should not use == for strings

earnest forum
#

why not?

tender shard
#

because if you do this:

String firstString = "asd";
String secondString = "asd";
assert firstString == secondString;

then it MIGHT work, but it also might not work

earnest forum
#

ah

#

strings are pooled or something right?

tender shard
#

yep

mortal hare
#

== basically checks if that object is the same, Strings are objects so comparing them with == would compare they objects not the contents of the string

tender shard
#

because both strings are different objects, and only their content is equal

#

but yeah the JVM caches a certain amount of strings

mortal hare
#

strings are pooled, but if they're dynamically created in your code this would never work

tender shard
#

so you will get weird, random behaviour when comparing different strings with ==

mortal hare
#

but its faster!

quaint mantle
#

.equals(""); right

#

i forgot

harsh matrix
#

Hey, I am making a spigot plugin with multiple listeners listening on the InventoryClickEvent.
If I try to access the clicked item with e.getCurrentItem() I am getting random null errors, even though I am checking that the item isn't null (like this: if (e.getCurrentItem() == null) return;)
The plugin is a custom enchantment table and I have lots of InventoryClick listeners, but they all ignore cancelled events with @EventHandler(ignoreCancelled = true)

Full Code:
https://github.com/PixelAgent007/easyenchantments

harsh matrix
#

listener/ArmorEnchanter
listener/ToolEnchanter
listener/WeaponEnchanter
listener/GuiSetups
listener/GuiInvSetup

#

it affects all listeners

lost matrix
#

This is a bad idea

harsh matrix
#

I know, I should remove that

harsh matrix
#

oooh

eternal oxide
#

AIR is not null

harsh matrix
#

yea I get it

#

thanks a lot!

wary harness
#

Anyone could help with garbing ip of bungee server thru player on spigot side

lost matrix
# harsh matrix but it checks if the current item is null before?
(clicked.getType() == Material.BLACK_STAINED_GLASS_PANE || clicked.getType() == Material.ENCHANTED_BOOK || clicked.getType() == Material.BOOK || clicked.getType() == Material.BARRIER)

Make a set instead and check contains on it.

private static final Set<Material> clickableMats = Set.of(
  Material.BLACK_STAINED_GLASS_PANE,
  Material.ENCHANTED_BOOK,
  Material.BOOK,
  Material.BARRIER
);

// also some helper methods should be usefull
public boolean isCustomInventory(Inventory inventory) {

}

// laster on
if(clickableSlots.contains(clicked.getType) && e.getSlot() != 40 && isCustomInventory(inv)) {
  e.setCancelled(true);
  p.playSound(p.getLocation(), Sound.BLOCK_NOTE_BLOCK_BASEDRUM, 3.0F, 3.0F);
}
wary harness
#

Like can I get bungee ip and domain which player used to join

lost matrix
harsh matrix
wary harness
eternal oxide
#

yes

#

getWorld can return null

#

That is not the code you asked about

#

if you got the world from a Player it will not be null, unless the player is dead

eternal oxide
#

well, mid respawn

wary harness
#

from which player has joined

lost matrix
#

Create your own plugin message

#

size() will never return null

eternal oxide
#

Bukkit.getWorld can

#

Thats what his IDE is complaining about

lost matrix
#

This is not how java works. What are you trying to do in the first place?

eternal oxide
#
World world = Bukkit.getWorld("aaa");
if(world == null) return;
if(ready.size() == world.getPlayers().size()) {```
zenith gate
#

How can I get equipped/worn items? I want to make a "setItem" if 4 pieces of my custom items are equipped you get another buff..

#
public static void SetItems(Player player) {
        if (player.getEquipment().getHelmet() == IronHelmetUtils.createIronHelmet() && player.getEquipment().getChestplate() == IronChestUtils.createTankChestplate()
        && player.getEquipment().getLeggings() == IronPantsUtils.createTankPants() && player.getEquipment().getBoots() == IronBootsUtils.createTankBoots()){
            player.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE, 1, 1));
        }

This no works, do i need an evenHandler/Listener?

eternal oxide
#

compare with isSimilar or .equals

eternal oxide
#

you are comparing ItemStacks

lost matrix
zenith gate
#

Okay

lost matrix
#

So the simplest PDC based approach is this class:

public class ItemSetManager {

  public static final NamespacedKey ITEM_SET_KEY = new NamespacedKey(JavaPlugin.getPlugin(SpigotSandbox.class), "item-set-typ");

  public boolean hasItemSet(Player player, String name) {
    for(ItemStack itemStack : player.getEquipment().getArmorContents()) {
      if(!isPartOfItemSet(itemStack, name)) {
        return false;
      }
    }
    return true;
  }

  public boolean isPartOfItemSet(ItemStack itemStack, String name) {
    if(itemStack == null) {
      return false;
    }
    ItemMeta meta = itemStack.getItemMeta();
    if(meta == null) {
      return false;
    }
    PersistentDataContainer container = meta.getPersistentDataContainer();
    String setType = container.get(ITEM_SET_KEY, PersistentDataType.STRING);
    return name.equals(setType);
  }

  public void applySetType(ItemStack itemStack, String setType) {
    Preconditions.checkArgument(itemStack != null);
    ItemMeta meta = itemStack.getItemMeta();
    Preconditions.checkArgument(meta != null);
    PersistentDataContainer container = meta.getPersistentDataContainer();
    container.set(ITEM_SET_KEY, PersistentDataType.STRING, setType);
    itemStack.setItemMeta(meta);
  }

}

(Spam intensifies)

#

Usage examples:

  // Creating an "iron-skin" helmet by using the itemManager
  public ItemStack createIronSkinHelmet() {
    ItemStack helmet = new ItemStack(Material.IRON_HELMET);
    // <- Do some naming and whatever here
    this.itemSetManager.applySetType(helmet, "iron-skin");
    return helmet;
  }
  // Listening for damage events and reducing everything for "iron-skin" wearer
  @EventHandler
  public void onDamage(EntityDamageEvent event) {
    // Check if damaged entity is player and cast
    if(event.getEntity() instanceof Player player) {
      // Check if he has the "iron-skin" set
      if(itemSetManager.hasItemSet(player, "iron-skin")) {
        // Reduce damage by 10%
        event.setDamage(event.getDamage() * 0.9);
      }
    }
  }
sturdy patrol
#

Hi there. I'm currently porting a forge mod to spigot. This mod is enabling interaction with minecraft from an HTTP interface. One of its endpoints can be used to modify material and blockdata. I'm able to do that with CraftBlockData.newData(material, string) & Block.setBlockData(blockData).
My issue is that the original api let the user select exactly how the block is updated. It's not doable with the spigot/bukkit API, so I was looking for the actual implementation of bukkit's setBlockData so see if there was something I could put together with NMS, but I couldn't find the source code. Any idea?

#

If nobody got an answer ready, I'll create a forum post

lost matrix
sturdy patrol
#

Thanks! I forget about that. As for the original mojang mapping, it can be used for a better comprehension of the code structure, but the standard spigot jar is not using it right?

grim ice
#

methods

#

not static

zenith gate
smoky oak
#

is there an example project.xml for maven somewhere?

drowsy helm
#

do you mean pom?

smoky oak
#

ah yes

drowsy helm
#

there should be heaps online. The main thing you need to know is repositories, dependencies and plugins

smoky oak
#

eh fair enough

lusty cipher
#

how do I place a block at Location

#

I can only find World#setBlockData

drowsy helm
#

Location.setBlock()

lusty cipher
#

oh

drowsy helm
#

or some shit like taht

lusty cipher
#

nah

#

that doesnt exist

eternal oxide
#

setType

drowsy helm
#

thats the one

lusty cipher
#

YES

#

now I remember

smoky oak
#

does anyone know the name of the 1.19 import?

#

Cannot resolve org.spigotmc:spigot-api:1.19-R0.1-SNAPSHOT

eternal oxide
#

that depend is fine. you forgot to add repos?

smoky oak
#

dunno

#

compiling server and then adding the dependency worked before

#

hence me doing it with all three args

#

(docs, source, remapped)

worldly ingot
#
<repositories>
  <repository>
    <id>spigot-repo</id>
    <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
  </repository>
</repositories>```
smoky oak
#

i have this?

<repository>
            <id>spigot-repo</id>
            <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
        </repository>
#

i copied over a old pom.xml then changed 1.18.2 to 1.19

worldly ingot
#

What's your pom look like then?

#

?paste

undone axleBOT
smoky oak
eternal oxide
#

you didn;t update the version in the specialsource plugin

worldly ingot
#

I'd suggest making a Maven property so you don't have to remember to update everywhere, yeah ;p

smoky oak
#

still the same error tho

#

i dont have to change the pom that often

#

im more worried that what worked in 1.18 stopped working in 1.19

#

where in .m2 was the spigot stuff again?

eternal oxide
#

C:\Users\%USERNAME%\.m2\repository\ORG\spigotmc\

smoky oak
#

oke thats weird

#

the 1.19 files are there

#

why would it recognize 1.18 stuff in .m2 but not 1.19

eternal oxide
#

have you run Buildtools with --remapped ?

smoky oak
#

yes

harsh totem
#

how do I check if a block is broken by it's appropriate tool in BlockBreakEvent?

smoky oak
#

should be possible to grab the tool its broken with

smoky oak
echo basalt
#

You might be able to use NMS

#

Or this file I fetched from the minecraft client and converted to yml

echo basalt
#

T_T

smoky oak
#

welp restarting the ide still gives the same error

#

anyone a clue as to why?

echo basalt
#

I guess you can do reverse search with mine

eternal oxide
#

No clue

harsh totem
echo basalt
#

getDrops(ItemStack)

chrome beacon
#

Bukkit getRecipesFor

harsh totem
#

oh

chrome beacon
#

Or smth like that

#

Let me check

clever brook
#

Can any help me

smoky oak
#

?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!

clever brook
#

Having some err in bungee

chrome beacon
#

Wrong channel

clever brook
#

I try make java/pe bungeecord he says online mode

smoky oak
#

argh
restarting my computed didnt help either

#

the files are there

#

so why doesnt it read them in from .m2

chrome beacon
#

Did you tell Intellij to use another .m2

smoky oak
#

dont think so

#

new project too

chrome beacon
#

Try building your project outside of Intellij

smoky oak
#

how am i supposed to build when the pom xml is the file with the issue

chrome beacon
#

Run mvn package

#

And see what it tells you

smoky oak
#

'this command cant be recognized or found'

chrome beacon
#

You need to add maven to your path

#

First I recommend downloading an up to date version of maven

#

I assume you're on Windows btw

#

Then open environmental variables > path

And add the path to the bin folder of your maven install

smoky oak
#

one second

#

i looked into my project structure

#

apparantly it finds the file

#

but refuses to build with 'cant resolve'

#

theres another weird thing

#

i built the server with --generate-docs but there's no javadoc present

chrome beacon
#

That --generate-docs didn't really work for me

#

So go to Spigot > Spigot-API and run mvn javadoc:javadoc

smoky oak
#

wait theres jdocs in build.bat-folder\Spigot\Spigot-API\target

next stratus
#

πŸ‘‹

smoky oak
#

but no jdocs for the remapped stuff

chrome beacon
#

Why would there be

#

Remapped stuff is not documented

smoky oak
#

ah

next stratus
#

how do you guys learn nms

smoky oak
#

welp copying them over seemed to fix it

harsh totem
#

how do I check if an item has durability at all?
like a pickaxe would have durability but an egg wouldn't have

chrome beacon
#

NMS has no documentation which is why you need to have the knowledge to digg around and figure out stuff your self

smoky oak
#

something something isdamageable i think

next stratus
smoky oak
#

theres some blocks online

#

for example for placing millions of blocks

#

but nothing concrete

#

also

#

use remapped so that it doesnt break completely upon version change

harsh totem
#

if an item has no durability it's durability is 0?

next stratus
#

remapped?

smoky oak
#

if you use --remapped in build.bat it gives you two folders, spigot-api and spigot

#

the latter is the remapped stuff

chrome beacon
next stratus
#

I already know java.

smoky oak
#

you HAVE to add the remapped plugin from md_5 though

next stratus
#

I just haven't touched NMS before.

smoky oak
#

some legal thing about not publishing deobfuscated mojang code

chrome beacon
#

You shouldn't post the obfuscated one either

#

Don't upload code you don't have the rights to

next stratus
#

I wish I learnt NMS before ngl

#

there's so much to learn about it

chrome beacon
#

I can help you if you want

#

I don't have access to a pc right now but I can guide you with the general process

next stratus
#

I mean, I wanna work out how to set blocks and such, there's tutorials out there but it's complex πŸ˜…

chrome beacon
#

Most tutorials are out of date by now

next stratus
#

I mean, I sadly can't use the latest version so that helps slightly i guess

smoky oak
#

u building for an older server?

lost matrix
next stratus
#

slightly older yes

smoky oak
#

i thought you cant place blocks async?

next stratus
lost matrix
#

Huh? You can do absolutely everything async...

next stratus
#

not setBlock

lost matrix
#

Yes

next stratus
#

Nope

lost matrix
#

What do you mean?

next stratus
#

I've tried before it throws a warning.

#

"You can't update blocks async" or some shit

lost matrix
#

Ah i see the problem. You think async is equal to multithreaded.

next stratus
#

?????

#

No?

#

It legit says you can't do it

lost matrix
#

Ive done it and even wrote a forum post about it.
If you split setting 1M Blocks over 1k ticks then you are
doing this task async.

next stratus
lost matrix
#

You just have to do it async on the main thread.

smoky oak
#

why not use nms and set the blocks in one tick

lost matrix
#

Bad phrasing from spigot

next stratus
#

I don't know nms

smoky oak
#

ah fair

lost matrix
smoky oak
#

uh i dont think so

next stratus
#

I'd learn it but idk how to do it

smoky oak
#

iirc it was around 25k/tick for spigot and around 14M/tick for nms

lost matrix
#

Everything thats faster than setType without physics updates can easily lead to corrupted chunks.

smoky oak
lost matrix
mortal hare
#

holy shit

#

i think i found longest comment on bukkit

#

?paste

undone axleBOT
mortal hare
#

28 lines

smoky oak
#

arent packets nms stuff?

lost matrix
mortal hare
#

yes they are

smoky oak
#

whered you find that

mortal hare
#

Packets are part of internal NMS

lost matrix
#

Technically packets are part of IP. You can read them by injecting a packet handler into the netty pipeline or by using ProtocolLib (which does it for you).
Problem is interpreting the protocol.

lost matrix
# next stratus that's the issue

Do you want to do updates on blocks that are hot? (Players are nearby and they can witness changes live)
or do you want to do cold changes (change blocks in preparation for certain events or restoring a map after usage)

next stratus
smoky oak
#

cant you use the normal setblock then? I'd guess you wouldnt want to change 50k+ blocks

lost matrix
#

Just do it async πŸ˜„

next stratus
#

I was using FAWE what was fine but the other dev's ego is too big thinking using nms is "better" and is forcing me to use it

lost matrix
#

Spigot calls nms. There is literally no reason to use raw nms unless you want to additionally trigger light and physics updates or even manually send packets afterwards.

next stratus
#

I use world edit to set the blocks normally isn't that fast enough...?

#

93 milliseconds to set 754 blocks

lost matrix
#

Sure. One of the most important rules in programming: Dont reinvent the wheel

hybrid spoke
lost matrix
next stratus
lost matrix
#

Yes

next stratus
#

hm

hybrid spoke
#

very slow

next stratus
#

it usually speeds up

lost matrix
#

This sounds like you are loading a schematic file from disk before pasting.

#

1k Blocks should be <5ms max.

#

Depending on your CPU

next stratus
#

it says 98ms now but I wonder if i'm calculating wrong

#

lemme make another thing 2s.

lost matrix
#

Show some code pls

wary harness
#

What do you think guys will that google AI invent time travel?

next stratus
#

it's saying 0ms now lol

lost matrix
wary harness
lost matrix
#

Astronauts travel 10min into the future on average in their lifetime.

next stratus
#

well it's saying 0 nanoseconds so I'm sure that's fine

lost matrix
next stratus
#

!paste

wary harness
next stratus
lost matrix
wary harness
#

was jk

lost matrix
#

^^

wary harness
#

🀣

smoky oak
#

iirc theres a package that does that

opal juniper
#

plugin message

next stratus
#

constantly saying 0ms idk what else to do lol

lost matrix
#

You mean via spigot or via bungeecord?

wary harness
next stratus
#

I don't know what else to do, it's setting the blocks but it keeps returning 0ms

opal juniper
#

1.8 is legacy and should be avoided at all costs

lost matrix
#

Your friend sounds smart

next stratus
smoky oak
#

use system nanos then

lost matrix
next stratus
#

68,300 ns

#

to me that seems perfectly fine

lost matrix
#

You would need to use a NanoClock

private static final NanoClock NANO_CLOCK = new NanoClock();

public Duration measure(Runnable action) {
  Instant pre = Instant.now(NANO_CLOCK);
  action.run();
  Instant post = Instant.now(NANO_CLOCK);
  return Duration.between(pre, post);
}
lost matrix
next stratus
#

ok, so I can keep using this method with no problems then?

lost matrix
#

Unless this is spamable and 10 players can do it a thousand times a second you should be fine.

tender shard
#

unless google is lying to me πŸ˜„

lost matrix
#

right. 68us are 0.068ms

#

Seems a bit low tho

smoky oak
#

uh you forgot three zeroes there

#

thats a factor of one million not onethousand

zealous osprey
#

It's a factor of 1000000, since you have:
sec -> millis -> micros -> nanos
each a step of 1000 to another

lost matrix
#

68,300ns = 68.3us = 0.0683ms
looks about right to me

next stratus
lost matrix
next stratus
#

Alright

#

the other dev has too big of an ego I guess...

smoky oak
#

well are you new?

#

programmers have either imposter syndrome or a god complex

#

no in between

lost matrix
# next stratus the other dev has too big of an ego I guess...

Yeah that can be a problem. But im of the same type. I just use ProtocolLib and write absolutely everything myself.
Ive gotten this way after reading some of the code of more popular apis that i where using.
*Oh and i use Crunch when im doing calculations for experience formulas for example @waxen plinth

echo basalt
#

ProtocolLib is gangst

next stratus
#

I mean redempt is a cool dev he helps a lot with coding

smoky oak
#

just becuase you're having a god complex doesnt mean youre a bastard

next stratus
#

?

sand rune
#

?learnjava

undone axleBOT
formal bear
#

How to get Player class from event? ```
public void playerFall(EntityDamageEvent event) {
event.something
}

modest garnet
#

Hey all,

this is probably a message you will skim over.
However me and my mate have an amazing idea for a project
however we are in need of a developer.

if this is something you are interested in then the idea can be
further explained in DM

there is a slight catch. me and this mate are both students.
money is not the easiest to come by. however we are devoted to this server
and would love to have someone join the team. and once the server has launched etc
money that we receive we will aim to provide you with money worth your time (dependent on server growth)

any questions or possible discuses the offer please DM me

echo basalt
#

mmmm development on the basis of a promise

modest garnet
#

ik its not ideal

echo basalt
#

check if its player

#

cast

#

whateve

formal bear
#

nvm got it

formal bear
lament swallow
#

Is there a better way to do this without NMS?

String advancementResourceLocation = event.getAdvancement().getKey().getKey();
if(advancementResourceLocation.startsWith("story/")) {
    //Is there a better way to do this??

    String advancementDisplay;
    switch (advancementResourceLocation) {
        case "story/mine_stone" : advancementDisplay = "Stone Age";
        default : advancementDisplay = "";
    }
}```
echo basalt
#

I don't see where you're doing NMS

#

getKey returns a namespaced key

lament swallow
#

i mean the better way would be to use NMS

echo basalt
#

Thing is these achievements are localized

lament swallow
#

but i don't want to*