#help-archived
1 messages ยท Page 207 of 1
<scope>shade</scope>
But you can just remove the scope as shade is the default one
In your pom <build><plugins> then add the plugin </plugins></build>
.
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
Having awful issues with end portal on current spigot
Is this is a known issue or a plugin conflict?
@frigid ember PLAYER_HEAD
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
declaration: package: org.bukkit.entity, interface: FallingBlock
@frigid ember Are you using Eclipse?
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
No idea then. This is an error from your IDE
I dont use eclipse anymore
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
This is not a java error. It stems from eclipse.
Make sure you dont use plain jar files in your maven project
If you need a dependency then it must come from maven
Yep thats all covered already. I think there are other dependencies that Hibernate is not able to retrieve from just the hibernate core
Maven should manage all sub dependencies. Never had this problem in intellij only in eclipse.
I suppose it could be because of Eclipse, but I find that very, very unlikely
do items with seperate NBT tags but with the same Material, stack in game?
@spare frost no
Awesome
This would mean that one of them had to erased
So if i wanna make the max stack size of some item to 1 i just add a randomly generated nbt tag
Yes
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 :)
A GUI is just a simple Inventory. if you change the content then the player will see the updated content.
javax.persistence.EntityTransaction
What the hell are you trying to import?
What reason do you have to import from javax?
He's using Hibernate I believe
If everything is shaded appropriately, also ensure it's been relocated
No reason to be shading anything without relocating it
@grim halo I know but that do not help me.
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?
Change a spefic slot into this inventory for client-side only
Send him a packet iguess...
Yes with ProtocolLib or directly with Minecraft .
" 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?
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 ^^'
@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
When you shade it in you can relocate/move it to a different package
Although, I never do that, maybe I should
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
Does it matter what package I relocate it to?
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
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>?
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.
someone help pls
@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?
The pattern should be the original package
yes thats what I did
I took that name from the maven dependency I already have defined in my POM
org.hibernate
The pattern should be the original package
<!-- 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
Generally, it should be. Although there's nothing stopping it from differing from the package
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
So... I left chunky generating all night, and was only at 14% when I got up.
I did the relocation we talked about as well
Might have to also relocate javax.persistance as well
[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?
bungeecord doesn't want to start up for me
@half badge Thats the thing, Hibernate only has one dependency in its maven repository
You should be able to relocate javax.persistance anyway
It's a dependency of Hibernate it self
Infact hibernate has quite a few dpendencies...
@half badge Thats what I'm saying. It doesn't seem reasonable to relocate all of those
Is there no other way?
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
Yeah
no, its not public*
What is it?
its not public*
Oh okay
If it's only you using it then you probably wont have to care about relocating
?
As long as nothing else attempts to shade Hibernate
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
<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
[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)
I guess I'm just going to get the jars & add them directly to my build path
Honestly just seems easier
Did you try the Pom snippet I sent you?
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 ..
@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
wow
tried another chunk generation plugin, and it made Chunky look like it's the slowest on the market
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
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
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
@frigid ember
?
@frigid ember what mc version?
Then it should just work with shading
@frigid ember This is not the place to hire devleopers - go the the services and reqruitment section on the forums for that
I use it without any issues
Let me give you the error
Before it was a pain since spigot decided to include an ancient jpa version without updating it
The type javax.persistence.PersistenceException cannot be resolved. It is indirectly referenced from required .class files
I get this after performing the shade
That seems like you are missing some transitive dep
When its just in my maven dependencies I don't get anything
Like jpa
[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) ~[?:?]
Wouldn't the core import the required persistance depedencies?
I use hibernate as part of spring nowadays
Well, it's also not finding hibernate
Wouldn't the core import the required persistance depedencies?
@half badge thats what I mean
Is it in your jar?
Did you change the <scope> for it?
<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
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
Just checking, you are using the jar with -shaded on the end as well?
not sure what you mean
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
#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));
@hoary parcel @half badge should I drag the dependent jars into the directory that I export my plugin jar to?
@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
They are in my pom....
But you need to build using Maven
Maybe I'm not understanding
Also remove everything from your build path or how ever its called in eclipse
You need to stop using eclipse tbf
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)
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...
mvn jar:jar for the goal?
then in goals: clean install
You'll find compiled binaries in the target directory
Btw what does "jfc" stand for? Never seen that.
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.
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
if its sent to the target folder thats fine
I can just retrieve it from there, correct?
<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
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?
guys guys, how to make a server 1.8-1.16? like hypixel, mineplex, etc..
Maybe you have some import or reference to the class left.
someone answer me please
@past basalt You need a plugin that changes the protocol based on the clients version.
ViaVersion does this for example.
@grim halo you are correct
so if i installed viaversion on each spigot server, it will allow players to join with higher versions?
Yes the lowest version is mutual
it doesn't matter if plugins don't support 1.16?
Does the bungeecord configuration getkeys also return substrings?
also i need to install it in bungeecord or spigot servers?
Idk what to do after I clicked the download now button and I pressed keep and everything someone help
Please
is this your first message? i didnt see all messages here
Yes
@past basalt Go on their spigot site and read how to set it up. They have all infos there i think.
I joined this server yesterday
Invsee
Ok
okay, ty
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?
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)
How to disable the end credits?
@frigid ember Just go with the bigger jar ^^ the dependencies should be in there.
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
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
Overload the command and list them yourself or fetch the command and change the output.
Use \n
If you want your plugin to change it then you will have to use a tabexecutor instead of a bukkitcommand
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
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
Did you open the jar and see if the yml is there?
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```
Did you open the jar and see if the yml is there?
I didn't have this issue when I exported the jar normally
Im gonna guess its not there
Do you have a "resources" directory in your project?
@frigid ember https://stackoverflow.com/questions/60764/how-to-load-jar-files-dynamically-at-runtime
@frigid ember And does it contain your plugin.yml
No, I have them at the root
the src root should only contain class files. If you have resources (like the plugin.yml) it should be in your resources path
I guess thats my problem
Gotchya
@frigid ember https://stackoverflow.com/questions/60764/how-to-load-jar-files-dynamically-at-runtime
@grim halo i can get the jar
but the error is i can use classes of main project
no idea what that means. Sry :/
Try using your plugins own class loader
that import is from main project
HELL YA BOI
SHIT WORKS
ah please explain me
@grim halo
Nice. Maven is hard at the beginning but you will learn to love it later.
Should I compare player objects with == or .equals()?
@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
plugin.getClass().getClassLoader().loadClass(main.getName()); how i load classes from jar
@grim halo this is how i load classes from anothere jar https://pastebin.com/EEXerSPj
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
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.
@hoary parcel
wtf are you trying to do?
i am trying to load plugin for a plugin
why?
basically loading an jar
why cant you let bukkit load plugins?
Plugins means,a module only for my plugin
I havebeed able to load the classes
So no one helped me. Really. Thanks for giving me a f***ing nothing.
but i can use methods and classes from main project.
@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.
uh... ask in the Skript discord
^
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
Server version?
1.8.8-R0.1-SNAPSHOT
are you using other plugins besides skript?
Umbaska
Since 1.8.8 is very outdated, you won't find much support for it.
But there are problems with 1.8.8 ๐
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.
1.8.8 is unsupported here tbh
1.8.8 is unsupported here tbh
@sturdy oar you are the unsipported.
what lol

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
DEMONIC TRIGGERED
Assisting it is
@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.
o/ Won't be missed
I use 1.8.8 myself, but I've never come here once asking desperately for someone else to fix my server
I had my daily dose of cringe from that last message
oh boy, he'll be trashed on in the Skript Discord with that attitude ๐
lmao you should read his original post, https://discordapp.com/channels/690411863766466590/690470011382267904/738067971460825137 he waited less than 10 minutes before complaining no one was helping
is he being serious i genuinely cant tell
I'm just starting to be more aggressive with my kicks. Don't really have the patience lately
lmao you should read his original post, https://discordapp.com/channels/690411863766466590/690470011382267904/738067971460825137 he waited less than 10 minutes before complaining no one was helping
@balmy sentinel Me waiting 3 days for StackOverflow answers
๐
S/O is the most toxic place, I swear to God
Posted one question there, never went back
I got banned
To posting, anyways. I still refer to it lol
yeah Im banned from StackOverflow... for asking questions .-.
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
That's hot
Looks like you must have deleted an if statement at the top of that for loop
That'd do it
Good grief i just read up on the history that guy was a toxic 5 year old
Let's forget him, giving people like that attention is what they want.
true
@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.
Or you smarten the fuck up and use a modern version
You will not be supported here. That's final
Ban Hammer when
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
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.
No one cares about 1.8.8 in here
Really? I never use 1.16. ._.
do y know what is minecraft
Doesn't sound like a problem to us
This had some translation error to me. I don't understand. Sry
grammar
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.
what
There is a plugin for old combat in newer versions
what
I ask that too
Nevermind they said they wouldn't use it
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
There's no event for it but you can detect it
how can i detect it?
with a Runnable or the movement event,
Player#getLocation()
Location#getChunk()
Using the event might be laggy because it could run every tick
^
Same with the runnable if it's scheduled for every tick
Can just be every second
yeah, being 100% accurate comes at the cost of performance
Yep
thanks, both of you gave me some good ideas where to start ;)
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)
Are there anybody who has experience to use PacketPlayOutMap?
Do the "low effort resources will be removed" also apply to free resources?
no
nono i just wanted to post a 30 lines free plugin
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!
yes it is
but only for donors
you need to donate 10โฌ then you can change it from website
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)
just use a shared host if you can't figure it out
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
You can take that quite literally @limber forge
where can i make a backup
With pen and paper for example (i think this is one of the recommended ways)
just write down the level.dat file
where is this file
What? @sinful spire
backup of what
like the world or
We are speakin about the spigot account backup codes right?
wait those exist
they exist for 2 step verification
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
Ok. Then you can dismiss the message
uh... 3 resources, 60 messages, 20 reactions?
probably wait a few days after you get those
Joined:Mar 28, 2018
Messages:87
Resources:8
Positive ratings received:20
@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.
You can just create a resource under the premium catergory.
It will then get reviewed. This might take up to 2 weeks.
@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.
okay i didnt made a plugin to sell yet i just wanted to know how i can sell
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
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
and it has it's own disable message e_e
also that
chinese probabily won't be able to use it at all
Locations are serializable
you can just use getLocation/set
instead of 10 get/sets for each of the values of the location
huh?
i'm talking about the plugin as I go through the source
He's a communist, they're random
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
lol
tbh i have my own serialization
this looks so much better
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
@subtle blade I just noticed a small oversight with Barrels when using the new Lidded api so I made a quick PR ๐คฆโโ๏ธ https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/pull-requests/716/overview
๐ 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
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 ๐
What's the Java way of making a program wait x time
depends
Thread.sleep(200)?
Thread.sleep will make a thread wait for x time
be careful because that sleeps the whole thing
that may or may not be equivalent to sleeping your program
its kind of like (not responding) lol
Would it be worth initialising a new thread and have the program run inside of that?
while(System.currentTimeMillis() - startTime > 5000){}
XD
maybe
Lmao
@ashen stirrup Maybe this is a xy problem. What are you trying to do?
That'd work
the real question is what are you doing
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
No pls dont use a while loop that was a bad joke.
as in it will be constantly checking the current time as fast as physically possible
until it's done waiting
Would it not be logical to run a Thread.sleep() in a new thread?
thread.sleep allows another thread to do work while one thread is sleeping
depends on what you're doing
StopCommand.java
the code that will run x seconds from now will then run x seconds from now on another thread
uh, minecraft isnt multithreaded is it
Making a countdown
that will freeze the server every x seconds in the countdown
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
So you have 2 options:
Count the ticks
poll the time each tick
I think he just wants a countdown for his stop command
^ Lmao
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
Making a starting point on reformatting most commands and adding certain features.
Then use that task to add onto a variable and once it hits your wait time execute what you want
Spigot fork type thing
certainly you have access to the bukkit scheduler if you are using a spigot fork
A Spigot fork that removes the Scheduler?
That sounds like a not very fun time
๐
IIRC, you need to pass a Plugin argument using Scheduler (or at least BukkitScheduler).
Right now I'm just reformatting the command messages etc.
that doesn't answer the question
Oh, yeah.
You don't need to fork Spigot to do that surely?
Plugins can replace default commands IIRC?
Like essentials replaces the give command
^
not necessarily but plugin commands will take precedence over the vanilla and bukkit commands
Yeah I know I can use PlayerCommandPreProcessEvent, I just want to delve into something new.
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
Cool. Got all the recordings and voice overs done for the first half of the BuildTools video. So that's neat
yourplugin:stop will be prioritized over minecraft:stop
You're making BuildTools tutorials? ๐ฎ
ye
Yeah didn't think it'd be much work to do, it's not terribly over-complicated
@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);
}
Yeah, also the problem with patches seems to be that windows generates the files as CRLF but the patches on git are just LF
I tried so much and ended up borking all my other git repos so I decided to stop ๐
Cheers, I'll take a look
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
Is there a way to modify world generation?
You can generate custom worlds with your own generation but I don't know if you can apply it to the main world
I want to make custom ores
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
no...
basically I'll just put some block like red nether bricks
but retextured
with custom resource pack
Ok that works
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
If you know how to do the models
Yeah I think so
That's what I've seen on servers at least. Not sure how you'd make your world generate the ores though.
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
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
get a vps
get a vps
lol
like i can suggest https://cldn.pro because i use it and its cheap for my budget
i mean what do you guys use
I know of 3: AWS EC2, Microsoft Azure, and Oracle Cloud
I use AWS but not for Minecraft (I don't have a server)
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
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
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?
I usually use maven modules for APIs
What are maven modules?
If you want an example I can link
Yes please
https://github.com/TheViperShow/BetterTeleport/tree/master/BetterTeleport-API/
For example in this plugin I have a separate API jar
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.
Do other developers can use my events
By just importing my jar into their other plugins
I have been looking but is there a PR open for Spigot that will get the itemstack from a Projectile?
how tf am i supposed to find the download to spigot server on jeeves
can anybody help me find the actual link
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.
@rotund orbit https://maven.apache.org/guides/mini/guide-multiple-modules.html
how tf am i supposed to find the download to spigot server on jeeves
@steel swift what's jeeves
You mean Jenkins?
You need to download buildtools
sorry
And build spigot yourself
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?
you don't need a multi-module project just to depend on dynmap
I don't know what he's doing
He talked about making an API so I thought that's what he needed
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
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
what do i click from here though https://hub.spigotmc.org/jenkins/job/BuildTools/lastStableBuild/
Am i allowed to post codeblocks here? :)
No man they're forbidden by the law
?bt
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
The latest stable
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?
Does dynmap have an API I can use to try to add support for it in my plugin?
Label is only when you use onCommand in the javaPlugin class usually
You want to use plugin.yml
label is the /text you type right after the slash as far as I understand
assuming you register the command correctly you dont need to check the command is the correct one
for the actual name of the command, you'd do cmd.getName
ie you dont need the label check at all
So, you're telling me i need to do equalsIgnoreCase("...") ?
no?
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
Then how's it going to get my command?
in your main class, you will want a separate command executor for each command
Oh
getCommand("test").setExecutor(your executor here)
ideally you would be using something like ACF but these are acceptable baby steps
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();
actually it avoids a really common issue
...when the coder forgets to add the command to plugin.yml
Already added it ;)
doesn't mean it deserves an error message lol
that's not ever supposed to happen except very early in the development cycle
oh I agree
and the developer will know what is wrong without an error message anyway
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
but I have seen somone actually edit the inside of jar to change the command name - believing that would work
i suppose but imo that is kind of overengineering it
Ok so, am i following his advice or not? lol
doesn't matter
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?
Thanks alot
@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
True, it might be a little more efficient
it saves a call
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?
you didnt update the block with the new type
You could wait a tick or maybe there's a way to update it
Oh yeah getting it again should work
BlockState state = block.getState();
state.setType(Material.);
state.update()```
then get the block
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
shouldn't you use block.getState() instead of getBlockData() ?
oh
hangon yeah
...CreatureSpawner isnt an instance of BlockData
you want the block.getState()
java.lang.ClassCastException: org.bukkit.craftbukkit.v1_15_R1.block.CraftBlockState cannot be cast to org.bukkit.block.CreatureSpawner
Weird.
post your code
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
try block.setState()
before putting state.setType(Material.SPAWNER); it would place pig spawner
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();```
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
you could just set the type and get the blockstate afterwards
in theory that should work as well
Yeah that works, thanks, I'm just stupid kinda new and I don't know how to use the API correctly.
getCommand("test").setExecutor(this);
if (sender instanceof Player) {
Player player = (Player) sender;
player.sendMessage("Hallo!");
}
return false;
}
}```
This correct, yeah?
Yeahh erm, i'm getting a fat error.
oh crap, right
2, like already established, you don't need to care about the cmd in the executor
can the incoming channel and outgoing channel have the same name in Bukkit?
Just use ACF e.e
3 ^
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?
ACF seems a little overkill.
alternatively, write your own command framework
it's an excellent learning experience
how to make a new MetadataValue?
ACF is amazing
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.
spigot is an api
^
a very confusing one.
@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 >:)
Sure, but what the fuck is Gradle/Maven? lol
I don't know too. I just download the jar files.
Probably a package manager or smth
Dependency managers
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
yes
oh I had to use nbt for them
wait
btw, that type of custom block is heavy on the client
@quick arch got any other suggestions?
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
So shall I use armor stands instead?
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
bro that's fucking lit
isn't that the same thing as armor stand inside mob spawner? @quick arch
that is the armor stand being inside the mob spawner
Yeah
but it's registered as a "normal block" that can be spawned in with /setblock and stuff
That's what I'm talking about, except without setblock O_O
that's with regular armor stands iirc
Spawns in a block, then put an armor stand on it with the custom stone being bigger
yeah
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
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
It lowers your fps by a lot if you have a lot of them
rip
may I ask how did you do that?
I did it with nbt
I can't put nbt in it
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
what the f?
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 ๐
metadata = server side
nbt = (mostly) client side?
no NBT is Minecraft's storage system
okay
Metadata is a type of storage system as well, but it doesn't persist over restart
so they're gone once the server restarts
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
There's Scoreboard Tags as well
only thing it serves to do is confuse people with block sate
but that's not used much
aren't tags vanilla
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
i always just used scoreboards
How can I add a target selector autocomplete to a command?
[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:```
you need to put the api version in plugin.yml
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
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
:/
me?
yes
wdym by that
latest
and what version is your server
from buildtools?
looks like it's 1.8
it is
Ok so where tf do i put this?
i dont think so
my message is going away :p
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
i'll try fixing that
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.
exactly what it says...
there's a
place
[YOUR PLUGIN PACKAGE]
you know
so like
java knowledge here
something like for example mines, com.taahyt.<pluginname>
also my question got buried
How can I add a target selector autocomplete to a command?
What do you mean by that
Hi everyone. My server keeps crashing randomly... Especially after longer periods of uptime. Here is the error: https://paste.helpch.at/olefelalor.bash
You can if you program it manually
That would take ages tho
if arg == @a loop all players and then do whatever
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
There is probably a method for that in nms somewhere too
listen for the packet packetinentityuseevent
Like, vanilla target selectors.