#help-development

1 messages ยท Page 501 of 1

icy beacon
#

if there are more than 4 indent levels you are doing something wrong

#

i saw 6 at one point

weak meteor
#

look ther'es the code

eternal oxide
#

odd whitespace

#

I'm not sure an IDE will ignore that blank line

#

I guess it might

#

add a sysout at the start of the run to see if your code is even being called

#

you can also use java if (helmet == null || chestplate == null || leggings == null || boots == null) continue;

#

instead of the first nesting

echo basalt
#

oh god

#

player name, comparing enums with equals

#

overall nesting

#

grr

slim wigeon
#

Songoda is going to get on my nerves, I cannot purchase any of their plugins due to a account on Paypal is required. I had a account but that got suspended due to my VPN. Just wanted fake players

eternal oxide
#

add a continue; and you can remove the whole else { on the next line

weak meteor
#

k

small current
#

i coded a plugin ages ago, and i dont remember the code, what was the event that stops moving of gravel and sand?

eternal oxide
#

no

#

you didn;t add any continue

weak meteor
daring maple
eternal oxide
#

no

daring maple
#
        if (helmet == null || chestplate == null || leggings == null || boots == null) {
                if (Nao.activeKits.containsKey(player.getName())){
                    Nao.activeKits.remove(player.getName());
                }
                continue; //Should be right here
            }```
slim wigeon
eternal oxide
#

you shoudl also auto format yrou code so it fixes your indents

weak meteor
small current
#

sand falling

eternal oxide
#

if eclipse CTRL+A then CTRL+SHIFT+F

small current
#

they are related to item frames

#

and stuff like that

weak meteor
eternal oxide
#

no clue on IJ

weak meteor
#

ctrl+f is search lol

daring maple
#

CTRL+ALT+L is intelliJ

eternal oxide
#

I'd probably use a switch in yrou code instead of all the ifs

#

add sysout at teh start and make sure yoru code is being called

weak meteor
#

It is being called

eternal oxide
#

one sec

austere gazelle
daring maple
# austere gazelle

This seems like something that should belong in a MutliWorld support channel, not this spigot development channel

cinder abyss
#

Hello, how can I cancel a block sound ?

daring maple
blissful wagon
#

there is any way to spawn a itemstack particle ? like carrot particle when you eat it

daring maple
#

?google

undone axleBOT
daring maple
#

But yeah you can spawn particles

blissful wagon
#

I googled before asking and couldn't find an answer

#

i tried to provide item stack as particle type but nope

or

  BlockLocation[0].getWorld().spawnParticle(((Particle) ItemModel), BlockLocation[0], 12);
vivid skiff
#

Is possible to regenerate the gradle wrapper?

eternal oxide
ivory sleet
#

so ye

vivid skiff
eternal night
#

paste the full stacktrace ๐Ÿ‘

#

beyond that, are you talking about the wrapper or the cli

#

two different things

#

the wrapper can be generated from your cli using gradle wrapper

#

where as you'd call the wrapper with gradlew or ./gradlew

glass mauve
#

I have some question about deploying spigot plugins:

1. How to correctly organize github branches? master = newest mc version, and then branches for all the other versions?
2. How to get attention for a Plugin library for other devs?
3. Any additional information I need to know before publishing a plugin?
long sable
#

hi, does anyone know how to get the actual dimensions of a textDisplay (both getDisplayWidth/Height() and getWidth/Height() return 0)?
Also - not sure what unit getLineWidth() is given in (default is 200) - pixels, perhaps? If so, how can I get the pixel width of any given text?

slim wigeon
#

How do I get blocks that can only be mined using a diamond pickaxe for a example?

chrome beacon
glass mauve
#

ok thanks :D

wet breach
chrome beacon
#

It would be a pain to maintain

#

but ofc you can

wet breach
eternal night
#

git submodules party

chrome beacon
#

I forgot you could do that

glass mauve
#

but I def need to have multiple jars if I use ProtocolLib? or does it automatically switch versions?

wet breach
chrome forge
#

Hi! I have plugin with some dependencies and I'm using shading for them. But with shading compilation time is much longer, is it possible to remove shading from first plugin, make second plugin, build it with shading and load into server, so it will be possible to access these dependencies in my first plugin?

chrome beacon
#

If you're on a modern version (1.17.1+) and the libraries are on maven central you can use the libraries feature in the plugin.yml

delicate lynx
#

beat me to it

chrome beacon
#

anyways yes you can make a second jar containing your shaded and relocated dependencies

vivid hill
#

Hey there so I implemented the lombok project and its erroring

'dependencies.dependency.version' for org.projectlombok:lombok:jar is either LATEST or RELEASE (both of them are being deprecated) @ line 101, column 22
'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: org.projectlombok:lombok:jar -> version RELEASE vs 1.18.26 @ line 104, column 21
It is highly recommended to fix these problems because they threaten the stability of your build.
#
 <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>RELEASE</version>
            <scope>compile</scope>
        </dependency>
eternal night
#

RELEASE is a placeholder they have for the actual version in the lombok docs

vivid hill
#

when I do that it errors too


It is highly recommended to fix these problems because they threaten the stability of your build.
For this reason, future Maven versions might no longer support building such malformed projects.
#

or can I ignore that

chrome beacon
#

malformed projects.

eternal night
#

I mean, throw us the entire pom.xml

#

after specifying the version

#

?paste

undone axleBOT
vivid hill
eternal night
#

I mean

#

you cannot define the dependency twice

#

which is what you are doing ๐Ÿ˜…

vivid hill
#

oh lol, didnt saw that haha

modern gust
#

anyone knows how to do this without scoreboards?

icy beacon
#

why not use scoreboards?

modern gust
#

the heart thing

icy beacon
#

i guess you could bind an armorstand or use packets

#

but why

modern gust
#

because I wanna show multiple lines, for example a bounty and the health

icy beacon
#

ah

icy beacon
#

packets would be harder, armorstands would be wankier

#

but yeah please wait for a second opinion from somebody

#

maybe i'm overlooking something

modern gust
#

ty anyways

icy beacon
#

anytime

timber mural
#

Where can i find Spigot 1.19.2 source code?

timber mural
#

as i said in spigot folder

#

there's nothing

chrome beacon
#

In the link you sent choose one of the projects to see the source code of

#

Spigot, Bukkit or Craftbukkit

timber mural
#

yeah what do i choose

chrome beacon
#

Depends on what you want to see

timber mural
#

i have no idea

#

my current server has spigot-1.19.2.jar

#

i want a source code so i can change it

remote swallow
#

what do you want to change about it

chrome beacon
#

So you want to fork Spigot?

#

?contribute

chrome beacon
#

You can skip the CLA since you're forking and not contributing

vivid hill
#

Hey um I am now getting this error

gencore-1.0-SNAPSHOT.jar, lombok-1.18.26.jar define 1 overlapping resource: 
  - META-INF/MANIFEST.MF
maven-shade-plugin has detected that some class files are
present in two or more JARs. When this happens, only one
single version of the class is copied to the uber jar.
Usually this is not harmful and you can skip these warnings,
otherwise try to manually exclude artifacts based on
mvn dependency:tree -Ddetail=true and the above output.
See http://maven.apache.org/plugins/maven-shade-plugin/
#

when trying to compile my jar file

weak meteor
eternal oxide
#

Kit?

weak meteor
#
public abstract class Kit {

    public abstract String getName();

    public abstract Integer getWarmup();

    public abstract Collection<PotionEffect> getEffects();

    public abstract List<Material> getConsubmables();

    public abstract Kits getKit();

    public void addEffects(Player player) throws InterruptedException {
        Collection<PotionEffect> active = player.getActivePotionEffects();

        // remove effects
        for (PotionEffect effect : active){
            player.removePotionEffect(effect.getType());
        }

        Thread.sleep(getWarmup()*1000);

        // add effects
        player.addPotionEffects(getEffects());
    }
}```
remote swallow
#

Thread.sleep(getWarmup()*1000);

weak meteor
#

what w that

remote swallow
#

wouldnt recommened that

worn tundra
#

Aint no way

eternal oxide
#

?paste

eternal oxide
#

I'd nto put the kits Sets in the runnable though

#

Much cleaner. To add new Kits you just create a new Set and add one line to your switch

timber mural
eternal oxide
#

yeah well, not in an IDE

short monolith
#

Hello, can someone help me, I am writing a plugin to check for that night now or not, if yes, then check for randomness and if the chance is true to spawn mobs with the necessary parameters near the players, who can tell me how to do this and preferably in a separate java class, otherwise I was able to check for the night only in the main class.

        World seWorld = Bukkit.getWorld("world");
        BukkitScheduler scheduler = getServer().getScheduler();
        scheduler.scheduleSyncRepeatingTask(this, new Runnable()
        {
            boolean day = false;

            @Override
            public void run()
            {
                if(seWorld.getTime() < 13000 && !day)
                {
                    day = true;
                }
                else if (seWorld.getTime() >= 13000 && day)
                {
                    day = false;
                    Bukkit.broadcastMessage("Night");
                    getServer().dispatchCommand(getServer().getConsoleSender(),"summon minecraft:allay -22 98 39");
                }
            }
        }, 0L, 20L);
eternal oxide
#

sec, it doesn;t return, its void

#

Thats a generics definition limiting what can be passed in teh arg

#

I do too, often ๐Ÿ™‚

#

Should enable polymorphism beyond type erasure

#

I look at it as another modifier like static or final, but I agree it shoudl really be after teh return type

rose trail
#

Please help, I have 2 servers, on one of them bedwars and on the other a plugin that should show the available arenas from the second server in real time? How to implement it?

eternal oxide
#

?pmc

hexed tendon
#

also, please don't clown on me. This isn't my code, as i am forking an existing project

#

what do i need to change?

#

the documentation on this plugin is non-existent

#

almost

eternal oxide
#

what is your networkmanager?

hexed tendon
#

networkmanager?

#

i have no clue

#

if you tell me how to access it i can tell you

eternal oxide
#

I assume you are attempting to override the send method to prevent yoru server crashign with NPCs

hexed tendon
#

yes

eternal oxide
#

do you have a public class NetworkManager extends Connection

hexed tendon
#

here are the errors

#

package de.firecreeper82.lotm.util;

import net.minecraft.network.Connection;
import net.minecraft.network.protocol.PacketFlow;

public class TutNetworkManager extends Connection {
public TutNetworkManager(PacketFlow enumprotocoldirection) {
super(enumprotocoldirection);
}
}

#

i have this

eternal oxide
#

yes

#

then in your NPC class constructor shoudl be something like...```java
Npc(MinecraftServer minecraftServer, ServerLevel worldServer, GameProfile gameProfile, ProfilePublicKey publicKey) {

    super(minecraftServer, worldServer, gameProfile, publicKey);

    this.connection = new NetworkHandler(minecraftServer, new NetworkManager(PacketFlow.CLIENTBOUND), this);
}```
hexed tendon
#

yes

#

public static ServerPlayer create(Location location, String name, String[] skin, boolean hideFromTab) {
UUID uuid = UUID.randomUUID();
MinecraftServer nmsServer = ((CraftServer) Bukkit.getServer()).getServer();
ServerLevel nmsWorld = ((CraftWorld) Objects.requireNonNull(location.getWorld())).getHandle();
GameProfile profile = new GameProfile(uuid, name);

    NPC npc = new NPC(nmsServer, nmsWorld, profile);
    npc.connection = new TutNetHandler(nmsServer, new TutNetworkManager(PacketFlow.CLIENTBOUND), npc);

    setSkin(npc, skin);
    setPosRot(npc, location);
    npc.getBukkitEntity().setNoDamageTicks(0);
    npc.getBukkitEntity().setHealth(1f);
    Bukkit.getOnlinePlayers().forEach(player -> ((CraftPlayer) player).getHandle().connection.send(new ClientboundPlayerInfoPacket(ClientboundPlayerInfoPacket.Action.ADD_PLAYER, npc)));
    nmsWorld.addNewPlayer(npc);

    Plugin.fakePlayers.put(uuid, npc);

    NPC.showAll(npc, location, hideFromTab);
    return npc;
}
eternal oxide
#

this may be a little old 1.19.1 probably

hexed tendon
#

i really should ask firecreeper82 to update the libs and the plugin

#

anyway

#

do you have any fixes?

#

it doesn't matter how it is done

eternal oxide
#

your code looks fine to me

#

what version are you building against?

hexed tendon
#

1.19.2

eternal oxide
#

um, same here

hexed tendon
#

R0.1 snapshot

#

i sent my pom.xml if you want to check my dependencies

eternal oxide
#

well your TutNetHandler is just fine. nothign wrong with it

hexed tendon
#

its herre

#

it says that its clashing against something

eternal oxide
#

increase teh version of yoru maven-compiler-plugin

#

3.8.1 is quite old

#

current is 3.11.0

hexed tendon
#

i changed my pomxml

#

how do i update?

fluid river
#

mvn update

#

for IJ Idea there is a blue m button

#

with options

#

for eclipse right click on project -> maven -> update

eternal oxide
#

other than that your pom looks ok

rose trail
#

Is there a way to send messages to the plugin if there are no players on the server, and are there any alternatives?

eternal oxide
#

sockets

remote swallow
#

or redis

eternal oxide
#

or sql

rotund ravine
#

Or any connection

rose trail
#

will spring cloud work? it seems to me that sockets will be more difficult to learn?

eternal oxide
#

sockets are really simple

rotund ravine
modern gust
#

is there any api that supports 1.8.8 to do this?

rotund ravine
#

Probably some of those hologram apis or nametag apis

hexed tendon
#

it didn't change anything

#

i updated and reloaded

remote swallow
#

update shade plugin to 3.4.1

rose trail
rotund ravine
#

I mean the bungee api can do it so youโ€™d just need to contact that.

hexed tendon
#

to which version do i need to switch?

#

oh

#

i'm a clown

eternal oxide
#

once your pom is upto date, if the errors are not gone I'd do a clean run of buildtools --remapped

#

I have near identical code which was probably the base for that lib, and it runs fine

hexed tendon
#

i think i need to change the thing at the op

#

top*

#

updated pom.xml

eternal oxide
#

add a filter to yrou shade plugin

#
                    <filters>
                        <filter>
                            <artifact>com.lmax:disruptor</artifact>
                            <excludes>
                                <exclude>META-INF/MANIFEST.MF</exclude>
                            </excludes>
                        </filter>
                    </filters>```
#

for whatever artifacts you are using

hexed tendon
#

bruh

#

the owner of the plugin dmed

#

me

#

he ssaid

#

"im gonna look into citizens tomorrrow

#

...

#

malding

#

oh well

#

it's gonna be a time saver

#

thanks for trying to help me

timber mural
#

where can i get spigot server 1.19.2 source code?

hexed tendon
#

run buildtools.jarrr

eternal oxide
#

buildtools work folder after runnign with --generate-sources

hexed tendon
#

btw where do i add the filter?

eternal oxide
#

in yoru shade plugin

#

section

hexed tendon
#

if yes, it was already like that

eternal oxide
#

in configuration section

wary topaz
#

private static final String[] SERVER_ORDER = {"lobby1", "lobby2", "lobby3", "lobby4", "lobby5"};

`static void gotolobby(CommandSender sender) {
ProxiedPlayer p = (ProxiedPlayer) sender;

    for (String serverId : SERVER_ORDER) {
        ServerInfo serverInfo = ProxyServer.getInstance().getServerInfo(serverId);
        if (serverInfo.getPlayers().size() < 20) {
            try {
                p.connect(serverInfo);
            } catch (Exception all) {
                p.sendMessage(new ComponentBuilder(ChatColor.RED + "This server is currently not active!").create());
            }
            break;
        }
    }
}`

BUNGEECOORD PLUGIN

The code above is just the example, I am not actually using this as a static BUT the question is if a server is full/down it doesn't get detected as a exception, how can I do this?

eternal oxide
#

do a ping first

#

see if its alive

wary topaz
#

Does that detect if the server is full to?

eternal oxide
#

no

wary topaz
#

So how can I do that?

eternal oxide
#

?jd-bc

wary topaz
#

Oh server ping, ty!

clear raptor
#

Hello guys! For last 2 days, I am trying to find solution for replacing private method in net.minecraft.world.entity.raid.Raid by plugin. I need to alter spawning of enemies in raid. I was trying to do it by ByteBuddy, but without success...

Does anyone here have any experience with it? Or any other way how to do it differently?

warm mica
#

The best solution would be to find a different way

#

If you really want to modify that method then you might want to look into creating a custom spigot.jar

clear raptor
#

So replacing private method is no-go? Public methods can be replaced? And what about completely replacing the class at runtime?

warm mica
#

You shouldn't mess with bytecode dynamically. If you are able to inherit the original class, replace the method and replace the old references with the new one, then you might want to try that. But that should be done with caution as well

#

I mean, you may also try using ByteBuddy, but I promise that it won't take long for that to break. The deeper you go, the greater the chance that it will break (because i.a. of an update, other parts of NMS/other plugins expecting different behaviors ...)

clear raptor
#

Thats why I wanted to replace just the single method that is searching for spawn point

#

I basically want to have vanilla raid with custom spawning so I can create spawn points and make enemies spawn under roof of arena...

#

Sadly, if I create my own arena plugin with own villagers/enemies spawning, the AI is not the same.

warm mica
#

Alternatively you could listen to the raid spawn event, remove them and respawn them at a different place. I have never done anything with raids, but that solution might do it as well

rapid dome
#

im trying to change the displayname of a player with a string taken from an arg of the command, but when i do it, it give me this error

#

[Async Chat Thread - #3/ERROR]: Chain link failed, continuing to next one java.lang.IllegalStateException: Missing key in ResourceKey[minecraft:root / minecraft:chat_type]: ResourceKey[minecraft:chat_type / minecraft:raw] at net.minecraft.core.IRegistry.e(SourceFile:88) ~[spigot-1.19.3-R0.1-SNAPSHOT.jar:3669-Spigot-454acb7-f150cfb] at net.minecraft.network.chat.ChatMessageType.a(ChatMessageType.java:59) ~[spigot-1.19.3-R0.1-SNAPSHOT.jar:3669-Spigot-454acb7-f150cfb] at net.minecraft.network.chat.ChatMessageType.a(ChatMessageType.java:49) ~[spigot-1.19.3-R0.1-SNAPSHOT.jar:3669-Spigot-454acb7-f150cfb] at net.minecraft.server.network.PlayerConnection.chat(PlayerConnection.java:2119) ~[spigot-1.19.3-R0.1-SNAPSHOT.jar:3669-Spigot-454acb7-f150cfb] at net.minecraft.server.network.PlayerConnection.b(PlayerConnection.java:2187) ~[spigot-1.19.3-R0.1-SNAPSHOT.jar:3669-Spigot-454acb7-f150cfb] at net.minecraft.server.network.PlayerConnection.lambda$17(PlayerConnection.java:1901) ~[spigot-1.19.3-R0.1-SNAPSHOT.jar:3669-Spigot-454acb7-f150cfb] at java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:718) ~[?:?] at java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:482) ~[?:?] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?] at java.lang.Thread.run(Thread.java:833) ~[?:?]

clear raptor
eternal oxide
#

set the raid on the roof, then move them down as they spawn?

clear raptor
#

they spawn only on grass ๐Ÿ˜„

eternal oxide
#

grass roof? ๐Ÿ™‚

#

or a single block

clear raptor
#

noooo ๐Ÿ˜„

warm mica
#

Or teleport them after they spawned

clear raptor
#

I think this is not a proper way...

eternal oxide
#

if it works

clear raptor
#

I have maybe another solution.... Can I create own Entities?

eternal oxide
#

yes

#

with NMS

clear raptor
#

So what if I create CustomVindicator what extends Vindicator and I override the method that for example causes Vindicator to start opening doors to village huts?

#

Because original Vindicator opens doors only if its part of raid

#

And I cannot rly fake a raid without server cancelling it.

eternal oxide
#

you can modify the goals

#

probably easier than replacing methods in teh server

clear raptor
#

Ohh... yea I saw goals on VIllagers..

#

But seems that its called Activity in 1.19

eternal oxide
#

yeah a lot changed in 1.19

clear raptor
#

1.19 introduced Brainsright?

eternal oxide
#

I've not messed with them. Others in here have though

clear raptor
#

Its kinda straight forward... I was looking into them for Villagers today...

#

You basically have Activities defined with priority and conditions when they should start

#

if Vindicators have the same thing I can maybe create fake raid with almost 100% same behavior as original one

#

But without same natural spawning I see... ๐Ÿ˜„ public static boolean isSpawnPositionOk(...) { /* compiled code */ } -_-

#

Thx btw... Will try to alter the Brains of the mobs first before experimenting more with byte buddy or custom spigot builds ๐Ÿ˜„

timber mural
#

uh guys

#

so basically

#

i open buildtools

#

and

#

spigot folder appears

#

and there's no source code

#

only patches

#

i need to know

#

what's the right thing

#

bukkit or craftbukkit

#

for the spigot server source

young knoll
#

Bukkit is the api layer

#

Craftbukkit is the implementation layer

eternal oxide
#

did you run with --generate-sources ?

timber mural
#

how to run it

eternal oxide
#

when you ran buildtools

timber mural
#

its a jar file

eternal oxide
#

?bt

undone axleBOT
timber mural
#

ooh right

#

cmd

eternal oxide
#

odd there is no 1.18 branch though

timber mural
eternal oxide
#

sorry --generate-source

#

no s

timber mural
#

alr thx

timber mural
#

im trying to change ore generator, but where is it located?

eternal oxide
#

then you are going about it the wrong way

#

What is your end goal?

timber mural
#

but i dont know where the files are

eternal oxide
#

then all you ned to Generators and BlockPopulators

timber mural
#
package org.bukkit.generator;

import java.util.Random;
import org.bukkit.Chunk;
import org.bukkit.World;
import org.bukkit.event.world.WorldInitEvent;
import org.jetbrains.annotations.NotNull;

/**
 * A block populator is responsible for generating a small area of blocks.
 * <p>
 * For example, generating glowstone inside the nether or generating dungeons
 * full of treasure
 * <p>
 * A BlockPopulator can be used in combination with a custom {@link ChunkGenerator}
 * by returning it in the method {@link ChunkGenerator#getDefaultPopulators(World)}
 * or by adding it manually to the worlds populator list returned by {@link World#getPopulators()}.
 * <p>
 * When adding a BlockPopulator manually to a world it is recommended to do so during
 * the {@link WorldInitEvent}.
 */
public abstract class BlockPopulator {

    /**
     * Populates an area of blocks at or around the given chunk.
     * <p>
     * The chunks on each side of the specified chunk must already exist; that
     * is, there must be one north, east, south and west of the specified
     * chunk. The "corner" chunks may not exist, in which scenario the
     * populator should record any changes required for those chunks and
     * perform the changes when they are ready.
     *
     * @param world The world to generate in
     * @param random The random generator to use
     * @param source The chunk to generate for
     * @deprecated Use {@link #populate(WorldInfo, Random, int, int, LimitedRegion)}
     */
    @Deprecated
    public void populate(@NotNull World world, @NotNull Random random, @NotNull Chunk source) {
    }

    /**
     * Populates an area of blocks at or around the given chunk.
     * <p>
     * Notes:
     * <p>
     * This method should <b>never</b> attempt to get the Chunk at the passed
     * coordinates, as doing so may cause an infinite loop
     * <p>
     * This method should <b>never</b> modify a {@link LimitedRegion} at a later
     * point of time.
     * <p>
     * This method <b>must</b> be completely thread safe and able to handle
     * multiple concurrent callers.
     * <p>
     * No physics are applied, whether or not it is set to true in
     * {@link org.bukkit.block.BlockState#update(boolean, boolean)}
     * <p>
     * <b>Only</b> use the {@link org.bukkit.block.BlockState} returned by
     * {@link LimitedRegion},
     * <b>never</b> use methods from a {@link World} to modify the chunk.
     *
     * @param worldInfo The world info of the world to generate in
     * @param random The random generator to use
     * @param chunkX The X-coordinate of the chunk
     * @param chunkZ The Z-coordinate of the chunk
     * @param limitedRegion The chunk region to populate
     */
    public void populate(@NotNull WorldInfo worldInfo, @NotNull Random random, int chunkX, int chunkZ, @NotNull LimitedRegion limitedRegion) {
    }
}

#

the only thing i see

#

in spigot api

eternal oxide
#

correct

#

also see org.bukkit.generator.ChunkGenerator

#

the java docs cover most of what you need to know

timber mural
#

wait so

#

i just have to edit functions?

#

so if i have this public void setBlock(int x, int y, int z, @NotNull Material material);

eternal oxide
#

yes, this is all in the API

#

not specifically that method

#

you want to alter ore generation

timber mural
#

yeah

timber mural
#

i just expected that there will be the whole generation code with ores and other stuff so that i could just modify it

cinder abyss
#

Hello, how can I replace a block breaking sound by another sound with ProtocolLib ?

subtle folio
#

Texturepacks would be the best bet.

cinder abyss
#

and it's only for 1 block (noteblock)

subtle folio
#

Sounds for breaking blocks are triggered by the client and not controllable form the server side

cinder abyss
subtle folio
#

of course you can play a sound during a block being broken but that would play on top of the breaking sound instead of overriding it.

#

Sure but the client knows when itโ€™s breaking a block and then decided based on that for what sound to play

cinder abyss
subtle folio
#

You could try that, though then the block wouldnโ€™t appear the way youโ€™d want it to (?)

subtle folio
#

Resource packs!

#

Make a fake block that appears the same and change the sound.

timber mural
subtle folio
#

There may be a way to set its hardness as well though i donโ€™t know it off the top of my head

subtle folio
timber mural
subtle folio
#

And thatโ€™ll help how..? ๐Ÿคฃ

#

What if the sound needs to be played throughout the duration of the block breaking experience?

hollow birch
#

this isnt a specific code question but for those of you that have worked on larger plugins how did you go about planning them before hand?

cinder abyss
# subtle folio Resource packs!

I made this and it's working :java event.getPlayer().stopSound(Sound.BLOCK_WOOD_BREAK); event.getPlayer().playSound(block.getLocation(), Sound.BLOCK_STONE_BREAK, 1, 1);

hollow birch
#

ive been wokring on one for a while and realize that expanding it is extremely difficult because of my abilities at the start vs what i know now and want to start over and any advice is appreciated

subtle folio
hollow birch
#

are there any tools yall use for mapping or just classic pen and paper

cinder abyss
#

Is there an event for when a block is being broken ?

hollow birch
cinder abyss
eternal oxide
#

only when you start to damage

hollow birch
#

what are you trying to do with it

cinder abyss
#

so I think it's perfect

eternal oxide
#

you can get teh start with the interact you can get the end with the break event. you have no way of knowing if teh player stops in the middle

young knoll
#

Thereโ€™s the damage event

#

The break event

#

And the abort event

cinder abyss
#

perfect

eternal oxide
# hexed tendon here?

I just thought what your problem may be. Check that lib doesn't shade any mojmapped classes by mistake

hexed tendon
#

ill look into it tomorrow

#

its 12pm where i live

weak meteor
#

bro

#

this isnt real

weak meteor
#

not the other kit

#

๐Ÿ’€

#

hell nah

exotic oriole
#

Hii, whats the best way to format the CHAT using Json, I have an idea about sending a broadcast message, not the message with the format, I was wondering if you have any other ideas on this :)
Thanks

eternal oxide
exotic oriole
exotic oriole
west oxide
#

hello, i am getting this error , i dont know why, i tried many things but it still doesnt work, am pretty sure its something that am missing but i cant find what it is, anyone please help. thanks alot

Caused by: java.lang.ExceptionInInitializerError
        at com.andrei1058.bedwars.player.hotbar.HotbarEditor.getItem(HotbarEditor.java:49) ~[?:?]
        at com.andrei1058.bedwars.player.hotbar.HotbarEditor.initializeItems(HotbarEditor.java:39) ~[?:?]
        at com.andrei1058.bedwars.player.hotbar.HotbarEditor.<init>(HotbarEditor.java:25) ~[?:?]
        at com.andrei1058.bedwars.player.hotbar.HotbarCommand.execute(HotbarCommand.java:20) ~[?:?]
        at com.andrei1058.bedwars.commands.bedwars.MainCommand.execute(MainCommand.java:225) ~[?:?]
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:141) ~[server.jar:git-Spigot-21fe707-741a1bd]
#
        at com.andrei1058.bedwars.player.hotbar.ItemType.<init>(ItemType.java:83) ~[?:?]
        at com.andrei1058.bedwars.player.hotbar.ItemType.<clinit>(ItemType.java:11) ~[?:?]
        at com.andrei1058.bedwars.player.hotbar.HotbarEditor.getItem(HotbarEditor.java:49) ~[?:?]
        at com.andrei1058.bedwars.player.hotbar.HotbarEditor.initializeItems(HotbarEditor.java:39) ~[?:?]
        at com.andrei1058.bedwars.player.hotbar.HotbarEditor.<init>(HotbarEditor.java:25) ~[?:?]
        at com.andrei1058.bedwars.player.hotbar.HotbarCommand.execute(HotbarCommand.java:20) ~[?:?]
        at com.andrei1058.bedwars.commands.bedwars.MainCommand.execute(MainCommand.java:225) ~[?:?]
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:141) ~[server.jar:git-Spigot-21fe707-741a1bd]
        ... 14 more```
rough ibex
#

?nocode

undone axleBOT
#

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

west oxide
west oxide
rough ibex
#

need to see ItemType constructor

#

at com.andrei1058.bedwars.player.hotbar.ItemType.<init>(ItemType.java:83) ~[?:?]

west oxide
#

it's an enum


  private ItemType(String title, List<Material> items, ItemStack itemStack) {
    this.items = items;
    this.itemStack = itemStack;
    this.title = title == null ? "" : title;

    ItemMeta meta = this.itemStack.getItemMeta();
    meta.setDisplayName(this.title);
    this.itemStack.setItemMeta(meta);
  }
#

elements are defined something like this :

UTILS(
    "Utils",
    new ArrayList<>(
      Arrays.asList(
        Material.WATER_BUCKET,
        Material.LAVA_BUCKET,
        Material.TNT,
        Material.FIREBALL,
        Material.FIREWORK_CHARGE,
        Material.ENDER_PEARL,
        Material.GOLDEN_APPLE
      )
    ),
    new ItemStack(Material.TNT)
  )```
eternal oxide
#

ItemType.java:83

west oxide
#

line 83:
meta.setDisplayName(this.title);

eternal oxide
#

one of those things is null

west oxide
#

which things

eternal oxide
#

line 84

#

83

rough ibex
#

meta might be null

#

the itemStack might be null

west oxide
#

okay i will try something to make sure it is not null (meta)

orchid brook
#

can i have some help about placeholder here ? or maybe do they have a dicord support ?

eternal oxide
#

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

west oxide
#

thanks alot guys

orchid brook
#

Okayy so i have install advanced drop manager, and i would like to have expression that give me a randomnumber. So i found this:
https://api.extendedclip.com/expansions/randomnumber/

So i did
/papi ecloud download RandomNumber

/papi reload

But when i do /papi parse me %randomnumber_number% it's doen't work. I can't find the solution

weak meteor
#

how can i change that?

#

like the numbers

#

and the bars

#

Like when you hover the bars there's text

echo basalt
#

packets

wise mesa
#

how can I convert an euler angle to a joml quaternion

eternal oxide
#

didn't md5 tell you that yesterday?

wise mesa
#

ummmm

#

possibly

#

yes he did

#

my bad

#

whoopsie doo

#

i forgot

#

rather forgetful

eternal oxide
#

๐Ÿ™‚

wise mesa
#

thanks

wise mesa
#

getting a nosuchmethoderror for org.bukkit.util.Vector.toVector3f()

#

im on paper though so that might be why

delicate lynx
#

?whereami

warm mica
warm mica
wise mesa
warm mica
warm mica
wise mesa
calm nova
#

Hey guys, any way to fix this?

#

I uploaded it already to the project..

delicate lynx
#

did you add the repositories?

calm nova
#

Yes.

sullen marlin
#

Reload project?

river oracle
#

shoulda cut the name yea opening up a resource to check how they impl something and immediately the class names ๐Ÿ˜ญ

#

pos as in piece of shit or point of sale?

sullen marlin
#

Position

young knoll
#

Well

#

At least some of them are capitalized

rigid otter
#

In BungeeCord, I spotted that ServerInfo#ping sometimes no response even a throwable error. Is this really happen?

#

Is this really happen or because of my code?

icy beacon
#

did you try invalidating caches

#

File -> Invalidate caches (I think it's there)

#

basically intellij sometimes shits in your mouth and forgets stuff that's there

#

to reset its dementia invalidate caches

#

invalidate yeah

#

eh I normally check everything

#

np

#

๐Ÿ˜„

wet breach
#

o.o

#

I am not smart

rotund ravine
#

Nope

#

It looks like it would in a yml.

rotund ravine
#

Try it.

#

Ur welcome.

rigid otter
#

Can I set ping timeout in ServerInfo#ping in BungeeCord?

vital sandal
#

What are the reason to use module for multi-version ?
instead of just create multiple package for each nms-version?

orchid gazelle
#

It literally looks like a random b64 string lol

vital sandal
#

There are many way to encode data
for itemstack you can encode just name-lore-enchantments-type-id (lossy version - readable)
or base64 (no data loss-unreadable)

#

the lossy one use less memory^

orchid gazelle
#

Mostly u'd use base64

#

Depends on the use case tho

vital sandal
#

In somecases base64 is not that needed

orchid gazelle
wet breach
rigid otter
ocean hollow
vocal cloud
#

Version mismatch? Make sure spigot in pom.xml is the same as the server?

chrome beacon
#

Use Paper or whatever api you're coding against

vocal cloud
dire bluff
#

Hello is it possible to create plugins with Python and if it is how can I learn how to create them I know everything I should k is about Python

pseudo hazel
#

no you cannot

#

but if you know everything about python then java shouldnt be a problem

dire bluff
#

Ok

shadow night
#

How do people even think of coding plugins in python for a game in java?

dire bluff
#

I mean I had a conversation with someone and told me that itโ€™s possible and I wanted to make it sure if I can also there are libraries that can make it possible like Jython but itโ€™s not that easy and it has not the same compatibility

wet breach
pseudo hazel
#

oh

#

but would you want to

#

I think is the next question

ivory sleet
tardy delta
#

time to learn java

vernal brook
#

Hi are there premade maps and if so where can I download or find them?

sullen marlin
#

planetminecraft probably

vernal brook
#

Ah ok I thought there are already maps that you can use automatically if you have the plugin ok thx.

placid moss
#

if i am creating a library plugin and need to depend on spigot (like nms and craftbukkit) how would you go about doing that

#

like not a library plugin, but a actual library, hosted on like say jitpack

hazy parrot
#

And for dep, just dep on spigot normally and add provided scope

placid moss
#

but that hasa build error in jitpack

#

because buildtools isnt on the repo

vocal cloud
#

show pom.xml for it

placid moss
#
plugins {
    id 'java-library'
}

group = 'me.partlysunny'
version = '1.0-RELEASE'

repositories {
    mavenCentral()
    maven {
        url = 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/'
        content {
            includeGroup 'org.bukkit'
            includeGroup 'org.spigotmc'
        }
    }
    maven { url = 'https://oss.sonatype.org/content/repositories/snapshots' }
    maven { url = 'https://oss.sonatype.org/content/repositories/central' }
}

dependencies {
    compileOnly 'org.spigotmc:spigot:1.19.4-R0.1-SNAPSHOT'
    testImplementation platform('org.junit:junit-bom:5.9.1')
    testImplementation 'org.junit.jupiter:junit-jupiter'
}

test {
    useJUnitPlatform()
}
#

here is a gradle

#

like without buildtools being run it doesn't work

#

on jitpack

eternal night
#

yea building nms reliant things on jitpack is not going to be fun

placid moss
#

is there any alternative or way to do it

eternal night
#

iirc there are some repos out there that just, disregard the legal consequences and still host the minecraft server

placid moss
#

like even using a custom jenkins build or something

eternal night
#

which you could use

placid moss
eternal night
#

if you self host then yea, this would be easy

#

usually that is not an option for a lot of people that use jitpack tho KEKW

placid moss
#

doom i dont wanna do that tho

#

yea ok thanks for the help ill figure something out

eternal night
#

you can use paperweight userdev in gradle, has the downside that you are exposed to paper internals which are not the same as spigot internals

#

and hence might break your plugin on spigot servers

placid moss
eternal night
#

yea, but you are depending on 1.19.4 so

#

ยฏ_(ใƒ„)_/ยฏ

placid moss
#

yea but i plan to have from 1.12.2

eternal night
placid moss
#

upwards in different modules

#

that was just one

eternal night
#

gl

placid moss
#

๐Ÿ’€

remote swallow
#

jitpack can use github workflows

#

you need to create one and use sprax devs spigot thing, can build spigot on a workflow

placid moss
#

is it legit tho cuz its not buildtools right

remote swallow
#

people use it all the time for github workflows and needing buildtools

#

all im guessing it does is run buildtools in the background

ocean hollow
#

how can I get list of items? it gives me null

tardy delta
#

isnt it "variations-barrel." + type

#

well size probably works ig

#
  • '\'' + index + '\'' ?
buoyant viper
#

i finally actually made proper PRs for this lol @remote swallow

#

more like 4, but whos counting :P

eternal night
#

duplicating api KEKW

eternal night
#

nice tho, grats on the first PR

brisk estuary
#

Hey guys. I'm creating a "custom entity" and want to keep track of all of them. This entity is just a stronger cave spider (potions) that has some particles around it. There is a chance that when a cave spider spawns it will be one of these stronger ones (using creature spawn event). My question is how should I handle the particles thing? Should I use a set to keep track of all the "custom" entities using their UUID and then inside a task I get the entity from it's UUID using Bukkit#getEntity() or would it be too laggy? Would it be a better option to use a HashMap<UUID, CaveSpider> or just a Set<CaveSpider>? Also, when one of those custom mobs despawn I need to remove it from the set/map, so I'm using the EntitiesUnloadEvent and EntitiesLoadEvent. Any tips on this?

#

Maybe I'm too worried about performance, idk

brisk estuary
#

?paste

undone axleBOT
wet breach
#

Also hashmap would be better. Set if you need order

#

You dont really need a task. The listeners from the api should be enough

brisk estuary
#

I need a task to spawn the particles around them. It'll be like a circle around them

wet breach
#

You dont need a task to spawn them. Just a task to move them

#

The only performance impactful thing you have is just the particles

#

There is some libs that can help with that

quiet ice
#

I'd use WeakHashMap to avoid mem leaks (unless you use UUIDs exclusively). You still need to handle chunk loading though

wet breach
#

Yeah could use a weakhashmap too but doubt it would make much a difference though. Custom entities dont disappear they just transform back to normal entities lol

quiet ice
#

Well my thought was what happens if the entity gets removed

wet breach
#

I suppose it would be wise to use that in case some plugin interferes

quiet ice
#

Performance-wise it'd be worse though. Best if you were to extend the NMS cave spider

#

Though that has other issues

brisk estuary
#

I mean, they just have some potion effects, some particles around them and drop a new item

#

They aren't that custom lol

wet breach
#

Yeah dont need nms for that lol

quiet ice
#

Yes but you'd be able to deal with entity removal much better

wet breach
#

Pretty sure killing entities via api is just fine lol

quiet ice
#

No, what happens if others do it (perhaps even through NMS due to "performance")

wet breach
#

Just catch the exception for it

quiet ice
#

So you'd need to choose between hoping nothing goes wrong, WeakHashMap or NMS

brisk estuary
#

the thing is that I'm trying to avoid using a sync task to do the particles thing and if I use a map or a set which identifies the entity by its UUID I'd have to use Bukkit#getEntity() which can't be called inside a async task, right?

wet breach
#

Catch exception check if entity is alive still, if not update whatever needs updating and carry on

quiet ice
#

Unless you use lists at which point that approach makes sense

brisk estuary
wet breach
#

As long as the entity gets removed at some point from whatever is tracking it. It wont be a memory leak

quiet ice
#

Then use CHM

icy beacon
#

the day that intellij stops RESETTING MY INDENT CONFIGURATION is the day I can die in peace

#

for fuck's sake

#

it's not even a big hassle

#

but oh my god

wet breach
buoyant viper
icy beacon
#

yeah but why does it reset out of the blue

#

it's actually stupid

wet breach
#

Next would be to check hard drive with check disk to see if there is any issues with the filesystem or hard drive

#

Occasionally the filesystem file gets screwed up especially if its super fragmented all of the place

#

Check disk will fix it if that is the issue

#

Otherwise its purely IJ for whatever reason

ocean hollow
wet breach
#

Using what you pulled from config

#

Cant just cast a list to a list and expect the objects to magically convert lol

icy beacon
wet breach
#

Casting the list only changes the list object itself and not the contents of the list to give more info

icy beacon
#

on an ssd

wet breach
#

Is your ssd running out of writes?

icy beacon
#

no other errors are there

icy beacon
wet breach
#

Need to look at the smart info

icy beacon
#

i think i have crystaldiskinfo

#

one sec

wet breach
#

Typically the ssd will tell you how much it has left. It should be some insane large number

wet breach
#

Object will always be an instance of itemstack

hazy parrot
#

How

#

Itemstack will always be instance of object

wet breach
#

And vice versa

ocean hollow
#

And will this fix my problem?

buoyant viper
#

that is 100% going to break

hazy parrot
icy beacon
buoyant viper
wet breach
remote swallow
#

cant you pass ItemStack.class to the getList param

buoyant viper
hazy parrot
wet breach
#

Anyways regardless generics and casting are not even necessary here

buoyant viper
remote swallow
#

i dont remember

wet breach
remote swallow
#

it takes a List<?>

#

ah thats def

wet breach
#

So casting isnt going to help nor checking a type against a generic

#

What needs to be done is to iterate through the list and create new itemstack objects

icy beacon
#

can you iterate through every element in the list and see if it's an itemstack with isItemStack?

wet breach
#

So that the server is aware of the itemstack objects

wet breach
#

Even if you serialize objects when you deserializs you still need to create a new object there is no getting around that

crimson terrace
ocean hollow
wet breach
#

The only difference with serialization is you can plug the data directly into the new object

wet breach
remote swallow
crimson terrace
#

its public static, right?

#

this one

remote swallow
#

oh

#

its just craft meta ite

#

item

wet breach
#

A perfect example is blockstate data. You still have to create a block before you cab plug the data in directly.

crimson terrace
#

programmatically you can get the ItemStack object with that deserialize method, ingame you still have to spawn it, thats what you mean?

wet breach
#

No

#

Objects in the jvm dont appear just because you cast

#

The only way an object can appear in the jvm is for it to be created using the new keyword there is no other way without going through and using the unsafe package of course

crimson terrace
#

we talking about the deserialize method?

wet breach
#

So serialization saves the state of an object

#

Deserialization can if the method implements it create the objects for you

#

But it depends on that method

crimson terrace
#

deserialization creates the object

hazy parrot
#

that still doesn't cover the statement that object is always instanceof itemstack

wet breach
#

Otherwise deserialization just turns it from binary data to non-binary data that is more organized

crimson terrace
wet breach
hazy parrot
#

yes, itemstack is always instanceof object

#

but not vice versa

#

as any instance in java instanceof object == true

crimson terrace
#

which is why casting is necessary

hazy parrot
crimson terrace
#

instanceof + cast in order to use the methods which can be used on the object

hazy parrot
wet breach
# hazy parrot but not vice versa

Right your correct, but they way they are doing it isnt going to work unless they create some new objects. Casting doesnt make new objects automatically lol

crimson terrace
#

casting doesnt change the list object, it just increases the amount of information you have at non-runtime

wet breach
#

And casting a list doesnt change the contents of the list either

crimson terrace
#

of course, gotta make sure its a pure list of Itemstacks or there may be errors

wet breach
#

Well need to deserialize and as long as the deserialization method creates the objects for you then yes will work

crimson terrace
#

ah I see. I'm pretty sure Spigot will create those objects itself

#

Either that or I just did that accidentally

wet breach
#

Serializing just saves the state of an object and its type. It isnt an object itself. So you need method that creates a new object and then you plug that object state in as the content of the object which includes type and you have your object you saved

crimson terrace
#

I must have just used deserialize methods everywhere then

wet breach
#

Lol

#

Just didnt actually realize those methods were taking care of the dirty work for you

#

And that is how apis should be

crimson terrace
#

yeah, Ive made like 50 ConfigurationSerializable classes in my new project XD

wet breach
#

Well at least you learned something that serializing doesnt mean the object itself is saved just its state.

#

So you have a better understanding of something now

crimson terrace
#

yeah ๐Ÿ˜„

#

all of us, I suppose ๐Ÿ˜„

wet breach
#

With that time to drive home now

crimson terrace
#

๐Ÿซก

fading python
#

java: package net.minecraft.server.v1_8_R3 does not exist is an error i get when compiling a plugin addon, how can i make it still work?

#

ive used buildtools to try and fix it (other's help) but it did not change anything

chrome beacon
#

Show your pom/build.gradle

#

?paste

undone axleBOT
fading python
#

there is no pom

chrome beacon
fading python
#

i got it from github

#

im tasked to compile it

chrome beacon
#

How are you compiling it

fading python
#

using intelij

#

its suppost to be an addon for another plugin

rare rover
fading python
#

theres many versions

#

i pasted in the last version

#

1_19_R1

chrome beacon
fading python
#

but it also sais tested for 1.19

chrome beacon
#

The error you sent is caused by it trying to compile against 1.8.8

#

but you're probably not depending on it so it's failing

fading python
chrome beacon
#

It might be worth hiring someone to compile that for you

#

since you don't appear to know Java

#

nor any dependency management in Gradle

#

?services

undone axleBOT
fading python
#

alright

grim iris
slim wigeon
#

Anyone messed with NPCs? Trying to find a way to get one on my server

remote swallow
#

citizens

slim wigeon
#

Money required, paypal account suspended. Not possible

remote swallow
#

its free on jenkins

chrome beacon
#

Citizens is available for free ^^

twin venture
#

hi , did anyone use KitClaimEvent event?
using EssentialsApi , ?

    List<String> items = event.getKit().getItems();

string of items?

#

i want to get the item itself xd?

worn tundra
twin venture
#

i didn't test xd

worn tundra
twin venture
remote swallow
#

check src to see how essentials gives players the kit

twin venture
#

it have a event called KitClaimEvent

worn tundra
#

You have to use this i assume

remote swallow
#

yeah, you have the kit you just need to see how to use it

worn tundra
#

Or this

icy beacon
#

top 10 goofiest anime characters

worldly ingot
onyx fjord
#

does any event fire for the knockback player will get ?

worldly ingot
#

No

#

Just the damage event but I don't think the amount of knockback received is exposed

onyx fjord
#

ah shit

#

is the velocity already applied?

#

or exposed

worldly ingot
#

Probably not set yet

onyx fjord
#

i guess i can calculate it myself, how does mc calculate it

heady spruce
#

Hello Guys!
I've question, i wanna send a Bukkit Broadcast message when obsidian is generated by lava + water. Any help is much wanted (1.8.8 Spigot)
Thanks
Tried the BlockFromToEvent, BlockPhysicsEvent.

gilded coyote
heady spruce
#

Obsidian isn't getting caught ig, always only liquids

#

bruh

#

i could decompile

#

but i did something wrong ig

#

ye

#

but still wont work

icy beacon
#

what would be a good naming in this situation? i've got an interface in my API that's called registry and i want to create an implementation of it in my project. should I go with (IRegistry; Registry) or (Registry; RegistryImpl) or something else?

chrome beacon
#

Both are fine

#

Pick one and stay consistent

heady spruce
icy beacon
#

hm, i'll go with (IRegistry; Registry) because it's more clear as to what's an interface and what isn't. thanks Olivo!

chrome beacon
#

Use addPasenger

icy beacon
#

any idea why i keep getting this?

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:3.4.0:jar (attach-javadocs) on project UnderscoreEnchantsAPI: MavenReportException: Error while generating Javadoc: 
[ERROR] Exit code: 1 - G:\PROJ PLUGINS\UnderscoreEnchantsAPI\src\main\java\com\roughlyunderscore\enchantsapi\events\EnchantmentActivateEvent.java:3: error: package org.bukkit does not exist
[ERROR] import org.bukkit.NamespacedKey;
[ERROR]                  ^
[ERROR] G:\PROJ PLUGINS\premium\UnderscoreEnchantsAPI\src\main\java\com\roughlyunderscore\enchantsapi\events\EnchantmentActivateEvent.java:4: error: package org.bukkit.entity does not exist
[ERROR] import org.bukkit.entity.Entity;
[ERROR]                         ^
[ERROR] G:\PROJ PLUGINS\premium\UnderscoreEnchantsAPI\src\main\java\com\roughlyunderscore\enchantsapi\events\EnchantmentActivateEvent.java:5: error: package org.bukkit.entity does not exist
[ERROR] import org.bukkit.entity.Player;
[ERROR]                         ^
(this goes on forever)

pom (relevant):

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-javadoc-plugin</artifactId>
  <version>3.4.0</version>
  <executions>
    <execution>
      <id>attach-javadocs</id>
      <goals>
        <goal>jar</goal>
      </goals>
    </execution>
  </executions>
  <configuration>
    <links>
      <link>https://hub.spigotmc.org/javadocs/bukkit/</link>
      <link>https://javadoc.io/doc/org.jetbrains/annotations-java5/23.0.0/</link>
    </links>
  </configuration>
</plugin>

jdk 16 corretto

undone kernel
#

i'm back just to post this i do not need help I'm perfectly sane

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (sender instanceof Player) {
            Player p = (Player) sender;
            if (sender.hasPermission("eagle.multisummon")) {
                if (args.length >= 2) {
                    try {
                        EntityType entity = EntityType.valueOf(args[0]);
                        int amount = Integer.parseInt(args[1]);
                        for (int i = 0; i < amount; i++) {
                            p.getWorld().spawnEntity(p.getLocation(), entity);
                        }
                        p.sendMessage(colorize("&aYou've spawned &e" + args[1] + " " + args[0] + "s"));
                    } catch (IllegalArgumentException e) {
                        p.sendMessage(colorize("&4This is not an entity."));
                    }
                } else {
                    p.sendMessage(colorize("&e/multisummon [mob] [amount]."));
                }
            } else {
                p.sendMessage(colorize("&4You don't have permission to do this."));
            }
        } else {
            sender.sendMessage(colorize("&4You cannot do this. "));
        }
        return true;
    }```
icy beacon
#

Please

undone kernel
remote swallow
#

seeing that code rememinds me why i blocked you

undone kernel
remote swallow
#

i didnt

undone kernel
remote swallow
#

i just saw the "1 blocked message" so just check to see what it is

remote swallow
#

check jefflib

undone kernel
icy beacon
#

damn

undone kernel
#
                if (!player.hasPermission("server.summon")) {
                    player.sendMessage("You do not have permission to use this command.");
                    return true;
                }
                if (args.length < 2) {
                    player.sendMessage("Usage: /summon <entityType> <amount>");
                    return true;
                }
                int amount;
                try {
                    amount = Integer.parseInt(args[1]);
                } catch (NumberFormatException e) {
                    player.sendMessage("Invalid amount. Please enter a valid number.");
                    return true;
                }
                EntityType entityType = EntityType.valueOf(args[0].toUpperCase());
                Location location = player.getLocation();
                for (int i = 0; i < amount; i++) {
                    Objects.requireNonNull(location.getWorld()).spawnEntity(location, entityType);
                }
                player.sendMessage(colorize("&aSpawned &e" + amount + " &a" + entityType + (amount > 1 ? "s" : "") + "."));```
does ths help your eyes
icy beacon
#

but i will check

#

ty

remote swallow
#

yes

icy beacon
#

oh my god this javadoc shit just does not work

remote swallow
#

when you make it a material again use Material.getMaterial(String.toUpperCase())

#

why would you use that to get a material

#

string is just meaning whatever you have

icy beacon
#

dude ?paste doesn't allow me to save the error ๐Ÿ˜ญ

#

what the fuck is

remote swallow
#

copy a bit of it and give it ot chat pgt

icy beacon
#

perhaps..

#

that's a bit too harsh

remote swallow
#

it makes stuff for me

#

i like it

icy beacon
#

true

icy beacon
remote swallow
#

it needs work butit does what i need

icy beacon
#

though i remember asking the same question like a year ago

#

and you know what helped

#

going from java 16 to java 8

remote swallow
#

stackoverflow

icy beacon
#

now i need java 16

#

but even downgrading does not help[

#

i'll just log off for the night

#

maybe alex will awaketh and help

#

i use chatsonic ๐Ÿ˜›

remote swallow
#

use catgpt

icy beacon
icy beacon
#

i start explaining and it fixes itself even though i didn't even send my question yet

remote swallow
undone kernel
remote swallow
#

V

undone kernel
#

what do you ask it

#

because it seems to be able to code fine for me

#
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerToggleSneakEvent;

public class CrouchExplosionListener implements Listener {

    @EventHandler
    public void onPlayerCrouch(PlayerToggleSneakEvent event) {
        Player player = event.getPlayer();
        if (player.isSneaking()) {
            World world = player.getWorld();
            Location location = player.getLocation();
            world.createExplosion(location, 3f, false);
        }
    }
}
``` sample it created
buoyant viper
#

?jd-s

undone axleBOT
undone kernel
kindred valley
#

I just didnt get it

#

Do you have issue

undone kernel
#
 public void onPlayerCrouch
world.createExplosion(location, 3f, false);
west oxide
#

hello, would it be a good idea to create a rest api and communicate with it instead of sql queries for database ?
for a bedwars plugin

undone kernel
kindred valley
#

Has chatgpt write this code

#

I dont understand

undone kernel
undone kernel
kindred valley
#

Do you have issue with code i am asking this

undone kernel
icy beacon
kindred valley
#

Ah god i dont get what is going on here

undone kernel
#

then why are you here

kindred valley
#

I saw you texted a code and i thought you have issue about code

short monolith
#

Hello, tell me, how to spawn several mobs near the player?

undone kernel
#

now that explains it

#

no i don't have a issue

remote swallow
kindred valley
undone kernel
short monolith
kindred valley
kindred valley
remote swallow
#

use ThreadLocalRandom.current() and pick adding or taking from their location then summon a mob there

undone kernel
# kindred valley No

this is suppose to be a reply to the guy who said chatgpt doesn't code for him so I said it works fine
hence message at the bottom where it says "sample it created"

short monolith
brisk estuary
#

does anybody know if the method Bukkit#getEntity() could cause lag if I used it inside a task every 5 ticks?

eternal oxide
#

depends how many you do, but generally no

#

then no

remote swallow
brisk estuary
#

sorry, I'll actually call it for every element in a set

#

yea, I guess it may be laggy if there's a lot of entities xd

eternal oxide
#

explain what you are doing, there may be a better way

brisk estuary
eternal oxide
#

I want a 5 letter word thats longer than 10... see if it replies fifty

#

how many entities are we talking?

brisk estuary
#

Would it be better to directly store each entity inside the set instead of its uuid and then check if it is still valid?

brisk estuary
eternal oxide
#

no advantage to storing the entity over gettign it from Bukkit

brisk estuary
#

I could use a async task

#

if I use Bukkit to get the entity I'm forced to use a sync task right?

eternal oxide
#

I'd have no issue coding 50 entities every tick to spawn particles around them. Unless your server is a potato.

#

yes

#

particles can be spawned async though

#

they are just packets

brisk estuary
#
@Override
    public void run() {
        final List<UUID> toRemove = new ArrayList<>();
        for (UUID uuid: CoolantRaknoidsManager.RAKNOIDS_UUIDS) {
            Entity entity = Bukkit.getEntity(uuid);
            if (entity == null || !entity.isValid()) {
                toRemove.add(uuid);
                continue;
            }
            // Spawn particles
            
        }
        toRemove.forEach(CoolantRaknoidsManager.RAKNOIDS_UUIDS::remove);
    }
#

atm I have smt like that

#

maybe I'm too worried about performance, I'll just keep it as is

eternal oxide
#

if you start to have issues later with performance

#

?workdistro

brisk estuary
#

thanks ๐Ÿ™‚

echo basalt
spare prism
#

Hello. Why don't my NBT tags get removed from the item?
My code to remove the tags:

    public ItemStack fixSign(ItemStack itemStack) {
        if(!itemStack.getType().toString().contains("SIGN")) return itemStack;

        net.minecraft.server.v1_12_R1.ItemStack nmsItem = CraftItemStack.asNMSCopy(itemStack);
        NBTTagCompound tag = nmsItem.getTag();

        if (tag == null) return itemStack;
        NBTTagCompound blockEntityTag = tag.getCompound("BlockEntityTag");
        if (blockEntityTag == null) return itemStack;

        System.out.println("Before removal: " + blockEntityTag);

        blockEntityTag.remove("Text1");
        blockEntityTag.remove("Text2");
        blockEntityTag.remove("Text3");
        blockEntityTag.remove("Text4");

        System.out.println("After removal: " + blockEntityTag);

        tag.set("BlockEntityTag", blockEntityTag);
        nmsItem.setTag(tag);

        return CraftItemStack.asBukkitCopy(nmsItem);
    }

And then I just set the item:

                if(event.getHand() == EquipmentSlot.HAND) player.getInventory().setItemInMainHand(nbtManager.fixSign(itemStack));
                else player.getInventory().setItemInOffHand(nbtManager.fixSign(itemStack));
#

the respective output in the console:

[20:42:13 INFO]: Before removal: {Text4:"{\"text\":\"\"}",Text3:"{\"text\":\"\"}",Text2:"{\"text\":\"\"}",Text1:"{\"text\":\"\"}"}
[20:42:13 INFO]: After removal: {}
#

Also I printed the tag to the console: tag: {BlockEntityTag:{},display:{Name:"ะšั€ะฐัˆ ั‚ะฐะฑะปะธั‡ะบะฐ"}}

ocean hollow
#

why it doesn`t have CustomModelData

remote swallow
#

does your texture pack have the custom model data for that item? nothing is visual without it

ocean hollow
#

yes it has

brisk estuary
#

yeah I'm creating a plugin inspired on warframe

lament swallow
#

Is it possible to update only a block texture without actually changing the block itself? The sort of change that reverts when the targeted block is updated

eternal oxide
#

Player#sendBlockChange

lament swallow
#

I've seen servers do it but i don't know how

#

Thanks a lot

wary harness
#

is there a method which returns amount of specific Itemstack in Ineventory

echo basalt
#

count

eternal oxide
#

Inventory#all

#

?jd-s

undone axleBOT
golden turret
#

is it possible to apply the shift effect seen in the player's name in an armor stand?

spare prism
#

Changing the NBT data

west oxide
#

hello, i am getting the following error when trying to compile using intellijidea

Index 6 out of bounds for length 0

there's no error in console and no error marked by the ide

#

all am getting is this

eternal oxide
#

its a shade error so has to be something to do with your pom

west oxide
eternal oxide
#

then clear caches

west oxide
#

that didnt fix

#

this way right ?

#

Invalidate and Restart

blissful wagon
#

how much far we can go with Gson ? we can save any type of object ? bc when i try to save something simple like a string or int it work properly but when i save something like player location or an item it just dosent work

eternal oxide
#

objects require TypeAdapters

#

you can't save/load a Player

blissful wagon
eternal oxide
#

yes

quaint mantle
#

Can someone help me set up a minecraft server with plugins?

eternal oxide
final monolith
#

lol BaseComponent's bukkit API is so buggy

fluid river
#
public static void sendActionBar(Player player, String text) {
    if (!Main.getInstance().getConfig().getBoolean("spigot")) {
      CraftPlayer p = (CraftPlayer)player;
      PacketPlayOutTitle sendactionbar = new PacketPlayOutTitle(PacketPlayOutTitle.EnumTitleAction.ACTIONBAR, 
          (IChatBaseComponent)IChatBaseComponent.ChatSerializer.a("{\"text\":\"" + text + "\"}"));
      (p.getHandle()).playerConnection.sendPacket((Packet)sendactionbar);
    } else {
      player.spigot().sendMessage(ChatMessageType.ACTION_BAR, 
          (BaseComponent)new TextComponent(text));
    } 
  }```
#

found out my old code

#

if (spigot) {}
else {}

remote swallow
#

if (!Main.getInstance().getConfig().getBoolean("spigot")) {

#

what

fluid river
#

basically just had a boolean so admins could define if they are on bukkit or on spigot

remote swallow
#

my good lord

chrome beacon
fluid river
#

had my main class called Main

eternal oxide
#

bestest name eva

remote swallow
#

elgarl u made group manager right

eternal oxide
#

originally no. 90% of ity is mine now though (past 10 years)

remote swallow
#

how does it feel tobe mentioned in essx faq

eternal oxide
#

Am I? don;t care

remote swallow
eternal oxide
#

Yeah, prissy new devs have no clue ๐Ÿ™‚

#

Looked at their essx code? I don;t go posting how bad it is on my faq

#

If I had a faq ๐Ÿ˜›

remote swallow
#

api docs are non existent and everything is interfaces

eternal oxide
#

just building it is cancer

#

I should team up with smile and alex and write our own, with blackjack and hookers

final monolith
# chrome beacon How so?

I can describe few issues with my long time use experience:

ComponentSerializer#toString is broken, works, but not as expected (as example: BaseComponents arrays)
TextComponent#fromLegacyText has some issues, i don't trust on it
TextComponent#String constructor should work different, something like the TextComponent#fromLegacyText, but no

Thats three things i can list now, i've experienced some others issues before... The unique thing i really trust on the bukkit's component api is the ComponentSerializer#parse, on my oppinion the api should be completely refactored

eternal oxide
#

Odd comments

#

Nothing specific, just doesn't work as you expected

final monolith
#

I can provide steps to reproduce the issues if you want

eternal oxide
#

if you have bugs you can submit them

final monolith
#

Where?

chrome beacon
#

?jira

undone axleBOT
eternal oxide
#

if they are just, I'd do it differently, you'll get nowhere

remote swallow
#

isnt it bungee so github?

chrome beacon
#

ah right it's part of the Bungee api

#

So Github might be the right place

eternal oxide
#

they do bungee on jira

#

I had a PR refused on there ๐Ÿ™‚

remote swallow
#

ah

spare prism
eternal oxide
eternal oxide
#

Your method returns a NEW ItemStack, so not the one you pass in

spare prism
eternal oxide
#

yes but a new one, not the original

spare prism
eternal oxide
#

test teh ItemStack after you applied the removed NBT

spare prism
#

check the topic again, I provided the code

eternal oxide
#

after you applied, before you put int eh inventory

lucid gazelle
#

hi, im trying to get the amount of the item in InventoryMoveItemEvent but it always returns the event.getItem().getAmount() as 1

spare prism