#help-development

1 messages · Page 1238 of 1

thorn isle
#

not really any different from shitcoin mining in terms of wattage, but upfront costs are an issue

torn shuttle
#

the window of time for deepseek's relevance is also quickly going away, personally I only think of it as the cheap option now that claude 3.7 is out

#

if I had infinite money I wouldn't even think about deepseek

#

so you have to rely on hoping some other massive model comes out with a completely free and open source license

#

or worse, good luck making your own lol

#

if I want a free model I have gemini, and if I want a good model I have claude, deepseek is in that weird intermediate level where I want something powerful that won't make me go bankrupt

slim wigeon
#

What was that in #general ? I don't put all that in one if statement

chrome beacon
#

Don't take #general too seriously

lusty sapphire
#

I would like to get Location from player, but I don't know how to do it.
I would also like to know if there is some kind of reference.

mortal vortex
#

@slim wigeon pretty sure this guy worked with songoda, so he's probably who you wanna harass.

lusty sapphire
#

thanks

slim wigeon
mortal vortex
#

or whatever ur skill issue was

slim wigeon
mortal vortex
slim wigeon
hushed spindle
#

I understand that. The issue is that the item is being mutated when it's not expected to be. Even when I add an item to an empty inventory is the amount changed by consistent quantities.
So given your example, if I pass an ItemStack with stack size 64 to an empty inventory, the quantity is now 63. If I do it again with the 63-size stack, its now 61, then 57, then 49, then 33, then 1. Again, the inventory is completely empty. It's just reducing the amounts for the heck of it

#

so its reducing by 1-2-4-8-16-32

umbral ridge
#

a server reload clears tasks right

mortal vortex
#

I have a utility class to generate a progress bar, but the specific color of this bar should be inferred from a config file. Everytime I invoke this class I think its a bit verbose passing plugin eachtime. Is doing something like this going to be acceptable?

private val plugin: JavaPlugin? = Bukkit.getPluginManager().getPlugin("PLUGINMAINCLASS") as JavaPlugin?

or will this cause errors

#

To clarify, in order to access the config I'll need an instance to the plugin, which should be passed through a constructor usually.

eternal night
#

Well, usually you'd construct this instance once with the plugin passed

#

and pass it around

mortal vortex
#

fair enough

slim wigeon
#

Trying to get my 1.19.3 plugins to date. And I noticed this function public void saveInv(ItemStack item, Inventory inv) { ItemMeta meta = item.getItemMeta(); BlockStateMeta sm = (BlockStateMeta) meta; Chest chest = (Chest) sm.getBlockState(); chest.getInventory().setContents(inv.getContents()); sm.setBlockState(chest); item.setItemMeta(sm); }This function saves the inventory to a item but my question is, how can I save a custom inventory like InventoryManager for a example?

smoky anchor
#

who wrote this, this is bad
no instanceof check for the BlockStateMeta ?
This code has 6 lines written on 3 because ???
And it does not save inventory, only the inventory contents.

#

You'll probably have to elaborate on what your InventoryManager is.

pseudo hazel
#

I love the confidence with the casting

smoky anchor
#

Watch me pass a stick and have your code explode

slim wigeon
#

I wrote it, I was getting started at the time. But I might know what I need to do. I also know this needs to be changed. Just want to get the code in working state before I change anything either than adding my core to it and server version from 1.19.3 to 1.21.1

smoky anchor
#

Ok fair I guess, just be sure to rewrite it properly.
And maybe do use more descriptive variable names, not just "sm"

pseudo hazel
#

but yeah idk why it wouldnt work for your custom inventory

#

assuming an instance of Inventory exists anywhere in there you should be able to save the contents in the same way

slim wigeon
#

I may ask for help so be ready, I don't know what I was doing with that. Let me get the plugin in functional state. One second

glossy laurel
#

guys, whats the event that gets fired when an item loses durability?

pseudo hazel
#

PlayerItemDamageEvent

jagged thicket
#

not this?

slim wigeon
glossy laurel
slim wigeon
#

Like for pickaxes and all that?

glossy laurel
#

but yeah

slim wigeon
slim wigeon
jagged thicket
slim wigeon
#

You had me check my previous code on that one

#

Then I seen what it really was

pseudo hazel
slim wigeon
pseudo hazel
#

maybe read what I said

#

PlayerItemDamageEvent != PlayerItemBreakEvent

#

Called when an item used by the player takes durability damage as a result of being used.

slim wigeon
#

I just noticed, I must be focusing on too much

#

I will test that as well

echo basalt
#

@lost matrix tell me your ways

valid basin
#

Does someone have a list of packets for 1.21? because wiki.vg doesn't work anymore for me

#

if someone can send a link

pseudo hazel
#
Minecraft Wiki

wiki.vg, a wiki that documents Minecraft's protocol extensively, was sunset on November 30, 2024. As the announcement posts reads, "The final content will be archived and made available for download in MediaWiki's XML export format under the CC-BY-SA license, along with an archive of images and other media." The sunsetting announcement can be re...

dawn flower
#

where did the 6 lore lines come from if meta in item is null? meta is item.getItemMeta()

rotund ravine
#

What’s in it

eternal night
#

wtf is isForInventoryDrop

dawn flower
#

idfk

rotund ravine
dawn flower
rotund ravine
#

In ur arraylist for lore

smoky anchor
#

What does the lore say 🎵

dawn flower
#

well i'm modifying the lore clientside so it should be empty

#

1 sec lemme give u the code

#
    @Override
    public void onPacketSending(PacketEvent event) {
        Player player = event.getPlayer();
        PacketContainer packet = event.getPacket();

        if (packet.getType() == PacketType.Play.Server.SET_SLOT) {
            ItemStack item = packet.getItemModifier().read(0);
            packet.getItemModifier().write(0, addEnchantLore(player, item));
        }

        if (packet.getType() == PacketType.Play.Server.WINDOW_ITEMS) {
            List<ItemStack> items = packet.getItemListModifier().read(0);
            items.replaceAll(item -> addEnchantLore(player, item));
            packet.getItemListModifier().write(0, items);
        }
    }

    private ItemStack addEnchantLore(Player player, ItemStack item) {
        item = item.clone();
        ItemMeta meta = item.getItemMeta();
        if (meta == null) {
            return item;
        }

        List<String> lore = new ArrayList<>();
        for (AbstractEnchant enchant : TurboAPI.getEnchantManager().getEnchants(item).keySet()) {
            lore.add(enchant.generateLore(player, item));
        }

        if (meta.hasLore()) {
            lore.addAll(meta.getLore());
        }

        meta.setLore(lore);
        item.setItemMeta(meta);
        return item;
    }```
smoky anchor
#

You testing this on creative ?

dawn flower
#

yes

smoky anchor
#

Ye well that's your problem

#

The creative inventory is whacky

dawn flower
#

who made the creative inventory

#

i want to have a small talk with him

valid basin
dawn flower
#

anyways tysm i've been trying to fix this for a long time

smoky anchor
#

I've had the same problem when I was trying to hide nbt from client
the nbt was just going away 'cause player in creative has complete control over their inventory

slim wigeon
#

...[05:07:14] [Server thread/WARN]: MrnateGeek moved wrongly!

smoky anchor
#

Just don't

slim wigeon
smoky anchor
#

Idk, I'm just making joke
Just move correctly

slim wigeon
#

It might be this stone walls near my miner machine, Mojang set its hit boxes wrongly. I not against either. Its perfect the way it is

flint coyote
#

Hmm why does this happen?

getServer().getPluginManager().registerEvent(CreatureSpawnEvent.class, this, EventPriority.NORMAL, (listener, event) -> {
            System.out.println("Creature Spawn Event called with " + event.getClass());
        }, this);
[STDOUT] Creature Spawn Event called with class org.bukkit.event.entity.ItemSpawnEvent
``` Sounds like a bug to me because ItemSpawnEvent does not extend CreatureSpawnEvent
smoky anchor
#

Mojang set its hit boxes wrongly
What do you mean ?

#

Items are not creatures

#

what

flint coyote
#

exactly, so why is my event called anyway?

slim wigeon
#

I cannot re-create the bug but if you seen it, you know what I mean

smoky anchor
slim wigeon
#

Its unrelated to spigot. Are your PMs open? I might can show you

smoky anchor
#

ye sure you can DM me that, I'm curious

flint coyote
#

I'll make a bug report later I guess

dawn flower
#
    @EventHandler
    public void onPrepareAnvil(PrepareAnvilEvent e) {
        AbstractEnchantManager enchantManager = TurboAPI.getEnchantManager();
        ItemStack first = e.getInventory().getItem(0);
        ItemStack second = e.getInventory().getItem(1);

        if (first == null || second == null || enchantManager == null ||
                enchantManager.getEnchants(second).isEmpty()) {
            return;
        }

        ItemStack result = first.clone();
        for (Map.Entry<AbstractEnchant, Integer> entry : enchantManager.getEnchants(second).entrySet()) {
            if (!entry.getKey().canApply(result)) {
                continue;
            }

            enchantManager.applyEnchant(result, entry.getKey(), entry.getValue());
        }

        e.setResult(result);
    }```

when creative, it works, but when survival the result appears for a split second then disappears
eternal night
#

CreatureSpawnEvent does not have its own handler list

#

neither does ItemSpawnEvent

#

the executor is responsible for ensuring only the correct instances are passed to the listener

flint coyote
#

So I have to check myself whether I get the correct event, despite I said I want this specific one? Why can't that check be in spigot?

#

Doing it in the executor is possible and I did that as a workaround but it seems off to me

eternal night
#

this system is eons old ¯_(ツ)_/¯

flint coyote
#

It's a one liner 😭

eternal night
#

but this is the way it is supposed to work

#

well

valid burrow
#

@flint coyote pr it if you care so much lol

eternal night
#

and get it clapped stonks

flint coyote
eternal night
#

The registered listener would have to start tracking that now

#

or the methods would need to wrap your EventExecutor

echo basalt
#

wasn't there an issue where it passed the wrong event?

flint coyote
#

Yeah it just did but apparantly that's working as intended

echo basalt
#

I mean passing the wrong subclass

#

like listening to ItemSpawn and it passing CreatureSpawn

slim wigeon
echo basalt
#

I recall having errors w that

flint coyote
#

yeah exactly the same issue here

echo basalt
#

yeah just do a class.isInstance check

eternal night
#

yea because itemspawn and creature spawn are both just registered into the entity spawn handlerlist

echo basalt
#

exactly

flint coyote
#

I did it with isAssignableFrom but yeah

#

Alright guess I'll not open a bug report if that's working as intended

#

Could at least get a warning in the javadoc though

jagged thicket
rough drift
#

It should iirc

jagged thicket
#

nvm it has

molten hearth
#

lmao i was looking for the same info

#

did you get it/try it?

#

my uni prof mentioned his dept has been using it successfully

echo basalt
#

guy at work uses it

#

They bought out supermaven which has really good AI autocompletion

#

and they're prob using it

#

so I'd have high expectations

rough drift
#

I looked at cursor, looks oddly familiar

echo basalt
#

it's a vscode fork

rough drift
#

I will

#

shoot

haughty storm
#

When uploading a resource on spigotmc, how would I best add a resource pack to the resource? Should i just use an external upload service andlink it or does spigotmc provide a better alternative

blazing ocean
#

it does not

echo basalt
#

prob just embed it in the resources folder n shi

blazing ocean
#

serve on the minecraft port 🔥

haughty storm
echo basalt
#

mm enterprise code I made a pdc wrapper

#

such quality code

jaunty gazelle
#

anyone recommend a good quickstart guide on the spigot api

blazing ocean
#

could have something in your data directory downloaded from some asset repo or something

#

it's close to what I do at work

#

I clone the asset repo and compile the resource pack to a seperate directory and zip it

proper cobalt
#

i have this

which is called in onEnable which does

Bukkit.getServer().getPluginManager().registerEvents(new DeathbanListener(), HCF.getInstance());
in its constructor
and look at the class

public class DeathbanListener implements Listener {
    private final DeathbanManager deathbanManager = HCF.getInstance().getDeathbanManager();

    @EventHandler
    private void onPlayerDeath(PlayerDeathEvent event) {
        final Player player = event.getEntity();

        if (deathbanManager.containsKey(player.getUniqueId())) {
            return;
        }

        long banTime = System.currentTimeMillis() + (HCFConfig.Deathban.DEATHBAN_TIME * 1000L);
        deathbanManager.put(player.getUniqueId(), banTime);
    }

    @EventHandler
    private void onPlayerRespawn(PlayerRespawnEvent event) {
        if (deathbanManager.containsKey(event.getPlayer().getUniqueId())) {
            event.getPlayer().sendMessage("ur in the thing");
        }
    }
}```
#

but its telling me deathbanManager is null

#

in the Listener

#

how is that possible

jaunty gazelle
#

when do i get embed perms btw

#

at what level

blazing ocean
#

?img

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

jaunty gazelle
#

!verify

undone axleBOT
#

Usage: !verify <forums username>

jaunty gazelle
#

oh hell nah

#

im using lightshot

#

🙏

#

🙏

#

pain.

blazing ocean
#

?

proper cobalt
#

huh why did my message get deleted

remote swallow
#

did it have something like get bukkit in it

dawn flower
#

is there something like PrepareAnvilEvent but also works when you shift click an item into the anvil

valid basin
#

Does someone know how I could disable swimming in modern versions to only allow the player to slowly swim (like it was in 1.8.8 versions) I've tried modifying the entity_metadata packet to cancel the event when it changes to swimming but it doesn't seem to work. If someone knows a better way I'd appreciate it

#

The spigot api methods don't really work reliably like like setSwimming

smoky anchor
#

Solution: stop supporting cross-version support with version difference of a DECADE

valid basin
#

I'm not supporting cross-version bro

#

I'm just trying to return the 1.8.8 features to 1.20

#

using packets

smoky anchor
#

But whyy
That's horryfing

valid basin
#

I've follow the entity metadata format

#

Pose VarInt Enum STANDING = 0, FALL_FLYING = 1, SLEEPING = 2, SWIMMING = 3, SPIN_ATTACK = 4, SNEAKING = 5, LONG_JUMPING = 6, DYING = 7, CROAKING = 8, USING_TONGUE = 9, SITTING = 10, ROARING = 11, SNIFFING = 12, EMERGING = 13, DIGGING = 14, (1.21.3: SLIDING = 15, SHOOTING = 16, INHALING = 17)

#

but it doesn't seem to work

smoky anchor
#

And don't call the lack of proper swimming a "feature"

#

Sorry, I'll see myself out

valid basin
#

Should I call it a de-feature then xD

kind hatch
#

We call that a regression.

valid basin
#

This is my code

#
        ProtocolManager protocolManager = ProtocolLibrary.getProtocolManager();

        protocolManager.addPacketListener(new PacketAdapter(plugin, ListenerPriority.NORMAL, PacketType.Play.Server.ENTITY_METADATA) {
            @Override
            public void onPacketSending(PacketEvent event) {
                List<WrappedWatchableObject> metadataList = event.getPacket().getWatchableCollectionModifier().read(0);
                if (metadataList == null) return;

                for (WrappedWatchableObject meta : metadataList) {
                    if (meta.getIndex() == 21) {
                        try {
                            Object value = meta.getValue();
                            if (value instanceof Number) {
                                int pose = ((Number) value).intValue();
                                if (pose == 3) { // SWIMMING ACCORDING TO WIKI
                                    event.setCancelled(true);
                                    return;
                                }
                            } else if (value instanceof Enum<?> poseEnum) {
                                // JUST A FALL BACK IG
                                if (poseEnum.ordinal() == 3) { // SWIMMING
                                    event.setCancelled(true);
                                    return;
                                }
                            }
                        } catch (IllegalArgumentException ex) {
                            event.setCancelled(true);
                            return;
                        }
                    }
                }
            }
        });

        plugin.getLogger().info("Modern swimming packets canceled so players can never swim.");
    }```
echo basalt
#

problem is the client's doing predictions

#

and no, that won't work because you're using the legacy wrapped watchble collection instead of WrappedDataValue iirc

thorn isle
#

i very vaguely remember the swimming/crawling pose being controllable from server side

#

i'm not sure how much prediction the client does on it

rough ibex
#

You can do it but everytime the client tries to swim theyll be bounced back and its super annoying

thorn isle
#

set their hunger to 0 🤡

quaint mantle
#

hi!

#

how do I go about using NMS? I have probably never used it, and I may need to right now. I want to add a few new tools to the game with custom mining speeds and stuff. I tried to modifying the attributes, ending up changing block_breaking_speed but that made a pickaxe which could instamine wood. So, um, how should I get started with NMS?

smoky anchor
#

?nms

smoky anchor
quaint mantle
#

what could I do otherwise?

thorn isle
#

iirc you can do that with datapacks

smoky anchor
#

Modify the tool component on the item or correctly use the attributes

chrome beacon
#

mining_efficiency attribute

quaint mantle
# chrome beacon mining_efficiency attribute

I tried that next. I was tinkering with the attributes and gave myself one with a command generated from mcstacker but it did not seem to affect the mining speed at all for anything.

thorn isle
quaint mantle
thorn isle
#

alternatively this

#

no clue if there is api for it though

smoky anchor
#

Yes, there is API

#

You do not need a datapack for any of this

thorn isle
#

neat

smoky anchor
#

And datapack would not help in any way at all
Again, you're just modifying an item which you can do with a /give

thorn isle
#

gone are the days of listening to fucking block damage packets and updating the block breaking process every tick in a scheduler task

quaint mantle
quaint mantle
#

or something else that fits what I am trying to do here?

thorn isle
#

apparently yes

#

i've yet to use it though so i don't know the names off the top of my head

#

try digging around the itemmeta docs and searching for "component" or such

#

logic would dictate that this would be ToolComponent but logic and bukkit don't go well together

smoky anchor
#

You can use the ItemMeta to get the tool component
Then modify that and set it back

#

It's not an API for "creating tools" exactly, but it does allow you to create tools

thorn isle
#

it IS toolcomponent

#

i'm amazed

#

is there api for getting the default toolcomponent from item material?

#

to e.g. use an existing vanilla tool as a base

quaint mantle
#

Btw, does this new components thing replace the old NBT system?

thorn isle
#

yes

smoky anchor
#

In a way, yes

#

NBT remains the save format for data

quaint mantle
#

other than serialisation.

thorn isle
quaint mantle
#

I just noticed that {} from the give command is gone and has been replaced with [] instead.

thorn isle
#

there is a CUSTOM component that still holds raw NBT

#

but apart from that, items at runtime are handled entirely as components

#

which are in principle immutable

#

which, if you ask me, is probably the best thing to happen since waterlogging

smoky anchor
#

Waterlogging is a terrible hack imo

thorn isle
#

well yes but it does look cool

smoky anchor
#

yes

slender elbow
quaint mantle
#

wow. Seems kind of nice. I should probably get more familiar with this stuff.

slender elbow
#

you see, itemmeta is a very good, highly flexible system

thorn isle
#

do we have a facility to get the base component

#

like on the bukkit itemfactory maybe

slender elbow
#

you have some methods in Material like getDefaultAttributeModifiers, getMaxDurability or whatever etc

#

but not really

thorn isle
#

kind of ass but i suppose hardcoding the properties of the vanilla tools isn't that much work, so whatever

slender elbow
#

in my opinion this is a fundamental flaw in the api

#

but i don't care because i don't use itemmeta

thorn isle
#

do we have something better

#

i know paper has some sort of data component api but i've yet to use it

slender elbow
#

if by "we" you mean spigot api, no

#

if you are using paper api, paper has their data components api, but you should ask in the paper discord about that

#

there's a docs page etc

fossil cypress
#

Is it possible to stop a minecart from going downhill on slopes?

mortal vortex
smoky anchor
#

maybe try to describe more of what you're doing

worthy yarrow
#

Given what's available through api, you'll probably have to describe when the minecart should slow down... programmatically that is

torn shuttle
#

honestly there's a 2 week free trial and I feel like 2 weeks is not enough time to justify the effort of migrating my current projects to try to use it

#

I have 5-6 different projects open in my IDE right now, I don't want to have to reconfigure everything

#

if it was 1 month I might consider it

bright spire
#

Guys do anyone knows how to fix the client-side visual issue where the player is shown normally when right clicking after switching from one slot to another while right clicking? I need to know how to fix this from spigot itself

#

The player is shown not rightclicking for example not using the bow when you switch slots while right clicking

#

But you can shoot arrows and so

cinder abyss
#

Hello, how can I get the knockback resistance of an entity ? (I want to make a function to deal knockback using an entity and an ItemStack without dealing damages)

cinder abyss
remote swallow
#

afaik best bet is just checking the entity and equipment

cinder abyss
#

what's the function to get his attributes ? I'm using at least spigot 1.17

cinder abyss
cinder abyss
#

Hello, how can I get the attack damage of an ItemStack ?

#

I tried meta.getAttributeModifiers(Attribute.GENERIC_ATTACK_DAMAGE) but it's null (for a Wooden Axe)
which should return me 7

young knoll
#

You need to use the default attributes for items that don’t have any explicit attributes set

#

Material#getDefaultAttributeModifiers iirc

cinder abyss
#

okay thanks

mortal vortex
manic delta
#

Guys I'm doing a #player.hidePlayer(target) and I'm sending a packet from the tab so that the player doesn't disappear from the tab but for some reason it disappear from the autocomplete, but as have it currently the target disappears from autocomplete but I don't want that to happen, any ideas?

#

I want to do it like this to "hide" players in modal spawns when I do big events but I don't want them to be hidden from the tab or autocomplete, just physically.

#

I'm currently using packetevents for this, it works just the problem is the autocompletion

private void sendHidePacket(Player server, Player toHide){
        try{
            UserProfile profile = new UserProfile(toHide.getUniqueId(), toHide.getName(), new ArrayList<>());

            WrapperPlayServerPlayerInfoUpdate.PlayerInfo info = new WrapperPlayServerPlayerInfoUpdate.PlayerInfo(
                    profile,
                    true,
                    toHide.getPing(),
                    GameMode.SURVIVAL,
                    Component.text(toHide.getName()),
                    null
            );

            EnumSet<WrapperPlayServerPlayerInfoUpdate.Action> actions = EnumSet.of(
                    WrapperPlayServerPlayerInfoUpdate.Action.ADD_PLAYER,
                    WrapperPlayServerPlayerInfoUpdate.Action.UPDATE_LISTED,
            );

            WrapperPlayServerPlayerInfoUpdate packet = new WrapperPlayServerPlayerInfoUpdate(actions, info);

            Object usersChannel = PacketEvents.getAPI().getProtocolManager().getChannel(server.getUniqueId());
            PacketEvents.getAPI().getProtocolManager().sendPacket(usersChannel, packet);
        }catch (NullPointerException ignored){}
    }
dense falcon
#
        ItemStack helmet = new ItemStack(Material.LEATHER_HELMET, 1);
        ItemStack chestplate = new ItemStack(Material.LEATHER_CHESTPLATE, 1);
        ItemStack leggings = new ItemStack(Material.LEATHER_LEGGINGS, 1);
        ItemStack boots = new ItemStack(Material.LEATHER_BOOTS, 1);

How may I add a color to leather armor?

young knoll
#

LeatherArmorMeta

raw abyss
#

im trying to detect player left clicks and set a scoreboard accordingly for use in command blocks. Am I over complicating things, and would this even work? I've never made a plugin before lol.

@EventHandler
public void onPlayerAnimation(PlayerAnimationEvent event) {
    if (event.getAnimationType() == PlayerAnimationType.ARM_SWING) {
        Player player = event.getPlayer();
        Bukkit.dispatchCommand(
            Bukkit.getConsoleSender(),
            "scoreboard players add " + player.getName() + " LeftClicks 1"
        );
    }
}
drowsy helm
#

and check if action is left click

raw abyss
#

but would that work with any type of left clicking? Like hitting an entity, air, breaking a block, etc

drowsy helm
#

breaking a block is counted as one click

raw abyss
#

left clicking

drowsy helm
#

but if we are talking arm swing it would be counted as multiple

#

but yes, it would cover all of those things

#

animation event just isn't reliable enough to determine whether it was a click

raw abyss
#

oh okay

#

so uh, how would i do that lol

#

nvm ill figure it out eventually

drowsy helm
#

use getAction to determine click type

torn shuttle
#

how do cool kids prevent players from moving in a safe way these days? I know

  • cancelling the movement event
  • forcing them to mount a static entity
  • setting their movement speed attribute to 0

but I don't like the first because it looks horrible, I don't like the second one in general and I don't like the third one because it's horribly unsafe in case of crashes and such

#

oh right and potion effects

#

but that doesn't really fully stop them

tranquil pecan
tranquil pecan
torn shuttle
#

you run into the issue where a server can crash and then people boot it back up with the plugin removed

tranquil pecan
#

How a server crash can remove a plugin

torn shuttle
#

not what I said

#

the admins can remove it after a crash

buoyant viper
#

like a door or button

#

or lever

#

etc

tranquil pecan
#

Well, you are just creating your own problems 💀

#

I don't think there are more methods

dapper night
#

Whats the diference between these 2 in regex?
(.{0,7})
([.]{0,7})

#

😭

dry hazel
#

no difference

#

well actually if the first dot isn't escaped, then it will match any character

#

but I presume discord just removed the escape

orchid trout
#

works really wel

#

l

dapper night
#

sorry for dm just images not alowed to me

dry hazel
#

first one matches any character 0 to 7 times, second one matches a dot 0 to 7 times

dapper night
#

it doesnt do that thats the problem

#

im trying to match any character in both

#

also space

quasi warren
#

Is this where I'd ask for someone to make a custom plugin for me.

dapper night
#

oh it actualy does but if it matches it cancels other things out

#

i understand problem now

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

dapper night
#

. stands for any character when in clouse

quasi warren
#

Anybody know where I'd post for needing a commissioned plug in?

dapper night
#

. is any symbol when not in clouse

#

[ ] <-- by clouses i mean this

dry hazel
#

yeah it makes a character set to match against

#

you can also put a backslash before the dot, that escapes it

dapper night
#

Lmao thank you making my life easyer as server owner, since getting like 300 dms on how to forward ports or how to make server thats super anoying, im not google lol.

slim wigeon
#

What effect is item pickup? Like effect for block breaking is STEP_SOUND

smoky anchor
slim wigeon
#

I think I tried that once in 1.19.3 but its not realitic (Single pitch)

#

Not knowing the values is a task in its self

#

So if you know where I can get these, that be helpful and I might can create a array. So it can get a value at random

smoky anchor
#

I don't think you need to make an array... just call the Math.random or whatever
But you can take a look at vanilla source code. It's easy if you depend on NMS.

slim wigeon
#

I don't want to use the NMS

smoky anchor
#

I'm not telling you to use NMS, I'm saying that it's the easiest way for you to check the server code

#

Some guy used ((random.nextFloat() - random.nextFloat()) * 0.7F + 1.0F) * 2.0F to make the pitch I think
0.2f for volume it seemed. But the post is 13 years old, so idk if it's right :D

slim wigeon
#

I might test that, thanks

smoky anchor
#

Nice
For future reference, I just googled "spigot item pickup sound" and got here

slim wigeon
#

I don't want to increase anything but thanks

smoky anchor
#

My intention with this message was to teach you a bit how to search this information yourself

slim wigeon
#

I see. But I get more updated version of the code when I ask here

mortal vortex
rough ibex
#

Event driven architecture with multiple components that might need to know about each other but have generally separate responsibilities sure is making my brain work

outer tendon
#

I keep getting a ticking block entity issue now that I've made changes to the populate method in my BlockPopulator, but I don't really understand what that means. Everything online about it pretty much says it has to do with mods, and that I need to restore an older version of the server or whatever, but I can't figure out what is causing it.

smoky anchor
#

?paste can you paste the whole error and your BlockPopulator

undone axleBOT
echo basalt
#

ug generics

#

gotta throw ? super T on literally everything

slender elbow
#

yeah

#

woo!

chrome beacon
#

Remember the PECS uwu

slender elbow
#

"but i have a list" :4head:

gentle iris
#

im going insane

#

does anyone know how to add libraries in intellij?

#

i need to add the Reflections library-- ive been adding it as a dependency and intellij seems to recognize it when im coding

#

but when i build the artifact... its just not there

#

when running the plugin, it errors "java.lang.NoClassDefFoundError: org/reflections/Reflections" and disables itself

#

I've been going around for half the day on the internet and everyone says "just add the maven dependency to the pom.xml" but I HAVE!

#

and it STILL doesn't compile to the artifact

echo basalt
#

You gotta shade it

gentle iris
#

ive seen other people say the same thing

echo basalt
#

?shade

#

bruh

#

?shadow

#

?maven-shade

gentle iris
#

then say "just google it lol"

echo basalt
#

bot pls

#

there's a guide

gentle iris
#

and then i do and i still dont understand

echo basalt
#

rip can't find it

#

Anyways you need to setup the maven-shade plugin in your pom

#

and remove the <scope>provided</scope> for anything that needs shading

gentle iris
#

i... cant upload files to this channel, but i have the maven-shade plugin and the dependencies that need to be compiled don't have a scope

vast ledge
#

?paste

undone axleBOT
gentle iris
#

also tried defining scope as compile

#

oh ty

#

I need both Commons and Reflections in the built artifact

#

but using the build command on intellij... outputs a .jar without either of the dependencies

#

so, if I need to shade those, how should I do that?

#

ugh, i think i found it

#

apparently, despite picking maven as my dependency manager, I have to use the maven build command instead of just the build command

peak depot
#

is it against spigot rules to do a global ban database?

valid burrow
#

someone already tried that

#

more than once

#

problem is

#

its very hard to moderate

#

people can just bot report someone resulting in thmw being banned everyhwere

peak depot
#

but when catdatabase

valid burrow
#

:p

valid burrow
#

like ip scores?

peak depot
#

more or less basic thing is a clone of gommehd guardin system

vast ledge
#

if it were IP based

valid burrow
#

thats not what i said

#

i said LIKE ip score

#

not using ip

peak depot
#

would then be like UUID or smth

#

gotta come up with an idea

valid burrow
#

Fraud score

#

maybe youre more familiar with that term

peak depot
#

but before I do that imma get better with design patterns

vast ledge
#

But selling accounts would still become an issue wouldn't it?

peak depot
#

if its an fresh account it has a good trust factor then yeah

jagged thicket
vast ledge
#

fr

slim wigeon
#

I wish there is some way I can have a inventory in a item either than setting its contents

vast ledge
#

Either you had a stroke or i can't read

peak depot
smoky anchor
#

Guy's just not very proficient in English

peak depot
#

neither am i

slim wigeon
blazing ocean
#

I mean one can notice you aren't

slim wigeon
#

Be careful trying to reply to people, there is a staff impersonator on the lose

blazing ocean
#

KEKW

#

You've got to be trolling at this point

slim wigeon
blazing ocean
#

I saw what they said

#

Saying that you shouldn't be tagging people unnecessarily does not mean they are trying to impersonate staff

slim wigeon
#

I just want to hear that from a staff member their selfs because it might not be in the rules. And if its not like the rule became a thing, its just better that I hear it from the staff for updated info

blazing ocean
#

Just because something isn't a rule doesn't mean it's not unnecessary, lol

slim wigeon
#

I was just replying to people

blazing ocean
#

Right and they said that tagging people unnecessarily like that is unnecessary and you shouldn't do it

slim wigeon
#

So I cannot reply to people??

slim wigeon
blazing ocean
#

not what they said

slim wigeon
#

That is what I did and they think it was pinging

blazing ocean
#

replying pings the sender by default

smoky anchor
#

I am starting to see why ppl block you....

blazing ocean
#

only now? kek

rough ibex
#

Having a conversation is ILLEGAL punishable by DEATH

blazing ocean
#

can't even be talking in 2025 anymore, smh

smoky anchor
#

_ _

blazing ocean
#

was about to say that

smoky anchor
slim wigeon
#

I just like to hear it from the staff members because people can say stuff completely false, that is my point. I was not trying to go against you but if you want to block me, I guess we don't have to talk. You would have said, you don't like to be pinged and I would not reply to your messages. Its just you said people and that is what set this off

remote swallow
#

Not pointless ping trust me

rough ibex
#

Going from replying pinging to impersonating staff is a wild jump

#

frogger cant make that shit

blazing ocean
remote swallow
#

It's just common courtesy, pointless response doesn't need a ping

rough ibex
#

Frogs are my favorite animal

remote swallow
#

Wait omg he's gonna tell us we're talking about this in help dev and tell us to go to general even when choco is here doing the same thing

blazing ocean
#

:frogpet:

#

fuck rip my nitro

slim wigeon
#

Maybe we should go there since the staff is there most times and I can get my point proven

blazing ocean
#

kekw

rough ibex
#

Lets do that

echo basalt
#

what's the big deal?

slim wigeon
#

I just wish they have a support system either than the forums. That can really help with times like this

eternal night
#

@blazing ocean where pink

blazing ocean
blazing ocean
slim wigeon
#

I not crying, I just annoyed

echo basalt
#

yeah you shouldn't ping people needlessly

#

mostly due to this

blazing ocean
eternal night
blazing ocean
#

discord not loading

echo basalt
#

If you need specific help then consider reaching out to the person directly

#

BUT you should only do that if the person's comfortable with that

#

For example I have a "Don't DM me unless work-related or asked for." because I find it annoying to be responsible for helping you

#

and if you have any issues now I'm on the hook to also fix those

blazing ocean
#

@eternal night frogpet

smoky anchor
#

It's not even that. Person was asking for help, this guy ping replied literally with "..." Which imo is quite annoying

echo basalt
#

TL;DR - Ask in public, be patient and someone will answer you, being picky about who helps you is overall annoying unless it's a niche issue and you guys are friends

#

In which case you're probably comfortable enough to reach out over DMs

eternal night
#

danke danke NODDERS looks a lot better

slim wigeon
#

I going to start copying the message with my reply, thanks. If someone does not like that, have a staff member tell me. Otherwise, I see this server extremely strict

echo basalt
#

Belittling people by going "..." only shows you're ignorant

eternal night
#

....

#

goes hard tho

echo basalt
#

it does

echo basalt
slim wigeon
#

Imlllusion: Belittling people by going "..." only shows you're ignorantMaybe there needs to be a filter that blocking these messages since people has a HUGE issue with it

blazing ocean
#

wha

#

I'm so confused at this point

eternal night
#

MrnateGeek: Imlllusion: Belittling people by going "..." only shows you're ignorant Maybe there needs to be a filter that blocking these messages since people has a HUGE issue with it
wtf is happening

echo basalt
#

this guy's arguing against everyone because he thinks he's right

#

... is contextual

smoky anchor
#

What have I done...

blazing ocean
#

lynxplay: MrnateGeek: Imlllusion: Belittling people by going "..." only shows you're ignorant Maybe there needs to be a filter that blocking these messages since people has a HUGE issue with it
wtf is happening
can we stop with these

echo basalt
#

Banning it outright is stupid

#

what kind of crybaby starts a whole war over pinging someone going "..."

eternal night
echo basalt
#

let's take it to email

blazing ocean
#

lynxplay: rad: lynxplay: MrnateGeek: Imlllusion: Belittling people by going "..." only shows you're ignorant Maybe there needs to be a filter that blocking these messages since people has a HUGE issue with it
wtf is happening
can we stop with these
no, this is now an email chain
do we get a mailing list at least

smoky anchor
#

Never have I thought that this would "blow up" this much
This is fucking stupid

blazing ocean
#

spigot in a nutshell

rough drift
#

wrong chat

eternal night
#

kekegaSlide2X I just noticed this isn't #general

blazing ocean
peak depot
#

btw does bungeecord support hexcodes by now?

slim wigeon
#

Since this is little relaxed I hope. I going to say this. It takes alot to make me cry, I have not cried in years. Since someone thinking this was #general , that is why I say to bring it there. Most people don't look at the #channel-name so they send a message to wrong channels. Its not a huge issue but this is what I wish to avoid

rough ibex
#

is this guy still going

blazing ocean
#

has been since they joined spigot

rough ibex
#

:hollow:

slender elbow
#

no-one cares

blazing ocean
#

@no-one

slim wigeon
#

Someone needs to transform this channel back to what this is meant for, you know what I mean

eternal night
remote swallow
#

No one is asking for help atm it really doesn't matter

slender elbow
#

i need help

peak depot
remote swallow
slender elbow
#

"like back then with patterns" ?

eternal night
#

like §x§f§f§f§f

#

or whatever it was?

blazing ocean
#

unusualXRepeatingHexThing whatever it's called in adventure

remote swallow
#

Use unusual x repeating hex format

peak depot
# slender elbow "like back then with patterns" ?
private static final Pattern pattern = Pattern.compile("#[a-fA-F0-9]{6}");

public static String hexColor(String message) {
    Matcher matcher = pattern.matcher(message);

    while (matcher.find()) {
        String color = message.substring(matcher.start(), matcher.end());
        message = message.replace(color, "" + ChatColor.of(color));
        matcher = pattern.matcher(message);
    }

    return ChatColor.translateAlternateColorCodes('&', message);
}
blazing ocean
jagged thicket
#

we use whatever channel we want

#

(btw no hate to paper) !!

blazing ocean
echo basalt
slender elbow
#

bungee components have supported rgb since rgb was a thing, but the format has and will always be ass

peak depot
#

so like this wont work or what &#00bfff"Test"

shadow ocean
#

Can any one help me with a plugin

echo basalt
#

no

shadow ocean
#

😢

slender elbow
#

not simply with translateAlternateColorCodes

echo basalt
shadow ocean
#

Plssss

shadow ocean
#

Ho

blazing ocean
#

ho ho ho?

peak depot
#

its not christmas rad

blazing ocean
#

chill it's only like... march

peak depot
slim wigeon
jagged thicket
#

what about you?

#

sometimes i use paper too

slender elbow
slim wigeon
#

Either of them are bad but trying to get support from one while using another is impossible. Like I cannot use Paper if I want to ask here

worthy yarrow
jagged thicket
#

i have to ammend uuid behind commands to prevent duplications 💀

worthy yarrow
#

I’ve only used it for one thing, colors

jagged thicket
#

yeah same

rough ibex
#

adventure used to have a small minimessage->spigot package

jagged thicket
#

yeah

rough ibex
#

they got rid of it and merged it with the big one

worthy yarrow
#

Mhm

rough ibex
#

I'm not shading your entire library

#

fuck off

worthy yarrow
#

It’s fucked

jagged thicket
slim wigeon
#

...

rough ibex
#

JSON it is then

blazing ocean
jagged thicket
#

idk when they added it

#

i did it like 2 years ago

#

i haven't used adventure after that

worthy yarrow
slim wigeon
#

UUIDs are useful if you trying to prevent copies. I use this to prevent chests from stacking since its a portable chests (Can be accessed via right-click)

rough ibex
#

we know what UUIDs are

worthy yarrow
#

I don’t, please tell me more

rough ibex
#

we take 2 longs and stick them together

#

or 4 ints

#

and then randomize all the bits

worthy yarrow
#

Well dang

rough ibex
#

most of the bits

worthy yarrow
#

Sounds like a lot of work, and for that reason… I’m out

rough ibex
#

some bits are kept to tell what kind of UUID it is

worthy yarrow
#

Hold on I didn’t know there were “typed” uuids?

slim wigeon
#

Example: b8b817a1-ebd2-4837-b901-7c892684d29a

#

UUIDv4

#

?

#

What are you trying to do?

rough ibex
#

make a joke dude

slim wigeon
#

Keep in mind this is a PG-13 server

rough ibex
#

stop impersonating staff

#

and minimodding

eternal night
eternal oxide
#

Show me a PG-13 rule?

worthy yarrow
rough ibex
#

me throwing the accusations back at you

slim wigeon
rough ibex
#

'pee is stored in the balls' is not sexual nature omegalul

blazing ocean
eternal oxide
slim wigeon
rough ibex
#

thats quite the ideological leap

blazing ocean
#

what

#

I'm literally so confused by this person

worthy yarrow
#

I cant find the gif god damnit

ivory sleet
#

Excuse me buddy but what?

young vine
#

You are a moderator btw.

young vine
peak depot
#

why does this:

    private  static final char COLOR_CHAR = ChatColor.COLOR_CHAR;

    public static String translateHexColorCodes(String startTag, String endTag, String message)
    {
        final Pattern hexPattern = Pattern.compile(startTag + "([A-Fa-f0-9]{6})" + endTag);
        Matcher matcher = hexPattern.matcher(message);
        StringBuffer buffer = new StringBuffer(message.length() + 4 * 8);
        while (matcher.find())
        {
            String group = matcher.group(1);
            matcher.appendReplacement(buffer, COLOR_CHAR + "x"
                    + COLOR_CHAR + group.charAt(0) + COLOR_CHAR + group.charAt(1)
                    + COLOR_CHAR + group.charAt(2) + COLOR_CHAR + group.charAt(3)
                    + COLOR_CHAR + group.charAt(4) + COLOR_CHAR + group.charAt(5)
            );
        }
        return matcher.appendTail(buffer).toString();
    }

        sender.sendMessage(new TextComponent(ChatColor.translateAlternateColorCodes('&', Colors.translateHexColorCodes("&#", "", "This is a message with color &#FF5733some text and &#33FF57more text!"))));

returns the img code from (https://www.spigotmc.org/threads/hex-color-code-translate.449748/#post-3867804)

smoky anchor
#

Your regex returns only one group I believe nvm, I can't read

wanton kindle
#

Do you know a utils for create Config File or a MiniGameMapManager ?

ivory sleet
ivory sleet
peak depot
peak depot
ivory sleet
peak depot
#

the &#

ivory sleet
#

its not inside the group

#

ur pattern is &#([a-fA-F0-9]{6})

#

notice &# is outside

zealous scroll
#

anyone know why AnvilView#getRenameText returns null but AnvilInventory#getRenameText doesn't?
My IDE's throwing errors for the latter because it's deprecated and marked for removal, but only that one works

fair rock
slim wigeon
#

Regex101 is useful

peak depot
#

so it should be like that? (&#[A-Fa-f0-9]{6})

fair rock
#

But to be fair i saw into the method of appendReplacement and it should work. The replacement "worked" and "didnt worked" at the same time

peak depot
#

yeah I dont know I know that there was a good lib for that but I dont rember its name

fair rock
#

Can you tell me what the result should be?

peak depot
#

just the string with the right hexcolor

fair rock
#

Your method prints me: "This is a message with color §x§F§F§5§7§3§3some text and §x§3§3§F§F§5§7more text!"
I dont have your error, lmao

peak depot
#

and its not the right color

slender elbow
fair rock
#

That looks kinda sexy, one liner

peak depot
#

doesnt work tho

#

wasnt there an api that was also be able to do like <color=#HEX>Message</color>?

slender elbow
#

you forgot to add the 0x

blazing ocean
#

minimessage

slender elbow
#

but what you're saying is called minimessage and not a few hours ago everyone was like "ew bundling adventure 🤢" so idk do with that as you will

blazing ocean
#

there's an easy solution to that, you'll just get bullied for mentioning it however

fair rock
#

Deinstalling all IDEs and go out and be happy?

blazing ocean
#

not quite it

fair rock
peak depot
#

yeah

slender elbow
#

idk if the console logger supports random hex colors

fair rock
#

Question. Which version you are currently on (Minecraft)?

peak depot
#

its not logger

slender elbow
#

also windows and cmd/conhost is certainly a choice that will affect how that turns out 🌚

peak depot
#

1.19 iirc

slender elbow
#

don't do new TextComponent(legacy shit)

#

use TextComponent.fromLegacy

fair rock
#

Would be funny if its now fixed

peak depot
#

nah

#

no difference

slender elbow
#

try doing it in-game rather than on the console

peak depot
#

gimmi a sec

#

need to do a server then

#

why does build tools take so long

#

:peporage:

proper cobalt
#

any command frameworks that work on 1.7.10?

peak depot
#

brother bout to get smacked for that question

fair rock
#

I just died after reading 1.7

proper cobalt
#

there was a good annotation based on iirc

#

cant remember the name

peak depot
#

thats is anno based

proper cobalt
#

kk thx

peak depot
#

Im not hating on the version unlike rad would but what you doing in 1.7

proper cobalt
#

developing

peak depot
#

yeah but pvp or what

ivory sleet
#

MAYBeeee, acf still works on 1.7, like maybe maybe?

proper cobalt
#

i just dont really understand arguments on acf

peak depot
proper cobalt
peak depot
#

also what is this game by now

#

I spawn somewhere in a fake swamp

#

wtf is a closed eyeblossom

zealous scroll
#
final float yaw = location.getYaw() + 90;
final float pitch = location.getPitch();
final float roll = 0.0f;

Bukkit.broadcastMessage(ChatColor.GREEN + "Yaw: " + yaw + " Pitch: " + pitch + " Roll: " + roll);
spawned.setHeadPose(new EulerAngle(pitch, yaw, roll));

does anyone know the math to convert yaw and pitch to a EulerAngle?

peak depot
#
final double yawRadians = Math.toRadians(location.getYaw() + 90);
final double pitchRadians = Math.toRadians(location.getPitch());
final double rollRadians = 0.0;

EulerAngle headPose = new EulerAngle(pitchRadians, 0, -yawRadians);
spawned.setHeadPose(headPose);

this should do the trick (not tested)

zealous scroll
#

ive already tried that haha it does some funky stuff

#

i cant get pitch working properly

fickle spindle
#

if i delete the player data (only one players data) from the folder of the main world this stats too will become null right PLAY_ONE_MINUTE?

peak depot
#

can you even use minimessage on bungee?

fallow violet
#

What packet is sent to the player when an item pops up into an item frame?

chrome beacon
#

Metadata

restive mulch
#

or EntityItemFrame,

chrome beacon
#

First one spawns the entity second one is the entity class

#

Neither of them sets the item

fallow violet
#

damn

#

so what is it?

#

Set enttiy metadata?

chrome beacon
#

yes

fallow violet
#

thanks

#

How can i get the DataWatcher of an EntityItemFrame? is there some tool that show me the real names instead of these shitty obfuscated letters?

thorn isle
#

paper userdev is cool

#

spigot has some specialsource shenanigans, i think they do support remapping

fallow violet
#

The item frame already exists

#

i just want to set an item

#

and bcs the mappings have changes, i cant find the ID of the entity and i cant find the data watcher or if that has changed i cant find anything xddd

thorn isle
#

there's this if you want to look at the mappings manually

#

the search is kind of shit and 99% of the spigot mappings are missing, but you can probably make do with just obf and mojang names

restive mulch
#

or whatever alias you used for your mappings

thorn isle
#

also yes it's worth considering if you can do this through the api instead of nms/protocol

#

what are you trying to do exactly?

restive mulch
#

if it’s nms you’ll need to manually look

restive mulch
fallow violet
#

I want that each player sees his own itemframe

#

kind of a key to a portal

#

so they have to input the item to unlock a portal

#

and each player has its own keys

thorn isle
#

if you're on paper (or maybe spigot has that now) you can use the entity visibility api to have a separate entity for each player, and have each player only see their item frame

fallow violet
#

lol

thorn isle
#

set the default visibility of the entity to false and add the player to the exception list with player.showEntity()

fallow violet
#

but everybody should see the entity

#

the items have to differentiate

thorn isle
#

sure

#

you spawn an entity for each player

#

so every player sees "the entity"

#

just the data is different for each player

restive mulch
#

on use does it change the item in the inventory and is there a way to save that data so you know if they activated/deactivated the portal?

fallow violet
thorn isle
#

item frames perform relatively well

#

how many are we talking?

restive mulch
thorn isle
#

if you have say 100 item frames you want to show and 20 players looking at them there'll be 2000 item frames, which is a decent bit but shouldn't be catastrophic

fallow violet
#

idk i kinda want the packet thingy to work

thorn isle
#

are you on paper?

fallow violet
#

no spigot

#

wait paper has packets?

restive mulch
#

craftbukkit nms would be something for you

thorn isle
#

no, but they have userdev which is a very convenient and durable way of working with nms

slender elbow
#

paper does indeed have packets

fallow violet
#

sounds good but i want the bukkit packet working first so i learn how it goes

slender elbow
#

minecraft, even

thorn isle
#

no need to fuck with obfuscation or mappings or protocollib; you'll have documented mojang mapped source to work with

fallow violet
slender elbow
#

"documented" is a bit of a stretch

restive mulch
restive mulch
thorn isle
#

e.g. you can just do new ClientboundAddEntityPacket() and send it to the player

fallow violet
#

in paper?

thorn isle
#

using userdev, yes

fallow violet
#

DAMN

#

thats cool

restive mulch
#

yeah paper supports

#

a lot better

thorn isle
#

you'll get compile time errors, linting, and autocomplete suggestions, instead of having to look at wiki.vg and the minecraft wiki and trying to guess what goes where

fallow violet
#

i love paper.

slender elbow
#

heretic

fallow violet
#

:)

restive mulch
#

my old code had like less than 100 lines now my new code has 500 am i cooked

#

(its protocollib)

thorn isle
#

or you can get the nms itemframe and call getEntityCreatePacket() and it generates the correct packet to send

#

sending the metadata was a bit more involved iirc but that was just a handful of nms calls as well

fallow violet
#

alr lemme try paper things but then im on the wrong discord

restive mulch
#

sigma

fallow violet
#

bro wtf

thorn isle
#

you can clone this and you should have everything you need out of the box

#

it uses gradle because paper devs are fucking hipsters with nothing better to do

fallow violet
#

im also using gradle... :(

thorn isle
thorn isle
#

and here's a guide on it

#

the best thing about userdev is that since the paper server jar uses mojang mappings now, your nms plugins don't break every version as they would if you wrote them against obfuscated nms

#

so unless mojang actually changes some method definition somewhere or removes some class, the plugin will work across version changes without even having to rebuild it

fallow violet
#

so why do ppl still use spigot when paper has so much features?

thorn isle
#

muh tnt duper

restive mulch
#

atleast when i was learning

thorn isle
#

paper's marketshare is like 70% or more of recent versions now i'm pretty sure

#

quite a few plugins have dropped spigot compatibility altogether

fallow violet
peak depot
#

wasnt there even a site where you get a bit money for each download but it only supported paper plugins?

thorn isle
#

i think the biggest issue people have with paper is that the devs can be pretty prickly and make strangely motivated design choices like deprecating all § formatting strings everywhere and going hard on preferring adventure

#

apart from that it's probably the number of exploits like tnt dupers and bedrock breaking that they've patched; some servers don't want that

restive mulch
thorn isle
#

the new api is also marked like 80% experimental so my entire ide window is yellow from "this is experimental" warnings when i work on anything post 1.19

peak depot
fallow violet
slender elbow
#

implying a piece of paper is more secure than E2EE

fickle spindle
#

how can i open the enchanting table with a stack of lapis?

sullen marlin
#

openEnchanting + get inventory.setslot lapis?

fickle spindle
#

for the setslot

sullen marlin
#

But probably slot 1

thorn isle
#

googling "minecraft inventory slot numbers" also shows you the numbers

#

it's either slot 1 or 2 iirc

#

the numbering scheme isn't consistent across inventories; old guis like the crafting table and furnace have the output slot as slot 0, and input slots left-to-right starting from 1

#

"modern" guis are left-to-right starting from 0, and iirc enchanting table is one of them

#

apparently the enchanting table doesn't have an output slot 🤡 i completely misremember what it looks like; but yes, it's slot 1

fallow violet
#

?paste

undone axleBOT
fallow violet
sullen marlin
#

What message is there

fallow violet
#

RacTrace null

#

misspelled

#

oh wait

#

now something has changed

#

It does hit the player lol i need to filter it...

jagged thicket
#

Is there any event like CraftItemEvent, which fires only when you pick up an item after craffting?

eternal night
#

What is the exact usecase? Once the recipe is done, there isn't much you can do

jagged thicket
#

smth like that

#

or can you already do that

thorn isle
#

uuuh

eternal night
#

There is a criteria trigger for RECIPE_CRAFTED

#

yea

thorn isle
#

you can listen to the statistic increment event on that

#

i sort of remembered that the craftitemevent would only fire when you actually take the item out because only then is the thing crafted, and that there'd be a CraftPrepareEvent or something for when the recipe in the grid is completed

#

but it looks like i remember wrong

jagged thicket
eternal night
#

Well it is just a fancy InventoryClickEvent

fallow violet
#

So i got packets working with the mojang mappings. I heard that its against the eula or something to use these mappings in production. Couldnt i just obfuscate my whole plugin instead of implementing a tool that obfuscated the mojang mappings again?

thorn isle
#

it's fine to use a mojang-mapped plugin

#

redistributing a mojang-mapped server isn't

#

which is why paper builds an obfuscated server and then remaps it

slender elbow
#

wat

#

redistributing the server in any shape or form is no bueno

thorn isle
#

myes

eternal night
#

but you may not redistribute the mappings complete and unmodified

#

is the only restriction on them

thorn isle
#

that's why paperclip grabs the regular vanilla server from mojang, which is fine

#

and then applies the paper patches, which are distributed in the paperclip jar

slender elbow
#

that doesn't sound like building an obfuscated server and then remapping it

fallow violet
slender elbow
#

but sure

thorn isle
#

remapping comes after that, yes

eternal night
thorn isle
#

the end result is a mojang-mapped paper server

fallow violet
#

does this sentence tell me its not allowed to redistribute the mappings in my plugin?

thorn isle
#

that's not what it means

eternal night
#

You cannot include the mappings file in your plugin

#

your plugin can reference the mapped names just fine (I am not a lawyer jada jada jada)

thorn isle
#

paper takes care of applying the mappings

eternal night
#

what

blazing ocean
#

should've just used yarn smh

fallow violet
#

so i can just code with the mappings and be fine?

thorn isle
#

yes

fallow violet
#

thanks

eternal night
#

do note, running a plain mojang mapped jar will only work on paper

#

spigot does not support that, you'll need to reobfuscate

fallow violet
#

so how can i do this? I heard abt a maven plugin but im using gradle and i dont know how to include it there xd

eternal night
#

?nms

slender elbow
#

jeff-blog.media

eternal night
#

has a "when using gradle" part

fallow violet
#

lol thanks

thorn isle
#

see the gradle build in the userdev test plugin i linked

#
  // Only relevant for 1.20.4 or below, or when you care about supporting Spigot on >=1.20.5:
  /*
  reobfJar {
    // This is an example of how you might change the output location for reobfJar. It's recommended not to do this
    // for a variety of reasons, however it's asked frequently enough that an example of how to do it is included here.
    outputJar = layout.buildDirectory.file("libs/PaperweightTestPlugin-${project.version}.jar")
  }
   */
#

uncomment this, basically

eternal night
#

Spigot has it's own way, I'd go with this if they target spigot

thorn isle
#

this reobfuscates the plugin, which will work 1:1 on spigot servers (and get mojang-mapped again on paper servers at runtime)

#

also an option

slim wigeon
remote swallow
#

hes talking about paperweight defaulting to not running reobf anymore

#

so hes probably saying use the gradle plugin listed on the ?nms command as its more targetted to spigot

short pilot
#

update on the custom mobs, i made this example that seemed to work; the wither skeleton only targeted cows

I was wondering how to make the target goals conditional

eg: Targets entities only if they are type player, and belong to specific faction ID

public class CustomWitherSkeleton extends WitherSkeleton {

    public CustomWitherSkeleton(Level world) {
        super(EntityType.WITHER_SKELETON, world);
        this.collides = false;
        this.expToDrop = 0;
        this.goalSelector = new GoalSelector(world.getProfilerSupplier());
        this.targetSelector = new GoalSelector(world.getProfilerSupplier());
        this.setInvulnerable(true);
        this.setCanPickUpLoot(false);
        this.setAggressive(false);
        this.setCustomNameVisible(true);
        this.goalSelector.addGoal(1, new MeleeAttackGoal(this, 1.0D, true));
        this.targetSelector.addGoal(1, new NearestAttackableTargetGoal<>(this, Cow.class, true));
    }

}
short pilot
#

cute pfp

young vine
#

Check Bukkit.getMobGoals()

#

Can implement the goal interface then

languid falcon
#

I'm trying to make a game selector. Imagine; as a lobby, we spawn players in the void and there is 3 galaxy schematics standing next to it. I want to lock the mouse cursor of player. For example, If player move its mouse to left, we should lock the cursor at the galaxy on the left, If player move its mouse to right, we should lock the cursor at the galaxy on the right. Is there any way to do it without having glitched perspective?

smoky anchor
#

Time for spectator hack ?

languid falcon
#

I can't even think of a way right now

tranquil pecan
#
@Override
public void onPlayerInteract(Player player, PlayerInteractEvent event) {
    Vector upwardBoost = new Vector(0, launchStrength, 0);
    player.setVelocity(player.getVelocity().add(upwardBoost));

    Bukkit.getScheduler().runTaskLater(BetLeftyItems.INSTANCE, () -> {
        player.setVelocity(new Vector(0, -slamStrength, 0));

        for (Entity entity : player.getWorld().getNearbyEntities(player.getLocation(), radius, radius, radius)) {
            if (entity instanceof LivingEntity && !(entity instanceof Player)) {
                ((LivingEntity) entity).damage(damage, player);
            }
        }
    }, 20L);
}

Why doesn't it damage any mobs?

#

The velocity thing works

#

and i can hit mobs with hand and other stuff

outer tendon
tranquil pecan
#

ok

fair rock
#

You grab your entities 1 second later after using the item & getting the boost

So the player location is in the air and not on the ground. Depending how fast he travels in the air and how big the radius is you never grab the entities on the ground

tranquil pecan
# fair rock You grab your entities 1 second later after using the item & getting the boost ...

Do you think this is enough it fix this?

@Override
public void onPlayerInteract(Player player, PlayerInteractEvent event) {
    Vector upwardBoost = new Vector(0, launchStrength, 0);
    player.setVelocity(player.getVelocity().add(upwardBoost));

    Bukkit.getScheduler().runTaskLater(BetLeftyItems.INSTANCE, () -> {
        new BukkitRunnable() {
            @Override
            public void run() {
                if (player.isOnGround()) {
                    player.setVelocity(new Vector(0, -slamStrength, 0));

                    for (Entity entity : player.getWorld().getNearbyEntities(player.getLocation(), radius, radius, radius)) {
                        if (entity instanceof LivingEntity && !(entity instanceof Player)) {
                            ((LivingEntity) entity).damage(damage, player);
                        }
                    }
                    this.cancel();
                }
            }
        }.runTaskTimer(BetLeftyItems.INSTANCE, 0L, 2L); 
    }, 20L);
}
fair rock
#

Nah you misunderstood

#

Just save the player location before running the runTaskLater

#
@Override
public void onPlayerInteract(Player player, PlayerInteractEvent event) {
    Vector upwardBoost = new Vector(0, launchStrength, 0);
    player.setVelocity(player.getVelocity().add(upwardBoost));
    Location boostLocation = player.getLocation(); // Position where he used the boost
    Bukkit.getScheduler().runTaskLater(BetLeftyItems.INSTANCE, () -> {
        player.setVelocity(new Vector(0, -slamStrength, 0));

        for (Entity entity : player.getWorld().getNearbyEntities(boostLocation , radius, radius, radius)) {
            if (entity instanceof LivingEntity && !(entity instanceof Player)) {
                ((LivingEntity) entity).damage(damage, player);
            }
        }
    }, 20L);
}
tranquil pecan
#

Oh dang

#

i didn't think of it

#

Thanks

fair rock
#

Is your goal like a pressure wave that damages nearby entities like a rocket start or something?

tranquil pecan
#

It's like player goes up and comes down with high velocity dealing damage to nearby enemy

#

nothing else

#

more velocity = more damage didn't add it yet

fair rock
#

Okay just a tip, dont say it isnt working. Tell next time your goal and then the code. Because from the code its look like a pressure wave damage. But that was my mistake to not ask

tranquil pecan
#

okay 👍

torn shuttle
#
        @EventHandler
        public void onEliteDeath(EliteMobDeathEvent event){
            if (extractionMatches.isEmpty()) return;
            String spawnPool = (String) event.getEliteEntity().getCustomData(new NamespacedKey("betterstructures", "spawnpool"));
            if (spawnPool == null) return;
            for (LootTablesConfigFields value : LootTablesConfig.getContentPackages().values()) {
                if (value.getSpawnPools().isEmpty()) continue;
                if (!value.getContainerPools().contains(spawnPool)) continue;
                for (LootTablesConfigFields.LootTableEntry lootTableEntry : value.getLootTableEntries()) {
                    if (ThreadLocalRandom.current().nextDouble() < lootTableEntry.chance()){
                        HashMap<String, Double> weighedMap = new HashMap<>();
                        for (LootPoolsConfigFields.EliteLootPool eliteLootPool : lootTableEntry.lootPoolsConfigFields().getEliteLootPools()) {
                            weighedMap.put(eliteLootPool.filename(), eliteLootPool.weight());
                        }
                        String result = WeightedProbability.pickWeighedProbability(weighedMap);
                        CustomItem customItem = CustomItem.getCustomItems().get(result);
                        if (customItem == null) {
                            Logger.warn("Failed to get loot " + result);
                            continue;
                        }
                        customItem.dropPlayerLoot(null, event.getEliteEntity().getLevel(), event.getEliteEntity().getLocation(), event.getEliteEntity());
                    }
                }
            }
        }

the actual jankiest code I've ever written

#

I have plugins injecting data into other plugins to randomize from like 5 different config file systems across hundreds of config files to try to get this to work

echo basalt
#

ugly ass code

torn shuttle
#

ye

#

wut u gon do bout it

echo basalt
#

shittalk

torn shuttle
#

I would fix it but I'm off to the gym now

fair rock
#

I hope your gym training is more structured and better done than the code :c
Do we get a update after gym when you fixed the code=

torn shuttle
#

no, you don't deseve it

fair rock
#

Hey :c

hushed spindle
#

how come a bunch of item meta functionality was removed in spigot 1.21.4? that was present in 1.21.3?

#

like setGlider or setTooltipStyle

chrome beacon
hushed spindle
#

uh, yeah my bad

#

i must have entered 1.20.4 instead i guess

orchid trout
#

is there a shortcut on intellij to bind parameters to fields?

blazing ocean
#

ctor generation?

thorn isle
#

alt-ins > generate constructor

blazing ocean
#

can also bind that to a key

round finch
#

not sure how I improve the randomness of world shaping so isn't so much sameish
it lacks mountain / hils my world gen

#

if anyone know i can improve my terrain please tell me

torn shuttle
#

just use noise like a normal person

round finch
#

lol

blazing ocean
#

I mean you can implement it yourself if you want

round finch
#

i still havn't work with world generation before

#

i should switch to spigot noise generator instead 100%

tropic wind
#

Hello! How can I make two different servers connect to the same server? For example, I have Server A and Server B, and I want everyone who joins either of them to be directed to the same world and play together, even though they connected through different servers.

round finch
thorn isle
#

the wiki has a decent one

round finch
thorn isle
#

first search result on google

round finch
round finch
#

to minecraft server?

gentle iris
#

is there a way to turn a ConfigurationSection into a YamlConfiguration?

#

im trying to separate a section from a file, and place it into another file

#

but i cant really see how to use ConfigurationSection properly

#

is there another way to get all values in a section?

wet breach
#

yamlconfiguration is a file, a ConfigurationSection is a section inside the file

wet breach
gentle iris
#

👀

wet breach
gentle iris
#

ill check it out, ty

wet breach
#

hope so

#

didn't post here it here so you could just look at something else >>

magic crystal
#

what's the proper way to maintain backwards compatibility with the enum changes to Particle and Potions, etc across 1.20 and 1.21? I can't find a mapping of them, for example what's the new name for Particle.SPELL_MOB?

chrome beacon
#

Build against the oldest version you want to support

shadow night
shadow night
sullen marlin
#

Sorry olivo

chrome beacon
#

👀

remote swallow
#

that is a crazy insult to olivo

sullen marlin
#

Please forgive me

wet breach
# round finch no way u made Tutorials

Hawkfalcon originally created it, then I joined his project and it eventually just became all my code. Then he gave exclusive rights to me after he decided to kind of leave the scene

#

so yes I did create ServerTutorial, but not originally

#

As of right now, there was one other person who pr'ed some stuff

#

but now it just sits there being neglected but many people have forked it I think lol

#

created back in 2013

thorn isle
#

no gallery

#

boo

white crescent
#

Hello, I am trying to make an bar above hunger bar which can display power, I have full power system but I can´t get throught this someone know how to do it?

chrome beacon
#

You'd use the actionbar

white crescent
#

Yes, but I can´t but it above hunger bar

#

it is locked in the middle of screen

chrome beacon
#

You can add spacing characters

#

if you use a resourcepack*

white crescent
#

I´ve tried but it doesnt work

chrome beacon
#

Does work

white crescent
#

Can I send you picture how I want it

chrome beacon
#

?img

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

white crescent
#

smth like this

chrome beacon
#

Yeah that's doable with a resourcepack

#

and spacing characters

white crescent
#

So make action bar with custom characters and space them?