#help-development

1 messages ยท Page 1301 of 1

buoyant viper
#

have u never used Mixins?

lilac dagger
#

nope

buoyant viper
#

damn

sly topaz
#

put it inside a <pre> tag

lilac dagger
#

is this the main thing in mixins?

#

i have maps with values of different things, so having a way to use a factory as an annotation is really cool

buoyant viper
#

ie. @Mixin(MinecraftClient.class)

tranquil quail
#

I need partners ๐Ÿ˜ญ

lilac dagger
#

so cool

#

good to know

buoyant viper
tranquil quail
#

I mean not like that wht

sly topaz
#

pair programming is for the weak

tranquil quail
#

For like developing

#

I'm strong

#

I wanna see everyone's plugins

brittle geyser
#

no it useful for my annotation config system

umbral ridge
#

man

#

what is the most common reason this happens

umbral ridge
#

and i cant figure it out

#

fucking bungeecord

#

on a lobby server i have enabled bungeecord.. i did all the steps through a tutorial and for them it works for me it doesn't

manic delta
dusty herald
# umbral ridge

Make sure that you're connecting through the Spigot proxy, not the lobby server

umbral ridge
#

yea xD

#

i figured it out

jade bone
#

Hi, i have a question regarding the MHF_ heads. I'm trying to add them to an custom GUI / Inventory using a helper function:

private ItemStack createHead(String owner, String displayName) {
        ItemStack skull = new ItemStack(Material.PLAYER_HEAD);
        SkullMeta meta = (SkullMeta) skull.getItemMeta();
        if (meta != null) {
            meta.setOwner(owner);
            meta.setDisplayName(displayName);
            skull.setItemMeta(meta);
        }
        return skull;
    }```
But they stay Alex heads, i call this function like so:
```java
 inv.setItem(46, createHead("MHF_ArrowLeft", plugin.getConfigManager().getLanguageManager().getMessage("previous_page")));```
brittle geyser
jade bone
#

Did it change?

brittle geyser
#

Yes

jade bone
#

But how can i get the player object of the MHF_ skin?

pliant topaz
#

isnt that just the player name? aka Bukkit#getPlayer

brittle geyser
#

try Bukkit.getOfflinePlayer("MHF_")

jade bone
#

meta.setOwnerProfile(Bukkit.getOfflinePlayer(owner)); needs a UUID unfortunatly

brittle geyser
#

then player.getPlayerProfile();

#

getOfflinePlayerExact?

#

do you have online-mode true?

brittle geyser
jade bone
brittle geyser
#

Bukkit.getOfflinePlayer(UUID.fromString("f2e4249e-f79d-4da4-a5d4-2291f7927f25"));

#

server.properties

jade bone
pliant topaz
#

or just get the player and do getUuid on it

brittle geyser
jade bone
#

Hmm cant get it to work, it keeps rendering the wrong head. Is it maybe broken in 1.20+?

pliant topaz
#

the wrong head (not alex) indicates a wrong uuid or the player which the uuid does belong to changed their skin

jade bone
#

So basically MHF_ArrowRight has been overwritten -_-

young void
#

does anyone know about forbidden vanilla shader magic?

#

guide me please๐Ÿ˜‚

#

how can i display players hand skin on a model

grand flint
#

what would be the best way to remove all sort of armour from the game?

#

like crafting, wearing, mobs spawning with it, structure chests

young knoll
#

Remove the recipes

#

Remove it from mobs in the spawn events

#

Remove it from loot in the loot generate event

grand flint
#

yeah its fine it wasnt like that

#

as in

#

ur method is correct

#

tturns out its not what im doing

#

thanks though ๐Ÿ’‹

buoyant viper
#

is there a /good/ way to modify the recipients of AsyncPlayerChatEvent?

worldly ingot
#

What do you think is the bad way?

buoyant viper
#

there is a getRecipients collection, but docs say it may be unmodifiable

worldly ingot
#

getRecipients() should be mutable on CraftBukkit servers

#

In all scenarios afaik

pliant topaz
#

and if it somehow errors you can still catch it and go back to the original approach

unique shuttle
#

Does anyone know how I can get the tag on the client?

chrome beacon
#

Are you writing a mod?

unique shuttle
#

I think it's server-side only. Is there any way to detect an NPC on the client?

unique shuttle
unique shuttle
#

I want to modify the entity on the client only if it's an npc

grand flint
#

whats the best way to hide players from the tablist?

#

without hiding the player from eachother obv

proud basin
#

probably using PlayerInfoRemovePacket via ProtocolLib

slender elbow
#

Player#unlistPlayer or something

#

nvm that's paper lmao

sly topaz
#

was about to say

#

you can't hide yourself with those methods anyway

slender elbow
#

idk they didn't say hiding oneself

sly topaz
#

fair enough

austere crow
#

PostFlattenTagRegistrar is the only paper package that says it cant be found? im using the most current everything

#

import io.papermc.paper.tag.PostFlattenTagRegistrar;

sly topaz
austere crow
#

ohh

#

your right

#

thats a good idea

#

thanks

buoyant viper
#

designing a virtual economy system (because i hate myself and wont just use Vault + like some random Eco plugin), cant decide if i want to store and work with floating point numbers (and deal with potential FP errors ๐Ÿคจ), or store user balances as whole numbers, and do just basic integer arithmetic, and then only when the balance is displayed is when ill just รท 10.00 (possible point of failure ๐Ÿคจ)

#

or well, i guess i dont need to do math to show balance

#

i could just artificially create a string and populate empty space with zeroes

slender elbow
#

just use whole numbers

#

if your unit is a cent then for formatting you can do %d.%d where the whole part is balance / 100 and the decimal is balance % 100

#

but it really does keep the math really simple without fp inaccuracies

#

or you can just use a bigdecimal which that's what it does internally anyway, BigDecimal("123.45") is just value = 12345; scale = 2

sly topaz
#

Acktually โ˜๏ธ ๐Ÿค“ , it uses a BigInteger for the unscaled value

#

but the essence is the same, so it isn't wrong per se

slender elbow
#

using an int for cents :(

#

only allow up to 21 million dollars

#

(only)

sly topaz
#

why the discrimination towards billionaires ๐Ÿ˜”

slender elbow
#

because I need to sleep

#

asado or pasta tomorrow?

sly topaz
#

pasta, humidity is too high

#

well, maybe it doesn't matter if you aren't going to be the one doing it lol

slender elbow
#

I can't remember the last time I've had parrilla ๐Ÿ˜ญ

#

(my memory is really bad)

sly topaz
#

(had it last week, just doesn't remember)

buoyant viper
mortal niche
#

hey i keep on getting an exeption NullPointerExeption: Name is null

#

heres the code that i think is the problem

drowsy helm
#

are you checking for null values

mortal niche
#

sotty idk why the fuck it didnt sent the message with the code

drowsy helm
#

?paste

undone axleBOT
drowsy helm
#

probs too long

#

you can chuck it in that and send the link

mortal niche
#

Your message could not be delivered. This is usually because you don't share a server with the recipient or the recipient is only accepting direct messages from friends. You can see the full list of reasons here: https://support.discord.com/hc/en-us/articles/360060145013 bro what the hell i got this when i tried sending it

drowsy helm
#

I dont accept dms

#

just send it here

left jay
#

how can i remove this us16 box that shows up when trying to use the ๐Ÿ›ก๏ธ emoji?

drowsy helm
#

Are you using the raw character or a unicode string

left jay
#

unicode string, but i did try as a raw character and it did the same thing

mortal vortex
#

๐Ÿ›ก๏ธ is an emoji, which contains both U+1F6E1 (which is a unicode shield symbol), AND Variation Selector-16 (U+FE0F).

#

Just dont use the emoji and use U+1F6E1

brittle geyser
#

in the end

charred blaze
#

what event do i use for left clicking an entity?

brittle geyser
#

Player interact entity

charred blaze
#

that only covers right clicking

brittle geyser
#

EntityDamageByEntity

charred blaze
#

the entity that im clicking is interaction entity and im not sure it gets damaged when i click it

brittle geyser
#

what entity type

charred blaze
#

Interaction entity

#

this thing

brittle geyser
charred blaze
#

1.21

brittle geyser
#

server version

charred blaze
#

1.21

brittle geyser
#

Test damage event

wraith dagger
#

?mappings

undone axleBOT
crisp coral
#

If anyone needs help developing plugins dms me

chrome beacon
#

?services

undone axleBOT
potent crescent
crisp coral
potent crescent
#

aha ok ๐Ÿ˜ญ๐Ÿ˜‚

crisp coral
#

You have been so helpful

potent crescent
#

thank you โค๏ธ

short vault
#

hey guys i'm running into an issue, So the issue is i wanted to get my repository from github into intellij and i done this, After that any code that's related to spigot-paper-bukkit will give an error, and also pom.xml the same thing it's all errors

cinder abyss
chrome beacon
cinder abyss
#

thanks x)

#

still I know that they are correct because protocollib doesn't send errors lol

cinder abyss
# chrome beacon you're never sending the packets?

hum, now I get a weird error :

[16:05:16 ERROR]: Error sending packet clientbound/minecraft:set_entity_data
io.netty.handler.codec.EncoderException: Failed to encode packet 'clientbound/minecraft:set_entity_data'
    at net.minecraft.network.codec.IdDispatchCodec.encode(IdDispatchCodec.java:62) ~[paper-1.21.8.jar:1.21.8-21-ed31825]
Caused by: java.lang.ClassCastException: class net.minecraft.network.syncher.SynchedEntityData$DataItem cannot be cast to class net.minecraft.network.syncher.SynchedEntityData$DataValue (net.minecraft.network.syncher.SynchedEntityData$DataItem and net.minecraft.network.syncher.SynchedEntityData$DataValue are in unnamed module of loader java.net.URLClassLoader @6433a2)
    at net.minecraft.network.protocol.game.ClientboundSetEntityDataPacket.pack(ClientboundSetEntityDataPacket.java:23) ~[paper-1.21.8.jar:1.21.8-21-ed31825]
    at net.minecraft.network.protocol.game.ClientboundSetEntityDataPacket.write(ClientboundSetEntityDataPacket.java:44) ~[paper-1.21.8.jar:1.21.8-21-ed31825]

with my code being : https://paste.md-5.net/satihuzece.java

#

do you know why ?

slender elbow
#

display entities are as cheap as they get, just spawn a real one

thorn isle
#

they do still shit up the entity tracker, so i wouldn't be spawning hundreds/thousands of them, but even then they are definitely one of the if not the cheapest server side entity you can spawn

thorn isle
#

or like just spawn it as a real entity; just make sure to mark it as non persistent so if you lose track of it, it won't stick around

#

it doesn't seem like you're even making it visible/different on a per-player basis which is one of the few reasons you might want to do this with packets

cinder abyss
#

Okay I see, thank you for your help

quaint comet
chrome beacon
quaint comet
#

I am experimenting with them and learning

#

and I wanted to try to show the explosion to only 1 player

chrome beacon
#

You can use the API for that

quaint comet
chrome beacon
quaint comet
chrome beacon
#

basically you have the wrong packet format for the version you're on

quaint comet
#

I thought that putting these 3 is enough, do I need to specify all fields?

chrome beacon
#

That's the protocol data

#

ProtocolLib is reflecting on the packet class itself

#

so you need to match Mojangs class

#

in this case those 3 doubles are stored as a vec3

#

(in modern versions)

chrome beacon
quaint comet
chrome beacon
#

?mappings

undone axleBOT
quaint comet
# chrome beacon ?mappings

Sorry if this sounds dumb, but these values listed here like vec3, float and boolean I should add into the packet

#

right?

chrome beacon
#

boolean?

crimson agate
#

How do I prevent click spamming? Like a cooldown for event processing? Because when I use a flag, when an click is processed in the same tick, it will still bypass this restriction

quaint comet
crimson agate
chrome beacon
chrome beacon
#

2 vec3s (one of which is optional), the explosion particle and explosion sound

quaint comet
chrome beacon
#

see if works

quaint comet
#

I am so dumb

#

I was looking at a different explosion

#

now I am at the correct one

#

the time it took me to realize

#

...

chrome beacon
#

ah wrong class

quaint comet
kind coral
#

does spigot have any rules about publishing gambling related plugins?

buoyant viper
#

i think it does actually

thorn isle
#

I don't think anyone follows them if it does

sly topaz
#

spigot itself might not but minecraft does

#

so, realistically, only servers that don't mind being blacklisted can use that kind of plugin lol

thorn isle
#

remind me, are crates considered gambling in the tos

kind coral
sly topaz
#

technically yes but nobody sees it as damaging enough to enforce anything

young knoll
#

I think there are specifically rules against premium gambling plugins

#

Donโ€™t recall any for free ones

thorn isle
#

i'm sure i've seen premium crates plugins

chrome beacon
#

are they older than the rule

thorn isle
#

i don't know, i can't remember any specific plugins off the top of my head, i'm just fairly sure i've seen some at some point

grim hound
#

How do you give an elytra a different 3d model based on some nbt?

#

like some model or some custom model data

#

literally no examples on the web

#

1.21.4 changed up everything

grand flint
#

i dont think its custom model data

#

its uhh

#

equip model?

young knoll
#

Thereโ€™s armor model

#

Or whatever it is

grand flint
#

yeah its the equip model i think

young knoll
#

Though idk if that works for elytra

grand flint
#

it does

#

i got some on my server

grim hound
#

wdym

grand flint
#

items have an equip model if u add an equippable

#

here in command form:

grim hound
#

so a give @p elytra[custom_model_data={floats:[1]}] 1 wouldn't ever work?

grand flint
#

no

#

custom model data

#

just replaces the items look

#

also dont use custom model data after 1.21.4

#

u use the item model component

#

and here is the one for equippables

#

/give @a cobblestone[equippable={slot:chest,asset_id:"myarmor:emerald_chestplate"}]

grim hound
#

any wiki

#

any docs

#

anything

grand flint
#

yeah thast for equippable

#

and here for item model;
/give @a cobblestone[equippable={slot:chest,asset_id:"myarmor:emerald_chestplate"},item_model="myarmor:emerald_chestplate"]

#

so the equippable model is the emerald_chestplate

#

then the item model is also the same

grim hound
#

why's it a cobblestone

grand flint
#

which is how the item looks in ur hand

#

why not

#

what does that change ๐Ÿ™

grim hound
#

I see

molten hearth
#

should've used air

grand flint
#

the item model is how it looks in ur hand

grim hound
#

item model is in inventory?

grand flint
#

when u throw it on the ground and stuff

#

the asset id

#

is for equippables

grim hound
#

I see

grand flint
#

its a model, how it looks when u equip it

#

only available for equippables

grim hound
#

what path does it prefix it with

grand flint
#

what

grim hound
#

like

grand flint
#

its a resourcepack

grim hound
#

yes

grand flint
#

assets>
minecraft>textures/models
myarmor>textures/models

#

so if u put ur armor in myarmor instead of minecraft

#

u would use myarmor:

grim hound
#

the asset_id is a .png texture right?

grand flint
#

no the asset id is a json

grim hound
#

uh

grand flint
#

i just told u its a model

#

how would a texture be 3d

grim hound
grand flint
#

.?

grim hound
#

the json

#

wtf is it

grand flint
#

what ever ur model is ??

thorn isle
#

it's essentially a list of primitive shapes defined by points and rotations

grim hound
#

nonono

#

not a blockbench model

#

just a simple model

#

like you'd remake an elytra

grand flint
#

dont talk to me anymore

grim hound
#

simple 2d png

thorn isle
#

you'd do that by listing primitive shapes described by points and rotations

grand flint
#

well look

#

i got this in nexo

#

this is the elytra

grim hound
# grand flint

now how would you make it only appear in certain elytras

grand flint
#

using the asset id probs idk

grim hound
#

so you don't know how the json looks like?

grand flint
#

the json is for a custom model

#

are u asking the json for an elytra?

grim hound
#

ohhh it's the

#

wait, there are two

grand flint
#

yeah

#

obv

#

u need to overwrite the minecraft elytra json

#

so u can add ur version to it

#

then if u have a custom eltyra u need to add a model for that

grim hound
#

so it's either this

#
{
  "parent": "minecraft:item/generated",
  "textures": {
    "layer0": "minecraft:item/elytra"
  }
}
grand flint
#

thats not an elytra

#

thats an item

grim hound
#
{
  "layers": {
    "wings": [
      {
        "texture": "minecraft:elytra",
        "use_player_texture": true
      }
    ]
  }
}
#

so this?

grand flint
#

yeah i think soi

#

let me see

#
{
  "model": {
    "type": "condition",
    "property": "broken",
    "on_true": {
      "type": "range_dispatch",
      "property": "custom_model_data",
      "entries": [
        {
          "threshold": 1000.0,
          "model": {
            "type": "model",
            "model": "d1e4e01a-100b-4eaa-b146-86743263c24c:05d1ef37-9406-4e1e-a430-dd24313ef7a6",
            "tints": []
          }
        }
      ],
      "fallback": {
        "type": "model",
        "model": "item/elytra_broken",
        "tints": []
      }
    },
    "on_false": {
      "type": "range_dispatch",
      "property": "custom_model_data",
      "entries": [
        {
          "threshold": 1000.0,
          "model": {
            "type": "model",
            "model": "d1e4e01a-100b-4eaa-b146-86743263c24c:05d1ef37-9406-4e1e-a430-dd24313ef7a6",
            "tints": []
          }
        }
      ],
      "fallback": { "type": "model", "model": "item/elytra", "tints": [] }
    }
  }
}

#

and hten for custom model data;

{
  "parent": "item/generated",
  "textures": { "layer0": "item/elytra" },
  "overrides": [
    {
      "predicate": { "custom_model_data": 1000 },
      "model": "d1e4e01a-100b-4eaa-b146-86743263c24c:05d1ef37-9406-4e1e-a430-dd24313ef7a6"
    }
  ]
}

grim hound
#

uh huh

grand flint
grand flint
grim hound
#

so no equipment >elytra.json?

grand flint
#

no dont think so

#

elytras work a bit different

#

u also need ur own elytra json

grand flint
#

u add ur own version

#

like my_elytra.json

#

then u would change it to texture: minecraft:my_elytra

grim hound
grand flint
#

u can also make custom tridents somehow now

grand flint
#

there is no equipment

#

that owuld go wherever u wanna put it

#

which would most likely just be inside of minecraft>models

grim hound
grand flint
#

yeah

#

i dont care

grim hound
grand flint
#

what would that possibly change ?

#

the main folder matters

#

the folder inside that doesnt matter

grim hound
grand flint
#

either

#

assets>minecraft>models>

#

or

#

assets>mynamespace>models>

#

what u put inside the models> folder doesnt matter, the main thing is that the models folder

#

so u could also have models>elytras>

grim hound
#

right?

#

it's inside a models folder

grand flint
#

yeah tahst fine

#

then u need

#

assets>minecraft>textures>wings1.png

grim hound
#

it is there

#

nothing renders

grand flint
#

then u need teh elytra definiton files

grand flint
#

im not sure how that one works i dont excatly think u need that but yeah

#

thats for the

#

item in hand

grim hound
grand flint
#

then u did it wrong

grim hound
#

what exactly?

grand flint
grand flint
#

thats the file that makes the actual elytra render as a custom one

grim hound
#

it needs to be called elytra.json?

grand flint
#

yes..? that is a minecraft file

#

a definition file

grim hound
#

and what does this sha1 mean?

grand flint
#

what

#

thats my file

#

just obsfucated

grim hound
grand flint
#

it will hack ur server

grim hound
#

is it like

#

uuhhh

#

texture?

grand flint
#

no it litearlly says model:

grim hound
#

or is it a json

#

aight

grand flint
#

give me a se

#

c

grim hound
#

soo uh

#

I assume this needs a custommodeldata defined so some value I cannot infer

grand flint
#

i sent u

#

the other file as well :D

eternal night
#

models just need that self referencing typing

#

composite models would go hard if they could just link to a separate model file

grand flint
#

thats a minecraft file as well

#

not ur custom file

grim hound
#

now it's also invisible in the inventory

#

/give @a elytra[equippable={slot:chest,asset_id:"minecraft:xes"},custom_model_data={floats:[1000]}] with

#

like that?

#

would you mind if I

#

sent you the rp?

grim hound
#

like elytra.json

grand flint
#

good for u

grim hound
#

So why would it still be invis?

left jay
left jay
karmic mural
#

Is there any existing function in spigotAPI I can call to see how much EXP is required to reach a certain level?

Would be to get the right amount of XP to remove from a player based on a certain level input, so they are deducted the EXP cost of X levels, not the literal levels themselves

#

or do I just need to use the level forumla to calculate it

karmic mural
#

sadness, formula it is

sly topaz
# karmic mural sadness, formula it is
public static int getTotalExpForLevel(int level) {
    if (level <= 16) return level * level + 6 * level;
    if (level <= 31) return (int) (2.5 * level * level - 40.5 * level + 360);
    return (int) (4.5 * level * level - 162.5 * level + 2220);
}

the formula is simple enough

#

you just have to remember to sum the value of Player::getExp * HumanEntity::getExpToLevel to that

karmic mural
#

But ty for the input

karmic mural
sly topaz
# karmic mural I'm not sure what you mean by this, could you rephrase?

well, in the case you want the total experience level necessary for a player to achieve that level, you'd need to take into account the amount of xp they already have towards the next level (aka progress/Player::getExp * exp needed for next level/HumanEntity::getExpToNextLevel = current progress in exp). However since you're trying to remove levels, I guess it doesn't matter?

#

I am a bit head empty right now to think about implications lol

karmic mural
#

without removing the literal levels as the cost would get higher the higher their total level

#

So rather than removing the levels I would get total exp, then set total xp - total exp for level

karmic mural
echo basalt
#

second and third have decimal numbers that need to be converted back

#

first one doesn't

karmic mural
#

Oh duh, ty lol

#

Level doesn't look like a real word anymore

strong sable
#

how long does premium resources take for approval?
It's been 7 days ๐Ÿ˜ญ

karmic mural
#

Following up on the earlier, would this be a sane way to achieve my goal of removing XP and making sure there's no desync on client side?

public static void removeLevelsFromPlayer(int level, Player player){
    int experienceCost = (getTotalExpForLevel(level));
    int playerTotalExperience = player.getTotalExperience();
    int newPlayerExperience = (playerTotalExperience - experienceCost);

    player.setTotalExperience(newPlayerExperience - 1);
    player.giveExp(1);
}

public static int getTotalExpForLevel(int level) {
    if (level<=16) return level * level + 6 * level;
    if (level<=31) return (int) (2.5 * level * level - 40.5 * level + 360);
    return (int) (4.5* level * level - 162.5* level + 2220);
}```
mortal vortex
#

oh u editted it

karmic mural
#

I'm not in my usual environment so it auto-filled incorrectly

mortal vortex
#

hang on, thats giving the total EXP needed to reach that level from 0, not the cost of gaining that many levels from current position, whcih is what i thought u were trying to do.

#

also its <16 and <31, not <=, because 16 and 31 are the bounds, not inclusive i dont tink

karmic mural
#

Yes, it's to remove the value of the levels from 0 rather than just removing the levels

karmic mural
#

~~removed fandom link ~~

mortal vortex
#

okee well if the numbers are right then sur, good method.

#

no, dont go off the fandom

#

(example)

#

fandom can be like completely wrong

smoky anchor
#

as I said literally below this, use the other, better wiki
there is an extension to replace the fandom links :D

mortal vortex
#

okay in that case its right my bad, ur boundaries r good

karmic mural
#

the minecraft.wiki one?

smoky anchor
#

ye

karmic mural
#

Info checks out there at least so all good, but ty for the feedback

#

and the wiki thing, idk why it wasn't the first result when I searched for it

mortal vortex
#

steve gets paid to promote minecraft.wiki

smoky anchor
#

shh

karmic mural
strong sable
#

how long does premium resources take for approval?

#

It's been 7 days

mortal vortex
#

ten trillion years

#

if you donate to spigotmc, its reduced to 4 working days

#

total no brainer solution

pseudo hazel
#

lol

#

no brain, full wallet

#

or more like empty wallet..

echo basalt
karmic mural
#

Players with hundreds of levels would be losing far more than those that are closer to the exact level needed

brittle geyser
#

ye its make sense

thorn isle
#

it could be considered a feature

#

diminishing returns and whatnot

#

depending on the context where this is used, being able to spend xp on 3 things in a row could be much more powerful than being able to do the three individually with having to collect xp in between, so it would be reasonable to remove more xp for doing the former

slender elbow
#

tax the rich

grand flint
#

eww

echo musk
#

Hey, I want to become a Java Developer So please tell me where I can learn.

slender elbow
#

by taking a java course

#

good things are said about jetbrains academy

#

?learnjava

undone axleBOT
#

For Beginners:

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

For Intermediate to Advanced Learners:

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

Practice and Hands-on Learning:

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

Free Resources and Documentation:

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

Community and Support:

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

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

stark dirge
#

how to fix this error?
java.lang.NullPointerException: Cannot invoke "com.comphenix.protocol.ProtocolManager.addPacketListener(com.comphenix.protocol.events.PacketListener)" because "this.protocolManager" is null

#

i tried many things but its not getting fixed

pseudo hazel
#

do you have any more to that error?

#

for example a stacktrace?

thorn isle
#

don't call addPacketListener() on this.protocolManager if it's null

echo basalt
pseudo hazel
#

๐Ÿ’€

stark dirge
#

tuff

stark dirge
#

how do i make a plugin that wont load chunks below y lvl 16 like the anti free cams

#

like in donut smp

potent crescent
#

?learnjava!

undone axleBOT
stark dirge
#

like whats the mechanics

vast ledge
#

What what's the mechanics

pseudo hazel
#

probably making a custom ChunkGenerator

thorn isle
#

what's a donut smp

vast ledge
#

I think he wants to not send packets for x blocks below the player

#

Ex when you're standing at y 90 you can't see y0 with freecam

thorn isle
#

will be kind of annoying to do with a plugin, but with nms it should be somewhat doable

vast ledge
#

Ye, his description wasn't all to enlightening

pseudo hazel
#

doesnt sound very easy

thorn isle
#

i do something kinda sorta similar in my view distance extender, you basically end up copying the chunk data packet write logic and make it write only the chunk sections you want

vast ledge
#

Not sure how mc sends world packets, is it per block or an entire chunk at once?

thorn isle
#

entire chunk

#

changes/updates are sent per-block

vast ledge
#

Ah, so you'd have to catch the chunk packet modify it to only contain blocks in players view distance and then send

pseudo hazel
#

yeah and I guess catch all changes to those blocks and dont send those as well?

vast ledge
#

Yea

#

Probs an array or hashmap of the chunks the player has been sent and what blocks he needs updates for

#

Seems like it would fuck Performance tho

thorn isle
#

and then once the player changes their elevation, you'll have to re-send chunk packets with those omitted sections in them

vast ledge
#

@stark dirge solution to your question in the above messages, just learn Java and then you can implement it ;D

thorn isle
#

alternatively, if what you want is some kind of anti-xray thing, paper has that built in and on spigot you can use ore obfuscator or whatever it's called

vast ledge
#

True, still don't understand what donut smp is. Do they like have something special with donuts or??

grand flint
young knoll
#

Drop all the lower chunk sections in the outgoing chunk packets

#

And then resend them all I guess when the player goes below that level?

grand flint
#

oh yeah doesnt chunks have Y level chunks as 2ell

young knoll
#

Mhm

grand flint
#

thats kinda crazy though

young knoll
#

Though does that really help

grand flint
#

how is donut smp handling all that

#

they got folia though

young knoll
#

Presumably I can just dig down and then freecam

grand flint
#

that must help a lot with the world

grand flint
#

its more for like elytra

vast ledge
grand flint
#

or horses

grand flint
#

isnt that like the entire purpose of folia

vast ledge
#

Missed the folia message

grand flint
#

thats kinda smart though

pseudo hazel
grand flint
#

prople cant just run around finding bases

#

u gotta memorize every single bedrock in the world

#

to find them

grand flint
#

i do wonder what 20k people do on donut smp

#

surely half of them is afk players

#

there is way more afk servers than smp servers

vast ledge
pseudo hazel
#

well idk wtf donut smp is so that was a misunderstanding on my part

#

anyways im not dying on this hill

young knoll
#

You canโ€™t load half a chunk

#

Well I guess you could but ehh

#

But you can fairly easily send half a chunk to clients

lilac dagger
#

Chunks are split in slices as far as I remember

pseudo hazel
#

i was confused with generating vs loading

vast ledge
#

Happens to the best

young knoll
#

I guess an even better way would be to directly implement vertical view distance in ChunkMap

thorn isle
#

that's one of the parts in nms i refuse to touch with a ten foot pole because spottedleaf made an absolute mess of it

#

in paper at least

young knoll
#

Well yeah paper uses moonrise

#

Itโ€™s not really nms at that point

hollow haven
#

Sooo. I'm really struggling with potions and such in spigot.

I'm trying to make a menu to select an effect, and all of that's easy to display by iterating through the registry of potioneffecttypes, but... I can't seem to be able to get a name or id of the potion. getName() is depracated and points to getKey()... which is also deprecated and points to getKeyOrThrow()... which plain doesn't work. Whenever the code is exscuted on server, it says "method does not exist" or similar

rotund ravine
#

?nocode

undone axleBOT
#

Itโ€™s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.

hollow haven
# rotund ravine ?nocode
for (PotionEffectType potion_type : Registry.EFFECT) {
            ItemStack potion = new ItemStack(Material.POTION);
            PotionMeta potion_meta = (PotionMeta) potion.getItemMeta();
            if (potion_meta != null) {
                potion_meta.setDisplayName("&" + potion_type.getColor().asRGB() + potion_type.getKeyOrThrow().getKey());
                potion_meta.setColor(potion_type.getColor());
                potion.setItemMeta(potion_meta);
            }
            pane.addItem(new GuiItem(potion, (event) -> {
                effect.setPotionEffect(potion_type);
                PotionEffectMenu gui = new PotionEffectMenu(effect);
                gui.show(viewer);
            }));
        }

Error:

java.lang.NoSuchMethodError: 'org.bukkit.NamespacedKey org.bukkit.potion.PotionEffectType.getKeyOrThrow()'
chrome beacon
hollow haven
chrome beacon
hollow haven
chrome beacon
#

Test on Spigot

eternal night
#

paper does not support that ^

#

if you are coding for 1.21.4 or later, paper hardforked there. So develop against the API you are using or switch to spigot

hollow haven
chrome beacon
#

Time for multimodule hackery

#

(or reflection)

eternal night
#

Yea probably easier than mapping everything manually

hollow haven
#

Is it lol? It's just 33 or so strings. 1 hashmap, and I have what I want

#

I haven't messed with reflection

eternal night
#

33 or so strings this version

#

next version, one might be added, one might be renamed, another removed

#

the version after, 3 renames

#

who knows

hollow haven
#

Haven't had the need to

eternal night
#

The general idea is that you create a bunch of interfaces that abstract your API dependant logic and then have a module imeplementing them via spigot API and one implementing them via paper API

hollow haven
#

Mmmm....

#

So I'd have to redo a lot, no? For stuff that already uses spigot?

eternal night
#

Well no, only the bits that are not the same between spigot and paper

hollow haven
#

Gotcha. I'll see what I can come up with, but, still sucks =v=

#

Don't get the point of hard forking such a like, random thing

eternal night
#

I mean, that commit was just after paper hardforked

#

so it just naturally did not get pulled anymore

#

wasn't like actively removed

hollow haven
#

I see. I'm not up to date on differences or, whatever has been going on. I just know a majority uses paper, but I code for spigot

#

Is there any code I could reference for a like, proper spigot/paper multimodule implementation? I get making an interface to abstract it, but it'd still be nice to see

eternal night
#
interface ServerAPIBridge {
    String getPotionEffectTypeName(PotionEffectType potionEffectType);
}

class PaperAPIBridge implements ServerAPIBridge {

    @Override
    public String getPotionEffectTypeName(final PotionEffectType potionEffectType) {
        return PlainTextComponentSerializer.plainText().serialize(Component.translatable(potionEffectType));
    }
}

class SpigotAPIBridge implements ServerAPIBridge {

    @Override
    public String getPotionEffectTypeName(final PotionEffectType potionEffectType) {
        return potionEffectType.getKeyOrThrow().getKey().replaceAll("_", " ");
    }
}
#

this would be like "the idea"

#

idk if spigot exposes a way to translate the potion effects translation key

#

you'd have them in separate modules (either maven or gradle) so that one of them can depend on the spigot-api, the other on the paper-api

#

you shade them into your final jar

#

and then instanciate the correct bridge depending on the server you run

#

so like ServerAPIBridge bridge = amIOnSpigot() ? new SpigotAPIBridge() : new PaperAPIBridge()

slender elbow
eternal night
# slender elbow thats so much code, can you summarise it?

Sure! Here's a super simple explanation for someone who doesn't know anything about coding:

This code is like a translator that helps get the name of a potion effect (like "Speed" or "Invisibility") in Minecraft, but how it does that depends on what kind of Minecraft server you're using.

There are two kinds of servers here:

Paper server โ€“ This one uses fancy text formatting tools to get the name of the potion effect.

Spigot server โ€“ This one just grabs the potion effect's name and replaces any underscores (like in "WATER_BREATHING") with spaces so it looks nicer (like "WATER BREATHING").

In both cases, the goal is the same: give you a readable name for a potion effect. The way it gets that name just depends on whether the server is Paper or Spigot.

hollow haven
eternal night
#

Well, you cannot do that nicely in the same module

#

the spigot and paper dependencies will clash

hollow haven
#

Urhhahuhnnm

#

๐Ÿ’ฅ

#

So much effort to just get potion names ;c

eternal night
#

I mean yea, you are basically developing a plugin for two different server softwares

hollow haven
#

Aye...

#

I'll have to do more research on this

#

For now, my map will work

#

But like

eternal night
#

fair enough

hollow haven
#

Deffo have to fiddle with this

eternal night
#

Yea, especially given every day spigot and paper merge API, they drift apart further

hollow haven
#

Hoped there was some example project I could see to like

slender elbow
#

like in that movie

#

where they drive into the sunset or something

hollow haven
#

Tear it apart and see

eternal night
slender elbow
#

speedy and angry or whatever

eternal night
#

๐ŸŽถ its been a long daaaaaaaaay, without you my friend ๐ŸŽถ

hollow haven
#

:'c

slender elbow
#

literally paper and spigot

eternal night
eternal night
worldly ingot
#

It's pissing me off

buoyant viper
#

what do the memory footprints of BigDec and BigInt look like

#

still trying to decide how i want to do currency, bc i could just use like... long and have more room for currency than ill ever need (bc id probably cap at max int lol), but ik BigDecimal is also made to handle arithmetic like that that needs low (basically 0) margin of error

eternal night
#

depends if you need decimal points xD

#

useless to have a BigDecimal if you only give out gold coins

buoyant viper
#

if it was just single, whole coins id def just use int or long depending on what i wanted max bal to be

eternal night
#

Then yea Def go with big decimal

#

It's memory footprint is miniml

buoyant viper
#

yee

buoyant viper
#

ah, fuck, i gotta figure out how to [de]serialize BD

thorn isle
#

personally i'd just toString it and then use the string constructor, unless you specifically want to serialize it as binary

#

much nicer to work with in databases and such

buoyant viper
thorn isle
#

string is nicer

#

binary isn't human readable, but is more compact

young knoll
#

You canโ€™t sight read binary?

#

Pfft

buoyant viper
eternal night
#

crydeath object streams

buoyant viper
#

ill have to test when i get home what that data looks like

eternal night
#

but like, big decimal is a big int and a precision int (well and scale)

#

fwiw, sql just toString()s it

buoyant viper
#

ObjectOutputStream(ByteArrayOutputStream())
base64 encode the byte array
write base64 string to DB

slender elbow
#

Object stream is :( because it has terrible space efficiency

buoyant viper
#

itll be fiiinneeee

eternal night
#

pretty sure it is like

#

objectively worse than just #toString lol

buoyant viper
#

oh it 100% would be

buoyant viper
sly topaz
#

is there a reason you aren't just using some existing economy plugin

buoyant viper
#

i like reinventing the wheel

sly topaz
#

fair enough

buoyant viper
#

and i hate myself just enough to do it

sly topaz
#

make sure to make all the method return completable futures because brr database operations

#

either that or setup a cache so that the get methods return from cache and then have retrieval methods or something

buoyant viper
#

yeah i planned on lazy saving

#

like plugin shutdown or something

#

n loading would be (blocking?) from DB if exists beforehand

sly topaz
#

me when the server crashes and I had just made a million vbucks transaction so my money is just lost in the cache:

young knoll
#

Ew blocking

sly topaz
young knoll
#

What if my database is on the moon

buoyant viper
#

i hope u got Fiber

sly topaz
#

I would have 3 levels of persistence

quaint mantle
#

Just use sqlite at this point ๐Ÿ˜ญ

sly topaz
#

I would have a sqlite database for local persistence and then another database on top for network-wide operations

young knoll
#

But then I canโ€™t put it on the moon!

buoyant viper
#

i could have a periodic save that then also has a master save at the end of life

#

or i could set up async transacting

#

idk

sly topaz
#

I would recommend first try to figure out the infrastructure and the scope before going into the code

#

are you going to use a database, if so an embedded one like sqlite or something like postgres? Is it going to be necessary to worry about cross-server synchronization and if so, should you offer a way to hook into a distributed cache like valkey or hazelcast? Or just use a messaging pub/sub on something like RabbitMQ?

#

once you figure out these questions, then the design for the plugin itself should be more clear

#

not that these are the only concerns, but usually the primary ones, cache, persistence and synchronization methodology

buoyant viper
#

hmm

#

i wont need to cross-sync balances between servers (itll just be a single mc serv) but i would like support for off-site databasing

buoyant viper
#

hell im still trying to figure out the data type i want to store the balance as LOL

#

this is part of a big update for my smp that im not even expecting to roll out until next year

buoyant viper
#

i guess possible synchronization issues aside, does it at least look like a good way of structuring? @sly topaz

sly topaz
buoyant viper
#

yippee

uneven hinge
rotund ravine
#

I am now sharing the plugin ๐Ÿ‘Œ๐Ÿป

#

Tbf canโ€™t even rmbr what it was

#

Oh

#

This one

rotund ravine
#

I cba to go look at the whole thing

uneven hinge
#

Like what do i do with them

rotund ravine
#

What did u do with them so far?

sly topaz
#

how are you terminating the game? Just using the terminate command on the arena?

uneven hinge
#

like if x and y are playing a game and z has permission to run /terminate he can terminate the match of x or y from the lobby

sly topaz
#

Yeah but what I mean is, how did you test the reset logic

uneven hinge
sly topaz
# uneven hinge Why should it? My world isn't null

I don't know, but it is one of the few places where there's just a return and no output so if it happened to be the case and you wouldn't know then I would guess it might be there. Your logic looks solid as well so it doesn't smell like an issue with the plugin itself

#

if you want to know for sure, use a debugger. Should be easy to setup

uneven hinge
#

in plugin.yml

sly topaz
#

oh, is there any chance spleef_arena world is the main world?

sly topaz
#

yeah no then just check with a debugger, my guess it is on the readWolrd returning null for whatever reason

uneven hinge
#

I never added it lol

sly topaz
# uneven hinge Can you tell me how do i add a debuger?

create a Remote JVM debug configuration in IntelliJ, copy the cmdline flags it shows you in the window, then put it in your test server's start script (make sure it is before the -jar flag). After that you can start your server and hit the debug button in IJ to start the debugger

uneven hinge
#

Alright thanks

sly topaz
#

oh, also make sure to edit your timeout-time in the spigot.yml so that it doesn't automatically crash the server after 60 seconds of suspension (will happen when you hit breakpoints)

sly topaz
uneven hinge
#

alright thanks

robust helm
#

any reason to use the bukkit schedular instead of CompletableFuture.runAsync for async stuff, aside from being able to cancel the bukkit stuff when the plugin shuts down?

lilac dagger
#

personally using completablefutures or executors nowdays in everything

slender elbow
#

they are not mutually exclusive, you can use them in conjunction

#

you can even use CompletableFuture.runAsync to run something on the main thread

lilac dagger
#

yeah, it depends on what you need them for

slender elbow
robust helm
#

sooo many weird terms

#

time for chatgpt

slender elbow
#

good to know that you don't value your own time lol

young knoll
#

Bukkit has a method to run something in the main thread

#

But it returns a future not a CompletableFuture

#

:(

thorn isle
#
CompletableFuture.supplyAsync(My::method, (task) -> Bukkit.getScheduler().runTask(plugin, task))

or if you're on paper,

CompletableFuture.supplyAsync(My::method, Bukkit.getMainThreadExecutor(plugin))
#

both work about equivalently

#

runasync without an executor parameter goes onto the common fork join pool, which, unlike the bukkit async scheduler thread pool, is bounded

#

this is generally better, as you won't end up blitzing through 500 threads

echo basalt
#

That main thread executor is not blocking

slender elbow
#

it just pipes the runnable to runTask

#

why would it be blocking? the whole point of executors is asynchronicity lol

echo basalt
#

Eating rn I'll give an example in a bit

#

In short, race conditions

slender elbow
#

๐Ÿคจ

echo basalt
#

In the case of futures it might not matter as much, depending on abstraction but for general tasks it might:

Let's say you have 2 impls of the executor

Non-blocking: (task) -> scheduler.runTask(plugin, task)
blocking: (task) -> lock -> scheduler.runTask(plugin, () -> {task(), unlock})

slender elbow
#

why on earth would you do that lmao

#

under that definition, every executor that isn't Runnable::run is non-blocking

#

which is a good thing

echo basalt
#

async -> sync -> async without callback hell

slender elbow
#

???

#
CF.runAsync(() -> not main thread)
  .thenRunAsync(() -> main thread, mainExecutor)
  .thenRunAsync(() -> not main thread)

runs perfectly as expected

#

let me reword that

#

skewing the definition of "sync" and "async"

#

the whole pipeline is async

echo basalt
#

yeah the more I think about this the more I think I'm stupid holup

slender elbow
#

the last runnable does not start all the way until the second runnable finishes

echo basalt
#

yeah my stupid ass thought the second runnable finishes when the executor.run finishes running

#

instead of just running a wrapper task that finishes after the scheduled runnable is actually called

slender elbow
#

you should be using reactive streams anyway :chatting:

echo basalt
#

15yo me felt so smart back then

thorn isle
#

you can also pass data and exceptions from a future to its dependents, e.g.

world.getChunkAtAsync(x,z)
    .thenApplyAsync(chunk::getSnapshot, mainExecutor)
    .thenApplyAsync(Skyblock::countBlockValueInChunk)
    .thenAcceptAsync((Double value) -> islandManager.updateChunkValue(x,z,value), islandSingleThreadExecutor)
#

here we schedule the chunk load from the caller thread, then once it loads, we dip to the server thread to extract the chunk snapshot, then we iterate over the blocks or whatever on the common pool, and finally we go to the plugin's own executor thread to update the data for the island

slender elbow
#

.thenApplyAsync(chunk::getSnapshot, mainExecutor) :(

thorn isle
#

passing the main executor here is required if you call getChunk off-main, since if the chunk is already loaded, the future will be returned completed and you end up calling getSnapshot off-main which is haram

slender elbow
#

the previous future already completes on the server thread, plus it will remove the load ticket immediately after the callback so there is a chance for the chunk to unload between the rescheduling of the task and the getSnapshot call

#

causing a sync load :(

thorn isle
#

the behavior may have changed since 1.18, but at least back then, if you called getChunkAtAsync on a chunk that's already loaded, it returns a future that's already complete

#

and calling thenAccept on a future that's already complete runs the task on the caller thread

#

i.e. off main

slender elbow
#

idk about back then but today if the method is called off main, it will recall itself on main

#

so it always completes on main

thorn isle
#

neat

#

it was kind of ass before precisely because of that opportunity for the chunk to unload in between

#

although even then that's kind of racy now that i think about it

#

if the main thread completes the future in between you making the getChunk call and the thenAccept call, the task will run on the caller thread and not on the main thread

#

considering how long the server usually takes to get to its polls that is probably very unlikely to happen, but there's no guarantee for it not to happen

#

so passing the main executor is still mandatory in principle

slender elbow
#

alternatively use the Consumer method :) (or just call getChunkAtAsync from the main thread)

uneven hinge
#

and checkec without debugger and added some syouts but still isnt getting called

wet breach
#

so call your method ๐Ÿ™‚

#

seems like an easy fix

uneven hinge
#

..

fresh merlin
#

Bro my ajleaderboard plugin stops working when I restart server and after putting another ajleaderboard plugin it works smoothly but as soon as I restart server it stops

clear elm
#

Hey, is there any API with its help i can get the Skull of offline player becuase the bukkit version dont works for me

thorn isle
slender elbow
#

yeah i mean there isn't really a 100000% safe way if you call it off main and the future for whatever reason completes before you get to append to it, like glhf

#

at least not one that doesn't involve more hacks

#

CF.supplyAsync(() -> world.getChunkAtAsync(cx, cz), mainExecutor).thenCompose(Function.identity()) :nodders:

#

also it does look like in 1.18 it rescheduled back to main too

thorn isle
#

i think it was before the moonrise nonsense

#

or it could be that i misremember

slender elbow
#

yeah moonrise wasn't a thing in 1.18

#

it's fairly recent

#

wow 1.21, that recent

thorn isle
#

i just vaguely remember digging into chunkmap or something and seeing it return CompletableFuture.completedFuture() with the chunk if it was already loaded

#

which i mean is valid behavior and kind of preferable to scheduling a task to an executor to return an already loaded chunk

#

but as of moonrise i have completely given up making any manner of informed assumptions about how the chunk system works

wet breach
# uneven hinge ..

to better aide in debugging, create a new parameter for your arena's to identify them all in your lists. IE an id of some sort that increments. Anytime anything happens in one of these arena instances, have it output its id and what its doing

uneven hinge
#

are u sure that my dumb brain would understand

wet breach
#

Well, I have a feeling that either it is an instance problem where things are not being applied to the appropriate instances or you have more then one manager instance which is causing the issues since you have no guard on ensuring only a single instance of the managers

thorn isle
wet breach
#

debugger should show the managers issue if that was the case, but it wouldn't help with the arena instance issue hence needing a way to identify them since you can have duplicate arena's

clear elm
#

How can i get offline Players skull?

undone canyon
#

Hello, please tell me how to request this package and what the parameters should look like.
Packet 0x05 version 1.19.2

chrome beacon
#

?protocol

undone axleBOT
chrome beacon
#

Take a look at the wiki ^^

clear elm
#

idk

#

i have tried everything and i dont works for offline players

#
import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.SkullMeta;

import java.util.UUID;

public class PlayerHead {
    public static ItemStack getPlayerHead(UUID playerUUID) {
        ItemStack skull = new ItemStack(Material.PLAYER_HEAD);
        SkullMeta meta = (SkullMeta) skull.getItemMeta();
        meta.setOwningPlayer(Bukkit.getOfflinePlayer(playerUUID));
        skull.setItemMeta(meta);
        return skull;
    }
}

i had this code and it didnt work

#

If the player is offline i get a basic head like steve or alex

#

@chrome beacon

chrome beacon
#

I see

clear elm
#

will this work for sure?

chrome beacon
#

if it doesn't work directly call update on the profile first

#

should cause it to look up data from mojang

clear elm
pseudo hazel
#

have you checked that the offline player is actually a valid player with valid uuid

clear elm
#

yes becuase when the player is online it loads his actul skin

pseudo hazel
#

hmm okay then

#

yeha then try the profile method

clear elm
#

@chrome beacon

crimson agate
#

Do you guys recommend using mojang or spigot mappings? When I would use mojang I would compile against spigot. What is more usefull to know? Since the names change depending on what I use.

#

I am new to nms. I know how it works, but I am new to reading the actual src code and understanding what each method does what I want to do

thorn isle
#

mojang mappings

#

spigot names are kind of eyeballed and not very good

young knoll
#

We also don't have names for most things anymore

left knoll
#

Hi

#

I need help with Net Safari Plugin

chrome beacon
#

and

#

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

buoyant viper
#

dumb question, but can a player receive potion effects while theyre dead?

#

id like to blind a player while theyre dead but idk if theyll receive the effect

nova notch
#

I'd imagine no because dead players just don't even exist iirc

#

try it and see

hybrid spoke
buoyant viper
crimson agate
# thorn isle mojang mappings

Do I have to do anything else other than just using the mappings? Like some special arguments to convert back into spigot for building

#

I use gradle

nova notch
# hybrid spoke why wouldnt they exist?

Because when a player dies it doesn't just like set the state of the player entity to dead or anything, the player entity gets removed from the world entirely

chrome beacon
hybrid spoke
crimson agate
#

Where do I find mojang remapped sources? Intellij doesn't index correctly, and I can't fined the sources.jar in plain spigot folder either. I have activated "generate sources" in buildtools though

nova notch
#

mojang strikes again

crimson agate
#

Do I have to use SpecialSource

young knoll
#

Yes

sly topaz
#

One thing you could try to do is manually compiling spigot with sources and then attaching the given source jar to IJ

abstract totem
#

is there an easy way to spawn a FireworkEffect as a clientside one or one that does no damage/knockback without having to catch the EntityDamageEvent?

sly topaz
#

as for the question itself, I don't think so, no

#

at least not without using internals

buoyant viper
#

i forget what u need crafting-wise, but people do make "rocket launchers" using fireworks as crossbow ammo

young knoll
#

Any firework with a firework star

#

If you just use paper and gunpowder you donโ€™t get a bang

slender elbow
#

sir, this is spigot

young knoll
#

Iโ€™m going to attach you to a firework khajiit

torn shuttle
#

๐Ÿคก we like having fun here

#

that's the new claude ai, opus 4.1

#

guess I'm not buying that 200/mo sub

mortal vortex
#

its also PAYG too

torn shuttle
#

oh man what an annoying new strat

#

I'm getting discord bots that just post images

#

for scams

buoyant viper
#

?jd-s

undone axleBOT
buoyant viper
#

?stash

undone axleBOT
hexed robin
#

is there a documentation of the bungeecord protocol?
what specifically does the bungeecord say to the server?
Does it simply forward or it does something else?

sullen marlin
#

Yes it just forwards packets, there's no special protocol

#

The only difference is it uses the hostname field of the login packet for IP forwarding if enabled

#

Otherwise it's 100% Vanilla

hexed robin
#

Ah, I so just act as a client then in bungeecord for the spigot server? (replacing the ip if forward is enabled etc)

sullen marlin
#

Yes

hexed robin
#

Thanks a lot!

grand flint
torn shuttle
#

hmmmm

#

if I have a component in a class that gets extended, is it cleaner if the children access that directly or if the parent exposes methods from the component

drowsy helm
#

Really depends on what the component is and whether itโ€™s methods need to be monitored

torn shuttle
#

yeah for my models project that is primarily meant to be used as an api/library I went with the more verbose but easier to access route

#

but man it's a pain

#

also if you put actual functionality in there, then forget about it and bypass it you're in a world of hurt

tall dome
#

Hi!
I see that libraries section of plugin.yml is marked as preview
Is it possible to enable it in a server and if not, which version will it be available from?

I spent a lot of time automating it and now I noticed it doesn't even work ;-;

chrome beacon
#

not sure where you found it marked as preview ๐Ÿคทโ€โ™‚๏ธ

chrome beacon
#

I see

#

It's not marked as preview in the javadoc so ๐Ÿคทโ€โ™‚๏ธ

tall dome
#

I sees, ty ^.^

#

Does it download libraries into ./libraries? I didn't see my declared libraries there on 1.21.4

pseudo hazel
#

that article is outdated

chrome beacon
#

anyways it works fine

#

you can use it

pseudo hazel
#

I think instead of using the plugin.yml you would usually just use the build system to declare the libraries right?

tall dome
#

I was looking in the wrong folder >.<

tall dome
chrome beacon
#

I was going off memory I could be wrong

#

check the changelog on spigotmc

tall dome
#

okie

pseudo hazel
#

oh i see

chrome beacon
#

right just to make sure the library you're trying to use is on maven central?

cosmic arch
#

Hey, I'm trying to work with packets in PAPER 1.21.8 using ProtocolLib. My goal is to change the yaw/pitch of a player (using packets). Whatever I tried, it either resulted in nothing happening or causing errors.
Could someone that has a little expertise in packet-related code join me in a call and show me so I can do these kind of things on my own.

wooden bay
#

Paper?

cosmic arch
#

Are you able to help me @wooden bay

pseudo hazel
#

maybe ask in the paper server?

#

?whereami

cosmic arch
pseudo hazel
#

idk

#

that depends on the problem

cosmic arch
#

bruh

pseudo hazel
#

but then let me pose another question

#

why not ask protocolib for help

cosmic arch
pseudo hazel
#

no

#

wdym

cosmic arch
#

It's a plugin, open source, I haven't really heard of any community where you can get support for this kind of stuff

pseudo hazel
#

is there no support for it?

cosmic arch
#

Packets, nms etc

pseudo hazel
#

that means its not a very good project then

wooden bay
#

Use packetevents

pseudo hazel
#

you get support for spigot, which is also free

cosmic arch
cosmic arch
pseudo hazel
#

yeah packetevents has help channels

cosmic arch
#

Alr, i'll look into it

potent crescent
#

how to upload image

grand flint
potent crescent
#

alr thx

grizzled lion
#

Do you guy know how to download the Bukkit referenced lib?

thorn isle
#

the what now

pseudo hazel
#

sounds like a gpt dream

echo basalt
#

Does anyone have code for calculating the width of a component?

#

I stole radsteve's but it's brokey and he gave up on the industry

remote swallow
#

adventure component or bungee

slender elbow
#

yes

remote swallow
#

for adventure id just say plaintext serialize it and length (probably wont work if you use client side translatables) and for bungee, convert to adventure components and do that step

slender elbow
#

bold and stuff changes the width

remote swallow
#

ah

#

i kinda yolo'd that kekw

thorn isle
#

Bold makes the text block 1 pixel wider

twin venture
#

hi , when will new resources be aprvoed?

#

its been like from friday ๐Ÿ˜›

chrome beacon
#

soon(tm)

buoyant viper
#

eventually

grand flint
#

premium resources?

#

can u post a premium server software?

twin venture
buoyant viper
grand flint
#

can we post a paper fork as a premium resource on spigot LMAO

buoyant viper
#

forum account ban speedrun any%

fleet pier
#

is it possible in spigot 1.8.9 to open a villager inventory with custom things to buy?

#

i see there is the InventoryType.MERCHANT but does it actually work?
how would i add items and what they cost

buoyant viper
#

try looking around in that inventory @fleet pier

fleet pier
#

oop

#

thank you thank you

buoyant viper
#

today i will do blocking IO for SQL queries

grand flint
#

hannah

young knoll
#

Premium resources must be plugins

fleet pier
#

so i guess its a normal inv?