#help-development

1 messages · Page 418 of 1

autumn ingot
#

can i use metadata to change the texture of certain mobs along with a texture pack? (i.e. make multiple types of wolves with entity.setMetadata and have the resource pack read it)

#

i know you can do that with items (like mcci does, with the orbs and magic sparks) but idk about mobs

#

im not looking to change the way these mobs are animated or move or anything btw, just a retexture

brave sparrow
#

Fairly sure you can’t do that, but you definitely can’t do it with Entity#setMetadata

#

That metadata is never sent to the client

willow widget
#

Has anyone seen that cool thing you can do with rain packets to make rain change the sky's color? how can I do that?

#

Not asking for spoonfeed, just wondering what do I have to look into because I've never worked with packets

midnight quarry
#

can anyone give me some hints on how can I go and make interactive holograms which update on client side?

#

I was thinking of armor stands and changing its name, but then it would update for all players which is something I don't want

wet breach
#

You use armorstands and packets

#

Instead of sending the packet to all players you send the packet to just the one player

#

And then you have to listen for those packets from players too

#

Now when using the armorstands you dont make them on the server instead they only exist in code for the packets to the client

#

This way only that specific client knows about it

midnight quarry
#

and what about right click interactions with armor stand?

#

can the client side armor stand still fire the interact event?

midnight quarry
wet breach
#

You would have to listen for the relevant packets

#

You wouldnt be able to make use of most of the api because you dont want the server to know about your fake entity

#

If the server knows about it. Either it will conplain or turn it into a real entity or tell the client its fake and remove it lmao

honest plaza
#

Also if there is anyone who could help me with ItemsAdder i would pay them up to 20$.

Problem is i updated server from 1.18.2 to 1.19.3 so i updated itemsadder &lonelibs &protocollib too, 95% textures work but if i do /ia it says its loading, but its saying 12 hours straight so there is something wrong and i need to fix it with someone. Did not managed after 12h to fix it. DM me.

tender shard
#

?services

undone axleBOT
terse ore
#
    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (args.length != 1) return false;

        sender.sendMessage("Creating world '" + args[0] + "'");

        String name = args[0];
        WorldCreator wc = new WorldCreator(name);
        wc.generator(new DeepDarkChunkGenerator());
        wc.biomeProvider(new DeepDarkBiomeProvider());
        wc.createWorld();

        sender.sendMessage("World created");

        return true;
    }```
#

one question guys

#

i have this command that generates a custom terrain world

#

but when the server is restarted it starts to generate normal world

#

how could I fix this?

twin venture
#

HI , is it possible to make this number final for all enchantments?

#

i googled it , but i didn't seem to get any result

chrome beacon
#

final for all enchantments?

#

Wdym

wet breach
muted dirge
#

How To Cancel PlayerCommandSendEvent?

chrome beacon
#

You can't

#

You should modify the getCommands collection instead

twin venture
#

sharpness 1 enchantment book = 15 level to enchant , etc etc all same ..

chrome beacon
#

Listen to the PrepareAnvilEvent and set the cost on the anvil inventory

twin venture
#

thanks

muted dirge
#

?

chrome beacon
#

Yeah

muted dirge
twin venture
chrome beacon
undone axleBOT
muted dirge
chrome beacon
twin venture
#

it was not added in 1.9

#

and older

terse ore
#
[10:09:35 ERROR]: POI data mismatch: never registered at BlockPosition{x=123, y=69, z=41}
[10:09:35 ERROR]: POI data mismatch: never registered at BlockPosition{x=122, y=69, z=41}
[10:09:35 ERROR]: POI data mismatch: never registered at BlockPosition{x=122, y=70, z=41}
[10:09:35 ERROR]: POI data mismatch: never registered at BlockPosition{x=123, y=70, z=41}
[10:09:35 ERROR]: POI data mismatch: never registered at BlockPosition{x=124, y=70, z=41}
[10:09:35 ERROR]: POI data mismatch: never registered at BlockPosition{x=125, y=70, z=41}
[10:09:35 ERROR]: POI data mismatch: never registered at BlockPosition{x=125, y=69, z=41}
[10:09:35 ERROR]: POI data mismatch: never registered at BlockPosition{x=125, y=71, z=41}
[10:09:35 ERROR]: POI data mismatch: never registered at BlockPosition{x=124, y=71, z=41}
[10:09:35 ERROR]: POI data mismatch: never registered at BlockPosition{x=123, y=71, z=41}
[10:09:35 ERROR]: POI data mismatch: never registered at BlockPosition{x=122, y=71, z=41}
[10:09:35 ERROR]: POI data mismatch: never registered at BlockPosition{x=122, y=72, z=41}
[10:09:35 ERROR]: POI data mismatch: never registered at BlockPosition{x=123, y=72, z=41}
[10:09:35 ERROR]: POI data mismatch: never registered at BlockPosition{x=124, y=72, z=41}
[10:09:35 ERROR]: POI data mismatch: never registered at BlockPosition{x=125, y=72, z=41}
[10:09:35 ERROR]: POI data mismatch: never registered at BlockPosition{x=124, y=69, z=41}```
#

why am I getting this error

#
    public void fill() {
        int portalID = getLastPortal();
        for (int y = 1; y < height - 1; y++) {
            for (int x = 1; x < width - 1; x++) {
                Block blockAt = startBlock.getLocation().add(x, y, 0).getBlock();
                blockAt.setType(Material.NETHER_PORTAL, false);
            }
        }
    }```
#

this is the code that generates those blocks

chrome beacon
#

Looks like POI wasn't registered

#

probably caused by you disabling the physics check

terse ore
#

if I enable the physics

#

the portal breaks

chrome beacon
#

Then you're going to need to find a way to register the POI

terse ore
#

what is POI?

chrome beacon
#

Point of interest

#

Mobs use it for knowing where certain block is

muted dirge
muted dirge
chrome beacon
#

No need to ping me twice

#

Also what command are you trying to hide

native solstice
#

I'm trying to compile spigot for 1.8 using BuildTools.jar on Windows. My git is set to checkout using LF line endings.

Despite this, my compilation still fails on the applyPatches step. Any ideas on how to fix this?

If I check the repo out myself, it works fine.

warm mica
tender shard
#

also are you using java 8 to run buildtools?

native solstice
#

I'll have a look at which bash I'm using, it might be the WSL one

#

Well, running it in git bash got me longer, albeit another error

#

Failed to execute goal on project spigot-api: Could not resolve dependencies for project org.spigotmc:spigot-api:jar:1.8-R0.1-SNAPSHOT: Could not find artifact net.md-5:bungeecord-chat:jar:1.8-SNAPSHOT

#

Do I not need to add --compile spigot for 1.8?

remote swallow
#

you should just need to run

java -jar BuildTools.jar --rev 1.8.8```
#

dont think 1.8 is still hosted

native solstice
#

That's not good then, I need NMS 1.8_R1 😅

eternal night
#

too legacy even for the legacy users kekw

remote swallow
#

who uses just 1.8

native solstice
#

me rn

tender shard
native solstice
#

LMAO, 1.8.8 doesn't work either, same error

eternal night
#

compiles for me

tender shard
#

for me too, on mac and windows

native solstice
#

what the heck?

tender shard
#

did you maybe set maven to offline mode?

#

do you have a ~/.m2/settings.xml file?

native solstice
#

lemme have a check, sorry for being a noob, been a while since I did java and spigot stuff 😅

#

Yeah, no settings.xml

eternal night
#

as a quick heads up, 1.8 has the log4shell exploit

native solstice
#

Darn. Means I need to add a patch for that too

eternal oxide
#

easier to not use 1.8

tender shard
#

?paste the full buildtools output. you can directly save it to file

java -jar BuildTools.jar --rev 1.8 > output.txt 2>&1
undone axleBOT
native solstice
#

my bad, here's it on paste

native solstice
remote swallow
#

use 1.8.8

eternal oxide
#

you don't have to build against 1.8 to support 1.8

remote swallow
#

if anyone is still using 1.8.0 thats their issue

native solstice
#

I do, since I use NMS

eternal oxide
#

ah

tender shard
native solstice
#

yeah, 1.9.2 doesn't compile either, same issue as the paste, bungeecord-chat

remote swallow
#

ig they arent hosted anyone KEKW

native solstice
#

Doesn't look like it

#

Oh for the love of god

remote swallow
#

thats 1.16

tender shard
#

go to "Spigot-API" directory in buildtools, edit pom.xml and add this repo: https://oss.sonatype.org/content/repositories/snapshots

#

and then somehow make buildtools not overwrite it again lol

#

oh wait

#

I'm stupid

#

way easier, gimme a sec

native solstice
#

oh?

tender shard
#
 mvn dependency:get -DrepoUrl=https://oss.sonatype.org/content/repositories/snapshots -DgroupId=net.md-5 -DartifactId=bungeecord-chat -Dversion=1.8-SNAPSHOT
#

run this once

#

then you got bungeecord-chat 1.8-SNASHOT in your local repo

#

then it should work

native solstice
#

trying it

#

Oh my god you're a lifesaver

tender shard
#

np

native solstice
#

Ty!

tawny remnant
#

Can i display a second thing under a entity's CustomName?

eternal oxide
#

save the resource not the config

tender shard
#

whut

#

ah

eternal oxide
#

whitespace is ignored in teh config

#

blank lines deleted

#

save the resource from teh jar instead of saving the config

#

unless you made changes

fluid river
#

rly

#

cool

tawny remnant
#

How can i create a loop in an Event? i want to loop something while a creature is alive (the creature spawns on PlayerFishEvent). Cananyone help?

hasty wasp
#

Anyone has an Idea why this code does not work?

            BlockStateMeta bsm = (BlockStateMeta) itemInHand.getItemMeta();
            ShulkerBox box = (ShulkerBox) bsm.getBlockState();
            Inventory inventory = box.getInventory();
            for (int i = 0; i < 27; i++) {
                ItemStack dirt = new ItemStack(Material.COARSE_DIRT, 64);
                inventory.addItem(dirt);
            }
            bsm.setBlockState(box);
            box.update();

This code is executed in the blockplaceevent. I made sure the item in Hand is a shulker box

Spigot 1.19

undone axleBOT
eternal oxide
#

you can only do somethign every x ticks until it dies or goes out of scope

eternal oxide
hasty wasp
#

I want to edit the placed block

tender shard
#

this creates a runnable that runs every second after an entity takes damage, then prints that it died when it died, and then cancels itself (so it doesn't run once per second anymore)

#

however, you may have many players fishing. Instead of creating a new runnable everytime, I would use just one runnable that runs all the time, then add the entities you wanna track to a Set<UUID> or Set<Entity> or whatever, and loop over that in your runnable

#

that e.g. could look like this:

    private final Set<Entity> trackedEntities = new HashSet<>();

    public void onEnable() {
        getServer().getPluginManager().registerEvents(this, this);
        getServer().getScheduler().runTaskTimer(this, () -> {
            trackedEntities.removeIf(entity -> {
                if (entity.isDead() || !entity.isValid()) {
                    System.out.println("The entity has died.");
                    return true;
                }
                return false;
            });
        }, 0, 20);
    }

    @EventHandler
    public void onDamage(EntityDamageEvent event) {
        trackedEntities.add(event.getEntity());
    }
sacred wyvern
#

I'm running into a bug where I have a Villager mob I remove while it's sleeping and the bed says The bed is occupied. Even though it's gone. Is there a clean up I have to do elsewhere when I remove a mob?

sacred wyvern
#

Cheers, setAware is false but if it's near a bed it still goes to sleep

sacred wyvern
#

Does getEntities() return entities like a Villager if it's not loaded within the current region? And or can I use that to remove an Entity from the main world if I'm in the nether? I think the second question is that I have to target the specific world first.

chrome beacon
#

getEntities only returns loaded entities

sacred wyvern
#

hmmm

#

It says world in the docs

#

Is there a way to remove villagers I've created from far away?

chrome beacon
#

Load the chunk they're in and remove them

#

Loop the material enum and store it in a static final variable

#

You can use streams to make it clean

undone axleBOT
young knoll
#

You can also just combine the tags into a list of materials

lavish cliff
#

guys how i can do for display the current head of player in a gui?

tender shard
#
  1. create an itemstack with Material PLAYER_HEAD
  2. cast the meta to SkullMeta
  3. use setOwningPlayer
  4. set the meta back to the item
  5. done
lavish cliff
#

thx

vestal cairn
#

what is wrong with this code?

WorldCreator wc = new WorldCreator("flat");
wc.type(WorldType.FLAT);
wc.generateStructures(false);
wc.generatorSettings("2;0;1;");
wet breach
vestal cairn
#

oh wait i think this is the wrong server

#

oh sorry, it throws "An internal error occurred while attempting to perform this command" and in the log it says malformed json

wet breach
#

probably due to your generatorsettings possibly

#

but you haven't really shown any code

vestal cairn
#

if i remove this part of the code it works fine, so it has to be this part

wet breach
#

if you say so

vestal cairn
#
if(command.getName().equals("newflatworld")){
            if(args[0].isEmpty()){
                sender.sendMessage("§4This command needs 1 argument");
            }
            else{
                WorldCreator wc = new WorldCreator("flat");
                wc.type(WorldType.FLAT);
                wc.generateStructures(false);
                wc.generatorSettings("2;0;1;");
                World w = Bukkit.getWorld(args[0]);
                Player p =Bukkit.getPlayer(sender.getName());
                Location l = new Location(w, 0, 5, 0);
                p.teleport(l);
            }
        }
wet breach
vestal cairn
#

yeah makes sense

wet breach
#

so its most likely wasn't what you thought

#

this is why you don't show code you think is wrong. Remember you are the one with the issue in code you created not us 😉

gleaming pulsar
#

Hey all, so I've been going mad over this right now, but... persistent storage. I want to store an Object of all the players save data to the player but I'm not having much luck achieving this. Wouldn't I need to create the object on the first join, ect. ect.? Any help would be appreciated. Also does assigning data to a player assign it to name or UUID?

#

I am fairly new to plugin dev, but do have programming experience, so should be fine. Hopefully.

wet breach
#

very generalized statements with no specifics

vestal cairn
wet breach
#

args shouldn't be a string

#

its an array

#

args[0] would return a string

vestal cairn
#

but it says it cant resolve on string

wet breach
#

instead

#

try args.length == 0 or size

#

should be one of those two

vestal cairn
#

i have the same code on other command and it works fine

gleaming pulsar
# wet breach very generalized statements with no specifics

In broader detail, I have a "SaveGame" object. It contains the players current level, exp earned, and any other data I might want in it. What I am struggling with here, is trying to use "PersistentStorageContainers" to try and give that to each unique user, so that when they rejoin they do not lose their data. It's hard to go into much further detail than this, honestly.

remote swallow
#

player.getPersistentDataContainer().set()

wet breach
#

or instead of trying to set so much data using PDC

#

you could instead look into better storage mechanisms

vestal cairn
# wet breach try args.length == 0 or size

i have removed the argcount checker and it still gives the same error

Caused by: com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 1 path $
wet breach
#

that might be better and easier

gleaming pulsar
#

Yeah to be honest, I don't really like PDC as it stands.

wet breach
gleaming pulsar
#

Is player a UUID?

wet breach
#

closest thing you have to json of anything

vestal cairn
wet breach
young knoll
#

Player is a player

#

Player has a uuid though

gleaming pulsar
#

Okay so I'm going to have to save them to UUIDs.

balmy pasture
#

I have two events, main(EntityDamageByEntityEvent) to make criticals work and EntityShootBowEvent to check should bow critical, but I don't see when I should reset bowCritical boolean or better even split them somehow to not intersect

remote swallow
#

players pdc does save to their uuids datafile

remote swallow
#

because it saves to nbt

gleaming pulsar
#

Righty

vestal cairn
gleaming pulsar
remote swallow
#

instance of a payer

#

player

gleaming pulsar
#

Okay. Not tried that yet.

elfin atlas
remote swallow
gleaming pulsar
#

Okay, cool. And do I need to seperate whether its their first join or not? Wouldn't adding the object again overwrite stuff with the default?

remote swallow
#

if you use getOrDefault when reading you only need to set it if it goes up

wet breach
#

seems a bit redundant

frank kettle
#

Just check player statistics

wet breach
#

hasPlayedBefore()

frank kettle
#

If Quit statistic == 0 then it means it's their first time

wet breach
#

don't even need to look at the statistics

#

there is a method for it

frank kettle
#

Well, same thing

wet breach
#

not quite

frank kettle
#

Either way he doesn't need to save it

wet breach
#

^

elfin atlas
wet breach
elfin atlas
gleaming pulsar
#

But eh.

young knoll
#

Just set it if it doesn’t exist

remote swallow
#

yeah, no need only create the data once it changes from the default and just have null checks for things

elfin atlas
wet breach
#

try using java 18?

#

doubt that could be the issue

#

if nothing else, just clear out the buildtools files and retry

elfin atlas
#

Okay

gleaming pulsar
#

Sorry, dumbass brain today.

    public void onPlayerJoin(PlayerJoinEvent event){
        Player player = event.getPlayer();
        player.getPersistentDataContainer().set(new SaveData);
    }

That last line seems to error, but eh. So ideally I'd want to at least try to load my object on a join?

chrome beacon
#

?pdc

young knoll
#

Yeah you can’t just set any object to pdc

#

You need a type adapter

#

Also you need a key to assign it to

gleaming pulsar
#

Okay I'm finding a better way of doing this 🤣

sacred wyvern
#

Hello, I'm creating a custom dialog system for villagers. Is there an event I can listen to when a player right clicks on a villager to know when to begin the conversation?

#

Similar to how right clicking opens a trade window?

#

Ah nm PlayerInteractAtEntityEvent

quaint mantle
#

How can I get PlayerConnection#connection in 1.19.4?

#

There is no getter for it anymore

eternal night
#

reflection

eternal oxide
#

?nms

hasty prawn
#

There was never a getter for it was there?

eternal night
#

no the field is private now

#

that is the issue they are talking about

#

mojang mappings won't help them there

hasty prawn
#

Ah

tall dragon
#

pretty sure its also obfuscated in 1.19, and on earlier versions its not

quaint mantle
#

I already have the code for reflection

#

Hold on

eternal oxide
#

you sure?

#

what version?

eternal night
#

1.19.4

eternal oxide
#

I'll build and test. not looked at .4

terse ore
#

what does NMS stand for?

tall dragon
#

net.minecraft.server

terse ore
#

oki ty

tall dragon
#

e.g minecraft server code

cobalt thorn
#

How can i give an allium?

tawny remnant
#

how do i remove this glitched armorStand?

eternal oxide
#

ServerPlayer#connection is public for me

#

1.19.4

tall dragon
hasty prawn
#

No idea what tag he's referring to, I've never heard of it. It's definitely possible to prevent them from changing though.

Ask him to look into EntityChangeBlockEvent, as that event does fire when the falling block hits the ground. He'll have to do some finicky stuff to get it to work properly, since the falling block still despawns, but cancelling that event should prevent the block from appearing.

tall dragon
#

i mean as long as the block does not touch ground ur fine right

#

and since ships go in water

#

pretty sure fallingblocks go through water fine

tawny remnant
#

Any idea to remove th .0 from a double? its making me uncomfortable

eternal oxide
wet breach
hasty prawn
#

LMAOO

tall dragon
ancient plank
#

"coming to the experts"

tawny remnant
eternal night
tall dragon
#

no idea. but u can see its possible xd

wet breach
tall dragon
#

never looked into it myself

eternal oxide
ancient plank
#

Magma slug

hasty prawn
#

Some of the people here are definitely experts

eternal night
#

at least on spigot

quaint mantle
eternal oxide
#

the connection is public, connection.connection isn;t

quaint mantle
#

yeah

eternal oxide
#

why are you wanting connection.connection?

quaint mantle
#

To register my packet listener

ancient plank
#

connection connection

worldly ingot
#

PES_CryHands That's what ProtocolLib is for

quaint mantle
#

ProtocolLib is just too heavy of a plugin for my use

ivory sleet
#

isnt it like

#

+0 kb

#

since its a lib

tall dragon
#

i guess he means its performance impact on the server

#

idk how big that is tho if its existent

ivory sleet
#

well it looks bigger than what it is iirc since it injects a lot of stuff where it just delegates

quaint mantle
#

How do i enable the second layer of an EntityPlayer's skin without mojang mappings

#

.getEntityData().set(...) doesnt exist maybe cus im on 1.8.8

#

so how do i do it?

#

someone said
npc.getDataWatcher().set(new DataWatcherObject<>(16, DataWatcherRegistry.a), (byte)127);
but .set doesnt exist and neither does DataWatcherRegistry

pseudo hazel
#

is there even a second skin layer in 1.8?

#

maybe its just the head

quaint mantle
#

for the entire body

pseudo hazel
#

oh I see

#

then idk

#

i dont use 1.8 since its ancient

quaint mantle
#

i love ancient

eternal oxide
#

WTH they changed a previous boolean to a byte in teh protocol for what reason?java public boolean shouldKeep(byte b0) { return (this.dataToKeep & b0) != 0; }

quaint mantle
#

how does this make sense when i fire it straight to the eye direction

#

Getting this error when trying to connect to my database,

Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Client does not support authentication protocol requested by server; consider upgrading MySQL client

how do i upgrade mysql?

eternal oxide
#

or don;t use ssl

quaint mantle
#

then what

tidal karma
#

Either stick to the supported protocols or add your desired driver version as a dependency and shade & relocate it into your plugin

#

Hi, would like to submit a pull request to BuildTools. Is there an option to do so in Stash?

eternal oxide
#

?contribute

eternal oxide
#

A lot to go thought but to be covered legally

quaint mantle
#

found another way

#

but also what on earth does my error have to do with ssl, doesnt say it anywhere and even without using ssl i still get the error

fluid river
#

@tender shard help him 🙂

eternal oxide
#

?bootstrap

undone axleBOT
#

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

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

elfin atlas
quaint mantle
#

Can make plugin?

eternal oxide
#

where?

#

using maven?

#

?paste your 1.19.4 pom

undone axleBOT
quaint mantle
eternal oxide
#

pom looks fine, other than your source/target

young knoll
#

Did you run buildtools with latest

#

Or --rev 1.19.4

#

Yes 1.19.4 is 1_19_V3 for NMS

eternal oxide
#

that import is fine, so long as you did actually build SPigot using Buildtools

#

?paste your buildtools log

undone axleBOT
young knoll
#

1.19.1 and .2 were both R1

#

.3 was R2

#

.4 is now R3

eternal oxide
#

I literally just built 1.19.4 and used nms this morning

young knoll
#

I’ve been using it for a few days

eternal oxide
#

yes

young knoll
#

Not with buildtools but still

undone axleBOT
eternal oxide
#

well mine is a multimodule

#

thats the 1.19.4 module

rigid totem
#

hi, i'm trying to prevent the player from closing a gui by doing e.getPlayer().openInventory(e.getInventory());, but it keeps crashing my server
is there any other way to do this?
https://paste.md-5.net/zonajukute.java

quaint mantle
eternal oxide
young knoll
#

Why 10

sacred wyvern
#

I'm sure this is a common question asked by newbs on this channel but I am one. I have a Plugin and allows for dynamic Villager creation and deletion. Originally it was using Entity ID but I found that doesn't persist from restarts. So I switched to uid's and looping through getLivingEntities.

However I'm seeing the getLivingEntities only returns a set list of about 100 uid's. Is there a different call to use or a pagenation I have to use in order to fully propegating the full list of UIDs?

young knoll
eternal oxide
#

oh true

#

silly javadoc

young knoll
sacred wyvern
young knoll
#

The heck is that import

quaint mantle
#

The obc for 1.19.4 is

org.bukkit.craftbukkit.v1_19_R3
Try with org.bukkit.craftbukkit.v1_19_R3.entity

young knoll
#

import org.bukkit.craftbukkit.v1_19_R3.entity.CraftEntity;

#

That is mojmap

#

Well not that one, craftbukkit doesn't get remapped

#

Because as I said

#

1.19.4 is NMS version R3

eternal oxide
#

yeah it shoudl be R3

#

I just named the module wrong

#

R3

young knoll
#

I mean the IDE should find the import for you

eternal oxide
#

I use a reflection util so I avoid version specific imports for CB

rotund ravine
#

?remapped

#

@tender shard what's the thing

young knoll
#

?nms

rotund ravine
#

thanhks

eternal oxide
#

1.19.4-R0.1-SNAPSHOT

quaint mantle
#

any way to drop particles of an item?

rotund ravine
#

and drop

#

what do you mean

eternal oxide
#

its 1_19_R3 in imports

rotund ravine
#

by dorp

#

remove particles?

quaint mantle
#

No

#

How can I spawn particles that are the texture of an item

rotund ravine
#

mods

quaint mantle
#

fr?

quaint mantle
young knoll
#

Yeah those are all client side

#

The block one is obviously only for blocks

rotund ravine
quaint mantle
#

I have an item that looks like a block with custom model data

#

I want to drop particles of it from the resource pack

rotund ravine
#

You can use those new item display stands to mimic particles if ur clever.

quaint mantle
#

Wouldn't that be laggy?

rotund ravine
#

who knows

young knoll
#

I mean

#

Laggier than particles yes

quaint mantle
#

Any way to send block damage to a barrier block?

livid dove
young knoll
#

I think they are using them to give collision to their fake blocks

#

Idk why they don't just use a fitting block for their fake block

#

Like stone or wood or dirt

flat ferry
#

Hi does anyone know a plugin where we can talk to a bot in the chat and who answers us, example:
Player: <@&694706251958845482> Hi, how are you?
Bot: Yes well and you, I'm having a nice day (...) : )

In the same style as ChatGPT but for minecraft which work in 1.8.9

rotund ravine
#

I already gave you one

#

you just need to either update your jafa

#

or compile it with a lower version

#

Don't compare strings with ==

young knoll
#

.equals

#

or .equalsIgnoreCase

rotund ravine
#

.equals or .equalsIgnoreCase as he said

tardy flame
#

As they said

young knoll
#

As a general rule only use == for primitive types, null checks, and enums

#

One ignores case

tardy flame
#

Case sensitive

#

As they said

rotund ravine
#

msg is not equals mSg, but msg is equalsIngnoreCase with mSG

quaint mantle
#

Am I able to ask a question not related to spigot nor bungeecord here?

tardy flame
#

Regarding development

quaint mantle
#

Yes, it's about development

rotund ravine
#

go for it

tardy flame
#

Go ahead

quaint mantle
#

I got a really weird problem.
I'm trying to run this query, but it fails to run (sqlite)

CREATE TABLE IF NOT EXISTS `account` (`id` INTEGER NOT NULL, `password` TEXT, `pin` TEXT, `2fa_token` TEXT, `panic` TEXT, `2fa` BOOLEAN, `created_at` NUMERIC DEFAULT (strftime('%s', 'now') * 1000), PRIMARY KEY(`id` AUTOINCREMENT))

The error is this one:
https://mclo.gs/7zRUEjr

When I run this exact same query in a sqlite engine, it just works

flat ferry
rotund ravine
#

send us your new logs.

quaint mantle
#

If I use any other block they'll z-fight

young knoll
#

Make the display one a tiny tiny fraction bigger

quaint mantle
#

Then the block breaking animation won't show

quaint mantle
bold gorge
#

How can I get TPS in 1.14.4 (it has to be 1.14.4)

tender shard
bold gorge
quaint mantle
tender shard
# bold gorge If I run into problems I'll come back to you
import net.minecraft.server.v1_14_R1.DedicatedPlayerList;
import net.minecraft.server.v1_14_R1.DedicatedServer;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_14_R1.CraftServer;

public class TPSTest {

    public static double[] getTps() {
        CraftServer craftServer = (CraftServer) Bukkit.getServer();
        DedicatedPlayerList nmsPlayerList = craftServer.getHandle();
        DedicatedServer nmsServer = nmsPlayerList.getServer();
        return nmsServer.recentTps;
    }
hazy parrot
quaint mantle
#

Oh

Execution finished without errors.
Reults: Query executed with success. Took 1ms
In the line 1:
#

That's when I run the exact same query in the sqlite engine

hazy parrot
#

SQL error or missing database (no such table: user)

quaint mantle
#

No, that's the error the console prints because it can't find the table users
The query that is being run is the one I sent

hazy parrot
#

yeah i said that error you sent is related to that you dont have user table

quaint mantle
#

It doesn't exist because the account table is not being able to be created.
The table user references the table account

As creating the table account throws error, the code stops executing and so the table user doesn't get created
The main issue is the reason of why the account table is not being able to be created

#

In jdbc, throws exception, in the sqlite engine, it just works

quaint mantle
#

The console log (https://mclo.gs/vrsNhEw) is thrown right after the exception https://mclo.gs/7zRUEjr gets catched in the file. So the console error is a result of the logged error

hazy parrot
quaint mantle
hazy parrot
#

show your code

quaint mantle
#

Wait

#

I just realised

#

I'm using QueryBuilder#queryType instead of QueryBuilder#build

QueryBuilder#queryType returns if the query is a "create", "update", etc...

quaint mantle
granite herald
#

I am working on a Item Exchange Plugin and need for the GUI categories. I already investigate a bit, but did not found a way to get the category each item from the creative menu I want to use. Is there a way to extract on spigot or how can I get it in general? Would be enough for me if I have a json file with the itemname and the category.

sacred wyvern
#

Anyone know why I'm getting an Null error? I'm storing a serialized location in the Config here

ConfigService.getConfig().set("server.characters." + id + ".location", sender.getLocation().serialize());

I save the config right after and the values show up in the file.
When I go to retrieve the value

        Map<String, Object> test = ConfigService.getConfig().getConfigurationSection("server.characters." + this.id + ".location").getValues(false);

right away I get this error:

Caused by: java.lang.NullPointerException: Cannot invoke "org.bukkit.configuration.ConfigurationSection.getValues(boolean)" because the return value of "org.bukkit.configuration.file.FileConfiguration.getConfigurationSection(String)" is null

However when I reload the plugin and it processes the value from the same code using the File it works fine.

#

Also if I change the getConfiguration to

        Object test =  ConfigService.getConfig().get("server.characters." + this.id + ".location");
        LOG(LogType.Info, "test " + test.toString());

And run it again by storing the location right away it prints out the value just fine so the data's there.

tawdry echo
#

Check id

tender shard
granite herald
tender shard
#

even for stuff like... diamond pickaxds?

sacred wyvern
sacred wyvern
#

correction getConfigurationSection() + getValues()

eternal oxide
#

what path?

sacred wyvern
eternal oxide
#

not sure it can translate the / live

#

yaml will treat that as .

sacred wyvern
#

Is that why it works fine when it loads the file though?

tender shard
eternal oxide
#

yes, nothign wrong with the layout

tender shard
#

yamllint keeps it intact

sacred wyvern
#

it also reads it using the get()

eternal oxide
#

it's probably a bukkit thing then

sacred wyvern
#

kk

rotund ravine
sacred wyvern
#

Hmm sorry for a further question on this.

Object test =  ConfigService.getConfig().get("server.characters." + this.id + ".location");

This reads like it's a java.util.Object. But when I try using it I'm getting.

class org.bukkit.configuration.MemorySection cannot be cast to class java.util.Map (org.bukkit.configuration.MemorySection is in unnamed module of loader java.net.URLClassLoader @3f91beef; java.util.Map is in module java.base of loader 'bootstrap')
eternal oxide
#

he's getting values no not using an object

#

MemorySection is Bukkits wrapper for teh backing Map

#

cast to MemorySection and getValues(true) to get teh map

eternal oxide
#

I usually create a method for that as there is a bug in the Bukkit configuirations serialization

sacred wyvern
# eternal oxide cast to MemorySection and getValues(true) to get teh map
class java.util.HashMap cannot be cast to class org.bukkit.configuration.MemorySection (java.util.HashMap is in module java.base of loader 'bootstrap'; org.bukkit.configuration.MemorySection is in unnamed module of loader java.net.URLClassLoader @3f91beef)

Lol the complete reverse. I feel like I'm taking crazy pills!

eternal oxide
#

if you add a Map to the config, you can fetch that Map and it will be returned as a Map.
If you then save/load yoru config and fetch the same path, you will get a MemorySection.

sacred wyvern
#
        MemorySection location =  (MemorySection) ConfigService.getConfig().get("server.characters." + this.id + ".location");
#

Gotcha that makes sense

eternal oxide
#

this is what I use. Could be done better```java
/**
* If loading from file the Maps in the data
* will be stored as a MemorySection not Maps.
*
* @param entry MemorySection or Map to check.
* @return Map containing the serialised data.
*/
@SuppressWarnings("unchecked")
protected Map<String, Object> castToMap(Object entry) {

    if (entry instanceof MemorySection) {
        return ((MemorySection) entry).getValues(true);
    } else {
        return (Map<String, Object>) entry;
    }
}```
sacred wyvern
#

Your a god mate thank you

#

This is precisely the bug I'm running into

sacred wyvern
balmy pasture
#

How to check is Entity can be damaged?

tawny remnant
#

Is there a way to extend the flight duration of a rocket?

eternal oxide
#

check Entity#isInvulnerable()

delicate lynx
eternal oxide
#

all Entities are Damageable

delicate lynx
#

why does this exist then lol

eternal oxide
#

they can be invulnerable

balmy pasture
#

Both won't work

eternal oxide
#

explain your usecase

balmy pasture
#

isInvulnerable() not works for damage immunity after hit

#

I want fire event only when chicken can be damaged

eternal oxide
#

a damage event always fires

#

even if it results in zero damage

balmy pasture
#

We're not talking about damage

eternal oxide
#

um we are

balmy pasture
#

Problem is event can be fired as many times as I can click

eternal oxide
#

Se above ^

#

a damage event ALWAYS fires

balmy pasture
#

I want fire event only when chicken can be damaged

eternal oxide
#

impossible

#

the event ALWAYS fires, even if it's for zero damage

delicate lynx
#

you only act if the chicken can be damaged, not the other way around

balmy pasture
#

I'm saying, there is damage immunity in game

#

Should be a way to check is Entity have it or not

delicate lynx
#

there is, Elgar told you

lost matrix
#

This is determined by the no damage ticks property

quaint mantle
#

even tho no support for older versions but for those using 1.8,
How on earth do i spawn particles on 1.8

eternal oxide
#

I don't believe there is a particle API in 1.8, only 1.9

quaint mantle
#

uhhh so how do i spawn big fake explosion

eternal oxide
#

err ?1.8 😄

quaint mantle
#

ye

#

on 1.8

eternal oxide
#

yeahhh

quaint mantle
#

what

eternal oxide
#

No API so packets or NMS

quaint mantle
#

ok how do i do it with nms

eternal oxide
#

you google as it's too old to support

analog thicket
#

world.createExplosion(location.getX(), location.getY() + 2, location.getZ(), 1.0f, false, false);

#

I didnt use nms for this

quaint mantle
#

nope, that damages people

#

not a fake explosion

#

i just want the particle

analog thicket
#

Well then its

                                PacketPlayOutWorldParticles packet = new PacketPlayOutWorldParticles(
                                        EnumParticle.SMOKE_NORMAL, true, (float) standLoc.getX(), (float) standLoc.getY(),
                                        (float) standLoc.getZ(), 0.5f, 0.5f, 0.5f, 0.01f, 5);
                                sendPacket(packet);
#

Atleast what i did

quaint mantle
analog thicket
#

1 sec

#

If i can remember them all lol

sterile token
analog thicket
#

The arguments display b, float, float, float, v3, v4, v5, v6, i..

#

Erhm floats are locsations

sterile token
analog thicket
#

Can't find it lol

sterile token
#

?wiki

balmy pasture
#

Well, I made it another way, chicken.setNoDamageTicks(0); and now it gets damage every time at least, but other way is to make cooldown and that's it?

undone axleBOT
quaint mantle
#

also is there an event for when an item changes durability? i cant set the item to unbreakable for some reason

sterile token
quaint mantle
#

oh yea

#

found it

sterile token
#

There it goes

analog thicket
#

There you go

quaint mantle
#

yyea

analog thicket
#

Its there.

sterile token
#

haha

quaint mantle
sterile token
#

But do you my issue?

#

Is github repository collaborators api working? Because im not able to invite any people as collaborator to my projects, it seems that they dont receive the invitation or they receive it but the invite links is broken with a 404 response code

quaint mantle
#

no idea

sterile token
#

It seems to be something really weird

#

I will prob open them a support ticket or send an email

patent socket
kind hatch
sterile token
sullen marlin
#

Definitely possible in 1.8 too though I think under playEffect

sterile token
#

md_5 any idea if github repository collaborators api is wroking wrongly?
Cuz it doesnt even allow me to invite people as collaborator

sullen marlin
#

No idea

sterile token
#

Oh right thanks

quaint mantle
#

if you know

sterile token
# rotund ravine works fien for me

Weird must smth there, it doesnt allow me to invite collaborators, they dont receive the email or the invite url received is broken with a 404 code

#

I just sent an email some hours ago, till waiting for response

analog thicket
analog thicket
#

And i knew how to spawn does

#

so

#

yeah

quaint mantle
analog thicket
#

No reason really

rotund ravine
#

yeah

#

u just gotta send the actual url to them

sterile token
#

what happened to you?

rotund ravine
#

i invited their email

#

and send them their invite link

sterile token
#

i mean in my case, during first weeks of februray i was able to add colaborators as yourn normally would do, and they receive the email and join the repo without any issue

#

Im not sure when this started to happen tho, because i have while outside of coding caused of classes

rotund ravine
#

oh mine never recieved any mails

sterile token
#

okay, so now im quiet thats a platform issue, maybe they didnt realize it

#

And with my email they realize about it 🤔

#

idk i just want to get that fixed or a response of what can be happening atleast

delicate lynx
#

what the hell is that

sterile token
#

I find github has invitation issues

delicate lynx
#

not you

sterile token
quaint mantle
# analog thicket No idea then :p

ok i found it, its the small but the data thing is set higher so its bigger, but its a random size, any idea on how to change that

#

?

rotund ravine
#

that's the invite url

sterile token
rotund ravine
#

sound like a you issue

sterile token
rotund ravine
#

Worked fine for me

sterile token
#

the invitation uri has a hash and its temporal

analog thicket
#

Maybe that

#

no idea

rotund ravine
sterile token
supple parcel
#

Hoping someone can answer this.
So basically I wanted to modify SimplePluginManager to look in the update directory's jar's to find the plugin name, then update the file appropiately.
So if I have LibsDisguises-1.19.jar in my plugins directory, then LibsDisguises-1.20.jar in my update directory, it'll delete the 1.19 jar and add the 1.20 jar.

So basically, I'm not forced to rename the jar in the update directory to LibsDisguises-1.19.jar just to get it to update.

So anyways, just two questions.

  1. Is there a reason this wouldn't be accepted (Just need to test my change)
  2. Does it belong in Bukkit or Spigot, I'm not even sure why there's two repos given they're both controlled by spigotmc now
rotund ravine
#

@supple parcel The amount of times i've seen stuff named in a different way than that is amazing.

#

Like sure it'd work for the plugin that actually make sense with their naming. Else you'd have to name all that shit yourself

supple parcel
#

I'm not too sure what you mean

#

My thoughts here is if I download WorldEdit-b543.jar I should be able to stick it into the update folder and not have any problems with it updating over WorldEdit-b434.jar

eternal oxide
#

it would probably be refused

#

Which is the new one MyJar-1a452 or MyJar-1b444

sterile token
supple parcel
#

Who knows, but if you added two different jars for the same plugin in the update folder, then yeah its going to be selecting one of them "randomly"

supple parcel
#

I'm not talking about an update system that checks version

rotund ravine
#

it's build 5432

eternal oxide
#

Then a PR to version check the file name would be refused. it's too variable to reliably check

sterile token
#

yeah, but thats is github build CI/CD, its the only that add to them

supple parcel
#

I'm talking about it simply finding jars by the plugin name, not just the file name

supple parcel
rotund ravine
#

jenkins can add them

quaint mantle
sterile token
quaint mantle
#

but the offset is the position

eternal oxide
supple parcel
#

You can name a jar a.jar but if it contains a plugin.yml that is name: LibsDisguises then it will delete LibsDisguises.jar and add a.jar in the plugins folder

eternal oxide
#

ah I see

rotund ravine
eternal oxide
#

you just want a blind replace of anything in the plugin folder with anything in the update folder, no matter what information it has. Just teh plugin name in plugin.yml

supple parcel
#

You phrased that a bit weirdly, but yes

#

Currently it will only check the file name

sullen marlin
supple parcel
#

Huh

sterile token
# supple parcel Huh

Why dont you do a spiget replicatron? You can base on it update system or auto update ssytem

rotund ravine
#

what

sterile token
#

They have both of them, Spiget has a versioning and updating path.

supple parcel
#

If you're suggesting the answer is to rename the update file content to match the jars in plugins, then that's what I'm trying to avoid.

patent socket
lost matrix
#

?di

undone axleBOT
delicate lynx
#

why is there 2 other classes in your command class

sterile token
sterile token
#

Because you dont want to compare plugin versioning nor auto updating 🤔

supple parcel
#

I have a plugin called LibsDisguises
If a file called LibsDisguises-54.jar is in update, and a file called my-file.jar is in plugins, and both plugins are called LibsDisguises, then it will move LibsDisguises-54.jar to plugins and delete my-file.jar
So if you ever want to update a plugin, you don't need to worry about file names. Just drop it into update and it'll replace the plugin.

kind hatch
#

Ah, so you want to compare plugin.yml names

supple parcel
#

Yes

rotund ravine
#

Makes sense

supple parcel
#

Feel kinda awkward about that existing PR though

sterile token
#

Mainly a versioning/naming comparison, what i have said from the start 🤔

rotund ravine
#

verano no one listens to you

sterile token
rotund ravine
#

what

kind hatch
#

?

lost matrix
#

XDD

rotund ravine
#

That's the society you have created.

lost matrix
#

Thats such an Verano answer

supple parcel
#

Sure, except it doesn't matter what version it is.
I should be able to install the very first version of a plugin and overwrite the newest version of a plugin if I want to be stupid.

sterile token
#

🤣

lost matrix
kind hatch
sterile token
kind hatch
#

Maybe you could use it for the jar that's already loaded in /plugins, but since the one in update isn't loaded, you won't be able to use SimplePluginManager for it.

supple parcel
#

Let me just make the PR 🥺

patent socket
sterile token
undone axleBOT
sterile token
#

Paste your currently code

lost matrix
undone axleBOT
round laurel
#

anyone know a custom death sound plugin

sterile token
flint coyote
#

Finding a plugin 😂

round laurel
flint coyote
#

Btw smile I managed to completely restructure my project and cleaned up a lot of messy code thanks to your feedback.

lost matrix
#

Sounds nice 😄

flint coyote
#

Only took like 9 hours lol

lost matrix
#

Worth it

flint coyote
#

it is/was indeed

patent socket
sterile token
onyx fjord
#

can java application define its custom default startup params?

lost matrix
#

You mean VM params? Or just properties you set with -D for example

onyx fjord
#

stuff like gc

#

or maximum memory

rotund ravine
#

I mean

#

differs unless u define them

rough drift
#

Just forgot to include it as optional lmao

small timber
#

how can I make like a tempban command

#

where I control how long I ban someone for

rotund ravine
small timber
#

can u give me one?

naive bolt
#

How can I check if a plugin on server

#

I know their is some sort of getDataFolder thing

#

but cannot remember

rough drift
#

Bukkit.getPlugin("name") != null

#

or smt else

naive bolt
#

Bukkit.getPluginManager().getPlugin("name")

#

thanks

rough drift
#

yeah

naive bolt
#

f bing

rotund ravine
#

eat a gpt-4 sandwich

naive bolt
#

better to not use gpt when coding

#

means you actually learn

#

WOW

rotund ravine
#

True, unless u know what oyu are doing

naive bolt
#

if u know what u doing u dont need it

rough drift
#

How can I read an option from the bukkit.yml?

#

Is there some sort of API for it?

heavy mural
#

If you ask why chatgpt chose for a certain approach its actually really valuable info

rotund ravine
naive bolt
rotund ravine
#

Lazy ftw

rough drift
#

not the plugin's description

naive bolt
#

oh yeah my bad

minor garnet
#
            YamlConfiguration.loadConfiguration(file);
        } catch (InvalidConfigurationException exception) {
            throw new InvalidConfigurationException("Error processing file " + file.getName() + ": " + exception.getMessage());
        }```

how i can catch that exception ?
rotund ravine
rough drift
rotund ravine
#

I am not going ot log on sigjh

rough drift
quaint mantle
rough drift
#

It's only lightmode

rough drift
#

Better

supple parcel
rough drift
#

Mine is somewhat more contained though, both still work

supple parcel
#

Yeah, I'm personally not a fan of reading every file in update every time a plugin loads. But other than making it more complicated, not much to do there.

rough drift
lavish wing
#

Hey guys help me pls
Why this code doesn't work?
Code

    @Override
    public void onEnable() {
        try {
            Socket socket = new Socket("localhost", 25565);
            OutputStream out = socket.getOutputStream();


            byte[] PacketLogin = new byte[]{0x01, (byte)'P', (byte)'l', (byte)'a', (byte)'y', (byte)'e', (byte)'r'};

            out.write(PacketLogin);
            out.flush();
            socket.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

Error

00:25:04 [INFO] Server permissions file permissions.yml is empty, ignoring it
00:25:04 [SEVERE] java.io.IOException: Received string length longer than maximum allowed (25970 > 16)
00:25:04 [SEVERE]       at net.minecraft.server.Packet.a(Packet.java:165)
00:25:04 [SEVERE]       at net.minecraft.server.Packet1Login.a(Packet1Login.java:23)
00:25:04 [SEVERE]       at net.minecraft.server.Packet.a(Packet.java:110)
00:25:04 [SEVERE]       at net.minecraft.server.NetworkManager.g(NetworkManager.java:168)
00:25:04 [SEVERE]       at net.minecraft.server.NetworkManager.c(NetworkManager.java:293)
00:25:04 [SEVERE]       at net.minecraft.server.NetworkReaderThread.run(NetworkReaderThread.java:34)
00:25:04 [INFO] /127.0.0.1:51696 lost connection
sullen marlin
#

are you running 1.5 lol

rough drift
rough drift
lavish wing
sullen marlin
#

1.2?

lavish wing
#

its infdev 2010 06 18 with beta 1.7.3 api

sullen marlin
#

lol

#

even worse

rough drift
#

damn

lavish wing
#

Im also using bungee cord

lavish wing
rough drift
#

should be like (byte) 6

lavish wing
#

Oh

#

thx

rough drift
#

I forgot tbh

#

wait no

#

it's uh (byte) 0, (byte) 0, (byte) 0, (byte) 6 or smt

lavish wing
#
00:29:11 [SEVERE] java.io.IOException: Received string length longer than maximum allowed (20588 > 16)
00:29:11 [SEVERE]       at net.minecraft.server.Packet.a(Packet.java:165)
00:29:11 [SEVERE]       at net.minecraft.server.Packet1Login.a(Packet1Login.java:23)
00:29:11 [SEVERE]       at net.minecraft.server.Packet.a(Packet.java:110)
00:29:11 [SEVERE]       at net.minecraft.server.NetworkManager.g(NetworkManager.java:168)
00:29:11 [SEVERE]       at net.minecraft.server.NetworkManager.c(NetworkManager.java:293)
00:29:11 [SEVERE]       at net.minecraft.server.NetworkReaderThread.run(NetworkReaderThread.java:34)
#
byte[] PacketLogin = new byte[]{0x01, (byte) 0, (byte) 0, (byte) 0, (byte) 6, (byte)'P', (byte)'l', (byte)'a', (byte)'y', (byte)'e', (byte)'r'};```
rough drift
#

smt like that yeah

lavish wing
# lavish wing ```java byte[] PacketLogin = new byte[]{0x01, (byte) 0, (byte) 0, (byte) 0, (byt...

It returns

00:29:11 [SEVERE] java.io.IOException: Received string length longer than maximum allowed (20588 > 16)
00:29:11 [SEVERE]       at net.minecraft.server.Packet.a(Packet.java:165)
00:29:11 [SEVERE]       at net.minecraft.server.Packet1Login.a(Packet1Login.java:23)
00:29:11 [SEVERE]       at net.minecraft.server.Packet.a(Packet.java:110)
00:29:11 [SEVERE]       at net.minecraft.server.NetworkManager.g(NetworkManager.java:168)
00:29:11 [SEVERE]       at net.minecraft.server.NetworkManager.c(NetworkManager.java:293)
00:29:11 [SEVERE]       at net.minecraft.server.NetworkReaderThread.run(NetworkReaderThread.java:34)
small timber
#
            Inventory anvil = Bukkit.createInventory(p, InventoryType.ANVIL);

            p.openInventory(anvil);
#

when it opens the anvil and i try and repair something

#

when I take out the result, it just disappears

chrome beacon
#

Yeah that won't work

#

I recommend using a 3rd party library for anvil GUIs

small timber
#

so how?

chrome beacon
#

hm actually the one I was thinking of only captures user input

#

You're going to need to use NMS to make the anvil inventory work

small timber
#

net minecraft sever?

chrome beacon
#

Yeah

lavish wing
small timber
# chrome beacon Yeah

so can you just quickly tell me how I would use NMS for this particular case so I don't need to spend hours researching how all of NMS works?

chrome beacon
lavish wing
#
byte[] PacketLogin = new byte[]{0x01, (byte) 0, (byte) 0, (byte) 0, (byte) 6, "Player".getBytes()};
chrome beacon
sacred scaffold
#

Ok

#

I need help

tardy delta
#

<insert naming conventions>

sacred scaffold
#

with my Code.

tardy delta
#

?ask

undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!

sacred scaffold
#

And my mental health

compact haven
#

bro put a byte array into a byte array initializer

sacred scaffold
#

Ok so I'm not a professional coder anymore. But I want to get back to it. And so basically I wrote this script but never got to use it and I forgot why the errors detected by the IDE prevented it from working when I exported it as a jar file.

#

There are errors on the underlined parts of the code and when I try to export it

#

its a plugin meant for API Spigot 1.8.8 by the way

hazy parrot
#

There is no main hand in 1.8

young knoll
#

Well that’s issue 1

#

getItemInMainHand doesn’t exist in 1.8

#

As for enchantment, you haven’t imported it

sacred scaffold
#

can I just use that without it affecting it

young knoll
#

Mhm

sacred scaffold
#

ok

sterile token
#

Hi im sending the next structure over redis, im a bit confused about doing the checks, so the receiver doesnt self listen to the packets he sent

// Sending to a specific server
{
  "payload": {
    "server": {
      "sender:" "lobby-1",
      "receiver": "proxy-1" 
    }
    "packet": {
       "uniqueId": "1"
       // Fields serialized here 
    }
  }
}

// Sending to any server:
{
  "payload": {
    "server": {
      "sender:" "lobby-1",
      "receiver": "" 
    }
    "packet": {
       "uniqueId": "1"
       // Fields serialized here 
    }
  }
}

Its a stupid question, but i cant code the correct check for it

sacred scaffold
#

What about registerevents

#

It says in the IDE "The method registerEvents(Listener, Plugin) in the type PluginManager is not applicable for the arguments (BowBoost, BowBoost)"

storm scaffold
#

Is there a way to define a custom crafting recipe requiring an item with a certain PersistentData tag, but without requiring any other certain data? e.g. a certain tag, but regardless of name/damage/custom model data

tardy delta
#

it needs a plugin and listener

young knoll
#

You’ll have to use the PrepareItemCraftEvent to check

sacred scaffold
#

im so dumb

#

so I can just implement 'plugin' to public class of bowboost?

storm scaffold
sacred scaffold
#

or should I cast arg 2 to plugin?

young knoll
#

You need to manually check if the item in whatever slot is your desired item

#

If it isn’t, clear the output

storm scaffold
#

Would that cause a lot of lag if I have loads of crafting recipes?

young knoll
#

The event gives you access to the recipe in use

sacred scaffold
#

I forgot how to convert implicit to explicity constructs

sterile token
sacred scaffold
#

does anyone know

young knoll
#

Which has a namespaced key

sacred scaffold
#

but thanks

#

I will def do that

#

before continuing

young knoll
#

You can map that key to your custom recipes so you don’t have to loop anything

sacred scaffold
#

when I get back

sterile token
sacred scaffold
#

Implicit super constructor Object() is undefined for default constructor. Must define an explicit constructor

#

yeah

sterile token
#

At this point im seeing you didnt learnt Java, so this def is not the way

sacred scaffold
#

Not entirely

#

I only know the basics and then did some courses

#

but I had help

#

just difficult applying it to games

sterile token
#

i dont even think you learn it, because the basics include, fields, constructors, excetions, also you dont understand what issues throw the IDE and why, etc

flint coyote
sacred scaffold
#

understood

sterile token
#

I can look for a good java playlist on english if you want

sterile token
#

Or its called OOP?

flint coyote
#

OOP is the common term

hazy parrot
#

Isn't it oop xd

sterile token
#

Oh POO is called in spanish, my bad

sacred scaffold
flint coyote
#

Hell yeah time to apply somewhere and tell them I can code POO 💩

quaint mantle
sterile token
#

haha

#

Thats another Alexito memeb 🤣

#

okay im struggling with redis for some reason is listening to self data arrive (its listening to the data, he is sending ) while he shouldnt listen to that data, cuz he is the sender

lavish wing
#

I got new error

#
            Socket socket = new Socket("localhost", 25565);
            OutputStream out = socket.getOutputStream();
            
            byte[] PacketLogin = new byte[]{(byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 6, (byte)'P', (byte)'l', (byte)'a', (byte)'y', (byte)'e', (byte)'r'};
            out.write(0x1);
            log.info("PACKET SENT: LOGIN STATUS");
            out.write((byte) 16);
            log.info("PACKET SENT: PROTOCOL ID "+ (byte) 16);
            out.write(PacketLogin);
            log.info(Arrays.toString(PacketLogin));
            out.flush();
            socket.close();
#

@rough drift

sullen marlin
#

What are you trying to Fri

#

To do

sterile token
sullen marlin
#

Because this seems like a terrible way to code anything useful

lavish wing
maiden thicket
#

what

#

am i looking at

lavish wing
#

I want to create npc on my server

maiden thicket
#

sir that is not how you should try to create a server at all

#

thats not how you should use packets at al

sterile token
maiden thicket
#

i dont know where u got that from 😭

lavish wing
sterile token
maiden thicket
#

wht version

lavish wing
#

because it haven't authlib

maiden thicket
#

u have to use

#

spigot

#

not spigot-api

sterile token
lavish wing
#

im using infdev 2010 06 18 with beta 1.7.3 api

maiden thicket
#

1.7.3 isnt supported

lost matrix
sterile token
lavish wing
#

server.jar

maiden thicket
#

why are u using such an old version

sullen marlin
#

How would beta 1.7 API even work on infdev?

sterile token
lavish wing
lost matrix
sullen marlin
#

Either way no one here is going to help you with a 13 year old version

lavish wing
sullen marlin
#

Never even heard of Poseidon, but this is surely the wrong place for help with it

sterile token
lavish wing
maiden thicket
sullen marlin
#

Doubt they go back that far

#

This is THIRTEEN years lol

maiden thicket
#

this???

young knoll
#

They don’t

sterile token
young knoll
#

I’ve seen a plugin that lets you join with all the way back to 1.0

#

But that’s it

lavish wing
maiden thicket
#

why

sterile token
maiden thicket
#

for what reason

lavish wing
maiden thicket
#

i

#

dont even think

#

that repository is legal

#

💀

sterile token
maiden thicket
#

not even craftbukkit

#

NMS

sterile token
#

Also bad commits, if you will make some public and good open source project, yo should use conventional commits atleast or even thought follow an order

acoustic falcon
#

hi, i am using HikariCP and a Postgres database but i get this error:

Caused by: java.lang.ClassNotFoundException: org.postgresql.ds.PGSimpleDataSource

this is my code:

    public ConnectionPoolManager(Main plugin) {
        this.plugin = plugin;
        this.USER = plugin.getConfig().getString("database.user");
        this.PASSWORD = plugin.getConfig().getString("database.password");
        this.HOST = plugin.getConfig().getString("database.host");
        this.PORT = plugin.getConfig().getString("database.port");
        this.DATABASE = plugin.getConfig().getString("database.database");
        setupPool();
    }

    private void setupPool() {
        HikariConfig config = new HikariConfig();

        config.setDataSourceClassName("org.postgresql.ds.PGSimpleDataSource");
        config.addDataSourceProperty("serverName", HOST);
        config.addDataSourceProperty("portNumber", PORT);
        config.addDataSourceProperty("databaseName", DATABASE);
        config.addDataSourceProperty("user", USER);
        config.addDataSourceProperty("password", PASSWORD);

        dataSource = new HikariDataSource(config);
    }

And last but not least my pom.xml

        <dependency>
            <groupId>org.postgresql</groupId>
            <artifactId>postgresql</artifactId>
            <version>42.5.4</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.zaxxer</groupId>
            <artifactId>HikariCP</artifactId>
            <version>5.0.1</version>
        </dependency>

If you need more of the code or error just let me know i!

tardy delta
#

you have to shade it ig

#

dont think spigot included postgres

acoustic falcon
#
<plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <configuration>
                    <source>15</source>
                    <target>15</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.2.4</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <shadeTestJar>true</shadeTestJar>
                            <shadedClassifierName>SHADED</shadedClassifierName>
                            <shadedArtifactAttached>true</shadedArtifactAttached>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
```This shades it right?
sterile token
#

Why people now a days love to use configuration for databases? Instead of making approach of the connection uri 🤔 🤔

tardy delta
#

you need to set scope to compile

acoustic falcon
sterile token
#

That makes your db config to reduce to 1 line 💀

acoustic falcon
#

Yeah that also works i will do that but i don't think it will solve my problem

sterile token
#

What jar are you putting on the server

#

Because the maven-shade-plugin will create 2 jars every time, one named as your project wihich is the one you have to use and another called your original-blabla.jar

acoustic falcon
#

i used the maven shade wrong thank you love the server already with this quick help!

sterile token
#

Really happy you fixed it

patent socket
young knoll
#

Because you don’t have a variable called task

#

Also you spelt cancel wrong

chrome beacon
#

What even is that code

lost matrix
tiny ferry
#

guys is there an easy way to check in a for loop if i equals to a number out of a list? lets say i run a for loop from 1 to 100, want to check if any of those numbers contains the same number in a list (example list: 1,6,17,18,29,47 etc)

#

*without having to do a bunch of ifs

lost matrix
tiny ferry
#

ahhh okay i will try

young knoll
#

Also consider a HashSet if you are going to be using a lot of contains

tiny ferry
#

a Hashset or a hashmap?

lost matrix
keen horizon
buoyant viper
#

its like a List but not exactly

young knoll
#

Sets can’t be accessed by index

buoyant viper
#

no duplicate entries allowed, and maybe im just dumb but theres also no .get

young knoll
#

Yes, no access by index and no duplicates

ivory sleet
#

(/s)

young knoll
#

SetListMapQueue?

buoyant viper
#

wonder why Sets dont have index

lost matrix