#help-development

1 messages Β· Page 842 of 1

proud badge
#

if its for the projectile how do I get the player then?

river oracle
#

The projectile

#

Check for instance of ender pearl

#

Get the shooter

#

Which Id provided by the casted entity

trim elk
#

guys, i have a skull modified by NBT-API, but when i change its slot it seems to lose the tags i created on it. why?

proud badge
#

would it be possible to obtain a Projectile's landing location before it has landed?

#

Something like Projectile.getLandingLocation

river oracle
#

Not that I'm aware of

proud badge
#

Rip

river oracle
#

You gotta do the math yourself

ivory sleet
trim elk
#

I only have mine, which uses DecentHolograms, ProtocolLib, XSeries, NBT-API

atomic niche
#

Why is there an official SonarLint plugin for eclipse πŸ˜”

#

More to the point, if eclipse gets one, why isn't there an official SonarLint plugin for netbeans.

quiet ice
#

Do not question it

#

But why do you need to use that? Is it even good?

atomic niche
#

Why I use sonar or why I use netbeans?

bleak stream
#

IntelliJ best

grim dock
#

Is it possible to have RGB Colors as the color of the displayName?

pseudo hazel
#

yeah sure

grim dock
# pseudo hazel yeah sure

Can this be done using scoreboards? Because I only found sources that said, that it does not work with scoreboards.

pseudo hazel
#

yes you can have hex color scoreboard text

#

you need to set the teams prefix

#

since that can have all colors

grim dock
#

I tried that but it didn't change the name behind the prefix

#

The prefix works fine but the displayName is not getting the correct color

pseudo hazel
quaint mantle
#

how do i create a jar that contains both specialsource and dependencies in maven?
when i apply the plugin using specialsource-maven-plugin, the nms work normally, but ClassNotFoundException occurs in those included in the dependency.

rough harness
#

ok so i am useing oraxen plugin to add a invis block i need for a custom gui but what would i put here

grim dock
pseudo hazel
#

idk

#

this doesnt use players as entries but made up ones

quaint mantle
#

do you want me to send you pom.xml?

chrome beacon
#

Well did you shade the dependency or provide it in any way?

#

Because code that doesn't exist cannot run

#

?paste and yes send pom

undone axleBOT
quaint mantle
rough harness
#

so i am trying to get rid of the map so i made a invis block in oraxen plugin but what would the id be for it sorry i am not a dev my quit from life issues

quaint mantle
#

jar produced by maven-shade-plugin does not have nms working normally, but the dependencies work.

remote swallow
#

what jar do you use

chrome beacon
#

Also not the material

rough harness
chrome beacon
river oracle
#

Also hire a new dev

chrome beacon
#

Material would still be paper

#

And yeah ^^

river oracle
#

If ypu don't know what you're doing you should pay someone to do it

#

If you pay well getting a new dev should be 0 issue

rough harness
rough harness
#

where do i put the item id

remote swallow
#

it would be custom model data

rough harness
#

thanks

rare rover
#

do i have to pass in ClientInformation inside the ServerPlayer?

remote swallow
#

pass ClientInformation.createDefault()

#

iirc it should work with that

rare rover
#

oh, ty

rough harness
remote swallow
#

that isnt custom model data

#

its a number

#

and your resource pack would that number with an invis texture

rare rover
#

hmm

#

java.lang.NullPointerException: Cannot invoke "net.minecraft.server.network.PlayerConnection.l()" because "player.c" is null

remote swallow
#

its probably trying to send packets

rare rover
#

hm

remote swallow
#

ah l is tick

rough harness
remote swallow
#

assets/minecraft/models/item

rough harness
remote swallow
#

now you have to create the json file and add the info for custom model data, then create the invis texture

rough harness
#

πŸ˜“ this hurts my head lol

remote swallow
#
{
 "parent": "item/generated",
 "textures": {
 "layer0": "item/map"
 },
 
 "overrides": [
 {"predicate": {"custom_model_data":1234567}, "model": "item/map"}
 ]
}
#

heres a guide

chrome beacon
#

Do yourself a favour and use Citizens

quaint mantle
chrome beacon
#

Maven will create more than one jar

#

Use the correct one

quaint mantle
#

i was applying the plugin to another folder lol

#

thank you for your help

astral scroll
#

kotlin is underrated

river oracle
#

Kotlin is definitely not underrated

warm light
#

anyone can help me with this?
amount was 10.00 I tried many amount but still same error

#

Currency amount must be non-negative number, contain exactly 2 decimal places separated by '.' (JPY contains 0 decimal places), optional thousands separator ',', limited to 7 digits before the decimal point and currency which is a valid ISO Currency Code

idle loom
#

why cant I
get things from the PluginDescriptionFile thingy

river oracle
#

?learnjava!

undone axleBOT
idle loom
#

oh I

#

I am dumb

#

πŸ’€

#

I forgot how classes work

sterile flicker
#

if I have a tilentity furnace I can make it burn all the time

restive jackal
#

so I was expecting just the display name "Bow of Ender" when I log an item's itemMeta.displayName, but I get the entire TextComponent instead

TextComponentImpl{content="Bow of Ender", style=StyleImpl{obfuscated=not_set, bold=not_set, strikethrough=not_set, underlined=not_set, italic=not_set, color=null, clickEvent=null, hoverEvent=null, insertion=null, font=null}, children=[]}
#

I thought I could use the .contains method to see if the name was in it, but it requires a TextComponent to compare

sullen marlin
#

?whereami

restive jackal
#

lol okay

sullen marlin
sterile flicker
#
public class FurnaceTileEntity {
    static BlockPosition getFurnacePosition(Location BlockLocation) {
        return new BlockPosition(BlockLocation.getX(), BlockLocation.getY(), BlockLocation.getZ());
    }
    static NBTTagCompound getNBTOfFurnace(TileEntity furnace) {
        NBTTagCompound nbt = new NBTTagCompound();
        return furnace.save(nbt);
    }
    public static void setTileEntity(World world, Block block) {
        WorldServer nmsWorld = ((CraftWorld) world).getHandle();
        CraftFurnace craftFurnace = new CraftFurnaceFurnace(block);
        craftFurnace.setBurnTime((short) 10000);
        craftFurnace.setCookTime((short) 10000);

        TileEntityFurnaceFurnace furnaceTE = (TileEntityFurnaceFurnace) nmsWorld.getTileEntity(getFurnacePosition(block.getLocation()));
        NBTTagCompound nbt = getNBTOfFurnace(furnaceTE);

        furnaceTE = (TileEntityFurnaceFurnace) furnaceTE.create(furnaceTE.getBlock(), nbt);
        nmsWorld.setTileEntity(getFurnacePosition(block.getLocation()), furnaceTE);
    }
}```  ```@EventHandler
    public static void playerHandleEvent(PlayerInteractEvent event) {
        Player p = event.getPlayer();
        if (event.getAction() == Action.RIGHT_CLICK_BLOCK) {
            Block bl = event.getClickedBlock();
            if (bl.getType() == Material.FURNACE && p.isSneaking()) {
                FurnaceTileEntity.setTileEntity(event.getClickedBlock().getWorld(), bl);
                event.setCancelled(true);
            }
        }
    }``` code
sullen marlin
echo basalt
#

good ol' md_5 helping the community out

#

rare sight to see

sterile flicker
sullen marlin
#

Pretty sure it's all in the API

sterile flicker
#

then what can tile entity be used for? I want to explore this

#

and if it's in the api, how do I do it?

sullen marlin
#

Block.getState and cast to Furnace

sterile flicker
sullen marlin
#

I don't really understand the question

sterile flicker
#

if it is in the nms spigot, then it can be used for what that is not allowed in the api?

#

what's wrong with experimenting with this

bleak stream
#

woo something i made actually worked on the first try

#

this is amazing!

bleak stream
#

You probably could use Furnace#setLit
Furnace in block.data.type inherits that method from Lightable

#

I’m still learning, so that might not be the proper use but I just wanted to share what I found

sterile flicker
#

if (nmsWorld.getTileEntity(getFurnacePosition(block.getLocation())) != null) { now working as excepted

#
    public void blockBreakEvent(BlockBreakEvent event) {
        Block block = event.getBlock();
        WorldServer nmsWorld = ((CraftWorld) block.getWorld()).getHandle();

        TileEntity tileEntity = nmsWorld.getTileEntity(new BlockPosition(block.getX(), block.getY(), block.getZ()));

        if (tileEntity instanceof TileEntityFurnaceFurnace) {
            event.setCancelled(true);
        }
    }```
#

same

#

tilentity for me will be like custom furnaces that cannot be broken, for example

sullen marlin
#

?xy

undone axleBOT
sullen marlin
#

not clear why you are using nms

sterile flicker
#

well, to create nms entities, for example, NPCs.

#

i can't do this with the of a spigot api without a citizens api

sullen marlin
#

This is tile entities though

sterile flicker
distant wave
#

pretty general java question but how could i setup scheduler which would be ran every real life day

torn badge
tender shard
dry hazel
#

or just a simple scheduledexecutorservice or whatever it was called if you don't need to persist the scheduled task

tender shard
#

Restarted*

distant wave
#

well my plan was to run executor onenable which would get time in ticks until midnight and then execute smth, then it would self reset(starting over again)

tender shard
#

Just use a Date and an async thread that checks the time every minute then

dry hazel
distant wave
tender shard
#

If you just wanna run it on midnight, just use a scheduler and check the time every few seconds

torn badge
distant wave
#

should i use normal java executors then isntead of bukkit runnables stuff

tender shard
#

i'd just use a normal runnable with the scheduler

torn badge
#

You can use a Bukkit Scheduler to check every minute, but don’t calculate any time in advance using ticks

distant wave
#

alright

#

sounds good ig

tender shard
#

better check every few seconds, otherwise it might run on 23:59:59 and 0:01:00

distant wave
#

was thinking every second

#

(20 ticks i mean)

#

so yeah uhh this is what i though

dry hazel
#

what if that doesn't run exactly on that nanosecond

distant wave
#

should i range it somehow instead then?

#

like if its between 23:59:59 and 00:00:01

tender shard
#

I'd just do sth like this

    /**
     * Schedule this to run every few ticks
     */
    class MidnightRunner implements Runnable {

        private boolean hasAlreadyRun = false;

        @Override
        public void run() {
            if(shallRunNow()) {
                // do stuff
            }
        }

        private boolean isMidnight() {
            LocalDateTime time = LocalDateTime.now();
            return time.getHour() == 0 && time.getMinute() == 0;
        }

        private boolean shallRunNow() {
            if(hasAlreadyRun) { // if it has already run, it can't run again until next midnight
                if(!isMidnight()) { // it's not midnight anymore, reset hasAlreadyRun
                    hasAlreadyRun = false;
                }
                return false; // do not run again this midnight
            }
            if(isMidnight()) { // it's midnight and it hasn't run yet, so run it
                hasAlreadyRun = true;
                return true;
            }
            return false; // it's not midnight yet, so don't run it
        }
    }
#

then you could also later just replace isMidnight() with isCorrectTime() and supply hour and minute through the constructor to make it reusable

dry hazel
#

I would use a single-thread scheduled ES with something like executor.scheduleAtFixedRate(() -> { /* stuff */ }, initialMillisUntilMidnight, TimeUnit.DAYS.toMillis(1), TimeUnit.MILLISECONDS)

tender shard
#

sure that'd also work

#

but that'd break if the time changes

halcyon hemlock
#

nihaoma

dry hazel
tender shard
#

it'd run at 11pm once per year and at 1am once per year (at least in countries that have daylight savings time)

dry hazel
#

in that sense, yea

#

since it's plainly a 24-hour gap between the schedules

quaint mantle
quaint mantle
tender shard
#

that's exactly what's causing the above mentioned issue

halcyon hemlock
#

im curious, let's say you use an api that returns the current time to nano second, by the time the request is returned the the page, wouldn't it be de synced? then how would you sync it?

quaint mantle
#

That's what most people do

#

And it's kinda effective

lapis widget
#

Is there anyway to have a team account on spigot?

tender shard
#

create a new account and send an email to get it approved as alt account

quaint mantle
storm scaffold
#

Is there a way to make a player entirely invisible to another specific player, including armour, but without hiding them from tab?

chrome beacon
tender shard
#

the item is automatically removed if they pick it up?

orchid trout
#

any way to clean this up other than making a seperate method

tender shard
#

why is all that code more or less duplicated?

orchid trout
#

yeah

#

i made method

#

for repeating code

#

nw

#

i was asking if therewas a way to clean it up without doing this

#

volume and pitch

south mason
#

I'm writing a small plugin for the New Year and I want to add fireworks to it that will appear around the player, fly up a little and explode. It seems like I did everything, the fireworks don’t fly up but immediately detonate. How to fix it?

#

    private void spawnFireworkAroundPlayer(Location location, Player player) {
        Firework firework = location.getWorld().spawn(location, Firework.class);
        FireworkMeta meta = firework.getFireworkMeta();
        Location playerLocation = player.getLocation();
        Vector direction = playerLocation.getDirection().multiply(1.5);

        Random random = new Random();
        FireworkEffect effect = FireworkEffect.builder()
                .flicker(false)
                .withColor(Color.fromRGB(random.nextInt(256), random.nextInt(256), random.nextInt(256)))
                .with(FireworkEffect.Type.STAR)
                .trail(true)
                .build();

        meta.addEffect(effect);
        meta.setPower(100);
        firework.setFireworkMeta(meta);
        firework.setVelocity(new Vector(0, 1, 0));
        firework.detonate();
    }
tender shard
#

don't call detonate()

quaint mantle
#

I would also give random power and random detonate delay, so it gives a better effect

tender shard
#

also you should use the consumer method to set the FireworkEffect before spawning it

quaint mantle
#

^

tender shard
#

When you want to spawn a custom entity, e.g. with a custom name or certain items equipped, you must use the method World#spawn(Location, Class, Consumer) unless you give a shit about compatibility with other plugins. I’ll explain why. The shitty way Usually, you can easily spawn entities like this: That is fine, as...

#
location.getWorld().spawn(location, Firework.class, firework -> {
  firework.addEffect(effect);
});
quaint mantle
#

You can also remove brackets

location.getWorld().spawn(location, Firework.class, firework -> firework.addEffect(effect))
tender shard
#

btw you don't have to create a new random everytime

#

just create it once and reuse it

#

(or just directly use ThreadLocalRandom.current())

wraith dragon
#

its expensive to create rught

tender shard
#

yes

quaint mantle
#

You could also use Math.random and use multiplications

#

It gives a number between 0.1 and 1, so multiply it by 255

tender shard
#

ThreadLocalRandom is easiest as one can just keep using nextInt

south mason
#

I'm very bad at this.

tender shard
quaint mantle
south mason
#

thx

#

like this

    private void spawnFireworkAroundPlayer(Location location, Player player) {
        Firework firework = location.getWorld().spawn(location, Firework.class);
        FireworkMeta meta = firework.getFireworkMeta();
        Random random = ThreadLocalRandom.current();
        FireworkEffect effect = FireworkEffect.builder()
                .flicker(false)
                .withColor(Color.fromRGB(random.nextInt(256), random.nextInt(256), random.nextInt(256)))
                .with(FireworkEffect.Type.STAR)
                .trail(true)
                .build();

        meta.addEffect(effect);
        meta.setPower(100);
        firework.setFireworkMeta(meta);
        firework.setVelocity(new Vector(0, 1, 0));
    }
tender shard
#

yeah but you should still use the spawn method that takes a consumer

    private void spawnFireworkAroundPlayer(Location location, Player player) {
        location.getWorld().spawn(location, Firework.class, firework -> {
            FireworkMeta meta = firework.getFireworkMeta();
            Location playerLocation = player.getLocation();
            Vector direction = playerLocation.getDirection().multiply(1.5);

            Random random = ThreadLocalRandom.current();
            FireworkEffect effect = FireworkEffect.builder()
                    .flicker(false)
                    .withColor(Color.fromRGB(random.nextInt(256), random.nextInt(256), random.nextInt(256)))
                    .with(FireworkEffect.Type.STAR)
                    .trail(true)
                    .build();

            meta.addEffect(effect);
            meta.setPower(100);
            firework.setFireworkMeta(meta);
            firework.setVelocity(new Vector(0, 1, 0));
        });
    }
quaint mantle
# south mason like this ```java private void spawnFireworkAroundPlayer(Location location, ...
private void spawnFireworkAroundPlayer(Location location, Player player) {
        location.getWorld().spawn(location, Firework.class, this::applyFireworkMeta);
    }

private void applyFireworkMeta(final Firework firework) {
  FireworkMeta meta = firework.getFireworkMeta();
        Location playerLocation = player.getLocation();
        Vector direction = playerLocation.getDirection().multiply(1.5);

        Random random = ThreadLocalRandom.current();
        FireworkEffect effect = FireworkEffect.builder()
                .flicker(false)
                .withColor(Color.fromRGB(random.nextInt(256), random.nextInt(256), random.nextInt(256)))
                .with(FireworkEffect.Type.STAR)
                .trail(true)
                .build();

        meta.addEffect(effect);
        meta.setPower(100);
        firework.setFireworkMeta(meta);
        firework.setVelocity(new Vector(0, 1, 0));
}
south mason
#

Thanks a lot

quaint mantle
#

No thanks

#

$20

#

now

clever lantern
#

if i annotate a constructor with @Inject from guice, this class will be automatically instantiated or do i have to put in somewhore in module with @Provides

lost matrix
clever lantern
#

yes

lost matrix
#

Let me double check if there is a new way for this right now. But you can annotate your @Provides method with an additional @Singleton method.

#

Hmm. I thought you could annotate classes as singletons as well. Let me write a quick test for this.

trim elk
#

i have a problem, when i create an item with NBT API, it works fine, but if i change its slot, it stops working
it loses its tags
What could it be?

lost matrix
trim elk
#

I'll try to record it, but it's literally picking up the item using a command, opening the inventory and changing its position

#

when I got the customized item and changed the slot and tried to use it, it lost its references, but when I repeated the process and used it without changing the slot, it worked normally

undone axleBOT
#

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

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

lost matrix
#

And tell us the version as well while you are at it.

trim elk
#

lol

#

survival work normally

chrome beacon
#

Are you hiding the nbt tag from the client

lost matrix
#

Creative mode is mostly client authoritative. So the server has no saying about the items that are created by the client.

trim elk
#

So if it's on a normal survival server, the nbt will work normally? that's strange, but okay

lost matrix
#

Are you hiding the nbt tag from the client

trim elk
#

and how do you remove it? I don't remember doing anything like that

lost matrix
#

Intercepting packets

charred blaze
#

if i have config like this:

  1:
     somepropertieshere
  2:
     someofthatheretoo

will config.getStringList("arenas") return 1,2?

chrome beacon
#

no

lost matrix
#

Nope

chrome beacon
#

That's not a list

candid galleon
#

those are keys

charred blaze
#

hm so how do i make it return keys

chrome beacon
#

getKeys

#

(false)

charred blaze
#

false? wdym

remote swallow
#

getKeys(false)

candid galleon
#

false for shallow keys

#

immediate children

#

deep for keys of keys

charred blaze
#

ah ok

candid galleon
#

a:
b:
c:

#

i’ve never tried out what true returns

#

my guess is b.c

charred blaze
#

okay thanks <3

#

what is method to store multiple numbers ? like
numbers: 1,2,3 (i need it for coordinates)

#

will setting an arraylist work?

charred blaze
quaint mantle
#

yes

#

yes

charred blaze
#

so yes?

quaint mantle
#

yes

charred blaze
#

ok

#

int x = (int) config.getList("numbers").get(0);

#

can i get first number with this

remote swallow
#

if its an int list sure

chrome beacon
#

Teleporting with a player as the passenger usually doesn't end well

hazy parrot
charred blaze
charred blaze
chrome beacon
#

?tas

undone axleBOT
upper hazel
#

which enchantment is responsible for the effectiveness of the pickaxe

shadow night
#

Efficiency?

upper hazel
#

Why the name and their descriptions are not similar to minecraft enchantments...

upper hazel
#

not exists

chrome beacon
#

Because that's what they were called back in the day

#

DIG_SPEED is what you're looking for

#

iirc

charred blaze
remote swallow
#

yeah

upper hazel
#

thenks

paper rain
#

Do some1 know how to work with TabAPI?

chrome beacon
#

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

grim dock
#

What is the best way to give a player a prefix and name color that uses RGB Colors? I tried using Scoreboards and the prefix worked with RGB colors but the name color itself did not. Is there a way to do that?

quaint hedge
#

i have this code for send packets of NPC to the player:
public static void addJoinPacket(Player player) {
for (NPC npc : NPCs.values()) {
ServerPlayer serverPlayer = ((CraftPlayer) player).getHandle(), npcPlayer = npc.getEntityPlayer();

        serverPlayer.connection.send(new ClientboundPlayerInfoUpdatePacket(ClientboundPlayerInfoUpdatePacket.Action.ADD_PLAYER, npcPlayer));

        EnumSet<ClientboundPlayerInfoUpdatePacket.Action> actions = EnumSet.noneOf(ClientboundPlayerInfoUpdatePacket.Action.class);
        actions.add(ClientboundPlayerInfoUpdatePacket.Action.ADD_PLAYER);
        actions.add(ClientboundPlayerInfoUpdatePacket.Action.UPDATE_DISPLAY_NAME);
        actions.add(ClientboundPlayerInfoUpdatePacket.Action.UPDATE_LISTED);

        ClientboundPlayerInfoUpdatePacket playerInfoPacket = new ClientboundPlayerInfoUpdatePacket(actions, new ArrayList<>(Collections.singletonList(npcPlayer)));
        serverPlayer.connection.send(playerInfoPacket);

        ClientboundAddEntityPacket addEntityPacket = new ClientboundAddEntityPacket(npc.getEntityPlayer());
        serverPlayer.connection.send(addEntityPacket);
    }
}

but i get this error:
Cannot invoke "net.minecraft.server.network.PlayerConnection.l()" because "player.c" is null
at net.minecraft.network.protocol.game.ClientboundPlayerInfoUpdatePacket$Entry.<init>()

#

the problem looks like in the npcPlayer but i dont know what i do wrong

chrome beacon
quaint hedge
#

the packetreader looks ok

#

private Channel getChannel(Player player) {

    ServerGamePacketListenerImpl serverGamePacketListener = ((CraftPlayer) player).getHandle().connection;

    Channel channel;
    try {
        Field field = null;
        for (Field f : serverGamePacketListener.getClass().getFields()) {
            if (f.getType().equals(Connection.class)) {
                field = f;
                break;
            }
        }

        if (field == null)
            throw new AttributeNotFoundException();
        field.setAccessible(true);
        Connection c = (Connection) field.get(serverGamePacketListener);
        channel = c.channel;
        return channel;
    } catch (Exception e) {
        e.printStackTrace();
        return null;
    }
}

public void inject(Player player) {

    //Entity Player playerconnection, playerConnection network manager, Network manager channel
    channel = getChannel(player);
    channels.put(player.getUniqueId(), channel);
    System.out.println(player.getDisplayName() + " Added to pipeline");

    if (channel.pipeline().get("PacketInjector") != null) {
        return;
    }

    channel.pipeline().addAfter("decoder", "PacketInjector", new MessageToMessageDecoder<ServerboundInteractPacket>() {

        @Override
        protected void decode(ChannelHandlerContext channel, ServerboundInteractPacket packet, List<Object> arg) {
            arg.add(packet);
            readPacket(player, packet);
        }
    });
}
chrome beacon
#

So the answer is still no

#

You didn't even try?

quaint hedge
#

im trying like 4 hours. im still learning this its new for me

chrome beacon
#

Do what we told you to do yesterday

quaint hedge
#

i saw in FancyNPC his packetreader but the way he get the channel is different

quaint hedge
#

and i get the channel

#

im guessing the problem is still with the channel?

chrome beacon
#

An NPC does not have a connection

quaint hedge
#

but i dont use the NPC for the connection i use the player

#

and send him the packets

young knoll
#

Doesn’t matter

#

The game gets upset because the NPC doesn’t have a connection

quaint hedge
#

so how i send the packets to the player and summon the NPC?

chrome beacon
#

Make a dummy connection to the npc

quaint hedge
#

npcPlayer.connection
like that?

#

i still dont understand

#

i need to create connction between the player and the npc?

chrome beacon
#

no

#

You need to create a connection that voids packets

#

so it doesn't throw errors

quaint hedge
#

if its voids from packets i will i summon him?
can you write a example of the code? i think im missing something

chrome beacon
#

no I'm not going to spoonfeed you code

quaint hedge
#

i dont mean like that i just dont get it what i should write

#

i will ask a dummy questiom so i will understand from the basic

#

the connection that we talking what do you mean by create him?

#

i have ServerPlayer that he is the NPC and he have connection

chrome beacon
#

No your NPC does not have a connection

#

that's the whole issue

quaint hedge
#

so how do i create that?

chrome beacon
#

That's for you to figure out

quaint hedge
#

npcPlayer.connection = new ServerGamePacketListenerImpl();

#

like that?

chrome beacon
#

You're working with NMS so you can't expect support for it

quaint hedge
#

do i have another way without NMS?

chrome beacon
#

Use Citizens

quaint hedge
#

npc.connection = new ServerGamePacketListenerImpl(((CraftServer) Bukkit.getServer()).getServer(), new Connection(PacketFlow.SERVERBOUND), npc, new CommonListenerCookie(gameProfile, 0, ClientInformation.createDefault()));
i think i did it

quaint mantle
#

Use Citizens

quaint hedge
#

i want to create a NPC plugin

#

from zero

quaint mantle
#

Clone citizen github

chrome beacon
#

at this point you're just letting us create it for you

quaint hedge
#

thats not my point

#

im here to learn

chrome beacon
#

There is no difference between us making it and Citizens team making it

quaint hedge
#

sorry if it looks like that

chrome beacon
#

It's more like talking to a wall

#

I have to repeat the same thing 4 times

quaint hedge
#

ok so will stop asking

chrome beacon
#

Feel free to ask questions about design and problems

#

don't ask us to write it for you

quaint mantle
quaint hedge
#

i dont want you to write i just need someone to advise me someone who have more knowledge then me

quaint mantle
#

Citizens

ivory sleet
#

Isnt citizens open source?

chrome beacon
#

It is

quaint mantle
#

Is there an exception related to malformed data

#

In the java framework

#

Like for example a json object missing a bracket

native ruin
#

jsonexception i think

chrome beacon
#

Probably depends on the JSON library you're using

native ruin
#

javax.json is built in iirc

lean pumice
#
int line = Integer.parseInt(args[3]);

How i can detecte if is a args[3] is a number?

ivory sleet
ivory sleet
quaint mantle
ivory sleet
#

Well there is an exception you can catch around that

lean pumice
quaint mantle
#

like MalformedBodyException idk

ivory sleet
#

u have

Integer x = Ints.tryParse(argument);

chrome beacon
ivory sleet
#

if x == null //x is not a number

lean pumice
#

tnx

ivory sleet
#

I just gave you another way vedcodee

quaint mantle
lean pumice
quaint mantle
#

I feel like making it runtime, but I also think to a certain degree it is recoverable

ivory sleet
ivory sleet
#

generally speaking you wanna have unchecked if its the programmers fault or the consumers fault the exception occured

#

And checked if its an issue that’s not by u nor the end user

#

tho u have certain β€œexceptions” that are checked regardless

#

For instance when it comes to multithreading

quaint mantle
#

well the thing is

#

It's a Config system

#

So it's the users fault not the developers fault

ivory sleet
#

Prob unchecked

quaint mantle
#

yeah

#

I'll prob do that and document it

wet breach
ivory sleet
#

I mean if you read/write IO then it might be reasonable to have it checked

quaint mantle
#

Also I've never really seen people enforce their exception with a constructor containing good info

quaint mantle
wet breach
#

because the people who are actually good don't do this stuff for free or have the time to just go around making tutorials freely

ivory sleet
quaint mantle
#

oh like a low level exception being thrown

orchid crypt
#

[13:17:01] [User Authenticator #21/INFO]: UUID of player Mikthegmr is 5e81b352-495e-4871-84e6-a9a9b5d41df7
i look this up and its my friend but his invertory is untoched and mikthegmr doesnt even exist like wtf

#

i dont even know how to patch this

#

i added anticheat becc the same thing happened but with my username and hub was destroyed idk man im looking for a patch quick

chrome beacon
#

so what's the problem

#

I don't understand?

orchid crypt
#

i dont get how to fix this

chrome beacon
#

fix what

orchid crypt
#

i send logs to dm

icy beacon
orchid crypt
#

i fixed it

fickle mantle
#

Can anyone here help me? BuildTools still doesn't work

chrome beacon
#

Assuming Windows

fickle mantle
#

yeah i've done that already

kind hatch
fickle mantle
#

same exception, doesn't work

#

anything else I can do?

chrome beacon
#

Guess somethings interfering with the download

kind hatch
#

?paste your log

undone axleBOT
chrome beacon
#

Never seen that error before

fickle mantle
#

thats the error I got yesterday using Git bash, but that gui gives me the same exception

kind hatch
#

That's weird, the latest build is 4001, not 3999.

fickle mantle
kind hatch
#

Ohhh, it's an issue with the portable git download then.

#

Maybe try adding the link to your whitelist. https://github.com/git-for-windows/git/releases/download/v2.30.0.windows.1/PortableGit-2.30.0-64-bit.7z.exe

#

Should really make a flag that disables that download.

fickle mantle
chrome beacon
#

Windows Defender shouldn't block that

kind hatch
#

^

#

Although tag mismatch is usually something on the dev side. So maybe it got screwed up?

chrome beacon
#

I'd say somethings messing with the connection

#

causing ssl to break

#

but I'm just guessing

kind hatch
#

Maybe a VPN rule? Or you're just on a private network?

fickle mantle
#

I downloaded portable git and still get the exception

fickle mantle
#

have you got any other ideas what I could do? xD

kind hatch
#

You could maybe try using the https certificate skip flag. --disable-certificate-check

fickle mantle
#

nope doesnt work

kind hatch
#

You could also try moving the portable git you downloaded into the parent folder of BuildTools.

#

I think that's where it tries to look for it on Windows.

fickle mantle
kind hatch
#

It is

fickle mantle
#

yeah then I've already done that

kind hatch
#

Another thought is the directory it's currently running in may have certain permissions. Current Path: C:\Users\KleinBuli\AppData\Local\Temp\scoped_dir23464_196411674\.

Maybe try running that in C:\Users\KleinBuli\Downloads\BuildTools

fickle mantle
#

doesn't work either

rustic crown
#

Anyone know if the "don't use self-driving computers to access spigotmc.org" rule is still in effect? Like, can we publish resource updates from scripts yet?

summer scroll
#

Does anyone know on how to light a nether portal with code?

fickle mantle
#

Now I used Git Bash to run BuildTools again, It startet downloading and creating bukkit and spigot folders and got some files but stopped after 1 minute and gave me the same exception as always

quaint mantle
kind hatch
fickle mantle
summer scroll
tender shard
kind hatch
#

They are using 17

fickle mantle
#

Java 17, I downloaded the JDK thats recommended on the spigotmc website for 1.17 and above

tender shard
#

are you using some weird antivirus that does HTTPS MITM like kasperky?

fickle mantle
#

nope just windows defender

wet breach
tender shard
#

then no clue

fickle mantle
wet breach
#

if you have git installed then why are you worried about portable

kind hatch
#

Cause BuildTools always downloads it.

#

Just part of its process.

remote swallow
#

it downloads when not ran in gitbash

wet breach
upper hazel
#

enchantment "reclining" is KNOCKBACK in bukkit?

fickle mantle
#

because when I used the GUI, it crashed while downloading portable git. When I run BuildTools in git bash it just crashed after a minute of downloding spigot or bukkit

kind hatch
#

If you open up command prompt and run git --version, what's the output?

fickle mantle
#

git version 2.43.0.windows.1

kind hatch
#

Does sh do anything?

fickle mantle
#

doesn't exist

kind hatch
#

What about in gitbash?

fickle mantle
#

command not found

kind hatch
#

That would be why the BuildTools check fails then.

fickle mantle
#

Okay how can I fix this?

kind hatch
tender shard
fickle mantle
#

I entered sh in git bash

fickle mantle
frail pilot
#

If you try to git clone a repo inside git bash, does it fail ?

fickle mantle
#

I never used git before how do I do that

tender shard
#

git clone <linkToARandomGitHubRepo>

#

e.g. git clone https://github.com/SpigotMC/BungeeCord

kind hatch
#

@tender shard Does your gitbash recognize sh?

frail pilot
#

git clone https://github.com/SpigotMC/BungeeCord.git for example

frail pilot
#

x)

tender shard
kind hatch
#

Hmmm, maybe a bad install then? Or maybe one of the settings in the install wizard is what installs it?

fickle mantle
frail pilot
#

Well, there is clearly a problem with your internet connection

tender shard
fickle mantle
#

My wifi connection disconnects when I'm not on a minecraft server, in a valorant/fortnite/csgo match...

#

or downloading something

frail pilot
#

Well

sterile flicker
#

How to Set Weather to Snow?

shadow night
#

By setting biome to snow ig

tender shard
#

snow is just rain in snowy biomes

sterile flicker
fickle mantle
#

is it possible that somebody just sends me the spigot.jar thats created by buildtools? I need it for nms

kind hatch
#

That won't work.

frail pilot
tender shard
fickle mantle
#

didn't change anything

kind hatch
kind hatch
#

Did you truly wipe it before you reinstalled it?

ocean hollow
#

how can I make it so that there is no PlayerInteractItem every tick? I mean that in one click the event is executed 2-3 times

frail pilot
fickle mantle
kind hatch
#

Uninstalling programs does not always result in all files being erased. You'd need to run some cleaning tools to get rid of everthing.
Plus, now that I'm thinking about it, git messes with your PATH environmental variable. It could also be that.

fickle mantle
#

isn't there any other way to use nms?

sterile flicker
kind hatch
sterile flicker
#

raining

#

i have player.setPlayerWeather(WeatherType.DOWNFALL);

tame wolf
sterile flicker
#

without y?

#

ok

frail pilot
kind hatch
tender shard
#

idk if they include the mappings etc too

frail pilot
tender shard
#

tbh I'd just install debian in a VM, run buildtools there, then copy the .m2 folder

fickle mantle
#

I tried on my other SSD and there it worked

#

I'll try running BuildTools on that ssd

tender shard
#

your system is cursed lol

frail pilot
#

x)

kind hatch
#

lol

sterile flicker
kind hatch
#

Drive permissions are a thing, but do they interfere with connections?

frail pilot
#

From a SSL exception to a hard drive problem

kind hatch
#

That's what I was thinking, but what if it was a network drive?

fickle mantle
#

nope buildtools won't work

frail pilot
#

Well

#

Based on previous result

#

Spam the BuildTools

#

With some luck

#

It will succeed to clone each repo

#

And then run

#

You managed to get 3 repo in one of your try

fickle mantle
#

it deletes the folders when I restart it

kind hatch
#

Run this once you have all the repos downloaded. java -jar BuildTools.jar --dont-update

fickle mantle
#

doesn't work

frail pilot
#

If you try to clone the BungeeCord repo on your ssd, does it still work ?

kind hatch
#

Did you include the --rev flag? Cause if so, remove it.

frail pilot
#

Definitly cursed

kind hatch
#

100%

frail pilot
#

Ok

#

Try to clone the spigot repos by hand and compile without the build Tools

kind hatch
#

--rev and --dont-update are incompatible flags. That's why you can't use them together. (Although they are not really, I'm working on getting that removed. :))

frail pilot
#

I don't know if there is any documentation of the Build process that the BuildTools follow

#

If there is not, just look at the source file and do each step yourself

kind hatch
#

The links won't be in the source code. It will be on the maven repo. nvm, I'm just dumb

#

1 sec

fickle mantle
#

like craftbukkit.git, bukkit.git and everything

kind hatch
#

These are the links you need.

frail pilot
#

Those are the repo you need to clone

fickle mantle
#

$ git clone https://hub.spigotmc.org/stash/scm/spigot/builddata.git
Cloning into 'builddata'...
remote: Enumerating objects: 568, done.
remote: Counting objects: 100% (120/120), done.
remote: Compressing objects: 100% (120/120), done.
error: RPC failed; curl 56 OpenSSL SSL_read: OpenSSL/3.1.4: error:0A000119:SSL routines::decryption failed or bad record mac, errno 0
error: 53271 bytes of body are still expected
fetch-pack: unexpected disconnect while reading sideband packet
fatal: early EOF
fatal: fetch-pack: invalid index-pack output
that doesn't work

frail pilot
#

On your SSD ?

fickle mantle
#

yeah

#

spigot, bukkit and craftbukkit work

frail pilot
#

Try to download it with firefox or smth

fickle mantle
#

okay what do i do now?

kind hatch
#

Move all of those downloaded folders into one.

fickle mantle
#

yeah

kind hatch
#

Then put BuildTools in that same folder and run it with java -jar BuildTools.jar --dont-update

#

If that fails, then it's a system issue.

fickle mantle
#

it failed

frail pilot
#

x)

fickle mantle
#

wait

#

but i think i know

#

Exception in thread "main" org.eclipse.jgit.api.errors.JGitInternalException: Destination path "BuildData" already exists and is not an empty directory at org.eclipse.jgit.api.CloneCommand.verifyDirectories(CloneCommand.java:254) at org.eclipse.jgit.api.CloneCommand.call(CloneCommand.java:166) at org.spigotmc.builder.Builder.clone(Builder.java:1140) at org.spigotmc.builder.Builder.main(Builder.java:377) at org.spigotmc.builder.Bootstrap.main(Bootstrap.java:27)

#

nope i dont know

frail pilot
#

Well

fickle mantle
#

but i can't delete the things in the Builddata folder?

frail pilot
#

It's basically saying that there is no git history

#

Which is logic because you downloaded the repo instead of cloning it

#

Nop

#

You need it

#

Well

#

You can enter each command that the BuildTools run

#

x)

fickle mantle
#

but why can't I clone builddata?

frail pilot
#

Internet connection I guess

#

Maybe there is files that are too heavy for your connection

fickle mantle
#

wow

frail pilot
#

BuildData contains binary

#

And the other just source code

kind hatch
#

The largest one being 10MB

fickle mantle
#

my connection isn't that slow

#

and not that bad

#

with downloading i've never got any issues

frail pilot
#

Is your connection stable ?

fickle mantle
#

right now yeah because i'm afk on a minecraft server lol

#

if I'd disconnect my connection would crash in like 20secs and I had to reconnect

kind hatch
#

I remember my last internet connection being somewhat unstable, but things would recover. It was like burst internet. Fucking terrible, but it could get the job done.

fickle mantle
#

yeah i've got that issue since 2020

kind hatch
#

Who's your provider?

fickle mantle
#

Vodafone ig

kind hatch
#

Tethering?

tender shard
#

it's definitely some issue related to SSL

fickle mantle
storm raven
#

Hey, I have a problem about add Vault API in my plugin because when I build my plugin, I have error:

package net.milkbowl.vault.economy does not exist

or, I add Vault in my library :

storm raven
#

yes but if I add like this, I have another error

tender shard
#

be?

storm raven
#

Invalid content was found starting with element '{"http://maven.apache.org/POM/4.0.0":repositories}'. One of '{"http://maven.apache.org/POM/4.0.0":parent, "http://maven.apache.org/POM/4.0.0":url, "http://maven.apache.org/POM/4.0.0":inceptionYear, "http://maven.apache.org/POM/4.0.0":organization, "http://maven.apache.org/POM/4.0.0":licenses, "http://maven.apache.org/POM/4.0.0":developers, "http://maven.apache.org/POM/4.0.0":contributors, "http://maven.apache.org/POM/4.0.0":mailingLists, "http://maven.apache.org/POM/4.0.0":prerequisites, "http://maven.apache.org/POM/4.0.0":modules, "http://maven.apache.org/POM/4.0.0":scm, "http://maven.apache.org/POM/4.0.0":issueManagement, "http://maven.apache.org/POM/4.0.0":ciManagement, "http://maven.apache.org/POM/4.0.0":distributionManagement, "http://maven.apache.org/POM/4.0.0":dependencyManagement, "http://maven.apache.org/POM/4.0.0":pluginRepositories, "http://maven.apache.org/POM/4.0.0":reports, "http://maven.apache.org/POM/4.0.0":reporting, "http://maven.apache.org/POM/4.0.0":profiles}' is expected.

tender shard
#

?paste your pom

undone axleBOT
storm raven
#

I send

#

do you see ?

kind hatch
#

Paste the link

tender shard
#

well you gotta send the link here

storm raven
tender shard
#

you have repositories and dependencies declared twice

eternal oxide
#

http?

tender shard
#

you have to "merge" it

storm raven
#

where ?

#

what line ?

tender shard
kind hatch
#

Into one section

tender shard
#

you got <repositories> twice and <dependencies> twice

kind hatch
#

Only one <repositories> tag and only one <dependencies> tag per pom file.

storm raven
#

can you edit the file to send it back to me

fickle mantle
frail pilot
fickle mantle
#

yeah but clone command doesnt work :c

frail pilot
#

Yeah I know

tender shard
sterile flicker
storm raven
#

yes but I have another error again

Dependency 'com.github.MilkBowl:VaultAPI:1.7' not found

kind hatch
#

Reload your pom

tender shard
# storm raven yes but I have another error again ```Dependency 'com.github.MilkBowl:VaultAPI...

Sometimes, people suggest you to change something in your pom.xml, and then IntelliJ starts to complain: That is totally normal. You simply have to click the β€œmaven reload button” in IntelliJ. Maven will then continue to download the required dependency/plugin, if it’s available. After a few seconds, everything should be fine. You can find the.....

kind hatch
storm raven
#

on yellow

tender shard
#

you can ignore that

storm raven
#

okay

tender shard
#

alternatively, read the comments in the blog post if this bothers you

fickle mantle
tender shard
storm raven
#

and I can use a vault API now ?

kind hatch
#

Yes

storm raven
#

thanks, you're so nice πŸ˜‰

tender shard
storm raven
#

bye

tender shard
#

i'm pretty sure that if you just run biuldtools in a debian VM, it'd work fine

fickle mantle
#

Okay, I'll install a vm then

kind hatch
#

Do you even need a VM? Can't WSL transfer files?

fickle mantle
#

the only thing i wanna do is creating a packet scoreboard because i wanna learn to code with nms, im dying istg

kind hatch
#

You don't need nms for that.

#

The scoreboard API was added a long time ago.

tender shard
#

well but they said they wanna learn to code with nms

kind hatch
#

Oh, mb

tender shard
#

if it compiled fine on debian, just copy the contents of /home/yourname/.m2/repository into the windows folder

#

and that's it

fickle mantle
#

actually I've always used packet scoreboard (a code of a friend) because I've always have been to stupid to make a tablist prefix and a non-flickering (idk if this is the right english word) sidebar at the same time

#

So my plan was to code the packet scoreboard myself

quiet ice
patent socket
#

Is there an efficient way to fill a preset area with lava, like the /fill command?

tender shard
quiet ice
#

technically vault should just get rid of this dependency since it isn't being used anywhere, but whatever

patent socket
#

A 96*96 area, 1 block tall

tender shard
#

i'd just use the api and iterate over the coords

#

96x96x1 isn't much

#

i'd just use Block#setType(Material, false) on each block

#

(unless you need physics ofc)

patent socket
tender shard
#

physics = e.g. checking if a torch is about to break, if sand is about to fall, etc bla bla

vale nebula
#

I'm trying to run a very large tellraw command using the bungeecord API. Starting with build 1760 I get this error. net.md_5.bungee.protocol.OverflowPacketException: Cannot send string longer than 32767
Is there a way to disable this check or alternative way of sending large jsons to the client?

lapis spade
#

Hello everyone, I have a problem with version 1.20.4. All the plugins where I used to register enchantments broke. How can I do to fix it? Is there a link or a post where this has already been discussed?

rotund ravine
#

Use PDC instead of adding enchantments

tender shard
#

yeah you weren't supposed to extend Enchantment in the first place

late sonnet
#

yeah... but think about migrate from that to PDC and avoid broke all.... things for the Doc from the future because has the same issue xd

tender shard
#

it'll however lead to issues when using removeEnchantment on the keyed one, as the server tries to cast the Enchantment to CraftEnchantment (which this class obviously does not extend)

quiet ice
#

What exactly is the difference between those two versions?

remote swallow
#

is enum E-Num en-um

late sonnet
#

with the time i hope mojang allow create custom enchantments...

tender shard
quiet ice
#

Ah I see

#

I personally don't do custom enchs that way, so thankfully I am not impacted

tender shard
#

Yeah i only have this to give glow effect

late sonnet
#

i blame the firsts tutorials i see where show that method xd

quiet ice
#

Well I only do it the way I did because that was what my predecessor did

river oracle
quiet ice
#

Though uh, I do it arguably worse than the recommended way as I store my enchantments in lore by default

river oracle
#

so annoying

#

I hope one day mojang allows custom enchants

lapis spade
#

Could you point me to a link to an example of someone using PDC to take a cue from?

quiet ice
#

Though I have an option to store it in the PDC if anyone really wishes to change the default

late sonnet
#

yeah if mojang allow that can reduce many custom code xd

rotund ravine
#

?pdc

tender shard
# lapis spade Could you point me to a link to an example of someone using PDC to take a cue fr...

or: Why you should NEVER use NBT tags again! Spigot 1.14.1 added the biggest improvement that (in my opinion) ever made it into the Bukkit API: The Persistent Data Container (PDC). It can be used to store custom data on Entities, TileEntities, and ItemStacks. Using a bit of math, it can also be used to...

river oracle
late sonnet
#

yeah i need migrate to PDC and try to check how migrate the old enchantments because in nbt still exists to the PDC or reset... the plugin is for a survival with people then can wait and reset the entire world for avoid migrate and reset all enchantments xd

tender shard
late sonnet
river oracle
late sonnet
river oracle
#

we have no clue how long they are going to keep stuff unsynced between client and server

#

it could be years still

late sonnet
tender shard
#

alternatively you can fiddle with reflection to create the ENchantment object dynamically. but it'd still fail when calling removeEnchantment if it's not in the registry (bukkit2minecraft method in the CraftEnchantment class or whereever it was again)

late sonnet
tender shard
#

to make that work you'd really have to extend the CraftEnchantment class (so one module per nms version πŸ₯² )

river oracle
#

You know what's wild though the fact the Brewing Stand still doesn't have custom recipes

#

mojang still has everything hard coded

tender shard
minor junco
late sonnet
river oracle
#

new SecureRandom() πŸ’ͺ

minor junco
#

well nah, it just avoids allocating a new random xd

tender shard
#

the anvil will probably just strip the whole enchantment tag without checking any specific enchantment

late sonnet
tender shard
#

yeah the enchantment change is a huge pain

#

but not in the ass

river oracle
#

where is it a pain at

late sonnet
#

i mean i can use a library... but that make me depend in another developer and reduce how many custom things can do... but in the other hand.. i need time xd

#

like the time for my PR related to Damage API

late sonnet
# minor junco What do you need?

make the enchantments work in last version (not need work in past versions but need if exists items with the old enchantments system migrate to the new)

tender shard
# river oracle where is it a pain at

extend Enchantment, register it. Works fine. Now call removeEnchantment with your enchantment and see it fail because spigot tries to cast your enchantment to CraftEnchantment

minor junco
#

I don't really know the specifics, but couldn't you test against the server version and flow accordingly

tender shard
river oracle
#

it'll only break once mojang syncs

#

but at the point where they do sync you'll have hopefully an easier alternative to register

tender shard
#

spigot should include a dummy glow enchantment tbh

#

@worldly ingot do you think a pull request for a dummy enchantment would get merged, so that people can give a glow effect to their custom PDC enchantments?

worldly ingot
#

Doubt it

tender shard
#

hm then what's the proper way to make items look enchanted using API

late sonnet
#

exists a OLD JIRA for the glow thing..

#

if that was not harcoded can be easy create a good method rather than add a dummy enchant

worldly ingot
tender shard
#

yeah i dont care how it works, I just wanna be able to give the enchantment look to items without NMS lol

worldly ingot
#

We're on the server after all

tender shard
worldly ingot
#

ItemFlag.HIDE_ENCHANTS

tender shard
#

then it wouldnt show other enchantments

worldly ingot
#

Like I said, we're working on the server. We can only do so much

tender shard
#

spigot could just include a dummy enchantment

worldly ingot
#

That might work now, no guarantee it will work in the future. It's undefined behaviour of the client that we shouldn't be adding API for

tender shard
#

rip

#

yeah I guess that's a valid reason not to include it

#

still, sad

undone axleBOT
worldly ingot
#

PES2_Pray Mojang adds an NBT tag to show an item glint

fickle mantle
#

How can i give a Scoreboard Team a custom color with for example ChatColor.of(new Color(177, 5, 5, 216)) ?

worldly ingot
#

You can't. Scoreboard teams only support the 16 standard colours

#

Vanilla limitation, unfortunately

fickle mantle
#

mh, i thought i saw some other servers have this feature

chrome beacon
worldly ingot
#

You can give arbitrary colours to a team's prefix, which would change their nameplate

#

The team colour itself cannot be RGB though

fickle mantle
late sonnet
patent socket
# tender shard i'd just use Block#setType(Material, false) on each block

Ok so when doing this after a player executes the command, I'm using this: blocation.getBlock().setType(Material.LAVA); However, the blocation location variable needs a world for the location. How could I get the world from the command sender? I'm currently doing this, which returns an error: Entity player = Bukkit.getPlayer(String.valueOf(sender)); World world = player.getWorld();

tender shard
#

check if the sender is instanceof Player, if not send an error message, if yes cast it to Player

patent socket
worldly ingot
#

It’s on my list

late sonnet
late sonnet
quaint mantle
tender shard
#

returning false would show the command's usage message

fickle mantle
#

How can I give every player their own scoreboard?

tender shard
#

ScoreboardManager#createNewScoreboard or sth

fickle mantle
#

if(player.getScoreboard().equals(Bukkit.getScoreboardManager().getMainScoreboard())) { player.setScoreboard(Bukkit.getScoreboardManager().getNewScoreboard()); }
i used this but this doesn't work

tender shard
#

why are you comparing it against the main scoreboard? you're also never saving the new scoreboard anywhere

fickle mantle
#

I post my code wait

quaint mantle
#

Remove the if statement

echo basalt
#

bro made a wrapper class

#

not sure how to feel about this

fickle mantle
#

Now only the last player that joins gets the scoreboard, the scoreboard of the 1st player gets removed

quaint mantle
#

Because u are removing the scoreboard

#

You need only 1 scoreboard

fickle mantle
#

where do I remove it?

quaint mantle
#

You should call Bukkit.getScoreboardManager().getNewScoreboard() only once

#

And save it

orchid trout
#

why does it say that onplayrlogin isnt being used

patent socket
#

is there a way to set a World variable to the overworld without detecting the world from a player?

late sonnet
orchid trout
#

yeah

#

nvm

late sonnet
#

its a IDE thing.. because the method is not being used directly... this ignore the logic of the annotation

tender shard
#

you only use the constructor arg

whole surge
#

Hello.
How can I create brewing stand reciepe that require no fuel/make so doing stuff in brewing stand would trigger brewing animation?

clever lantern
#

what attribute to use so it only says in main hand
in the img i used [Attribute.GENERIC_ATTACK_DAMAGE]

clever lantern
#

i dont see setSlot

remote swallow
#

its on the constructor

clever lantern
#

ah ok ty

#

btw what is the first arg

#

id of attribute you that you set?

#
                UUID.randomUUID(),
                "GENERIC_ATTACK_DAMAGE",
                additionalDamage,
                AttributeModifier.Operation.ADD_NUMBER,
                EquipmentSlot.HAND
        );```  i do this rn
quaint mantle
#

Is there any event that checks if a Block is placed/destroyed via command?

quiet ice
tender shard
quiet ice
#

.

tender shard
#

ah I see

quiet ice
#

Took a while to find. Seems like that hack is rather unknown

tender shard
#

that'd however break if one adds an enchantment and then removes it again

quiet ice
#

yeah I suppose that is correct

chrome beacon
#

anyways system path dependencies are deprecated

#

you should just install the jar in to your maven repo

peak depot
#

whats in your guys opinion is the best way to make sure paid plugins arent just given away from 1 guy that paid for it?

quiet ice
#

Yeah I know. Just wanted to look whether I could add that as a source underlying that system scopes are bad. But obviously I wouldn't want to add an invalid/out of date source there - would I?

quiet ice
chrome beacon
#

You can always go open source with paid support like Citizens uwu

quiet ice
#

Yeah exactly

tender shard
#

still it's working fine for me on maven 3.6.3

quiet ice
#

Though I mean realistically I could add any source I want, it's not like anyone who reviews my paper will have any idea on how the maven resolver yet alone the java ecosystem as a whole works.

tender shard
quiet ice
tender shard
#

use 7.2.18

quiet ice
#

Oh wow, alex figured out how to use a maven repository manually

tender shard
#

is this a joke or sth lol

quiet ice
#

I am genuinely surprised since few know about that you can use the online index

tender shard
quiet ice
#

yeah

tender shard
#

mod_autoindex πŸ₯²

#

does nginx even support that

#

ah yeah it does but it's off by default

quiet ice
#

I dunno. I've been using lighttpd's mod_dirlisting module for this

eternal oxide
#

sacked

tender shard
#

well then check the repo

#

you yourself sent a screenshot of worldedit

#

i mean the pom.xml you sent includes worldedit

quiet ice
#

Well there we have your issue, your artifactid was wrong

tender shard
#

worldguard is indeed 7.0.9 latest

storm raven
# tender shard since you don't shade vault, it's not an issue

sorry but in my code, I put :

        if (entity.getType() == EntityType.CREEPER){
            if (EthernaPl.getInstance().setupEconomy()) {
                player.sendMessage(Config.plugin.getConfig().getString("EntityDeath.message.creeper"));
                EthernaPl.getInstance().economy.depositPlayer(player, 3);
            }
        }```

but when I kill creeper, I don’t earn my money and I don’t have my message in my chat
quiet ice
#

what does your setupEconomy method do?

sturdy heron
#

can you make a localhost auto download newest spigot release (i'm hosting through intellij)

storm raven
#
    public Economy economy = null;



public boolean setupEconomy() {
            RegisteredServiceProvider<Economy> economyProvider = getServer().getServicesManager().getRegistration(Economy.class);
            if (economyProvider != null) {
                economy = economyProvider.getProvider();
            }

            return (economy != null);
        }```
sturdy heron
quiet ice
#

Though uh honestly, that this should work even though it is horribly inefficent

quaint mantle
#

The method is from VaultAPI.

#

It isnt self coded

quiet ice
storm raven
quaint mantle
#

No

quiet ice
#

You listen to it like any other bukkit event

quaint mantle
storm raven
#

So what should I put instead of her?

quaint mantle
#

Not everytime a mob is killed

quiet ice
#

Yes, but not in the constructor

#

Everythign but the constructor

quaint mantle
#

The java onEnable

#

I mean that with constructor

#

Ik that it isnt the constructor

quiet ice
#

You need to do it on the first tick

#

At the earliest

quaint mantle
#

Then just do new BukkitRunnable

#

It would run at first tick

orchid trout
quiet ice
#
public class EconomyListener implements Listener{
  private MyPlugin plugin = JavaPlugin.getInstance(MyPlugin.class);

  @EventHandler
  public void onEvent(ServiceRegisterEvent evt) {
    RegisteredServiceProvider rsp = evt.getProvider();
    if (rsp.getService() == Economy.class) {
      // Technically you need to invoke rsp.compareTo() but that is an exercise left to the user
      plugin.setEconomy(rsp.getProvider());
    }
  } 
}
storm raven
quiet ice
# orchid trout why

Because otherwise you risk that the economy registers after your plugin initialized

eternal oxide
steel swan
#

hey, i have protocolLib installed, as u can see by the fact that i can invokeProtocolManager and ProtocolLibrary, but i cant get the CraftPLayer, why?

quiet ice
#

Yeah right, you also need to query the RSP

#

@storm raven Just to make sure, you have an economy installed on your server, right?

quaint mantle
quiet ice
#

Vault alone does not suffice

storm raven
#

yes I have the vault plugin

quiet ice
#

And what is your economy implementation/provider plugin?

storm raven
#

I have vault and essentialsX

quaint mantle
#

🀒

steel swan
quaint mantle
#

If you need craftplayer then you need nms

quiet ice
#

?stash

undone axleBOT
storm raven
quiet ice
#

Let's just say I'm preoccupied

orchid trout
#

youre better off not using essentials or vault and making your own economy

quiet ice
#

Jesus

orchid trout
#

uh

#

did i say something racist?

quiet ice
storm raven
#

?pom

undone axleBOT
#

Please paste your pom.xml file, or build.gradle (or build.gradle.kts) if you're using gradle on the following website: https://paste.md-5.net/

storm raven
quiet ice
orchid trout
#

ok

tender shard
storm raven
tender shard
#

so what does setupEconomy return?

quiet ice
#

Do you know whether your event handler gets called in the first place?

eternal oxide
#

so long as you depend on vault (plugin.yml) your setUpEconomy() will work fine

storm raven
tender shard
#

what does it return?

eternal oxide
#

IF you are referencing the same Economy Field in all your code

tender shard
#

true or false?

storm raven
#

return (economy != null);

quiet ice
#

I think it never gets called, that is the issue

storm raven
#

true, no ?

quiet ice
storm raven
#

!= null = true

tender shard
storm raven
#

no ?

quiet ice
#

It can return false if it is null

#

Why that would be the case is up in the air.

#

Basically what alex wants is a temporary System.out.println(economy);

storm raven
#

basically, I mark what

quiet ice
#

Could you send us the EntityDeath class?

tender shard
#
        System.out.println("Listener called");
        if (entity.getType() == EntityType.CREEPER){
            System.out.println("It's a creeper");
            if (EthernaPl.getInstance().setupEconomy()) {
                System.out.println("Eceonomy is working");
                player.sendMessage(Config.plugin.getConfig().getString("EntityDeath.message.creeper"));
                EthernaPl.getInstance().economy.depositPlayer(player, 3);
            }
        }

add some debug prints ^

#

then check what it prints

storm raven
#

okay, I try

#

and I kill creeper

tender shard
#

try it

quaint mantle
#

You will get useless warnings everytime

tender shard
#

not really

quaint mantle
tender shard
#

no

quaint mantle
#

When i use it gives warnings to not use it

tender shard
#

then you're not using spigot

quaint mantle
#

Oh right this is spigot

#

Not papur

quiet ice
tender shard
#

also who cares aobut those warnings if it's just for debugging

minor junco
#

I mean if it's for debugging purposes sout is completely fine no

storm raven
tender shard
quiet ice
#

And with SLF4J logger I mean LoggerFactory.getLogger(getClass()).info(...)

quiet ice
fickle mantle
#

does anyone here have a code for a Scoreboard System for 1.20 with a Sidebar + Tablist Prefix. The Sidebar should be unique for each player. I've been trying to code this for hours, but nothing works

storm raven
storm raven
tender shard
fickle mantle
#

I've tried my own code, I've tried multiple codes from youtube. With every code, the scoreboard disappears for the 2nd player

storm raven
#

my listener is called no ?

tender shard
#

obviously not, if it doesn't print anything

storm raven
quiet ice