#help-development

1 messages · Page 1482 of 1

quaint mantle
#

Hello so i am making a permission plugin and i would like to make it so when they are in a group it displays their group prefix in front of there name how would i do that

tardy delta
#

@eternal oxide why were we saving in the pdc of a chunk again?

sullen marlin
#

because individual blocks dont have a pdc

#

only chunks and tile entities do

#

doors are not tile entities

quaint mantle
#

?paste

quiet ice
#

?paste

queen dragonBOT
quiet ice
#

Verify for commands

quaint mantle
#

Oh lol

tardy delta
#

ow yea

quaint mantle
quiet ice
#

I recommend you getting Java 16

sullen marlin
#

e.getItem might be null

quaint mantle
#

i am new so lmao

kind coral
#

idk how to formulate this, any help ahah
so i am trying to like have 10 levels ok?
and starting stat is 20
and ending stat is like 800
how can i make it so that each level it increases by a right amount? idk if i explain myself

sullen marlin
quiet ice
#

It has better NPE message (it tells you what exactly is null) and it is required for Minecraft 1.17

quaint mantle
#

i am using 1.12.2

quiet ice
#

a

sullen marlin
#

as for why it doesnt really work, one issue is that you only make them fly if cooldowns.containsKey which it never will the first time

#

you need to revisit your logic a little

quaint mantle
#
if (!(cooldowns.containsKey(p.getUniqueId().toString()))){
cooldowns.put(p.getUniqueId().toString(), System.currentTimeMillis());
}
#

like this?

#

before cooldowns.containsKey

ivory sleet
#

You could do some trivial event listening (using AsyncPlayerChatEvent).

vital ridge
#

How could I start runnables per entity and stop them per entity? So entitys have their own runnables. Im trying to use hashmaps but not rly working it out

#

since stopping the runnables is not working as it should

#

and the runnables still keep going

ivory sleet
#

Oh yeah Nuxoria what do you have as of now?

vital ridge
#

Okay basically i have a plugin what spawns chicken with a command

#

the chicken starts running towards you

#

when the chicken gets close enough he dissappears and the runnable stops

#

now every chicken should have a runnable which constantly checks for the distance

#

and then stops it if distance is close enough

#

ill send some code i hope you bother to read through it lol

ivory sleet
#

Yeah

sullen marlin
#

honestly it might be easier for you to just have 1 runnable that checks all chickens

vital ridge
#

Ik but I always get stuck with this stuff

#

per entity or player runnables

#

so Id just like to finally solve my problem

#

?paste

queen dragonBOT
vital ridge
ivory sleet
#

I think you get stuck on the destruction process.

sullen marlin
#

the problem is you have static

vital ridge
#

Here im putting my data into the runnab le

sullen marlin
#

the problem with static is it means you can only have one

#

remove all the statics and then you can do new ChickenRunnable() for eachj chicken

vital ridge
#

And her eim calling my constructor

ivory sleet
#

As md5 said you should probably work more object oriented here not using static excessively.

sullen marlin
#

yeah

vital ridge
#

qall the statics?

sullen marlin
#

you need to remove all the statics

vital ridge
#

so chicken runnable will ask for chicken parameter?

#

And ill get rid of the static?

sullen marlin
#

yes

vital ridge
#

Okay ill try to get rid of all statics

ivory sleet
vital ridge
sullen marlin
#

all the classes

#

none of the classes you pasted should have static

toxic mesa
#

So i might be rlly stupid but can anyone explain to me why this returns 4 empty lines?

        if (block.getState() instanceof Sign) {
            Sign sign = (Sign) block.getState();
            String lines[] = sign.getLines();

The sign is filled with stuff, and this ^^ is called on SignChangeEvent.
What am I doing wrong?
(version= 1.16.5)

vital ridge
#

but like the getter methods

sullen marlin
#

getState will return the OLD sign

#

event.getLines returns the NEW lines

toxic mesa
#

Ahh okay tysm

sullen marlin
#

this but static

severe folio
opal juniper
#

That’s a point

vital ridge
#

ent.getworld.spawnparticle imo is spawning it only for the ent

#

so others cant see it

sullen marlin
#

no it isnt

vital ridge
#

it isnt?

#

I once had a problem

#

with that

#

where particle spawned for ent

#

only

#

not sure what method i used then

sullen marlin
#

that would be Player.spawnParticle

vital ridge
#

oh yea

#

yea

river shell
#

Still looking for an experienced developer, willing to pay your worth. Get in contact with me.

chrome beacon
#

?services

queen dragonBOT
river shell
#

I can't post there unfortunately

ivory sleet
#

Easiest way would be to listen for player move event and then check if a past position is the same as a current one, if that’s the case then start a runnable to take the time.

chrome beacon
river shell
#

I'm sure that being paid is nicer than a little rule broken on the server in pursuit of hiring someone!

#

I'll take someone who is good with Java/MC devt. and doesn't mind too much that I asked here

ivory sleet
#

You should still do it on the right place aka what olivo linked you, this channel is made for assisting development, not for recruiting developers or anything.

river shell
#

To be honest right, the requirement on the forums is making 20 posts, before I can ask to hire someone. I don't really have a reason to talk to anyone on the Spigot forums, other than hiring.

#

So I've either got to make 20 spammy non-contributory posts on spigot

#

Or just quickly try my luck here, yknow

ivory sleet
#

Can we just not go over this

river shell
#

I've already messaged a spigot mod to see if they will make an exception on the 20 posts rule for me to no avail unfortunately

#

Sure!

#

You were just engaging with me, that's all

ivory sleet
#

I have some other discords which have request services channels if you’re interested. This is still not the right place bud

river shell
#

will respond to your PM thanks

tardy delta
#

you said to store a hashmap of players uuids against location keys. but how can i get the location of the block? is that
Block b = event.getClickedBlock() . something to get location?

eternal oxide
tardy delta
#

uh i'm trying to storing it inside a hashmap and check for the lock that way

eternal oxide
#

you are scrapping the PDC and saving the data yourself?

tardy delta
#

uhh

#

idk if im scrapping it

eternal oxide
#

You are if you are changing to a hashmap

#

You are literally asking the exact same questions for days.

tardy delta
#

im trying to make it more simple

eternal oxide
#

um, the code I showed you is as simple as it could get. Using the PDC does everything for you, no database, no saving/loading. It seriously can;t get any simpler

tardy delta
#

well at least i can change the system.out.println to something better

stiff topaz
#

Im having issues with importing Votifier...

pom.xml:
||```xml
<repositories>
<repository>
<id>spigotmc-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
<repository>
<id>sonatype</id>
<url>https://oss.sonatype.org/content/groups/public/</url>
</repository>
<repository>
<id>jitpack</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.16.5-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.vexsoftware</groupId>
<artifactId>nuvotifier-universal</artifactId>
<version>2.6.0</version>
<scope>provided</scope>
</dependency>
</dependencies>

||
Usage:
||```java
    @EventHandler
    public void onVotifierEvent(final VotifierEvent e) {
        Vote vote = e.getVote();
        System.out.println(vote.getUsername() + " has voted on " + vote.getServiceName());
    }
```||

Error:
||```diff
-The POM for com.vexsoftware:nuvotifier-universal:jar:2.6.0 is missing, no dependency information available
```||
eternal oxide
#

Yes, that was fully working sample code, but you need to do the messaging how you want

ivory sleet
#

?paste

queen dragonBOT
coral sparrow
ivory sleet
#

Thanks (:

wraith rapids
#

strange that elgar doesn't have the helper role

opal juniper
#

u had to apply

wraith rapids
#

oh

eternal oxide
#

I'm too grumpy in my old age to put a target on my back.

wraith rapids
#

interesting that the helper role has perms to kick/ban and delete messages

opal juniper
#

Wait really?

wraith rapids
#

that's basically a mod at that point

vital ridge
#

@ivory sleet changing my methods to private and using parameters fixed almot everything! Im just getting this error for some reason:
https://paste.md-5.net/uceduzisin.rb
at this block of code:

for (UUID uuid : ChickenMap.runnablePerChicken.keySet()) {

                                    if (uuid == chicken.getUniqueId()) {

                                        ChickenMap.runnablePerChicken.get(chicken.getUniqueId()).stop();

                                        ChickenMap.runnablePerChicken.remove(chicken.getUniqueId());

                                    }

                                }
opal juniper
#

yeah

vital ridge
#

the error appears on the for loop line

wraith rapids
#

don't modify a collection while iterating over it

opal juniper
#

ConcurrentModificationException

vital ridge
#

i need to tho

#

when i dont my removing doesnt work properly

wraith rapids
#

then use an iterator

#

get the entry set and use an iterator

#

modifications to the entry set are reflected in the map

opal juniper
#

So i have a .jar file that i need to use as a library.

it is in the lib folder however i need to work out how to load it. The second issue is that it is written in kotlin, not java

ivory sleet
#

Kotlin is interoperable with java

quiet ice
#

Kotlin does create a lot of junk at the bytecode layer though

#

But idk, method descriptors should be fine

ivory sleet
#

Yea

eternal oxide
opal juniper
quiet ice
#

Just treat it as a normal library I guess, if you use maven (don't recommend it for that type of stuff) use the system scope

eternal oxide
quiet ice
#

I however recommend gradle's solution since that allows using your artifact without warnings

eternal oxide
#

a new libraries: entry in the plugin.yml

vital ridge
# wraith rapids then use an iterator

ive worked with iterators like once so yea I might just did a dumb mistake but this code block gives illegalstatexecption at it.remove();

Iterator it = ChickenMap.runnablePerChicken.entrySet().iterator();
                                
                                while (it.hasNext()) {
                                    
                                    ChickenMap.runnablePerChicken.get(chicken.getUniqueId()).stop();

                                    it.remove();
                                    
                                }
opal juniper
#

or just cache it

eternal oxide
#

it creats a new libraires folder

opal juniper
#

awesome, ill give it a shot

#
libraries:
  - com.github.pemistahl:lingua:1.1.0

this just leaves me with a class not found error, is there anything else i have to do?

eternal oxide
#

I've no idea what repos it checks in

#

did you get an error in console?

#

I know it checks maven central

opal juniper
#

no it didn't even mention downloading them

#

afaik it is in maven central

eternal oxide
#

sec and I'll check

opal juniper
#

yeah it is there

eternal oxide
#

I'll add it to my test plugin and see if it works

opal juniper
#

👍

eternal oxide
#

yep, it worked perfectly

opal juniper
#

im stupid

#

my spigot is too old

#

8/may

#

ill run bt rq

#

its defo downloading something

#

yep it works

#

it even got the kotlin depends

#

is there a way to prettyify this

eternal oxide
#

Yep, much better than injecting into ClassLoaders or pacakaging huge jars

opal juniper
#

as in make a custom output

eternal oxide
#

Can;t read, SS is too small for me

opal juniper
#

sorry

#

?paste

queen dragonBOT
opal juniper
#

can i remove the log or whatever

#

or make my own

eternal oxide
#

I'd not bother trying. its only going to be in teh log once.

opal juniper
#

fair fair

#

what about this tho

#

cause that comes every time

eternal oxide
#

That will always be there. It may change in the future as this is a preview feature

opal juniper
#

ah i got you

#

thanks

jovial nymph
#

how do use this cool code box on discord?

opal juniper
#

back tick

#

`

#

three next to each other

#

like this^^

eternal oxide
#

```java
followed by ```

jovial nymph
#

you mean those ' ?

opal juniper
#

no

#

top left

ivory sleet
#

` is not equal to '

opal juniper
#

of the keyboard for me

jovial nymph
#

wait german keyboard

opal juniper
#

ohhh idk

outer pond
#

Top right, next to backspace

opal juniper
#

just copy the stuff in the pastebin

jovial nymph
#

ok got it

ivory sleet
#

Else you could write some code then select it and right click it where you can change it

jovial nymph
#

because i get this Caused by: java.lang.IndexOutOfBoundsException: Index: 2, Size: 2 at java.util.ArrayList.rangeCheck(Unknown Source) ~[?:1.8.0_291] at java.util.ArrayList.get(Unknown Source) ~[?:1.8.0_291] at de.mondgnu.lobbyvillager.villager.VillagerTradeWindowHandler.getWorldWithMostPlayer(VillagerTradeWindowHandler.java:49) ~[?:?] at de.mondgnu.lobbyvillager.villager.VillagerTradeWindowHandler.onTradeOpen(VillagerTradeWindowHandler.java:33) ~[?:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_291] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_291] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_291] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_291] at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[spigot.jar:3092-Spigot-9fb885e-ebe18b9] Error with this```public World getWorldWithMostPlayer(List<World> worldList)
{
World worldListItem = worldList.get(0);
for(int i = 1;i <= worldList.size();i++) {
if (worldListItem.getPlayers().size() < worldList.get(i).getPlayers().size()) {
worldListItem = worldList.get(i);
}
}
return worldListItem;

}```Code
ivory sleet
#

Oh yeah

eternal oxide
#

size 2 = index of 0 and 1

ivory sleet
#

change i <= worldList.size() to i < worldList.size() probably

opal juniper
#

how do you spawn a new thread?

ivory sleet
#

and then start with int i = 0

jovial nymph
#

ok

#

i try

#

omg why are you so smart

#

it worked

ivory sleet
coral sparrow
jovial nymph
#

i love to code bukkit plugins its so fun when something works

eternal oxide
opal juniper
#

i need to run some code that takes a little while onEnable thats all

quaint mantle
#

How can i make PlayerList plugin without ProtocolLib?

ivory sleet
#

Hmm I don't recall whether BukkitScheduler#runTaskAsynchronously pauses execution until server is finished enabling.

wraith rapids
#

asynchronous tasks are started at the beginning of a tick

eternal oxide
#

It doesn;t run till the next tick

wraith rapids
#

and the server doesn't tick until it has enabled

opal juniper
#

wait no that is fine

eternal oxide
#

But as he's talking about Threads he clearly doesn't need to wait for the result.

opal juniper
#

it just needs to be called onEnable thats all

#

yeah

ivory sleet
#

Oh okay then either you create a new Thread then or use something like a CompletableFuture if you want it to run async while enabling.

wraith rapids
#

that may not be good

jovial nymph
#

i have another question i get this ErrorError occurred while enabling MapHandler v1.0-SNAPSHOT (Is it up to date?) java.lang.IndexOutOfBoundsException: Index: 1, Size: 1 at java.util.ArrayList.rangeCheck(Unknown Source) ~[?:1.8.0_291] at java.util.ArrayList.get(Unknown Source) ~[?:1.8.0_291] at de.mondgnu.maphandler.MapHandler.onEnable(MapHandler.java:20) ~[?:?] at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:263) ~[spigot.jar:3092-Spigot-9fb885e-ebe18b9] at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:342) ~[spigot.jar:3092-Spigot-9fb885e-ebe18b9] with this Code```public final class MapHandler extends JavaPlugin {

@Override
public void onEnable() {
    List<String> worlds = findFoldersInDirectory("C:/Minecraft server/Main1.16.5/ClassicBWMaps");
    if(worlds.size() != 0)
    {
        for(int i = 0;i <= worlds.size();i++)
        {
            WorldCreator world = new WorldCreator("ClassicBWMaps/" + worlds.get(i) + "/Legacy");
            world.createWorld();
        }
    }

}

@Override
public void onDisable() {
    // Plugin shutdown logic
}

public List<String> findFoldersInDirectory(String directoryPath) {
    File directory = new File(directoryPath);

    FileFilter directoryFileFilter = new FileFilter() {
        public boolean accept(File file) {
            return file.isDirectory();
        }
    };

    File[] directoryListAsFile = directory.listFiles(directoryFileFilter);
    List<String> foldersInDirectory = new ArrayList<String>(directoryListAsFile.length);
    for (File directoryAsFile : directoryListAsFile) {
        foldersInDirectory.add(directoryAsFile.getName());
    }

    return foldersInDirectory;
}

}```

wraith rapids
#

the general contract of onEnable is that once it returns, your plugin is enabled and functional

eternal oxide
#

Who taught him code blocks and not paste 😦

opal juniper
#

?paste

queen dragonBOT
wraith rapids
#

you do not want to offload heavy work to an asynchronous thread and have your plugin in a weird not-quite-enabled state even after onEnable returns

eternal oxide
#

Me too. I'm guilty

wraith rapids
#

what are you offloading to this new thread

opal juniper
wraith rapids
#

yeah, onEnable should wait for that

opal juniper
#

so it just loads the models to mem

wraith rapids
#

your plugin probably doesn't function entirely without that

stiff topaz
#

Im trying to use the votifier API but it wont work

public class VoteEvent implements VoteListener, Listener {
    @EventHandler(priority = EventPriority.NORMAL)
    public void onVote(VotifierEvent event) {
        Vote vote = event.getVote();
        Bukkit.broadcastMessage("VOTE! CHECK CONSOLE");
        System.out.println(vote.getUsername() + " has voted on " + vote.getServiceName());
    }

    public void voteMade(Vote vote) {
        System.out.println("Received: " + vote);
    }
}

Error when compiling:

-package com.vexsoftware.votifier.model does not exist
wraith rapids
#

which means that it's not enabled without it

opal juniper
#

i mean, yes probs not

wraith rapids
#

which means that onEnable shouldn't return before it's done

opal juniper
#

yeah i get it lmao

wraith rapids
#

onEnable taking a while is fine; it is only done once at startup

opal juniper
#

i just hate the [11:43:11] [Server thread/WARN]: Can't keep up! Is the server overloaded? Running 8792ms or 175 ticks behind

wraith rapids
#

that shouldn't happen at startup afaik

#

as the server doesn't tick at startup

opal juniper
#

🤷

stiff topaz
eternal oxide
#

Is your language detection for typed messages or for language in files/data?

wraith rapids
#

are you sure this is because of your onEnable at startup

#

and not something happening after your onEnable

opal juniper
eternal oxide
opal juniper
#

oh, yeah

#

player typed

wraith rapids
#

it doesn't sound like it's in the startup

#

or are you using like plugman or something to reload the plugin

opal juniper
#

but i didn't type nothing

eternal oxide
#

in that case you can just fire it off async as no players will be online for a while.

wraith rapids
#

that is not guaranteed

#

a player might join in the first tick

opal juniper
eternal oxide
#

just set a boolean for enabled so yoru plugin doesn;t try to do anythign untill yoru async task set it to true

wraith rapids
#

which may be directly after this plugin has enabled

#

absolutely not

opal juniper
#

fuck off

ivory sleet
#

I mean if you do want to load in parallel I guess you could start loading it in onLoad and then join the async task in the end of onEnable.

eternal oxide
#

And just hope you never get me on your server. With my typing ti will never work out my language.

opal juniper
#

i mean i was just gonna set a boolean status

wraith rapids
#

saving 8 seconds of startup time is not worth breaking the contract of onEnable

opal juniper
#

eehh fair enough

wraith rapids
#

and yeah, you can do your startup in parallel

#

but onEnable must wait until your startup is done

#

doing it in parallel might save you half a second or something

eternal oxide
#

You could begin your init in onLoad

wraith rapids
#

also doable

eternal oxide
#

Just don;t use anything Bukkit in there

opal juniper
#

👍

ivory sleet
eternal oxide
#

You are not pink, I don;t see your messages anymore.

ivory sleet
#

lol

wraith rapids
#

you should ban someone for shits and giggles

eternal oxide
#

Try to never. Power goes to peoples heads.

#

unless its NNYa 😛

wraith rapids
#

unlimited power

jovial nymph
ivory sleet
#

Unsure if I can actually ban people

#

oh nvm

#

I can

wraith rapids
#

yeah you can

#

you can also delete messages

coral sparrow
wraith rapids
#

and mute and move users in voice channels

ivory sleet
#

oh thank you for letting me know nny lol

wraith rapids
#

and use external emoticons as well

#

interesting how they gave you all these perms but didn't tell you anything about them

ancient plank
#

conclure didn't read the message telling us what permissions we have, he just went straight into doing his daily tribute to helping people in the help chats

wraith rapids
#

lol

ivory sleet
#

Oh yeah they did tell us about the mod perms guess I just missed it

opal juniper
#
    @Override
    public void onLoad() {
         CompletableFuture.runAsync( () -> {
            this.detector = LanguageDetectorBuilder.fromAllSpokenLanguages().build();
            this.detector.detectLanguageOf("Starting the Language Service");
        });
    }

This doesn't allow it to return b4 it is done, how do i do that

wraith rapids
#

join or get the future in onEnable

#

that'll make onEnable block until the future is complete

opal juniper
#

i did do that but it just ran the whole runnable onLoad

#

and waited and stuff

ivory sleet
#
CompletionStage<Void> future;
void load() {
  future = CompletableFuture.runAsync(...);
}
void enable() {
  //other stuff
  future.join();
}```
#

iirc

wraith rapids
#

does runAsync block for the result? i don't remember but I don't think it does

ivory sleet
#

CompletionStage carries join()

wraith rapids
#

seems rather silly for it to block

ivory sleet
#

I mean it blocks on the thread its executed on right?

opal juniper
#

yeah

wraith rapids
#

then you don't want that

opal juniper
#

no

#

i want it to just chug away in the background

ivory sleet
#

But ofc if u'd use smtng like Executor e = r -> Bukkit.getScheduler().runTask(plugin,r); then it would still run sync

wraith rapids
#

that will explode

#

because the server can't run any tasks until it's done enabling

ivory sleet
#

yup

opal juniper
#

also CompletionStage doesn't seem to have the join

wraith rapids
#

and it won't enable until onenable returns

#

and onenable won't return before this stops blocking

ivory sleet
#

Oh yeah use CompletableFuture then

wraith rapids
#

🤷🏿‍♀️ complete a completable future manually from a new Thread I suppose

#

can't use bukkit's scheduler for this so you need to create and spin a thread yourself

#

and you only need one so you don't need to set up thread pools or anything

#

just a raw thread will do

opal juniper
#

soo

#

if i understand

ivory sleet
#

yeah although CompletableFuture::runAsync uses the common pool by default so just using it without providing an executor should execute in concurrent

wraith rapids
#

but that apparently blocks until the future is complete?

ivory sleet
#

Hmm I think it would only block the worker that got delegated the task, not the server thread unless get or join is called explicitly.

keen kelp
#

can I make it so it doesn't do the moved too quickly thing in when I p.teleport?

wraith rapids
#

that'd make more sense yes

keen kelp
#

or do I have to set that number to a huge number

#

like just disable it entirely

opal juniper
#

yeah do that if you want to

keen kelp
#

since that probably isn't ideal

#

and if I were to do that is there a way to disable it?

#

or can I only set it to huge values

opal juniper
#
    InitLangDetector initLangDetector;

    @Override
    public void onLoad() {
        this.initLangDetector = new InitLangDetector(this);
        this.initLangDetector.start();
    }
    @Override
    public void onEnable() {

        try {
            this.initLangDetector.join();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

    }

would this work?

#

InitLangDetector extends thread

ivory sleet
#

Uh sure

opal juniper
#

what does

Uh
mean 🤣

#

what did i do...

ivory sleet
#

Oh I just didn't expect the usage of a Thread but that looks fine

opal juniper
#

ah ok

#

cool

#

how do you do coloured text?

coral sparrow
#

player.perfomCommand or player.chat (a bungee command) would work?

ivory sleet
#

Nope

coral sparrow
#

on a spigot plugin

coral sparrow
#

🙄

ivory sleet
#

You can do the opposite iirc but doing that would require a bungee plugin also

coral sparrow
ivory sleet
#

Yep

coral sparrow
#

me is bad at bungee api even if it is similar to spigot

#

lazy to make one

ivory sleet
opal juniper
#

like to the console

#

sorry i should have clarified

#

cause some methods produce the colour codes

coral sparrow
opal juniper
#

yes

ivory sleet
#

Yeah I think it does

opal juniper
#

but it depends on how you use it

#

cause using the logger with chatcolour doesnt work afaik

coral sparrow
#

the "symbol" would work?

#

Like lot of plugins log with a colored text

ivory sleet
#

I mean using the coloredconsolesender should work fine?

coral sparrow
#

🤔

opal juniper
#

oh idk

ivory sleet
#

If something needs to be logged then color shouldn't matter?

#

OH nvm it's just called ConsoleCommandSender

eternal oxide
#

adding colour to a console message makes the logs a nightmare to read

opal juniper
#

fair point

#

but it is just a couple of lines

coral sparrow
#

I dont color my logs

opal juniper
#

Starting the Language Service
I can see why that is a pain

ivory sleet
#

🥴

eternal oxide
#

Colour in game but in logs theres no point

#

What if everyone coloured every message

opal juniper
#

yeah ik

#

can we get a ChatColor.ORANGE

ivory sleet
#

You can use hex colors

#

ChatColor.translateAlternateColorCode('&',"&x&F&F&A&5&0&0") or smtng

opal juniper
#

ok

#

thanksa

ivory sleet
#

little verbose but yeah

coral sparrow
#

Can we send title message without using nms

rugged topaz
#
        getServer().getMessenger().registerOutgoingPluginChannel(this, "BungeeCord");
        getServer().getMessenger().registerIncomingPluginChannel(this, "BungeeCord", this); // this line causes error

Error occurred while enabling Lobby v1.0 (Is it up to date?)
java.lang.IllegalArgumentException: This registration already exists
more context is prolly necessary but i'm not sure why this error would be occurring out of nowhere, even after having no issues for weeks. tried restarting, reloading and rebuilding.

wraith rapids
#

using the console command sender is cancer

#

as that won't respect the end user's logging configuration

#

and can't be attributed to your plugin properly

ivory sleet
opal juniper
rugged topaz
#

why would that be

opal juniper
#

what like the big thing on the screen

#

cause there is an api for that

coral sparrow
coral sparrow
opal juniper
#

yeah,

rugged topaz
opal juniper
#

i thought it was baked into spigot

coral sparrow
#

I cant do without nms

#

xd

ivory sleet
#

I am unsure but that might be invalid then yanlol

rugged topaz
#

im not sure if other plugins r able to conflict

#

but

#

it only happened after

rugged topaz
#

i added another plugin

ivory sleet
#

also can you send the entire stacktrace

rugged topaz
rugged topaz
#

found my easy fix, comment out the registration line, build, reload, uncomment, build reload. back to normal, but it'll just break again as it's already happened several times in the past day

#

probably unable to get help either because its honestly weird asf

ivory sleet
#

Also btw what are you using the incoming channel for

rugged topaz
#

reading playercounts from another server

#

so that i can have a 'total network online players'

ivory sleet
#

It looks like you register the channel twice

#

are you unregistering onDisable?

rugged topaz
#

is that even possible

#

bc no

ivory sleet
#

Yes

#

you very much have to do that lol

rugged topaz
#

well oops

#

wasn't here

ivory sleet
#

Yeah I will add it

rugged topaz
#

what's the uh

#

method

#

unregisterincoming and unregisteroutgoing?

#
    @Override
    public void onDisable() {
        getServer().getMessenger().unregisterOutgoingPluginChannel(this, "BungeeCord");
        getServer().getMessenger().unregisterIncomingPluginChannel(this, "BungeeCord");
    }
ivory sleet
#

I edited it 😄

rugged topaz
#

got it ty :)

#

also is there an easier way

#

to get player counts for the proxy

ivory sleet
#

Uh I think the way you're doing it is the ideal way

rugged topaz
#

o alr

#

ty

hardy valley
#
"Could not set generator for default world 'world': Plugin 'SpaceTravel v1.0-SNAPSHOT' is not enabled yet (is it load:STARTUP?)"
``` How can I fix this?
ivory sleet
#

Maybe wanna set the load to STARTUP in plugin.yml

dusk flicker
#

In the plugin yml you want to set load: STARTUP so it loads before worlds.

hardy valley
#

oh alr thanks

quaint mantle
#

Hello, I'm working on editing(forking) a spigot jar. I was originally using paper jar, but I realized that spigot jar has a lot of lag. How did the paper make this spigot not lag? My question is how to fork a spigot jar without a lag.

ivory sleet
#

Wym has a lot of lag

quaint mantle
#

hmm

#

for example, when I kill boss, 1 tps downs

#

Paper never goes down tps with this

ivory sleet
#

Ideally you should probably head over to the paper discord and ask the same question there.

quaint mantle
#

okay thanks!

ivory sleet
#

But in short Toto, there isn’t just one how, they have optimized it for some years now so optimizing it as paper might now be as trivial as you think.

quaint mantle
#

oh

ivory sleet
#

Although you’re free to go through all of their patches

quaint mantle
#

Can i use MongoDB with spigot development

#

?

ivory sleet
#

Yup

quaint mantle
#

Ok thanks

ancient tusk
#

Hi, someone know how to remove npc from tab without remove this skin ? I don't want to use Citizen. Sorry for my english, i'm french.

ancient tusk
#

?

coral sparrow
#

player.setPlayerListName("");

ancient tusk
#

Because I have already done the code for the other features and I don't want to start over

ivory sleet
#

Citizens is basically doing everything for you by abstracting away packets and nms, why not use it @ancient tusk ?

coral sparrow
#

yeh

ancient tusk
coral sparrow
coral sparrow
ancient tusk
#

Yes but I want there to be no line

coral sparrow
#

Probably nms

quaint mantle
#

How would i tie information for a bossbar, per player. Using a hashmap with the key of player yes. But what would i use for the value

ancient tusk
quaint mantle
ancient tusk
#

Well finally I may be using Citizen. Anyhow, thanks for your help

quaint mantle
#

id recommend citizens

eternal oxide
ancient tusk
#

No, I will use Citizen, it will be easier

eternal oxide
#

you can hide the name just by setting the PlayerListName to a space

ancient tusk
eternal oxide
#

Thats why I asked you if you cared about the connection info

#

using ProtocolLib will remove it completely

ancient tusk
#

okay, thanks i will try

coral sparrow
eternal oxide
#

No clue

coral sparrow
#

:/

rocky river
#
@EventHandler
    public void customStoneGen(BlockFormEvent e) {
        //System.out.println(e.getBlock().getType());
        // Standard Custom Stone Gen
        if (e.getNewState().getType() == Material.COBBLESTONE) {
            Material underCobble = e.getBlock().getRelative(BlockFace.DOWN).getType();
            //System.out.println(underCobble);
            for (Material m : validBlocks) {
                //System.out.println(m);
                if (underCobble == m) {
                    Bukkit.getScheduler().runTaskLater((Plugin) this, () -> {
                        System.out.println("IF " + m);
                        e.getBlock().setType((Material) underCobble);
                        //Code That Runs After Timer
                    }, 1);
                    break;
                }
            }
        }
    }```Code works fine without the runTaskLater, but with it I get ``Could not pass event BlockFormEvent to VanillaPlus v1.0-SNAPSHOT``
#

anyone have an idea?

eternal oxide
#

is your event listener in your plugins main class?

rocky river
#

No, it's in "public class CustomStoneGen implements Listener"

eternal oxide
#

Then you can;t blindly cast this to Plugin

#

You need an instance of your plugins main class

slim magnet
#

Hey if I have a Villager and I dont want him to move around or make noises but still face nearby players, what do I do

eternal night
#

You can set the movement speed attribute to 0

slim magnet
eternal night
#

didn't the paper discord already supply you with the answer ? xD

slim magnet
#

no

#

Idk how to apply the actual attribute

eternal night
#
villager.getAttribute(Attribute.GENERIC_MOVEMENT_SPEED).setBaseValue(0);
slim magnet
#

thanks

quaint mantle
#

Information:
    <random player UUID>   --- how would i get this as i don't know what it would be 
          <value attached to that>  --- and get this too
eternal oxide
#

random text is very random

quaint mantle
#

?

eternal oxide
#

You give no context to your question

#

Your question makes no sense

quaint mantle
#

It doesn't really need it, im trying to get the stringlist of players UUIDs and the values attached to them. When i don't know their uuids

eternal oxide
#

You are still making very little sense

#

The only thing I've managed to make out is you want to get a value thats somehow attached to a UUID that you don;t know.

quaint mantle
#

Ok let me explain it the way i did before...

I'm trying to get a list of player UUIDs from a YML file. And i have the UUIDs stored in a stringlist called Information I'm trying to get the list of player uuids and the values attached to them to store them into a hashmap, Keep in mind i don't know what the UUIDs will be so how would i go around getting them via .getStringList

eternal oxide
#

if you are attaching values to them you don;t store them as a StringList

#

You store it as a Map/ConfigurationSection

quaint mantle
#

Forget it

eternal oxide
#

I can tell you how to do it, but ok

carmine ivy
#

Hey I have a problem with my custom book, I want the title to be underlined at the top of the page but it carries on throughout the entire page
How would I stop the underline?

eternal oxide
#

there is a reset color code

carmine ivy
#

What is it?

quaint mantle
#

&r is the code

carmine ivy
#

Ahh ok

#

Thanks!

quaint mantle
#

i found out how

proud basin
#

@vestal dome So you know how I was trying to get a command to run when a message is clicked in the book, well I found some code online that actually makes it work

vestal dome
#

hm

quaint mantle
#

using json?

vestal dome
#

nice..

proud basin
#

I think so

#

I didn’t look into it too much

ivory sleet
#

Yeah that has always been possible ?

quaint mantle
#

sounds abit right

proud basin
#

Hm is json hard?

quaint mantle
#

not too hard

ivory sleet
#

I mean not if you understand the syntax of it

proud basin
#

Is it part of spigot or????

quaint mantle
#

Json itself isnt

proud basin
#

is it json json

ivory sleet
#

No json is JavaScript object annotation for short iirc

proud basin
#

k

#

Actually

ivory sleet
#

But we have bungee chat api for instance which wraps around json with objects

proud basin
#

I don’t think it uses kson

#

json*

quaint mantle
#

Show the code

proud basin
#

lemme find the spigot page again

#

Im not on my pc

#

I can’t find it

quaint mantle
#

which one is yaw?

eternal oxide
#

turn your player and see which changes the most (probably the second)

maiden briar
#

Is there a way to serialize bungee's hover and click event to a Json string so I can save it into the config?

eternal oxide
#

Pitch and yaw, pitch is head movement up/down, Yaw is turngin around

maiden briar
ivory sleet
#

I think Component#toString should be enough

maiden briar
#

Really? I saw a class named "TextComponentSerializer" can't I put that into a Gson?

ivory sleet
#

Oh yeah you can ?

maiden briar
#

Ok

ivory sleet
#

It implements a JsonDeserializer

quaint mantle
#
p.getInventory().getItemInMainHand().getItemMeta() == BedrockPiece.getCustomItem().getItemMeta()
``` i have an if condition like this, BedrockPiece is a custom item btw.
p is the player entity. not sure why this doesnt work
#

No errors

ivory sleet
#

Use .equals

quaint mantle
#

Oh

maiden briar
#
private final static Gson textComponentSerializer = new GsonBuilder().registerTypeAdapter(net.md_5.bungee.api.chat.TextComponent.class, new TextComponentSerializer()).create();

@Override
    public Map<String, ?> serialize()
    {
        Map<String, Object> values = new LinkedHashMap<>();
        values.put("json", textComponentSerializer.toJson(toChatText()));
        values.put("center", centered);
        return values;
    }

    @Override
    public Object deserialize(Map<String, ?> values)
    {
        if(values.containsKey("json"))
        {
            TextComponent bungee = textComponentSerializer.fromJson((String) values.get("json"), TextComponent.class);
            JsonChatComponent chatComponent = new JsonChatComponent(bungee.getText());
            chatComponent.clickEvent = bungee.getClickEvent();
            chatComponent.hoverEvent = bungee.getHoverEvent();
            
            if(values.containsKey("center"))
                chatComponent.centered = (boolean) values.get("center");

            return chatComponent;
        }

        return null;
    }```
Smth like this?
heavy delta
#

can someone recommend a tutorial for gtting started with plugins

maiden briar
#

Learning Java

#

I know a course, but that is advertising

heavy delta
#

send throught dm

maiden briar
#

Ok

ivory sleet
#

Yeah tvhee that should work

heavy delta
#

but how do plugins work

ivory sleet
#

Swirl yeah it’s highly recommended to get some basic java skills before hoping to spigot api.

#

Oh

#

There exists some wiki pages for it

heavy delta
#

ok

maiden briar
#

Good that you are pretty good, you know the most important things from Java?

steep nova
ivory sleet
heavy delta
#

thanks

ivory sleet
#

I would recommend reading source code also

quaint mantle
#

Anyone know why my maven is showing this for my vaultAPI

ivory sleet
#

Did you declare the repository?

quaint mantle
quaint mantle
#

So how can i detect when i put fire on a block

ivory sleet
#

Hmm then it should work fine

quaint mantle
#

it aint

#

do i need to download something

eternal oxide
#

show yoru pom

#

?paste

queen dragonBOT
ivory sleet
#

PlayerInteractEvent maybe

quaint mantle
#

yeah wait

#

i got hit by an idea

#

thanks

quaint mantle
#

is there a jar file i need to download?

ivory sleet
#

?paste your pom.xml

queen dragonBOT
quaint mantle
eternal oxide
ivory sleet
#

Elgar will help you as he is a god at this yeahyeah (I use gradle)

quaint mantle
#

ok

eternal oxide
#

Theres nothing wrong with your pom. InteliJ or Eclipse?

quaint mantle
#

Intellij

eternal oxide
#

Cleared cache?

quaint mantle
#

yeah

ornate heart
#

Is there a refresh button at the top right of your pom.xml

quaint mantle
#

Yes

eternal oxide
#

then restart your IDE

quaint mantle
#

Working now thanks

stiff topaz
#

How do I reinstall the Spigot libraries on IntelliJ, I seem to have deleted them

eternal oxide
#

Using Maven?

stiff topaz
#

Yes

eternal oxide
#

run BuildTools

#

?bt

queen dragonBOT
stiff topaz
eternal oxide
#

Run BuildTools

#

Check if the files already exist, if they do, repeat as above, Invalidate cache and restart IDE

stiff topaz
#

the entire repository is gone

eternal oxide
#

just run BuildTools

quaint mantle
#

How can i make make the block break a little? you know there is a texture change when you are breaking blocks

ivory sleet
#

I believe you can send a block break update to a player

quaint mantle
#

🌟 Packets 🌟

#

thanks

#

that would be PacketPlayOutBlockBreakAnimation then

ivory sleet
#

No need for packets?

quaint mantle
#

i am using 1.12.2

ivory sleet
#

😬

quaint mantle
cloud berry
#

guys wat is proper way 2 convert block coords to region coords? :I is it just divide by 512?

ivory sleet
#

Wouldn’t you have to get the offset of the region from origin and then subtract that from the block coordinate?

eternal oxide
#

region?

cloud berry
#

oh no

#

i mean like which region a block is in

eternal oxide
#

by region, do you mean chunk?

cloud berry
#

no, region

#

512x512

eternal oxide
#

what is a region?

cloud berry
#

mca file

stiff topaz
cloud berry
#

looks liek hes dividing by 512 but idk ive been jebated by block math b4

eternal oxide
#

woudl it not be >> 9

cloud berry
#

:I

#

hmmmm

#

it could be :I

#

i need 2 find out 4 sure somehow 🤣 or ima delete ppls houses

eternal oxide
#

yes 512 is 9

cloud berry
#

handles negative properly rite?

eternal oxide
#

yes

cloud berry
#

kk ;3 tysm ima try taht

eternal oxide
stiff topaz
#

git bash

#

Its working now strangely

eternal oxide
#

if you don;t have a java home set

#

Are you sure you even have java installed?

heavy delta
#

hey why is java class not an option in intelliJ

quaint mantle
#

?paste

queen dragonBOT
heavy delta
#

?

quaint mantle
#

i just wanted to get the link

#

i always forget

#

Lol

heavy delta
#

lol

quaint mantle
#

its supposed break bedrock when ignited

#

any help?

heavy delta
#

lol im just starting plugins

heavy delta
quaint mantle
#

:/ i feel that

quaint mantle
sacred shoal
#

hey guys is there anyway to build a spigot with latest rc1 of 1.17 to start testing the plugins and java 16 on it?
so when the day comes can have an idea of what plugins to implement

eternal oxide
#

Two line 19, NEVER sleep the main thread

#

Lastly what is playerInteract.java:172 ?

#

oh one more poitn this section of code !(l.getBlockY() <= 0) is equivalent to l.getBlockY() > 0

eternal oxide
stiff topaz
heavy delta
#

when i hit "new"

#

why is "java class" not an option

minor fox
eternal oxide
#

java class?

#

do you mean to create a new class?

opal juniper
#

Oh it means you are not in a valid package

heavy delta
#

lemme dm you a photo

eternal oxide
quaint mantle
eternal oxide
#

then b is null

#

its not a block igniting a block, its an entity, so you use getIgnitingEntity

quaint mantle
#

Oh

eternal oxide
#

and you always test for null if it can be null

quaint mantle
#

i want to get the ignited block

loud swift
#

silly question, but, can world names have spaces?

quaint mantle
#

so i have to .getBlock

eternal oxide
#

no

loud swift
stiff topaz
quaint mantle
#

ok

loud swift
eternal oxide
#

You getBlock() to get the block that was set alight

eternal oxide
#

It can break so many things

loud swift
#

dang, i guess i have to support it then :/

#

Had a command with an arg that can have spaces & world would be a second one

eternal oxide
#

just force them to wrap the world with "" if it has a space

#

I coundn;t honestly tell you if they can or can;t these days

#

actually once se

loud swift
#

I just tried to create a world and it generated with a name with spaces

quaint mantle
loud swift
#

but on chunk load it appeared sorrounded by []

#

elgar, the command args will still split it right?

eternal oxide
#

Yes spaces can still be used in world names

loud swift
#

its just to be able to parse it after joining the parts?

eternal oxide
#

you surround a "world test" in " it will be passed as a single arg

loud swift
#

😮 nice

#

thanks

quaint mantle
eternal oxide
#

No you never ever use any Sleep or wait.

quaint mantle
#

Oh

#

Lol

#

Okay

#

i want to delay it though

eternal oxide
#

sleep and wait are literally freezing the server for that amount of time.

#

To delay execution of code use teh Scheduler

quaint mantle
#

like this?

eternal oxide
#

if you want them spaced 1 second apart the first one would be 20L, the second would be 40L etc

quaint mantle
#

oh

#

its not working 😭 🤜

distant fern
#

Hi. Why this code doesnt work?

 @EventHandler
    public void onDziadek(PlayerMoveEvent e){
        if(e.getPlayer().getInventory().getHelmet().getItemMeta().getDisplayName().equals("§7Helm Dziadka")){
            e.getPlayer().sendMessage("test");
            e.getPlayer().setWalkSpeed(0f);
        }
    }



}
#

The test shows up but im still able to move

quaint mantle
#

any errors?

stone sinew
#

I think it adds the value rather then setting it. I could be wrong. Doesn't hurt to try.

quaint mantle
#

When will paper 1.17 release?

#

idk

ivory sleet
#

That’s a question you should ask in the paper discord

pulsar zenith
pulsar zenith
civic prairie
ivory sleet
paper viper
#

It's most likely due to the string check

#

you shouldnt be comparing the helmet itemstack display name with some string

#

cause its not safe

#

and also did you register the event

ivory sleet
#

Also the PME is limited to 20 tps

paper viper
#

instead of using display name, use persistent data container

#

store the item as some sorta identifier as a string

rugged topaz
#

does anyone know if it's possible to send and receive bungeecord plugin messages for any given channel when there are no players on?

ivory sleet
#

No it needs a PluginMessageRecipient to send a message which is as of now only players are

#

I am unsure but I believe receiving doesn’t require any player

rugged topaz
#

well one's redundant without the other

#

i'm trying to have a staff chat-like system, and basically if no one's on a given server and plugin messages are being sent to that server, when a player joins they basically just all start flooding chat

ivory sleet
#

No but for instance only server A would need a player contained to send, server B doesn’t need a player contained to receive

ivory sleet
rugged topaz
#

i leave and join server a (lobby) 10x times, which should be sending to all opped players on the network "yan left lobby", however no one is on the duels server, so when a opped player joins the dueled server, they're also greeted with a bunch of spam that should've been sent from the past

rugged topaz
#

at least something

ivory sleet
#

Oh maybe I am wrong then

#

One way would be to go use redis instead, I don’t know if someone tried this yet but to implement your custom PluginMessageRecipient

rugged topaz
#

never worked with redis

#

would it work if i implemented a check for playercount?

#

yea should

ivory sleet
#

Yeah technically you could get far with that

quaint mantle
#

@eternal oxide it doesn't work, idk whats wrong.

#

can someone help me so i am making a punishment system called "IdkPunishment" and it is saying unable to connect to database which means it can't connect to my database.

#

code here

#

code that prints out the error

ivory sleet
#

You don’t print the stacktrace?

quaint mantle
#

no

ivory sleet
#

It would help significantly if you would print it

quaint mantle
#

no errors

#

.

rugged topaz
rugged topaz
#

a shabby fix seems to be getting the player count from 5 seconds ago? using a scheduler ig

#

idk, do you have any better ideas

paper viper
#

i beleive you can get it using reflection

#

hold on

ivory sleet
paper viper
#

Ok so you have two options

#

you can use reflection and NMS to use the recentTPS

#

or you can make your own class

#

to track the current TPS

rugged topaz
#

wdym, so include the timestamp in the forwarded message and compare it on when it's received to see if it's the same as rn?

#

depends on if bungeecord messages are received immediately or not

left swift
#

hey i noticed in some plugins they save data when plugin is turned on and off. Simple example - a command that changes the boolean value to the opposite each time it is used and writes the value to the hashmap for each player. After restarting the plugin, the hashmap has been remembered and each player has the value set before the restart. Can it be done somehow without using the database and writing to the file?

ivory sleet
#

Technically you could use players pdc to do that

#

Enes have you tried debugging that ?

rugged topaz
quaint mantle
#

let me

ivory sleet
#

To tuso

rugged topaz
#

o

ivory sleet
paper viper
#
Class<?> craftServer = Class.forName ( "org.bukkit.craftbukkit." + getServerVersion() + ".CraftServer" );
Method getServer = craftServer.getMethod ("getServer");
Object nmsServer = getServer.invoke ( Bukkit.getServer ( ) );¨
double[] recentTps = (double[]) nmsServer.getField("recentTps");
double average = (recentTps[0] + recentTps[1] + recentTps[2]) / 3;

public static String getServerVersion () {
    return Bukkit.getServer().getClass().getPackage().getName().substring(23);
}

maybe try this

ivory sleet
#

Doesn’t have to be the time stamp, was just an example

rugged topaz
#

because i wanna use System.currentTimeMillis()

paper viper
#

I found it on the forums and it uses reflection to get the tps

rugged topaz
#

timestamp seems the most efficient tho

ivory sleet
#

I use Instant.now but both works

quaint mantle
#

it doesnt print "is bedrock"

#
if (!(l.getBlockY() == 0) && b.getType() == Material.BEDROCK){
            System.out.println("is bedrock");
ivory sleet
#

use != instead of !(condition)

quaint mantle
#

is there anything else wrong?

ivory sleet
#

But uh yeah block y is basically at the bottom

#

At least what you’re checking

#

Or nvm

#

Heh the opposite

quaint mantle
#

here's the rest of the code

rugged topaz
#

conclure

#

is there any reason why messages r only processed after i leave and join the same server

#

e.g. they'll be sent from another server but i'll only receive them (using a bukkit.broadcastmessage to debug this) after i leave and rejoin that same server

quaint mantle
#

i just need to fix this

ivory sleet
ivory sleet
proud basin
#

It does look like it is using json

ivory sleet
#

Maybe use b.getY() instead of b.getLocation().getBlockY()

tiny zinc
#

Lol. The client would probably disconnect but the server would either have some sort of error just treat it as a timeout. It would be interesting to see what would happen though.

quaint mantle
#

I'm having a problem with using my arenaConfig file (https://paste.md-5.net/qesiyiweti.cs). I've done so it's not much static in it but more constructors but I can't seem to be able to actually get the config or anything.

quaint mantle
ivory sleet
#

Hmm Enes this is only when a player is igniting a block right ?

quaint mantle
#

Yes

ivory sleet
#

BlockPlaceEvent might be more suitable

quaint mantle
#

Yeah uh sure

opal juniper
#

then, you can check if it was a ban using the QuitEvent, and checking if the user is banned

quaint mantle
eternal oxide
ivory sleet
#

Oh xD

eternal oxide
#

ah okies, I had to go t-cut my bonnet

quaint mantle
ivory sleet
#

You can see the group id and artifact id there

ivory sleet
#

You might be sending it erroneously

quaint mantle
#

wym

quaint mantle
loud swift
eternal oxide
#

odd

loud swift
#

For example:
/setcustomblock "gold ore with overlay"

eternal oxide
#

to both

quaint mantle
proud basin
#

oh man I don't know where to start

eternal oxide
quaint mantle
#

Is a water bottle the only thing a player can consume or interact with related to water

quaint mantle
#

its stuck there

eternal oxide
#

your packets are overwriting eachother

loud swift
#

Anyone know if there is a way to indicate that multiple words in a command should be part of the same argument string?

#

I can do it manually if necessairy but i'd rather not reinvent the wheel

quaint mantle
#

its still

eternal oxide
subtle vector
#

if i throw a snowball and it has a pdc and in it it has a namespaced key bob. If i throw the item/snowball does it keep it pdc even as an entity

eternal oxide
#

pdc on ItemStack does not transfer

quaint mantle
subtle vector
#

it there a way i can keep it?

quaint mantle
#

always

eternal oxide
#

You never see any of the other break stages, but you do get their sounds?

quaint mantle
#

Yep

eternal oxide
#

very strange

#

it sounds impossible

quaint mantle
#

maybe it is

#

let me try again

granite stirrup
#

how do u make maven repos lol

paper viper
#

you use some repo hosting thing like artifactory

#

something like that

#

host it yourself

#

then you can upload artifacts on there

subtle vector
quaint mantle
#

Lmao

eternal oxide
subtle vector
#

like i throw a snowball

#

and that thrown snowball still has it data from itemstack

eternal oxide
#

it does?

quaint mantle
#

@paper viper in cmd?

subtle vector
#

does lauching it manually mean like throwing it

paper viper
quaint mantle
#

Ok

subtle vector
quaint mantle
paper viper
#

no no

#

for one thing

#

have you cd'd into your project directory?

quaint mantle
#

Yes

paper viper
#

like you are inside your project direcotry

#

Ok good

#

you need to set the path for maven

quaint mantle
#

Oh ok

#

is sys vars?

paper viper
#

Yes

quaint mantle
#

which creates a maven installation in the project

#

bassacliy a maven enviroment

#

i dont have maven installed on my pc

eternal night
#

It doesn't create a maven installation

paper viper
#

^

eternal night
#

IntelliJ ships an inbuilt maven version

paper viper
#

you still have to install maven

eternal night
#

That is uses to compile things

#

Your plugin merely configures it

#

(through the pom.xml)

#

I'd heavily advise for installing maven fully on your system

wraith rapids
#

this is why i tell people to learn the thing before they get a gizmo to do the thing

quaint mantle
#

I dont have maven

#

It aint installed

wraith rapids
#

get maven

quaint mantle
#

on my pc

paper viper
#

then install it

#

Lmao

quaint mantle
#

But how i am i using maven with intellj

wraith rapids
#

intellij bundles its own maven binaries

paper viper
#

read up

quaint mantle
#

boolean meterMoved = (beforeLocation.distance(afterLocation) >= 1) ? meterMoved = true : meterMoved = false;

I don't use ternery operators at all is this correct or completely wrong as im trying to see if 2 locations are greater than 1 but im getting this error

Variable expected

proud basin
#
List<String> pages = new ArrayList<>();
            TextComponent page0 = new TextComponent();

            page0.addExtra("\n");
            page0.addExtra("Yea");
            page0.setClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, "google.ca"));
            page0.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder("k cool").create()));
            pages.add(ComponentSerializer.toString(page0));
            openBook((Player) sender, pages);
``` so I have this but im trying to add normal text without any click events or hover events. How could I do this?
wraith rapids
#

yeah no

wraith rapids
#

don't use = true

paper viper
#

you cant assign

wraith rapids
#

just do true

paper viper
#

during ternary

quaint mantle
#

ahhhh

wraith rapids
#

boolean meterMoved = (beforeLocation.distance(afterLocation) >= 1) ? true : false;

quaint mantle
#

thank you

wraith rapids
#

which is literally boolean meterMoved = (beforeLocation.distance(afterLocation) >= 1);

paper viper
#

also, you dont have to do that

#

Yeah lol

#

no point xD

quaint mantle
#

oh yeah -_-

paper viper
#

also

quaint mantle
#

Sorry ive been at this for 6+ hours my brain is melt

wraith rapids
#

use distancesquared

paper viper
#

distance is kinda intensive if you're going to do this action a lot

#

distancesquared gets rid of the calculations stuff you need to do for square roots

quaint mantle
#

Best way of checking if a player has moved a block as i will be using this alot later on

#

boolean meterMoved = (beforeLocation.distanceSquared(afterLocation) >= 1);

#

better?

quaint mantle