#help-archived

1 messages ยท Page 207 of 1

frigid ember
#

I would move a falling block to the air in random direction

#

7smile7, I would need to specify which dependency I want to shade, no?

grim halo
#

<scope>shade</scope>
But you can just remove the scope as shade is the default one

frigid ember
#

gotchya

#

Where in the POM does this go?

grim halo
#

In your pom <build><plugins> then add the plugin </plugins></build>

frigid ember
#

.

#

ItemStack playerhead = new ItemStack(Material.LEGACY_SKULL, 1, (byte) 3);

#

LEGACY_SKULL/LEGACY_SKULL_ITEM is deprecated

#

what should skull be

#

in 1.16

#

SKULL_ITEM dusnt exist

wheat mirage
#

Having awful issues with end portal on current spigot

#

Is this is a known issue or a plugin conflict?

#

@frigid ember PLAYER_HEAD

frigid ember
#

oof

#

ok ty

#

How make a falling block, and push that in the air (in a random direction) ?

#

@grim halo now I'm getting this problem: The type javax.persistence.EntityTransaction cannot be resolved. It is indirectly referenced from required .class files

#

if you explain better @frigid ember ??

#

...

#

...

#

Falling block ... booom boom in air

#

explode?

#

yeah and move in a random direction

#

a fountain of falling block

grim halo
#

@frigid ember Are you using Eclipse?

frigid ember
#

just add an effect

#

yes I am using eclipse

#

and move it in a random direction?

#

You would have to use a runnable for that

grim halo
#

No idea then. This is an error from your IDE

frigid ember
#

It is

#

move it to a location every x ticks

grim halo
#

I dont use eclipse anymore

frigid ember
#

Its because the required jar files are now no longer on the class path

#

Trust me the problem is not because of eclipse

#

This is a compile time issue where something is missing

#

But, I would falling block can move

grim halo
#

This is not a java error. It stems from eclipse.

#

Make sure you dont use plain jar files in your maven project

grim halo
#

If you need a dependency then it must come from maven

frigid ember
#

Yep thats all covered already. I think there are other dependencies that Hibernate is not able to retrieve from just the hibernate core

grim halo
#

Maven should manage all sub dependencies. Never had this problem in intellij only in eclipse.

frigid ember
#

I suppose it could be because of Eclipse, but I find that very, very unlikely

spare frost
#

do items with seperate NBT tags but with the same Material, stack in game?

grim halo
#

@spare frost no

spare frost
#

Awesome

grim halo
#

This would mean that one of them had to erased

spare frost
#

So if i wanna make the max stack size of some item to 1 i just add a randomly generated nbt tag

grim halo
#

Yes

meager vale
#

Someone know how to send a same inventory GUI and change a slot for client-side ??
I want to make a confirmation GUI for the context :)

grim halo
#

A GUI is just a simple Inventory. if you change the content then the player will see the updated content.

subtle blade
#

javax.persistence.EntityTransaction
What the hell are you trying to import?

#

What reason do you have to import from javax?

half badge
#

He's using Hibernate I believe

subtle blade
#

If everything is shaded appropriately, also ensure it's been relocated

#

No reason to be shading anything without relocating it

meager vale
#

@grim halo I know but that do not help me.

grim halo
#

Then you need to specify your question because i have no idea what you are trying to do ^^

#

You want one gui to open another confirmation gui that leads back to the main gui?

meager vale
#

Change a spefic slot into this inventory for client-side only

grim halo
#

Send him a packet iguess...

meager vale
#

Yes with ProtocolLib or directly with Minecraft .

grim halo
#

probably this one

past basalt
#

" skywars-lobby:
motd: '&1Just another BungeeCord - Forced Host'
address: localhost:25572
restricted: false
skywars-siege:
motd: '&1Just another BungeeCord - Forced Host'
address: localhost:25573
restricted: false" when i write - in the bungeecord it doesn't start up, why?

meager vale
#

Oh, thx for the link ^^
It's exactly what I expected @grim halo

#

You want one gui to open another confirmation gui that leads back to the main gui?
The main gui will open the confirmation gui, it's commun inventory object for all confirmation gui

Sorry I'm little bit slow to translate my sentence ^^'

frigid ember
#

@subtle blade yes, I am trying to use Hibernate for database interactions

#

however, the class is not being found when I am simply using Maven. When you say "relocate", what do you mean exactly?

#

I need some help on this bit

half badge
#

When you shade it in you can relocate/move it to a different package

#

Although, I never do that, maybe I should

subtle blade
#

Right. You want to nest this under one of your own packages

#

because if another plugin is shading the same classes, the classloader is going to give you a hard time

frigid ember
#

Does it matter what package I relocate it to?

subtle blade
#

Can be whatever you want. CraftBukkit relocates dependencies to org.bukkit.craftbukkit.internal.libs or something. You can do something similar with your.plugin.package.libs

#

Just make it a subpackage of your main package

frigid ember
#

Would this just be an empty package then?

#

I don't understand why I need to do this to begin with. All my other dependencies work fine without this

#

Also, what goes in <shadedpattern>?

wraith thicket
#

Your main dependency is the bukkit API. That is provided by the server. It is there for you to use.
If you use an external library, this will not be provided by the server. Thus, you'll need to shade it into your jar.

past basalt
#

someone help pls

frigid ember
#

@wraith thicket gotchya

#

Does this look correct then?

#
    <build>
        <plugins>
            <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>
                        <configuration>
                            <relocations>
                                <relocation>
                                    <pattern>hibernate-core</pattern>
                                    <shadedPattern>net.mcnations.nationsatwar.shaded</shadedPattern>
                                </relocation>
                            </relocations>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
#

where <pattern>hibernate-core</pattern> is what I want written out to the shadedpattern location?

subtle blade
#

The pattern should be the original package

frigid ember
#

yes thats what I did

#

I took that name from the maven dependency I already have defined in my POM

half badge
#

org.hibernate

frigid ember
#

thats the group

#

I took the artifact

#

Should it be the the group?

wraith thicket
#

The pattern should be the original package

frigid ember
#
        <!-- https://mvnrepository.com/artifact/org.hibernate/hibernate-core -->
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
            <version>5.4.18.Final</version>
            <scope>shaded</scope>
        </dependency>
#

gotchya, the group is the package

wraith thicket
#

Generally, it should be. Although there's nothing stopping it from differing from the package

frigid ember
#

Sorry for the spam guys. After I shaded the jar, I'm back to getting this error:

#

The type javax.persistence.EntityTransaction cannot be resolved. It is indirectly referenced from required .class files

stoic shell
#

So... I left chunky generating all night, and was only at 14% when I got up.

frigid ember
#

I did the relocation we talked about as well

half badge
#

Might have to also relocate javax.persistance as well

stoic shell
#
[09:33:22 INFO]: [Chunky] Task running for world. Processed: 907540 chunks (14.52%), ETA: 65:54:36, Rate: 22.5 cps, Current: -887, -1210```
#

Is there any way to speed this up?

past basalt
#

bungeecord doesn't want to start up for me

frigid ember
#

@half badge Thats the thing, Hibernate only has one dependency in its maven repository

half badge
#

You should be able to relocate javax.persistance anyway

#

It's a dependency of Hibernate it self

#

Infact hibernate has quite a few dpendencies...

frigid ember
#

@half badge Thats what I'm saying. It doesn't seem reasonable to relocate all of those

#

Is there no other way?

half badge
#

Someone here probably has a better idea than I do

#

I mean.. is it a public plugin? If it's for your own use it's probably not too important to relocate it

frigid ember
#

Its part of the maven central repository if thats what you mean

#

oh

#

my plugin

half badge
#

Yeah

frigid ember
#

no, its not public*

half badge
#

What is it?

frigid ember
#

its not public*

half badge
#

Oh okay

#

If it's only you using it then you probably wont have to care about relocating

frigid ember
#

?

half badge
#

As long as nothing else attempts to shade Hibernate

frigid ember
#

oh, I see what you're saying

#

Ok, then relocation doesn't matter. The problem though still exists with the fact that I am getting that error

#

lol i always do shadeing

#

and relocatig

half badge
#
<plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.2.1</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
<shadedArtifactAttached>true</shadedArtifactAttached>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
#

Then I'd just keep this

frigid ember
#

ah

#

if i am useing JDA

#

i will relocate the classes

half badge
#

Yeah

#

Might be an option to relocate dependencies of dependencies

frigid ember
#

yes

#

and loggermessages

#

if you wanna format them

stoic shell
#

[09:33:22 INFO]: [Chunky] Task running for world. Processed: 907540 chunks (14.52%), ETA: 65:54:36, Rate: 22.5 cps, Current: -887, -1210
Is there any way to speed this up?
(it's been running all night and half of yesterday)

frigid ember
#

I guess I'm just going to get the jars & add them directly to my build path

#

Honestly just seems easier

half badge
#

Did you try the Pom snippet I sent you?

frigid ember
#

add that snippet to

#

<build>

karmic sable
#

Why is it that when a player has perm: "aaaa.bbbb.1" cant do the command, unless they also have perm "aaaa.bbbb"
YET when player has both perms, they can also do "aaaa.bbbb.3" and 4 and 5 and ..

frigid ember
#

@half badge yes, the issue is then other dependencies are missing

#

The shade does not shade all of Hiberenate's dependencies in as well

#

rendering Hibernate useless

stoic shell
#

wow

#

tried another chunk generation plugin, and it made Chunky look like it's the slowest on the market

frigid ember
#

Who makes plugins? Dm me

#

No

#

@subtle blade Sorry for the spam, but I need some hand-holding for getting this Hibernate to work. Theres literally nothing online for it, and the "shade" method does not work

#

@hoary parcel I saw you had posted on some threads regarding Hibernate/ ORM setup

#

I keep getting an error saying the class cannot be found. I read that I needed to shade the jar

#

I did that, but then I get an error in my java code saying the class is missing

unkempt ridge
#

I'm having a little trouble with creating a new PotionEffect. I was wondering how do I make the effect last permanently, and what is ambient? I've tried reading the docs, but I'm still confused

wraith thicket
#

?services

worldly heathBOT
wraith thicket
#

@frigid ember

frigid ember
#

?

hoary parcel
#

@frigid ember what mc version?

frigid ember
#

latest

#

1.16.1

hoary parcel
#

Then it should just work with shading

wraith thicket
#

@frigid ember This is not the place to hire devleopers - go the the services and reqruitment section on the forums for that

frigid ember
#

No mini, I know it should

#

but it doesnt

hoary parcel
#

I use it without any issues

frigid ember
#

Let me give you the error

hoary parcel
#

Before it was a pain since spigot decided to include an ancient jpa version without updating it

frigid ember
#

The type javax.persistence.PersistenceException cannot be resolved. It is indirectly referenced from required .class files

#

I get this after performing the shade

hoary parcel
#

That seems like you are missing some transitive dep

frigid ember
#

When its just in my maven dependencies I don't get anything

hoary parcel
#

Like jpa

frigid ember
#

Well I just use Hibernate in my dependencies

#

Hibernate core

hoary parcel
#

Try adding jpa then and shading that explicitly or smth

#

Idk

frigid ember
#
[10:19:45] [Server thread/ERROR]: Error occurred while enabling nationsatwar v1.1 (Is it up to date?)
java.lang.NoClassDefFoundError: org/hibernate/cfg/Configuration
        at net.mcnations.nationsatwar.PluginMain_Load.onEnable(PluginMain_Load.java:31) ~[?:?]
half badge
#

Wouldn't the core import the required persistance depedencies?

hoary parcel
#

I use hibernate as part of spring nowadays

frigid ember
#

Thats what I get when I run the server

#

Yeah I use hibernate with spring as well

hoary parcel
#

Well, it's also not finding hibernate

frigid ember
#

Wouldn't the core import the required persistance depedencies?
@half badge thats what I mean

hoary parcel
#

Is it in your jar?

half badge
#

Did you change the <scope> for it?

frigid ember
#
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.2.1</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <shadedArtifactAttached>true</shadedArtifactAttached>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
            <version>5.4.18.Final</version>
            <scope>shaded</scope>
        </dependency>
#

Its imported in my classes, its added to my POM, I'm not sure what else I need to do

#

I checked the exports. the Hibernate cfg file is not in there at all

hoary parcel
#

What's scope shaded?

#

Set it to compile

frigid ember
#

ok

#

I set it to compile, still getting

[10:27:52] [Server thread/ERROR]: Error occurred while enabling nationsatwar v1.1 (Is it up to date?)
java.lang.NoClassDefFoundError: org/hibernate/cfg/Configuration
half badge
#

Just checking, you are using the jar with -shaded on the end as well?

frigid ember
#

not sure what you mean

half badge
#

When you package your jar, it will create two files

#

project-name-version.jar and project-name-version-shaded.jar in the target folder

#

So when you copy over that to your plugins folder, or however your loading it into the server, make sure you use the shaded version

frigid ember
#

i don't see any shaded jars

#

in the directory

unkempt ridge
#

#help-archived message this is what I got right now will this work? player.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, Integer.MAX_VALUE, 2, false, false, false));

frigid ember
#

@hoary parcel @half badge should I drag the dependent jars into the directory that I export my plugin jar to?

hoary parcel
#

export

#

Pls don't tell me you use eclipse

#

And not actually use maven to build

half badge
#

Oh...

#

That would be the issue.

grim halo
#

@frigid ember As i told you before.
If you use a dependency manager you can not just add jars to your build path.

#

You need to add them in your pom

frigid ember
#

They are in my pom....

half badge
#

But you need to build using Maven

frigid ember
#

Maybe I'm not understanding

grim halo
#

Also remove everything from your build path or how ever its called in eclipse

hoary parcel
#

You need to stop using eclipse tbf

frigid ember
#

Ok so

#

How do I "build using maven"

#

I think this is where the misunderstanding is

#

I usually use the export feature

#

and by usually, I mean the only way I create jars (via the export feature)

hoary parcel
#

That's wrong

#

Stop touching that

frigid ember
#

ok

#

Should I be doing a maven build then?

grim halo
#

Intellij has some nice beginner friendly buttons you can just click.
You need to specify your maven goals. A standard one would be
mvn clean install

#

right click pom -> Run As -> Maven build...

subtle blade
#

Stop trying to switch someone's IDE preferences. jfc

#

Answer the fucking question

frigid ember
#

mvn jar:jar for the goal?

subtle blade
#

clean package should suffice for the goals, then run

frigid ember
#

yep I'm in that screen which is good

#

ok

#

thank you ๐Ÿ™‚

grim halo
subtle blade
#

You'll find compiled binaries in the target directory

grim halo
#

Btw what does "jfc" stand for? Never seen that.

frigid ember
#

where do you specify in this screen where you want the jar to be sent?

#

Also,

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  2.905 s
[INFO] Finished at: 2020-07-29T10:48:10-05:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project nationsatwar: Compilation failure: Compilation failure: 
[ERROR] Source option 5 is no longer supported. Use 7 or later.
grim halo
#

It is normally just built in your target folder.
If you want to specify the output directory you would need the maven jar plugin for example.

#

Ah ok this error, Wait a min

frigid ember
#

if its sent to the target folder thats fine

#

I can just retrieve it from there, correct?

grim halo
#
 <properties>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
  </properties>

This in your pom. Changes the java version of your project

#

Yes you can just copy or cut it from your target dir

frigid ember
#

Awesome

#

Thanks 7smile

#

one more error

#
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] /C:/Users/mtthw/eclipse-workspace/NationsAtWar/src/main/java/net/mcnations/nationsatwar/player/NationPlayer.java:[49,46] cannot find symbol
  symbol:   class DatabaseOps
#

the class DatabaseOps was a class I deleted a while ago

#

Why is it showing up here?

past basalt
#

guys guys, how to make a server 1.8-1.16? like hypixel, mineplex, etc..

grim halo
#

Maybe you have some import or reference to the class left.

past basalt
#

someone answer me please

grim halo
#

@past basalt You need a plugin that changes the protocol based on the clients version.
ViaVersion does this for example.

frigid ember
#

@grim halo you are correct

past basalt
#

so if i installed viaversion on each spigot server, it will allow players to join with higher versions?

grim halo
#

Yes the lowest version is mutual

past basalt
#

it doesn't matter if plugins don't support 1.16?

frigid ember
#

Does the bungeecord configuration getkeys also return substrings?

past basalt
#

also i need to install it in bungeecord or spigot servers?

prime spire
#

Idk what to do after I clicked the download now button and I pressed keep and everything someone help

#

Please

frigid ember
#

is this your first message? i didnt see all messages here

prime spire
#

Yes

grim halo
#

@past basalt Go on their spigot site and read how to set it up. They have all infos there i think.

prime spire
#

I joined this server yesterday

frigid ember
#

ah

#

ok

#

what plugin?

prime spire
#

Invsee

frigid ember
#

ok

#

then drop it into the plugins folder of your server

#

and reload/start it

prime spire
#

Ok

past basalt
#

okay, ty

frigid ember
#

Does the bungeecord configuration getkeys also return substrings?

#
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  7.801 s
[INFO] Finished at: 2020-07-29T11:02:44-05:00
[INFO] ------------------------------------------------------------------------

ayeeeeee

#
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ nationsatwar ---
[INFO] Deleting C:\Users\mtthw\eclipse-workspace\NationsAtWar\target
``` Theres no target folder though?
#

I go there and maven deleted it...?

#

whats your pom.xml?

#

What do you mean whats my pom.xml

#

your maven file

#

it should be called pom.xml

#

its called pom.xml yes

#

send here please the content

#

ran it again with just package as the goal & it worked

#

yeah

#

I just checked and I have the shaded content now

#

So now, how do I get the contents of these run into my spigot server?

#

Do I just drag both jars into the directory?

#

yes

#

@frigid ember Well when I drag it into the plugins directory and boot up the server, I get an error saying the shaded jar does not have a valid plugin.yml

#

use the file without the -shaded tag

#

and not the -original

#

what

#

I have two jar files. One with no extension, and one with the -shaded

#

Do I drag both into the directory? Or, only the original?

#

What is the point of the -shaded jar if we do not use it? Won't we just run into the problem from before if those classes can't be accessed?

timber prairie
#

So I'm creating a premade, with some scripts, using Skirpt, but if I want to damage a player, it doesn't works, while pvp is enabled,

#

For short example: I can damage animals, and I can't damage players.

#

So no one is helping. Thanks for the nothing.

#

(see times when I wrote it)

wheat mirage
#

How to disable the end credits?

grim halo
#

@frigid ember Just go with the bigger jar ^^ the dependencies should be in there.

frigid ember
#

I did that, but then it said it was missing an appropriate plugin.yml file

#

Even though the plugin.yml is most certainly there

#
[11:17:09] [Server thread/ERROR]: Could not load 'plugins\nationsatwar.jar' in folder 'plugins'
org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml
        at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:160) ~[spigot-1.16.1.jar:git-Spigot-0509002-6b95d59]
        at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:144) ~[spigot-1.16.1.jar:git-Spigot-0509002-6b95d59]
        at org.bukkit.craftbukkit.v1_16_R1.CraftServer.loadPlugins(CraftServer.java:382) ~[spigot-1.16.1.jar:git-Spigot-0509002-6b95d59]
        at net.minecraft.server.v1_16_R1.DedicatedServer.init(DedicatedServer.java:186) ~[spigot-1.16.1.jar:git-Spigot-0509002-6b95d59]
        at net.minecraft.server.v1_16_R1.MinecraftServer.v(MinecraftServer.java:810) ~[spigot-1.16.1.jar:git-Spigot-0509002-6b95d59]
        at net.minecraft.server.v1_16_R1.MinecraftServer.lambda$0(MinecraftServer.java:164) ~[spigot-1.16.1.jar:git-Spigot-0509002-6b95d59]
        at java.lang.Thread.run(Thread.java:830) [?:?]
Caused by: java.io.FileNotFoundException: Jar does not contain plugin.yml
        ... 7 more```
#

hey how can i load a external jar

#

like spigot loads plugin

open ibex
#

I don't think you load the jar, you just make an instance of the main class in the jar. How to find the main class idk

#

Maybe reflection? Not sure

#

Wait I'm dumb, the main class is specified in plugin.yml

sturdy oar
#

wut

#

yes

grim halo
#

Overload the command and list them yourself or fetch the command and change the output.

open ibex
#

Use \n

#

If you want your plugin to change it then you will have to use a tabexecutor instead of a bukkitcommand

grim halo
#

As Pepper wrote you can just add a escaped new line "\n"
If this doesnt work then you create a List<String> and send them one by one

frigid ember
#

Guys, I don't understand. I got the shaded jar to compile and everything.

#

However, when I add the shaded jar to the plugins directory, I get an error saying the jar does not contain a plugin.yml

grim halo
#

Did you open the jar and see if the yml is there?

frigid ember
#
org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml
        at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:160) ~[spigot-1.16.1.jar:git-Spigot-0509002-6b95d59]
        at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:144) ~[spigot-1.16.1.jar:git-Spigot-0509002-6b95d59]
        at org.bukkit.craftbukkit.v1_16_R1.CraftServer.loadPlugins(CraftServer.java:382) ~[spigot-1.16.1.jar:git-Spigot-0509002-6b95d59]
        at net.minecraft.server.v1_16_R1.DedicatedServer.init(DedicatedServer.java:186) ~[spigot-1.16.1.jar:git-Spigot-0509002-6b95d59]
        at net.minecraft.server.v1_16_R1.MinecraftServer.v(MinecraftServer.java:810) ~[spigot-1.16.1.jar:git-Spigot-0509002-6b95d59]
        at net.minecraft.server.v1_16_R1.MinecraftServer.lambda$0(MinecraftServer.java:164) ~[spigot-1.16.1.jar:git-Spigot-0509002-6b95d59]
        at java.lang.Thread.run(Thread.java:830) [?:?]
Caused by: java.io.FileNotFoundException: Jar does not contain plugin.yml
        ... 7 more```
grim halo
#

Did you open the jar and see if the yml is there?

frigid ember
#

I didn't have this issue when I exported the jar normally

#

Im gonna guess its not there

grim halo
#

Do you have a "resources" directory in your project?

frigid ember
#

does

#

any

#

one know

#

Yes @grim halo I have a resources directory

grim halo
#

@frigid ember And does it contain your plugin.yml

frigid ember
#

No, I have them at the root

grim halo
#

the src root should only contain class files. If you have resources (like the plugin.yml) it should be in your resources path

frigid ember
#

I guess thats my problem

#

Gotchya

#

but the error is i can use classes of main project

grim halo
#

no idea what that means. Sry :/

frigid ember
#

throws

grim halo
#

Try using your plugins own class loader

frigid ember
#

that import is from main project

#

HELL YA BOI

#

SHIT WORKS

#

ah please explain me

#

@grim halo

grim halo
#

Nice. Maven is hard at the beginning but you will learn to love it later.

spare frost
#

Should I compare player objects with == or .equals()?

wheat mirage
#

There's no portal event when a player leaves the end?

#

Wtf?

grim halo
#

@spare frost Should not matter as every player has exactly one instance but .equals() is prefered as some new dev could hold a reference to an old Player object

wheat mirage
#

There's no teleport even when they leave the end?

#

Either?

frigid ember
#

plugin.getClass().getClassLoader().loadClass(main.getName()); how i load classes from jar

grim halo
#

I cant help you with this atm. I would have to think about that and im currently writing my own stuff.

#

Ping MiniDigger. He loves to help.

frigid ember
#

@hoary parcel

hoary parcel
#

wtf are you trying to do?

frigid ember
#

i am trying to load plugin for a plugin

hoary parcel
#

why?

frigid ember
#

basically loading an jar

hoary parcel
#

why cant you let bukkit load plugins?

frigid ember
#

Plugins means,a module only for my plugin

hoary parcel
#

dont manually add classes to random classloaders

#

implement your own urlclassloader

grim halo
hoary parcel
#

old code of mine

frigid ember
#

I havebeed able to load the classes

timber prairie
#

So no one helped me. Really. Thanks for giving me a f***ing nothing.

frigid ember
#

but i can use methods and classes from main project.

balmy sentinel
#

@timber prairie I feel as tho most of us use Java compared to Script (correct me if I'm wrong). You'll have to wait until someone who knows scripting comes on to help you.

quick arch
#

uh... ask in the Skript discord

vital copper
#

^

timber prairie
#

The problem is not in the Skript.

For short example: I can damage animals, and I can't damage players.

#

Pvp is enabled in server.properties, and no one script disables pvp

sturdy oar
#

Server version?

timber prairie
#

1.8.8-R0.1-SNAPSHOT

vital copper
#

are you using other plugins besides skript?

timber prairie
#

Umbaska

vital copper
#

Since 1.8.8 is very outdated, you won't find much support for it.

timber prairie
#

-,-

#

I said there are no problems with Skript..

#

Are you blind?

quick arch
#

But there are problems with 1.8.8 ๐Ÿ˜

vital copper
#

All I can say it try debugging it smartly. Does PVP work when you remove Skript/Umbaska from the plugins folder? Find out for sure what is preventing PVP.

sturdy oar
#

1.8.8 is unsupported here tbh

timber prairie
#

1.8.8 is unsupported here tbh
@sturdy oar you are the unsipported.

sturdy oar
#

what lol

vital copper
subtle blade
#

So no one helped me. Really. Thanks for giving me a f***ing nothing.
(1) You are not entitled to support
(2) You are on a 5 year old version of the game which has not been supported by Spigot for a little over 4 years now
(3) You're using Skript, a topic with which many here are not familiar

#

If you want to get bratty, you're more than welcome to leave and find support elsewhere or I'll assist you in doing so

timber prairie
#

DEMONIC TRIGGERED

subtle blade
#

Assisting it is

grim halo
#

@timber prairie You are asking for support with Skript on a >5y old version of spigot.
Not many ppl tinker with ancient stuff so you have to be prepared to be on your own if you encounter problems.

subtle blade
#

o/ Won't be missed

sturdy oar
#

I use 1.8.8 myself, but I've never come here once asking desperately for someone else to fix my server

vital copper
#

I had my daily dose of cringe from that last message

quick arch
#

oh boy, he'll be trashed on in the Skript Discord with that attitude ๐Ÿ˜

balmy sentinel
outer locust
#

is he being serious i genuinely cant tell

subtle blade
#

I'm just starting to be more aggressive with my kicks. Don't really have the patience lately

quick arch
#

Choco that's good >:)

#

Now kick Ivan ๐Ÿ‘

sturdy oar
#

๐Ÿ˜ 

subtle blade
#

S/O is the most toxic place, I swear to God

#

Posted one question there, never went back

sturdy oar
#

I got banned

subtle blade
#

To posting, anyways. I still refer to it lol

sturdy oar
#

yeah Im banned from StackOverflow... for asking questions .-.

subtle blade
#
        for (Plugin plugin : plugins) {
                pluginList.append(ChatColor.WHITE);
                pluginList.append("\n");
            }

            pluginList.append(plugin.isEnabled() ? ChatColor.GREEN : ChatColor.RED);
            pluginList.append(plugin.getDescription().getName());
            pluginList.append(ChatColor.GRAY + " (" + ChatColor.GOLD + "v" + ChatColor.YELLOW + plugin.getDescription().getVersion() + ChatColor.GRAY + ")");
        }

        return "(" + plugins.length + "): " + pluginList.toString();
    }```
#

This bit here

#

Check your braces

#

Indentation gives a good hint too

opal adder
#

That's hot

subtle blade
#

Looks like you must have deleted an if statement at the top of that for loop

#

That'd do it

neat oxide
#

Good grief i just read up on the history that guy was a toxic 5 year old

vital copper
#

Let's forget him, giving people like that attention is what they want.

neat oxide
#

true

timber prairie
#

@subtle blade so you have kicked me for needing help ffor an "unsupported" version. This means a permanently block, you know? For why? Because of Skript is not the error why I can't damage a player. Actually you don't have to do something with me, without my permission, so the unblock cost is 10.000HUF.

subtle blade
#

Or you smarten the fuck up and use a modern version

#

You will not be supported here. That's final

quick arch
#

Ban Hammer when

subtle blade
#

You don't have to like me. Quite frankly I don't care whatsoever. Though if you're not going to respect the rules here, you have no reason to stay

timber prairie
#

So you say don't use 1.8, right? Sorry, but I have to say, this is false. For why? Because I'm making a premade, from 1.8, up to 1.16. Actually this premade is a pvp server, so I'm NOT placing an oldpvpmechanic plugin, for the nothing. Whatever, someone said, 1.8, for servers... And I just warn you, that this message is not an insult-message.

quick arch
#

No one cares about 1.8.8 in here

timber prairie
#

Really? I never use 1.16. ._.

rare prairie
#

do y know what is minecraft

quick arch
#

Doesn't sound like a problem to us

timber prairie
#

This had some translation error to me. I don't understand. Sry

rare prairie
#

grammar

timber prairie
#

Nem รฉrted.

#

Tudom ki vagy

rare prairie
#

dik

#

honnan

timber prairie
#

Hรกรกรกรกt... ๐Ÿ™‚

#

Tudnod kellene. ๐Ÿ˜„

#

Na de ร‰n รญgy nem fogok ezzel fososkodni. Megy neked is a letiltรกs egy rรฉgebbi sรฉrintรฉsรฉrt.

rare prairie
#

mibajod

#

รฉletembe nem lรกttalak

#

handicapped people

sinful spire
#

what

open ibex
#

There is a plugin for old combat in newer versions

rare prairie
#

what
I ask that too

open ibex
#

Nevermind they said they wouldn't use it

pliant anchor
#

hi, I need help with an idea I had for my server, is there a way to detect when a player walks in to a specific chunk, i was thinking about a custom event, but i need your help

quick arch
#

There's no event for it but you can detect it

pliant anchor
#

how can i detect it?

quick arch
#

with a Runnable or the movement event,
Player#getLocation()
Location#getChunk()

open ibex
#

Using the event might be laggy because it could run every tick

quick arch
#

^

open ibex
#

Same with the runnable if it's scheduled for every tick

quick arch
#

Can just be every second

open ibex
#

That's what I was thinking

#

It might not be as accurate but at least it won't be laggy

quick arch
#

yeah, being 100% accurate comes at the cost of performance

open ibex
#

Yep

pliant anchor
#

thanks, both of you gave me some good ideas where to start ;)

patent cape
#

i did port forward i did the rules for firewall i did the rules for my anti virus app but i tried to connect from another internet to my server (i have bungeecord server) someone can help me?
(pls do @ for me when u answer)

chrome edge
#

Are there anybody who has experience to use PacketPlayOutMap?

sturdy oar
#

Do the "low effort resources will be removed" also apply to free resources?

tiny dagger
#

no

sturdy oar
#

ok nice

#

i thought they were getting removed as well

tiny dagger
#

unless you wanna post a premium with 3 shitty ones

#

then no

#

๐Ÿ˜‚

sturdy oar
#

nono i just wanted to post a 30 lines free plugin

frigid ember
#

Hi! Sorry if this is a very popular request but i would like to know if it is possible to change the username of my Spigot account (because I bought resources, so changing my account would be futile).

Thanks to you!

sturdy oar
#

yes it is

#

but only for donors

#

you need to donate 10โ‚ฌ then you can change it from website

frigid ember
#

MDRRR

#

sorry LMAOOO incroyable ๐Ÿ˜‚

patent cape
#

i did port forward i did the rules for firewall i did the rules for my anti virus app but i tried to connect from another internet to my server (i have bungeecord server) someone can help me?
(pls do @ for me when u answer)

pastel nacelle
#

just use a shared host if you can't figure it out

limber forge
#

what does this mean

#

Save your backup codes (print them out)! We will not reset accounts who have lost their backup codes.

#

its needed for premium

grim halo
#

You can take that quite literally @limber forge

limber forge
#

where can i make a backup

grim halo
#

With pen and paper for example (i think this is one of the recommended ways)

sinful spire
#

just write down the level.dat file

limber forge
#

where is this file

grim halo
#

What? @sinful spire

sinful spire
#

backup of what

grim halo
#

I think he is trolling you

#

^^

sinful spire
#

like the world or

grim halo
#

We are speakin about the spigot account backup codes right?

sinful spire
#

wait those exist

quick arch
#

they exist for 2 step verification

limber forge
#

Please ensure that you have saved your Backup Codes away from your primary computer / authentication device (preferably written down). We may not accept requests to disable Two-Step Verification if you do not have these.

You may manage your verification options

#

i have written the codes down

grim halo
limber forge
#

i have written the codes down...

#

can i ignore this message now?

grim halo
#

Ok. Then you can dismiss the message

limber forge
#

so

#

how can i get premium now?

#

i have the requests

quick arch
#

uh... 3 resources, 60 messages, 20 reactions?

#

probably wait a few days after you get those

limber forge
#

Joined:Mar 28, 2018
Messages:87
Resources:8
Positive ratings received:20

sinful spire
#

ohhh

#

i didnt read his previuos message

#

i was thinking of a mc server

limber forge
#

oh xD

#

do I have to apply for premium on spigot mc?

grim halo
#

@limber forge You need to write decent quality code. You can submit a premium resource and then it will get reviewed.

#

If you want i can read against it and give you an assessment.

limber forge
#

i dont understand

#

i have to make a plugin and submit it to the support?

grim halo
#

You can just create a resource under the premium catergory.
It will then get reviewed. This might take up to 2 weeks.

limber forge
#

ahh i got premium

#

okay thx

#

i understand

grim halo
#

@limber forge As stated above i can read a bit of your code and give you some advice or at least tell you if you should polish it first or if its worth a try.

limber forge
#

okay i didnt made a plugin to sell yet i just wanted to know how i can sell

pastel nacelle
#
      try {
         this.checkURL = new URL("https://api.spigotmc.org/legacy/update.php?resource=" + projectID);
      } catch (MalformedURLException var4) {
         Bukkit.getLogger().warning("ร‚ยงcCould not connect to Spigot, plugin disabled!");
         Bukkit.getPluginManager().disablePlugin(plugin);
      }
#

0 out of 5 stars

tiny dagger
#

best protection is what lax has

#

that guy is a genius

pastel nacelle
#

This whole plugin will shit itself if it can't reach spigot to check for updates

#

Just why

#

System.out.println("Plugin enabled!");

#

don't use stout

#

you are given a plugin logger for a reason

quick arch
#

and it has it's own disable message e_e

pastel nacelle
#

also that

tiny dagger
#

chinese probabily won't be able to use it at all

pastel nacelle
#

Locations are serializable

#

you can just use getLocation/set

#

instead of 10 get/sets for each of the values of the location

tiny dagger
#

uh?

#

this doesn't match what you just said

pastel nacelle
#

huh?

tiny dagger
#

one moment you talk about a thing

#

then you say about locations being serializable

pastel nacelle
#

i'm talking about the plugin as I go through the source

quick arch
#

He's a communist, they're random

pastel nacelle
#
      Location loc = p.getLocation();
      cfg.set("X", loc.getBlockX());
      cfg.set("Y", loc.getBlockY());
      cfg.set("Z", loc.getBlockZ());
      cfg.set("Welt", loc.getWorld().getName());
      cfg.set("Yaw", loc.getYaw());
      cfg.set("Pitch", loc.getPitch());

#

is what the plugin does

tiny dagger
#

lol

pastel nacelle
#

i'm saying you could juse use cfg.set(loc)

#

and be done with it

tiny dagger
#

tbh i have my own serialization

quick arch
#

same

#

I store data in command blocks >:)

tiny dagger
pastel nacelle
#

i'm also pretty sure this join listener is going to throw a linkage error or something if you don't have PAPI

#

since it directly defers to PlaceholderAPI and a static method in it

crimson sandal
subtle blade
#

๐Ÿ˜› That's fine

#

I pushed to Spigot a minor mistake as well with the hoverable /plugins message. The website field showed the plugin version lol

crimson sandal
#

Hahaha really ๐Ÿ˜„ It feels good that I won't have to have a whole load of NMS in future versions of my plugin now, although I've had to add checks to make sure the Lidded class is actually available due to people not updating or who use Paper since it won't have that patch yet

#

Oh wait

#

Literally 3 minutes ago it was pushed to Paper ๐Ÿ˜„

ashen stirrup
#

What's the Java way of making a program wait x time

pastel nacelle
#

depends

sinful spire
#

Thread.sleep(200)?

pastel nacelle
#

Thread.sleep will make a thread wait for x time

sinful spire
#

be careful because that sleeps the whole thing

pastel nacelle
#

that may or may not be equivalent to sleeping your program

sinful spire
#

its kind of like (not responding) lol

ashen stirrup
#

Would it be worth initialising a new thread and have the program run inside of that?

grim halo
#

while(System.currentTimeMillis() - startTime > 5000){}
XD

pastel nacelle
#

maybe

ashen stirrup
#

Lmao

grim halo
#

@ashen stirrup Maybe this is a xy problem. What are you trying to do?

ashen stirrup
#

That'd work

pastel nacelle
#

the real question is what are you doing

ashen stirrup
#

Spigot fork type thing, I realised I wont be able to use new BukkitRunnable() and using Thread.sleep() would likely cause errors so I was looking for the typical way of "waiting".

#

I think imma use the while loop, that's most likely to work.

#

Without being too complex

pastel nacelle
#

nnno

#

that while loop is just a retarded way of doing thread sleep

grim halo
#

No pls dont use a while loop that was a bad joke.

pastel nacelle
#

as in it will be constantly checking the current time as fast as physically possible

#

until it's done waiting

ashen stirrup
#

Would it not be logical to run a Thread.sleep() in a new thread?

pastel nacelle
#

thread.sleep allows another thread to do work while one thread is sleeping

#

depends on what you're doing

ashen stirrup
#

StopCommand.java

pastel nacelle
#

the code that will run x seconds from now will then run x seconds from now on another thread

sinful spire
#

uh, minecraft isnt multithreaded is it

ashen stirrup
#

Making a countdown

sinful spire
#

that will freeze the server every x seconds in the countdown

pastel nacelle
#

you will need to sync back to the main for your shutdown procedure

#

other than that, doing the countdown on a separate thread will work fine

grim halo
#

So you have 2 options:
Count the ticks
poll the time each tick

pastel nacelle
#

you are in way over your head by the way

#

what on earth are you doing

grim halo
#

I think he just wants a countdown for his stop command

ashen stirrup
#

^ Lmao

crimson sandal
#

Yeah just schedule a task that runs every tick and use that as your counter, or even schedule it to run every 20 ticks so it's running every second

ashen stirrup
#

Making a starting point on reformatting most commands and adding certain features.

crimson sandal
#

Then use that task to add onto a variable and once it hits your wait time execute what you want

pastel nacelle
#

Spigot fork type thing

#

certainly you have access to the bukkit scheduler if you are using a spigot fork

crimson sandal
#

A Spigot fork that removes the Scheduler?

#

That sounds like a not very fun time

#

๐Ÿ˜„

ashen stirrup
#

IIRC, you need to pass a Plugin argument using Scheduler (or at least BukkitScheduler).

pastel nacelle
#

so... you are doing what?

#

writing a fork of spigot?

ashen stirrup
#

Right now I'm just reformatting the command messages etc.

pastel nacelle
#

that doesn't answer the question

ashen stirrup
#

Oh, yeah.

crimson sandal
#

You don't need to fork Spigot to do that surely?

pastel nacelle
#

kind of in over your head here

#

just write a plugin for it

crimson sandal
#

Plugins can replace default commands IIRC?

#

Like essentials replaces the give command

wicked cape
#

^

pastel nacelle
#

not necessarily but plugin commands will take precedence over the vanilla and bukkit commands

ashen stirrup
#

Yeah I know I can use PlayerCommandPreProcessEvent, I just want to delve into something new.

pastel nacelle
#

the underlying commands can still be executed, but you will need to use the full namespaced command name

#

no, just, register a new command

#

called stop

subtle blade
#

Cool. Got all the recordings and voice overs done for the first half of the BuildTools video. So that's neat

pastel nacelle
#

yourplugin:stop will be prioritized over minecraft:stop

crimson sandal
#

You're making BuildTools tutorials? ๐Ÿ˜ฎ

subtle blade
#

ye

crimson sandal
#

Nice

#

Oh yeah I wrote a script to build patches for just one class too btw

subtle blade
#

Yeah didn't think it'd be much work to do, it's not terribly over-complicated

grim halo
#

@ashen stirrup Here a general idea on how polling would look like:

  private final JavaPlugin plugin;

  public void countDown(final int seconds) {
    new BukkitRunnable() {

      private int count = seconds;
      private long threshold = System.currentTimeMillis() + 1000;

      @Override
      public void run() {
        if (System.currentTimeMillis() - threshold > 1000) {
          threshold += 1000;
          Bukkit.broadcastMessage("Cooldown: " + count--);
        }
        if (count == 0) {
          this.cancel();
        }
      }

    }.runTaskTimer(plugin, 1, 1);
  }
crimson sandal
#

Yeah, also the problem with patches seems to be that windows generates the files as CRLF but the patches on git are just LF

subtle blade
#

Yeah...

#

Line endings are a bitch

crimson sandal
#

I tried so much and ended up borking all my other git repos so I decided to stop ๐Ÿ˜„

ashen stirrup
#

Cheers, I'll take a look

tiny dagger
#

what happens with string keys in hashmaps, are they cached by java? ๐Ÿค”

#

like how in java sometimes string == "something"

#

until the cache expired

#

not sure if that happens in a hashmap would they still expire

frigid ember
#

Is there a way to modify world generation?

open ibex
#

You can generate custom worlds with your own generation but I don't know if you can apply it to the main world

frigid ember
#

I want to make custom ores

open ibex
#

You can't really make fully custom ores

#

Maybe there's a way to with a texture pack and custom models or something, but I've never used that and don't know how it works

#

For fully custom ores you'll need to make a mod

frigid ember
#

no...

#

basically I'll just put some block like red nether bricks

#

but retextured

#

with custom resource pack

open ibex
#

Ok that works

frigid ember
#

I mean I'd say it's possible since you can reskin a custom item without needing to replace the original item.

i.e create a "emerald sword" from the "wood sword" without replacing the normal wood sword

open ibex
#

If you know how to do the models

frigid ember
#

and make a custom drop too

#

right?

open ibex
#

Yeah I think so

frigid ember
#

That's what I've seen on servers at least. Not sure how you'd make your world generate the ores though.

open ibex
#

I don't know much about the world generation but to make the drops you have to keep track of the ores somehow and when they are broken spawn the correct item

#

Regular blocks can't have nbt so maybe using tags

frigid ember
#

Hey, I wanted to ask something to you guys in this channel.
What is a good server host for a small MC server (like 20 to 50 players)?
Is there any generic "game hosting" service or are the minecraft-specific hosts good?

#

get a vps

sinful spire
#

get a vps

open ibex
#

get a vps

frigid ember
#

Lol, okay. What's a good one?

#

get a vps

open ibex
#

lol

sinful spire
frigid ember
#

i mean what do you guys use

open ibex
#

I know of 3: AWS EC2, Microsoft Azure, and Oracle Cloud

#

I use AWS but not for Minecraft (I don't have a server)

frigid ember
#

gcloud offers $300 free trial you might wanna look into that and abuse their system

#

but from reliable providers, from my experience i can suggest OVH, digitalocean and vultr

#

Oh okay

#

I'll check those out thanks

sturdy oar
#

VPS Is still shared hosting

#

It may not perform well for game servers

#

And if you buy a super powerful VPS you usually just end up paying more than a dedi so it's not usually worth it

rotund orbit
#

I want to add functionality to some of my plugins that require access to lists or objects in other plugins AI have created. How do I create an API for other plugin developers to be able to access the resources used by my plugins?

sturdy oar
#

I usually use maven modules for APIs

rotund orbit
#

What are maven modules?

sturdy oar
#

If you want an example I can link

rotund orbit
#

Yes please

sturdy oar
rotund orbit
#

I saw that there was a plugin for dynmap support for factions and I wanted to be able to add that support in for my factions plugin.

sturdy oar
#

Do other developers can use my events

#

By just importing my jar into their other plugins

silver basin
#

I have been looking but is there a PR open for Spigot that will get the itemstack from a Projectile?

steel swift
#

how tf am i supposed to find the download to spigot server on jeeves

#

can anybody help me find the actual link

sturdy oar
#

how tf am i supposed to find the download to spigot server on jeeves
@steel swift what's jeeves

#

You mean Jenkins?

steel swift
#

jenkins

#

autocorrect

sturdy oar
#

You need to download buildtools

steel swift
#

sorry

sturdy oar
#

And build spigot yourself

rotund orbit
#

Thank you @sturdy oar. I will take a look at these when I get home. Is it alright if I PM you if I have questions?

sturdy oar
pastel nacelle
#

you don't need a multi-module project just to depend on dynmap

sturdy oar
#

I don't know what he's doing

#

He talked about making an API so I thought that's what he needed

pastel nacelle
#

looks to me like he wants to support dynmap in his plugin

#

you'd need a multimodule project or excessive quantities of reflection if you wanted to support multiple versions of dynmap in the same plugin

rotund orbit
#

I wanted to make an API so I could access resources in another plugin and I want to provide dynmap support for my factions plugin. Two separate things sorry

steel swift
wicked cape
#

Am i allowed to post codeblocks here? :)

sturdy oar
#

No man they're forbidden by the law

wicked cape
#

lol

#

I'll take that as a joke?

sturdy oar
#

Yes

#

Unless the code is NDA

steel swift
#

oh is it buildtools.jar

#

?

#

and i download that

silver basin
#

?bt

worldly heathBOT
sturdy oar
#

The latest stable

wicked cape
#
        if (label.equalsIgnoreCase("test")) {
            if (sender instanceof Player) {
                Player player = (Player) sender;
                player.sendMessage("Hallo!");

        }
    }
        return false;
    }
}```

Can someone please tell me what in the fuck i'm doing wrong here?
rotund orbit
#

Does dynmap have an API I can use to try to add support for it in my plugin?

pastel nacelle
#

don't use label

#

label will change if someone uses a different alias

sturdy oar
#

Label is only when you use onCommand in the javaPlugin class usually

#

You want to use plugin.yml

pastel nacelle
#

label is the /text you type right after the slash as far as I understand

silver basin
#

assuming you register the command correctly you dont need to check the command is the correct one

pastel nacelle
#

for the actual name of the command, you'd do cmd.getName

silver basin
#

ie you dont need the label check at all

wicked cape
#

So, you're telling me i need to do equalsIgnoreCase("...") ?

sturdy oar
#

no?

silver basin
#

no you need to remove that entirely

#
    public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
          if (sender instanceof Player) {
                Player player = (Player) sender;
                player.sendMessage("Hallo!");
          }
         return false;
    }
}```
#

also you want to remove the return false probably

wicked cape
#

Then how's it going to get my command?

pastel nacelle
#

in your main class, you will want a separate command executor for each command

wicked cape
#

Oh

pastel nacelle
#

getCommand("test").setExecutor(your executor here)

#

ideally you would be using something like ACF but these are acceptable baby steps

silver basin
#
 PluginCommand command = getCommand("test");
            if (command != null) {
                TestCommand commands = new TestCommand(this);
                command.setExecutor(commands);
                command.setTabCompleter(commands);
            } else {
                warn("Command Executor Error: Check plugin.yml");
                Bukkit.getPluginManager().disablePlugin(instance);
                return;
            }```
#

that goes in onEnable();

pastel nacelle
#

what on earth am i looking at

#

like

#

i guess that works

silver basin
#

actually it avoids a really common issue

#

...when the coder forgets to add the command to plugin.yml

wicked cape
#

Already added it ;)

pastel nacelle
#

doesn't mean it deserves an error message lol

#

that's not ever supposed to happen except very early in the development cycle

silver basin
#

oh I agree

pastel nacelle
#

and the developer will know what is wrong without an error message anyway

open ibex
#

You don't actually need to set both an executor and completer, if you just set the executor as a tabexecutor the tab completion will work automatically

silver basin
#

but I have seen somone actually edit the inside of jar to change the command name - believing that would work

pastel nacelle
#

i suppose but imo that is kind of overengineering it

wicked cape
#

Ok so, am i following his advice or not? lol

pastel nacelle
#

doesn't matter

silver basin
#

you can simplify it

#
getCommand("test").setExecutor(new TestCommand());
frigid ember
#

Hello, I am new to Java and I would like to learn how to develop Minecraft plugins for my server. Would anyone suggest me some way on how to learn it?

tiny dagger
#

intellij courses

#

then bukkit api

#

shouldn't take too long imo

frigid ember
#

Thanks alot

pastel nacelle
#

avoid the tutorials on spigot

#

most of them are kinda garbo

frigid ember
#

ok

#

ty

silver basin
#

@open ibex btw if you dont set the TabCompleter your right if you executor is a tabcompleter it falls back - but you are better to explicity set it

open ibex
#

True, it might be a little more efficient

silver basin
#

it saves a call

frigid ember
#
Block block = player.getWorld().getBlockAt(player.getLocation());
block.setType(Material.SPAWNER);
CreatureSpawner data = (CreatureSpawner) block.getBlockData(); //error
Caused by: java.lang.ClassCastException: org.bukkit.craftbukkit.v1_15_R1.block.data.CraftBlockData cannot be cast to org.bukkit.block.CreatureSpawner

How to fix that?

silver basin
#

you didnt update the block with the new type

frigid ember
#

how to do so?

#

I just basically need to get that block again?

open ibex
#

You could wait a tick or maybe there's a way to update it

#

Oh yeah getting it again should work

silver basin
#
        BlockState state = block.getState();
        state.setType(Material.);
        state.update()```
#

then get the block

frigid ember
#
Block block = player.getWorld().getBlockAt(player.getLocation());
block.setType(Material.SPAWNER);            
block = player.getWorld().getBlockAt(player.getLocation());
CreatureSpawner data = (CreatureSpawner) block.getBlockData();

same error

#

oh

#

didn't work :/ same error

#

I'll try waiting a bit

#

still :/

java.lang.ClassCastException: org.bukkit.craftbukkit.v1_15_R1.block.data.CraftBlockData cannot be cast to org.bukkit.block.CreatureSpawner
south talon
#

shouldn't you use block.getState() instead of getBlockData() ?

frigid ember
#

oh

silver basin
#

hangon yeah

#

...CreatureSpawner isnt an instance of BlockData

#

you want the block.getState()

frigid ember
#
java.lang.ClassCastException: org.bukkit.craftbukkit.v1_15_R1.block.CraftBlockState cannot be cast to org.bukkit.block.CreatureSpawner
#

Weird.

silver basin
#

post your code

frigid ember
#
            Location loc = player.getLocation();
            World world = player.getWorld();
            Block block = world.getBlockAt(loc);
            BlockState state = block.getState();
            state.setType(Material.SPAWNER);
            state.update();
            Bukkit.getScheduler().runTaskLater(plugin, ()->{
                Block blck = world.getBlockAt(loc);
                CreatureSpawner data = (CreatureSpawner) blck.getState();
                data.setRequiredPlayerRange(0);
                data.setSpawnRange(0);
                data.setSpawnCount(0);
                data.setSpawnedType(EntityType.CREEPER);
            },1);
#

now it doesn't place a spawner at all

silver basin
#

try block.setState()

frigid ember
#

before putting state.setType(Material.SPAWNER); it would place pig spawner

silver basin
#

sorry ignore that

#

oh state.update(true)

#

your chaning the block type you need to force the update

#
     * Attempts to update the block represented by this state, setting it to
     * the new values as defined by this state.
     * <p>
     * This has the same effect as calling update(false). That is to say,
     * this will not modify the state of a block if it is no longer the same
     * type as it was when this state was taken. It will return false in this
     * eventuality.
     *
     * @return true if the update was successful, otherwise false
     * @see #update(boolean)
     */
    boolean update();```
frigid ember
#

now no errors but the spawner doesn't change, I assume it's because I don't set the state, thanks!

#

I mean block data

silver basin
#

you could just set the type and get the blockstate afterwards

#

in theory that should work as well

frigid ember
#

Yeah that works, thanks, I'm just stupid kinda new and I don't know how to use the API correctly.

wicked cape
#

getCommand("test").setExecutor(this);

            if (sender instanceof Player) {
                Player player = (Player) sender;
                player.sendMessage("Hallo!");

        }
        return false;
    }
}```
#

This correct, yeah?

frigid ember
#

idk this seems more correct

#

but I'm noob at this so... idk

pastel nacelle
#

1

#

don't use == with strings

wicked cape
#

Yeahh erm, i'm getting a fat error.

frigid ember
#

oh crap, right

pastel nacelle
#

2, like already established, you don't need to care about the cmd in the executor

nova badge
#

can the incoming channel and outgoing channel have the same name in Bukkit?

quick arch
#

Just use ACF e.e

pastel nacelle
#

3 ^

rotund orbit
#

Trying to make a custom recipe use custom iteme as ingredients. How do I use the ExactChoice object when setting the Ingredients of a recipe? Or do I have to use the prepare item craft event to cycle through the items being used for the recipe to make sure it is the custom items being used and not regular items?

wicked cape
#

ACF seems a little overkill.

pastel nacelle
#

alternatively, write your own command framework

#

it's an excellent learning experience

wicked cape
#

I'm not that advanced.

#

I'm doing this for a reason. lol

frigid ember
#

how to make a new MetadataValue?

quick arch
#

ACF is amazing

wicked cape
#

I'm sure it is.

#

But i've not got the first idea on how to use it.

#

And i don't want to rely on an API as soon as i've started.

dusty topaz
#

spigot is an api

quick arch
#

^

frigid ember
#

a very confusing one.

wicked cape
#

๐Ÿคฆโ€โ™‚๏ธ

#

If you really need me to use ACF that bad, then so be it.

quick arch
#
@CommandAlias("test")
@CommandPermission("test")
public class TestCommand extends BaseCommand {

  @Default
  @CommandCompletion("test2|test3")
  public void onDefault(Player player){
    player.sendMessage("hi you executed /test!");
  }
  
  @Subcommand("test2")
  @CommandPermission("test.test2")
  public void onTest2(Player player){
    player.sendMessage("hi you executed /test test2!");
  }

}
#

It's not messy >:)

wicked cape
#

Sure, but what the fuck is Gradle/Maven? lol

frigid ember
#

I don't know too. I just download the jar files.

#

Probably a package manager or smth

quick arch
#

Dependency managers

frigid ember
#
        CreatureSpawner data = (CreatureSpawner) block.getState();
            data.setRequiredPlayerRange(0);
            data.setSpawnRange(0);
            data.setSpawnCount(0);
            data.setSpawnedType(EntityType.ARMOR_STAND);
            data.setMetadata("Invisible", (MetadataValue)??? );
#

Tips on how to make mob spawner have armor stand being invisible?

#

I don't know how to set MetadataValue on setMetadata

quick arch
#

what's that for

#

custom blocks?

frigid ember
#

yes

quick arch
#

oh I had to use nbt for them

wicked cape
#

wait

quick arch
#

btw, that type of custom block is heavy on the client

wicked cape
#

spawners can have armor stands?

#

pog

frigid ember
#

@quick arch got any other suggestions?

quick arch
#

whereas just regular armor stand custom blocks are on the server

#

spawners can have armor stands?
They can have armor stands to disguise it as a custom block, yes

frigid ember
#

So shall I use armor stands instead?

quick arch
#

yeah

#

Made custom blocks a while ago

#

It's bad because it's using a lib to make it an actual block

#

and it bugs a lot cause of tile entities being weird

#

/setblock ~ ~ ~ custom_block

wicked cape
#

bro that's fucking lit

frigid ember
#

isn't that the same thing as armor stand inside mob spawner? @quick arch

quick arch
#

that is the armor stand being inside the mob spawner

frigid ember
#

Yeah

quick arch
#

but it's registered as a "normal block" that can be spawned in with /setblock and stuff

frigid ember
#

That's what I'm talking about, except without setblock O_O

quick arch
#

that's with regular armor stands iirc

#

Spawns in a block, then put an armor stand on it with the custom stone being bigger

frigid ember
#

yeah

pastel nacelle
#

if we're talking about the little spinny fucker in the spawner block, I don't think the server really has a way to communicate much information about it

quick arch
#

The mob spawner technique is more harder on the client

#

but also more realistic cause it can show block break stages

#

the client has to render the mob spawner btw, that's why its harder on the client

frigid ember
#

@quick arch harder compared to what?

#

I made empty model for mob spawner already

quick arch
#

It lowers your fps by a lot if you have a lot of them

frigid ember
#

but wait I won't see breaking animation

#

crap

quick arch
#

rip

frigid ember
#

may I ask how did you do that?

quick arch
#

I did it with nbt

frigid ember
#

I can't put nbt in it

quick arch
#
compound.set((Object)0, new Object[] { "MaxNearbyEntities" });
compound.set((Object)0, new Object[] { "RequiredPlayerRange" });
compound.set((Object)NBTEditor.getNBTCompound("{id:\"minecraft:armor_stand\",Marker:1b,Invisible:1b,ArmorItems:[{},{},{},{id:\"" + this.material.getKey().toString() + "\",Count:1b,tag:{CustomModelData:" + this.customModelData + "}}]}"), new Object[] { "SpawnData" });
#

yeah I did it with a library

frigid ember
#

what the f?

quick arch
#

Don't think you can put custom mobs in it unless you edit the nbt directly

#

๐Ÿค”

pastel nacelle
#

set is such a misnomer

#

highly triggering

quick arch
#

that's for the regular armor stand type

#

too lazy to look in the source so it's decompiled with Luyten

#

Forgot what scale it had to be in ๐Ÿ˜

frigid ember
#

metadata = server side
nbt = (mostly) client side?

quick arch
#

no NBT is Minecraft's storage system

frigid ember
#

okay

quick arch
#

Metadata is a type of storage system as well, but it doesn't persist over restart

#

so they're gone once the server restarts

pastel nacelle
#

metadata is the aborted fetus born of bukkit/spigot that was supposed to become something the like PDC is now

#

there is almost zero reason to ever use it or acknowledge its existence in any fashion

quick arch
#

There's Scoreboard Tags as well

pastel nacelle
#

only thing it serves to do is confuse people with block sate

quick arch
#

but that's not used much

pastel nacelle
#

aren't tags vanilla

quick arch
#

yeah

#

You can store 1024 tags on an entity

#

but you'll have to make your own serializer and stuff

#

and yes, map makers use that to store data

pastel nacelle
#

i always just used scoreboards

stoic shell
#

How can I add a target selector autocomplete to a command?

frigid ember
#
[01:26:44] [Server thread/ERROR]: Fatal error trying to convert HelpopGUI v1.0:me/Lazinq/HelpopGUI/HelpopGUI.class
org.bukkit.plugin.AuthorNagException: No legacy enum constant for PLAYER_HEAD. Did you forget to define a modern (1.13+) api-version in your plugin.yml?```
#

tf does this mean xd

#

srry im normally on 1.8

#
            ItemStack playerhead = new ItemStack(Material.PLAYER_HEAD, 1);
            SkullMeta meta = (SkullMeta) playerhead.getItemMeta();```
#

and plugin.yml

name: HelpopGUI
version: 1.0
author: Lazinq
main: me.Lazinq.HelpopGUI.HelpopGUI

commands:
  Helpop:
  HelpopGUI:```
south talon
#

you need to put the api version in plugin.yml

frigid ember
#

just api-version: 1.16.1

#

?

pastel nacelle
#

or, in other words

#

"Did you forget to define a modern (1.13+) api-version in your plugin.yml?"

#

major version only, leave out the minor

#

1.13, 1.14, etc

frigid ember
#

ok

#

ty

#
    public void openGUIEvent(Player player) {
        Inventory inventory = Bukkit.createInventory(player, 54, "HelpopGUI");
        for (Map.Entry<UUID, String> entryName : getGUIHashMap().entrySet()){
            ItemStack playerhead = new ItemStack(Material.PLAYER_HEAD, 1);
            SkullMeta meta = (SkullMeta) playerhead.getItemMeta();
            meta.setOwner(entryName.getKey().toString());
            ArrayList<String> lore = new ArrayList<String>();
            lore.add(entryName.getValue());
            meta.setLore(lore);
            playerhead.setItemMeta(meta);

            inventory.addItem(playerhead);
        }
        player.openInventory(inventory);
    }```
it doesnt add the heads into the slots inside the inventory
#

:/

steep orbit
#

Anyone got clue what this is?

bronze acorn
#

uh

#

what spigot api are u using

#

for ur plugin

steep orbit
#

me?

bronze acorn
#

yes

steep orbit
#

wdym by that

bronze acorn
#

for ur plugin

#

what version

steep orbit
#

latest

bronze acorn
#

and what version is your server

frigid ember
#

from buildtools?

bronze acorn
#

looks like it's 1.8

wicked cape
steep orbit
#

it is

wicked cape
#

Ok so where tf do i put this?

bronze acorn
#

are you using nms

#

@wicked cape pom.xml

#

@steep orbit are you using nms

steep orbit
#

i dont think so

frigid ember
#

my message is going away :p

bronze acorn
#

it's most likely because you're trying to use a 1.16 (latest) plugin on 1.8

#

@frigid ember for starters, you're creating an inventory everytime a player opens the gui

#

don't do that

#

store the inventory

#

set a variable and initialize it in the constructor

steep orbit
#

i'll try fixing that

wicked cape
#

Aaaand.... What's this precisely actually asking me to do? Replace [YOUR PLUGIN PACKAGE] with a package to your plugin so that ACF is relocated to it.

bronze acorn
#

homie what are u trying to do

#

lol

stoic shell
#

exactly what it says...

bronze acorn
#

there's a

#

place

#

[YOUR PLUGIN PACKAGE]

#

you know

#

so like

#

java knowledge here

#

something like for example mines, com.taahyt.<pluginname>

stoic shell
#

also my question got buried

#

How can I add a target selector autocomplete to a command?

lone fog
#

What do you mean by that

spring coyote
#

By that do you mean @a

#

if so u cant cuz bukkit doesnt support it im pretty sure

nocturne crane
lone fog
#

You can if you program it manually

spring coyote
#

That would take ages tho

lone fog
#

if arg == @a loop all players and then do whatever

pastel nacelle
#

might just be paper api, but there is a method to resolve a string representing a target selector, given a command sender, to a list of entities

spring coyote
#

huh

#

Also can anyone help me out with this?

lone fog
#

There is probably a method for that in nms somewhere too

bronze acorn
#

listen for the packet packetinentityuseevent

stoic shell
#

Like, vanilla target selectors.

bronze acorn
#

i belieeve

#

protocollib has built in packet listeners

pastel nacelle
#

yes, but what do you mean by that

#

it suggests you different selectors when you press tab?