#help-development

1 messages ยท Page 1855 of 1

spiral light
#

you said you wanne just remove vanilla recipes ?

red sedge
#

thing or is it to remove minecraft recipe

last ledge
#

dude, I'm trying to create field in config.yml using /register command. Player comes runs command, a field will be created with his UUID, for e.g UUID: Password

spiral light
#

plugins that add recipe shouldnt use "mineraft" as ns ... they should use plugin name or smth else to identify ... thats the reason for having a key

last ledge
#

I just need to know how to create custom field from command

#

plugin.getConfig().set(player.getUniqueId(), 0);

#

am trying

young knoll
#

Config.set?

spiral light
#

plugin.getConfig().set(player.getUniqueId()+".Password", 0);
=?

rough basin
#

Where Can I see an example where I add an input value to a BukkitRunnable and recurse to keep the input value?
I sucks at google so I always get new BukkitRunnable() code That I didn't want bruh

red sedge
#

thanks

frigid rock
#

hello! I'm pretty new at spigot dev, and i was trying to make a plugin. This simple plugin checks if a player wrote in chat a message example: "hello" and it would cancel it, and finally send a message to the player with some informations.

#

i was wondering how to do it

#

i tried making a AsyncPlayerChatEvent but it didnt actually work

quaint mantle
#

Paper momento

#

?learnjava

undone axleBOT
quaint mantle
#

But i think the concept is pretty easy you dont need to learn entire java to know how to make it lul

red sedge
#

i know

#

incredible

red sedge
#

did you register the event~?

frigid rock
#

yup

red sedge
#

can you send your code?

frigid rock
#

yup

red sedge
#

may you?

frigid rock
red sedge
#

i think there is no @EventHandler

#

above your method

frigid rock
#

bruh.

#

thank you so much haha

red sedge
#

no problem!

wide robin
#

Hello! I just started developing plugins for spigot, and I ran into a problem. When I am creating my first class extend JavaPlugin it says that it doesn't exist, I added the jar file to the libaries and still it didn't work, What should i do?

quaint mantle
#

Learn maven!

#

Or ya know, use intellij with the minecraft plugin for it

spiral light
quaint mantle
#

It does almost everything

wide robin
wide robin
red sedge
spiral light
#

but if you used maven correctly it shouldnt be the wrong jar

wide robin
#

IDK if I did it correctly

#

Im new to this

buoyant viper
wide robin
#

I just created a project and I chose maven

#

in intellij

buoyant viper
#

did u add the repository and dependency

wide robin
red sedge
#

I'd say watch like 2-3 tutorials abt spigot

#

that should get you started

wide robin
#

I explored the folders in the jar file and I don't even see the plugin directory

wide robin
red sedge
#

sure lemme find some

wide robin
#

thanks man

#

I looked for some but all of them are not updated

red sedge
#

okay actually

#

you have intellij right

wide robin
#

yeah

red sedge
#

uh go to plugins

#

and download minecraft developer

last ledge
#

plugin.getConfig().set("Accounts."+ player.getUniqueId()+".Password", 0);

wide robin
red sedge
#

is what im goi ng to guess

vague mason
#

How do I check on what Spigot API version getBlockData() has been added? So I don't need to test this on all mc server versions.

red sedge
# wide robin done

create a new project and there will be Minecraft Developer in the projectcreation menu

last ledge
#

If player types /register will it be saved as UUID : Password?
plugin.getConfig().set("Accounts."+ player.getUniqueId()+".Password", 0);

wide robin
#

paper is based on spigot right?

true perch
#

Is there a way to write a method that works on a Player object?

player.callCustomMethod("test");```
last ledge
red sedge
spiral light
buoyant viper
#

holy shit they were trying to help bud

red sedge
wide robin
#

thank you

true perch
spiral light
last ledge
wide robin
#

oh and I am emberrased to ask but what is it a groupId and artifactId?

red sedge
buoyant viper
#

groupId is like org.spigotmc

artifactId should b spigot-api

red sedge
#

i think groupid was like the author

#

not sure tho

last ledge
wide robin
#

oh thanks

red sedge
last ledge
#

I dont want you to take effort to help me ๐Ÿ™‚

red sedge
#

k

last ledge
#

and I dont want that

frigid rock
#

yo! i have another question lol. How do you change weather from rain to sun? (i promise its the last one lol)

spiral light
#

didnt readed all the msg ... why is Frolic so mad ?

frigid rock
last ledge
spiral light
#

lol

last ledge
#

also that . after the lol

spiral light
#

its just a name O.o

last ledge
#

ik but

#

my brain imagines him as a Kid

#

lol.

buoyant viper
#

jus take the dam help smh

red sedge
#

so my help is automatically useless

buoyant viper
#

if it fixes it it fixes it they could be like 8 years old or 35 years old code is code

last ledge
buoyant viper
#

so?

last ledge
#

it explains all

spiral light
#

and you ask how to save a config or how to set a config path ? and ??

buoyant viper
#

both of which are on spigots plugin tutorial pages iirc

last ledge
#

But

#

my question was

#

How to make a field using command in config.yml

#

for my /register command

#

which will save like UUID : Password

spiral light
red sedge
last ledge
#
  1. ok
buoyant viper
maiden briar
#
public void setNightVisionEnabled(boolean nightVisionEnabled)
    {
        System.out.println("[DEBUG] [SpectatorSettings] Path: " + "storage.spectator-settings." + uuid + ".night-vision");
        plugin.getConfig().set("storage.spectator-settings." + uuid + ".night-vision", nightVisionEnabled);
        plugin.saveConfig();
        System.out.println("[DEBUG] [SpectatorSettings] NightVision Should Be: " + nightVisionEnabled);
        System.out.println("[DEBUG] [SpectatorSettings] NightVision: " + plugin.getConfig().getBoolean("storage.spectator-settings." + uuid + ".night-vision"));
    }
[15:51:32 INFO]: [DEBUG] [SpectatorSettings] Path: storage.spectator-settings.88a9152e-d81a-3141-ad43-4fcfada8a470.night-vision
[15:51:32 INFO]: [DEBUG] [SpectatorSettings] NightVision Should Be: true
[15:51:32 INFO]: [DEBUG] [SpectatorSettings] NightVision: false

Ehm?

quaint mantle
#

what api version should i use to develop 1.17 plugins?

buoyant viper
#

1.17

quaint mantle
#

so for 1.18 i should 1.18 right?

buoyant viper
#

yeah

quaint mantle
#

ok thnx

maiden briar
#

@ivory sleet

delicate cargo
#

how can i make an extending class change a super class variable?

red sedge
last ledge
#

ig

delicate cargo
ivory sleet
maiden briar
delicate cargo
#

super().?

maiden briar
#

No without .

#

It is a constructor

magic viper
#

Hi! I'm really new to plugin development, but I need to make an npc that always looks at player's eyes, I was told that there's a way to send an specific packet to make the game just always follow client player eyes, but I didn't find information about it online, is that even possible? Or do I need to calculate the direction the player is and send the rotation packet?

maiden briar
#

Last one is my best guess

last ledge
#

there is already one plugin to do that?

#

citizens?

magic viper
red sedge
#

I think citizens isnt client side

delicate cargo
maiden briar
#

Then you can't extend the class

magic viper
maiden briar
#

It is impossible

delicate cargo
#

i made the class

ivory sleet
#

tvhee idk I mean maybe try to print out if the value was set in the first place before writing to a file

maiden briar
#

Make a constructor then

delicate cargo
#

n o

buoyant viper
#

what

delicate cargo
#

because abilites have to be hardcoded

buoyant viper
#

whatdya mean no

maiden briar
delicate cargo
#

oh wait

#

ohhhhh

ivory sleet
#

well that code is too small to tell what you might have done

maiden briar
#

You can make a protected constructor

delicate cargo
#

im stupid

ivory sleet
#

like for instance if you're doing stuff multithreaded it can mess you up big time

maiden briar
ivory sleet
#

send the code

maiden briar
#

Ok

magic viper
patent horizon
#

how do i remove a value from a yaml config?

maiden briar
#

set null

delicate cargo
#

how can i add a function parameter to a constructor?

red sedge
#

alternating the npcs so they dont all refresh in one tick

ivory sleet
#

tvhee why do u use allman =c

maiden briar
#

?

magic viper
#

That makes sense haha

ivory sleet
#

allman style

maiden briar
#

What style is that? Never heard of

ivory sleet
#

when
{
you
{
do
{
this
}
}
}

maiden briar
#

Huh where did I do that?

red sedge
ivory sleet
#

code you just sent

red sedge
#

maybe add a config feature so people can decide based on their server

maiden briar
#

I know, but some are impossible to make in 1 line

ivory sleet
#

no

#

not rly

#

like

#

just keep the braces on the same line imo

manic furnace
#

Under which license is the spigo-api?

ivory sleet
#

anyway can paste them rather

#

?paste

undone axleBOT
magic viper
#

Ohh right, well... I'll test if it looks smooth, and will try to optimize filtering by distance

maiden briar
#

Ohh I have learnt this from the start since 1.5 years and now I can't change it anymore, my head explodes otherwise

ivory sleet
#

No worries I just purely hate that style but nothing wrong with that

maiden briar
#

Ok

#

Don't look the sysout debug, it is removed if the problem is fixed

ivory sleet
#

Wym?

lean gull
#

anyone? (i'm using protocollib btw)

manic furnace
ivory sleet
#

?dmca

undone axleBOT
ivory sleet
#

Believe the license is there

manic furnace
#

I couldn't find any license there

ivory sleet
#

oh yeah, well iirc its GNU General Public License 3

copper scaffold
#

Has someone an idea how i can make my own plot plugin?

red sedge
#

?paste

undone axleBOT
red sedge
#

Hm?

#
        while (recipeIterator.hasNext()) {
            Recipe recipe = (Recipe) recipeIterator.next();
            if (!(recipe instanceof Keyed))
                continue;
            Keyed keyedRecipe = (Keyed) recipe;
            if ("minecraft".equals(keyedRecipe.getKey().getNamespace()))
                Bukkit.removeRecipe((NamespacedKey) keyedRecipe.getKey());
        }
```https://paste.md-5.net/dujinavaha.cs
#

@spiral light (sorry for ping) thought you could help

spiral light
#

weird style

#

hmm couldnt you let it look like before without the continue ?

red sedge
#

I could?

#

would be like that i think?

spiral light
#

less complicated i think ๐Ÿ˜„
also "string".equals(...) is very confusing

red sedge
#

I guess I usually use that so it will never be null

#

but in this situation its just habit

#

so?

spiral light
#

testing...

dusk flicker
#

That must go against Java conventions

red sedge
dusk flicker
#

That string check

#

?conventions

undone axleBOT
red sedge
#

i mean it is more useful

dusk flicker
#

Eh not really

red sedge
#

dont need a null check

dusk flicker
#

As you said it's to make sure it isn't null, might aswell just use an actual equals null as it is way more readable

red sedge
#

meh

#

im not sure if it makes it hard to read

#

more like not used to

#

but then again it doesnt really matter since its a private plugin

dusk flicker
#

You can tell if it's hard to read if it's difficult to understand or you need to be use to something to understand

lean gull
#

anyone know how to disable noteblocks' blockstate updates with packets?

dusk flicker
#

But yeah not the biggest thing, just common practices

red sedge
#

also wow using if statements without brackets is against the conventions?

spiral light
#

very weird

#

this will work

red sedge
#

it works till the remove i think

spiral light
#

hmmm

#

probably because removing while iterating is bad xD

red sedge
#

hm?

#

maybe i should add the values to a list or smth

#

and loop over that after the while loop

#

wait

#

"net.minecraft.world.item.crafting.IRecipe.toBukkitRecipe()" because the return value of "java.util.Iterator.next()" is null

#

??

spiral light
#

if you remove in the iterate the intern list is smaller

#

so hasNext tests for like the size ...

#

creating a list and add values from the iterate and after that remove them works fine

#

sucks for me because now i cant craft anything anymore xD

tender shard
#

any way to detect whether a hit is a critical hit, without manually calculating all of that myself?

red sedge
#

well who needs crafting anyways

#

just yeet one part of the game who cares

red sedge
#

The base attack must not be reduced to 84.8% damage or lower due to cooldown.
weirdly detailed minecraft... weirdly detailed

spiral light
#

well its 10/118 of the cooldown ... see no problem with this

red sedge
#

oh/

red sedge
#

smh get your math right minecraft

ripe merlin
#

Hi everyone, does anybody know why this doesn't work anymore in 1.18 ?

red sedge
#

click implement methods....

ripe merlin
#

That doesn't do anything

#

i already tried

red sedge
#

what is x()

ripe merlin
#

idk lol

#

this is why i'm here

spiral light
#

it shouldnt be possible to have 2 methods with exact the same name and return types and arguments O.o

ripe merlin
#

yeah but entitysheep is part of the api

spiral light
#

do you have the x() method in your class ?

ripe merlin
#

no

red sedge
#

try removing all the methods and implement methods al over again

ripe merlin
#

i already tried that

#

i don't understand why it doesn't work

spiral light
#

which version ?

ripe merlin
#

1.18

spiral light
#

you could try using remapped-mojang version ... there is no x() method xD

glossy marsh
#

Hello! Can anyone help me? How do I make use of the Bungeecord Chat API when coding a plugin? I already imported the spigot api into my project. I've been trying to figure this out for over an hour

red sedge
ripe merlin
#

The implement methods create just "a" and "d_"

ripe merlin
#

I'll try to re-map

#

I should use buildtools ?

spiral light
#

you have to

red sedge
#

okay weird question while adding a custom craft do I need to add the plugin name to the id or jsut referencing my plugin will automatically add it

glossy marsh
#

Is there a certain library I need to import?

spiral light
#

?paste code ?

undone axleBOT
spiral light
#

just the right imports

ripe merlin
#

it works!!!

glossy marsh
ripe merlin
#

Thanks you very much @quaint mantle ๐Ÿ™‚

hollow bluff
#

I have removed fire damage from mobs, but how can I do so they arent on fire?

red sedge
#

fire tick i think

hollow bluff
#

ah yes thanks

spiral light
glossy marsh
glossy marsh
spiral light
#

did you try to import it ? XD

glossy marsh
#

Oh and import net.md_5.bungee.api.chat.ClickEvent; doesn't work

spiral light
#

do you use maven ? looks like you only have the Spigot-API

glossy marsh
spiral light
#

i think you need to add the spigot-server-jar too

#

should be in the bunder/versions dic

dim ridge
#

hey everyone this isn't a self promo thing but I'm a mc youtuber and I'm looking for someone who know how to code mc plugins for papermc/spigot rn there isnt any payment but if ur interseted pls dm me ๐Ÿ™‚

red sedge
#

@spiral light could you possibly add me

glossy marsh
glossy marsh
acoustic pendant
#

Hey! i have a plugin that reduces damage an entity has done to a player, but if i get a mob from a custom mobs plugin, that damage isn't being reduced, how can i solve that? (I have tried with the priority at lowest)

#

with EntityDamageByEntityEvent

#

and event.setDamage(The damage reduced)

#

how can i solve that?

glossy marsh
paper falcon
#
<plugin>
                <groupId>net.md-5</groupId>
                <artifactId>specialsource-maven-plugin</artifactId>
                <version>1.2.2</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>remap</goal>
                        </goals>
                        <id>remap-obf</id>
                        <configuration>
                            <srgIn>org.spigotmc:minecraft-server:1.18-R0.1-SNAPSHOT:txt:maps-mojang</srgIn>
                            <reverse>true</reverse>
                            <remappedDependencies>org.spigotmc:spigot:1.18-R0.1-SNAPSHOT:jar:remapped-mojang</remappedDependencies>
                            <remappedArtifactAttached>true</remappedArtifactAttached>
                            <remappedClassifierName>remapped-obf</remappedClassifierName>
                        </configuration>
                    </execution>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>remap</goal>
                        </goals>
                        <id>remap-spigot</id>
                        <configuration>
                            <inputFile>${project.build.directory}/${project.artifactId}-${project.version}-remapped-obf.jar</inputFile>
                            <srgIn>org.spigotmc:minecraft-server:1.18-R0.1-SNAPSHOT:csrg:maps-spigot</srgIn>
                            <remappedDependencies>org.spigotmc:spigot:1.18-R0.1-SNAPSHOT:jar:remapped-obf</remappedDependencies>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
``` add this to <plugins><plugins>, version here is 1.18, change it to whichever you need
And also add in <dependencies><dependencies> `<classifier>remapped-mojang<classifier>`
tender shard
spiral light
spiral light
patent horizon
#

i got this from decompiled code since i lost the original

spiral light
#

looks wrong

patent horizon
#

ik

glossy marsh
patent horizon
#

i was basically just looping through the data.getGuilds to see if answ matched any of them, regardless of capitals

spiral light
glossy marsh
buoyant viper
spiral light
glossy marsh
# spiral light what does not work ?

I tried a bunch of things and to add a bunch of libraries as dependencies; BungeeCord.jar, paper-1.18.1.jar, spigot-1.18.jar and spigot-api-1.18.1-R0.1-SNAPSHOT

None of these got the code to work

spiral light
#

did you run the server-boot-jar ?

glossy marsh
spiral light
#

if you run buildtools you get a server jar that is only the bootstrap-jar
if you run this jar (starting the mc-server with it) it creates all libraries, api such as the spigot-server-jars which you will probably need

trim crystal
#

How can I put cooldowns on items like enderpeals have?

glossy marsh
fleet imp
#

I'm using the Maven Shade plugin. In goals, maven doesn't know what shade is and neither do I
also, how do I actually add a shaded jar

spiral light
trim crystal
#

Thanks

thorny python
#

is there a way to make the server shutdown immediately when exceptions happens during loading my plugin?

#

Bukkit.shutdown() seems still loading other plugins even I call shutdown

dark arrow
#

how to summon an entity as the exact location given?

thorny python
#

oh thanks

tender shard
tacit drift
#

also set in any integer dfferent from 0

tender shard
# trim crystal How can I put cooldowns on items like enderpeals have?

just did the same thing an hour ago lol

    @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
    public void onThrowEnderPearl(ProjectileLaunchEvent event) {
        if(event.getEntity().getType() != EntityType.ENDER_PEARL) return;
        ProjectileSource source = event.getEntity().getShooter();
        if(!(source instanceof Player)) return;
        Player player = (Player) source;
        int cooldown = main.getConfig().getInt("ender-pearl-cooldown",20);
        Bukkit.getScheduler().runTaskLater(main,
                () -> player.setCooldown(Material.ENDER_PEARL, cooldown),
        1L);
        main.debug(String.format("Setting Ender Pearl cooldown for %s to %f seconds", player.getName(), ((double) cooldown) / 20));
    }
thorny python
#

got it

little trail
#

How can I compile my 1.17 plugin that doesn't use 1.17 specifics to work with backwards compatibility, currently I get "warn: myplugin does not specify an api version".(removed 1.17 from it as an attempt) and "has been compiled by a more recent version of the java runtime (version 60), this version supports up to 55"

fleet imp
#

I'm using the Maven Shade plugin. In goals, maven doesn't know what shade is and neither do I
also, how do I actually add a shaded jar

#

please

#

anyone. i need help

spiral light
#

yes you need help .... do you wanne show your pom too ?

little trail
tender shard
#

then it works with ALL versions in theory

fleet imp
# spiral light yes you need help .... do you wanne show your pom too ?
<plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>16</source>
                    <target>16</target>
                </configuration>
                <version>3.8.1</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <shadedArtifactAttached>true</shadedArtifactAttached>
                            <shadedClassifierName>shaded</shadedClassifierName> <!-- Any name that makes sense -->
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>

it doesnt know what shade is

little trail
#

What jre version should I pick

tender shard
tender shard
undone axleBOT
little trail
#

As far back as I can really

tender shard
spiral light
little trail
#

So I assume with the 1.13 api version the lowest it'll support is 1.13

fleet imp
tender shard
#

it will work with ANY version as I already said

#

"api-version" doesn't exist in pre 1.13

little trail
#

oh I see

spiral light
# fleet imp wdym

your use compiler plugin and what it to shade ... you would need the shade plugin to use shade ... all in all this makes no sense there ^^

ripe merlin
#

I'm back for help, @quaint mantle if you could help me again i'll be gratefull ๐Ÿ˜ฆ
When I build it says "java: x() in org.worsewarn.testplugin.CustomSheep cannot override x() in net.minecraft.world.entity.EntityLiving
return type boolean is not compatible with void"

fleet imp
tender shard
undone axleBOT
red sedge
#

okay so

red sedge
#

i added some custom recipes

#

but in the recipe book it doesnt auto complete

ripe merlin
tender shard
# fleet imp https://paste.md-5.net/zexerovabe.xml

remove those shading stuff from the compiler plugin and add the shade plugin as separate plugin, sth like this:

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.2.4</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>
    </build>
tender shard
red sedge
#

its more like that i can see the recipe

tender shard
#

does your recipe use MaterialChoices or ExactChoices?

red sedge
#

but it sees it as i dont havethe items

glossy marsh
red sedge
#

exact

tender shard
#

do those ExactChoice items have any NBT tags?

fleet imp
spiral light
red sedge
#

and i got the items from that config value

tender shard
red sedge
#

so it is exactly the same

tender shard
#

it will work when you use PDC tags instead

glossy marsh
red sedge
#

uh

#

so i cant have any metadata?

tender shard
#

yes you can: using PDC

spiral light
red sedge
#

how tf am I suppose to do that?

tender shard
#

?pdc

tender shard
red sedge
#

yeah. but metadata contains lore and all that stuff

tender shard
#

just custom NBT tags won't work

fleet imp
red sedge
#

uhm can i send the itemstack text of the item?

#

cuz rn im really confused

tender shard
#

the itemstack text?

red sedge
#

hold up

#

?paste

undone axleBOT
tender shard
red sedge
tender shard
#

hm that should actually work

#

what's your MC version?

red sedge
#

1.18

tender shard
#

weird. then I have no idea too

red sedge
#

thinking of that might be the issue

#

maybe

#

oh

#

well

#

thanks anywayas

ripe merlin
tender shard
#

you have to use the full server artifact, the one only called spigot, not spigot-api

ripe merlin
#

i tried also that but it's the same error

quaint mantle
#

?log4j

undone axleBOT
tender shard
#

if you have spigot, you also have spigot-api

tender shard
buoyant viper
#

what if i alex api

#

๐Ÿ˜Ž

tender shard
#

what? ๐Ÿ˜„

tacit drift
#

What are mojang mappings?

#

pretty much deobfuscated?

buoyant viper
#

๐Ÿ˜

tender shard
ripe merlin
#

java: x() in org.worsewarn.testplugin.CustomSheep cannot override x() in net.minecraft.world.entity.EntityLiving
return type boolean is not compatible with void

tender shard
tacit drift
#

omg

ripe merlin
#

and yeah i have all this stuff in my pom.xml

tender shard
ripe merlin
#

ye

tender shard
#

do you have a method called x() in your CUstomSheep?

ripe merlin
#

yeah

buoyant viper
#

mojang mappings are the unobfuscated names of methods fields classes etc provided by Mojang themselves @tacit drift

tender shard
#

or do you just use your IDE to build / compile?

#

in mojang mappings, there are no methods called "x()"

#

they have proper names like "getLocation()"

ripe merlin
#

I'm using my ide to build

tender shard
#

that's your problem

tacit drift
#

๐Ÿค”

ripe merlin
#

arhg

tender shard
#

you must use maven both for you dependencies and to compile

#

are you on intelliJ?

ripe merlin
#

okay

#

yeah

tender shard
#

right click your pom, then choose "Add as Maven Project" or sth like that

#

should be at the bottom

buoyant viper
#

is there a gradle task equivalent of specialsource

eternal oxide
#

or Right hand window labeled Maven, use lifecycle package

buoyant viper
#

or would it just work

tender shard
eternal oxide
#

true, but usually its people using artifacts and not the maven window

buoyant viper
#

if he had the rest of spigot it probably loaded as maven

tender shard
ripe merlin
#

i loaded it as a maven module

#

i juste don't build it with

tender shard
#

can you show a full screenshot of your x() method including all the pom.xml stuff in your sidebar, etc? like a full intellij screenshot

tender shard
#

probably you simply didn't reload your pom changes after editing your pom

#

that's why intelliJ doesn't underline @Override x() in red

eternal oxide
#

If he is gettign an error about overriding x() then InteliJ is seeing his project. He's building with Artifiacts not Maven

tender shard
#

from what I understood, intellij thinks everything is fine until they start building the jar

#

that's why I asked for a screenshot, then we'll know for sure ๐Ÿ™‚

eternal oxide
#

Yes, because he's loaded with Maven, btu not compiling with it

spiral light
#

Oh Elgar your the guy with the CustomSheep right ?

ripe merlin
eternal oxide
#

InteliJ is trying to build using Artifacts and not Maven, so it doesn;t do any mappings

tender shard
# ripe merlin

I literally said "full screenshot" including your FULL intelliJ window

#

including the sidebars etc

eternal oxide
ripe merlin
#

but if i romove x() method i get

tender shard
#

noone can help you until you show a proper screenshot of your setup

eternal oxide
#

^

buoyant viper
#

^^

patent horizon
#

^^^

ripe merlin
#

oh sry

buoyant viper
#

just hit prntscr button and paste ezpz

tender shard
#

easy peasy lemon squeezy

ripe merlin
buoyant viper
tender shard
# ripe merlin

did you by any chance also add the unremapped spigot .jar manually as dependency to intellij?

#

you should never add ANY dependencies using IntelliJ. You should let maven handly everything from dependencies to building, otherwise you're fuuuucked

#

and not in the good way

buoyant viper
ripe merlin
#

possibly

tender shard
#

remove that again

#

see the "External Libraries" part on the left?

#

EVERY dependency except your JDK should start with "Maven: "

buoyant viper
#

fuck thats a lot of deps

tender shard
#

yeah lol

ripe merlin
patent horizon
#

man really said Depend: *

tender shard
# ripe merlin

pls look through the list and check if any single one doesnt start with Maven

tender shard
ripe merlin
#

all start with Maven:

patent horizon
#

my list aint that long xd

tender shard
#

this is my full list lol

patent horizon
#

you using spigot or spigot-api ?

tender shard
#

(which btw is also not a mojang mapped name)

olive lance
#

mfnalex what kind of plugin are you making that uses like 80 deps

tender shard
#

so there MUST be the "un"remapped spigot dependency somewhere

tender shard
foggy estuary
#

?paste

undone axleBOT
ember estuary
#

How are Bukkit/Spigot/Paper made?
I guess you just modify the vanilla jar, but is there something to deobfuscate the variable names and stuff? some kinda map?

foggy estuary
#

https://paste.md-5.net/ilosuwerof.java anyone know why the ``` for (Player player : Bukkit.getOnlinePlayers()) {

                    player.sendMessage("test");
                player.playSound(player.getLocation(), Sound.ENTITY_ENDER_DRAGON_DEATH, 3.0f, 3.0f); ``` doesnt work?
patent horizon
#

time to shade all of papi, vault, and essentials into my project hehe ๐Ÿคช

tender shard
#

lets just shade the JDK ๐Ÿ™‚

quaint mantle
#

im gonna make like the most bloated library ever

patent horizon
quaint mantle
#

making a permissions plugin would take 20 lines of code

tender shard
#

what was this cli app called again that counts lines of code?

tender shard
foggy estuary
#

Yeah

tender shard
foggy estuary
#

I tried testing with send message in case my music doesnt work but its not the case.

#

Just doesnt do it.

tender shard
#

in your settings

tender shard
#

I don't understand what that sentence means

#

you mean the message also doesnt get sent?

foggy estuary
#
                    
                        player.sendMessage("test");```
#

yeah

tender shard
#

then obviously your loop never runs because you didnt show enough code

buoyant viper
#

?paste

undone axleBOT
tender shard
paper falcon
tender shard
tender shard
paper falcon
#

mine?

paper falcon
#

oh I've seen that but someone else asked it

tender shard
tender shard
tender shard
# foggy estuary There is nothing.

show your other code. if you don't and think everything else is fine, then I have bad news: you DID mess up somewhere but noone can tell you when you don't show more code

foggy estuary
#

Ill show it all ๐Ÿ˜„

#

?paste

undone axleBOT
tender shard
#

yeah that would be helpful ๐Ÿ˜„

#

otherwise it's like showing your cat key and say "why does my engine not start" ^^

foggy estuary
tender shard
#

the listener in line 117 it is right?

#

the entity that died doesn't have the metadata "Rav" as it seems. ADd an else to the if to see whether this is true

foggy estuary
#

rav.setMetadata("Rav",new FixedMetadataValue(plugin,"rav")); i set the rav to have that meta in the line above no?

foggy estuary
tender shard
#

your SecondForm event probably runs after your LastDeathForm method

#

why don't you just do it in one listener method?

iron palm
#

what ways you guys recommend for avoiding static abuse?
I sometimes use Constructor if i could
but also sometimes i use static too much

foggy estuary
tender shard
#

and I think a static getter for the main instance is fine too

tender shard
#

e.g. it's totally fine to have static fields such as

private static final Pattern pattern = Pattern.compile("%randomint_([\\d]{1,3})_([\\d]{1,3})%");
#

because that one will never change dependending on any instance

foggy estuary
tender shard
acoustic pendant
#

could anyone tell me why am i getting this error? also i can't use goalSelector method in 1.17

tender shard
#

my guess is you use mojang mappings but your source is still in obfuscated / spigot mappings

acoustic pendant
#

it says that it cant be aplied to world, but in the guide i was following it did this

tender shard
#

erm did you by any chance import BOTH obfuscated and remapped spigot .jar?

#

because it looks like that

#

oh wait I'm stupid

#

ignore what I said

#

you followed a tutorial for custom entities for older versions

acoustic pendant
#

oh lol, 1.7

tender shard
#

meanwhile you also have to provide an entitytype in the constructor

#

but you should really use mojang mappings instead ๐Ÿ˜›

acoustic pendant
#

ok. i'll try that, thanks!

foggy estuary
acoustic pendant
#

do you maybe know a 1.17 guide of custommobs?

tender shard
foggy estuary
#

Ty

acoustic pendant
fading talon
#

does anyone know the plugin authme?

tender shard
acoustic pendant
#

well no, they use goalSelector as well

tender shard
acoustic pendant
#

np thanks

fading talon
#

bc i can login however when other ppl join an error message appears

acoustic pendant
#

authme is bad

tender shard
#

or go to their discord

#

this channel is for help in coding your own plugins

fading talon
#

no one is answering

acoustic pendant
#

use nlogin is better

#

If is posible, anyone could pass me a 1.17 custom mobs guide? i haven't find nothing in google

#

only 1.16 and before

red sedge
#

1.16 one should work fine

acoustic pendant
#

but the method goalSelector doesn't work in the 1.17.1 api

#

Probably i'm not importing nms well

lean gull
#

does anyone know if its possible to make custom player animations with a resource pack and a plugin? like lets say one where you put your hand forward to point, or a handwave animtion like the trident animation

left swift
#

how can i change player skin? i edited textures property in gameprofile, but idk how can i refresh player skin.

wooden fable
#
    private Group getCurrentGroup(Collection<Group> playerGroups, Track track) {
        track.getGroups().forEach(groupName -> {
            playerGroups.forEach(group -> {
                if(group.getName().equalsIgnoreCase(groupName)) {
                    return group;
                }
            });
        });
        return null;
    }

Does someone see what i'm doing wrong here?

On group i'm getting the error "Unexpected return value"

patent horizon
#
[19:27:54 WARN]: [WallyHub] Loaded class net.milkbowl.vault.economy.Economy from Vault v1.7.3-b131 which is not a depend, softdepend or loadbefore of this plugin.``` what am i doing wrong?
left swift
buoyant viper
#

i think u need to de-lambda it

left swift
buoyant viper
#

or assign it to an outcome variable

acoustic pendant
buoyant viper
#

alternatively: streams and optionals, but streams? well....

acoustic pendant
#

Ok, thank!

left swift
#

๐Ÿ‘

wooden fable
#

Thx! I'll just use for (group : groups)

tender shard
patent horizon
#

no

tender shard
#

then I have no idea

patent horizon
#

im starting to think my plugin isn't updating properly on the server

tender shard
#

gg mfnalex best helping duuude

tender shard
#

are you using maven modules by any chance in your plugin?

#

because that one drove me insane, it never updated the classes in the dist jar when I changed only a dependant module without also adjusting its version

#

just open your jar in a zip program and see whether the plugin.yml is correct

patent horizon
#

no

#

just gradle

#

plugman is flooding my console

tender shard
#

oh well if you use plugin, don't wonder if it breaks

#

plugman*

sullen marlin
#

Isn't it softdepends, plural?

patent horizon
#

not according to papi's github

tender shard
#

softdepend is correct

#

unless the tab completion in intellij is broken too

patent horizon
#

it's working ig

left swift
#

How can i refresh player skin, i want to change skin, so i edit textures property

            profile.getProperties().removeAll("textures");
            profile.getProperties().put("textures", new Property("textures", VALUE));```
tender shard
#

without a valid signature, this will never work iirc

solid cargo
#

Yo. So the thing is. I need to create a loop that replaces a certain item with another. All of that is fine. The real question is what impact will the server have? (80+ players)

solid cargo
#

If i make the loop run every 30 seconds

tender shard
#

then it does not matter at all

#

I thought you wanted to do it once per tick or once per second

solid cargo
#

Nah im not that mad

left swift
tender shard
#

from the forums:

Not possible. The signature is obtained from the mojang servers. You got to upload it to a user, than over the user fetch the skins signature and save it. Now you can change your skin back. Save the signature into a config/storage file.
https://www.spigotmc.org/threads/get-value-signature-of-skin-from-file.390567/

solid cargo
tender shard
#

yes

#

just imagine

#

you just check all 30 seconds whether some player has an item

#

the server itself checks on every tick whether every entity steps into a lava, has a block below them, should start to feel hungry now, ...

#

we are not running on 20MHz CPUs anymore ๐Ÿ˜›

solid cargo
#

True lol

tender shard
#

the funny thing is

#

even my raspberry pi can somewhat run minecraft

#

of course it's a special version, but it works lol

solid cargo
#

Yeah. I also had one. I threw it somewhere and idk where it is

visual tide
#

how do i get an nms block from a bukkit block?

solid cargo
#

Prolly in my dadโ€™s junk place

glossy venture
#

you mean like the material

#

or a block in the world

sullen marlin
#

Why

#

?xy

undone axleBOT
visual tide
#

org.bukkit.Block to net.minecraft.server.<version>.Block

#

for playing chest open animation

sullen marlin
#

Why do you need nms for that

visual tide
#

uh

#

does api have that?

visual tide
#

that would be for all players tho

glossy venture
#

org.bukkit.Block is a block in the world and net.minecraft.server.Block is a block type

young knoll
#

I think you can cast to CraftBlock and then getHandle

glossy venture
#

but nms uses block states right

#

it doesnt store block objects

visual tide
#

doesnt have handle ๐Ÿ˜

glossy venture
#

because nms doesnt have a block class

#

extract the block state

sullen marlin
#

I feel like if you want it per player you need to use packets and nms block isn't going to help....

young knoll
#

Then use the state, CraftBlockState, and getHandle

visual tide
glossy venture
#

weird

glossy venture
#

or something like thta

visual tide
#

thats what i said at the beginning

glossy venture
#

because thats the same as an org.bukkit.Material

visual tide
#

wait what

glossy venture
#

or well the block type

foggy estuary
#

Woops

#

i didnt mean to reply for that

glossy venture
#

or something

#

or maybe Blocks.chest

young knoll
#

Yes

glossy venture
#

use that

#

nms Block class is a block type not a block in the world

foggy estuary
#

Is there a limit to amount of metadatas?

glossy venture
#

its grass instead of grass in world "world" at 0 0 0 with [snowy=false]

#

wait does a block need a tile entity to store nbt?

#

or is it in the block state

young knoll
#

Tile entity

glossy venture
#

ah

eternal oxide
#

else track the block and store data in the chunk pdc

alpine urchin
foggy estuary
foggy estuary
#

?

ember estuary
#

Can you guys think of a way to draw/control pixels on the players screen? maybe using a resourcepack?
Maps are great and all, but very limited in color, 128x128 isnt much either, and they arent fullscreen. any idea for a better alternative?

#

the thing with resourcepacks is, you cant change its textures without reloading it. so i am wondering if theres a way around that. to draw individual pixels

quaint mantle
#

Since minecraft supports rgb text

ember estuary
#

that sounds good

#

but cant symbols only be used in chat?

buoyant viper
#

anywhere u can put text

quaint mantle
#

action bar ๐Ÿ˜„

ember estuary
#

true xD

#

can that have multiple lines

#

then it would be an idea

quaint mantle
chrome beacon
#

Yeah you can use this to make custom overlays

#

It's quite cool

ember estuary
#

thats nice, didnt know that :D

onyx shale
#

is there a specific event for placing head on a wall?

#

blockplace doesnt seem to trigger it i think

shadow owl
#

Is there a way to change an item's mining level?

#

ex: make a wooden pick break diamond ore effectively?

#

I know I can do it by listening to events, but I think this would be cleaner

spiral light
#

probably in nms

#

but its not cleaner O.o

#

you can check the Tags and compare it with your handmaterial ... but also not easier

shadow owl
#

Okay, thanks

quaint mantle
#

player head is a block

toxic mesa
#

anyone have experience with proguard?
Gives an error without the error

quaint mantle
#

whats that

brave sparrow
#

What are the above warnings

#

@toxic mesa

brave sparrow
toxic mesa
#

I can't find any errors

brave sparrow
#

Maybe in information?

toxic mesa
#

Nothing

brave sparrow
#

Interesting

toxic mesa
#

Should I? xD

brave sparrow
#

May as well lol

terse ice
toxic mesa
#

ur joking right

fervent gate
#

https://prnt.sc/25b8kpu This is an error: Non-static method getPlugin() cannot be referenced from a static context. How is this a static context?

vocal cloud
#

Main. Is static

visual tide
#

anything that is not in a non-static method is a static context

quaint mantle
toxic mesa
fervent gate
quaint mantle
#

then when you create DeathListener

new DeathListener(this)
fervent gate
#

this is the main class

quaint mantle
fervent gate
#

Ok

quaint mantle
#

also dont name it main, name it the plugin name

visual tide
#

^

fervent gate
#

Ok

quaint mantle
#

like SuperPermissions for example

visual tide
#

random.nextDouble() < 0.25 would be true 25% of time time right

brave sparrow
#

Just about, yeah

#

Itโ€™s not guaranteed to be exactly 25% of the time but with a large enough sample size thatโ€™s what youโ€™d expect to see

visual tide
#

oke ty

polar pagoda
#

Is there a way to load/ unload a world thats not in the main server folder? Like for a skyblock plugin, everyone has their world but its located in a different directory. I can only get it to work with worlds located in the main directory

brave sparrow
#

Copy the file and load it

polar pagoda
#

alright

left swift
#

how can i check if entity is moving?

brave sparrow
#

Wdym

left swift
#

Whether the entity is in motion or standing still does not change its position

brave sparrow
#

Right

#

Why do you want to know if theyโ€™re in motion

left swift
#

it's kind of an armorstand, and i'd love to move it when it moves,

#

entitycreature that has an armorstand model

brave sparrow
#

Youโ€™d probably have to make a custom NMS class that overrides the movement behavior for whatever entity it is

#

Thereโ€™s no event called when an entity moves because it would get fired all the time

true perch
#

How can I store the instance of a ResultSet iteration into a HashMap?
I noticed there's a resultSet.getStatement() method. I assumed that would store the instance of the iteration, doesn't seem to work.

ResultSet stats = SQL.getConnection().prepareStatement("select * from player_data").executeQuery();

HashMap<String, Statement> playerDataResults = new HashMap<>();

while (stats.next()) {
    playerDataResults.put(stats.getString("uuid"), stats.getStatement());
}```
young knoll
#

Why do you need to store the result set

acoustic pendant
young knoll
#

Caused by: java.lang.IllegalArgumentException: Can't find attribute minecraft:generic.follow_range

#

It canโ€™t find that attribute

acoustic pendant
#

hmm

#

i don't know what's wrong here

#

i mean, the follow_range i guess is the third parameter of PathfinderGoalLookAtPlayer

#

but what's wrong there=

ivory sleet
#

You must register the attribute to your entity I believe

acoustic pendant
#

it's registered

ivory sleet
#

Attribute, not goal

left swift
#

How can i set armorstand/entity to certain direction (the same like player)?

acoustic pendant
west pecan
#

I am trying to write an addon to a plugin that needs to track when something first occurred in order to trigger a threshold if it occurs x times within x time. How would I go about storing the initial time value? I was hoping I could store the server tick time, would I instead just store system time as miliseconds and use that instead? Really just not sure what methods are available/best practice for this.

I do not want to create a task for each event to increase a counter as that could get out of hand quickly

young knoll
#

Use the system time

west pecan
#

Ok, was a little hesitant as that isn't resistant to slower tick speeds but it shouldn't matter in the end

woeful crescent
#

why does intellij hate maven

#

error: no files downloaded from ...

quaint mantle
woeful crescent
#

i added it as a remote repo too

terse ore
#

Hey

#
    @EventHandler
    public void onXPBottleBreak(ExpBottleEvent event) {
        Block block = event.getHitBlock();
        System.out.println(block.getLocation());
    }```
#

I get null from the hit block

#

does someone know what's wrong?

young knoll
#

Did you hit an entity

woeful crescent
terse ore
woeful crescent
acoustic pendant
young knoll
#

Why would the players type be a pig

terse ore
woeful crescent
#

i made a thread

acoustic pendant
woeful crescent
#

but... it says player?

#

why?

acoustic pendant
#

to get the players location

young knoll
#

Why is your entity named player

#

If itโ€™s a pig

woeful crescent
#

Player player = (Player) sender;

young knoll
#

So itโ€™s not a pig

#

You are just blindly casting it to one

woeful crescent
#

You then cast player to CraftEntity, get its handle, get the type, and cast that type to pig

#

im confused

woeful crescent
acoustic pendant
#

and i'm getting his location

#

to spawn him there

woeful crescent
#

no, you're getting the handle

#

look

acoustic pendant
#

but i'm just getting the person who sent the command

#

i don't get what's wrong there

woeful crescent
acoustic pendant
#

what

#

oh

acoustic pendant
woeful crescent
#

oh

#

For future reference, casting an object in java means you are SAYING that that object is that type. Player is not of type pig, so you can't just say that player is pig and call it a day.

#

Are you talking about making a player riding a pig?

acoustic pendant
#

i mean

woeful crescent
#

Or maybe teleporting a pig to a player and constantly making it invisible

acoustic pendant
#

no

#

that code is suposed to spawn

woeful crescent
#

spawn a pig?

acoustic pendant
#

this

#

and that pig follows who sent the command

woeful crescent
#

Also use bukkit stuff, not NMS stuff

#

World#spawnEntity(Pig.class, Location)

#

Not completely sure tho

acoustic pendant
#

I mean

woeful crescent
#

Nvm it's World#spawnEntity(Location, Pig.class)

acoustic pendant
#

Hmm

foggy estuary
#

can you make ender dragon death explosion spigot

acoustic pendant
woeful crescent
#

?

#

You need a world

#

so from a location, use getWorld()

#

wdym doesn't work

acoustic pendant
#

i mean

#

it requires a entitytype

#

i'm providing a class

acoustic pendant
woeful crescent
#

nms?

#

why u using nms

#

u wanna spawn a pig, right?

acoustic pendant
#

that follows a player

#

so i defined this

stone light
#

updating an old project and I get
The method setData(byte) is undefined for the type Block
I assume setData has been deprecated but I don't know what to change it to

#

I also have
The method cancelAllTasks() is undefined for the type BukkitScheduler
and
The method setTypeId(int) is undefined for the type Block
in the same area that are confusing me

young knoll
little trail
#

Probably a stupid question but is it at all possible for my code using Maven and java.net.http.WebSocket (java 11 iirc) to work with java 8

stone light
left swift
#

is it possible to lower some entity on the y axis? I mean actually lower it, but that it behaves as if it was not lowered. For example a pig that walks normally on the ground / blocks, but its texture and hitbox is slightly underground. I don't want to use packet teleporting here as the server still thinks entity is above and it doesn't allow me to build there.

topaz cape
#

is it possible to sort a treemap of a String Boolean by the first Strings are the ones with true and then with false (in alphabetical order too)

quaint mantle
#

gradle hard!

dusk flicker
#

im forced into learning gradle lol

topaz cape
ivory sleet
#

๐Ÿ˜Œ

dusk flicker
#

damn

#

shouldent have said anything

#

gradle isnt the hard part tho lol, wish it was... Have to deal with making insanely precise turns using a gyroscope with no way to test it lol

brave sparrow
dusk flicker
#

not natively

#
    public static <K, V extends Comparable<? super V>> Map<K, V> sortByValue(Map<K, V> map) {
        List<Map.Entry<K, V>> list = new ArrayList<>(map.entrySet());
        list.sort(Map.Entry.comparingByValue());

        Map<K, V> result = new LinkedHashMap<>();
        for (Map.Entry<K, V> entry : list) {
            result.put(entry.getKey(), entry.getValue());
        }

        return result;
    }

one of my utils I have, might be stolen from stackoverflow, cant remember

quaint mantle
#

that

#

is,

#

quite a generic method

dusk flicker
#

after a quick google def stole from stackoverflow

rough basin
#

?paste

undone axleBOT
dusk flicker
#

but yeah very generic

quaint mantle
#

what does sortbyvalue do

dusk flicker
#

well it takes a map, and outputs a map

#

so, sorts said map, by its value, as long as the value extends a Comparable

rough basin
#

https://paste.md-5.net/nomupahani.cs
Whenever I run the Task, I get a NullPointerException at line 68.
But config.yml is not Null and the name of the snowman were loaded in the same way before the code change nah

#

What did i wrong?

torn badge
#

What exactly is line 68? @rough basin

rough basin
#

List<String> data = config.getStringList(sentry.getCustomName());

torn badge
#

Try debugging and print out config and sentry before this line to check which one is null

rough basin
#

wait a sec

crimson verge
#

does anyone know why I may be getting this error? I am trying to add protocollib to my pom but only the repository link works, not the dependency

torn badge
#

Did you reload Maven?

#

Top right should be a button

crimson verge
#

ye

#

it just cant find it for some odd reason

torn badge
#

Show your whole pom

rough basin
#

Sorry for silly question

foggy estuary
#

Does anyone know how to add players onto a current scoreboard?

#

and display their name in scoreboard

golden turret
#

how could i make a jar that patches itself?

#

like, i create a plugin and it detects a new version available

#

then it will replace its own contents to make the installed version updated to the latest

young knoll
#

Oh no

#

Please no auto updates

paper viper
#

please dont

#

just add a warning message when they need to update

#

dont do autopatching, thats a fuckmess when your own plugin is loaded

golden turret
#

forgot to mention

#

that

#

i dont care

#

and not spigot related basically

paper viper
#

if autopatching was possible, then spigot/paper could just auto patch their own server jars for a new version

#

but they dont do it

golden turret
#

just used a plugin as an example

#

actually it is, just stop the current jvm and start a new ๐Ÿคก

#

ok so lets move to what i really want

#

what about my java program patch another jar

#

like, spigot patching a plugin that have something

patent horizon
#

how would i get the name of an item without the color codes?

young knoll
#

Strip the color codes

quaint mantle
#

ChatColor.stripColor(str)

golden turret
#

bruh

young knoll
#

Yes that

quaint mantle
golden turret
#

i would say to do it with replaceAll

quaint mantle
dusk flicker
#

that has to be the stupidest way

paper viper
dusk flicker
#

to strip color codes

paper viper
#
  1. provided method exists
  2. who the hell wants to chain like 11 replaceAll calls
  3. even a proper regex can do better
#
  1. slow
dusk flicker
#
  1. stupid
golden turret
#

string.replaceAll("ยง[a-fk-o0-9]", "")

dusk flicker
#

what happends when you use a different char