#help-development

1 messages Β· Page 2107 of 1

supple elk
#

why can't I use the Factory class as the key?

feral socket
#

no, it gives you the block that's been hit.

knotty gale
#

where?

lost matrix
feral socket
#

i already sent you the link.

knotty gale
#

ik

feral socket
#

what does that function return? think for a second.

knotty gale
#

oh I mean how do I check which block is hit

if(event.getHitBlock() == )
supple elk
echo basalt
#

you can check its type, location etc

feral socket
#

lol, learn java

knotty gale
feral socket
#

you're not just gonna get all the answers

echo basalt
#

well shit you got some really bad guidance

#

I'm not here to babysit you and tell you what you want

quaint mantle
#

πŸ₯£

feral socket
#

gotta check if the arrow even hit a block first, as the function can return null

feral socket
#

who would that be

quaint mantle
knotty gale
#

I mean my b jgeez

lost matrix
#

But then you need the Map to have different types

#

Map<Class<? extends GameType<?>>, GameType<?>>

supple elk
#

meant to send that

supple elk
#

but apparently I'm providing a 'capture of' of the required type?

tardy delta
#

isnt it ? extends T?

lost matrix
supple elk
lost matrix
lost matrix
#

Nope. Game is completely abstracted away in your class. You dont need it anywhere.

supple elk
#

sorry, I'm not too experienced with generics

quaint mantle
#

Okay so, I have a question.

Let's say that I want to have a 0.5% chance that a player gets an item upon mining a block.
How would you do it so it has a 0.5% chance.

#

are you providing the item?

quaint mantle
#

or just an item in general

#

like the normal break item

#

I'm confused about the "chance" part.

supple elk
#

new Random().getNextFloat()

#

gives u a float between 0 and 1

supple elk
#

check if it's below 0.005

quaint mantle
#

use ThreadLocalRandom ^

#

why 0.005?

#

ohh okay.

supple elk
#

gives 0.5

kind hatch
#

Use one of the random classes Java provides and use a method that returns a decimal.

There’s Random & LocalThreadRandom.

supple elk
#

the chance that a random value between 0 and 1 is less than 0.005 is 0.5%

quaint mantle
#

But thank yall for the help!

supple elk
#

πŸ‘

supple elk
lost matrix
# supple elk fixed?

This would be the approach for your GameType registry

@SuppressWarnings("unchecked")
public class GameRegistry {

  private final Map<Class<? extends GameType<?>>, GameType<?>> gameTypeMap = new HashMap<>();

  public <K extends Game, T extends GameType<K>> T getType(Class<T> gameTypeClass) {
    return (T) gameTypeMap.get(gameTypeClass);
  }

  public <K extends Game, T extends GameType<K>> void registerType(T gameType) {
    gameTypeMap.put((Class<? extends GameType<?>>) gameType.getClass(), gameType);
  }

}
timber whale
#

What event should I use when I want to see when a leaf disappears when I break the trunk of the tree

#

I tried using the BlockFadeEvent, but It didn't activate

quaint mantle
#

the javadocs do wonders

timber whale
#

Oh i didn't see that

#

thank you

lost matrix
# lost matrix This would be the approach for your GameType registry ```java @SuppressWarnings(...

But a better approach would be to have a method for the typed class:

public abstract class GameType<T extends Game> {
  
  public abstract Class<GameType<T>> getTypedClass();
  
}

To reduce one cast:

public class GameRegistry {

  private final Map<Class<? extends GameType<?>>, GameType<?>> gameTypeMap = new HashMap<>();

  @SuppressWarnings("unchecked")
  public <K extends Game, T extends GameType<K>> T getType(Class<T> gameTypeClass) {
    return (T) gameTypeMap.get(gameTypeClass);
  }

  public <K extends Game, T extends GameType<K>> void registerType(T gameType) {
    gameTypeMap.put(gameType.getTypedClass(), gameType);
  }

}
supple elk
#

oh I can literally just cast

#

anything wrong with this?

#

why do I need to pass in generics to specify the Game?

spare prism
#

Hello. Why is the list empty?

    private static List<Long> adminRoles;
    public static void setupAdminRoles() {
        System.out.println("adm: " + Main.getInstance().getConfigManager().getConfig().getLongList("Discord.AdminRoles"));
        adminRoles = Main.getInstance().getConfigManager().getConfig().getLongList("Discord.AdminRoles");
        System.out.println("adminRoles: " + adminRoles);
    }
    public static List<Long> getAdminRoles() {
        return adminRoles;
    }
[22:11:58 INFO]: [DiscordUtils] adm: [905508941230915684]
[22:11:58 INFO]: [DiscordUtils] adminRoles: [905508941230915684]
    public static boolean isAdmin(Member member) {
        if(member != null) {
            System.out.println(BotController.getAdminRoles());
            System.out.println(new HashSet<>(BotController.getAdminRoles()));
            System.out.println(new HashSet<>(member.getRoles()));
            return Sets.intersection(new HashSet<>(BotController.getAdminRoles()), new HashSet<>(member.getRoles())).size() > 0;
        }
        return false;
    }
[22:12:01 INFO]: []
[22:12:01 INFO]: []
[22:12:01 INFO]: [R:Admin(905508941230915684)]
tardy delta
#

messaged should be pinned here

supple elk
#

no need for game generic

grim ice
#

why only toString and not fromString

#

me sad

ivory sleet
#

Mostly gonna be valueOf

spare prism
ivory sleet
#

no clue

#

But scatter out some breakpoints or print statements and debug your software

#

but ye

#

adminRoles = Main.getInstance().getConfigManager().getConfig().getLongList("Discord.AdminRoles");

#

feels like a good point to start with

#

how does your config look like

spare prism
ivory sleet
#

well obviously, something goes wrong as your config doesn't fetch those values

knotty gale
#

how do I check if a player has a certain potion effect?

spare prism
tardy delta
#

Player#hasPotionEffect?

spare prism
#

lmao

tardy delta
#

look at the docs

spare prism
ivory sleet
#

well

#

thats a completely different part of your code

spare prism
ivory sleet
#

literally not

#

Anyhow, for beginners, how about you sharing a larger proportion of your code base, it is fundamentally needed for anyone to assist you, especially when you ask us to debug state of your code

spare prism
#

?paste

undone axleBOT
ivory sleet
#

and where's setupBot invoked

spare prism
# ivory sleet and where's setupBot invoked
    @Override
    public void onEnable() {
        if(Main.getInstance().getConfigManager().getConfig().getBoolean("Discord.AsyncBotLoading")) {
            Bukkit.getScheduler().runTaskAsynchronously(this, () -> BotController.setupBot(configManager.getConfig().getString("Discord.BotToken")));
        } else {
            BotController.setupBot(configManager.getConfig().getString("Discord.BotToken"));
        }
    }
ivory sleet
#

and your ConfigManager looks like?

ornate mantle
#

how would i remove an nbt tag? I specifically want to remove the PublicBukkitValues tag

knotty gale
#
if(((LivingEntity) entity).hasPotionEffect(PotionEffectType.GLOWING)) {

any reason this wont work

ivory sleet
#
    if(member != null) {
        System.out.println(BotController.getAdminRoles());
        System.out.println(new HashSet<>(BotController.getAdminRoles()));
        System.out.println(new HashSet<>(member.getRoles()));
        return Sets.intersection(new HashSet<>(BotController.getAdminRoles()), new HashSet<>(member.getRoles())).size() > 0;
    }
    return false;
}
#

where is this invoked from?

ivory sleet
ornate mantle
ivory sleet
#

but essentially get the nms stack, yeet the nbt entry and put it where it needs to be

knotty gale
#

Yes i have defined the entity

#

nvm it does

lost matrix
ornate mantle
#

i want it gone from the item

lost matrix
ornate mantle
#

fuck

lost matrix
#

Why do you need them to be gone?

ornate mantle
#

im using an api that adds a random uuid in the PublicBukkitValues nbt thing

ivory sleet
#

which api

#

oh

ornate mantle
#

triumphgui

ivory sleet
#

well

ornate mantle
#

the mf-gui is different each time

ivory sleet
#

i believe matt has an option to avoid that

ornate mantle
#

ah

#

first name basis

lost matrix
ornate mantle
#

no lol

#

i just have a specific item on display

#

and it gives that specific item to the player

#

im not even modifying said item

#

it just magically appears

lost matrix
#

To me it just looks like a PDC entry. You can easily remove those.

ornate mantle
#

how do i do that

lost matrix
#

One moment

ornate mantle
#

You just would need to store them in the give command with the format bukkit stores them, which is under PublicBukkitValues

Then each key under that would be your NamespacedKey value.

/replaceitem entity @p armor.chest minecraft:diamond_chestplate{PublicBukkitValues:{"yourplugin:foo": 42}} 1

found this at https://www.spigotmc.org/threads/tutorial-storing-custom-data-on-itemstacks-in-1-13-2.354283/

ivory sleet
#

so Giorno

#

you can extend GuiItem

#

and return a stack w/o the value

ornate mantle
#

alr

#

lemme mess around with the source code

lost matrix
# ornate mantle how do i do that
  private static final NamespacedKey MF_GUI_KEY = NamespacedKey.fromString("minefallsbazaar:mf-gui");

  public static void removeKey(ItemStack itemStack) {
    if (itemStack == null) {
      return;
    }
    ItemMeta meta = itemStack.getItemMeta();
    if (meta == null) {
      return;
    }
    PersistentDataContainer container = meta.getPersistentDataContainer();
    container.remove(MF_GUI_KEY);
    itemStack.setItemMeta(meta);
  }
ornate mantle
#

bruh

#

thats literally what i was thinking

ivory sleet
#

or that

ornate mantle
#

then yall said nms

#

and i went nvm

ivory sleet
#

mye, well getting rid of the entry requires nms iirc

ornate mantle
#

i'll go with @ivory sleet's idea

#

because i dont wanna call the removekey method each time

ivory sleet
#

try smiles idea

lost matrix
#

Because you said you wanted to remove the whole PublicBukkitValues section

ornate mantle
#

i do

#

but im gonna extend the guiitem class

#

so that its never added

ivory sleet
#

yes well you'd in principle need to have your own field

#

which overrides it

ornate mantle
#

my field is gonna be at the root uh

#

level yes

#

root level

ivory sleet
#
    private ItemStack itemStack;

    public GuiItem(@NotNull final ItemStack itemStack, @Nullable final GuiAction<@NotNull InventoryClickEvent> action) {
        Validate.notNull(itemStack, "The ItemStack for the GUI Item cannot be null!");

        this.action = action;

        // Sets the UUID to an NBT tag to be identifiable later
        this.itemStack = ItemNbt.setString(itemStack, "mf-gui", uuid.toString());
    }


    public void setItemStack(@NotNull final ItemStack itemStack) {
        Validate.notNull(itemStack, "The ItemStack for the GUI Item cannot be null!");
        this.itemStack = ItemNbt.setString(itemStack, "mf-gui", uuid.toString());
    }


    @NotNull
    public ItemStack getItemStack() {
        return itemStack;
    }

#

(default)

lost matrix
#

Why does this gui api add keys to their ItemStacks?

ivory sleet
#

supposedly to identify the items later

ornate mantle
#

"to be identifiable later"

#

i really dont

#

wait why is it adding it to the itemstack

lost matrix
#

Sry but again: Thats so stupid

ornate mantle
#

it really is

#

i hope my entire plugin doesnt shit itself after ive done this

#

its just a massive pile of spaghetti

lost matrix
#

I would suggest using another GUI library to be honest...

grim ice
#

remember kids

#

dont reinvent the wheel

lost matrix
quiet ice
#

the only reason to reinvent the wheel is to get a round one

quaint mantle
#

wheres the joke

ivory sleet
#

actually smile

#

the lib uses it to identify it on click later on

quaint mantle
ivory sleet
#

where if the item is the expected item it'll run certain callbacks

quaint mantle
#

besides the nbt part, use pdc

lost matrix
quaint mantle
#

bruh it uses inventoryholder

ivory sleet
#

I'd assume so

#

I mean IH is nice apart from that it shouldnt be used

lost matrix
noble lantern
#

i never understood that

ivory sleet
#

because it may brick implementation

noble lantern
#

Is there a better way of handling checking inventories other than IH then? Cause my lib currently uses it, would be nice to change it

ivory sleet
#

apparently you have just ::equals

noble lantern
#

oh

#

fr

#

shit

ivory sleet
#

which should work

#

but like its way less object oriented

noble lantern
#

well, users on the end of my API wont ever see that

ivory sleet
#

so that's the only deemed disadvantage, mye

noble lantern
#

the backend of this looks nothing like normal java lmao

But front end for users is nice

ivory sleet
#

the gist if abstraction init

noble lantern
noble lantern
#

oh gist is abstraction

ivory sleet
#

I mean,

#

you have your set of interfaces

noble lantern
#

yeah its a FunctionalInterface api, same with commands too

sterile token
#

?learnjava momment

undone axleBOT
ivory sleet
#

such that if you wanna change the implementation of your actual behavior, consumers wont (likely) ever get affected by it

quiet ice
ivory sleet
#

lol

noble lantern
ivory sleet
#

mye

sterile token
#

What does the Functional annotation?

ivory sleet
#

FunctionalInterface?

sterile token
#

Yup

ivory sleet
#

just makes sure the interface annotated with it must only have a single abstract method

#

else it wont compile pretty much

sterile token
#

Hmn

quiet ice
#

It's just something for the compiler like @Override

sterile token
#

Didnt stand but ok

quiet ice
#

Only that the functional-interface annotation is actually visible at runtime

noble lantern
#

theyre nice tbh

#

been playing with them a lot lately

#

just played with annotations too last night and added em to the command lib

ivory sleet
quiet ice
#

Yeah functionalinterface is incredibly nice for lambdas

noble lantern
quiet ice
#

Basically it guarantees that any interface which has the annotation can be represented as a lambda

small lynx
quiet ice
#

I don't recall that you can create a currency with that plugin

small lynx
#

it is like Vault

quiet ice
#

Or well API, you must actually implement that currency in vault-style stuff

quiet ice
noble lantern
#

Why not like

#

use vault

quiet ice
#

Vault is kindof a pice of shit

small lynx
#

because Vault dont support multiple economies

noble lantern
quiet ice
#

But after implementing Treasury for two of my eco plugins, it isn't that great either

ivory sleet
#

What is so bad about vault apart from using doubles

small lynx
noble lantern
quiet ice
#

Not really

#

There is only one registered implementation

small lynx
#

?paste

undone axleBOT
small lynx
#

this is the class i have created to attempt to register XP custom economy

#

but i have NO IDEIA

#

on how i get currency from that class

#

and start to do things like giving xp to players

quiet ice
#

Oh you want to register an currency? That is not possible last time I checked - I am afraid

#

Or well actually there is a really stupid hack that would allow that but uh it's a hack

small lynx
#

this plugin API in my opinion is very bad documented

knotty gale
#

how do I make an item drop?

#

so like after a listener is executed

small lynx
#

yes but idk how i register my currency with that clas

noble lantern
#

time to add an economy system to my API and overrun vault

quiet ice
#

Only issue is that you have no control over the currency

#

Yeah, I think you'd have to go with my hack

small lynx
#

i really need a api like Vault that supports multiple economies

noble lantern
#

is the author of vault even around anymore

quiet ice
#

Basically you'd need to implement EconomyProvider which will basically redirect any calls to your currency and otherwise passes through the original impl

noble lantern
#

you could PR additions to that repo

quiet ice
#

Right now only really small changes will see the light of the day

#

Use Java 15

#

It does not, but it helps me indefinitely given that I can say "lol, xyz is null"

#

so what are the line numbers?

delicate lynx
#

1.7.10 πŸ’€

ivory sleet
#

the snippet

noble lantern
quiet ice
#

πŸ€¦β€β™‚οΈ I can read you know

delicate lynx
#

wtf is bSpigot

quiet ice
#

Punishment.getPunishment(x, y) is null

quiet ice
#

Which shall not be named

delicate lynx
#

oh

#

my bad, didn't know

noble lantern
#

lowkey that that stood for bstats or some shit

quiet ice
delicate lynx
#

I just got trolled

quiet ice
#

That being said without context I would think that you would refer to the site that offers premium plugins at a moral cost

#

what does data.getPunishments return?

knotty gale
quiet ice
#

Also you should crank up your IDE's pedantricness to the maximum when you have nullabillity annotations

noble lantern
#

and if you want it after a listener is executed

#

run it in a bukkit task

quiet ice
#

then you should get a StackOverflowError

knotty gale
noble lantern
#

not an ItemStack

knotty gale
#

oh ok

noble lantern
#

wtf

#

<link> is to not embed the link

#

but weird it shows the <>'s

eternal oxide
#

only on mobile

noble lantern
#

they need to show more love to discord mobile

flat olive
#

anybody have any ideas on how to make it so that enderpearls can go thru fence gates if they are opened

noble lantern
#

might be of help?

#

i would assume you could raytrace through the fence gate

#

and get the block on the other side

flat olive
#

rayTrace

#

sounds interesting

eternal oxide
#

Have you tried just cancelling the hit event?

flat olive
#

I have not

eternal oxide
#

if you cancel teh hit event, you shoudl then be able to take the pearls velocity, normalize it and add it to the pearls location

sinful tundra
#

?paste

undone axleBOT
flat olive
eternal oxide
#

no

#

You are adding a nomalized Velocity (Vector) to the pearls Location, putting it the other side of the gate

flat olive
#

Okay that makes sense

manic delta
#

How can I get the title of an inventory created in InventoryClickEvent?

mellow edge
#

how can I create my dad with spigot?

manic delta
#

I tried with Inventory.getTitle()

eternal oxide
#

event.getView()

manic delta
#

But getView what do

eternal oxide
#

it has a title

manic delta
#

get mouse inventory?

eternal oxide
#

event.getView().getTitle()

manic delta
#

Yes but

#

that gives me the inventory of the click?

eternal oxide
#

it gives you the view

#

The View has the title

manic delta
#

And what means with view

eternal oxide
#

Two inventories, one being the players

#

Top and Bottom

manic delta
#

🀨

mellow edge
#

can I at least create my brother with spigot

manic delta
#

Ok i will try

steel swan
#

hey, does anyone know a way to change whats on top of the tab and whats down the tab?

#

i cant seem to find anything

flat olive
#

How do I get the location of an enderpearl

steel swan
flat olive
#

for wherever it hits

steel swan
#

check when an enderpearl is thrown

flat olive
#

thanks

steel swan
#

and when it like dies

mellow edge
#

NullPointerExcpetion at line 1 world is null

undone axleBOT
flat olive
#

event.getEntity().getLocation()

mellow edge
#

but I tought nobody would be that creative lol

steel swan
mellow edge
#

ik the pain

#

and i didnt actally test it lol

noble lantern
steel swan
#

he will just drink milk

#

what he went to get...

#

SO

#

anyone knows how the change the top and the bottom of the tab?

#

like that for instance

knotty gale
#

how do I add potion effects to a player?

noble lantern
#

Cme?

#

Ohh

#

Its thrown when you try to modify a list by removing elements in a for loop

#

Yep, you can just have a toRemove list, then in your for loop add to that list what you want removed

Then call thatOtherList.removeAll(toRemove)

#

Or you can use iterators, either or

#

First solution is slightly more simple

#

like this

#

you can use iterators in a for loop

flat olive
knotty gale
#

this is kinda confusing

noble lantern
#

for (Something something : thatIterator) {
if (iterator.hasNext()) {
iterator.next(); // your object
iterator.remove()
}
}

#

List has a iterator() method

#

wait my for loop was fucked

#

sec

#

ignore toRemove warning

mellow edge
#

wtf

noble lantern
#

its just bc its a empty arraylist

mellow edge
#

are u using intellij and which plugin to have a picture as a background

noble lantern
#

Oh thats built into IntelliJ

kind hatch
#

Backgrounds are a feature of the IDE itself.

noble lantern
#

sec

patent horizon
#

how does one get the name of a group in luckperms

smoky adder
#

Hi I'm trying to make a custom .yml file but I can't I already looked on google I also asked for help yesterday on this channel but I always find errors, can you send me a guide?

noble lantern
#

damn wtf

#

ur fast

kind hatch
#

I'm quick with it

mellow edge
#

thats why I love intellij

#

it is costumizable

noble lantern
#

just do note

#

it takes a while to get transparent png's working

#

took me a while to figure it out

mellow edge
#

I dont need transparent image

noble lantern
#

youll want one trust, its rather annoying having the full screen be a picture

#

this bg kind of matched my theme too

mellow edge
#

it really did

noble lantern
noble lantern
vagrant flicker
#

Hi. I know this is super long ago, but did you ever figure this out?

sterile token
#

What does the getKeys(boolean) does?

noble lantern
#

lemme explain

sterile token
#

Allr thanks

noble lantern
#
key1:
   key2:
     key3:
#

say you have a file like this

#

if you use true

#

it will get ALL of those

kind hatch
smoky adder
noble lantern
#

if you use false, it will only get one

EG: getConfigurationSection("key1").getKeys(false); it will only provide you key2 and not key3 as well

#

but if you used true, it would return key2 and key3

vagrant flicker
kind hatch
#

#getKeys(false) returns all subnodes that belong to that parent.
#getKeys(true) returns all subnodes and their children.

kind hatch
patent horizon
#

yes

sterile token
#

So here if using getKeys(false) will return just test-1?

Items:
  test-1:
    Display: "&6Test"
    Material: Compass
    Lore:
      - "&7This is a test item."
      - "&7It has a lore line."
      - "&7It has another lore line."
    Slot: 1
    Command: ""
  test-2:
    Display: "&6Test"
    Material: Compass
    Lore:
      - "&7This is a test item."
      - "&7It has a lore line."
      - "&7It has another lore line."
    Slot: 1
    Command: ""
kind hatch
#

and test-2

noble lantern
#

^

sterile token
#

Oh ok

noble lantern
sterile token
#

So getKeys(true) will giveme each node and sub node

#

Thanks

kind hatch
#

Yea, but keep in mind that they all get added to a list.

Items.test-1
Items.test-1.Display
Items.test-1.Material
Items.test-1.Lore
etc
Items.test-2
Items.test-2.Display
etc

#

That what getKeys does. It returns a list of strings which represent a path.

noble lantern
#

now if only i could get the keys for my house that i lost last night

#

tried both true and false, but the path to find my keys never returned a valid value

kind hatch
#

That's because you used the wrong house as the path. πŸ˜›

#

getConfigurationSection("my-house").getKeys(true) instead of getConfigurationSection("my_house").getKeys(true)

noble lantern
#

OHH

#

i was using neighbors_house

#

ty!

sterile token
kind hatch
#

Yea, I meant to edit that message but didn't. :3

void shale
#

it is stupid question i doubt there is an easy way but is there maybe easy way to tell if right clicking the target has any action?
I made custom scroll thingy and i dont want to to active when i right click say button or open the door

sterile token
#
getPlugin().getItems().getConfigurationSection("Items").getKeys(false).forEach(name -> {
  getPlugin().getLogger().info("Loading item: " + name);
  ConfigurationSection section = getPlugin().getItems().getConfigurationSection("Items." + name);
  section.getKeys(false).forEach(value -> getPlugin().getLogger().severe(name + " key " + value));
});
#

So that will display every node and sub node? Shadow

kind hatch
#

Idk if my brain is working right, but I'm not used to writing streams/lambda. If you give me a few I can write out an example.

sterile token
#

Allr

void shale
#

or maybe actually it would be easier to prevent default right click action if i try to use my scroll

#

there is a function for preventing default event action right?

#

i vaguely remember that

kind hatch
#

@sterile token

for (String section : getConfig().getConfigurationSection("my-section").getKeys(false)) {
      // For simplicity's sake, make the full path a variable you can use later.
      String path = "my-parent-node." + section;
      
      // Access whatever variable you need with the path variable you just created.
      getConfig().get(path + ".whatever-i-need-to-access");

      // So if you need to get an integer
      getConfig().getInteger(path + ".my-inner-path-to-my-integer-value");
}
patent horizon
#
        Objects.requireNonNull(getCommand("store")).setExecutor(new LinksCommand());
        Objects.requireNonNull(getCommand("discord")).setExecutor(new LinksCommand());
        Objects.requireNonNull(getCommand("club")).setExecutor(new LinksCommand());``` how can i allow aliases of a command? this is npe-ing on load
kind hatch
void shale
#

i dont mean just entity, i dont want my scroll to activate on right click if i hold it and press on door, button, switch, trapdoor, etc. anything that has some action when i right click it

kind hatch
void shale
#

either that or the other way, cancel those actions when i right click scroll. so it either does default action or only my action. now say it opens door but also immediatly teleports me too

kind hatch
#

If so, cancel the event.

#

If they are holding a scroll.

flat olive
#

How would I check to see if a thread is already running or not?

kind hatch
kind hatch
void shale
#

well I will do it tomorrow but i will note that down. I made some nice progress today partually cause of nice help i got here today

flat olive
#
ExecutorService threadPool = Executors.newCachedThreadPool();
Future<String> futureTask = threadPool.submit(StartUp::doUpdates);

I'm executing this in my onPlayerJoin event, so I don't want this thread multiplying I only want to check if its not running then allow it to be used once

kind hatch
#

If you only want one thread, why not use Executors#newSingleThreadExecutor()?

flat olive
#

you can do that?

kind hatch
#

Yea

flat olive
#

so if another player joins that method wont be called because theres already an instance where it was called, and it wont work again until the thread is cancelled right?

kind hatch
#

Well, if you are calling the creation method in the onJoin method, then it will likely create another new thread. But, you could always call the #shutdown() method at the end of the method so that it gets deleted afterwards.

flat olive
#

what do you mean?

kind hatch
#

If you wanted to route all extra onJoin logic to one thread, create it outside of the onJoin method and have an way to access it inside the scope.

supple elk
#

any idea why this isn't working?

supple elk
#

as you can see it's created some data

flat olive
#

wait

#
        ExecutorService threadPool = Executors.newSingleThreadExecutor();
        if(threadPool.isTerminated()) {
            Future<String> futureTask = threadPool.submit(StartUp::doUpdates);
        }
#

Cant I just do this

kind hatch
#

So, you'd create a global variable either in that class or the main class. Executors#newSingleThreadExecutor().
Then you'd access that instance with the name you gave it.

ExecutorService threadPool = Executors.newSingleThreadExecutor();

public void onJoin(PlayerJoinEvent event) {
  threadPool.whateverYouNeed()
}
flat olive
#

if its terminated make a new thread else continue with on join

patent horizon
#

how do i use kyori minimessages to make a link with text

kind hatch
flat olive
#

uh it appears that would not work

#

here ill show you

flat olive
#

its supposed to be running a thread to look for changes from a mongodb changestream

#

then it recursively recalls another method that makes a new thread

#

however for my permissions node, when I join the server the players data is taken and put into mongodb cluster, the issue here is that the user gets no output of changes being made if they were just created, instead they have to rejoin

#

and I can freely make it as threads after so it works just fine but the issue is

#

whenever another user joins

#

a thread is made

#

so its going to keep stacking threads on the same method

kind hatch
#

But I feel like there is a simpler way to get a recently created value from mongo.

flat olive
#

Yeah I'm not quite sure, hopefully newSingleThreadExecutor doesn't create multiple threads

kind hatch
#

It doesn't, but it will create a new thread if one of the tasks given to it fails. So that it can finish the remaining tasks.

flat olive
#

Ah okay

#

that's actually good

sterile token
#

Shadown im really confused with nodes and sub nodes

kind hatch
#

What about?

sterile token
#

Do you remember my yaml?

gleaming grove
# supple elk

The error is ocured because the file path you want to load not meet Regex pattern [a-z0-9/._-].

kind hatch
#

Yes.

flat olive
#

well this is bad

#

its occurring twice and giving the users the same output

sterile token
#

Im creating an object based on each node and im still geting NPE

getPlugin().getItems().getConfigurationSection("Items").getKeys(true).forEach(name -> {
  Configuration node = getPlugin().getItems().getConfigurationSection(name);
  getPlugin().getLogger().info(name + " display " + node.getString("Display"));
});
earnest forum
#

configuration section

#

not configuration

sterile token
#

I know

#

But why im getting npe?

earnest forum
#

can you show the ya

#

yaml

sterile token
#

Yes

flat olive
#

oh omg

earnest forum
#

because a "spawnX: 15" is not a configuration section and will give you nle

#

npe

#

that's a value

kind hatch
#

I think you misunderstand what things are being returned.

sterile token
#

Im rlly annoyed with sections

earnest forum
#

is "name" not already a configuration section?

#

I don't usually work with lambdas I don't know

kind hatch
#

A ConfigurationSection is really just a path. Paths in yaml are separated with the period symbol. (.) So if you have a node that exists under another node (aka a subnode), then you will need to add the period to the path.

rootnode.subnode

#

What #getKeys(false) does is return a list of subnodes that are under a parent node.

#

So in your example. You would have a list of sections that would contain test-1 and test-2

sterile token
#

So which will be the code?

sterile token
kind hatch
#

You can iterate over that list with a foreach using a String.

earnest forum
#

what exactly is the NPE?

#

what's null

kind hatch
#
for (String section : #getConfigurationSection("path.to.my.section").getKeys(false)) {
}
sterile token
#

Why dont use lambda

earnest forum
#

clearer

sterile token
#

I dont know why people doesnt use them

kind hatch
#

Didn't care to jump on the bandwagon.

sterile token
#

They are amazing but its okay

#

No problem

#

now i want to solve my fucked issue

earnest forum
#

what's the NPE complaining about

gleaming grove
earnest forum
sterile token
#

Dont worry

gleaming grove
#

yes they have

sterile token
#

Jsut help me

earnest forum
#

oh ok

#

what's the NPE complaining about verano

sterile token
#

Im getting npe when calling node.get

#

No matter if calling getInt, getString, etc

earnest forum
#

node.get returns an object I think

sterile token
#

I know but just to explain

earnest forum
#

check if node is null

#

before getting

sterile token
#

Its null

#

I already checked

#

I dont kno why the fuck its null

kind hatch
#

That means that your path isn't correct.

sterile token
#

Its correct lmao

earnest forum
#

getKeys(true)?

kind hatch
#

Apparently not.

sterile token
#

My config its 100% okay i checked 10 times

earnest forum
#

what does the boolean actually do I never knew

kind hatch
#

Yea, it may be in the config, but the way you access it in the code may be wrong.

sterile token
#

So how i can fix it?

kind hatch
#

Are you adding the dots to your path? (.)

#

If you want to access a subnode, you need to have them.

earnest forum
#

AHHH

#

I know

#

you are getting the configuration section wrong

sterile token
#

for (String section : getConfigurationSection("Items").getKeys(false)) {
ConfiguractionSection node = getConfiguractionSection(section);
node.getString("display");
}

earnest forum
#

you have to do

sterile token
#

That its what i did without lamda

earnest forum
#

"Items."+name

#

nvm

#

see lambdas confusing

sterile token
#

Wouldnt string section contain: "Items.each-array-node"?

gleaming grove
earnest forum
#

yes

kind hatch
#

A ConfigurationSection is really just a string. At least it can be converted to one with the #toString() override.

sterile token
earnest forum
#

it says Configuraction

kind hatch
#

In your case, node is equal to the first element in the for each loop which is just test-1

earnest forum
#

is that in the code or a typo on discord?

kind hatch
#

Then, when it iterates to the next element, node will actually be test-2

#

So what can you do with that?

#

The following.

#

"Items." + node + ".Display"

#

Use that as the path.

#

That's the whole point of YAML

earnest forum
#

wait no i was right

kind hatch
#

Dealing with paths.

earnest forum
#

I was correct

#

when you get node

#

"Items."+name

sterile token
earnest forum
#

"name" doesn't include the Items section

kind hatch
#

Because ConfigurationSection is just a complicated middleman for what is actually a String.

gleaming grove
#

Literraly 2 line of code

sterile token
#

getKeys(true) doesnt return Items.test-1 and Items.test-2?

kind hatch
#

Yes, you need getKeys(false)

#

Also

#

Ok

#

Look

sterile token
#

πŸ€”

kind hatch
#

#getConfigurationSection() takes a string as a parameter. That string that you give it is the path that leads to a list of sections.

#

That way, you can use #getKeys(false) to get each name from the list.

#

You can use that name to complete the path.

earnest forum
#

you can think of the "Items" section as a list, when you loop it, it only returns the subnode name, not "Items.test-1"

#

as does a regular array list

sterile token
#

OHH OK

#

I thought the fucked getKeys() was returning the path + looped item

kind hatch
#

No, it only returns the names of any direct children within the path. IF you wanted the full path of all children, then you would use #getKeys(true)

sterile token
#

πŸ˜‚

earnest forum
#

I think personally using false is better

kind hatch
#
root-node:
  subnode1: # This is a child of root-node
    sub-subnode: 1 # This is a child of subnode1
  subnode2: # This is also a child of root-node
    sub-subnode: 2 # This is a child of subnode2
flat olive
#

using a change stream how can you get one field from whatever table was updated in mongodb

earnest forum
#

you have more control and can directly see what the subnode name is without any extra steps

#

having to remove the prefix "Items."

sterile token
#

Look code here and yaml file

gleaming grove
sterile token
earnest forum
kind hatch
#

@sterile token

Items: # This is your root node.
  test-1: # This is a child of Items
    Display: "&6Test"
    Material: Compass
    Lore:
      - "&7This is a test item."
      - "&7It has a lore line."
      - "&7It has another lore line."
    Slot: 1
    Command: ""
  test-2: # This is also a child of Items
    Display: "&6Test"
    Material: Compass
    Lore:
      - "&7This is a test item."
      - "&7It has a lore line."
      - "&7It has another lore line."
    Slot: 1
    Command: ""

What getKeys(false) does is return a list of section names based on the path that you give. So #getConfigruationSection("Items").getKeys(false) will return a arraylist that contains "test-1" and "test-2"

#

If you had more sections, the name of the node would also be in that list.

sterile token
#

πŸ˜‚

earnest forum
#

did the code work

sterile token
kind hatch
#

Because you aren't separating it with the dot

sterile token
#

😑

kind hatch
#

Why do you need #getKeys(true)?

flat olive
#

I mean like this :

 MongoChangeStreamCursor<ChangeStreamDocument<Document>> cursor = col.watch().cursor();

        System.out.println("Watching stream");
        ChangeStreamDocument<Document> next = cursor.next();
        assert next.getUpdateDescription() != null;
        System.out.println("Database has been updated! --> " + next.getUpdateDescription().getUpdatedFields());

        BasicDBObject query = new BasicDBObject();

I get the updated fields that get updated but what I want to do is get the table that was updated, you can do that by just using getUpdateDescription() method, however, it returns all of it as a json and I cant compare an entire set of json objects with a player that is currently on the server, I need to get the single string text found in "name" for whatever was updated and then I need to compare and see if the name in the updated field is equal to a user that is online on the server,
https://paste.md-5.net/uqesaquwuq.cs

kind hatch
#

Just use #getKeys(false)

#

And then take the value that's given to you and put it as part of the full path

sterile token
kind hatch
#

How else do you expect to get a value from your config? You need to provide a path.

#

If you don't want to rewrite it, make it a variable.

#

So you only have to change it once.

earnest forum
#

verano you know that you won't get a npe from the GetConfigSection method even if it's null

#

it's only until you use the section

sterile token
kind hatch
#

That's cause your using #getKeys(true) >.<.
USE #getKeys(false) PLEASE

flat olive
#

anybody know?

sterile token
earnest forum
#

overcomplicating

sterile token
#

Holy mommie its diff to explain

earnest forum
#

you complained about hard coding as if you would change it in the future, but you would need to come back anyways for the getKeys() line?

kind hatch
#

Because #getKeys(true) returns all paths. Unless your subnodes are all the same type, it wouldn't work. You have Strings, numbers, and a list. How do you expect to iterate over different types of data like that?

#

You don't.

#

Especially with a foreach

#

You need the same type of data to begin with.

earnest forum
#

does true loop children as well?

kind hatch
#

Yes

earnest forum
#

ah that's it

kind hatch
#

That's why you use #getKeys(false) and use the string it returns to make the full path.

sterile token
#

So code be:

getPlugin().getItems().getConfigurationSection("Items").getKeys(false).forEach(name -> {
ConfigurationSection node = getPlugin().getItems().getConfigurationSection("Items." + name);
getPlugin().getLogger().info("Loading item: " + name);
getPlugin().getLogger().info(node.getString("display"));
});

#

?

earnest forum
#

yes

kind hatch
#

No

#

You still need to separate your paths.

gleaming grove
kind hatch
#

Well hold on

sterile token
#

Oh lmao i didnt see the time

kind hatch
#

You're close

sterile token
#

In fact send full code shadown

#

Please im annoyed

earnest forum
#

he did put "Items."+name?

kind hatch
#

Yea, but if he wants to access the subnodes, he'll have to add onto the string.

#

So "Items." + name + ".whatever"

kind hatch
earnest forum
#

no but if you have the ConfigurationSection object you can call #getString() and that doesn't require a .

kind hatch
#

Oh, then he needs to Capitalize the name.

#

Paths are case-sensitive

earnest forum
#

he's changed it to "display"

#

lower cased

kind hatch
#

In the config as well?

earnest forum
#

yes

sterile token
#

yes

kind hatch
#

Then it should work.

sterile token
#

so now the code should work?

earnest forum
#

yes

flat olive
earnest forum
#

ye

sterile token
kind hatch
#

Try it and see. πŸ˜›

earnest forum
desert loom
#

it's as simple as

        ConfigurationSection parentItemsSection = getConfig().getConfigurationSection("items");

        for (String key : parentItemsSection.getKeys(false)) {
            ConfigurationSection childItemSection = parentItemsSection.getConfigurationSection(key);
        }
sterile token
flat olive
sterile token
#

Look the photo on top

earnest forum
#

you weren't doing that

sterile token
#

Holy yeath look on first photo

earnest forum
#

you weren't doing that.

#

look closely

#

at Theones example and your code

#

they were using the parent configuration section (Items) when getting the "node" object

kind hatch
#

Yea, turns out that the implementation for ConfigurationSection literally uses Strings.

Just use strings ffs.

earnest forum
flat olive
#

MongoDB Updated Field

sterile token
#

Holy shit still getting NPE when doing section.getString("display")

#

Im so fucked stressed

kind hatch
#

Any real reason why you need to use lambda for that? Like, wouldn't it be beneficial to understand how it works in "normal" java first. Then convert it?

sterile token
#

I understand how java works

kind hatch
#

Then why can't you just use that then?

sterile token
#

Because im having section issues

kind hatch
#

Performance difference isn't that significant.

sterile token
#

Dont worry

#

I just need to solve this issue

kind hatch
desert loom
#

what's your code now?

sterile token
#

getPlugin().getItems().getConfigurationSection("Items").getKeys(false).forEach(name -> {
ConfigurationSection node = getPlugin().getItems().getConfigurationSection("Items." + name);
getPlugin().getLogger().info("Loading item: " + name);
getPlugin().getLogger().info(node.getString("display"));
});

desert loom
#

is the npe because node is null?

sterile token
#

Its giving me npc when getting any value from node

#

Im so annoyed

#

And my code its exactly the same as yours

kind hatch
#

Literally just read my example. Like is it so hard?
It's not lambda, but holy fucking shit at least it works.

sterile token
#

I cannot understand non lamda

kind hatch
#

But you said that you understand java????

sterile token
#

Holy shit

#

I discovered the issue

#

I was always using the old items.yml file

#

🀑

#

1 fucked hour

desert loom
#

unfortunate.

sterile token
#

Yes lmao

echo basalt
sterile token
#

How do i compare itemstack with displayname and lore?

echo basalt
#

ItemStack#isSimilar

#

ItemStack#equals

sterile token
#

Its possible to do that on Interact event?

kind hatch
#

PDC is also another way

sterile token
#

PDc here doesnt exists

#

That why i dont use it

kind hatch
#

What? What version are you developing against?

echo basalt
#

probably 1.8

#

or 1.12

sterile token
#

So the only way its using isSimilar?

golden turret
#

when i do npm install module, does it install the dependency globally or >> ONLY << locally?

#

also, how do i disable this

#

im using the latest version of intellij

kind hatch
#

Pretty sure locally. I think you need the global flag for it to be installed globally.

kind hatch
#

Would appreciate some feedback on this.

quaint mantle
#

single responsibility programming

#

i forgot the name one sec

#

SRP, SOLID

warm trout
#

How can I remove an NPC from the tablist while keeping the skin

noble lantern
ebon coral
#
            worldCreator.generator(new VoidGenerator());
            final World world = Bukkit.createWorld(worldCreator);
            this.world = world;```
#

This doesn't seem to be working...

kind hatch
#

Not sure why there is so much hype around them. Sometimes it's even more complicated to read. Sure, in some cases it can be way faster and far slower in others, but I care more about readability than performance most of the time.

ebon coral
#

System.out.println("worlds - " + Bukkit.getWorlds()); prints [20:49:36 INFO]: [Prison] [STDOUT] worlds - [CraftWorld{name=world}] (no void world).

noble lantern
#

most the times i only use them for one line method referances

eg

something.forEach(Something::doSomething);

ebon coral
#

I tend to use somethings.forEach(something -> doSomething);

#

Not sure why

kind hatch
#

Same. If it can produce the same results, still be easily readable, and is faster. Then why not right?

noble lantern
ebon coral
#

Does it not load after creation?

noble lantern
#

Also i think i needs a type of chunk generate to actually generate that world, not sure

#

No worlds dont get automatically loaded either to my knowledge

ebon coral
#

That's what this is

#

    @Override
    public boolean shouldGenerateNoise() {
        return false;
    }

    @Override
    public boolean shouldGenerateSurface() {
        return false;
    }

    @Override
    public boolean shouldGenerateBedrock() {
        return false;
    }

    @Override
    public boolean shouldGenerateCaves() {
        return false;
    }

    @Override
    public boolean shouldGenerateDecorations() {
        return false;
    }

    @Override
    public boolean shouldGenerateMobs() {
        return false;
    }

    @Override
    public boolean shouldGenerateStructures() {
        return false;
    }

    @Override
    public Location getFixedSpawnLocation(final @NotNull World world, final @NotNull Random random) {
        return new Location(world, 0, 175, 0);
    }

}```
#

There's no load world method though.. only unload?

noble lantern
half leaf
#

any1 knows how to make a player Invulnerable in 1.8.9
i used to do isinvulnerable
but apparently it aint a thing in 1.8.9

ebon coral
#

Multiverse Core loads it but it bugs out

#

I don't want to use any external API's or plugins for this- just the inner VoidGenerator and the world creation by itself.

noble lantern
half leaf
#

o okay

noble lantern
#

any errors in console?

ebon coral
#

No errors, it just loads like 20 center chunks empty- then the rest have normal biomes.

#

I assume it has something to do with Multiverse-Core not getting the generator.

golden turret
#

how can i open a powershell inside a phone?

ebon coral
#

What does this have to do with Spigot lol

golden turret
flat olive
#

can anyone answer my thread please? Been waiting a few hours

noble lantern
gleaming grove
#

Is it possible to how-swap plugin code while server is running?

noble lantern
#

also you should be able to just teleport that player to that world once its created

#

player.teleport(thatWorldsSpawnLocation);

ebon coral
ebon coral
#

It's deprecated lol

#

I was correct

#

My method is the latest

gleaming grove
waxen plinth
#

Then no, not really

noble lantern
#

Yeah was checking java docs, i think i know the issue

waxen plinth
#

You could potentially have classes that are dynamically loaded from a folder or something

#

But that's just a bad solution

waxen plinth
#

Why do you need such a thing?

ebon coral
#

Just use Skript (joke please don't)

gleaming grove
#

because now I need to type /disable <MyPlugin> everytime I want to build my code

ebon coral
#

Literally just restart the server

waxen plinth
#

.-.

ebon coral
#

Takes no longer than 8 seconds

waxen plinth
#

I just type /plug reload -c <plugin> and it's done in milliseconds

gleaming grove
#

but i need to type this

waxen plinth
#

Not really

ebon coral
#

Redempt save me from my issue I beg

#

XD

gleaming grove
#

you understand my pain?

ebon coral
waxen plinth
#

You could just have it as the last command in console

ebon coral
#

First world problems

#

T_T

waxen plinth
#

Click console, hit up, hit enter

noble lantern
#

Try adding that worlds name to your bukkit.yml

worlds:
  world:
    generator: PluginsNameInPlugin.yml

I know when i tried a world generator in the past, i had to add this to the bukkit.yml to get the generator to completely work (You can edit the file via your plugins code if it does)

And try just teleporting the player to that world when the worlds dont creating, should work just fine (i think)

waxen plinth
ebon coral
#

Just detect if a file changes in your plugin folder and use PlugWomen's API (or a console command it if doesn't have it) which then runs the reload command

gleaming grove
#

My Idea Is to just click build button in IDE and have new verison of the plugin on my server

ebon coral
#

Everything looks fine, the world generates, the folder is there, yet it's not there.

kind hatch
# quaint mantle single responsibility programming

Well, this is what I'm trying to figure out. Right now the PlayerDataManager updates player data and player preferences. The reason they are in the same interface is because my implementation.

The interface was originally going to be just player data. So I created classes like YAMLPlayerDataManager, MySQLPlayerDataManager, etc. I then added user preferences because it was easy.

Now that I think about it a little more, if I were to separate the preferences into its own interface, I would have two interfaces that nearly function in the same sense. The point of this interface is so that server owners can change what storage type they want to use and everything about the plugin will adjust accordingly.

So If by default, the storage setting is yaml then all user data and user settings will be stored in a per player yml file.
If the owner changes the setting to mysql, then all user data and settings will need to be stored in the mysql database.

If I were to split up my interface, would it really make it easier as I would now need a YAMLPlayerDataManager and a YAMLPlayerPreferencesManager as well as a MySQLPlayerDataManager and a MySQLPlayerPreferencesManager.

Would that really be a benefit? It seems like a weird form or redundancy or double work in a sense at least at the moment.

waxen plinth
#

You mean when you start the server

#

The world doesn't get loaded?

ebon coral
#

It's it's own world

waxen plinth
#

Right I know

#

And that world is not loaded when you start the server, right?

#

But it's loaded when you first generate it?

gleaming grove
#

or maybe would it be possible to send command to server console from IDE, what do you think?

ebon coral
#

Yeah

noble lantern
#

Worlds should get loaded when you teleport a player to them

You can add the world directly using Bukkit.getWorlds().add(yourWorld) iirc

ebon coral
#

I think so

#

Yeah but how do I get the world to add??

waxen plinth
#

Create it the same way you did initially

#

If the world already exists it will be loaded rather than overwritten

#

So you just act as if you're creating it

ebon coral
#

How do I load it?

waxen plinth
#

Same way you created it

ebon coral
#

Oh fr?

waxen plinth
#

Like I just said several times

noble lantern
#

world creator wont override when you use it if the world exists^

ebon coral
#

Whoops let's try that then

noble lantern
waxen plinth
#

I never had to use that

flat olive
ebon coral
#

You guys saved me, thank ya so much.

gleaming grove
#

Is it possible to trigger java code before Application build in Intelji?

honest laurel
ebon coral
#

Not my fault :(

#

Oh also how do I make a player face towards a block?

honest laurel
#
Block block;
Player player;
Vector v = block.getLocation().add(.5, .5, .5).subtract(player.getEyeLocation()).toVector();
Location loc = player.getLocation();
loc.setDirection(v);
player.teleport(loc);```
flat olive
maiden thicket
#
[04:03:48 INFO]: [Sunburst] Teleporting to: {
  "worldName": "world",
  "spawnLocation": "42600.28573334319, 69.0, 27752.98790673437, 0.0, 0.0"
}```
 prints correctly
it should be setting the spawn location but it does not

[04:06:13 INFO]: [Sunburst] Location: Location{world=CraftWorld{name=world},x=42600.28573334319,y=69.0,z=27752.98790673437,pitch=0.0,yaw=0.0}```

#

^when i add java Logger.log("Location: " + loc);

quaint mantle
#

you might have to use the #teleport method

#

and you might have to wait a tick to do so ^

maiden thicket
#

sadge

#

ill try, i did player join event and waited even 20 ticks and it didnt work lmaoo

maiden thicket
maiden thicket
#

nvm figured it out

kind hatch
trail tangle
#

anyone can help me pls to craft an invulnerable item frames ?

#

public void Recipe() {
  ItemStack i = new ItemStack(Material.ITEM_FRAME);
  ItemMeta meta = i.getItemMeta();

  ShapedRecipe shapedRecipe = new ShapedRecipe(i);

  shapedRecipe.shape("BBB", "BLB", "BBB");
  shapedRecipe.setIngredient('B', Material.BLAZE_ROD);
  shapedRecipe.setIngredient('L', Material.LEATHER);
  getServer().addRecipe(shapedRecipe);
}

flat olive
#

does anybody know how to get the entire colletion of an updated document using change stream?

#

I have almost solved my solution

#

ah I think getFullDocument() will solve it :DDD

trail tangle
#

u know how to set an attribute to an item with a craft exemple (to craft an invisible item frames)

crisp steeple
#

dont think you can just craft invisible item frames

#

you would have to implement that feature yourself

kind hatch
crisp steeple
#

^

#

just craft something with nbt and then set it to invisible on hangingplaceevent or whatever its name is

carmine mica
#

well there's missing api there. cause you should be able to craft the item with the right EntityTag nbt and itll set it automatically on place.

summer scroll
#

Can you set player's attack cooldown time?

waxen plinth
#

It's an attribute

summer scroll
#

Is it player attribute or the item?

#

Ah okay found it, thanks!

waxen plinth
#

GENERIC_ATTACK_SPEED

#

It's both

#

All attributes are

summer scroll
#

What happend If I only change the attack speed of the player?

waxen plinth
#

They would attack faster

#

Or slower

#

If you made it slower

summer scroll
#

Only affecting hand or items will be affected too?

waxen plinth
#

Items will also be affected

summer scroll
#

Perfect, thank you so much

noble lantern
#

Is there an easy way to remove %placholder_here% from a string?

somber hull
#

yea

#

get the string

#

and replace %placeholder_here% with whatever you want

river oracle
#

No

#

There isnt

somber hull
#

ig replaceall

river oracle
#

Sorry

noble lantern
#

No it needs to be for any placeholder

somber hull
#

Like with placeholderapi?

noble lantern
#

Im thinking regex, but im not sure how to really make a regex string for that

river oracle
#

You could use regex to match between 2 % signs

somber hull
#

You would have to specify

#

every placeholder

#

and what you want to replace them with

river oracle
#

You could look up more general examoles

dusty herald
#

Google "regex to get text between @

somber hull
#

or use placeholderapi

dusty herald
#

"

noble lantern
dusty herald
#

yes you can

somber hull
noble lantern
somber hull
#

so you want to replace anything contained in %%?

noble lantern
#

got it

dusty herald
#

Google "regex to get between quotes" and replace the quotes with @

noble lantern
#

\%(.*?)\%

dusty herald
#

yes.

#

That

somber hull
#

Or like %deaths% replace with 5
@noble lantern

#

or

#

are you replacing anything contained in %%

noble lantern
#

its not a specific placeholder im needing to replace

somber hull
#

gooot it

#

so

#

your removing anything contained in %%

noble lantern
#

and yes

somber hull
#

just ignored me

#

kinda rude

#

Β―_(ツ)_/Β―

dusty herald
#

lol no it's not

somber hull
#

couldve stopped me from wasting my time

somber hull
dusty herald
#

yes

somber hull
#

indeed

dusty herald
#

I will mourn you

somber hull
#

πŸ•‹

dusty herald
#

I will bring flowers to your grandma

noble lantern
rugged cargo
#

i just saw on the spigot website that its "owned" by Facebook (Meta) is this true?

noble lantern
#

yes

rugged cargo
#

gross

dusty herald
somber hull
#

like

rugged cargo
#

yeah its 8 years ago i realise that. :)

dusty herald
#

no?

somber hull
#

like

#

the specific day

#

πŸ€¦β€β™‚οΈ

rugged cargo
#

oh im a dodo buttface that doesn't realise things.

rugged cargo
#

is that the second facepalm youve given me btw?

rugged cargo
#

oh, well ive gotten two now. i think its a sign

somber hull
#

lol

#

maybe this isnt the place for you

rugged cargo
#

yeah im out of touch. i know this :D

#

the text is so believable though!. lol

somber hull
#

i beleived it for a second too then i looked at the date

rugged cargo
#

that makes one of us... clearly

#

ok. panic averted. i can like spigot again

grizzled bridge
#

how can I make a specific armorstand uninteractable

#

like I mean, it cannot be broken whatsoever and a player cannot change anything about it

hybrid spoke
grizzled bridge
#

more specifically the breaking one