#help-development

1 messages · Page 278 of 1

echo basalt
#

lacks single-core

tardy delta
#

hehe

buoyant viper
#

just spawn more threads ezpz

echo basalt
#

Now, for minigames and all

#

I'd rather go for the i9-12900k

#

With a higher ram frequency

tardy delta
#

damn i got the ryzen 7 5200 iirc

echo basalt
#

less disk

crude estuary
#

Runs Very Good

echo basalt
#

5600x on my personal rig

#

my work laptop got an i5-1240p

buoyant viper
#

Ryzen 9 3900X on da gaming/dev pc

crude estuary
#

That's OP

#

xD

buoyant viper
#

originally i did mean to do a lot more dev/work than gaming on it tbh

crude estuary
#

But you always end up Gaming with it

tardy delta
#

tomorrow im customizing my pc lol

crude estuary
#

xD

buoyant viper
tardy delta
#

this ui scale sucks

buoyant viper
#

some games just... look so good

crude estuary
#

Yeah

#

RTX on be Like

#

Heaven

buoyant viper
#

but its an RTX2060 so i can only get like 40 fps most of the time with RTX on

echo basalt
#

gimmick for now

buoyant viper
#

Minecraft Bedrock RTX worlds be like

#

Laaagggggg

crude estuary
#

Yeah

tardy delta
#

bruh screenshot tool not automatically copying screenshots

buoyant viper
#

void@void-PC

crude estuary
#

y Manjaro and not TurboLinux tho

buoyant viper
#

Debian >

crude estuary
#

Debian is Good but i use arch btw

tardy delta
buoyant viper
#

i might use arch now that archinstall makes me less scared to do stuff

tardy delta
#

manjaro arch based

buoyant viper
#

manjaro is the least Arch arch distro imo

crude estuary
#

But not the Real Feeling of using Arch

vocal cloud
#

Neofetch needs to display memory in GB

opal juniper
#

@echo basalt
Was running this onDisabled java.util.concurrent.CompletionException: org.bukkit.plugin.IllegalPluginAccessException: Plugin attempted to register task while disabled

crude estuary
#

and Maybe Screwing Everything up without Knowing

tardy delta
#

lemme see what shit is all starting up by default

opal juniper
#

i thought that it wasn't disabled yet though

tardy delta
#

tf is matray

buoyant viper
#

probably taskbar or something idk

#

?google

undone axleBOT
tardy delta
buoyant viper
#

theyre both Names

echo basalt
#

yeah I forgot you can't really run tasks on the main thread with the executor n all

tardy delta
#

whats up with the taskbar tho

buoyant viper
#

its something

opal juniper
#

PluginDisableEvent

echo basalt
#

what event?

#

uhh

tardy delta
opal juniper
#

yeah i was then looking at that

echo basalt
#

try it

#

but make sure to join the allOf

#

otherwise you'll have issues

opal juniper
#

i am 👍

buoyant viper
tardy delta
#

touchpad aint even enabled

opal juniper
echo basalt
#

for how long

opal juniper
#

over 3 mins

#

still is

#

I changed it a bit

echo basalt
#

hm

#

something tells me the scheduler aint running

opal juniper
#

ah and it has just joined a future

echo basalt
#

hmm

#

I see

#

saveAllClouds -> System.currentThread()

#

pass that instead of the MAIN_THREAD_EXECUTOR for running stuff

opal juniper
#

Thread is not compatible with Executor

echo basalt
#

yeah uhh

#

I'm tryna see how I can run something on that thread object

tardy delta
#

just broke me ui

buoyant viper
#

good

echo basalt
#

I think you'll need to do some kind of lock system 🤔

#

like a recursive lock

#

this is getting complicated

tardy delta
buoyant viper
#

yknow

echo basalt
#

think like

tardy delta
#

setting scale to 125%

buoyant viper
#

nothing in gods great fucking earth

#

couldve prepared me

tardy delta
#

now my taskbar is broken

buoyant viper
#

for what i just saw

tardy delta
#

im having the minecraft font

#

lets reboot lol

onyx fjord
#

whats the formula for chunks loaded with X view distance?

opal juniper
#

pythagorus?

onyx fjord
opal juniper
#

@echo basalt
was thinking about:

public class CurrentThreadExecutor implements Executor {
    public void execute(Runnable r) {
        r.run();
    }
}
``` but that seems to just submit it on the thread that called it
#

so a stackoverflow is the result of that

arctic glade
#

thanks

vapid grove
#

How would I create world-specific commands?

#

Example: /bal in the main game, while in the hub it doesnt exist.

hazy parrot
#

It's usually per server, not per world

vapid grove
#

so id have to make 2 servers

#

doesnt that cost more money

eternal oxide
#

permissions

hazy parrot
#

You can't really make it doesn't exist, you can just pretend it doesn't exist

echo basalt
hazy parrot
#

With messages etc

vapid grove
eternal oxide
#

yes

#

access to commands is via permissions

#

tab complete is via permissions

vapid grove
#

are permissions world or server based

eternal oxide
#

world

vapid grove
#

ok ill just give anyone who joins the world a permission to use the commands

#

and in the main one niot

eternal oxide
#

lol to that code 🙂

#

you cancelled every event

sterile token
eternal oxide
#

yep

sterile token
#

ok

#

Im dumb bro today

#

I didnt sleep much sorry

eternal oxide
#

everyone has those days

sterile token
#

Now yes i removed that for not neccesary

humble tulip
#

in the thread

#

and a while(true) {
if map has runnables
map.getrunnable.run
}

#

something like that ig?

naive loom
#
        PacketContainer container = ProtocolLibrary.getProtocolManager().createPacket(PacketType.Play.Server.SCOREBOARD_TEAM);

        String name = UUID.randomUUID().toString().replace("-", "").substring(0, 12);

        container.getIntegers().write(1, 0);
        container.getStrings().write(0, name);
        container.getChatComponents().write(0, WrappedChatComponent.fromText(player.toString()));
        container.getSpecificModifier(Collection.class).write(0, Collections.singletonList(player.getName()));
        container.getChatComponents().write(1, WrappedChatComponent.fromText(ChatColor.translateAlternateColorCodes('&', nametag)));

        try {
            ProtocolLibrary.getProtocolManager().sendServerPacket(visibleTo, container);
        } catch (InvocationTargetException e) {
            Bukkit.getLogger().info("Unable to send packet to " + visibleTo.getName());
            e.printStackTrace();
        }
```Would anyone know how to change the player's username with this packet? Or is that not possible and do I send a different packet?
sterile token
#

I need recomendations for using JDA, via spigot plugins

#

Do i need to initialize it in another thread?
Also please make suggestion

humble tulip
#

jda already initializes in another thread

#

unless you call jda.awaitReady()

daring elm
#

How effieciency is PurPurMC ?

eternal night
#

Try and see

ionic thicket
#
        Action azione = playerCoinvolto.getAction();
        Player giocatore = playerCoinvolto.getPlayer();

        Material bloccoDiSmeraldo = Material.EMERALD_BLOCK;
        
        if(azione == Action.RIGHT_CLICK_BLOCK) {
            if(playerCoinvolto.getClickedBlock().getType() == bloccoDiSmeraldo) {
                giocatore.sendMessage("hai cliccato un blocco di smeraldo");
            }
        }
    } ```u guys know why this isnt working? i'm trying to send the player a message when it right clicks an emerald block
tall dragon
ionic thicket
#

bloccoDiSmeraldo means emeraldBlock in italian, sorry if i couldnt translate

#

yeah i annotated it

tall dragon
#

yea the name doesnt rlly matter

#

what is it been initialized to

#

oh wait

#

im blind

#

sorry

ionic thicket
#

oke ahah

#

dont worry

tall dragon
#

did you register the event?

ionic thicket
#

yep

#

wait

tall dragon
#

then it should work

ionic thicket
#

one sec

vague swallow
#

How can I get the Distance between 2 entities?

ionic thicket
tall dragon
tall dragon
ionic thicket
tall dragon
#

once for each hand

#

check the hand in the event

ionic thicket
#

i mean

ionic thicket
#

im rightclicking

#

im not using 2 hands ahah, if i click with my second hand it does it one time

tall dragon
#

trust me -,-

#

check the hand it will do it once

ionic thicket
#

yea im trusting you but im very new and idk how to do it

tall dragon
#

just look though the methods from the event

#

and im sure you will figure it out

ionic thicket
#

ooke

#

im not smart enough to understand

tall dragon
ionic thicket
#

ty

undone axleBOT
#

The PlayerInteractEvent may be called once per hand. If you only want code to be executed once, you can check the result of https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/player/PlayerInteractEvent.html#getHand(), then decide functionality.

For example, only executing code if the main hand was used:

@EventHandler
public void onPlayerInteract(PlayerInteractEvent event) {
    if (event.getHand() != EquipmentSlot.HAND) { // * if the hand used is NOT the main hand:
        return; // do not progress past this point  |
    }
    // provide functionality
}
vague swallow
#

I'm trying to change the max live of a firework on 1.18 but there is not such a method only setFireTicks and setFreezeTicks

#

Does anyone know why?

daring elm
vague swallow
#

that's what I mean

#

there is no .getMaxLive()

#

only .getMaxFireTicks or .getMaxFreezeTicks

#

whatever that means

tall dragon
#

does that not exist in 1.18?

vague swallow
tall dragon
vague swallow
vague swallow
echo basalt
#

the entire developer community will thank you

daring elm
#

waht is this?
** [WARN] Install JVM debug symbols to improve profile accuracy**

echo basalt
#

the last thing I want to do is work on someone else's code and see tons of variables named in chinese

echo basalt
tall dragon
#

dont think that will help him

daring elm
#

Does anyone know what this means? 😂
[WARN] Install JVM debug symbols to improve profile accuracy

My server keeps sending this to the console.

sterile token
#

Is posible to get default mc scoreboard using their name via spigot api?

sullen marlin
#

Name?

sterile token
#

Yeah, have you seen that now on 1.19 you can create scoreboards via /scoreboard command

#

I want to get those scoreboards

river oracle
#

scoreboard api 😭 I'm sorry for your loss.

sterile token
sullen marlin
#

Uh scoreboards or criteria?

river oracle
sterile token
#

I want to know if posible get the Set<Scorebaord> from those scoreboards

sullen marlin
#

Wasn't aware that was a thing

#

Open a feature request if it really is

sterile token
#

Oh so, its not posible right?

#

Perfect i will open the request, thanks md5

sterile token
river oracle
#

maybe you should check NMS internally first to make sure it exists

#

can't you just do Scoreboard#getObjectives ?

#

I mean I don't see why not

sterile token
#

Wait let me explain

river oracle
#

or even Scoreboard#getObjectivesByCriteria

sterile token
#

Soomeone told me if i can do a plugin wich takes the vanilla mc scoreboards and sent their objetives to discord via JDA on every scoreboard update

#

So far i have been looking in the docs to see how i would get them tho

river oracle
#

I mean you probably could? getMainScoreboard is the main scoreboard afaik

#

Gets the primary Scoreboard controlled by the server.

#

is in the docs

sterile token
#

ok

#

and what if you have created many scoreboards?

river oracle
#

I'm not sure tbh, the scoreboard api internally in NMS is kinda a mess and that also translates to spigot I couldn't tell you anything honestly

sterile token
#

Remember that im wondering to get the list of created scoreboard from the /scoreboard command

river oracle
#

look internally in NMS

#

you've got my curious so I'm going to rn lol

sterile token
#

yes its something new they added since 1.16 if im not wrong

river oracle
#

I'm just gonna build 1.19.3 remmapped and give it a look

subtle folio
#

Why does my ReGEX not match this? ReGEX: ^((-?[0-9]+,\s?-?[0-9]+,\s?-?[0-9]+)) String: (3, -30, 3)

river oracle
#

what are you trying to get everything inside the string besides the commas?

subtle folio
#

Im trying to get everything in that string, lol

#

Im tokenizing it.

river oracle
#

do you use regex101?

subtle folio
#

I did

#

It says no match, 😦

tender shard
subtle folio
#

just the full string

tender shard
#

if you need the full string, then just do (.*) lol

subtle folio
#

right but I want to assure its numbers, 3 of them to be exact

#

comma seperated and all that

subtle folio
#

IJ weird 👍

river oracle
#

(-?[0-9]+)

sterile token
#

y2k? Still alive?

subtle folio
#

would that match (3, 2, 0)?

#

if there is commas ?

buoyant viper
#

are u escaping the parentheses

subtle folio
#

I dont think so..

tender shard
#

you have to

#

(

#

fuck discord

buoyant viper
#

\(

subtle folio
#

I seee

buoyant viper
#

\)

tender shard
#

discord removed the escape char

subtle folio
#

god damn

#

thank you

#

\

tender shard
#

\(

subtle folio
#

\\

#

\(

#

haha

river oracle
buoyant viper
river oracle
#

BT just finished

buoyant viper
#

i always make there before i use

subtle folio
#

i did regex101 !!!

#

it didnt work

buoyant viper
#

oh rip

subtle folio
#

ugh

#

nvm it did

#

🙂

#

thank you ladies

tender shard
#

I didnt do anything, but still: you are welcome

sterile token
subtle folio
#

that was very helpful

tender shard
#

alrighty lol

subtle folio
#

and you fucked discord

tender shard
#

I did?

subtle folio
#

W in my book

subtle folio
tender shard
#

last time I remember, I fucked s/o else, but not discord

subtle folio
#

s/o

#

significant orthodox?

#

i didn't know you were religious

tender shard
#

ughm yes

#

close enough

#

i think I forgot my jägermeister in the bathroom, brb

subtle folio
#

WEEAAKKKK

#

jkjk

tender shard
#

I found it

river oracle
#

I hvae the code up

tender shard
subtle folio
tender shard
#

I already am at home, what's your point

buoyant viper
#

all or bust

#

100% only

subtle folio
tender shard
#

I must not, I drank jägermeister

#

the limit for pilots is 0.00‰

subtle folio
#

i see

tender shard
#

or maybe it's 0.5‰, I don't really know

buoyant viper
#

i think 0.5 is driving limit

#

or maybe thats 0.05?

tender shard
#

depends on the unit

buoyant viper
#

but thats also a diff measurement methink

#

BAC

#

blood alcohol content

tender shard
#

0.05% is the same as 0.5‰

sullen marlin
#

‰wtf

tender shard
#

first one is "per hundred" and second one is "per thousand"

sullen marlin
#

Never seen that in my life

tender shard
river oracle
#

nice nails

tender shard
#

thx

#

my best friend did them on christmas lol

river oracle
#

my friends always have nice nails and mine are just a mess lol

tender shard
#

relatable

#

stop chewing on them and make your female friends paint them from time to time, then you will look fabulous lol

river oracle
#

easier said than done

vague swallow
#

rotund ravine
#

permille yeah

rotund ravine
#

Permille can be used for other things though.

vague swallow
#

for some reason I can't get the Ticks until detonation of a fireworkrocket and also can't change them. Does anyone have an idea why?

sullen marlin
#

What do you mean cant get

vague swallow
river oracle
#

error?

vague swallow
#

It's just not there

river oracle
#

oh

#

what version you on

vague swallow
#

1.18

river oracle
#

coulda been added post 1.18 then

vague swallow
river oracle
#

then just use that method

vague swallow
rotund ravine
river oracle
#

yeah a lot of this stuff seems like it was added later as I said

rotund ravine
rotund ravine
river oracle
#

1.18.2 at minimum

vague swallow
river oracle
#

NMS maybe?

river oracle
vague swallow
river oracle
#

all of your plugins use NMS???

#

jesus christ you are a wild guy

vague swallow
#

How can I update the version of a plugin with IntelliJ?

vague swallow
river oracle
vague swallow
river oracle
#

nope

subtle folio
#

i mean plugin.yml isnt required to be changed

river oracle
#

oh api-version in plugin.yml

subtle folio
#

but you'd get your api verisions

#

lol

tender shard
rotund ravine
vague swallow
# river oracle nope

Sorry if the question is stupid but don't I have to replace the 1.18 file with the 1.19 file?

timid berry
#

anyone know how i can compile this

buoyant viper
#

with maven

timid berry
buoyant viper
#

mvn package idk

river oracle
#

the maven commands to compile

river oracle
#

he def wants maven install

buoyant viper
#

oh yeah

#

defo for sure

river oracle
#

mvn deploy

#

is the best though

#

because it does maven package, and install for you

#

and then there is the third extra step it does

eternal oxide
#

no point to use instal unless you are also going to code other plugins

buoyant viper
river oracle
#

yreah yeah

#

I only use maven deploy

eternal oxide
#

mvn package

buoyant viper
#

deploy or bust

river oracle
#

lol he is just trying to get around a paywall I'm having a little fun here my guy

buoyant viper
#

all or nothin

eternal oxide
#

is all you need to build a project

timid berry
#

bruh what da hell bruh

tender shard
timid berry
#

oh naw

tender shard
timid berry
#

my ass got no money

#

plus the source code is there

#

jus gotta figure out how to compile it

tender shard
#

mvn package

buoyant viper
#

how many times can we gonna say mvn package challenge

tender shard
buoyant viper
# timid berry

im pokijg fun at the fact that like 4 of us have said the same thing tbh

#

might be a cache miss or something try deleting ur local maven repo (~/.m2 ?) or something idk

#

or is mvn clean package / mvn package clean a thing

#

maybe that could do it

tender shard
#

yes it is

#

mvn clean package

river oracle
#

do /compile

#

its like a minecraft command

tender shard
#

lmao Y2K stop messing with noobs

buoyant viper
#

TIL (more like a week ago rather than today) that minecraft has a command to open a lan server on a specific port

#

/publish

#

its existed since circa 1.13

tender shard
#

isn't that the same as doing Escape -> Open to LAN or sth?

buoyant viper
#

now it is

river oracle
#

yes

#

kinda crazy

buoyant viper
#

since 1.19.3 added port option to the menu

tender shard
#

I'll go to sleep now, have a nice day everyone

buoyant viper
#

its only 3am

#

get ur ass up

tender shard
#

I woke up at 22 o clock

buoyant viper
#

well

tender shard
#

and I have at least 2 permille

#

soooo

#

shut up lol

buoyant viper
#

smh

timid berry
#

now what

#

which one do i use \

buoyant viper
#

probably the bigger one idk

severe slate
#

original tends to be incomplete (without shadings)

hardy garnet
#

This is a relatively simple technical question. Does spigot need chunks loaded to change blocks from one block to another?

echo basalt
#

yes

#

Blocks are stored in chunks

#

I mean technically if you're really sure you can somewhat change the world file itself

#

but that's a lot of hassle

humble tulip
#

Currently working on multilang support for my plugin. I'm looking for ideas on how I should implement them

buoyant viper
#

just write to the region file ezpz

humble tulip
#

currently, the messenger has a sendMessage method which takes a CommandSender, MessageKey and Placeholder varargs

#

what i'm wondering about is how Locale should work

echo basalt
#

hm

humble tulip
#
    public static final char SEPARATOR = '_';

    private String lang;
    private Set<String> countries;

    private Map<MessageKey, String[]> messages;
echo basalt
#

probably an enum LANGUAGE

humble tulip
#

this is what im thinking now

echo basalt
#

or actually a registry

#

like

#

I feel like the message handler itself should handle all the lang stuff

#

The end result would look like

humble tulip
echo basalt
#

LanguageHandler#sendMessage(CommandSender, MessageKey, Placeholder... placeholders)

#

type deal

humble tulip
#

there's so much spanish

#

i dont want users to have to make 7 files to support each es

#

that's the issue im currently having

echo basalt
#

you could make an inheritance system

gleaming grove
echo basalt
#

I made a brilliant system for this... 3 years ago

gleaming grove
#

what's wrong?

#

what to improve?

humble tulip
#

i can do this

#

so one file can be used for multiple country locales

#

and the Map<String, Locale> in LocaleManager class will just have en_US, en_AU and en_UK all mapped to the same locale

#

actually

#

i think this works

#

haha typing it out solved my problem

echo basalt
#
public class LanguageRegistry {

  private final Map<String, Language> languages = new ConcurrentHashMap<>();

  public LanguageRegistry(JavaPlugin plugin) {
    load(new File(plugin.getDataFolder(), "langs"));
  }

  private void load(File folder) {
    if(!folder.exists()) {
      boolean created = folder.mkdirs();

      if(!created) {
        // uh... IO error?
        return;
      }
    }

    Map<String, String> dependencyMap = new HashMap<>();

    for(File languageFile : folder.listFiles()) {
      if(languageFile.isFolder()) {
        // We don't want nested folders, this is an invalid state
        continue;
      }

      FileConfiguration configuration = YAMLConfiguration.loadConfiguration(languageFile);

      String languageId = languageFile.substring(0, languageFile.lastIndexOf(".") - 1));
      Language language = new Language(configuration);

      register(languageId, language);

      String dependencyId = configuration.isSet("dependency") ? configuration.getString("dependency") : null;

      if(dependencyId != null) {
         dependencyMap.put(languageId, dependencyId); 
      }
    }

    for(Map.Entry<String, String>> entry : dependencyMap) {
      String languageId = entry.getKey();
      String dependencyId = entry.getValue();

      Language source = getLanguage(languageId);
      Language master = getLanguage(dependencyId);

      if(master == null) {
        // This language is set as a dependency, but doesn't exist
        continue;
      }

      source.setInheritedLanguage(master);
    }
  }

  public void register(String name, Language language) {
    languages.put(name, language);
  }

  public Language getLanguage(String id) {
    return languages.get(id);
  }
}
#

something like this

#

this is out of my head, might be missing indentation

humble tulip
#
    private void loadLocales() throws IOException, InvalidConfigurationException {
        List<String> inJar = findLocaleResources();
        for (String s : inJar) {
            this.saveResource(s, true);
        }

        File langFolder = new File(plugin.getDataFolder(), "lang");

        for (File localeFile : langFolder.listFiles()) {
            if (localeFile.isDirectory())
                continue;
            
            if (!localeFile.getName().endsWith(".yml"))
                continue;

            FileConfiguration localeConfig = new YamlConfiguration();
            
            localeConfig.load(localeFile);

            //load it here
        }
    }
#

this is what i have

gleaming grove
#

ye but what's wrong with my solution besides I not using ConcurrentHashMap?

humble tulip
gleaming grove
#

oh right, that a thing

echo basalt
#
public class Language {

  private final Map<MessageKey, List<String>> cachedMessages = new ConcurrentHashMap<>();
  
  @Nullable
  private final Language inheritedLanguage;

  public Language(FileConfiguration configuration) {
    load(configuration);
  }

  private void load(FileConfiguration configuration) {
    // if it's a string, we just make an immutable list of size 1
    // This allows support of multi-line messages
    ...
  }

  public void setInheritedLanguage(Language master) {
    if(master.getInheritedLanguage() == this) {
      // circular dependency? odd
      throw new IllegalStateException("Circular language dependency");
    }

    this.inheritedLanguage = master;
  }

  public List<String> getMessage(MessageKey key) {
    if(key == null) {
      return Collections.emptyList();
    }

    List<String> messages = cachedMessages.get(key);

    if(messages == null) {
      if(inheritedLanguage == null) {
        return Collections.emptyList();
      }

      return inheritedLanguage.getMessage(key); 
    }

    return messages;
  }
}
#

type deal

#

Now,

#
public class PlayerLanguageTracker {

  private final LanguageRegistry registry;
  private final Map<UUID, String> selectedLanguages = new ConcurrentHashMap<>();

  public PlayerLanguageTracker(LanguageRegistry registry) {
    this.registry = registry;
  }


  public void setLanguage(Player player, String language) {
    setLanguage(player.getUniqueId(), language);
  }

  public void setLanguage(UUID playerId, String language) {
    selectedLanguages.put(playerId, language);
  }

  public Language getLanguage(UUID playerId) {
    String selectedLanguage = selectedLanguages.get(playerId);
    
    if(selectedLanguage == null) {
      return null;
    }

    return registry.getLanguage(selectedLanguage);
  }

  ...

  public void sendMessage(Player player, MessageKey key) {
    if(key == null) {
      throw new IllegalArgumentException(key);
    }

    Language language = getLanguage(player);
    
    if(language == null) {
      // critical error, player has no language?
      return;
    }

    List<String> messages = language.getMessages(key);

    for(String message : messages) {
      ...
    }
  }
}
#

type deal

#

add track(), untrack() methods to this registry

#

you know the deal

humble tulip
#

oo

#

i like the inheritiance

echo basalt
#

2 registries, 1 data class

#

You'd just call PlayerLanguageTracker#sendMessage all the time

#

sendMessage(player, NO_PERMISSION)

#

type deal

#

idfk

#

wrote all of this out of my head

kind hatch
#

Use the bukkit scheduler to run that task.

#

?scheduling

undone axleBOT
vague swallow
#

Can someone please tell me what's wrong about this scheduler? For some reason it's only repeating 1 time instead of 5:

taskID = Bukkit.getScheduler().scheduleSyncRepeatingTask(Main.getPlugin(), new Runnable() {
      int number = 5;

      @Override
      public void run() {
           if(number <= 0) {
               Bukkit.getScheduler().cancelTask(taskID);
           } else {
               p.sendMessage("" + number);
               number--;
           }
      }
}, 0, 5);```
humble tulip
#

let me see the messge it sends you

granite burrow
#

How would I be able to change the message that appears when the player changes an item in their hot bar?

My goal would be to change that to a custom multi line string, or remove it and only use the action bar

Example:

kind hatch
granite burrow
#

darn, also the item name is displayed on a separate line than the action bar

kind hatch
#

Yep, you would need packets to send messages there.

granite burrow
#

darn okay :/ Looks like I gotta make a mod then

maiden thicket
humble tulip
#

@maiden thicket it's on the wiki.vg protocol page as well

#

let me find it

#

here

maiden thicket
#

ohh

#

it does

humble tulip
#

:v

maiden thicket
#

nvm

#

it does not

#

:sadge:

#

O

#

i see

tranquil stump
buoyant viper
#

wynncraft is in fucking sane tbh

sullen marlin
#

depending on your version there are packets to delete chat

echo basalt
#

you can notice it flickering once or twice

echo basalt
#

codebase needs to be hella organized

#

not technically advanced, just the basics really well

tranquil stump
#

Has someone made an api for this or will I have to go make one tomorrow?

sterile axle
#

bukkit conversation api is pretty sexy for that, but not as custom as wynncraft's

sterile axle
#

this is extremely contrived but, well, it might get you somewhat started

#
public final class TestConversationsPlugin extends JavaPlugin implements Listener {
    private ConversationFactory factory;
    private final Map<UUID, Conversation> convos = new HashMap<>();

    @Override
    public void onEnable() {
        factory = new ConversationFactory(this)
                .withLocalEcho(true) // sender can see own messages in the convo
                .withModality(true) // suppresses other chat for duration of convo
                .withTimeout(30) // will cancel the convo if no activity for 30 secs
                .withFirstPrompt(new FirstPrompt()); // convo starts with FirstPrompt (below)

        getServer().getPluginManager().registerEvents(this, this);
    }

    @EventHandler
    public void onJoin(PlayerJoinEvent event) {
        final Player player = event.getPlayer();
        final Conversation convo = factory.buildConversation(player);
        convos.put(player.getUniqueId(), convo);
        convo.begin();
    }
    
    @EventHandler
    public void onShift(PlayerMoveEvent event) {
        final Player player = event.getPlayer();
        if (player.isConversing() && player.isSneaking()) {
            final Conversation convo = convos.get(player.getUniqueId());
            if (convo != null) {
                convo.outputNextPrompt();
            }
        }
    }
}
#

Then just need some prompts

    public final class FirstPrompt extends MessagePrompt {
        @Override
        protected Prompt getNextPrompt(ConversationContext context) {
            return new SecondPrompt();
        }

        @Override
        public String getPromptText(ConversationContext context) {
            return "Hey! Welcome to the conversation...\nPress shift to go to the next prompt...";
        }
    }

    public final class SecondPrompt extends FixedSetPrompt {
        @Override
        protected Prompt acceptValidatedInput(ConversationContext context, String input) {
            return Prompt.END_OF_CONVERSATION;
        }

        @Override
        protected boolean isInputValid(ConversationContext context, String input) {
            return input.toLowerCase(Locale.ROOT).matches("a|b|c");
        }

        @Override
        public String getPromptText(ConversationContext context) {
            return "Choose A, B, or C.";
        }
    }

more: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/conversations/package-summary.html

kindred valley
#

Ok

soft viper
#

Can i get a list of plugins with bungeecord?

#

plugins on spigot servers

fluid river
#

well, you can send plugin message to spgiot server

#

then with a plugin on spigot server you can try looping through files in plugins folder, adding names to the list

#

and then send the result back to bungeecord with another plugin message

soft viper
#

Yes, but I want to know if the server has spigot version of my plugin

#

To know if i should work with this server

fluid river
#

well, you can register an incoming channel

#

and each time some spigot server send info from your spigot plugin, connect it to network or smth

#

i don't rly like plugin messaging cuz of it's limitations

#

requires player on a server

soft viper
#

yes

fluid river
#

sql and redis are better

#

you can try sql for that

soft viper
fluid river
soft viper
fluid river
soft viper
#

Thanks

fluid river
#

might help you

charred blaze
#

import org.bukkit.Bukkit;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerCommandPreprocessEvent;

public class Commands implements Listener {
    @EventHandler(ignoreCancelled = true)
    public void onCmd(PlayerCommandPreprocessEvent e) {
        if (e.getMessage().equalsIgnoreCase("gmc")) {
            Bukkit.dispatchCommand(e.getPlayer(), "gm creative");
        }
        if (e.getMessage().equalsIgnoreCase("gms")) {
            Bukkit.dispatchCommand(e.getPlayer(), "gm survival");
        }
        if (e.getMessage().equalsIgnoreCase("gma")) {
            Bukkit.dispatchCommand(e.getPlayer(), "gm adventure");
        }
    }
}
#

why isnt this working?

jagged monolith
#

Are you getting any errors? Did you register the event in the onEnable event?

#

An that's not really how you make commands either

charred blaze
#

im not getting any errors

#

when im typing /gmc

#

it says /help

sterile axle
#

you can sorta kinda make commands that way i guess but...erm. wat.jpg

#

the message in the PlayerCommandPreprocessEvent would be prepended with a /

#

so you need to check /gmc, /gms, /gma etc...

#

atm you would literally type the message gmc as if it were a normal chat message and that's probably going to trigger it

orchid gazelle
#

why redis over sql for messaging you may ask? 1. redis is a lot faster, already has a message broker included + does not need to write your data persistently on your drive, so you will even save server resources and your drive

vague swallow
#

and then nothing anymore

remote swallow
#

what you trying to do?

vague swallow
acoustic widget
#

Hello I'm trying to unregister custom command (BukkitCommand) using my unregisterCommands method... But doesn't work..
How can i do that ? https://pastebin.com/yCfaDd8C
.unregister return true but i can still see and use command ig

remote swallow
vague swallow
#

Saw that in a tutorial

#

How would you make a repeating task?

remote swallow
#

one moment ill type something up

vague swallow
#

Thanks!!

hazy parrot
#

How would you make scheduler without runnable?

remote swallow
#
int number = 5;
Bukkit.getScheduler().runTaskTimer(Main.getPlugin()/* use di pls */, task -> {
    if (number == 0) {
        task.cancel(); /* might be something else idk, dont have ide open */
    } else {
        p.sendMessage(String.valueOf(number));
        number--;
    }
}, 0, 5);
remote swallow
hazy parrot
#

That is still representation of runnable, just not anonymous class

#

But whatever ig

remote swallow
#

the formatting might be a bit off because i didnt want to open an ide

vague swallow
remote swallow
#

ah, forgot about that. Easiest way to fix it i can think of atm is just making number static

#

anyone feel free to correct me

vague swallow
#

static isn't allowed there

kind hatch
#

Any reason you don't just use a bukkit runnable?

new BukkitRunnable() {
  int number = 5;

  @Override
  public void run() {
    if(number <= 0) {
      cancel();
    } else {
      System.out.println("" + number);
      number--;
    }
  }
}.runTaskTimer(this, 0, 5);
vague swallow
kind hatch
#

Trying to create a system that announces when everyone in a list of players earns a specific advancement, but I'm not sure what the best approach would be.

vague swallow
#

how to I get the position of the block 5 blocks away from the player in his viewing direction?

remote swallow
#

what they are looking at or just 5 straight ahead of them

vague swallow
remote swallow
#

i cant think of the code for it rn but the best option you have is #getBlockAt their location + 5 or - 5 from the X or Z they are facing

shadow zinc
#

?paste

undone axleBOT
shadow zinc
#

why is the chat input field not prepopulated with initialKeyValue?

stoic vigil
#

hey! sometimes if this gets exectued, i get kicked with the reason on the img

public void sendChat(Component message) {
  Bukkit.getOnlinePlayers().forEach(player -> player.sendMessage(message));
}
#

what do i have to change?

chrome beacon
#

That looks like Paper API

#

Ask them

stoic vigil
#

lol thats a that huge difference?

jagged monolith
#

This is spigot. you won't get help for PaperAPI here.

remote swallow
#

spigot uses strings, paper uses components

#

they are completely different

vague swallow
#

?whereami

vague swallow
remote swallow
#

happened about here

vague swallow
remote swallow
#

lol

frank kettle
#

Anyone knows which event is called when a player successfully trades with a villager? so far on google search threads only found when a player opens the menu or clicks on a item to trade. not the trade itself.

remote swallow
#

just checked the jds and it appears there isnt one

frank kettle
#

i was checking the events list as well and couldn't find anything about trading or villagers on player events

remote swallow
#

theres trade select and some villager ones but none for a trade being completed

frank kettle
#

well, i can store the inventory when a player clicks on villager and when they close the Merchant inventory check if there was any change on the inventory

#

but people can drop items to each other in between those

remote swallow
#

one sec let me get my choco out

remote swallow
#

Spigot/Bukkit would probably love a pr for that

frank kettle
#

arent those the ones?

remote swallow
#

?contribute

remote swallow
#

i would guess the first one is for when a villager gets a new trade

#

the last one is probably for when they restock

frank kettle
#

3rd is when a villager upgrades and gets a new trade

cunning lotus
#

how do i change the owner of the player head

signal mountain
#

so i need help with something
i want to make something that if you type a message like "hello world" its get changed byt another thing

cunning lotus
#

what im trying to do is

frank kettle
#

oh, and 4th is just when the villager replenish his trades

cunning lotus
#

spawn invisible armor stand with a custom player head

frank kettle
#

none for when the trade is successfull

tender shard
remote swallow
vague swallow
signal mountain
vague swallow
#

and check if the message is "hello world"

frank kettle
#

So there's really no event when a trade is done? 🥹

remote swallow
#

sadly not

vague swallow
remote swallow
#

?stash one sec

undone axleBOT
signal mountain
tender shard
remote swallow
frank kettle
remote swallow
#

check the slot num

tender shard
#

Yeah

vague swallow
# signal mountain ok thx
@EventHandler
public void onMessageSend(AsyncPlayerChatEvent event) {
  if(event.getMessage().equals("hello world") {
    event.setMessage("your text here")
  }
}
remote swallow
#

couldnt tell you what number it is just make a quick listener for the click event, and set the item to something with the name of its slot number

frank kettle
#

so if they click on the trading item(the slot on the far right) basically?

remote swallow
#

yeah

frank kettle
#

how to know if it was successfull tho? 🤔

remote swallow
#

check if the item isnt null

frank kettle
#

let me check again how trades work

frank kettle
tender shard
#

How can it be unsuccessful o0

remote swallow
#

if the item is null nothing happened

frank kettle
#

ah true

#

the item

#

only shows if u can trade at all

tender shard
#

Yes

remote swallow
#

yea

frank kettle
#

playing mc for so many years and forget something so trivial 😔

vague swallow
frank kettle
#

ty for the idea guys, will try

frank kettle
#

that would make all of the trades the same

vague swallow
#

oh well yeah then nvm

frank kettle
#

i will do like epic and alex said

charred blaze
#

Error within error (??!!!! SOMETHING WENT SUPER WRONG!): Internal exception was thrown!

#

what the hell

#

is this

undone axleBOT
tardy delta
#

always fun when jvm crashes

#

even more fun when it happens due to worldedit

remote swallow
undone axleBOT
frank kettle
#

its slot 2 and if its AIR then its not a trade

remote swallow
#

loots like it

#

best to check for null too

#

can be either

frank kettle
#

i did check for null too

remote swallow
#

that should work how you want then

frank kettle
#
@EventHandler
    public void onTradingVillager(InventoryClickEvent event) {
        if (event.getClickedInventory() == null) return;
        if (event.getClickedInventory().getType() != InventoryType.MERCHANT) return;
        if (event.getCurrentItem() == null || event.getCurrentItem().getType() == Material.AIR) return;
        event.getWhoClicked().sendMessage("Clicked slot: " + event.getSlot());
        event.getWhoClicked().sendMessage("Clicked item: " + event.getCurrentItem().getType().toString());
    }```
#

yeah, now its good

remote swallow
#

make sure you listen to the inv drag event too

frank kettle
#

just need to add a check for slot if its 2

frank kettle
frank kettle
#

i know what it is but why

cunning lotus
remote swallow
#

as in?

cunning lotus
#

do i just set players name inside " " ?

#

or something else

frank kettle
remote swallow
#

i would guess the even is called when they click somewhere then drag those items over there inv

#

i havent looked at source so it might now

frank kettle
#

it happens when u click on the item of the trade

#

if u check for the slot 2

#

then u can drag it or with shift insta send to inv

remote swallow
rotund ravine
#

Saw someone try to use kotlin on the forums yesterday, we are invading :strong_arm:

eternal oxide
#

Time for some bleach

remote swallow
#

kotlin just looks funny

rotund ravine
#

Though most people just use it as java

frank kettle
glossy venture
#

is there documentation on the BungeeCord plugin.yml (bungee.yml)
and can i define libraries to load on start like bukkit with the libraries: block?

remote swallow
#

instead of our nice

@EventHandler
public void onMove(PlayerMoveEvent event) {
    event.setCancelled(true);
}

you have some fucking weird shit like this

@EventHandler
fun onMove(PlayerMoveEvent: event) {
    event.setCancelled(true);
}
``` or some bs like that
rotund ravine
remote swallow
#

you what

remote swallow
tender shard
rotund ravine
remote swallow
#

i cant like being able to do method() would be cool

frank kettle
#

any idea for the villager trades thing?

#

it only returns as 1 amount

rotund ravine
rotund ravine
#

code?

frank kettle
#
@EventHandler
    public void onTradingVillager(InventoryClickEvent event) {
        if (event.getClickedInventory() == null) return;
        if (event.getClickedInventory().getType() != InventoryType.MERCHANT) return;
        if (event.getCurrentItem() == null || event.getCurrentItem().getType() == Material.AIR) return;
        if (event.getSlot() != 2) return;
        event.getWhoClicked().sendMessage("§7§oTrade successfull.");
        ItemStack i = event.getCurrentItem();
        event.getWhoClicked().sendMessage("" + i.getType().toString() + " (" + i.getAmount() + ")");
    }```
remote swallow
#

if the villager only trades X and X for Y(1) just check the count for amoung

frank kettle
rotund ravine
#

that's one emerald

frank kettle
#

villgaer only trades 1 at the time but we can trade more

remote swallow
#

check the count

frank kettle
#

is there a way to know how many the person gets?

remote swallow
#

check how many emeralds they get

#

if they always get one the amount is the size of the stack

rotund ravine
#

They will always get one unless they click two times, or shift click

frank kettle
#

yeah shift click

#

clicking two times is fine

rotund ravine
frank kettle
#

so check if its shift click and do the math myself?

rotund ravine
#

Most likely

frank kettle
#

well

#

the question i have is

#

how do i know what trade the villager is doing?

#

is there any code for that?

rotund ravine
#

Get the inventory clicked, check if it's a merchantinventory type and get the selected recipe

frank kettle
#

will do

#

was asking in case there was a simpler way.

remote swallow
rotund ravine
#

Well that is already what the above can do.

frank kettle
#

u will never know if they traded more that way

remote swallow
#

is that possible?

frank kettle
#

i will check for merchantinventory on shift clicks

frank kettle
remote swallow
#

ah yeah, just adding the items in

frank kettle
#

u can just put the items inside and trade for first thing

remote swallow
rotund ravine
# frank kettle yes

I mean, you can take a snapshot of the player inventory before and after and compare the difference lol.

frank kettle
#

specially if u want to tell potatoes or smth at first

frank kettle
#

i will just check if its shift clicks and the trade

#

oh no guys

#

it seems like if i check whats the price for a thing, it returns 0 because the inventory click event "happens after the trade" and the trade doesnt exist anymore since Shift click trades all of it....

#

🥹

rotund ravine
#

lol

#

?jira

undone axleBOT
frank kettle
#

time to cancel shift click

austere solstice
#

Hi, firstly how should I paste code here? 😄

jagged monolith
#

?paste

undone axleBOT
austere solstice
#

thanks

rotund ravine
#

What is the errors?

vague swallow
#

How can I stop a fireworkrocket from exploding because of a player in it's way?

austere solstice
chrome beacon
#

All of it

rotund ravine
summer scroll
eternal oxide
#

because you are not sorting your completions based on the args

dry yacht
remote swallow
#

StringUtil.copyPartialMatches

summer scroll
#

I don't understand, how can I filter it? Any examples?

frank kettle
eternal oxide
#

line 6 you literally add the players name

frank kettle
#

never tried tho.

summer scroll
remote swallow
#

yes

summer scroll
#

Alright, let me try it, thanks.

frank kettle
#

just make sure u cancel it when they teleport 😂

summer scroll
#

What should I put on the first argument?

#

In that case args[0]?

remote swallow
#

return StringUtil.copyPartialMatches(args[num], list that you would return without this, new ArrayList<>())

dry yacht
eternal oxide
#

utils is basically what .Net is

summer scroll
#

It's working perfectly, thank you so much guys!

cunning lotus
#

how do i constantly add velocity to the armor stand

dry yacht
dry yacht
cunning lotus
#

i can use a loop to check if the armor stand exists if it exists add "amount of velocity" per tick but how do i add velocity to the facing direction

summer scroll
dry yacht
gilded knot
#

What's the basic usage of scoreboard management?

dry yacht
# summer scroll I kinda understand it, I wasn't know that I actually need to sort the List by my...

Didn't mean it in any bad way. It's just that most people go ahead and call any utility without actually thinking about why that solves their problem. I myself (haven't been coding plugins in a while tho) used to create my own wrapper around the standard tab completer function to also get the current argument index, which is is basically determined by how many args there already are. By using streams I can also limit the max. number of responses in a centralized manner and do not have to filter out list items I don't need anyways.

#

This was my wrapper.

gilded knot
dry yacht
frank kettle
gilded knot
#

Basically

#

I'm making a "Defend the Nexus" type of game

#

I want to make a scoreboard which shows all 4 Nexus' HP

#

I have a screenshot wait

#

Like this

frank kettle
#

so u want to do that scoreboard?

#

or thats what u have right now

gilded knot
dry yacht
#

All players view the same data, right?

gilded knot
#

Yup

frank kettle
#

i would recommend using teams and updating the teams when hp changes of a nexus

dry yacht
#

Then one scoreboard, created at init time, would be enough, which you send to all players.

gilded knot
#

but what's the basic usage?

#

how do I make one*

frank kettle
#

well, im pretty sure u can find it online if u want examples of code

#

have u searched at all?

gilded knot
#

Roughly

#

nvm found a thread

frank kettle
#

there's so many tutorials out there

#

its easy to find on how to do it

gilded knot
#
static Plugin plugin;
ScoreboardManager manager = Bukkit.getScoreboardManager();
    final Scoreboard board = manager.getNewScoreboard();
    final Objective objective = board.registerNewObjective("test", "dummy");
    @EventHandler
    public void PlayerJoin(PlayerJoinEvent e) {    
        final Player p = e.getPlayer();
        Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(Main.plugin, new Runnable() {
            public void run() {        
                ScoreboardManager manager = Bukkit.getScoreboardManager();
                final Scoreboard board = manager.getNewScoreboard();
                final Objective objective = board.registerNewObjective("test", "dummy");        
                objective.setDisplaySlot(DisplaySlot.SIDEBAR);
                objective.setDisplayName(ChatColor.RED + "YourScoreboardTitle");
                Score score = objective.getScore("Score10");
                score.setScore(10);            
                Score score1 = objective.getScore("Score9");
                score1.setScore(9);        
                Score score2 = objective.getScore("Score8");
                score2.setScore(8);                        
                Score score3 = objective.getScore("§6Colors");
                score3.setScore(7);        
                p.setScoreboard(board);
            }
        },0, 20 * 10);
   
    }

}
frank kettle
#

I was about to give you code but better if you learn how to search it.

austere solstice
gilded knot
frank kettle
#

you do need 😂

gilded knot
#

It's just a universal scoreboard which shows everyones' Nexus HP

frank kettle
#

to update the nexus HP

gilded knot
#

ah aight

frank kettle
#

well, u gonna update the score

#

then their "order" will keep changing

#

cause higher number goes higher on the lines

gilded knot
#

Yeah I know

#

I don't have an issue with that

frank kettle
#

i would recomemnd doing like every server does

#

and updating the teams

gilded knot
#

aight then

frank kettle
#

like this

#

u use the score to line them up the way you want

gilded knot
#

yep

frank kettle
gilded knot
frank kettle
#

are u coding on the latest versions?

gilded knot
#

1.19.2

frank kettle
#

alright then u should be fine

gilded knot
#

cheers

dry yacht
cunning lotus
#

i used baloon just as a name

dry yacht
cunning lotus
#

i want to make the armor stand go towards its facing direction

frank kettle
cunning lotus
#

at a constant rate

dry yacht
gilded knot
#

hm

dry yacht
#

I always wrote my own API on top of packets, I hate the scoreboard API.

gilded knot
#

by flickering you mean the scoreboard disappearing for like half a second

#

?

dry yacht
gilded knot
#

ah aight

kind hatch
frank kettle
#

everyone uses teams at this point

#

i didnt use teams for so long and its so good, not just the scoreboard but also for player "tags" above their head.

dry yacht
# kind hatch Don't let md hear that.

I'm sorry, but it just is that way. It has been initially implemented poorly and never got fixed up due to all of the backwards compatibility pressure.

frank kettle
#

I haven't found a problem with it

#

what's the issue?

gilded knot
#

@md_5 :trollface:

frank kettle
#

is it poorly efficient for big servers?

dry yacht
# cunning lotus how do i constantly add velocity to the armor stand

Oh, right... You want the constant movement, well then you'll need to either create your own armor stand with packets in order to avoid the server attaching physics and thus drag to it (slowing it down) and rendering your own vector in a separate task or you need to compensate for drag forces.

frank kettle
#

i just find it annoying the way to update it to all of the players, specially if u doing a minigame that requires tons of updates.

#

but always did the job

dry yacht
# frank kettle I haven't found a problem with it

It's way easier to have a mental model of what's actually going on and how to handle/update boards if you get full control. The client stores this board, so why can I not just update it by updating a score of the scoreboard? Telling someone "just use teams" is insanity. It just obscures the inner workings.

cunning lotus
#

so this basically means i don't have enough knowledge to achive what im trying to achive

#

im quite new i didnt understand what you are saying

frank kettle
#

if he doesnt care for the order then sure just update the scores.

cunning lotus
#

i just need to move this armorstand towards what its facing

dry yacht
dry yacht
frank kettle
#

it was just because of that and i said i recommended using teams

dry yacht
#

Teleporting it will only work if you let the delta in distance get small enough, which then requires to compensate with how often you teleport, if you want to have natural movements. I'd rather use packets, as the client interpolates between move packets.

#

Lol

dry yacht
#

Impossible.

#

Because even the server sends packets, lol

#

Kotlin can extend existing APIs, right? Extend the inventory, haha

#

Yes yes, I get what you mean, it should've been there a long time ago.

#

Yeah, I ment extending without implementing and having to carry your own impl around

#

Is there even a packet to update a window's title by it's ID? Don't remember anymore

chrome beacon
#

Well you just reopen a new window with the same id, right?

#

Is there a reason for the server to know what you're typing?

#

Not really so it does make sense

#

For vanilla

#

Not you

dry yacht
#

Yes, I do know about that, but you cannot change the title once the screen has been opened. You need to create a new screen.

#

Because mojang

dry yacht
#

1000iq, omg

#

So the window state persists when doing that?

#

That would legit be a gamechanger

#

Because so many people spam the whole state accross the nework to do inv-title animations

#

Yeah, I think I'm gonna try that now, just need to get into bukkit real quick. I need the latest windowID, i got some old reflection util of mine to read that somewhere on my disk here.

green prism
#

Is there any InventoryCloseEvent reason get method?

undone axleBOT
green prism
#

... it's only paper I think

green prism
#

I'm actually making an Util library...
The Util will be used to make Setup Inventories.
I want to get the reason, if it is "COMPLETED", event.setCancelled(false)
otherwise Inventory.reopen("this");

#

Is it a bad idea?

#

ProtocolRock?

#

to add the feature?

#

Yeah... I can do that
Do you have any alternative idea to do that thing?

gilded knot
#

stupid question

#

yknow PlayerRespawnEvent

#

what happens if i did event.setCancelled(true)

#

so the player would simply not just respawn?

chrome beacon
#

That's not the respawn event though :kekw:

valid basin
#

Would someone know how to exactly get total amount of kills from an entire team (like add up all the kills), and then divide it by the number of team members?
This is my current code:

            int team_amount = team.getMembers().size() + 1 + team.getOfficers().size();
            for (int team_kills : ProfileManager.getProfile(player).getStat(PlayerStat.KILLS) {
                
            }```
gilded knot
valid basin
#

But idk how to exactly get all kills from every player in a team and then add it up on top of each other

gilded knot
#

ah right

chrome beacon
#

He does?

hazy parrot
#

total amount of kills from an entire team

chrome beacon
#

and then divide it by the number of team members

#

If you don't want the average just skip the divide part

valid basin
#

yes

chrome beacon
#

Depends on what you want to do

spice shoal
#

guys i have a problem.

I want to create my first plugin but , when i do java -jar BuildTools.jar --rev latest in terminal , it say this:

kind hatch
#

Well, it's quite simple.

chrome beacon
#

Your desktop is in the onedrive folder

kind hatch
#

Don't run it in a onedrive folder.

chrome beacon
#

^

spice shoal
#

ok thanks guys

ancient plank
#

Onedrive is a mess sometimes

#

Rlly has it out for me

valid basin
#

wouldn't it be more lightweight to just add up the existing stats of players in a team instead of storing new variables?

spice shoal
#

Guys i have downloaded Git Bash but it say this

#

what i can do?

#

I mean? sorry I’m not very practical

chrome beacon
#

It will download git and continue

spice shoal
#

oh ok

dry yacht
#

I really cannot seem to get that to work, :(

gilded knot
#

Getting this error for some reason

dry yacht
gilded knot
#

kk

dry yacht
dry yacht
gilded knot
#

I mean, I don't see any package errors

#

kk

#

getting that too