#help-development

1 messages · Page 1197 of 1

sly topaz
#

if the player's body could move with the car, it'd be perfect

young knoll
#

You can even see the normal vectors on the triangles

sly topaz
#

though I guess they'll just hide the player when it is completed

young knoll
#

I wish Mojang would give us full rotation for the player

#

And the camera

blazing ocean
#

and then move the camera marker

young knoll
#

Yeah but you can't roll the camera

#

only pitch and yaw

blazing ocean
#

hmm

young knoll
#

Tho I did see some fancy shader that allowed some roll

sly topaz
#

that'd look funny in 3rd person

#

just a player putting their head upside down

blazing ocean
sly topaz
#

that's a name

blazing ocean
#

I couldn't remember the name

#

Josh knows right

sly topaz
#

I thought it was just a long ass acronym lol

young knoll
#

Yeah I know who you mean

#

lol

hybrid spoke
blazing ocean
#

you what

hybrid spoke
#

there once was this guy with a christmas hitler pp, reminded me of him lol

#

this guy

ebon topaz
#

I’ll go for this approach I suppose,
My purpose for this is a server that I have with my friends and there isn’t any good custom food plugins so I decided to make my own so I’m adding a bunch of custom foods with item textures made by some artists

#

And possibly custom crops down the line

eternal oxide
#

I liked NNY. he was funny

#

So many ban evasions. He was the guy who refused to die.

blazing ocean
#

@shadow night are you seeing this

hybrid spoke
#

but other than that a cool dude

eternal oxide
#

yep

drowsy helm
#

Yo @torn shuttle where do you do the pathfinding stuff in elitemobs I want to copy you

#

It’s all proprietary right

shadow night
torn shuttle
#

which is definitely not hosted and maintained on github

#

and if you touch it you owe me 1 mil

drowsy helm
#

I’ll hack the mainframe and steal it real quick

blazing ocean
woeful quartz
#

Plz update the auctionhouse plugin from 1.20.4 to 1.21.4

ebon topaz
heady birch
#

hey

cedar saffron
#

@molten hearth @rough drift go update it NOW

grim hound
#

Can you change how command input looks like with a resource pack?

orchid trout
#

how about you check

blazing ocean
#

you could try shaders but I don't think the commands have a seperate depth from chat

grim hound
#

I mean the client's own input

#

Like a different font

#

(for example)

blazing ocean
#

You can change the font for the entire game

#

but not a specific part

grim hound
#

What about: if the client starts typing /do some stuff
It'd look like /do different word?

blazing ocean
#

what

grim hound
#

Like replacing characters with different existing characters but

#

only visually

blazing ocean
#

not programatically and commands only

grim hound
#

When typing a command

blazing ocean
#

you could go through the pain of studying GLSL and minecraft's text renderer and then doing that for the entire game but yeah no

#

what the fuck is the xy tho

grim hound
#

Not gonna say

#

Cuz fuckin "offline mode not supported" mfos

blazing ocean
#

oh you use offline mode

wooden frost
#

Is it possible to reset every attribute of a player(maybe using a method/itterating)?
(i did try to do it but it didn't work, because i guess it couldn't get the default value?)

marsh sluice
#

how can i make a way to go to different servers or worlds in one singular world? i wanna be able to do /server build to have a build server to make maps and arenas and stuff like that

remote swallow
#

bungeecord

jagged bobcat
soft flame
#

I need help, this code doesnt work and idk why

        try {
            UUID fakeUUID = UUID.randomUUID();
            WrappedGameProfile fakeProfile = new WrappedGameProfile(fakeUUID, fakePlayerName);

            PacketContainer packet = Minerium.getInstance().getProtocolManager().createPacket(PacketType.Play.Server.PLAYER_INFO);

            packet.getPlayerInfoActions().write(0, EnumSet.of(com.comphenix.protocol.wrappers.EnumWrappers.PlayerInfoAction.ADD_PLAYER));

            PlayerInfoData playerInfoData = new PlayerInfoData(fakeProfile, 1, EnumWrappers.NativeGameMode.SURVIVAL, WrappedChatComponent.fromText("Fake Player"));

            packet.getPlayerInfoDataLists().write(0, Collections.singletonList(playerInfoData));

            Minerium.getInstance().getProtocolManager().sendServerPacket(receiver, packet);

            Bukkit.getLogger().info("Fake player added to tablist: " + fakePlayerName);

        } catch (Exception e) {
            e.printStackTrace();
        }
    }```
#

This code uses protocollib 5.3.0 mc version 1.21.4

sly topaz
wraith delta
#

Is Frost walker enchant part of leaf decay? Or some event that can be cancelled.
When I use it, the ice won’t go away.

sly topaz
cunning solstice
#

i kinda wonder if it's possible to use mixins in a PLUGIN

chrome beacon
sly topaz
#

there are various mixin loaders for spigot nowadays, ignite is the most popular one

chrome beacon
#

Do note that it needs to bootstrap the server

wraith delta
sly topaz
#

people don't usually use them because of that reason

chrome beacon
#

since it has to load before everything else

sly topaz
blazing ocean
sly topaz
#

well, just print the handlers

sly topaz
blazing ocean
#

Yeah I agree that mixins are really nice for quick stuff

#

like for a fork you need to edit, rebuild patches, publish, pull, change your server jar

cunning solstice
blazing ocean
#

no

sly topaz
cunning solstice
#

tbh i want to make a vanilla mc server using plugins

#

but like

#

im more addicted to forge modding

#

xd

#

so that's why im asking if it's possible to create plugin like a mod but in vanilla mc

sly topaz
#

I mean, there's no reason you couldn't use forge/fabric instead of spigot for a server and just use their API instead

#

as long as you don't add anything to the client-side, it'd still be just as vanilla as spigot

#

plugins are just server-side mods for that matter

#

well, I should be more clear, "as long as everything you do adheres to the vanilla protocol" is a better way to word that

cunning solstice
#

im a bit confused but i feel like that means i join vanilla minecraft client (minecraft launcher), into fabric server if my mod is SERVER only

#

i'd rather have plugin server instead of modded one :/

sly topaz
#

I don't get what you want honestly lol

cunning solstice
#

(spigot plugin)

sly topaz
#

what for

cunning solstice
sly topaz
#

that isn't very specific

#

what functionality is spigot's API missing that you require of a mixin

cunning solstice
sly topaz
#

there is no reason to have a mixin if the API supports it, is what I am trying to get at

#

same goes for fabric and forge really

cunning solstice
#

oh

#

i kinda wanted to make features that's not possible in spigot

cunning solstice
woeful quartz
#

auction house

cunning solstice
#

i meant

#

send me plugin link

woeful quartz
woeful quartz
cunning solstice
#

if this 1

woeful quartz
#

yes\

cunning solstice
#

you should ask author

woeful quartz
#

who is author

cunning solstice
#

:/

#

i can't say it here

woeful quartz
#

why

cunning solstice
#

but it's at right side of plugin page

#

i was trying to find his media on his resources but i think he has none

#

only yt

woeful quartz
#

yes i know is name now but how do i contact him

molten hearth
#

Please report all issues by starting a conversation. If you post in the discussion forum, it may get overlooked as we are getting more discussion now.

mortal hare
#

i wonder in pure Entity-Component system, how would you represent a minecraft block? is it an Entity, is it something else

#

i mean it does have collision

#

so it must have CollisionComponent so it must be Entity

#

im pretty sure if mojang implemented pure Entity-Component system it would destroy both the tickrate and the fps

#

at the same time how would you represent the World mesh

chrome beacon
#

I wouldn't make all blocks entities

#

There's no point in doing so?

mortal hare
#

but that's not pure ECS anymore

#

in pure ECS even a block should be Entity

chrome beacon
#

Just because you have an ECS does not mean everything needs to be in it

mortal hare
#

since it has specific attributes to it

river oracle
#

Blocks aren't entities

#

Therefore aren't in ECS

mortal hare
#

why not

river oracle
#

If you put them in your ECS I believe you'd be making the BDCS (brain dead component system)

mortal hare
#

we have tile entities in minecraft

#

so they can be entities

river oracle
#

Imagine the lag if every block is a tile entity kekw

mortal hare
#

i know

#

the main difference in mojang's entities and ECS entities, is that they have tick() method

#

meanwhile in pure ECS you would have Tickable Component

river oracle
#

Is it really an Entity component system then because such entities would be inanimate thus not entities

mortal hare
#

like water

#

or has certain features like damaging player on touch

river oracle
#

That'd be client sided rendering so it'd be silly to include it

#

Graphics can handle that

mortal hare
#

I mean in theory minecraft can use Flyweight design pattern where they would represent everything in world in compressed and optimized blob, but accessing that particular data it would expose it under proxy object which represents as an ECS entity

#

World.getEntity(): Entity

Entity.hasComponent(Living.class)
Entity.hasComponent(Static.class)

river oracle
#

Then it's just a component system and not really an ECS because not everything is an entity thus not everything is ECS

#

You can't make everything an entity either things such as world generation and rendering are largely inanimate

#

They have no life in of themselves

mortal hare
#

World Generation and Rendering are Systems

#

Blocks, and living mobs can be Entities with certain components

#

World would be a blob container for entities

river oracle
#

But blocks aren't mostly alive or animate

mortal hare
#

but they can be

river oracle
#

I feel like you're stretching the meaning of entity

blazing ocean
#

have you considered not making an ecs

river oracle
#

If you're going to add components like this to everything it's nolonger anything to do with entities

#

Infact the components meanings are largely devoid of entities

river oracle
#

Petty sure Ike is making something too lol

split tinsel
#

is there a way to check if a player has their inventory open, like for this code i need to be able to stop players removing items from their offhand slot, which has id 40, however id 40 can also be a slot in a double chest

package io.github.mrnameless666.vanillaPlusEngine.listener;

import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.inventory.InventoryClickEvent;

public class InventoryClickListener implements Listener {
    @EventHandler
    public void onInventoryClick(InventoryClickEvent event) {
            event.setCancelled(true);
    }
}
lilac dagger
#

player.getOpenInventory().getTopInventory() == bottom

sly topaz
lilac dagger
#

or something like that

sly topaz
lilac dagger
#

it depends how you use the first part

#

player.getOpenInventory().getBottomInventory() is always the player inv

#

ah nvm

#

i see what you mean

mellow edge
#

what is always executed first (no matter the event priority): EntityDamageByEntityEvent or EntityDamageEvent? I THINK it is EntityDamageByEntityEvent but I am not sure.

lilac dagger
#

EntityDamageByEntityEvent extends EnityDamage no?

#

worth a test

mellow edge
#

yes it does

#

well it isn't written anywhere I could see

sly topaz
#

it doesn't have its own handlerlist, so it would be called at the same time

lilac dagger
#

but in which order

mellow edge
#

maybe the execution is still custom

sly topaz
lilac dagger
#

in a single thread there is an order

sly topaz
#

there is a single event being called

lilac dagger
#

ah hmm

sly topaz
#

and there being only one thread doesn't mean it can't be concurrent, all events are happening in a single (main) thread yet they're called simultaneously

mellow edge
#

but if it is a single thread how can they be called simultaneously, one is always called first

sly topaz
#

in this scenario, it is a single event instance so it doesn't matter

mellow edge
#

ok so you are telling me that if I put the EntityDamageByEntityEvent to the highest priority and EntityDamageEvent to the lowest, the EntityDamageEvent would always be called first because they share the handlers?

sly topaz
#

no, since the priority of the handlers are different

#

if there is no explicit priority definition, then they'd be called at about the same time (as long as they share the same Listener class)

mellow edge
#

yes if they have prio then the lowest is called, if they don't its random (or as you said concurrent?)

sly topaz
#

to make it clear, it is like having two handlers of the same event

lilac dagger
sly topaz
#

these two:

@EventHandler
public void onDamage(EntityDamageEvent e) {
  if (e instanceof EntityDamageByEntityEvent event) {
    /* do stuff */
  }
}

@EventHandler
public void onDamage(EntityDamageByEntityEvent event) {
      /* do stuff */
}

are the same

mellow edge
sly topaz
lilac dagger
#

they will be called at once

#

javier is right

mellow edge
#

so they are chosen by random and tolerated as the same event or what

lilac dagger
#

i think priority is also shared

sly topaz
#

what is your issue exactly, because I feel like we're going in circles

lilac dagger
#

he wants to see which one is called first

sly topaz
#

yeah but I assume that's for a reason and not just pure curiosity

lilac dagger
#

if order mathers priority for entitydamage event should be the same i think

mellow edge
#

well my issue is that I need to know the exact priority because I have a main trigger for player death events (custom made before a player would actually die), now I want to set the priority of some other EntityDamageByEntityEvent (it is not the same as the EntityDamageEvent below here!!!!) to always be executed first, thus if they share the priority I can simply set the EntityDamageByEntityEvent to lowest, otherwise I need to create EntityDamageEvent from it and cast it into EntityDamageByEntityEvent if possible

    @EventHandler(ignoreCancelled = true, priority = EventPriority.HIGHEST)
    public void mainDeathEvent(EntityDamageEvent e) {
        System.out.println("main death event! ");
        if(e.getEntity().getType() != EntityType.PLAYER) return;

        Player diedPlayer = (Player) e.getEntity();
        if (diedPlayer.getHealth() - e.getFinalDamage() > 0) return;
        GamePlayer GPDead = GameHandler.getGamePlayer(diedPlayer.getUniqueId());
        if(GPDead == null) return;

        e.setCancelled(true);

        Game game = GPDead.getGame();

        if(e instanceof EntityDamageByEntityEvent) {
            game.handlePlayerDeath(Game.DeathReason.KILLED_BY_DAMAGER, GPDead, diedPlayer, ((EntityDamageByEntityEvent) e).getDamager());
        } else {
            game.handlePlayerDeath(Game.DeathReason.DIED_PEACEFULLY, GPDead, diedPlayer, null);
        }
    }

lilac dagger
#

i looked here and i think handlerlist share priority for the same event with handlerlist

#

did you try setting a different priority for your entity damage events?

sly topaz
mellow edge
#

yes

#

exactly

#
    @EventHandler(priority = EventPriority.LOWEST)
    public void entityCustomDmg(EntityDamageByEntityEvent e) {```
sly topaz
#

you don't have to set it to lowest for that to work as mainDeathEvent handler has HIGHEST priority, meaning anything lower than that will work

#

but yes lowest would essentially work for your purpose

mellow edge
#

it must be at least LOW tho because of other other EntityDamageByEntityEvents

sly topaz
#

well, I am not aware of any other handlers you might have so that's up to you

#

if you want it to affect those other handlers as well then yes

mellow edge
#

idk ik what you meant so no problem

#

but rn I will try to change the priority now and test if that actually changes the priority because I want to be sure

#

yeah they do share the priority I flipped them for a bit

#

so in short: till now I tought EntityDamageEvent is called and then subevents but it turns out they are all simply called without any priority cause they share handlers

steady turtle
#

Does anyone know how to create a custom entity for 1.21, I've tried looking for examples but they are all for older versions with stuff that has been renamed?

blazing ocean
lilac dagger
#

lol 😄

undone axleBOT
chrome beacon
#

You can use this to look up old names ^^

steady turtle
#

do you know of any tutorials or guides or something?

chrome beacon
#

For what

#

Using the site?

steady turtle
#

for creating the basic structure of a custom entity (like what they all need)

chrome beacon
#

Old guides still work fine

steady turtle
#

ok

chrome beacon
#

The method of doing so hasn't changed

#

just the names of the calls but you can look that up using the link above

mellow edge
#

@lilac dagger @sly topaz thank you for help

lilac dagger
#

no problem, i hope i was of help

golden turret
#

i get this on a github action, but if i click on the maven.pkg.github.com link and authenticate, i can get the file normally. This is my workflow config and build.gradle.kts. I have another repo with the same workflow and it works fine. How can i fix this?

hard socket
#

is it preferd to use IntelliJ data sources to host my DB?

tall dragon
#

intellij data source to host your db?

#

pretty sure those are just to connect to your db

zealous scroll
#

Is there a way to edit the content of an already-sent message to a player's chat? Perhaps using the signing feature?

young knoll
#

You can delete it

#

But not edit it

earnest girder
#

When people add entities like TextDisplays and HumanPlayer NPCs to their servers, where do they put the code that spawns them in? How do I maintain entities that are meant to be permanent across server restarts?

Should I check if each entity is there on server start and spawn it in if it isnt?

pliant topaz
chrome beacon
twilit coral
rough drift
chrome beacon
#

A good approach is to save your entities in the chunk nbt and spawn them in the chunk load event

earnest girder
chrome beacon
#

Use set persistent instead

#

Prevents them from being saved in the first place

young knoll
rough drift
#

ah

scarlet jolt
#

I’m currently working on a plugin for my smp and I’m planning to connect it to my website, if anyone would like to help with my project please ping me

worldly ingot
remote swallow
#

so just get it

sonic goblet
#

Does PlayerInteractEvent not fire the RIGHT_CLICK_AIR Action if the player doesn't have an item in their hand?

young knoll
#

Correct

sonic goblet
umbral flint
#

Path pluginPath = InvisPractice.get().getDataFolder().toPath();

Why is this going outside the server directory

ivory sleet
#

have u tried printing it out?

#

or maybe u use it from another base dir or sth? (where toAbsolutePath() might help)

umbral flint
#

I'll try toAbsolutePath

ivory sleet
#

yuh like go to is just toPath() toAbsolutePath() and a nice normalize() does the trick on incoming paths

umbral flint
#
[19:46:08 INFO]: C:\Users\skinn\Documents\Development\MC Servers\invis-practice\plugins\invis-practice
[19:46:08 INFO]: C:\kits
Path pluginPath = InvisPractice.get().getDataFolder().toPath().toAbsolutePath().normalize();
System.out.println(pluginPath);
this.kitStoragePath = pluginPath.resolve("/kits");
System.out.println(this.kitStoragePath);
#

I'm on 1.8 and Java 8

tall dragon
#

pretty sure u dont include the slash

#

in resolve

umbral flint
#

oh

#

ok

#

it works now

#

thanks

#

I could've sworn last time I did this I used a /

ivory sleet
#

lol

mortal hare
#

Is there any way to get physical keycodes in java

#
        case InputKey.ALPHANUMERIC_6 -> List.of(KeyEvent.VK_6, KeyEvent.VK_CIRCUMFLEX, KeyEvent.VK_DEAD_CIRCUMFLEX); // The '6', '^' key.
        case InputKey.ALPHANUMERIC_7 -> List.of(KeyEvent.VK_7, KeyEvent.VK_AMPERSAND); // The '7', '&' key.
        case InputKey.ALPHANUMERIC_8 -> List.of(KeyEvent.VK_8, KeyEvent.VK_ASTERISK);   // // The '8', '*' key.
        case InputKey.ALPHANUMERIC_9 -> List.of(KeyEvent.VK_9, KeyEvent.VK_LEFT_PARENTHESIS); // The '9', '(' key.
        case InputKey.QUOTE -> List.of(KeyEvent.VK_QUOTE, KeyEvent.VK_QUOTEDBL);            // The ''', '"' key.
        case InputKey.COMMA -> List.of(KeyEvent.VK_COMMA, KeyEvent.VK_LESS);            // The ',', '<' key.
        case InputKey.MINUS -> List.of(KeyEvent.VK_MINUS, KeyEvent.VK_UNDERSCORE);            // The '-', '_' key.
        case InputKey.PERIOD -> List.of(KeyEvent.VK_PERIOD, KeyEvent.VK_GREATER);           // The '.', '>' key.
        case InputKey.SLASH -> List.of(KeyEvent.VK_SLASH);            // The '/', '?' key.
        case InputKey.SEMICOLON -> List.of(KeyEvent.VK_SEMICOLON, KeyEvent.VK_COLON));        // The ';', ':' key.
        case InputKey.EQUALS -> List.of(KeyEvent.VK_EQUALS, KeyEvent.VK_PLUS));           // The '=', '+' key.
        case InputKey.LEFT_BRACKET -> List.of(KeyEvent.VK_OPEN_BRACKET, KeyEvent.VK_BRACELEFT);     // The '[', '{' key.
        case InputKey.RIGHT_BRACKET -> List.of(KeyEvent.VK_CLOSE_BRACKET, KeyEvent.VK_BRACERIGHT);    // The  ']', '}' key.
        case InputKey.BACKSLASH -> List.of(KeyEvent.VK_BACK_SLASH);        // The '\', '|' key.
        case InputKey.BACKTICK -> List.of(KeyEvent.VK_BACK_QUOTE, KeyEvent.VK_DEAD_TILDE);         // The '`', '~' key.
#

doing something like this looks stupid

#

AWK's key event only return virtual key codes

#

i want physical ones

earnest girder
#

what exactly does entity#setPersistent do?

ivory sleet
#

the entity cant despawn

#

or I mean it still can

#

but it disables it generally

worn gulch
#

Hello, if I'm making a biome provider, is it possible to get what biome would normally be in a location using the vanilla provider? Basically I want to change biomes above a certain Y-value but leave biomes below that Y value the same as the vanilla generator.

young knoll
ivory sleet
#

its not?

young knoll
#

setPersistent controls whether the entity gets saved when the chunk unloads

ivory sleet
#

ah fuck me

young knoll
#

Despawning is setRemoveWhenFarAway iirc

ivory sleet
#

too much nms for me my bad

earnest girder
#

is there a guide for adding custom entities to your server? I need to have permanent TextDisplays and NPCs that always exist, but i need to create them in my plugin's code. How do I code their creation so that there is always exactly 1 of each entity for every server restart?

#

if I created the on server start and deleted them on disable, then server crashes would cause duplicates to be made

young knoll
#

Set them to not be persistent

#

setPersistent(false)

#

Then spawn them on chunk load or keep the chunk loaded

ebon topaz
#

how do i make a furnace recipe with a itemstack result?

young knoll
#

Doesn’t the recipe constructor take an itemstack

ebon topaz
#

apparently not from what i can tell, its material or a recipechoice which im guessing ill need to use recipechoice but how do i pass a itemstack to that

ebon topaz
#

sorry I'm dumb i meant input

young knoll
#

There’s RecipeChoice.ExactChoice

#

But idk if it works on furnace recipes

#

The docs say shaped recipes only but you can try it

ebon topaz
#

i mean im not getting any errors

#

ill test it out

barren peak
#

question, is the only way to detect when a player starts mining or cancels mining through packets? or is there a way to do it withought?

young knoll
#

BlockDamageEvent

#

BlockDamageAbortEvent

barren peak
#

oh cool, is blockdamage event only on start mining, or is it constant while mining?

young knoll
#

Start

barren peak
#

ok, thanks

ebon topaz
#
public static final ItemStack RAW_CHICKEN_NUGGET_ITEM = new ItemBuilder(Material.CHICKEN, 9)
        .setDisplayName("Raw Chicken Nugget")
        .setCustomModelData(8)
        .build();

public static final Recipe RAW_CHICKEN_NUGGET_RECIPE = new RecipeBuilder("raw_chicken_nugget", RAW_CHICKEN_NUGGET_ITEM)
        .shape(" R ", "   ", "   ")
        .setIngredient('R', Material.CHICKEN)
        .build();

so i found an added side effect of a dupe glitch

#

because i based the nugget off the raw chicken and it uses the raw chicken in the recipe

ebon topaz
#

am i going to have to use a prepareitemcraftevent to check that the crafting recipe for the nugget isn't a nugget? or is there a different way?

sly topaz
#

what do you mean

#

what is the dupe exactly

rough ibex
#

I think he means if you put the nugget back in you get 9 back out?

#

since the ingredient is a chicken

#

and you get a chicken back out

#

so you get 9 chick out, put 1 of those back in for 9 more?

#

I'm just guessing

sly topaz
#

am I dumb because I am not getting it

#

if they're using exact choice, you couldn't just get a chicken out of a chicken, since they don't have the same metadata

ebon topaz
sly topaz
#

wait, I actually don't even understand what that recipe is supposed to do

#

ah, you get 9 chicken nuggets out of a chicken

ebon topaz
#

put raw chicken in and get 9 raw chicken nuggets out

sly topaz
#

so yeah, if you use exact choice for the recipe it should be fine

#

is there a reason it is a shaped recipe even

ebon topaz
#

doesnt need to be its just the builder that i had already made

quaint mantle
#

when a new version of minecraft is released
how can i update my plugins to that version?

ebon topaz
remote swallow
#

If you don't use nms update the dependency in ur build system and fix and deprecation, if you use nms run bt and deal with it

sly topaz
#

if you aren't, then I'd recommend start using one

remote swallow
#

Who uses buildsystems anymore just write asm

sly topaz
#

usually if it is a simple enough plugin, you don't have to do anything and it'll just work

ebon topaz
ebon topaz
#

👍

ebon topaz
#

worked great

public static void registerAllRecipes() {
    Bukkit.getServer().addRecipe(CHICKEN_SANDWICH_RECIPE);
    Bukkit.getServer().addRecipe(CHEESE_RECIPE);
    Bukkit.getServer().addRecipe(CHERRY_PIE_RECIPE);
    //Bukkit.getServer().addRecipe(HONEY_GLAZED_SALMON_WITH_RICE_RECIPE);
    Bukkit.getServer().addRecipe(CHOCOLATE_BAR_RECIPE);
    //Bukkit.getServer().addRecipe(SUSHI_RECIPE);
    Bukkit.getServer().addRecipe(BOBO_TEA_RECIPE);
    Bukkit.getServer().addRecipe(RAW_CHICKEN_NUGGET_RECIPE);
    Bukkit.getServer().addRecipe(COOKED_CHICKEN_NUGGET_RECIPE);
}

i think this might get a bit full

glossy laurel
#

Guys

#

Can I do blocking methods in PAPI requests

#

(Without killing the main thread)

drowsy helm
#

Pretty sure all papi requests are on main thread

remote swallow
glossy laurel
sly topaz
ebon topaz
#

I thought you shouldn’t register the recipe inside the build method

autumn ingot
blazing ocean
#

yep

#

I don't remember there being a way to get all tags a material is tagged with

#

may be wrong though

sly topaz
#

there is no way to get which tags apply to a material, no

#

it must be stored somewhere though, given F3 shows them

blazing ocean
#

NMS I suppose

lethal kindle
#

is there any way i can detect custom keybinds? any key pressed
i think not but maybe nms... pls help

sullen marlin
#

Don't think so

smoky anchor
sly topaz
#

who is this boq person

smoky anchor
#

A Mojang developer

lethal kindle
smoky anchor
#

in what context

lethal kindle
#

holding an item and middle clicking it

smoky anchor
#

it is probably impossible to detect middle clicking just air, I doubt any packet would be sent from client

lethal kindle
#

basically what i'm trying to do is creating a map that gives you a stick
you can left and right click to select the corners of the map region and then confirm it somehow with a middle click

#

but i think it's impossible

smoky anchor
#

Just use offhand for that

lethal kindle
#

oh

#

good idea tysm

pastel axle
#

Hmm, am I reading correctly that I can't create an Inventory or InventoryView title with components?

pastel axle
#

Bummer.

sly topaz
#

then again, the most you can do with components in the inventory title is translatable components I guess, so it isn't too bad

smoky anchor
#

??
Have you never seen custom inventories with font magic ?

pastel axle
#

I was hoping to change the font, which is supported natively

sly topaz
pastel axle
#

I guess Lore can't do it either

sly topaz
#

using components in spigot requires NMS for the most part, as the API for it isn't there yet

#

there is a PR open to solve that, however it's been in the works for a while now

buoyant eagle
real lagoon
#

Excuse me, but wtf is "ass-pressure"?

blazing ocean
#

nor the dolphins grace effect

real lagoon
#

LOL

young knoll
#

A lot of the newer effects have funny descriptions

smoky anchor
#

Didn't someone go through those and remove them some time ago ?

young knoll
#

Nah

#

I added proper descriptions but I left the memes

fast jasper
#

does anyone know any resources for for "simulating players" via puppets or something in order to perform certain types of plugin testing that would usually require real players to be logged on? anything like this exist?

blazing ocean
#

via puppets?

#

and no that is not a thing

#

you can use offline mode if your setup doesn't depend on uuids

chrome beacon
#

You can use Mineflayer and offline mode to help automate testing

chrome beacon
#

The name is not guaranteed to be known if the player is offline

blazing ocean
#

you'd need to use the mojank API to fetch skin data if it's not cached

young knoll
#

Iirc you can make a profile with the uuid only

chrome beacon
#

You can

young knoll
#

Actually doesn’t OfflinePlayer have a getProfile?

#

Yeah OffinePlayer#getPlayerProfile

blazing ocean
chrome beacon
#

Calling update on it will

young knoll
#

It will if you complete it

blazing ocean
young knoll
#

No

blazing ocean
#

oh it's just their player profile stuff then

young knoll
#

Spigot has #update

chrome beacon
#

Ah wait I see they're not awaiting the player profile update?

#

It's a completable future

young knoll
#

Oh yeah

blazing ocean
#

.join() time

young knoll
#

They should be using thenRun or whenComplete

#

Yeah or join it in the async task I guess

blazing ocean
#

though those are async

chrome beacon
#

blocking the scheduler thread for no reason is uh less than ideal

blazing ocean
#

(not the bukkit ones)

young knoll
#

Meh

#

The scheduler has an unbounded thread pool

#

Kek

jagged merlin
#

I need a plugin that allows me to customize the logout screens, like for wrong version or something else, does it exist? I need it

tight compass
#

Why cant I import Plugin into my BungeeCord project? I have it added in my pom.xml but I guess net.md_5.bungee.api.plugin.Plugin isn't in the API? But...

blazing ocean
#

show your pom.xml

#

?paste

undone axleBOT
tight compass
#

yea I was trying to remember teh command

#

This is the dependency part

blazing ocean
#

isn't bungee on a different repo

#

?maven

undone axleBOT
tight compass
#

That's what I wasn't sure of

blazing ocean
#

I believe it might be on https://hub.spigotmc.org/nexus/content/repositories/snapshots/

eternal oxide
tight compass
#

Both?

#

What should my pom.xml be?

tight compass
#

I figured it out

grim hound
#

Are players identified by their uuids by the server?

#

In nbt save files

blazing ocean
grim hound
#

Nickname

chrome beacon
#

That can change

blazing ocean
#

it's literally world/data/<uuid>.dat

grim hound
#

Okay

#

Thanks ;]

chrome beacon
#

Only in offline mode does the name have any effect on player data

#

but that's because the server generates a uuid based on the name

grim hound
#

Yeye

#

Okay

pure dagger
#

i want to make a command which sets (sets to config) material of a Block Player is holding, but when a Player holds for example a potato its different because potatoes as Block are called POTATOES, how can i do this

echo basalt
#

What version are you using?

pure dagger
#

1.18.2

echo basalt
#

eh

#

Modern versions have ItemType vs BlockType

#

You might need to manually map yours

pure dagger
#

ugh

#

is there at least like some list

chrome beacon
valid basin
#

Does someone know a good cross version particle library? That supports creation of this:
Many static and animated shapes.
Display images as particles.
Text to particles.
Complex shapes like tesseracts and double pendulums.

echo basalt
#

x-series has cross-version particles

valid basin
#

cross-version particles is the name of the lib?

echo basalt
#

There's also ParticleLib but it's outdated

echo basalt
pure dagger
#

its different material

#

if u understand

chrome beacon
#

If you want a list of blocks grab the values of the material enum and filter them isBlock

pure dagger
#

Player is holding" potato" but i need "potatoes"

chrome beacon
#

ah I see

pure dagger
#

i need to map it

chrome beacon
#

Manual map it is then

pure dagger
#

:c

#

is there a way to make dure i have every thing?

chrome beacon
#

Have you checked if Spigot handles it for you?

echo basalt
#

I recall having to do manual conversions for one of my open-source contributions

young knoll
#

There’s BlockState#getPlacementMaterial iirc

chrome beacon
#

BlockData*

#

it exists but not in 1.18.2 which they are using

pure dagger
#

ugh

#

but its probably done already ?

#

by someone

livid ivy
#

does anyone know how to cap the armour prot level to prot 3 for my smp?

chrome beacon
livid ivy
#

didnt know which one to post it in

undone axleBOT
blazing ocean
#

ah yes chatgpt

#

fix, combat timers dont work properly, they dont refresh on each hit and its a total mess. Don't make your own "quality of life" updates just make it work

#

i love telling people to fix shit and just make it work

#

just gonna forward this rq

remote swallow
#

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

blazing ocean
#

well yeah

#

that's the literal answer

#

sighs

river oracle
#

AI can't code well you're digging yourself a never ending hole

blazing ocean
remote swallow
#

this sounds kinda crazy

#

but why not use an existing plugin like combatlogx

#

instead of failing to write code and failing to get ai to do it

blazing ocean
#
remote swallow
#

no

#

use the plugin

#

no

#

use it on the server

#

is it for your server or are you trying to pubish a plugin

blazing ocean
remote swallow
#

anyway for both:

you dont know how to code it. you shouldnt be making it without being able to make it urself, even if you do make it work it will mostly not contain any good features that would entise a large amount of people to stop using already existing plugins that they know how to use and like it

#

so report it to them

#

its an actively updated plugin, so tell them the issues and it gets fixed for everyone

slow flint
#

My code :

            PacketContainer metadataPacket = protocolManager.createPacket(PacketType.Play.Server.ENTITY_METADATA);
            
            int entityId = npcUUID.hashCode(); 
            metadataPacket.getIntegers().write(0, entityId);

            // Création de WrappedDataWatcher
            WrappedDataWatcher watcher = new WrappedDataWatcher();
            
            WrappedDataWatcher.WrappedDataWatcherObject entityFlags =
                    new WrappedDataWatcher.WrappedDataWatcherObject(0, WrappedDataWatcher.Registry.get(Byte.class));
            watcher.setObject(entityFlags, (byte) 0x00);
            
            WrappedDataWatcher.WrappedDataWatcherObject customName =
                    new WrappedDataWatcher.WrappedDataWatcherObject(2, WrappedDataWatcher.Registry.getChatComponentSerializer(true));
            watcher.setObject(customName, Optional.of(WrappedChatComponent.fromText("§eMon NPC").getHandle()));
            
            WrappedDataWatcher.WrappedDataWatcherObject customNameVisible =
                    new WrappedDataWatcher.WrappedDataWatcherObject(3, WrappedDataWatcher.Registry.get(Boolean.class));
            watcher.setObject(customNameVisible, true); 
            
            List<WrappedWatchableObject> watchableObjects = watcher.getWatchableObjects();
            metadataPacket.getWatchableCollectionModifier().write(0, watchableObjects);
            
            protocolManager.sendServerPacket(viewer, metadataPacket);

            logInfo("Metadata packet successfully sent to " + viewer.getName() + " for NPC with ID " + entityId);
        } catch (Exception e) {
            logError("Error sending metadata packet: " + e.getMessage(), e);
        }```
#

My error :

Error sending packet clientbound/minecraft:set_entity_data

#

Does anyone know how to solve the problem?

vague topaz
#

is Player#getInventory().removeItem(item) removing all items that 100% matches the one that is given(name, lore etc), or it only takes type and amount into a count?

blazing ocean
#

Hi kat

worthy yarrow
#

hi rad

blazing ocean
#

wanna vc

worthy yarrow
#

ok

#

redgot?

blazing ocean
#

yay

#

yup

quaint mantle
drowsy helm
slow flint
scarlet jolt
#

how do i fix this

#

must be a valid class fully qualified name

#

in intellij

chrome beacon
#

Sounds like whatever you're doing needs to be a valid class fully qualified name

scarlet jolt
#

idk what that means 😭

chrome beacon
#

you really need to give us some context

scarlet jolt
#

ok i changed something to lowercase it worked nvm

worldly ingot
#

I love the internet lol

grim hound
#

uh

blazing ocean
#

real

grim hound
#

is the server's compression mechanism

#

broken?

#

for packets larger than 8192 bytes

grim hound
bitter rune
#

i have a bit of an issue with economy, i am using essentialsX using this math and timesing it by .01 and it doesnt come back with the right decimal number its like 0.009999997 instead of 0.01... i tried using big decimal in java as well with no avail

https://paste.ofcode.org/DPpQQFsVmcACHzTat4WVN6

tight compass
#

I just wrote a staffchat plugin using the BungeeCord API. I can toggle it on and type in staff chat, but whenever I toggle it off I get

'Chat had an invalid signature. Please try reconnecting.'

I have enforce secure chat off on both the proxy and the spigot. How can I fix this?

sullen marlin
#

You need to do your math with BigDecimal

worldly ingot
#

Or store fractional values separately as an integer

#

Or a byte, whatever. Could technically fit it into 7 bits lol

bitter rune
#

I'll try that, thanks. I tried doing the math and then using big decimals to round it up, but that didn't work. I understand big decimals now, so I will give this a go; thanks. And if that fails ill use integers

sullen marlin
#

Integers and doing everything as cents is another option

tight compass
#

Do integer math but the least 2 significant digits are actually the decimal part

#

So your integer is 1050, but the 50 is the decimal part

bitter rune
#

that could work, i can store the cents in my plugin and put the dollars in essentialsx and just convert it back and fourth as needed

worldly ingot
#

At least internally

bitter rune
#

just divide in the output by 100 and call it a day, its a fake decimal

opaque scarab
#

I've updated a plugin from 1.21.0 to 1.21.4. The plugin adds custom biomes to the world. In this case, a debug biome "test:raw" is added. I made some change to the code, adjusting it for the latest version, and for the life of me I cannot figure out what I'm doing wrong here. The code in 1.21.0 worked perfectly, and it seemed .4 just changed the names of some methods. I suppose not.

The variable biome is built in a separate method I have confirmed works fine.

The code concerned: ```
public void implement() {
newKey = ResourceKey.create(Registries.BIOME, ResourceLocation.fromNamespaceAndPath("test", "raw"));
changeRegistryLock(false);
Registry.registerForHolder(getRegistry(Registries.BIOME), newKey.location(), biome);
getRegistry(Registries.BIOME).freeze();
}

private void changeRegistryLock(boolean isLocked) {
MappedRegistry<Biome> materials = getRegistry(Registries.BIOME);
try {
Class<?> registryMaterialsClass = Class.forName("net.minecraft.core.RegistryMaterials");
for (Field field : registryMaterialsClass.getDeclaredFields()) {
if (field.getType() == boolean.class) {
field.setAccessible(true);
field.setBoolean(materials, isLocked);
}
}
} catch (ClassNotFoundException | IllegalAccessException e) {
e.printStackTrace();
}
}

private <T> MappedRegistry<T> getRegistry(ResourceKey<Registry<T>> key) {
DedicatedServer server = ((CraftServer) Bukkit.getServer()).getServer();
return (MappedRegistry<T>) server.registryAccess().lookupOrThrow(Registries.BIOME);
}


implement() is the primary method.
#

Here is the error: ```
[15:20:50 ERROR]: Error occurred while enabling Surreal3 v1.0-SNAPSHOT (Is it up to date?)
java.lang.IllegalStateException: Tags already present before freezing
at net.minecraft.core.MappedRegistry.freeze(MappedRegistry.java:312) ~[paper-1.21.4.jar:1.21.4-15-bb76819]
at surreal_3.jar/cyrei.surreal3.debug.biome.BiomeMakerDebug.impliment(BiomeMakerDebug.java:86) ~[surreal_3.jar:?]
at surreal_3.jar/cyrei.surreal3.Surreal3.onEnable(Surreal3.java:43) ~[surreal_3.jar:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:288) ~[paper-api-1.21.4-R0.1-SNAPSHOT.jar:?]
at io.papermc.paper.plugin.manager.PaperPluginInstanceManager.enablePlugin(PaperPluginInstanceManager.java:202)


The error occurs on server startup. If anyone is able to help, it would be greatly appreciated!
earnest girder
#

do NPCs trigger PlayerInteractAtEntityEvent ?

chrome beacon
#

Depends on how they're implemented

mortal hare
#

cool

#

U N S A F E memory in java

#

IntBuffer buffer = MemoryUtil.mallocInt(1)

chrome beacon
opaque scarab
chrome beacon
#

The registries aren't designed to be modified this late in the load process hence the mess required to unfreeze and hoping it works

#

Swapping allTags for MappedRegistry.TagSet.unbound() would get rid of the error

#

Might cause loss in registry entries so uh you'll have to tinker with it

maiden hearth
#

I packaged my plugin and when i attempt to run it on my server i get the following error. I opened the .jar file in 7zip and it is right there

[16:39:06] [Server thread/ERROR]: Could not load 'plugins\LammPluginMc-1.0-SNAPSHOT.jar'
org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml
        at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:170) ~[spigot-api-1.21.4-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:158) ~[spigot-api-1.21.4-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:122) ~[spigot-api-1.21.4-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.craftbukkit.v1_21_R3.CraftServer.loadPlugins(CraftServer.java:468) ~[spigot-1.21.4-R0.1-SNAPSHOT.jar:4409-Spigot-33ece3e-e28af08]
        at net.minecraft.server.dedicated.DedicatedServer.e(DedicatedServer.java:235) ~[spigot-1.21.4-R0.1-SNAPSHOT.jar:4409-Spigot-33ece3e-e28af08]
        at net.minecraft.server.MinecraftServer.y(MinecraftServer.java:1032) ~[spigot-1.21.4-R0.1-SNAPSHOT.jar:4409-Spigot-33ece3e-e28af08]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:329) ~[spigot-1.21.4-R0.1-SNAPSHOT.jar:4409-Spigot-33ece3e-e28af08]
        at java.base/java.lang.Thread.run(Thread.java:1583) [?:?]
Caused by: java.io.FileNotFoundException: Jar does not contain plugin.yml
chrome beacon
#

Are you using maven or gradle?

#

also check for typos in the file name

maiden hearth
#

im using maven

#

its definitely called plugin.yml

chrome beacon
#

Could you send your pom.xml

#

?paste

undone axleBOT
maiden hearth
tiny tangle
#

someone can teach me

maiden hearth
#

my plugin.yml looks like this

name: LammPluginMc
description: allow users to call /lamm and run lamm code
author: minneelyyyy
version: 1.0
api-version: 1.21
main: com.minneelyyyy.LammPluginMc
commands:
  lamm:
    description: run lamm code and return the result in chat
    usage: /lamm <code>
#

and like i said, the jar file clearly has plugin.yml in the root

tiny tangle
#

how can I import the net. for the minecraft imports for gradle

maiden hearth
#

i cant send images here

#

but yeah its in the root of the jar

chrome beacon
chrome beacon
undone axleBOT
#

Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.

Here's some screenshot utilities that you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org

maiden hearth
#

ah, i dont have a spigotmc account

chrome beacon
#

Second part then

tiny tangle
#

thanks

maiden hearth
#

so its correct in the jar

chrome beacon
maiden hearth
#

i just rebuilt and copied it

chrome beacon
#

Just in case

maiden hearth
#

starting server

#

oh

#

error is gone

#

;-;

#

i swear i did this like 4 times

tiny tangle
#

oh right, I remember that, last time I asked about how to make a server side item "backpack" custom texture, what was the most easy to do? if it was fabric one or do a plugin one , without making the user download when join or upload to a page , but send as a packet network. i was kinda loss

maiden hearth
#

to no success

#

but no error in the log

young knoll
#

Well, you could use a custom player head but that’s limited

tiny tangle
opaque scarab
young knoll
#

Both spigot and fabric can host a resource pack locally

chrome beacon
#

allTags is the list

tiny tangle
#

is there a guide to how to setup locally

#

how to make it

chrome beacon
#

First you need a web server to host the resourcepack

#

and then you can use setResourcepack with the resourcepack url

tiny tangle
#

oh, so still needs to upload it to a page?

chrome beacon
#

Just somewhere for the client to download from

#

If you want that could be the server itself

tiny tangle
#

I was like setting sort of a localhost , and port of the same server

#

yeah, i dont know how to do that

chrome beacon
#

if you want same ip and port as the server you can use Inject by @blazing ocean uwu

#

Personally I recommend using the Javalin example

#

Just make a route that responds with the resourcepack zip file

blazing ocean
#

shameless self promo goes brr

young knoll
#

Mines better

#

And unfinished

wet breach
maiden hearth
#

no i was stopping the server and replacing the jar, im sure i messed up somewhere stupid

#

at least it works now

wet breach
#

guess that is what matters, it works lol

tiny tangle
#

so I would need only these compileOnly("io.netty:netty-all:4.1.97.Final") compileOnly("org.slf4j:slf4j-api:1.7.30") compileOnly("io.papermc.paper:paper-api:1.21.4-R0.1-SNAPSHOT")?

chrome beacon
#

no not really

#

Not sure why the first two are there

#

I blame @blazing ocean 🔫

#

Check the main README for dependency information

#

Then the javalin example code

young knoll
#

Netty is needed

#

slf4j idk

chrome beacon
#

Yeah but not in that module

tiny tangle
#

okay, I sort of get it ... i not sure when mapping to the resource pack.zip it needs to be wrapped alongside with the plugin or outside on the server directory file.

#

haha

chrome beacon
#

That's up to you

#

You can have it in the jar if you want

#

or if you want your users to be able to edit it you can put it in your plugin folder for example

tiny tangle
#

oh, glad to ask

#

at least make it does not pop up that download resource window when join will be fine

chrome beacon
#

That will popup

#

Nothing you can do about it

opaque scarab
# chrome beacon yes

Ok I’m really sorry to keep bothering you. I’m looking at the MappedRegistery class rn and I’m not seeing any child class called TagSet. I’m probably just blind lol

fleet pier
#
                    CraftPlayer craftPlayer = (CraftPlayer) onlinePlayer;
                    PacketPlayOutNamedSoundEffect packetPlayOutNamedSoundEffect = new PacketPlayOutNamedSoundEffect("ambient.cave.cave6", onlinePlayer.getLocation().getX(), onlinePlayer.getLocation().getY(), onlinePlayer.getLocation().getZ(), 1.0f,1.0f);
                    craftPlayer.getHandle().playerConnection.sendPacket(packetPlayOutNamedSoundEffect);```
#

did i do something wrong

#

im trying to play a specific cave sound for the player

young knoll
#

Why not use the api

fleet pier
#

spigot 1.8.9

opaque scarab
fleet pier
#

💀

opaque scarab
young knoll
#

Also I don’t think the sound works like that

#

Pretty sure the variant is determined by the seed

chrome beacon
#

There are two anon implementations in there as well

blazing ocean
#

doesn't need to be kept in for paper

chrome beacon
#

but why is it in the example module

#

Does it not get inherited?

blazing ocean
#

Because it's missing on the classpath

#

no

#

not with compileOnly

#

that configuration is not transitive afaik

young knoll
#

compileOnlyApi

blazing ocean
#

Ah

young knoll
#

(java-library plugin)

opaque scarab
chrome beacon
#

it's package private

blazing ocean
chrome beacon
#

Now NeoForge

blazing ocean
#

I was gonna do that tomorrow

#

along with probably bungee and forge

#

man this is gonna be a pain to maintain

chrome beacon
#

You can skip regular Forge uwu

blazing ocean
#

yeah I kinda just wanna get like a load of platforms working

#

modded ones are practically free because all I need is a mixin

#

what

opaque scarab
chrome beacon
#

Reflection

blazing ocean
opaque scarab
#

Ah fun

blazing ocean
#

did that for velo

opaque scarab
#

The the heck did Mojang change this….

chrome beacon
#

For safety

opaque scarab
#

I suppose

chrome beacon
#

Locking down the registries after they've fully loaded is the correct way to handle that

#

Problem is Spigot plugins don't load early enough

#

Paper plugin loaders can though so if that's your target it's easier

opaque scarab
#

True.

#

I should look into making it load earlier I suppose, which might help. I’ve been taking a break from plugin dev for like a year and maybe this wasn’t the first project to resume XD

earnest girder
#

I'm talking human player NPCs with nms

chrome beacon
#

If it's a properly registered entity it would probably work

#

?tas is the best way to check

undone axleBOT
ebon topaz
#

How could I make a book like this? With the crafting grid to show how things are made?

chrome beacon
#

A resourcepack with a custom font

#

You have characters for each of the different icons and then use offsets and negative space to get them in to position

proper cobalt
#

is there any vid guides on texture packs or like website guides

earnest girder
#

does anyone know how to set a PlayerEntity's position in CraftBukkit?

#

it seems like it used to have a #setLocation method but it doesnt anymore

sullen marlin
#

.teleport

earnest girder
#

how do the parameters for that method work?

#

I cant find any documentation

sullen marlin
#

?jd-s

undone axleBOT
earnest girder
#

EntityPlayer isnt on there

#

this is Bukkit

#

or nms

ivory sleet
#

You can often reverse engineer it by looking how it ties into usage in craft bukkit classes and spigot api itself

sullen marlin
#

Why do you need NMS to move a player

earnest girder
#

im not moving a player

#

im setting the position of an npc

sullen marlin
#

Player.teleport

#

getBukkitEntity().teleport

earnest girder
#

thanks

#

does anyone know what to replace these classes with for 1.21?

import net.minecraft.network.protocol.game.ClientboundAddPlayerPacket;
import net.minecraft.network.protocol.game.PacketPlayOutPlayerInfo;
undone axleBOT
young knoll
#

I believe add player was merged with add entity

#

And the other one isn’t a mojmap name

#

Should be something like ClientboundPlayerInfoPacket

chrome beacon
#

^^

earnest girder
#

PacketPlayOutSpawnEntity and ClientboundPlayerInfoUpdatePacket 👍

earnest girder
sinful pecan
#

Does anyone happen to know how to make a placeholder display if a bungee server is Online, Offline, or Whitelisted? Whilst also being able to set each of these to different colors. IE- Online-Green, Offline-Red, Whitelisted-Orange.

mortal vortex
sinful pecan
mortal vortex
tiny tangle
maiden hearth
#

for some reason, my dependency library (jar-jni) is not being included in my jar file and its crashing whenever i use my slash command with a java.lang.ClassNotFoundException: io.questdb.jar.jni.JarJniLoader

#

this is all i have for jar-jni, i dont know why its not part of the jar

#

and yea the jar archive does not seem to contain it

sullen marlin
#

you need to use maven shade plugin

#

or add the library to plugin.yml libraries section

barren peak
#

how do you get if the tool being used is the right tool for the block on BlockDamageEvent (EX: pickaxe on stone is correct tool, pickaxe on wood isn't)

sullen marlin
#

Block.isPreferredTool

barren peak
#

ty

maiden hearth
#

so... i added a main class and figured out how to do that with maven properly, and it worked, i then decided to see what would happen if i copied that over to my server and the plugin worked without the UnsatisfiedLinkError... i am not quite sure what the difference is

#

i think java will just forever confuse me...

#

just somehow "statically linking" (in the archive) instead of relying on spigot to load the library up works

sullen marlin
#

Spigot wont load the library unless you add it to plugin.yml too

maiden hearth
#

i did that

remote swallow
#

either, add shade plugin and shade or add it to libraries

#

you dont need to do both

opaque scarab
#

So I'm trying to use MappedRegistry.TagSet.unbound() to effectively "unfreeze" the registries to add custom biomes in 1.21.4 I attempted to use reflection, my code here: ```
try {
Field field = MappedRegistry.class.getDeclaredField("allTags");
field.setAccessible(true);
Object object = field.get(getRegistry(Registries.BIOME));

        Class<?> tagset = Class.forName("net.minecraft.core.MappedRegistry$TagSet");
        Method method = tagset.getDeclaredMethod("unbound");
        method.setAccessible(true);
        method.invoke(object);

    } catch (NoSuchFieldException | IllegalAccessException | ClassNotFoundException | NoSuchMethodException | InvocationTargetException e) {
        e.printStackTrace();
    }```

unfortunately, that's my weakness and the registry is still "bound" Does anyone know what i did wrong? thanks (:

#

If anyone has further questions, i'd be happy to provide further info (just didn't want to bloat the channel)

opaque scarab
#

u know what just kill me

sullen marlin
#

Use a data pack?

opaque scarab
# sullen marlin Use a data pack?

I’ve been updating this plugin for several versions though, and I’d like it to continue coinciding with some other plugins I’ve developed

#

I’m porting it from 1.21.0 to 1.21.4

pastel axle
#

Alright, I need a second opinion. This works fine:

AreaEffectCloud cloud = (AreaEffectCloud) w.spawnEntity(location, EntityType.AREA_EFFECT_CLOUD);
cloud.setParticle(Particle.BLOCK_CRACK, Material.AIR.createBlockData());

But I want to set the particle before it spawns, to avoid the default size for a split second. I found an answer online that said to use a consumer.

However, this errors with class org.bukkit.craftbukkit.v1_20_R1.block.data.CraftBlockData cannot be cast to class org.bukkit.material.MaterialData

AreaEffectCloud cloud = w.spawn(location, AreaEffectCloud.class, new Consumer<AreaEffectCloud>() {
    @Override
    public void accept(AreaEffectCloud cloud) {
        cloud.setParticle(Particle.BLOCK_CRACK, Material.AIR.createBlockData());
    }
});

Any ideas on what I could be doing wrong?

sullen marlin
#

does plugin.yml have api-version set

blazing ocean
#

use a lambda please

pastel axle
pastel axle
sullen marlin
#

Doubt it

blazing ocean
#
w.spawn(location, ..., (cloud) -> {
    // do your things
});
pastel axle
pastel axle
#

This is what happens when I resurrect a 9 year old plugin of mine without doing the basics. <_<

spiral light
#

who the hell coded the new adventure api to create "better" json formated chat msg with click and hover event ?
this is far away from beeing easy to understand .... nothing works for me currently -.-
i managed to create a Component with text but how do i send it to Players ?
Audiences.players().sendMessage(Component.text("Hello, players!"));
players() is not a function of Audiences and i can find any other information about this ...

spiral light
#

this is all i got ...

blazing ocean
#

BukkitAudiences

spiral light
#

i doesnt know BukkitAudiences

spiral light
#

i need to add a new dependency ? but why ? half of the shit is already given in the normal api .... i dont like this

blazing ocean
#

because the API is platform independent

#

that's the whole point of adventure

spiral light
#

yeah but they could provide it just for the spigot api too ... i dont like the idea of saying the old bungee chat api is deprecated but you need to add other stuff to make it work with the new system ...

blazing ocean
#

what?

spiral light
#

they could just add the bukkit adventure api to the spigot dependecy

blazing ocean
#

wha

sly topaz
blazing ocean
#

well, not completely supported

sly topaz
#

by who

blazing ocean
#

spigot

#

it's only supported in like two places

#

the rest is still strings

#

component PR™ when

sly topaz
#

well, yeah that's what I mean by not complete

blazing ocean
#

well the bungee chat impl itself is complete iirc

spiral light
blazing ocean
#

?whereami

sly topaz
blazing ocean
#

they are

sly topaz
#

they implement adventure, so you don't have to use it as an additional dependency like in spigot

#

I thought you were trying to use adventure in spigot

spiral light
#

hmm paper was in pom but not used in any way

sly topaz
spiral light
#

thanks for your help btw ^^

blazing ocean
#

I need some netty help, I'm trying to forward an HTTP request to my backend servers (am proxying http requests to my proxy), for some reason this returns an HTTP/0.9 response. I've tried printing the response, it says it's HTTP/1.1, but 99% of http clients will just refuse to accept it since it's 0.9 apparently. https://pastes.dev/nQjdZU4LMV

sly topaz
#

that documentation page is kind of annoying, it goes to explain the broad concepts which is fine, however I had hoped the examples would be more clear cut, like actually showing how you can send a message, be it with components or MM since that's the main way people use components anyway

blazing ocean
#

shouldn't there be a status line?

wet breach
#

headers().set(HttpHeaderNames.ACCEPT_ENCODING, HttpHeaderValues.GZIP);

blazing ocean
#

I only need to send that one request and then close it again

#

I've just tried writing the status line manually like this

response.readerIndex(0)
       response.writeCharSequence(httpResponse.protocolVersion().toString() + " " + httpResponse.status().toString() + "\n", StandardCharsets.US_ASCII)
       response.resetReaderIndex()

but I still get the exact same error

wet breach
#

curl localhost:25564/games/packs/global -v -o global.zip --http1.1

blazing ocean
#

still, same error

wet breach
#

you are doing something wrong then, what are you connecting to?

blazing ocean
#

Minecraft server, it responds to HTTP normally if I curl it directly (using inject)

#

curl localhost:25565/packs/global -v -o global.zip --http1.1 is completely fine

wet breach
#

what do you mean is fine?

#

it worked?

blazing ocean
#

Yeah, that's my backend server

wet breach
#

so the first one is bungee?

#

and I assume second is actual mc server?

blazing ocean
wet breach
#

so why are we trying to proxy requests now?

blazing ocean
#

My backend servers are the one that serve resource packs, and those are not going to be externally accessible so I need to proxy them and redirect to the backend based on the request path

#

I could maybe move the pack hosting logic to the proxy

#

Could probably serialise the resource pack to a protobuf and send it to my proxy via websocket

#

tbh that's probably the better solution

#

Serializing a ~10mb resource pack object and sending that via WS feels a bit silly but yeah

echo basalt
#

Make a resourcepack microservice

young knoll
#

I read that as microwave

blazing ocean
#

of course

tawdry depot
#

anyone aware of a good youtube video showing how to create custom NPC mini bosses

pseudo hazel
#

no, what even is an npc mini boss

tawdry depot
#

an npc that can attack with custom abilities

graceful meadow
#

Hi! I'm trying to add something to an interface in org.bukkit.block.data package, and I have a few questions.

  1. Should I cange it in Bukkit, or Spigot-API, or both?
  2. The interface I'm modifying is implemented in packages org.bukkit.craftbukkit.block.data and org.bukkit.craftbukkit.block.impl. I modified the proper class in org.bukkit.craftbukkit.block.data package, but the one in org.bukkit.craftbukkit.block.impl package has a comment that says: 'Automatically generated file, changes will be lost.'. How do I regenerate the contents of that file?
gilded granite
#

how do I add thing to autocomplete for my commands

blazing ocean
#

if you're using command executors, implement TabCompleter

gilded granite
#

ok thx

pseudo hazel
#

you should use a TabExecutor then you can put the command and autocomplete in the same class if you want

young knoll
#

You can do that with TabCompleter and CommandExecutor as well

young knoll
#

TabExecutor just combines them

sly topaz
#

as for the second question, who knows, doesn't seem to be documented anywhere

#

didn't even notice those were generated sources lol

young knoll
#

Yeah idk about the auto generated code

#

You’d have to ask MD or maybe @worldly ingot

sly topaz
#

I searched all over the project(s) and there doesn't seem to be anything about blockdata generation in buildtools or similar, so I am unsure of where it is actually being generated

graceful meadow
#

Alright thanks, in worst case scenario I'll just modify the file manually

static marten
#

hello, do you guy have any plugin that i can use for unloading a world and loading a world for minigame? i was trying to use slime world manager but its too outdated

worldly ingot
blazing ocean
static marten
gilded granite
#

what event listener get all the droped items?

cerulean quarry
#

Is it possible to move interaction entities with vectors?

#

Does any1 know

blazing ocean
#

a location is a vector

cerulean quarry
#

i mean like

#

have it move when interacted with and use a vector to modify that movement

blazing ocean
#

do you mean velocity

cerulean quarry
#

like is it moveable without teleport

#

yea with like setvelocity sure

blazing ocean
#

yeah in that case just apply velocity

sonic goblet
gilded granite
#

even the items droped by the player?

sonic goblet
sly topaz
#

you can use ItemSpawnEvent for any items that just spawn

#

would be nice if that event provided a reason tbh

gilded granite
blazing ocean
#

then listen to both

sonic goblet
#

^^^

gilded granite
#

how can I get block in the chunk of where a player is

#

like search for a specifi block

worldly ingot
#

You would have to iterate over all the blocks in the chunk. I'm not sure what else you expected PES_Giggle

gilded granite
#

yeah but how do I do so?

eternal oxide
#

depends what "Block" you want

gilded granite
#

A hopper

worldly ingot
#

You can use player.getLocation().getChunk() to get the Chunk object they're in, then it's just a matter of iterating from chunk's getX() to getX() + 16, getZ() to getZ() + 16, and world minimum to world maximum

eternal oxide
#

a Hopper has a TileEntioty so searching is quite simple

worldly ingot
#

Chunk has getTileEntities(), so it might save you some iteration times :p

gilded granite
#

like that ?
if (block.getLocation().getChunk().isLoaded()) {
Arrays.stream(block.getLocation().getChunk().getTileEntities())
.filter(tile -> tile instanceof Hopper)
.forEach(tile -> {
Hopper hopper = (Hopper) tile;
});
}

eternal oxide
#
Arrays.stream(chunk.getTileEntities()).filter(Chest.class::isInstance).map(Chest.class::cast).collect(Collectors.toList())```
#

do for hopper, will give you a List<Hopper> of Hoppers

gilded granite
#

thx

gilded forge
#

Guys do you have any idea about this:

PingPacket packet = new PingPacket(player.getPing());
                if (player.getPendingConnection().getVersion() >= ProtocolConstants.MINECRAFT_1_9) {
                    player.unsafe().sendPacket(packet);
                }

I tried to send a PingPacket to client with BungeeCord API
But sadly [Kolleen] disconnected with: EncoderException : java.lang.IllegalArgumentException: Cannot get ID for packet class net.md_5.bungee.protocol.packet.PingPacket in phase GAME with direction TO_CLIENT for version [767] @ io.netty.handler.codec.MessageToByteEncoder:-1

#

I installed vias on spigot

#

My client is 1.21.1 and BugneeCord is 1.21.1 too

chrome beacon
#

Why are you sending that packet manually?

gilded forge
#

Because proxiedPlayer.getPing() is not on time

chrome beacon
#

wdym not on time?

gilded forge
#

this ping updates once per several seconds

chrome beacon
#

yeah that's normal

gilded forge
#

I m making /ping command

chrome beacon
#

Just use getPing

gilded forge
#

But MCCIsland made a new type of /ping

blazing ocean
#

They're also not using bungee

gilded forge
#

their /ping command seems sending ping packet manually

blazing ocean
#

we have no idea what their ping command does

#

they likely won't tell you either

gilded forge
#

They are using modified Velocity i think?

blazing ocean
#

yep

gilded forge
#

But you can send ping packet through SpigotAPI with packet events

#
WrapperPlayServerPing packet = new WrapperPlayServerPing(packetId);
        PacketEvents.getAPI().getPlayerManager().sendPacket(player, packet);
#

We can't do this through BungeeCordAPI?

chrome beacon
#

You do want it on the server and not the proxy

#

so you see the actual full ping

gilded forge
#

Okay

#

Well I found out that MCCIsland is sending ping packet through their modified Paper instead of Velocity

#

Because their /ping cooldown period updates on server switching

#

lol

chrome beacon
#

Yeah having it on the proxy is less than ideal

clear elm
#

I have a method from chatgpt which takes the x y and z vaslue from a location and turns it into a string but it only gives int values. for example if the y value is 361.7 it does 361, i dont know why pls help

        return location.getWorld().getName() + "," +
                location.getBlockX() + "," +
                location.getBlockZ() + "," +
                location.getBlockY();
    }```
blazing ocean
#

getX, getY, getZ

#

just gonna forward this again

#

(s/fabric/spigot)

clear elm
#

thank you very much

clear elm
# blazing ocean

Im just using chatgpt for some parts. the main part of the plugin im doing myself

blazing ocean
#

that's like one of the easiest parts 😭

clear elm
#

im using it to save hashmapss in yml files

eternal oxide
#

Bukkit serialization handles all that for you

clear elm
#

whats that

clear elm
#

uh thanks ill try to understsnd it

sly topaz
# clear elm uh thanks ill try to understsnd it

it is pretty simple, if you are using Bukkit's configuration API (that is YamlConfiguration or the getConfig/saveConfig in JavaPlugin), then anything that implements ConfigurationSerializable will be serializable into yaml for a given YamlConfiguration, and all you have to do is use the generic get/set methods and cast the inputs/outputs or getObject which does the casting automatically

#

most of bukkit objects implement ConfigurationSerializable so for common objects like locations, you don't have to worry about it

clear elm
#

i need to save a armorstand

sly topaz
#

Maps and Lists are also automatically serialized I believe, into a configuration section and a yaml list respectively

clear elm
#

i have a hashmap Location, Armorstand

sly topaz
#

unless you want to spawn the entities out of the yaml configuration, in which case you'd have to create a format for your armor stand properties

clear elm
#

i want to delete the entity

#

remove

sly topaz
#

remove when

#

on disable?

clear elm
#

i want to save it when restarting so i can still remove the entity after an restart

#

with entity.remove

sly topaz
#

if you are going to respawn the entity, why not just leave it in the world

#

that way you'd only have to save the locations for any specific logic you may have on them

#

ah, I get what you are trying to do now, yeah just saving the locations should do

clear elm
#

i use the armorstand as a hologram

sly topaz
#

if you are in a newer version, I recommend using text displays, they're far better for that purpose

clear elm
#

im still 1.20

sly topaz
#

1.20 did have text displays, no?

#

they were added in 1.19 or so iirc

clear elm
#

idk but i prefer armorstand cuz i thionk ill downgrade my plugin to 1.16

sly topaz
#

what I'd personally do is have a UUID <-> Location map saved in a file, be it a configuration file or whatever

#

that way you can just do Bukkit.getEntity(someUuid) and possibly load the chunk if it isn't loaded yet with the location to find the entity

clear elm
#

i didnt knew this works

clear elm
pliant topaz
sly topaz
clear elm
lilac dagger
#

It's not worth supporting 1.16 @clear elm

#

There's no mojmaps

#

It has a weird jdk range limit

#

Jdk 11 or something like that

clear elm
#

Is 1.17 worth it?

chrome beacon