#help-development

1 messages Β· Page 338 of 1

echo granite
#

I will try to delay the title, thank you everybody πŸ™‚

mighty mica
#

Hello everyone,
This may be a stupid question...
But is it possible to call another class on onEnable()?
What I mean is;
If I split up all my onEnable code and put it into different classes, would it be possible to call said classes?
To execute the code within on onEable?

echo granite
solemn frigate
#

hullo all, is it possible to get a head with custom textures? like get a head from a png of a skin or smth?

sturdy heron
#

How do I get all entities in a world using ProtocolLib?

solemn frigate
#

thats not what im asking

river oracle
#

my thats not a good answer at all

river oracle
# solemn frigate hullo all, is it possible to get a head with custom textures? like get a head fr...

I usually just use headbase and use Mojang's GameProfile class provided by Minecraft's auth dependency https://minecraft-heads.com/
My internet is to slow to find a thread rn but there are plenty on spigot about how to set custom head textures

sturdy heron
#

someone was too eager to shove a toxic answer into a programmer's face

river oracle
sturdy heron
#

Yes I meant all entities loaded, basically the Bukkit.getWorlds().get(0).getEntities() but in ProtocolLib

river oracle
#

why would you need to use ProtocolLib for that though?

#

it wouldn't be any faster

sturdy heron
#

I'm doing asynchronous threads and the getEntities does not support such a thing

river oracle
#

you can't read chunks asynchronously? thats surprising

sturdy heron
#

Not sure about the logic behind it but doing so gives me an error, lotta methods seem to not like asynchronous stuff

river oracle
#

thats generally how spigot works unfortunatly.

#

can't write any data async in pretty much every case.

#

but as far as I was aware you can actually read most things, mind posting the error you were getting?

#

?paste

undone axleBOT
timid berry
#

how do i compile this? like whats the maven command for linux

timid berry
#

do i do mvn install also?

tender shard
#

only if you need to install the .jar to your local repo

river oracle
#

also like to point out protocolLib won't help you there

#

thats how the minecraft server works inherently

timid berry
#

lmao

sturdy heron
#

huh I would think that ProtocolLib would have a way to grab entities in a world but maybe not, probably just have to make a static variable that updates whenever entities are destroyed / created

buoyant viper
#

protocollib is really just packets

#

i dont see why it would have a method to get all entities in the world

river oracle
#

/ tyring to do

sturdy heron
#

Well right now I'm doing an asynchronous thread that runs every 10ms to simulate a bullet moving through the minecraft world, (that way I can make so shooting far away will make you need to aim ahead of the player). If I synchronize it up to the main thread then it will result in less "accurate" aim ahead timings since the jump between needing to aim ahead and not will be 5x more abrupt

#

Anyway I need to get all the entities in the world since I need to know when the bullet hits an entity

dry yacht
sturdy heron
#

raycasting is instant, I'm simulating a bullet through time

dry yacht
sturdy heron
#

yes

dry yacht
#

You could still use raycasting and calculate how much lower the bullet would hit at the distance of an intersection. This way, you're at least dramatically lowering the number of hit candidates.

sturdy heron
#

I mean thats basically simulating the bullet which is what I'm already doing

#

I also can use the raycast every 10ms, though the API used will still loop through the entities once since it needs to know where they are

dry yacht
sturdy heron
#

yep, it'll also only be doing 14 raycasts max so shouldn't be too performance heavy

odd adder
#

Hi , anyone know which method in nms that can convert strings to CompoundTag?

tender shard
odd adder
#

there seems not any function in CompoundTag

#

only bytes

tender shard
#

ah it's parseTag

#
    @Override
    public void deserializePdc(String serializedPdc, PersistentDataContainer target) throws Exception {
        CompoundTag tag = TagParser.parseTag(serializedPdc);
        ((CraftPersistentDataContainer)target).putAll(tag);
    }
``` for example
odd adder
#

thanks

lethal coral
#

how is the flash particle colored in a firework

buoyant viper
lethal coral
#

😐

regal scaffold
#

@tender shard Were you able to successfully add cirrus? I saw the git merge

rare rover
#
    public static Map<String, Class<?>> classes = new HashMap<>();

    public static void registerClass(Class<?> clazz) {
        classes.put(clazz.getName(), clazz);
    }

    public static Variable deserializeVariable(String str) {
        if (str.startsWith("playerVariable{")) {
            String replace = str.substring(15, str.length() - 1).replace("||", "@@");
            String[] split = replace.split("@@");
            Class clazz = classes.get(split[2]);
            Player plr = Bukkit.getPlayer(split[0]);
            if (!plr.isOnline() || clazz == null) return null;
            return new Variable<>(split[1], Bukkit.getPlayer(split[0]), clazz.cast(split[3]));
        }
        return null;
    }``` ik very goofy system but how would i make this work? Since i cant cast it to everything everytime
thin delta
#

Hey guys, I'm trying to find a spigot plugin to revert sneaking mechanics back to pre-1.14+ mechanics. Specifically to prevent players from being able to fit in a 1.5 block tall area while sneaking

lethal coral
#

then handle it in each class

rare rover
#

good idea

quaint mantle
#

uh could I create a thread just need some help

rotund ravine
#

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

quaint mantle
#

?paste

undone axleBOT
quaint mantle
#

I have this class called "DctrSpaceHelmCMD" which when a player does /spacehelm <player_name> it adds the spacehelm to their helm
well it sets it as the players helm while I want it just to add it to the players inventory how do I do so?

remote swallow
#

player.getInventory().addItem(itemstack)

quaint mantle
#

but

#

am I not supposed to define the itemstack before that?

remote swallow
#

the itemstack can be defined anywhere

quaint mantle
#

I tried that but I got item as null

remote swallow
#

?paste the code

undone axleBOT
quaint mantle
#

I already have the array list defined in the main class so im gonna remove that

remote swallow
#

there is quite a bit wrong on that PlayerInteractMethod, and you are adding stuff to th method after you have already given the item

#

spacehelm isnt even the item you define stuff to

jagged monolith
#

You have an event in that class but you're not even implementing Listener for that class.

quaint mantle
#

oh so what do I do?

remote swallow
#

implements CommandExecutor, Listener or put them in seperate classes

jagged monolith
#

You should also move player.getInventory().addItem(spacehelm); to after you set all the lore and other information for the item

quaint mantle
#

oh

#

alrighty

#

I got this in the main file where the itemstack is defined as helmet

#

do I keep it as is?

remote swallow
#

that will still probably work if colors is a list/hashmap of materials

quaint mantle
#

ig

#

andd uhh am I supposed to define spacehelm in each class?

 public static ItemStack spacehelm;```
jagged monolith
#

Use Dependency injection and make a public getter for it. You shouldn't really need static.

remote swallow
#

with di

#

?di

undone axleBOT
quaint mantle
#

uhh

jagged monolith
#

That's the best way to do it as it means you'll be sure you're always referencing the correct itemstack

quaint mantle
#

?paste

undone axleBOT
remote swallow
#

you create a getter for the item stack

#

not the command

jagged monolith
#

The item stack you're making in the main class

quaint mantle
#

hm

quaint mantle
#

?paste

undone axleBOT
remote swallow
#

your still adding a null item, not the spacehelm item

quaint mantle
#

shit

remote swallow
#

set the meta after the item flag and add itemStack

quaint mantle
#

like dis?

remote swallow
#

?learnjava

undone axleBOT
remote swallow
#

spacehelm is nothing

#

you can remove it

#

at the item to the inventory AFTER you do anythign to the meta

quaint mantle
#

oh

quaint mantle
#

hi

#

how do i create a compass item with the needle pointing in a certain direction?

jagged monolith
#

You can use the CompassMeta#setLodestone(location) to set the direction it points in.

grizzled oasis
#

Hi, i have a WeakHashMap on my main class and inside of it's saved only playerUUID and a string but when the GangJoinEvent is flagged the HashMap don't reply with the string but with nothing

https://paste.md-5.net/kamojisose.cs

limpid nexus
#

Thats because your not putting anything inside the hashmap or printing it out

#

Your telling it to get but not put and also wheres the loop to cycle through the players?

lethal bane
#

Is there a way to change the default nbt tag of something like enchantments. I have put some nbt data in the enchantments nbt tag like this:
Enchantments:[{lvl:1s,id:"minecraft:sharpness",min:1,max:4,value:5}] just as an example. But spigot keeps removing this nbt data and the tag then look like this:
Enchantments:[{lvl:1s},id:"minecraft:sharpness"] all my custom nbt data is removed. Is there a way to prevent this from happening?

tender shard
#

just use PDC instead

quaint mantle
#

hi, do hashmaps in java store keys by value or reference?

limpid nexus
#

Key and value

lethal bane
#

Yes but the system is already done and very complicated. I coded it in a datapack originally and now want to make it work on spigot. So no, I cant use PDC in this case.

remote swallow
quaint mantle
#

i mean

tender shard
#

reference

quaint mantle
#

is the key a reference object or value?

remote swallow
#

map.get(key) returns value

lethal bane
#

Please, does someone know how to prevent spigot from deleting the nbt data?

quaint mantle
#
String string = "string object";

HashMap<String, Integer> hashmapobject = HashMap<String, Integer>();
hashmapobject.put(string, 1);
remote swallow
#

you can most likely convert the nbt on those items to pdc

quaint mantle
#

is the code i posted above storing the string object's reference or storing "string object"?

tender shard
#

it's btw not spigot that overrides it, but vanilla mc

#

a reference, as said

quaint mantle
#

okay.

lethal bane
#

na it works fine on vanilla servers

quaint mantle
#

wait, so can it not match hashmapobject.get("string object");?

#

if it is a reference?

tender shard
#

ofc you can do that

quaint mantle
#

ok nvm, that problem aside for now.

#
    private ItemStack createCompass (Material material, int count, String name, String... lore) {
        final ItemStack item = new ItemStack(material, count);
        final CompassMeta meta = item.getItemMeta();

        meta.setDisplayName(name);
        meta.setLore(Arrays.asList(lore));

        item.setItemMeta(meta);

        return item;
    }```
#

it shows an error when i try to get the compass meta.

remote swallow
#

cast it

quaint mantle
#

okay.

tender shard
#

because getItemMeta() returns ItemMeta, not CompassMeta. You have to cast it

azure quarry
#

is it possible to make it so squids dont need to spawn on water from squid spawners? via api

quaint mantle
#

nvm.

remote swallow
#

which out of these would you say is better, im guessing the top one

quaint mantle
#

depends on what you are doing

remote swallow
#

which looks better from an end user perspective

quaint mantle
#

oh you are asking about the looks not technicalities.

remote swallow
#

yeah

quaint mantle
#

probably top.

#

and change mysql-info to maybe URI/URL.

remote swallow
#

okay

#

thanks

hard radish
#

What’s a preferred way of hosting a mysql?

#

For paid and also free if possible

jagged monolith
#

Most hosting providers actually give you a database to use.

haughty granite
#

with ItemStack, how to add a grey text just below it like on the screen ?

remote swallow
#

lore

haughty granite
#

and to make a space, just add an empty lore?

remote swallow
#

think so

haughty granite
#

any idea how to avoid this?

remote swallow
#

which?

haughty granite
#

the sentence that doesn't break

remote swallow
#

that has to be done manually

haughty granite
#

really ?

remote swallow
#

yeah

haughty granite
#

πŸ™ƒ

sage patio
#

Hi, anyone can send an example how i can set a block direction in 1.12.2?

azure quarry
#

is it possible to make it so squids dont need to spawn on water from squid spawners? via api

quaint mantle
#

Hello can somebody help? I got vehicles [The paid one with no resource pack] i got the chest but when i place it the vehicle despawn like i see armorstand but instantly despawns

urban mauve
#

guys, i wanna upload my resource, but i have update checker that works with resource id
how can i get it before resource upload to build it?

chrome beacon
#

Upload > get id > update?

urban mauve
jade rock
#

how do i make it so that the block will break if the user placed it. here is my code so far:

@EventHandler
public void onBlockPlace(PlayerInteractEvent event){
  Player p = event.getPlayer();
  if (event.getAction() == Action.RIGHT_CLICK_BLOCK) {
   //code to break the block
 }
}
limpid nexus
#

check the players name and if its an instance of player then get the block id and break it

jade rock
#

how do you get the block id

limpid nexus
#

Or something along those lines

remote swallow
#

iirc get the location and use breakNaturally or something along those lines

jade rock
#

they all require a storage?

tardy delta
#

Faster?

icy monolith
#
    @EventHandler
    public void onBlockBreak(BlockBreakEvent event) {
        Player player = event.getPlayer();
        if (player.isOp()) {
            return;
        }
        event.setCancelled(true);
        final Block block = event.getBlock();
        Material originalType = block.getType();
        if (originalType != Material.STONE && originalType != Material.IRON_ORE && originalType != Material.DIAMOND_ORE && originalType != Material.EMERALD_ORE) {
            player.sendMessage("You can't break these blocks!");
            return;
        }
        event.setDropItems(false);
        event.getPlayer().getInventory().addItem(new ItemStack(block.getType()));
        block.setType(Material.BEDROCK);
        Bukkit.getServer().getScheduler().runTaskLater(this.plugin, new Runnable() {
            @Override
            public void run() {
                block.setType(originalType);
            }
        }, 20 * 5);
    }
}```
Does any one know a fix to this? Idk why, but the world is split in 2 and half of the world works and other half dosnt.
tender shard
quaint mantle
#

hi

quaint mantle
remote swallow
#

mariadb is a fork of mysql

quaint mantle
#

well and that it is not mysql.

#

oh nvm.

tender shard
quaint mantle
#

nvm.

#

anyway, i have to register a lot of event handlers but they are all pretty much the same, is there a way to like do this easier than just creating a class for each and every one of em?

sage patio
urban mauve
sage patio
#

and somebody tell me how the FUCK i can set block face in 1.12.2

quaint mantle
#
registerEventHandler((Event) EventType);
#

something like that?

#

its pretty much the same event handlers for all of em.

#

so

#

any idea on how i could do it?

hard radish
grizzled oasis
#
    public void Xanax(PlayerInteractEvent event) {
        Player p = event.getPlayer();
        Material Drug = Material.PUMPKIN_SEEDS;

        if(cooldown.contains(p.getUniqueId())) {
          
            return;
        }

        p.sendMessage(String.valueOf(event.getPlayer().getItemInHand()));

        if(event.getPlayer().getItemInHand().getType().equals(Drug)) {
            p.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE, 7, 1));
            p.playSound(p.getLocation(), Sound.ENTITY_EXPERIENCE_ORB_PICKUP, 1f, 1f);
            cooldown.add(p.getUniqueId());
            new RemoveCooldown(p.getUniqueId()).runTaskLater(plugin, 100);
        }
    }

The event is not fired and event doesn't log nothing, i already did registred everything

subtle kite
hard radish
sage merlin
#

for (int i = 0; i <= slots.size(); i += 1) { for (String d : modifyfile.getConfigurationSection(e.getPlayer().getUniqueId() + "." + "Inventory" + ".").getKeys(false)) { if (modifyfile.getItemStack(e.getPlayer().getUniqueId() + "." + "Inventory" + "." + d) != null) { ItemStack item = modifyfile.getItemStack(e.getPlayer().getUniqueId() + "." + "Inventory" + "." + d); e.getInventory().setItem(slots.get(i), item); } } }} im trying to save a players inventory (custom) after a restart through a config file but its not working

#

you could say its like a portable chest

grizzled oasis
icy monolith
#

In java do i have a class for basicly every action i need it to make? like if i would want to make a block place event i would need to make a new class for it?

#

Also what does implementing event listener mean and why do i need it?

Example:
getServer().getPluginManager().registerEvents(new BlockBreak(this), this);
I dont rly know what it does or why i need it, but it just says i do. Can some one explain this

#

ok and for each event i do a different .java file with a different event

eternal oxide
#

You register each class that implements a Listener. The Listener can contain multiple events.

topaz cape
#

what's a good structure for a random name + random skin database

#

for a disguise plugin of course

tender shard
jade rock
#

is there anyway to change the attribute of an offlineplayer only with username?

icy monolith
#

ah ok

sage patio
#

mfnalex

#

do you know how i can set block face in 1.12.2

hazy parrot
kindred valley
#

bummm

hard radish
#

still looking for a good mysql host... any suggestions?

dry yacht
dry yacht
onyx fjord
#

can you change players view distance in spigot?

#

without nms

jade rock
hazy parrot
onyx fjord
smoky oak
#

is there a less expensive variant of rayTrace if you only want to check if all the blocks are air?

dry yacht
# jade rock player.getAttribute

Take a look at this (https://minecraft.fandom.com/wiki/Player.dat_format#NBT_structure) page and expand the section "Tags common to all mobs". As you can see, there's an attributes list in the NBT of all entities. By using a NBT API (https://github.com/tr7zw/Item-NBT-API) you can easily load, modify and save the player-data file of your target-player.

An easier but less elegant route would be to just keep a list of attributes yourself, persist them somewhere, and apply them on join. But I'd much prefer the route of editing the NBT file.

GitHub

Add custom NBT tags to Items/Tiles/Entities without NMS! - GitHub - tr7zw/Item-NBT-API: Add custom NBT tags to Items/Tiles/Entities without NMS!

Minecraft Wiki

<player>.dat files are used by servers to store the state of individual players. The format is also used within level.dat files to store the state of the singleplayer player, which overrides any <player>.dat files with the same name as the singleplayer player. These files are in NBT format.

tardy delta
topaz cape
#

or anything else

jade rock
tardy delta
#

hmm i could eventually integrate my parser in a plugin

dry yacht
dry yacht
jade rock
dry yacht
dry yacht
jade rock
#

i think you can set it with the file

#

api*

dry yacht
jade rock
#

oh alr

#

thanks

topaz cape
onyx fjord
#

i just did a mistake by sending packet on join

#

and looks like its sent by server a bit later

dry yacht
dry yacht
# jade rock thanks

If you're stuck with editing the NBT file, I can try to quickly create an API for you.

onyx fjord
#

lmao something's not right

tardy delta
#

πŸ’€

#

those stringlatin and stringutf classes are kinda pissing me off

onyx fjord
# onyx fjord

I am interrupting view distance update packet, maybe i need to do something else too?

trim creek
#

You are not returning a string. xd
(this is a joke. "nem" means "no" in hungarian)

dry yacht
onyx fjord
#

using packetevents

dry yacht
onyx fjord
#

2

#

o

#

looks like i fixed it

dry yacht
#

I think the main issue is just that you've thus changed the viewing distance on the server to two, but the client still expects packets there.

onyx fjord
#

i also had to listen to client settings

dry yacht
onyx fjord
#

the one server receives

#

and the one server sends (update render distance)

#

but yea no ghost chunks now

onyx fjord
#

can i also somehow force chunk reload ?

#

for client

tardy delta
#

what are you doing?

dry yacht
#

Ah, PacketPlayOutViewDistance and PacketPlayInSettings I guess?

onyx fjord
#

yes

#

naming is different but that should be it

icy monolith
#

Know why itemMeta.setDisplayName("Iron fragment"); shows a warning?

tardy delta
#

paper?

dry yacht
onyx fjord
tardy delta
#

cuz those paper men are a bunch of idiots

onyx fjord
onyx fjord
#

😐

tardy delta
#

how are they gonna load plugins then?

onyx fjord
#

main craftbukkit class has like 500+ warnings

tardy delta
#

πŸ’€

onyx fjord
icy monolith
tardy delta
#

backwards compatibility goes brr, i understand them

onyx fjord
tardy delta
#

if you dont need any paper api, use spigot api yes

onyx fjord
#

you dont need paper api

tardy delta
#

thats what you say

icy monolith
# tardy delta ignore it

Yeah, but i can't cuz i need it to set the name of the item to that, but atm with this warning it dosnt set its name

onyx fjord
#

and if you plan publishing on spigot you cant use paper api

tardy delta
#

warnings will compile

remote swallow
dry yacht
icy monolith
onyx fjord
icy monolith
#

i set it after

remote swallow
#

or before you set the meta

dry yacht
tardy delta
#

<insert item builder here>

#

how spigot doesnt have that by default

icy monolith
onyx fjord
icy monolith
#
        ItemStack item = new ItemStack(Material.AIR);;
        ItemMeta itemMeta = item.getItemMeta();;;
        if (originalType == Material.STONE) {
            item = new ItemStack(Material.STONE_BUTTON);
            itemMeta = item.getItemMeta();
            itemMeta.setDisplayName("Stone fragment");
        }
        else if (originalType == Material.IRON_ORE){
            item = new ItemStack(Material.IRON_NUGGET);
            itemMeta = item.getItemMeta();
            itemMeta.setDisplayName("Iron fragment");
        }
        item.setItemMeta(itemMeta);
        event.getPlayer().getInventory().addItem(new ItemStack(item.getType()));```
there
onyx fjord
tardy delta
#

;;; u good man?

remote swallow
#

you add a completely different item

icy monolith
#

dont mind that lol

remote swallow
#

addItem(item) not addItem(new ItemStack())

icy monolith
#

ah

onyx fjord
#

pure joy and fun now time for painkiller

dry yacht
onyx fjord
#

client proceeds a refresh

#

f3 + a kinda style

#

so yes they dissapear

dry yacht
#

Lol, then I guess those few packets would be the fastest way to gain full control over render distance.

onyx fjord
#

now i need a way to change tracking distance player has for certain entities

#

ideally packets/api no nms

icy monolith
tardy delta
#

ChatColor.translateAlternateColors?

dry yacht
onyx fjord
#

ye youd easily end up with a chatcolor mess

#

also i wouldnt be shocked if it was deprecated in paper lmao

remote swallow
#

it is

#

both chat color classes

#

and all the methods

onyx fjord
#

you WILL use components

tardy delta
#

no

onyx fjord
#

^

#

agreed

remote swallow
#

agree

onyx fjord
#

this is a non component zone

tardy delta
#

who doesnt use strings for messages

remote swallow
#

i love the minimessage format

tardy delta
#

like cmon man

remote swallow
#

but implementing it

#

i fucking hate

onyx fjord
#

u ONLY EVER use components for clickable messages

#

thats it

tardy delta
#

looks terrible too

onyx fjord
#

you WILL use adventure!

dry yacht
#

Hardcoding messages is stupid anyways. There should be a common syntax for defining these things in a config file.

tardy delta
#

hmm wondering what they mean with that Math.random() is not threadsafe

dry yacht
tardy delta
#

i mean it uses an atomiclong so should be threadsafe no?

smoky oak
#

i mean

#

do u need math random to be threadsave

tardy delta
#

nah just fast and i was wondering what they dif between Random, SplittableRandom and ThreadLocalRandom was

#

decided to use splittable one as its faster

dry yacht
tardy delta
#

dunno what would happen if it were not to be threadsafe anyways

onyx fjord
#

SecureRandom 🫑

tardy delta
#

dunno what that one does, iirc it doesnt use a seed?

#

or it changes it so the results arent predictable or smth?

quiet ice
#

It uses the secure random method of the OS I assume

#

i.e. /dev/srand

#

which polls it's data from mouse movements and other things

#

Hence it is advised to move your mouse when creating encryption keys

tardy delta
#

ahhh

quiet ice
#

I'd advise against Splittable random due to the fact that I haven't been aware that is exists until recently

tardy delta
#

i didnt know it existed either till pulsebeat sent me that

quiet ice
#

If it is truely safe to use in concurrent environments it comes at a drawback

tardy delta
#

im more using it cuz its faster

quiet ice
#

Either you have worse RNG or performance is worse

quiet ice
tardy delta
#

if its about the same as other random it doesnt really matter

#

as who is going to use 1000 rand() calls in my parser at once

quiet ice
#

Also, Random is thread-safe

        long oldseed, nextseed;
        AtomicLong seed = this.seed;
        do {
            oldseed = seed.get();
            nextseed = (oldseed * multiplier + addend) & mask;
        } while (!seed.compareAndSet(oldseed, nextseed));
        return (int)(nextseed >>> (48 - bits));
#

That being said you may experience small to detrimental performance reductions in concurrent envs

tardy delta
#

ye just sent that code a bit higher ^^

quiet ice
#

ChatGPT is telling bullshit there

tardy delta
#

as most of the times

dry yacht
quiet ice
#

Using AtomicLong in itself doesn't mean thread safety, but compareAndSet pretty much guarantees it

tardy delta
#

thats the only thing i remember, that cas tries to update smth till it succeeds

quiet ice
#

in conjunction with the while loop yes

tardy delta
#

ah

#

works ig

dim bluff
#

Hey, I know there's gonna be a little bias here when I ask, but: Which one should I start with to develop plugins in the latests versions of minecraft? Spigot or bukkit?

alpine swan
#

probably spigot, it contains more stuff and still has all of the bukkit features

#

anyways

quiet ice
#

You need to use the spigot api

alpine swan
#

how could i compare getNearbyEntities with an entity type (trying to see if the nearby entities contains an entity of a certain type)

quiet ice
#

Unless you compile cb yourself that is

#

Does anyone know how to nullify the annotation processor path under maven?

eternal oxide
#

Use the method that accepts a Predicate

alpine swan
#

could you explain this further, im quite new to java stuff

dry yacht
#

HOLY

undone axleBOT
vivid skiff
#

ok

tardy delta
#

Cow.class::isInstance if you want it fancy

alpine swan
#

if it possible to use an entity type in .contains() comehow

tardy delta
#

wha

dry yacht
#

How would that be better?

vivid skiff
remote swallow
dry yacht
#

Well, if it has type Cow, it's a Cow, innit?

quaint mantle
#

?paste

undone axleBOT
quaint mantle
#

alr thanks

tardy delta
#

database that uses a yml file πŸ€”

vivid skiff
dry yacht
#

But sure, do the instanceof, that should internally basically also only compare a hash or whatever.

tardy delta
#

naming on its best

vivid skiff
#

But i does the same thing with every other line thats sets something

remote swallow
vivid skiff
remote swallow
#

all the paths

#

no need for it

vivid skiff
tardy delta
#

exactly what i thought

remote swallow
#

those are not paths

tardy delta
#

why are you creating sections tho

remote swallow
#

remove the . from the start of

vivid skiff
#

I dit it but it gives me the same error

remote swallow
#

you would get a different error

dry yacht
dry yacht
dry yacht
#

Re-send the error as well as the whole file containing the claimed-chunks paths so that I can make use of line-numbers.

vivid skiff
# dry yacht Sure you compiled and replaced the jar properly?
org.bukkit.command.CommandException: Unhandled exception executing command 'chunk' in plugin ATHChun
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46) ~[patched_1.12.2.jar:git-
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:152) ~[patched_1.12.2.
        at org.bukkit.craftbukkit.v1_12_R1.CraftServer.dispatchCommand(CraftServer.java:685) ~[patch
        at net.minecraft.server.v1_12_R1.PlayerConnection.handleCommand(PlayerConnection.java:1492)
        at net.minecraft.server.v1_12_R1.PlayerConnection.a(PlayerConnection.java:1297) ~[patched_1.
        at net.minecraft.server.v1_12_R1.PacketPlayInChat.a(PacketPlayInChat.java:45) ~[patched_1.12
        at net.minecraft.server.v1_12_R1.PacketPlayInChat.a(PacketPlayInChat.java:5) ~[patched_1.12.
        at net.minecraft.server.v1_12_R1.PlayerConnectionUtils.lambda$ensureMainThread$0(PlayerConne
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ~[?:?]
        at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
        at net.minecraft.server.v1_12_R1.SystemUtils.a(SourceFile:46) ~[patched_1.12.2.jar:git-Paper
        at net.minecraft.server.v1_12_R1.MinecraftServer.D(MinecraftServer.java:850) ~[patched_1.12.
        at net.minecraft.server.v1_12_R1.DedicatedServer.D(DedicatedServer.java:423) ~[patched_1.12.
        at net.minecraft.server.v1_12_R1.MinecraftServer.C(MinecraftServer.java:774) ~[patched_1.12.
        at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:666) ~[patched_1.1
        at java.lang.Thread.run(Thread.java:829) [?:?]
Caused by: java.lang.IllegalArgumentException: Cannot set to an empty path
        at org.apache.commons.lang.Validate.notEmpty(Validate.java:321) ~[patched_1.12.2.jar:git-Pap
        at org.bukkit.configuration.MemorySection.set(MemorySection.java:168) ~[patched_1.12.2.jar:g```
#
        at org.bukkit.configuration.MemorySection.set(MemorySection.java:202) ~[patched_1.12.2.jar:g
        at me.gurwi.athchunkclaim.database.ChunksDatabase.claimChunk(ChunksDatabase.java:68) ~[?:?]
        at me.gurwi.athchunkclaim.commands.ATHCCommand.onCommand(ATHCCommand.java:28) ~[?:?]
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[patched_1.12.2.jar:git-
        ... 15 more```
remote swallow
#

which is line 68 of ChunksDatabase

vivid skiff
#

Is the same line i just tried to remove the section creation

#

But nothing changes

dry yacht
#

Can't you just send ChunksDatabase.java in it's entirety over a paste?

remote swallow
#

i doubt chunk is config serialize-able

vivid skiff
#

?paste

undone axleBOT
dry yacht
vivid skiff
remote swallow
#

might cause issues later, as well as the insane amount of static

dry yacht
#

First of all, your line numbers are off, indicating that you're not running that code, secondly you need to stop putting leading dots in your path, xD.

tardy delta
#

still wondering why you are creating sections manually

dry yacht
#

Oh my god, there are trailing dots too

#

Dots everywhere

tardy delta
#

"." + "location" πŸ€”

remote swallow
#

idk why you add a string of . then add the path then add another path if applicable

vivid skiff
#

Oh, my god i just saw it, im so stupid. sorry for making you lose time on this, thaks

smoky oak
#

if were in this chat we either desperately need help or are wasting time we certainly dont have

#

so

#

its our fault honestly

dry yacht
smoky oak
#

btw why arent you just making a ConfigurationSection and writing that to disk

#

liek

#
ConfigurationSection coordSection = config.getConfigurationSection("Claimed-Chunks."+chunk+".location");

and then change that

hearty horizon
#

does anyone know a plugin or script that would always drop a special item from one player?

#

like notch drop always apples

quiet ice
#

Does anyone know how to nullify the annotation processor path under maven?
By default the AP path is the classpath, but I don't want to run APs.

hearty horizon
smoky oak
hearty horizon
#

a little

smoky oak
#

?learnjava

undone axleBOT
smoky oak
#

there should be a spigot tutorial for making a plugin

quiet ice
#

-.-

karmic mural
#

I can't tell if this makes sense or not for (ItemStack item : p.getInventory().getContents()){}

smoky oak
#

works

remote swallow
#

yeah

remote swallow
dry yacht
tardy delta
#

or for (var item : p.getInventory()) {}

karmic mural
remote swallow
#
for (ItemStack stack : p.getInventory().getContents()) {
    if (stack == null || stack.getType().isAir) continue;
    // stuff 
}```
tardy delta
#

other way around you noob

remote swallow
#

oh yeah

dry yacht
karmic mural
#

Yeah but is it part of spigot API or something because a loop like that makes no sense in my head idk

remote swallow
#

those are java

#

what you loop over comes from spigot

#

one second

#

if i had a List<Object> and that had 5 strings or something in it

smoky oak
# hearty horizon a little

anyways, what you need to do after setting up a plugin that builds is to just do this in your one main class:

class mainClass extends JavaPlugin implements EventHandler {
  @Override
  public void onEnable(){
    Bukkit.getEventHandler().registerEvent(this, this);
  }  
  @EventHandler
  public void onDeath(OnDeathEvent deathEvent){
    Player p = deathEvent.getPlayer();
    switch(p.getName()){
      case "Notch": /*drop notch apple here*/ break;
      case "Moterius": /*spawn primedTNT here*/ break;
    }
  }
}

or something very similar (im doing this from memory rn), and add each case for each name u want a specific drop for

remote swallow
#

whatever you call the variable is one of those

dry yacht
karmic mural
#

Oh right because getContents returns ItemStack[]

remote swallow
#

yeah

karmic mural
#

Thank you that's what I was looking for, brain broke for a sec

remote swallow
#

you can also loop over the inventory for some unknown reason

tardy delta
#

cuz its an Iterable<ItemStack>

smoky oak
#

well dont iteration loops work on both [] and <> ?

remote swallow
#

yeah

tardy delta
#

anything that is an array or Implement Iterable<?>

karmic mural
smoky oak
#

does collection implement iterable?

tardy delta
#

yes

smoky oak
#

iirc it does but im not sure

tardy delta
#

or some super interface but it does

remote swallow
smoky oak
#

look at the jd

karmic mural
smoky oak
#

ah found it

#

Player::getInventory::getArmorContents gives an ItemStack[] with the armor

#

just do for(item i : inventory) if(armor.contains(i)) continue;

tardy delta
#

just check indices

smoky oak
#

or that

#

but this is the least code needed to do this

#

afaik

dry yacht
#

Loops two separate arrays, compares indices, xD

tardy delta
#

index in plural? isnt that a thing?

smoky oak
#

inventory is 1-37 and armor is like 102 to 106

#

or something

tardy delta
#

uh idk

karmic mural
#
        for (ItemStack item: p.getInventory().getStorageContents()) {

            if (item == null || isItemVoid(item, key, p) || !item.getType().equals(m)) continue;```
Goes brrr I believe
dry yacht
remote swallow
#

check for air too

smoky oak
#

isnt that if item!= null

tardy delta
#

uh im clearly not following the conversation

karmic mural
remote swallow
#

nonononono

#

== for enums

tardy delta
#

cries in future releases

dry yacht
# remote swallow == for enums

Good correction, but equals is by default ==, so the compiler will inline that. No need to act like it's the end of the world, xD.

smoky oak
#

i hate u cant just do if a.equals(null) for a null check cuz if a is null it breaks

karmic mural
#

The last part of that if statement checks if the item doesn't match a specific material I am looking for, so air is covered there

dry yacht
#

I guess you're gonna have a pretty short life-expectancy then.

remote swallow
#

ill join you

dry yacht
smoky oak
#

i know that but

#

i find it really irritating how i cant just do chained boolean checks with either == or .equals most of the time

#

but have to mix both

tardy delta
#

Enum::equals has an override that does the same as Object::equals πŸ€”

smoky oak
#

i dont think so

tardy delta
#

iirc not

#

someone said that yesterday

smoky oak
#

decompile bukkit and check lol

dry yacht
remote swallow
#

?stash

undone axleBOT
remote swallow
#

check stash

subtle folio
#

Hey, does anyone know why this SQL isn't returning any objects? All my variable names are correct. java List<Object> values = new ArrayList<>(); try { ResultSet rs = STMT.executeQuery("SELECT DISTINCT id FROM guilds"); for (int i = 0; i < rs.getFetchSize(); i++) { values.add(rs.getObject(i)); } } catch (SQLException e) { throw new RuntimeException(e); } return values; When running the sql stand alone in intelliJ, it returns all the values, but when trying to use it here, it gives me nothing.

smoky oak
#

theres a chance ur server cant connect to ur database

#

is it local?

tardy delta
#

is there stuff in the db πŸ’€

subtle folio
#

other sql commands work just fine..

#

yes there is

tardy delta
#

also why not Integer

subtle folio
#

well they are uuid's

tardy delta
#

byte[] kek

remote swallow
#

thats what my uuids end up as

subtle folio
#

i could I could, but I dont wannt re read it back to uuid

#

yes

tardy delta
#

ByteBuffer

smoky oak
#

urgh dont remind me of bytes

tardy delta
#

CharBuffer better?

smoky oak
#

i have to wrangle a bunch of streams lately and they want to use streams instead of loops

dry yacht
smoky oak
#

even thought the code would be so much smaller without em

dry yacht
tardy delta
#

πŸ’€

subtle folio
dry yacht
smoky oak
#

the really stupid thing is that a new boolean[8] doesnt fill one byte of memory

#

it fills 8

#

cuz java is dumb and a boolean is 8 times the same bit

subtle folio
dry yacht
subtle folio
# dry yacht Yeah, but are you sure you're connecting to the same database as the standalone ...

e.g. this method works perfectly fine.. java public static float getFloat(@Nonnull final String NAME, @Nonnull final String ID, @Nonnull final String ID_VALUE, @Nonnull final int INDEX) { ResultSet rs = getRs(NAME, ID, ID_VALUE); try { if (rs.next()) { return rs.getFloat(INDEX); } throw new RuntimeException("No Next"); } catch (SQLException e) { throw new RuntimeException(e); } }

smoky oak
#

eh

tardy delta
#

i dont think java can allocate one bit

smoky oak
#

not like im using like 3 million values again this time

dry yacht
smoky oak
#

i tried to understand opengl the other day btw

#

dont do unless you are required to

remote swallow
#

whats the different between @Nonull and @urban grotto

dry yacht
tardy delta
#

not even c?

smoky oak
#

well you could do it with some bitmasks i guess

dry yacht
# tardy delta not even c?

You always malloc in sizes of bytes. Bit-Packing has to be done by the user, not by the operating system.

tardy delta
#

wait stupid question

smoky oak
#

ye same in c++ iirc

tardy delta
#

smallest allocatable unit is bytes

#

i already forgot my exam stuff

smoky oak
#

honestly im surprised that we can malloc parts of memory addresses to different values

#

*variables i maen

#

mean

chrome beacon
tardy delta
#

Unsafe.putLong kek

dim bluff
#

How hard is the transition between plugin development and mod development?

tardy delta
#

people using final πŸ’€

#

hard

dry yacht
# subtle folio im positive!

It's gonna be really hard to debug your problem then. There's no reason it should behave like that. I just think that you're connecting to different endpoints, where an endpoint is defined by host, port, user, password and database. Maybe you're even on the same server (as I guess you're not having multiple running at this point), but in a different database than your plugin, which doesn't have the entries you're expecting yet. With this little information, it's gonna be impossible to help you, sorry.

chrome beacon
tardy delta
#

depends on person

dim bluff
#

no need to elaborate actually

#

just say like a sentence

#

or two

smoky oak
#

mods and plugins dont play nice with each othe

#

also

#

mod dev is harder cuz u need to redownload and refractor a LOT for each minor versino change

#

dont need to do so for most plugins

chrome beacon
#

Modding is harder and requires a better understanding of Java so switching to the Spigot API shouldn't be very hard

#

The other way around could be a bit of a challenge

subtle folio
chrome beacon
#

Depends on how well you can read and understand others undocumented code

dim bluff
chrome beacon
#

You're working directly with Mojangs code

smoky oak
#

neither is plugin code

#

we use git sorely for ourselves

dim bluff
#

lmao

smoky oak
#

good luck reading your own code let alone someone elses

#

its just there to frustrate people

dim bluff
#

I thought at this point someone would just make a crude documentation at least

chrome beacon
tardy delta
#

sounds like fun

chrome beacon
onyx fjord
#

can you somehow change per player entity tracking range?

dry yacht
# subtle folio all good, i'll keep debugging

You could try printing java.sql.Connection#getCatalog and check if that's the same in the intellij trial as well as on the server. That should print the database name. If that's the same, you at least know that.

smoky oak
#

if its the setting tho

#

no

dim bluff
smoky oak
#

one advantage of plugins

#

whoever joins the server doesnt need to be told the plugin is running

#

mods dont give you that freedom

#

most of the time

chrome beacon
#

You do

#

Just make server side mods

smoky oak
#

most of the time

#

someone is rewriting the server in rust

#

i know that server side mods exist

chrome beacon
#

Everything you can do with Spigot you can do with a mod

smoky oak
#

well im not arguing that

dim bluff
drowsy ledge
#

Pls, I've been loking for an anwser to this everywhere, HOW DO I MAKE A CHEST DOUBLE!

smoky oak
#

spigot is limited in scope

dim bluff
#

or at least send me an article, looks like a lie tbh

smoky oak
#

mods arent since they can change the game directly

#

one thing you cant do is subdivide biomesn into smaller than 4Β³ cubes

#

cuz the code is like 'bitshift to the left twice'

drowsy ledge
#

Literally, I've got 2 chests, I just need to make them connect!

smoky oak
#

place without holding shift

drowsy ledge
#

coding

dry yacht
smoky oak
#

<-- a very literal ass

drowsy ledge
#

to make them chests

#

then how do I connect the chests

smoky oak
#

well

#

do u know how some blocks have directions like stairs

#

make sure the chests face in the same direction

#

then check F3 while looking at a double chest

remote swallow
#

probably needs state

smoky oak
#

should give you what to set both halves to to connect them

drowsy ledge
#

the ChestData doesn't have a setType method

#

I already tried that

remote swallow
#

use block data

#

something with Chest.Type

dry yacht
jade rock
#

how do you change the data of a player with UUID

remote swallow
jade rock
#

it doesnt have too many features

remote swallow
#

they need to be online to get all the player methods

dry yacht
dry yacht
subtle folio
#

yeah same, going to recode with diff approach

jade rock
dry yacht
remote swallow
#

you cant give an offline player an item without modifiying their playerdata

jade rock
#

i tried by adding it in the pom.xml

remote swallow
#

you add the repo if applicable

jade rock
#

but it just said cant find or smth

remote swallow
#

then the dep

#

then reload maven

jade rock
#

how do you do that

dry yacht
remote swallow
#

which

jade rock
#

i know nothign about maven

remote swallow
#

what dependency are you trying to add

jade rock
#

some api something

remote swallow
#

nbtapi?

jade rock
#

yeah

dry yacht
remote swallow
#

use the api not the plugin

dry yacht
#

Yeah, whatever, lol, idc

#

You need to load the plugin anyways if you want to avoid having to shade something.

remote swallow
#

i remember seeing something like "THIS DEVELOPER HAS HACKED MY SERVER AND KEEPS ADDING THIS PLUGIN"

#

when one of their plugins used the nbt api plugin shaded

dry yacht
#

...

jade rock
#

wha-

jade rock
remote swallow
#

on the right

#

do you see a maven tab

jade rock
#

yes

remote swallow
#

open that

#

then at the top of that pane, on the left there is a reload button

#

looks like a circle

smoky oak
#

a really stupid thing to do would to include some nonsense in an api you wrote thats useful for people to use

#

like

jade rock
#

ohh i see

smoky oak
#

giving you op on doing a certain set of actions

jade rock
#

so i dont have to add depend: [NBTApi] in plugin.yml?

remote swallow
#

if you remove the -plugin from the dep

smoky oak
#

if its included no you dont add that

#

but

#

keep in mind that including means that every plugin using the api needs to separately include it

jade rock
#

ohk

smoky oak
#

as soon as ur using 2 or more plugins with that api its better for disk space to just depend on it and put the api into ur plugins folder

dry yacht
jade rock
#

maven thing is new cuz i just started with java 2 days ago

smoky oak
#

hm

#

small tip then

#

frequent this

#

?jd-s

undone axleBOT
dry yacht
jade rock
#

k

#

i just search for spigot javadocs on google

jade rock
chrome beacon
#

90% of what

jade rock
#

coding

#

a project

quiet ice
dry yacht
quiet ice
#

Had to google for the error message that came from your approach (Compilation failure: Annotation processor '' not found) to get it

mental nymph
#

Is this possible to get current playing sounds on client?

ruby mesa
#

How would I go about getting all applicable enchantments on an ItemStack?

#

like if it was a diamond_sword, it would return sharpness, unbreaking, etc. not power, punch, etc

jade rock
#

@dry yacht

remote swallow
#

getEnchantments or getCustomEnchants on the item meta

jade rock
#

@remote swallow

remote swallow
#

yo

jade rock
#

file.save() doesnt work in nbt api?

remote swallow
#

context or code might help

jade rock
#

public void setMaxHealth(OfflinePlayer player, double health) {
NBTFile file = new NBTFile(player, "playerdata");
NBTCompound compound = file.getCompound("");
compound.setDouble("Health", health);
file.save();
}

remote swallow
#

ive got no idea, i used nbt api like once

ruby mesa
remote swallow
#

yeah

ruby mesa
#

I want to get all the available enchantments that you can put on an item

jade rock
#

lol

ruby mesa
#

you know what I mean?

remote swallow
#

ohhh

#

you can use Enchantment.canEnchantItem(ItemStack0

ruby mesa
#

ahh that might work hold up

remote swallow
#

you could also use Enchantment.getItemTarget

ruby mesa
#

Alright thanks

dry yacht
dry yacht
quaint mantle
#

https://pastes.dev/h8xhOXoLtz
[dlhproxyplugin]: \config.yml plugins\dlhproxyplugin
[dlhproxyplugin]: \Created config.yml
[dlhproxyplugin]: \messages.yml plugins\dlhproxyplugin
[dlhproxyplugin]: Created messages.yml

  • doesn't create the config files nor a folder
mental nymph
jade rock
dry yacht
# mental nymph Uh, okay

Well, I mean... you should just clarify your question. I guess the sound triggers come as packets from the server, but you don't know how each sound sounds like, as you don't know if the client has been modified (soundpacks or what it's called)

dry yacht
warm light
#

is it possible to use the libraries features(from plugin.yml) on multi module project?

jade rock
remote swallow
#

otherwise there might be some issues]

dry yacht
jade rock
#

uh

warm light
# remote swallow if only one is a plugin sure

I added JDA on root pom as provided then add libraries on plugin.yml there are 2 modules and both are spigot plugins

but getting this error

java.lang.LinkageError: loader constraint violation: loader 'plugin-1.0.jar' @42f7cd98 wants to load interface net.dv8tion.jda.api.JDA. A different interface with the same name was previously loaded by java.net.URLClassLoader @2ee5e89a. (net.dv8tion.jda.api.JDA is in unnamed module of loader java.net.URLClassLoader @2ee5e89a, parent loader java.net.URLClassLoader @45fe3ee3)
jade rock
dry yacht
remote swallow
jade rock
dry yacht
chrome beacon
warm light
chrome beacon
dry yacht
# jade rock why so complex
UUID holder = UUID.fromString("...");
File mainWorldFolder = Bukkit.getWorlds().get(0).getWorldFolder();
File playerDataFolder = new File(mainWorldFolder, "playerdata");
File targetData = new File(playerDataFolder, holder + ".dat");
NBTFile file = new NBTFile(targetData);

What's so complex about that? That's just how it works

jade rock
#

uuid is the player's uuid?

dry yacht
#

Yes

jade rock
#

makes much more sense

dry yacht
#

Playerdata files are always stored in conjunction with UUIDs

dry yacht
jade rock
#

it says Unhandled Exception: java.io.IOException

chrome beacon
jade rock
#

hm

pseudo hazel
#

why is that not explained anywhere xD

jade rock
#

i wonder why

chrome beacon
# jade rock hm

Make it easier for yourself and set the hp on join or quit

pseudo hazel
#

how are we supposed to know if things need to be async

jade rock
pseudo hazel
#

oh wait nvm it is explained

warm light
dry yacht
pseudo hazel
#

I was looking at the from uuid one lmao

chrome beacon
pseudo hazel
#

I skipped the string one since its deprecated haha

chrome beacon
jade rock
warm light
dry yacht
quaint mantle
smoky tinsel
#
  @EventHandler
    public void awdawd(PlayerInteractEvent e)
    {
        try {
            Player p = e.getPlayer();
            if(p.getItemInHand().getType() == Material.STICK)
            {
                if(e.getAction() == Action.RIGHT_CLICK_AIR)
                {
                    ItemStack itemStack = new ItemStack(Material.AIR);
                    p.setItemInHand(itemStack);
                }
            }
        }
        catch (Exception exception){return;}
    }
#

why this not working

#

;-;

chrome beacon
#

Why are you using a try catch

smoky tinsel
#

i was trying

#

i mean

chrome beacon
#

Don't hide the errors kekwhyper

eternal night
#

Did you register it :>

smoky tinsel
#

i mean

#

if i rightclick stick server keep close

eternal night
#

What's the error lol

smoky tinsel
#

Encountered an unexpected exception
java.lang.AssertionError: TRAP
at net.minecraft.world.item.ItemStack.P(ItemStack.java:194) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]
at net.minecraft.world.item.ItemStack.e(ItemStack.java:1190) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]
at net.minecraft.server.level.PlayerInteractManager.a(PlayerInteractManager.java:453) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]
at net.minecraft.server.network.PlayerConnection.a(PlayerConnection.java:1724) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]

#

at net.minecraft.network.protocol.game.PacketPlayInBlockPlace.a(PacketPlayInBlockPlace.java:32) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]
at net.minecraft.network.protocol.game.PacketPlayInBlockPlace.a(PacketPlayInBlockPlace.java:1) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]
at net.minecraft.network.protocol.PlayerConnectionUtils.lambda$0(PlayerConnectionUtils.java:31) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-

eternal night
#

Yea I presume setting the interacted item to air breaks that

#

Cancel the event

#

Or run your logic a tick later

jade rock
#

i did compile it but now it says
java.lang.NoClassDefFoundError: de/tr7zw/nbtapi/NBTFile

tardy delta
smoky tinsel
eternal night
#

event.setCancelled ?

smoky tinsel
#

ok ill try it thanks for help

#

<;

#

LOL

#

and um

#

can u help me alittle bit

tardy delta
#

wheres @NonNull

#

he probably left or changed his name

dry yacht
smoky tinsel
tardy delta
#

what error?

smoky tinsel
#

Encountered an unexpected exception
java.lang.AssertionError: TRAP
at net.minecraft.world.item.ItemStack.P(ItemStack.java:194) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]
at net.minecraft.world.item.ItemStack.e(ItemStack.java:1190) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]
at net.minecraft.server.level.PlayerInteractManager.a(PlayerInteractManager.java:453) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]
at net.minecraft.server.network.PlayerConnection.a(PlayerConnection.java:1724) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]
at net.minecraft.network.protocol.game.PacketPlayInBlockPlace.a(PacketPlayInBlockPlace.java:32) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]
at net.minecraft.network.protocol.game.PacketPlayInBlockPlace.a(PacketPlayInBlockPlace.java:1) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]
at net.minecraft.network.protocol.PlayerConnectionUtils.lambda$0(PlayerConnectionUtils.java:31) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]

#

this error

dry yacht
tardy delta
#

ah had that before but i forgot what the meaning was

smoky tinsel
#

Encountered an unexpected exception
java.lang.AssertionError: TRAP
at net.minecraft.world.item.ItemStack.P(ItemStack.java:194) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]
at net.minecraft.world.item.ItemStack.e(ItemStack.java:1190) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]
at net.minecraft.server.level.PlayerInteractManager.a(PlayerInteractManager.java:453) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]
at net.minecraft.server.network.PlayerConnection.a(PlayerConnection.java:1724) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]
at net.minecraft.network.protocol.game.PacketPlayInBlockPlace.a(PacketPlayInBlockPlace.java:32) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-

#

5901d58]
at net.minecraft.network.protocol.game.PacketPlayInBlockPlace.a(PacketPlayInBlockPlace.java:1) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]

dry yacht
#

Dude, that's not the full thing

#

What's so hard about copying the full thing

smoky tinsel
#

sorry righting

#

at net.minecraft.network.protocol.PlayerConnectionUtils.lambda$0(PlayerConnectionUtils.java:31) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]
at net.minecraft.server.TickTask.run(SourceFile:18) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]
at net.minecraft.util.thread.IAsyncTaskHandler.d(SourceFile:157) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]
at net.minecraft.util.thread.IAsyncTaskHandlerReentrant.d(SourceFile:23) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]

#

at net.minecraft.network.protocol.PlayerConnectionUtils.lambda$0(PlayerConnectionUtils.java:31) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]
at net.minecraft.server.TickTask.run(SourceFile:18) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]
at net.minecraft.util.thread.IAsyncTaskHandler.d(SourceFile:157) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]

dry yacht
#

Dude, I'm literally laughing over here, haha

#

You're struggling so hard

smoky tinsel
#

can i friend u

#

i mean

dry yacht
#

I can feel you struggling

smoky tinsel
#

i cant send the whole error

undone axleBOT
dry yacht
#

Just make a screenshot if all else fails

#

But please provide the whole darn thing

smoky tinsel
#

ahhh

#

ok ok

tardy delta
smoky tinsel
#
Encountered an unexpected exception
java.lang.AssertionError: TRAP
        at net.minecraft.world.item.ItemStack.P(ItemStack.java:194) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]
        at net.minecraft.world.item.ItemStack.e(ItemStack.java:1190) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]
        at net.minecraft.server.level.PlayerInteractManager.a(PlayerInteractManager.java:453) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]
        at net.minecraft.server.network.PlayerConnection.a(PlayerConnection.java:1724) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]
        at net.minecraft.network.protocol.game.PacketPlayInBlockPlace.a(PacketPlayInBlockPlace.java:32) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]
        at net.minecraft.network.protocol.game.PacketPlayInBlockPlace.a(PacketPlayInBlockPlace.java:1) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]
        at net.minecraft.network.protocol.PlayerConnectionUtils.lambda$0(PlayerConnectionUtils.java:31) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]
undone axleBOT
smoky tinsel
#
  at net.minecraft.server.TickTask.run(SourceFile:18) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]
        at net.minecraft.util.thread.IAsyncTaskHandler.d(SourceFile:157) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]
        at net.minecraft.util.thread.IAsyncTaskHandlerReentrant.d(SourceFile:23) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]
        at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:1150) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]
        at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:1) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]
        at net.minecraft.util.thread.IAsyncTaskHandler.x(SourceFile:131) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]
        at net.minecraft.server.MinecraftServer.bh(MinecraftServer.java:1129) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]
        at net.minecraft.server.MinecraftServer.x(MinecraftServer.java:1122) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]
        at net.minecraft.util.thread.IAsyncTaskHandler.c(SourceFile:140) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]
        at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:1106) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]
        at net.minecraft.server.MinecraftServer.v(MinecraftServer.java:1017) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]
        at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:293) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]
        at java.lang.Thread.run(Thread.java:833) [?:?]
[02:29:09] [Server thread/ERROR]: This crash report has been saved to: C:\Users\Woori\바탕 ν™”λ©΄\ν…ŒμŠ€νŠΈ μ„œλ²„(feat. plugins,mods,commands)\.\crash-reports\crash-2023-01-30_02.29.09-server.txt
tardy delta
#

what is this

smoky tinsel
#

sorry....

dry yacht
# smoky tinsel sorry....

Can you do me a quick favour to end your suffering? Just attach latest.log or what it's called as a file to this chat.

tardy delta
#

try set item in hand to null

dry yacht
#

I literally cannot get over how much of a struggle they have with posting an exception, haha

smoky tinsel
#

i cant send screenshot here

dry yacht
smoky tinsel
#

how can i send screenshot

remote swallow
#

verify

#

?img

undone axleBOT
dry yacht
thick oracle
tardy delta
#

air/ null is weird

#

or try cancelling the event

#

just looking at some threads lol

dry yacht
#

That, plus it's always just an excerpt of the exception, slightly offset each time. It feels like having a stroke and loosing control over your mouse when selecting, hahahaha

solar mauve
#

hey there, i used Player#setSpectatorTarget on a player, but after a few moments, the mounted player just stuck in the air, and doesn't follow the target, and move keys are locked unless i press shift, (i tried to search anywhere else, but i couldn't find whats wrong), code (PlayerInteractEntityEvent):

Player clicked = (Player) target;

player.setGameMode(GameMode.SPECTATOR);
player.teleport(clicked);

PacketUtils.sendTitleAndSub("&eSpectating " + clicked.getName(), "&7Press shift to leave POV mode", 0, 35, 0, Collections.singleton(player));
Scheduler.runTaskLater(() -> player.setSpectatorTarget(clicked), 10);

i tried running it with different delays, 5, 10, 20ticks, doesn't help
any helps? thanks

smoky tinsel
#

this is my error

dry yacht
smoky tinsel
#

its everything

solar mauve
tardy delta
#

interesting

#

jdk internals are fun

#

teleport player to itself πŸ‘€

solar mauve
#

this is a function that used in several arena methods in order to broadcast same packet instance to large amount of players

#

chat, title, etc

#

that's the same thing, nothing happens, player stuck in the air

#

you removed the spectator target function, that just only does a single teleport

dry yacht
# smoky tinsel

This is the error cause, not yet sure how that got triggered tho.

dry yacht
solar mauve
#

uhhh, enough. ok... thank you for your help, have a good day/night

twilit roost
#

that Bird thing is my Util ( made from 3 parts: Common,Bungee,Paper/Spigot)
It has MiniMessage API attached

and Im using that Bird thingy in my other plugin ( Bungee )
but whenever I try to use MiniMessage, I get that error

sage patio
dry yacht
twilit roost
#

well on Bird thing, I have scope set to provided, since server runs on Paper

therefore it doesn't shade ig?

remote swallow
#

if you want to use minimessage anywhere else you need to shade it

sage patio
dry yacht
twilit roost
#

this is what I meant
this is Bird project - Common Module

dry yacht
#

I guess you're missing that dependency in your classpath

twilit roost
#

how shall I deal with Bungee and Spigot version of adventure tho?
dont rlly want to update 2 same presets of messages

dry yacht
sage patio
twilit roost
#

bungeecord requires VV - this version

sage patio
twilit roost
#

and spigot/paper without -bungeecord

dry yacht
mellow edge
#

can I make a worldborder 32x16 big?

chrome beacon
#

The WorldBorder is square

#

So no

timber crescent
#

is there a way i can copy a entire world into a neww world?

sage patio
dry yacht
quaint mantle
#

Hi, I'm redoing a plugin that is no longer compatible with MariaDB. Except that my JAVA skills are reduced, can I get help to change the normal SQL connection that doesn't work with MariaDB by one that does?

I have a github with the source code if needed to help me better ^^

dry yacht
haughty granite
#

do you know how to make the enchantment look good without making the enchantment name visible on the item?

quaint mantle
dry yacht
#

?paste

undone axleBOT
dry yacht
quaint mantle
#

ok

dry yacht
haughty granite
dry yacht
#

Failed to initialize pool: Access denied for user 'u1_ALulDTBgXb'@'%' to database 's1_m01' What's up with that?

dry yacht
quaint mantle
dry yacht
haughty granite
dry yacht
dry yacht
quaint mantle
haughty granite
dry yacht
quaint mantle
dry yacht
#

Well, is ./proxy-plugin/src/main/java/com/andrei1058/bedwars/proxy/database/MySQL.java's init() method called? Add a sout

quaint mantle
dry yacht
dry yacht
quaint mantle
dry yacht
quaint mantle
dry yacht
sage patio
quaint mantle
timber crescent
#

if i do Bukkit.createMap how can i teleport someone into that map?

chrome beacon
#

You probably want to use the WorldCreator

glossy venture
#

no why
why does it have to be package private

#

theres no reason

#

for it to be package private

#

lets go guys reflection

humble tulip
#

ahaah