#help-development

1 messages · Page 2173 of 1

sterile token
#

You always trying to help

kind hatch
#

Well, looking at your code. You first check if the claim owner is the same as the one in the event. If that is true, you keep the event running due to the event.setCancelled(false). If that check fails, you then check to see if a list of flags does not contain a build flag. If it doesn't contain that flag, send the message that you can't build. That's what I see at least.

sterile token
#

Sometimes looks like im trolling but most of the time i just dont realize what i rite because im annoyed

ivory sleet
#

lol

#

Relatable

sterile token
ivory sleet
#

shadown?

sterile token
#

shadow*

ivory sleet
#

Who’s shadow?

sterile token
#

🤔

ivory sleet
#

Still haven’t figured who shadow is

kind hatch
#

I cri, conclure doesn't realize.

uncut bane
#

hi, when i am installing my plugin in my server i got this error : error "class file has wrong version 62, should be 55" can someone help me ? i tried to change jdk version in my Intellij projet strucutre but no matters still have the same error..

ivory sleet
sterile token
kind hatch
ivory sleet
#

Oh

sterile token
ivory sleet
#

I am dumb

#

FUCK

sterile token
uncut bane
ivory sleet
#

jeesus

chrome beacon
#

Yo Conclure you might want to get some sleep

ivory sleet
#

True that

sterile token
dire marsh
#

wtf

sterile token
#

Its 4am there

ivory sleet
#

Gn yall Ig :3

kind hatch
#

Gn

sterile token
dire marsh
#

is that a threat?

sterile token
chrome beacon
kind hatch
#

Try compiling your project against java 8 or 11.

lethal python
#

you know how when you place a block in the same spot as grass and lichen and stuff the block will just replace them, is there a way of checking if a block is one of those types of replaceable blocks

kind hatch
#

I think there is an event call BlockChangeEvent. It might get fired when that happens.

uncut bane
kind hatch
uncut bane
#

maven

kind hatch
#

Make sure these properties are set in your pom.

<properties>
    <maven.compiler.source>8</maven.compiler.source>
    <maven.compiler.target>8</maven.compiler.target>
</properties>
dire marsh
#

62 is java 18, 55 is java 11 just fyi

uncut bane
#

but my intellij is still compiling with 18 even if i have put 11

kind hatch
#

Shouldn't if you are doing it through maven.

#

You could check your project settings and set the jdk to java 11. Then change those properties to 11 as well.

dire marsh
#

intellij? more like dumj! hah!

uncut bane
kind hatch
#

Sure, but you can also send images here with imgur if you aren't verified yet.

uncut bane
#

Just verified

#

Okay I’ll send here

#

So I put this

kind hatch
#

Try refreshing your project after you set that. Then try recompiling.

uncut bane
#

And here is my project structure

kind hatch
#

And? What's the result?

sterile token
#

To sleep a player on the floor i need to use an fake entity right?

dire marsh
#

probably

#

last time i checked that kind of thing out it's really hard to do

uncut bane
kind hatch
#

Yes, but I'd run clean first then package.

wet breach
kind hatch
#

You can also set a defaultGoal in your pom so that you can just click the green play button and it will execute them both automatically.

#
<build>
    <defaultGoal>clean package</defaultGoal>
</build>
kind hatch
wet breach
uncut bane
wet breach
#

that link I posted is another way to have maven set the JDK version

kind hatch
kind hatch
#

I meant in your pom.

#

?paste your entire pom.

undone axleBOT
uncut bane
#

don't have

kind hatch
#

Hmm, you may need the compiler plugin then.

uncut bane
#

i need to add this to my pom ?

#

<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.10.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>

kind hatch
#

Yes, but the source and target would be 11.

uncut bane
#

aight

wet breach
#

clear caches

sterile token
uncut bane
#

okay its working now

sterile token
#

your welcome

uncut bane
#

i mean right version

uncut bane
#

but i have another question

sterile token
#

Just go ahead :D

uncut bane
#

on maven, where do i need to put my config.yml ?

sterile token
#

The folder called resouces

wet breach
#

might have to make that folder yourself

sterile token
uncut bane
#

i have it

sterile token
#

Mines intellij generate the project ith every directory

uncut bane
#

but after compiling got this

sterile token
#

?

uncut bane
wet breach
#

did you add config.yml to that folder?

sterile token
wet breach
#

and are you using the appropriate methods when enabling to have the server copy it from the jar?

#

third

#

here is a link to help update plugin.yml version number without having to edit it all the time

sterile token
#

frost where i can know what paremeters does the maven-deploy-plugin hve?

uncut bane
uncut bane
wet breach
sterile token
uncut bane
sterile token
sterile token
subtle folio
#

Very confused, what does this mean? ```Caused by: java.lang.NullPointerException: Cannot invoke "java.util.HashMap.put(Object, Object)" because "net.tazpvp.tazpvp.Tazpvp.sellables" is null

at net.tazpvp.tazpvp.Tazpvp$1.<init>(Tazpvp.java:64) ~[tazpvp-1.jar:?]``` ```java

public static HashMap<Material, Integer> sellables = new HashMap<Material, Integer>(){{
sellables.put(Material.DEEPSLATE_GOLD_ORE, 1);
sellables.put(Material.DEEPSLATE_IRON_ORE, 1);
sellables.put(Material.DEEPSLATE_REDSTONE_ORE, 1);
sellables.put(Material.DEEPSLATE_LAPIS_ORE, 1);
sellables.put(Material.DEEPSLATE_EMERALD_ORE, 1);
sellables.put(Material.RAW_GOLD, 1);
sellables.put(Material.RAW_IRON, 1);
sellables.put(Material.REDSTONE, 1);
sellables.put(Material.LAPIS_LAZULI, 1);
sellables.put(Material.EMERALD, 1);

}};```
wet breach
#

Then in your properties file for maven, is where you secret key stuff goes for your server

sterile token
wet breach
#

maven repo stuff is sent

#

like the files to make a repo

sterile token
#

Hmn

wet breach
#

it sends your jar, a signature file

#

etc

#

the wagon plugin is what dictates the connection type

sterile token
#

I need the exact params because TS project its crying me saying that the params are not specified

wet breach
#

in your maven settings file

#

is where you need to specify your credentials

sterile token
#

Oh i didnt explain

wet breach
#

it is what most likely it is complaining about unless you didn't specify the appropriate wagon plugin

sterile token
#

I done my own express typescript server

wet breach
#

then its up in the air on the problem since you have a custom server

sterile token
#

So im setting the deploy-plugin my ts server

sterile token
#

XD

wet breach
#

well it depends on the wagon plugin

#

as I keep saying

sterile token
#

Wagon plugin??

wet breach
#

yes

sterile token
#

I dont use wagon plugin

wet breach
#

that is why then

sterile token
#

He?

#

I will seriously see your link

wet breach
#

so in my server tutorial when I had my server, I had an ftp server so I used the wagon ftp plugin

#

there is one for SSH and HTTPS

sterile token
#

Im just wondering to do my custom maven server

uncut bane
#

i just opened the jar and there is the config.yml

wet breach
#

the link above tells the deploy plugin, which type of connection to initiate to the repo server

uncut bane
#

i dont know what it isnt recognizing it

wet breach
#

not sure what is so hard in understanding about the wagon plugin extension

sterile token
#

I dont use that

wet breach
#

and I am telling you that is your problem

sterile token
#

I just use maven-deploy-plugin

#

Why need to use wagon http?

wet breach
#

how else you suppose to send credentials?

sterile token
#

which credentials?

#

Im just trying the maven-deploy-plugin do a request to my ts server

#

to know the parameters i need to parse in server side

wet breach
#

alright good luck then

#

not going to explain it again

sterile token
#

Are you trolling me

#

Really

#

Lmao im being serious...

wet breach
#

so was I

sterile token
#

he dont get angry i will use the translator

wet breach
#

obviously I have used the deploy plugin successfully

#

either it works for me by magic

#

or I am doing something that you are not

sterile token
#

I used translator, so from what i read you telling me to use another plugin but i didnt understand you

#

Now that i translated i understand

wet breach
#

did you even look at the link above?

sterile token
#

yeah

#

I see you using a wagon-http-plugin

wet breach
#

notice it is below the deploy plugin as an extension?

sterile token
#

Yeah

#

I have added the code to my pom*

wet breach
#

that is because it tells the deploy plugin in how to initiate the connection and what to send, credential or no credential

sterile token
#

Ohhh

#

i thought the wagon plugin tells the server how to initiliaze

#

That why i was not following you

#

That why i cannot live on an english country

wet breach
#

if you are going to use credentials

#

deploy plugin pulls that from the settings file from maven

#

this way you don't put credentials in the pom for everyone to see 🙂

sterile token
#

My webserver doesnt have any credentials its just literally a post request listener

wet breach
#

well just letting you know

sterile token
#

Which debug to console what receives

sterile token
wet breach
#

might have to create a server tag in settings still

#

even if no credentials being used

sterile token
#

ok

#

How?

#
<server>
    <id>testing</id>
    <url>https://localhost</url>
</server>
#

If ima not wrong

scarlet sand
#

Does anyone know how to get maximum data value?

sterile token
humble tulip
#

of?

scarlet sand
humble tulip
#

might just have to hardcode them i think

scarlet sand
#

i know i can do item.getData().toString() to get GOLDEN_APPLE(0) and GOLDEN_APPLE(1) or WOOL(some number)

#

but i wanna know the max number

sterile token
#

?jd-s

undone axleBOT
sterile token
#

There you can find all the values from Item#getData()

subtle folio
#

Hello, im trynig to spawn a armorstand to the center of a block, java int x = (int) p.getLocation().getX(); double y = p.getLocation().getY(); int z = (int) p.getLocation().getZ(); ArmorStand a = (ArmorStand) p.getWorld().spawnEntity(new Location(p.getWorld(), x + 0.5, y, z + 0.5), EntityType.ARMOR_STAND); this code only works in one corner of the block, when standing in other corners it goes off to the next block.

#

#getX()?

sterile token
subtle folio
#

or will that already center it

sterile token
#

It will already center

subtle folio
#

Sweet thanks

sterile token
#

Try it

subtle folio
#

kk

sterile token
#

But i think it should center it

subtle folio
#

ah that gets the 0 0

#

i still have to add .5 to x and z

#

thanks

sterile token
#

Your welcome

#

Have a lovely night/day

#

Its possible to a entity following you, like does hipixel anticheat?

crude cobalt
#

Will there be problems with server resources if I use a hash map?

ivory sleet
#

well if it becomes large

#

but everything takes resources

#

however, compared to other stuff like IO, no HashMap is generally considered cheap given the time complexity it offers for certain operations

spiral hinge
#

Anyone here know how to use "Night Config" the library for configuration files? If so, I am trying to create a multiline string and I create it like this:

spec.define("test", """
Line 1
Line 2
Line 3""");

But when it loads it in the TOML file, it shows up like this:

test = "Line 1\nLine 2\nLine 3

I'd like it to show up like this in the TOML file, though:

test = """
Line 1
Line 2
Line 3"""
sterile token
#

Why using tomó?

spiral hinge
#

I prefer to use TOML

sterile token
#

Also please provide the link

spiral hinge
sterile token
#

Yes please

spiral hinge
sterile token
#

I will check it

iron glade
#

whats the chat clear shortcut ingame?

iron glade
#

So basically I'm trying to filter some words in the chat, I have the filtered words in a file, the problem is that for example if I have "fuck" and "fucking" in the file and someone writes "fucking" in the chat it comes through as ####ing instead of #######, how would I fix this?

crisp steeple
#

use the longest word it matches

subtle folio
#

Is there any simple way of checking if a itemstack is a pickaxe of any type?

#

or do I just make a list and call it a day?

iron glade
#

get it's material and check if it contains "pickaxe"

subtle folio
#

oh sweet

#

it would be in all capitals correct?

#

p.getInventory().getItemInMainHand().getType().name().contains("PICKAXE")

summer scroll
#

Yeah all capitals

iron glade
#

I guess

subtle folio
#

Alright ty

iron glade
#

if not you can always just set it toLowercase() before checking if it contains

summer scroll
#

If that doesn't work you can try #endsWith("_PICKAXE")

subtle folio
#

got it

lethal python
#

guys it's not possible to have an item in an inventory which doesn't show the dark purple name window

#

right?

#

even if you set custom name empty it displays little box

iron glade
#

dark purple name window?

worthy yarrow
#
    public void OnEntityDeathEvent(EntityDeathEvent e){
        if (e.getEntityType().equals(EntityType.IRON_GOLEM)){
            e.getDrops().remove()``` Trying to make a custom entity drop plugin and for iron golems I dont know the how to remove poppies from the drop list.
glass mauve
#

use == for enums

worthy yarrow
#

forgot that was an enum

#

I dont know where to find poppy in getdrops

glass mauve
#

oh you only want poppies to get removed?

worthy yarrow
#

yes

glass mauve
#

probably use filter for the list

#

e.getDrops().stream().filter(entity -> );

#

is there a way to set the drops?

worthy yarrow
#

Not when i use entitydeathevent

#

just setdroppedexp

glass mauve
#

you cant use filter for that bc you cant set the drops

#

then iterate through each ItemStack in getDrops and remove it when itemstacks Material == Material.POPPY or smth

worthy yarrow
#

e.getDrops().remove(Material.POPPY); not just this?

glass mauve
#

I think that would not work bc e.getDrops() returns List<ItemStack> and Material.POPPY is not an ItemStack

glass mauve
worthy yarrow
#

Man I have no clue how to write this

glass mauve
#

okay let me help you

#

so normally I would use filter in this case, but that uses streams and returns a new Collection at the end.

#

nvm we can use filter :D

worthy yarrow
#

Alright

glass mauve
#

e.getDrops().stream().filter(entity -> ).collect(Collectors.toList());

#

this returns a new list

#

now we can remove everything from getDrops

#

and use the e.getDrops().addAll() method

#

btw you need to write smth in here (entity -> )

dark arrow
#

I have created a function through which we can customize spawnrates how can i turn it into api?

worthy yarrow
glass mauve
#

(entity -> entity.getType() == Material.POPPY) should work

#

not entity

#

its an itemstack

#

just change the variable name

#

(itemstack-> itemstack.getType() == Material.POPPY)

worthy yarrow
#

e.getDrops().stream().filter(itemStack -> itemStack.getType() == Material.POPPY).collect(Collectors.toList());

glass mauve
#

yea probably

worthy yarrow
#

I'll test brb

glass mauve
#

did you do this stuff

now we can remove everything from getDrops
and use the e.getDrops().addAll() method

worthy yarrow
#

Well If I'm already removing the poppy wont that just leave the iron?

glass mauve
#

I think its itemStack.getType() != Material.POPPY

glass mauve
worthy yarrow
#

I believe I've already reached the end, all I want is the iron to drop, then when I get that working I was going to implement more mobs and custom item drops

#

I just needed to write the iron golem one so i could learn how to remove and add items to an entities death event

glass mauve
#

👍

worthy yarrow
#

Thank you for the help, testing brb

#

oh real quick, I have this written in my main class do i still have to register the event?

#

Or should I quickly register the event and move it to a separate class

glass mauve
#

move it to a separate class

#

and register it

dark arrow
#

yo

#

lets go i am verified

lethal coral
#
    public static GameProfile getGameProfile(Player player) throws Throwable {
        Object entityPlayer = PLAYER_GET_HANDLE.invoke(player);
        Method m = entityPlayerClass.getMethod("getProfile", GameProfile.class);
        return (GameProfile) m.invoke(entityPlayer);
    }

I'm new with reflection and am wondering if this would cause any problems.
The warning I get with the last line is "2 arguments expected", but it's a get method, so there are no arguments within the method I'm trying to invoke

glass mauve
#

probably read docs

lethal coral
#

thank you for being so useful

glass mauve
#

it only needs more arguments if the Method got arguments you need to pass

lethal coral
#

great thank you for the answer

glass mauve
#

for example:

public static void test(int a) {

}

m.invoke(obj, arguments)

#

first argument gets ignored and can be null if the method is static

#

the second argument(s) is an Object array

#

you dont need to pass any if your method dont have any parameter

#

and sorry for helping

#

but dont ask question, which you can easily look up in seconds

lethal coral
#

you know what's crazy

#

how my question could've been answered here within the first 2 seconds without the sass

#

I was simply asking for confirmation

glass mauve
#

and I answered it

lethal coral
#

[04:54:13 WARN]: java.lang.NoSuchMethodException: net.minecraft.server.level.EntityPlayer.getProfile()

#
    public static GameProfile getGameProfile(Player player) throws Throwable {
        Object entityPlayer = PLAYER_GET_HANDLE.invoke(player);
        Method m = entityPlayerClass.getMethod("getProfile");
        return (GameProfile) m.invoke(entityPlayer);
    }
marsh burrow
#

does anyone know anything about ports? Im trying to release this plugin I made that relays information using sockets. We opened up the ports, but the connection gets instantly denied, any ideas?

glass mauve
#

what is on line 53 in ProfileUtils

#

and what is entityPlayerClass

lethal coral
lethal coral
kindred valley
#

How can i make a book system on first join(rules, how to play)

steel swift
#

hello, im making

    public void OnjoinServer(PlayerJoinEvent e) {
        Player p = e.getPlayer();
        p.getInventory().setItem(9,getMenuItem());

    }

    public ItemStack getMenuItem(){

        ItemStack sbmenu = new ItemStack(Material.BOOK);
        ItemMeta meta=sbmenu.getItemMeta();

        meta.setDisplayName(ChatColor.GOLD + "Skyblock Menu");
        List<String> lore = new ArrayList<String>();
        lore.add(ChatColor.GRAY + "View all of your Skyblock");
        lore.add(ChatColor.GRAY + "progress, including your Skills");
        lore.add(ChatColor.GRAY + "Collections, Recipes, and more!");
        meta.setLore(lore);

        sbmenu.setItemMeta(meta);

        return sbmenu;

    }```

but i didnt get the item when i join the server with plugin loaded
glass mauve
lethal coral
#

yeah

tranquil viper
#

how do you change the message that says "unknown command type /help for help"

glass mauve
lethal coral
glass mauve
#

and I cant find an EntityPlayer in nms.level

lethal coral
#

EntityPlayer is found with the method, but we need to find EntityHuman I believe as that's the superclass that has the getProfile method

glass mauve
#

I mean there is no class in net.minecraft.server.level that is called EntityPlayer

lethal coral
#

there clearly is one as it's found

#

🤷‍♂️

#

I'm confused as well

glass mauve
#

but Im also using Paper instead of Spigot

#

should be no difference tho

lethal coral
#

I'm using paper as well

#

but as you can see

#

it was found

#

just not the method since it's in the EntityHuman (superclass)

glass mauve
#

but you get an error

lethal coral
#

I get an error for the method not the class

glass mauve
#

yea I see thats weird

lethal coral
#

this is the error I would get if the class wasn't found

#

🤔

glass mauve
#

you found one?

lethal coral
#

yeah for EntityHuman it's world.entity.player.EntityHuman

#

so weird

glass mauve
#

yea wtf

#

yea and the getMethod doesnt work bc its in a superclass

lethal coral
#

🕺

#

time to see if it works

glass mauve
#

🕺

#

I dont even have EntityHuman in minecraft.world.player ._.

lethal coral
#

😐

#

that's bullcrap

#
    public static GameProfile getGameProfile(Player player) throws Throwable {
        Object entityPlayer = PLAYER_GET_HANDLE.invoke(player);
        Method m = entityHumanClass.getDeclaredMethod("getProfile");
        return (GameProfile) m.invoke(entityPlayer);
    }
glass mauve
#

im confused, so I dont have EntityHuman and EntityPlayer

#

im on 1.18.2

lethal coral
#

what you're using may have wonky mappings

#

I'm using one of the patched jars in the cache folder in jd-gui

glass mauve
#

idk I cant find it :D

lethal coral
#

🤨

#

are you using what I'm using

glass mauve
#

Paper 1.18.2, and I search in intellij

#
repositories {
    mavenLocal() // (1)
    mavenCentral()

    maven { url 'https://papermc.io/repo/repository/maven-public/' }
    maven { url 'https://oss.sonatype.org/content/groups/public/' }
    maven { url 'https://repo.dmulloy2.net/repository/public/' }
    maven { url 'https://libraries.minecraft.net/' }
}

dependencies {
    paperweightDevelopmentBundle 'io.papermc.paper:dev-bundle:1.18.2-R0.1-SNAPSHOT'

    compileOnly 'io.papermc.paper:paper-server:1.18.2-R0.1-SNAPSHOT:mojang-mapped' // (1)
    compileOnly 'io.papermc.paper:paper-api:1.18.2-R0.1-SNAPSHOT'

    compileOnly 'com.mojang:authlib:1.5.21'

    compileOnly 'com.comphenix.protocol:ProtocolLib:4.7.0'

    implementation 'org.mongodb:mongo-java-driver:3.12.11'
    implementation 'org.reflections:reflections:0.10.2'
}
earnest forum
glass mauve
#

so I dont need it

earnest forum
#

it depends on what mapping you're ob

#

ServerPlayer is EntityPlayer

#

renamed

#

remapped

glass mauve
#

was just wondering

#

yea different mapping

#

yea I can find ServerPlayer

lethal coral
#

and do you see the getProfile method?

glass mauve
#

well let me check that, but need to go to school after that

#

there is no getProfile method in ServerPlayer, but it extends Player

lethal coral
#

😩

glass mauve
#

probably different names,

#

I cant find getProfile in there

lethal coral
#

this would be much easier without needing to use reflection 💀

glass mauve
#

💀

#

need to go, I can help you later in like 5h 💀

lethal coral
#

dang

#

alright seeya

#

weird how it's not in the EntityHuman class on 1.18 but it is on 1.17

earnest forum
#

CraftPlayer?

#

they changed nms A LOT in 1.17 and 18

lethal coral
#

😐

#

I was looking at the 1.17 version

earnest forum
#

ah

#

that's annoying

earnest forum
lethal coral
#

for what

earnest forum
#

nms

lethal coral
#

I'm using the obsfucated stuff the default paper jar provides

earnest forum
#

are you using maven

lethal coral
#

indeed

#

I'm using reflection to get the method

earnest forum
#

can you show your pom

#

the spigot dependency

lethal coral
#
        <dependency>
            <groupId>io.papermc.paper</groupId>
            <artifactId>paper-api</artifactId>
            <version>1.18.2-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
earnest forum
#

I really don't know much about maven sorry

#

maven with paper

lethal coral
#

oh no there's nothing wrong now

#

regarding that method

#

there's a new problem with what I'm trying to change though

earnest forum
#

which line?

lethal coral
#

51

#

hmm

earnest forum
#

"name" doesn't exist

lethal coral
#

I'm like 85% sure name is a property name

earnest forum
#

probably another culprit of spigot getting rid of named methods and stuff

lethal coral
earnest forum
#

the property is probably a letyer

lethal coral
#

no

#

this is the property of the gameprofile

#

oh wait

#

wait a minute..

earnest forum
#

yeah dunno sorry

lethal coral
#

the only property is textures

#

😩

#

I could've sworn there was a name property

glass mauve
#

💀

thorny dawn
#

id provide u with a code example but i code in kotlin sorry

crude charm
#

I haven't even touched an ide in over a year but I wanna get back into development, how should I go about refreshing my memory?

kindred valley
eternal needle
#

Hi i have made a plugin and i have a problem with that it crash my server after som hours. Tag me pls help i need it to stop crash i crash more then 20-30 times a day

i don't get any errors or crash reports

My code: https://paste.md-5.net/wozexuxaqa.java

eternal oxide
kindred valley
eternal oxide
#

no

kindred valley
#

Can player close it on first page?

ivory sleet
crude charm
eternal oxide
#

You are going to look at your old code and wonder WTH you were thinking

#

Happens to me every time

kindred valley
#

Calculatorspigot

crude charm
#

Probs yeah, I remember having a bug that looking at it now I was an idiot for not fixing because it works in one way but not another

kindred valley
crude charm
#

I think I've messed up my pc by deleting some stuff

quaint mantle
#

isnt the error too obvious

crude charm
#

Ik I'm fixing it rn

green prism
#

One question, I can’t figure out how to make the gui signs where you write the text and then confirm... I’m finding some APIs but they are now out of use, for the rest, I can't find anything useful with ProtocolLib that explains me how to do this... Any ideas?

crude charm
#

I completely deleted my JAVA_HOME variable when I deleted java 8

quaint mantle
#

does somebody know how can I change the colors of leather armor after sometime

green prism
# quaint mantle does somebody know how can I change the colors of leather armor after sometime

personally I would make a beautiful store of all the armor through an arraylist and then a loop asynchronous task that retrieves the meta and changes color
//Code from spigot

ItemMeta meta = item.hasItemMeta() ? item.getItemMeta() : Bukkit.getItemFactory().getItemMeta(item.getType());
LeatherArmorMeta leatherArmorMeta = (LeatherArmorMeta) meta;
// from RGB:
leatherArmorMeta.setColor(Color.fromBGR(10,50,100));
// from Color:
leatherArmorMeta.setColor(Color.FUCHSIA);
item.setItemMeta(leatherArmorMeta);```

If instead you do not want to make a loop, simply a task like that that after some time removes that object from the array and then does not change more color
eternal needle
chrome beacon
#

You need to exit the loop

#

Just like ElgarL said it gets stuck forever in your while loop

eternal oxide
# eternal needle it crash befor it gets to the last and how does i fix it

Look at this loopjava while (nextMessage == lastmessage) { random.nextInt(messages.size()); }Once that condition (nextMessage == lastmessage) is met your loop starts. The code inside the while loop needs to alter the condition to allow it to exit. It needs to change the value of nextMessage or lastmessage.

chrome beacon
#

They already told you?

green prism
#
                message = messages.get(0);
                lastmessage = 0;
            }```
Try with a e.printStackTrace right there...
rough drift
#

wc

chrome beacon
green prism
#

sure, but if he's having an error without a stacktrace... That's the "Why"...

#

try with printing the stacktrace and check what is the error

chrome beacon
#

There is no error. They triggered the auto stop because of their infinite loop

quaint mantle
chrome beacon
sacred mountain
#

Is there something that checks if it contains and returns the item if so

chrome beacon
#

?

#

if "it" contains?

#

What's it

earnest forum
#

the inventory?

chrome beacon
#

ouch yeah

#

but you would have to loop the inventory to find all matching item stacks

quaint mantle
chrome beacon
#

You will still need to find the item stack you're changing color of

#

no?

quaint mantle
#

no I dont want to find it in the player inventory

#

i want it to run when I run a command it should dye the leather armor first with Green color and then after 1 sec it changed it to yellow

chrome beacon
#

and reset it to prevent it from going out of bounds

quaint mantle
#

Example?

uncut bane
#

hey, does someone can help me i am getting this error :
Error occurred while enabling DSCraftFRPL v2.0.0 (Is it up to date?)
java.lang.NullPointerException: null
at fr.starxx.dscraft.DSCraft.onEnable(DSCraft.java:257) ~[?:?]

chrome beacon
quaint mantle
chrome beacon
#

You should be able to get a value from an array with out me writing it out for you

#

if not it's really time to learn some basic java. You need to know it to write Spigot plugins

quaint mantle
#

huh

green prism
chrome beacon
#

Don't edit that async

#

You should not use Bukkit API async

green prism
#

why not

chrome beacon
#

It's not designed for that

green prism
#

Sync*

chrome beacon
#

You're asking for things to break

quaint mantle
#

I want an array list that goes from one Color in array to another in a runnable

eternal oxide
#

You don;t need an array if you are literally switching two colours

quaint mantle
#

how?

eternal oxide
#

Set color, start delayed runnable, runnable sets new color

chrome beacon
#
        new BukkitRunnable() {
            Color[] colors;
            int index;

            @Override
            public void run() {
                if(index >= colors.length) index = 0;
                Color color = colors[index];
                index++;
            }
        }.runTaskTimer(this, 20, 20);

It's really just something like this

rotund pond
#

Spoon feeding

chrome beacon
#

Yeah I'm aware

rotund pond
#

?help

undone axleBOT
#
CafeBabe Help Menu
*Red V3*
**__Admin:__**

selfrole Add or remove a selfrole from yourself.

**__Cleanup:__**

cleanup Base command for deleting messages.

**__Core:__**

embedset Commands for toggling embeds on or off.
info Shows info about CafeBabe.
licenseinfo Get info about Red's licenses.
mydata Commands which interact with the data CafeBabe has about...
set Commands for changing CafeBabe's settings.
uptime Shows CafeBabe's uptime.

**__Downloader:__**

findcog Find which cog a command comes from.

**__Mod:__**

names Show previous names and nicknames of a member.
userinfo Show information about a member.

**__ModLog:__**

listcases List cases for the specified member.
reason Specify a reason for a modlog case.

**__Permissions:__**

permissions Command permission management tools.

chrome beacon
#

?spoon Looking for this?

undone axleBOT
#

Spoonfeed a newbie for a day and they'll come back with more questions. Teach them to find their own answers and you'll both be better off: you won't get stuck answering the easy questions and they'll be much more productive than before.

rotund pond
green prism
#

olivo what do you think about that?

            int i = 0;
            plugin.getServer().getScheduler().scheduleSyncRepeatingTask(plugin, new Runnable() {
                public void run() {
                    for(ItemMeta meta : itemMetasArray) {
                          ItemMeta meth = meta
                          if(i > 0) {
                             i--;
                          } else i++;
                     meta.setArmorColor(colors[i])
                     
                }
              }
            }, 0L, 20L);```
chrome beacon
#

That won't work

green prism
#

r u sure?

chrome beacon
#

Yeah

#

Feel free to give it a try but it won't work

#

ItemMeta is always a copy

green prism
#

so you can just store the itemstack

#

sure ik

#

itemstack.setItemmeta meta

eternal oxide
#

This is my runnable for a rainbow entity.```java
new BukkitRunnable() {

        int colour = 0;

        @Override
        public void run() {

            team.setColor(ChatColor.values()[colour++]);
            if (colour > 15) colour = 0;

        }}.runTaskTimer(this.plugin, 0, 5L);```
#

as simple as that

green prism
#

wow

#

that's clean

#

cool

chrome beacon
green prism
#
        new BukkitRunnable() {

            final Color[] colours = {Color.AQUA, Color.BLACK};
            int i = 0;
            @Override
            public void run() {
                for(ItemStack armor : armors) {
                    LeatherArmorMeta armorMeta = (LeatherArmorMeta) armor.getItemMeta();

                    armorMeta.setColor(colours[i]);
                    i = this.i == 1 ? i-- : i++;
                    armor.setItemMeta(armorMeta);
                }
            }}.runTaskTimer(this.plugin, 0, 5L);
        }```
green prism
chrome beacon
#

No

green prism
#

oh

chrome beacon
#

It won't update in the inventory

green prism
#

so you can't do nothing for that x)

#

or you can serialize the Player's armor (Player & ItemStack), and use a listener for active updates of the array

quaint mantle
#

do you ppl know how can I create a config file and read from it

chrome beacon
eternal oxide
green prism
#

yea

eternal oxide
#

so many to choose from 🙂

green prism
quaint mantle
#

LOL

quaint mantle
quaint mantle
chrome beacon
quaint mantle
eternal oxide
#

I get the feeling you are not reading the wiki at all

eternal oxide
#

it tells you how to save and load

quaint mantle
#

oh wiat

quaint mantle
#

but wait let me try what i got

eternal oxide
#

look at teh first code block in the Using Custom Configurations section. it has save and load

#

if you are talking about the built in config then Plugin#reloadConfig()

quaint mantle
#

ok

#

ITS NOT WORKING

#

its giving me an error

#

thats is this:

        at me.unrealmanni.magic_armor.commands.Rainbow.<init>(Rainbow.java:25) ~[?:?]
        at me.unrealmanni.magic_armor.Magic_Armor.onEnable(Magic_Armor.java:17) ~[?:?]```
eternal oxide
#

because "this.plugin" is null

quaint mantle
#

HOW

eternal oxide
#

Rainbow.java:25

quaint mantle
#

this is the code at that line:
color_speed = Integer.parseInt(Objects.requireNonNull(plugin.getCustomConfig().getString("rb_color_time")));

eternal oxide
#

you have not set plugin to a value

quaint mantle
eternal oxide
#

plugin is null

quaint mantle
#

can you fix that

eternal oxide
#

hang on, I'll wave my magic wand...

#

Did that fix it?

quaint mantle
#

idk how to

#

so can you

eternal oxide
#

?paste You will have to show me the whole class

undone axleBOT
quaint mantle
#

oh wait I got something

#

it fixed that but now its giving me an error that The embedded resource 'custom.yml' cannot be found in plugins\Magic_Armor-1.0-SNAPSH

#

oh but wait

green prism
#

?spoon

undone axleBOT
#

Spoonfeed a newbie for a day and they'll come back with more questions. Teach them to find their own answers and you'll both be better off: you won't get stuck answering the easy questions and they'll be much more productive than before.

iron glade
#

Return longest string containing message

green prism
#

I just wanted to read, don’t worry

iron glade
#

If anyone has an idea on how to fix the above ^

green prism
#

hey elgar

#

can you help me?

eternal oxide
#

with?

green prism
#

signs

#

& protocollib

eternal oxide
#

Red sky at night is supposed to a good sign

#

However, I don;t use ProtocolLib

#

sorry

green prism
#

nono that was the prob

#

thanks

eternal oxide
#

lol

green prism
# eternal oxide lol

I wanted to do something less useless in my life and I thought to make a sign where you write ur text and save it in the config or idk, without placing the sign but nothing, the only plug-in that does is obs. _:

#

protocollib seems the only light in the dark sky

#

but I'm hungry rn

topaz moon
#

can you get the position and value (text) of a sign?

green prism
#

I just want to open the sign gui to player

#

then save the text when the player saves

#

I don't want to place anything

#

so no block, no position, no data.

#

only packets I think

topaz moon
#

and this text should be player info or what?

#

or should it spawn a sign?

green prism
#

player credit card pin

#

fake creditcard

topaz moon
#

Ok

green prism
#

that's an atm plug-in

topaz moon
#

so this has nothing to do with sign then. Hmm, so what you basically need is a text input gui and a gui for displaying the card

topaz moon
#

basically this?

green prism
#

bruh

#

I spent all day searching a thread like that

#

thanks bro...

topaz moon
#

cost me literally 30 seconds

#

lol

#

googled "bukkit gui with text"

green prism
topaz moon
#

second thread there is a link

#

to the one I just send you

#

hf bro, you might need to change some code since this is 1.11

green prism
#

what fun! I'll definitely have fun! Thanks

#

"...I just managed to get this working after not finding any recent Threads about it or getting help :eek:. Because I don't want you to endlessly wander the Internet I figured I make a post out of my solution."

#

ahahah

topaz moon
#

I always tell people that successfully googling things is a skill you can state in your CV

chrome beacon
#

It's quite true

topaz moon
#

it is! I wasn't joking

#

people get hired for this, especially in IT lol

green prism
iron glade
#

I'm currently using anvil guis for most user input stuff cause it allows the input message to be pretty long

rough drift
green prism
iron glade
#

I'm using that and it works like a charme

green prism
#

thanksss brooo

#

❤️

#

I'll give a try to sings then i'll use that, thanks bro ❤️

iron glade
quaint mantle
#

does somebody know I want to place how can I place a block when a beacon is placed I want to place blocks on it how can I do that

fallow violet
#

you get the PlaceBlockEvent and then you can set a block with a Location.getBlock().setType(Material.TYPE)

#

you know how?

quaint mantle
#

yes but how can I get the cords on it

#

I want to place on it

chrome beacon
#

getLocation and offset

quaint mantle
#

Example?

fallow violet
#

just do

new Location(event.getWorld(), X, Y, Z).getBlock()
quaint mantle
fallow violet
#

event.getBlock().getLocation()

quaint mantle
#

I want y+

#

1

eternal oxide
#
Block block = event.getBlock();
if (block.getType() == Material.BEACON) {
    block.getRelative(BlockFace.UP).setType(Material.STONE);```
fallow violet
#

^

quaint mantle
#

and also can you tell me how can I place at the sides

#

of the beacon

fallow violet
#

change the BlockFace

eternal oxide
#

same as above, use NORTH etc for the BlockFace

fallow violet
#

You can use i guess: NORTH, SOUTH, EAST, WEST, DOWN, UP

eternal oxide
#

there is also NORTHEAST etc

quaint mantle
#

I want Down, East, West, North, South is it possible

fallow violet
quaint mantle
eternal oxide
#

enough to make a full cube

fallow violet
#

^

#

:>

crude cobalt
#

Are there any local variables for players besides HashMap and Statistic?

chrome beacon
#

?

crude cobalt
#

Global variable, separate for each player

opal juniper
#

i have no clue what you mean

quaint mantle
#

client-side packets, what's the burden between when receiving a changed itemstack and moving an armorstand. Which would it cause more lag?

kindred valley
#

Hello guys can someone explain what the f is skript

warm saddle
#

there sevrer is running at 20tps

thorny dawn
#

ur runnable might be too performance heavy to execute in 1 sec intervals

#

wait

#

i read tha twrong

thorny dawn
#

i dont really get it mind elaborating?

thorny dawn
kindred valley
kindred valley
#

And they says that skript is better than spigot

#

🥴

opal juniper
warm saddle
kindred valley
opal juniper
#

as far as i can tell, you can do most things that you can do with pure spigot but not everything

thorny dawn
#

its still shit lmao

thorny dawn
warm saddle
#

what should i make the interval?

#

its currently at 20

#

should i make it 10 or 30?

thorny dawn
#

make it a big longer like 40 and see if it behaves properly

warm saddle
#

oh

#

ok

#

in another file

thorny dawn
#

its true

warm saddle
#
package dev.jamieisgeek.parkourtag.Utils;

import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.scheduler.BukkitRunnable;

import java.util.UUID;

import static dev.jamieisgeek.parkourtag.Utils.PTUtils.*;

public class GameInProgress {

    public static void GameInProgress() {
        final int[] startTimer = {6};

        new BukkitRunnable() {
            @Override
            public void run() {

                startTimer[0] = startTimer[0] - 1;
                joinedPlayers.forEach((UUID id) -> {
                    Player p = Bukkit.getPlayer(id);
                    p.sendMessage(prefix + ChatColor.WHITE + "Game starts in: " + startTimer[0]);
                    if(startTimer[0] == 1) {
                        p.sendMessage(prefix + "Run!");
                        this.cancel();
                        inProgress = true;
                        ScoreUpdate.updateScoreboard();
                    }
                });
            }
        }.runTaskTimer(main, 0, 20);
    }
}
#

wait

#

i think i've seen the problem

#

its inside the forEach

green prism
#

what if I compile the plug-in in a more-recent version of java?

quaint mantle
#

do you ppl know how can I put materials in an array

#

and use it

eternal night
#

A plain Material[] array ?

quaint mantle
eternal night
#

share your code

quaint mantle
#

ok

#

This is where it gives error:

                            block.getRelative(BlockFace.UP).setType(colors);```
eternal night
#

Well that is a) not how you define an array

#

and b), a block can only have one type

#

not all of them at the same time

quaint mantle
#

oh so how can I change blocks after 1 seconds in a location

eternal night
#

just once or every 1 second

#

tho generally read through

#

?scheduling

undone axleBOT
quaint mantle
#

ok

#

but thats a long work

#

it there a shorter way

eternal night
#

not really no

midnight shore
#

hi! how can i render particles at the border of a boundingbox?

chrome beacon
midnight shore
#

ty a

heady spruce
#
Caused by: java.lang.ClassCastException: class org.bukkit.configuration.MemorySection cannot be cast to class java.util.Map (org.bukkit.configuration.MemorySection is in unnamed module of loader 'app'; java.util.Map is in module java.base of loader 'bootstrap')```
does anyone know what is the problem here?
slate mortar
slate mortar
twilit roost
#

How to remove Renderers from unloaded ItemStack of type Map

ItemStack map = new ItemStack(Material.FILLED_MAP);
        ItemMeta meta = map.getItemMeta();
        meta.setCustomModelData(1);
        meta.setDisplayName(CharEntry.QUEST_ITEM + ChatColor.DARK_AQUA+ ChatColor.BOLD+ "Quest" + ChatColor.RESET + CharEntry.TREASURE_ICON);
        MapView view = ((MapMeta)meta).getMapView();
        view.getRenderers().forEach(view::removeRenderer);
        view.addRenderer(new TreasureRenderer());
        map.setItemMeta(meta);
#

this throws null error on the line ```
MapView view = ..

green prism
chrome beacon
#

Yeah you will need to use a resourcepack to retexture the anvil inventory

#

If you don't want to retexture the anvil inventory retexture an item to be the size of the inventory

silent topaz
#

hey what's the new alternative to player#sendTitle

#

its deprecated

crude cobalt
#

Please rate the code, what needs to be fixed?

public HashMap<Player, Integer> map = new HashMap<>();
    @EventHandler
    public void PlayerToggleSneakEvent(PlayerToggleSneakEvent e){
        if(e.isSneaking()){
            int value = map.get(e.getPlayer());
            map.replace(e.getPlayer(), value + 1);
            Bukkit.getScheduler().scheduleSyncDelayedTask(ParkourV1.instance, () -> {
                map.replace(e.getPlayer(),0);
            },5);

        }
    }
    @EventHandler
    public void  OnPlayerMove(PlayerMoveEvent e){
        if((int)map.get(e.getPlayer()) == 2 && e.getPlayer().isOnGround()){
            map.replace(e.getPlayer(),0);
            double diffX = e.getTo().getX() - e.getFrom().getX();
            double diffY = e.getTo().getY() - e.getFrom().getY();
            double diffZ = e.getTo().getZ() - e.getFrom().getZ();
            e.getPlayer().setVelocity(new Vector(diffX, diffY, diffZ).multiply(10));

        }
    }
    @EventHandler
    public void onJoin(PlayerJoinEvent event){
        map.put(event.getPlayer(), 0);
    }
#

Does this code have a big performance impact?

echo basalt
#

not just that

#

using Player as a key instead of the player id can cause some issues

silent topaz
#

ye

echo basalt
#

but also you should reuse variables

chrome beacon
silent topaz
#

it says its deprecated

#

is it my ide's problem

crude cobalt
silent topaz
chrome beacon
silent topaz
chrome beacon
#

Are you using PaperAPI

silent topaz
#

no

quaint mantle
#

purpur?

silent topaz
#

spigot

crude cobalt
silent topaz
#

oh wait my ide was just getting braindamage nevermind

quaint mantle
#

p.getUUID

silent topaz
quaint mantle
#

wow okay sorry

#

i forgot that

crude cobalt
silent topaz
#

np happens

#

aight peace out yall study aight? be top imma go back to coding my game thanks for help

crisp steeple
#

also map.replace is kind of a weird way of doing it, map.put should probably be used instead

crude cobalt
upper vale
#

I highly doubt you want to change the velocity of the player when they move their mouse

#

Keep in mind PlayerMoveEvent is called when players look around as well

crude cobalt
quaint mantle
#

good morning

package me.armando_sales.ultimate_protection.events;

import org.bukkit.block.Block;
import org.bukkit.configuration.serialization.ConfigurationSerializable;
import org.bukkit.entity.Player;

import javax.annotation.Nonnull;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;


public class Protection implements ConfigurationSerializable {

    @Override
    @Nonnull
    public Map<String, Object> serialize() {
        Map<String, Object> stringObjectMap = new HashMap<>();
        stringObjectMap.put(this.toString(), this);
        return stringObjectMap;
    }

    private final Player owner;
    private final Block block;
    private final Set<Player> players = new HashSet<>();

    @Override
    public String toString() {
        return "Protection{" +
                "owner=" + owner.getName() +
                ", block=" + block.getType() +
                ", players=" + players +
                '}';
    }

    public Protection(Player owner, Block block) {
        this.owner = owner;
        this.block = block;
    }

    public Player getOwner() {
        return owner;
    }

    public Block getBlock() {
        return block;
    }

    public Set<Player> getPlayers() {
        return players;
    }
}
#

can you tell me what does mean these &id and *id?

#
c8c93dab-ee5f-2f90-9aae-82abcfd00a6c:
- &id002
  ==: me.armando_sales.ultimate_protection.events.Protection
  Protection{owner=ArmandoSales, block=CHEST, players=[]}: *id002
- &id003
  ==: me.armando_sales.ultimate_protection.events.Protection
  Protection{owner=ArmandoSales, block=CHEST, players=[]}: *id003
chrome beacon
upper vale
#

Also make sure to remove player from your map when they leave the game or you’re going to have a memory leak

crude cobalt
chrome beacon
#

What do you want to track it for?

quaint mantle
#

#help-development message
so, everytime I place a chest the Id is incremented, is there a way to reset it or
is there a way to remove them?

crude cobalt
upper vale
quaint mantle
#

yes

upper vale
#

Can’t tell on mobile but that’s what it looks like

crude cobalt
#

Which event should i use to track ween player leave from server?

upper vale
#

The ID is probably just something Bukkit does when you serialized as string

#

¯_(ツ)_/¯

#

I’ve only seen ConfigurationSerializables being used as like configuration sections, never seen them stored as string lists

crude cobalt
heady spruce
#

idk why its not working, even tough i didnt had any problem with it before:
Caused by: java.lang.ClassCastException: class org.bukkit.configuration.MemorySection cannot be cast to class java.util.Map (org.bukkit.configuration.MemorySection is in unnamed module of loader 'app'; java.util.Map is in module java.base of loader 'bootstrap')<- the error.

public static void givePlayerKitWithCustomSort(Player playerName, Kit kit) {
        playersHaveKit.add(playerName.getName());

        Map<Integer, Object> map = (Map<Integer, Object>) Main.yamlConfiguration.getValues(true).get("Koasyytank");
        if (map == null) {
            givePlayerKit(playerName, kit);
        }
        for (int i = 0; i < kit.getKitSize(); i++) {
            if (map.get(i) == Material.AIR) {
                continue;
            }

            playerName.getInventory().setItem(i, ItemStack.deserialize((Map<String, Object>) map.get(Integer.toString(i))));
        }
        Bukkit.getPlayer("playerName").getInventory().setBoots(kit.getKitContain(37));
        Bukkit.getPlayer("playerName").getInventory().setLeggings(kit.getKitContain(38));
        Bukkit.getPlayer("playerName").getInventory().setChestplate(kit.getKitContain(39));
        Bukkit.getPlayer("playerName").getInventory().setHelmet(kit.getKitContain(40));
    }``` my method where its saying where the error is getting from
chrome beacon
#

Well that's not efficient code

#

You really shouldn't cast blindly

twilit roost
#

How to move a whole bunch of blocks repeatedly at once in same direction?

opal juniper
#

⭐ loop ⭐

twilit roost
#

And how to load a large build ?
If its possible without APIs

kindred valley
#

can i provide a book to be opened till the last papaer

tall dragon
twilit roost
#

yep
My idea is to load a ship that will be controllable when player joins
I tried using fixed for loops for generating Sails
but that seemed little too awkward for me

tall dragon
#

could use this

twilit roost
#

thx imma take a look at it

kindred valley
#

is there any way can not click done buton till get the last paper on a book

native falcon
#

Would this be correct?
Bukkit.getServer().getWorld("main")).playSound(player.getLocation(), Plugin.getPluginInstance().getConfig().getObject("Sound", Sound.class), 0.5f, 0f);
In the Config:
Sound: BLOCK_NOTE_BLOCK_HARP

kind hatch
#

You'd be better off using #getString("Sound") instead of #getObject("Sound") as you wouldn't need to cast to a string.

tardy delta
#

i mean use dependency injection for your plugin

#

also that world may not exist

kind hatch
#

Also, if you have the player object, you can use player#getWorld() instead of Bukkit#getWorld()

native falcon
tardy delta
#

if some idiot deletes it, it will throw an exception

native falcon
heady spruce
tardy delta
#

dont do it then

last ledge
#

if(player.hasPermission("Fancychats." + plugin.getConfig().getStringList("Colors")))

#

I want to print this line

#

How do I do it

#

I want to print the full form of this permission

kindred valley
#

hello guys there is a problem

tardy delta
#

why are you checking if a player has a permission of a list to a string?

kind hatch
#

Anyone here good with mysql? I'm having some small issues with my setup. I've got my queries working, but they seem slow. They are tied to inventory click actions, and they do work, but it takes a second. I'm worried about what would happen if multiple people were using the inventories at the same time. Is this normal for mysql? Is there a way to speed things up?

kindred valley
#

when i join a server i cant fucking see anything just air

last ledge
tardy delta
last ledge
#

If player has perms like FancyChats.&c

#

it will change its font color to red

#

and so on

#

idk what I'm doing, but I'm doing something ig.

kind hatch
#

Which unfortunately, needs to be often.

tardy delta
#

that will check if player.hasPermission("FancyChats.["&c", "&f", /* etc */]")

last ledge
#

oh

tardy delta
#

and query your db once in a while

tardy delta
#

what are you tryin to achieve?

#

checking if the player has permisison to use that colorcode in chat?

last ledge
# tardy delta what are you tryin to achieve?

I'm trying to achieve the permission the player has, for example if player has perms like Fancychat.&c, the chat he sends will be changed to red color if has .&e will change to yellow color etc

kind hatch
#

Hmm, well I am a little worried about how much data I have per player, but I am caching yaml files for the other storage implementation. My only question is how would I save these queries to be executed later if I'm storing playerdata in a cache?

tardy delta
#

i guess you want to loop over the color codes and if the player has that permission, break and apply it

#

so i assume these codes are in some specific order

last ledge
#

No, color codes are written randomly in the config

tardy delta
#

so like saving the whole cache after some time

last ledge
#

String msg = event.getMessage(); String newMsg = ChatColor.translateAlternateColorCodes('&', "" + msg); event.getMessage().replace(msg,newMsg);

#

I'm trying something like this

#

'&',""+ msg

#

idk what to put inside this

#

so that it works

#

;-;

#

I'm myself confused.

eternal night
#

event.getMessage().replace(msg,newMsg); makes no sense

#

strings are immutable

#

event.setMessage exists

tardy delta
#
for (String colorCode : config.getStringList("codes")) {
  if (player.hasPermission("blablabla." + colorCode)) {
      // save that code for the player somewhere idk
      break; //???
  }
}```
kind hatch
tardy delta
#

not sure about the break part but you cant have multiple colors applied i guess

mystic gate
#

hi

#

i have a problem with my scoreboard plugin

kind hatch
mystic gate
#

im making it so you can edit and add lines from it config

#

but how i make it color it as the config

tardy delta
mystic gate
#

i tried java Objective obj = scoreboard.registerNewObjective("server", "dummy", ChatColor.translateAlternateColorCodes("&", plugin.getConfig().getString("ScoreBoard_name"))); but it says error

kind hatch
mystic gate
#

if i try ChatColor.BLUE it works

#

or any other color

#

but not translateAlternateColorCodes

tardy delta
#

not optimized at all but it might give you an idea

last ledge
#

does this make sense

#

?

tardy delta
#

dont think you want to check if the player has permission every time

#

rather save the color code or something

#

so the actual ChatColor, not the char

midnight shore
#

is there an event for entity move?

#

like there is playermoveevent

#

but is there also entitymoveevent?

#

or smth similar

last ledge
tardy delta
midnight shore
#

in spigot?

kind hatch
rotund pond
tardy delta
uncut bane
#

Is it possible to split the username of players with a space ?

quaint mantle
#

can you ppl just tell me how can I make that whenever I place a beacon it places a block on it and after 1 it changes the block on it I cant understand anything

tardy delta
#

?scheduling

undone axleBOT
tardy delta
#

and listen for the blockplaceevent

quaint mantle
last ledge
quaint mantle
quaint mantle
tardy delta
#

ah it changes

#

whats after 1? 1 second? 1 tick?

quaint mantle
#

and it repeat on changing blocks on it

tardy delta
#

then schedule a reapeating task

chrome beacon
#

We've spoon fed you enough code already

#

If you want us to write the entire thing for you why not hire someone

#

?services

undone axleBOT
tardy delta
#

i guess the beacon color will change when you place a block on it serversided 🤤

quaint mantle
#

my code looks liek this rn:

                        int c_color = 0;
                        public void run() {
                            if (c_color==7){
                                c_color=0;
                            }
                            block.getRelative(BlockFace.UP).setType(Material.RED_STAINED_GLASS);
                            c_color++;
                            if (c_color == 1){
                                block.getRelative(BlockFace.UP).setType(Material.ORANGE_STAINED_GLASS);
                                c_color++;
                            }
                            if (c_color==2){
                                block.getRelative(BlockFace.UP).setType(Material.YELLOW_STAINED_GLASS);
                                c_color++;
                            }
                            if (c_color==3){
                                block.getRelative(BlockFace.UP).setType(Material.YELLOW_STAINED_GLASS);
                                c_color++;
                            }
                            if (c_color==4){
                                block.getRelative(BlockFace.UP).setType(Material.GREEN_STAINED_GLASS);
                                c_color++;
                            }
                            if (c_color==5){
                                block.getRelative(BlockFace.UP).setType(Material.BLUE_STAINED_GLASS);
                                c_color++;
                            }
                            if (c_color==6){
                                block.getRelative(BlockFace.UP).setType(Material.PURPLE_STAINED_GLASS);
                            }
                        }
                    }.runTaskTimer(plugin, 20, 20);
                }
            }```
tardy delta
#

use a switch

quaint mantle
chrome beacon
#

Yes

tardy delta
#

ye

quaint mantle
#

ok

tardy delta
#

placing a different (glass block i guess) on a beacon whenever its placed

quaint mantle
#

I am trying yo change the block on the beacon after every one second reptivley

tardy delta
#

and whats 'after 1'?

quaint mantle
#

after 1 second

tardy delta
#

i'd say hide them all and the ones you dont want to hide, write their description in the lore?

granite owl
iron glade
#

"spread - Spread of the arrow. A recommend spread is 12"

#

what do they mean with spread?

echo basalt
#

angle deviation

#

setting it to 0 will make the arrow follow the direction vector perfectly

#

adding it will be a spread% innacuracy

tall dragon
quaint mantle
#

where is the wiki for saying what packet contains what?

#

i rmb there was something like this on a minecraft wiki

#

found it

tardy delta
#

player runnable things

#

only gets worse

iron glade
#

Is there a way to add a visual trail to the arrow?

tardy delta
#

spawn particles

native elbow
#

why isnt spigot using the official mojang mappings for NMS classes?

iron glade
tardy delta
#

ye

#

follow the arrow until it hit

#

would i do

iron glade
#

I'll try it

#

Is there something less intensive than

for(World w : Bukkit.getWorlds()) {
    for(Entity ent : w.getEntities()) {
         if(ent instanceof Arrow) {

           Arrow a = (Arrow) ent;

             if(a.getPersistentDataContainer().get(plugin.key, PersistentDataType.STRING).equals("spartanian arrow with target " + player.getUniqueID()))

                   a.remove();
                        }

                    }
                }```to remove all specific arrows?
bold copper
#

hi, please tell me what kind of event happens when a player deals damage to someone?

chrome beacon
bold copper
iron glade
#

^

bold copper
# iron glade ^

then... tell me if I can damage the entity so that this event does not work, but so that the affected entity knows who caused the damage

native elbow
chrome beacon
#

Scroll down to developer notes

kindred valley
#

?services

undone axleBOT
bold copper
bold copper
#

Tell me in which direction I should look for an error so that there is no conflict

quaint mantle
#

@tardy delta it doesnt work its not placing a block on it

uncut bane
#

Hey, can someone help me with my code please?

tall dragon
#

?ask

undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!

uncut bane
#

is it possible to make that when player getrightclicked he can accept or deny

crude loom
#

How can I silence a living entity?

kind hatch
#

Wdym by silence?

quaint mantle
#

kill

#

🔪

crude loom
#

So it won't make a sound, like the sound a Villager does

crude loom
iron glade
kind hatch
#

That flag hides all enchants no matter what. You would need a custom enchant solution/lore management system.

quaint mantle
#

In protocollib, is there a way to get the field name?

#

cause the order of protocollib is not the same as in the wiki

iron glade
#

anyone knows why my default config doesn't reset when I delete everything from it, save it and then reload?