#help-development
1 messages ยท Page 1806 of 1
Hi there, i'm having a issue when enabling my bungee-spigot plugin on the proxy., How can i fix? Please ping me ๐
16:35:58 [WARNING] Error loading plugin StaffMode
java.lang.NoClassDefFoundError: org/bukkit/plugin/java/JavaPlugin
at java.base/java.lang.ClassLoader.defineClass1(Native Method)
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1010)
at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:150)
at net.md_5.bungee.api.plugin.PluginClassloader.findClass(PluginClassloader.java:146)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:586)
at net.md_5.bungee.api.plugin.PluginClassloader.loadClass0(PluginClassloader.java:66)
at net.md_5.bungee.api.plugin.PluginClassloader.loadClass(PluginClassloader.java:59)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:519)
at net.md_5.bungee.api.plugin.PluginManager.enablePlugin(PluginManager.java:340)
at net.md_5.bungee.api.plugin.PluginManager.loadPlugins(PluginManager.java:250)
at net.md_5.bungee.BungeeCord.start(BungeeCord.java:273)
at net.md_5.bungee.BungeeCordLauncher.main(BungeeCordLauncher.java:67)
at net.md_5.bungee.Bootstrap.main(Bootstrap.java:15)
Caused by: java.lang.ClassNotFoundException: org.bukkit.plugin.java.JavaPlugin
at net.md_5.bungee.api.plugin.PluginClassloader.loadClass0(PluginClassloader.java:97)
at net.md_5.bungee.api.plugin.PluginClassloader.loadClass(PluginClassloader.java:59)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:519)
... 13 more
When the player glides (With an elytra so basically passes through) A ring (The ring has a worldguard region) The player gets 1 light blue dye
then you need to use worldguard api, also add it as dependecy in plugin.yml
How...
their site doesnt explain it
@EventHandler
public void onHitSupremeAxe(EntityDamageByEntityEvent e){
if(!(e.getDamager() instanceof Player)){
return;
}
Player attacker = (Player)e.getDamager();
if(!(attacker.getInventory().getItemInMainHand().getItemMeta().getPersistentDataContainer().equals(SupremeAxe.SUPREME_AXE.getItemMeta().getPersistentDataContainer()))){
return;
}
if(e.getEntity() instanceof LivingEntity){
((LivingEntity)e.getEntity()).addPotionEffect(FluPotion.FLU_POTION_EFFECT);
}
}
could someone take a look at my code and tell me if there is something wrong?
i didn't work with worldguard so i can't say, but there probably should be api, mb try this https://worldguard.enginehub.org/en/latest/developer/index.html
Ye thats the site im at
^ should answer your questions
but idk how to add it to my project
If you compile your plugin or mod using something like Maven or Gradle (which you should!), you will need to add WorldGuard to the list of dependencies. You can find WorldGuardโs artifacts in sk89qโs Maven repository.
How do I get their repository
sk89q
just copy paste code from 'Example: Configuring a Maven pom.xml' to your pom.xml and from 'Modifying plugin.yml' 'depend' to your plugin.yml
yes
where do I find pom.xml and plugin.yml....?
Uhm
Issue
If you use .equals you will get a NPE if that pdt is null
pom.xml in project root and plugin.yml in 'src/main/java/resources'
and where do i find the project root? I didnt get to choose a project location
the project root means, the folder of project
root = same level as the src folder
just reload maven
`
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
public class DamageListener implements Listener {
public void onDamage(EntityDamageByEntityEvent event){
Entity damager = event.getDamager();
Location damager_location = damager.getLocation();
World world = damager.getWorld();
world.spawnEntity(damager_location, EntityType.PANDA);
}
}`
can someone tell me why this isnt working?
there's button in top-right corner when you open pom.xml
hmhm
@EventHandler above the method. And register the event.
"Load maven changes"?
yes
https://gyazo.com/80a6faf72dabf2995312c4f86a7c2822 DId that, now I have this
can you send screenshot of full ide window
how do i change the name of this compass and the color of the name to red?
p.getInventory().addItem(new ItemStack[]{new ItemStack(Material.COMPASS)});
thx
CompassMeta compass = (CompassMeta) item.getItemMeta();
compass.setDisplayName("blah");
item.setItemMeta(compass);```
and the color?
ohhh so in the "blah" like comma and then color?
ChatColor.RED + "blah"
ah okay thanks
target.getLocation().getWorld().playEffect(target.getLocation(), Effect.CRIT, Integer.MAX_VALUE, 0.5F, 0.5F, 0.5F);
why isn't this working
intellij underlined it
theres alot of things in it that it cant resolve, how exactly do i apply it to what i put
let me gues... 1.8 ?
and what is the error ?
(target.getLocation(), Effect.CRIT, Integer.MAX_VALUE, 0.5F, 0.5F, 0.5F); is underlined
effect class ?
? @vale ember
Cannot resolve method 'playEffect(org.bukkit.Location, org.bukkit.Effect, int, float, float, float)'
can you send full pom.xml file, because i don't see the top of the file
do you use autocomplete ? maybe this method does not exist with int float float flaot
Hi folks, where can I find a Spigot jar which has been remapped with the obfuscation maps?
no
Hello, I am looking for how to call one function from another. I was wondering if you have any advice for me?
I currently have access to the obfuscated spigot jar (i.e the server) and a deobfuscated vanilla server jar, though there are some differences in naming between the two and I'd like to read the deobfuscated spigot version ๐
myFunction();
this is basic java, not spigot plugin help
import it and use
what
@peak granite
CompassMeta compass = (CompassMeta) item.getItemMeta();
compass.setDisplayName(Color.RED + "Teleportation Menu");
item.setItemMeta(compass);```
thank you
yeah?
all the "CompassMeta" lines are wrong and idk what to put there
there is no (target.getLocation(), Effect.CRIT, Integer.MAX_VALUE, 0.5F, 0.5F, 0.5F)
you need to set the meta on the items before you put it in the players inventory
so? how do i play the effect
effect or particle ?
Hello what is the best way to send mass block changes of a single block to a client. Sending invididual block changes lags at the moment with 50+
to client
no one else can see
replace 'VERSION' with some valid version
p = player
okay thanks, also the item.getItemMeta lines arent working either, they are red and it says cant resolve symbol
idk any versions
specificlly the item. are red
ItemStack item = new ItemStack(Material.COMPASS);
CompassMeta compass = (CompassMeta) item.getItemMeta();
compass.setDisplayName(Color.RED + "Teleportation Menu");
item.setItemMeta(compass);
p.getInventory().addItem(item);```
spawnParticle doesn't exist on 1.8
update to 1.18
no
use particlelib if youre forced to use 1.8
so put that under my p.getInventory.... or instead of it?
instead
okay thanks
Okay the errors are gone, now what?
why even cast
if u dont use any of CompassMeta stuff
How to include packages that not contains classes? Maven compiling only packages with classes. configuration.* is missed in jar
<build>
<defaultGoal>clean package</defaultGoal>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<archive>
<addMavenDescriptor>false</addMavenDescriptor>
<manifest>
<addClasspath>false</addClasspath>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.4</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
<configuration>
<outputDirectory>...</outputDirectory>
</configuration>
</plugin>
</plugins>
<finalName>${project.parent.artifactId}-${project.version}</finalName>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
</build>
in your build xml <!-- Include languages --> <resource> <directory>src</directory> <excludes> <exclude>**/*.java</exclude> </excludes> </resource> </resources>
Like stated before, I'm trying to (When the player passes through a worldguard region) They get a blue dye.
im trying to send a photo cause its saying theres stuff wrong, do i need a role or something to send them?
how can I add value to String list to config?
i can upload a file
!verify
Usage: !verify <forums username>
to upload
There is a problem. It is adding main.java. ...
Also config and plugin, but it could be fixed with changing to /configuration/. And what about main.java?
like a spigot account user?
your spigot forum account name
Is it possible to change a shields design via ItemMeta?
modify the directory line to src/main/java
and refresh config
Can I get the shields bannermeta?
how long do i have to wait before the server recognizes my new account
What should I use to have an event trigger when an Entity receives Suffocation Damage?
Like zombie stuck in stone blocks bruh
Any ideas on how to do that
Now there is a copy
?paste your pom
this is my first plugin and its kind of embarrassing but how do i actually get the physical file to put in my plugins folder?
does vault not have a method to set a player's balance
it use OfflinePlayers
Fixed. If u are interesting, there is a solution:
<resource>
<directory>src/main/java/configuration</directory>
<includes>
<include>**/*.yml</include>
<include>**/*.schematic</include>
<include>**/*.schem</include>
</includes>
<targetPath>configuration</targetPath>
</resource>
but not set
He wouldn't have a document that explains how it works for importing a function please? because I couldn't find it on my side.
.addItem(new ItemStack[] { new ItemStack(Material.DIAMOND_SWORD) });
You are creating ItemStack array, not Material array
p.playSound(p.getLocation(), 1, 1, 1); i have no idea how to use playSound
oh i think ik what im doing wrong
assumingp is a plater
yes
((CraftPlayer) target).getHandle().b.sendPacket(packet);
Why is the PacketPlayOutGamesTateChange packet not WORKING anymore in 1.18?????
WTF
How can you set a player_head itemstack to a certain skin?
The method is no longer called sendPacket()
its now called a()
how do i make it so, that i can "turn on/off the listener" ?
This is how I send my packets now:
ReflectionUtil.invokeMethod(playerConnection, "a", new Class<?>[] { packetClass }, new Object[] { packetPlayOutPlayerInfoRemovePlayer });
ReflectionUtil.invokeMethod(playerConnection, "a", new Class<?>[] { packetClass }, new Object[] { packetPlayOutPlayerInfoAddPlayer });
Why is thgere nmo CraftPlayer????
How do I get the connection
And why do they make those fucking packet thing EVERY UPDATE more complicated?
Wut
How do I just send a normal packet?
PacketPlayOutGameStateChange packet = new PacketPlayOutGameStateChange(new a(5), 0);
((CraftPlayer) target).getHandle().b.sendPacket(packet);```
This was so fucking easy but why did they change it AGAIN?
https://prnt.sc/21q6612 i cannot use any Packets anymore
It is so fucking complicated now wtf
Because mojang and spigot like fucking up every update. Spigot can just blame mojang every time but we all know they can just add to the api to make it the same.
saving an inventory to base64 goes brr
noice
I thought base64 had a limit?
?
i dunno
I have a command and I need to convert an argument to Player. How tho
maybe it havent reached it
Bukkit.getPlayer()
Spigot has nothing to do with packets, thats all Mojang
thx
based on the name, so args[x]
reread the msg
I hate it now it got so complicated I remember when you just could do
PacketPlayOutGameStateChange packet = new PacketPlayOutGameStateChange(5, 0);
Then this fucking a(5) shit came in whyever and in 1.17 I had to do
PacketPlayOutGameStateChange packet = new PacketPlayOutGameStateChange(new a(5), 0);
and not everything is ruined again
String has no method getPlayer
oop, thx
no worries
I know I have to switch my latest projects to maven because md_5 made the jar a bootstrap instead of implementing the libs.
this says there is local vars that should replace the need for new a(5) i think
Yeah but if I switch to Maven I cannot send Packets
of course you can
Yeah but with that stupid ProtocolLib
no
Ok, I have a
(PlayerHeadMeta) ItemStack(Material.PLAYER_HEAD).getItemMeta, how can you set the head skin?
maven
How do i set a player attribute
Hm
player.getAttribute(Attribute).set...
y
for a command im making
how can I put the value in string list in config?
How can i do monthly stats
explain more what when
you could get the list then add smth and then set the list again
and to refresh it on a current basis, what can I do? adding a value for example
Hey folks, is there a way to disable the hash checking in 1.18 for the bundled libraries? during my developing I need to switch out some spigot classes with modified ones, and it seems to just reset them
edit the server.jar too
Which one? I'm currently replacing .class files in bundler/version/spigot-1.18-R0.1-SNAPSHOT.jar
๐ง
what do you want to change in the spigot jar ?
Some minecraft classes. The ones im putting in are the same functionally but contain a lot of println statements
i think you open the server.jar that you run with winrar, go into META-INF and edit the stuff you need to change there
Oh good one, I can just replace that jar in there
everytime the server.jar runs the data in bundler/ will get copied out of this jar
Hm, that doesnt quite do it
what exactly did you do ?
Actually, it might go wrong earlier in the chain ๐ค
monthly stats for minigames
i.e at the time I compile my customized classes
like on gommehd.net
so you have the data already and just wanne get the last 30 days ?
if you save your data with a timestamp just query with a limit of time then
no
For some reason, IntelliJ is compiling the wrong class in
and I dont know why ๐ค
did you check the output of the compiling ?
maybe it has a completly different mapping
Yeah, I checked
so I have a project open in intellij, with only the source of the things I want to change, so 1 file currently, then the spigot jar and all libraries added as libraries.
with the class I want to change removed from spigot
if you just added some print-lines you could edit the spigot jar in buildtools and get a clean one ^^
so I compile, and yet it still pulls in the wrong class ๐ค
๐ค elaborate on that further?
I need to edit specifically net.minecraft.server.commands.CommandLocateBiome
Why?
why
To add some debug statements to make NMS easier.
i.e with the information I can use that to correctly implement the NMS code in my own plugin
so you want a custom locate cmd ?
I don't see why you need debug in that command?
seems pretty expenditure just for a debug tbh..
Or if someone else has an idea, running into this: Missing key in ResourceKey[minecraft:root / minecraft:worldgen/configured_structure_feature]: ResourceKey[minecraft:root / minecraft:worldgen/biome], while calling d on iRegistry
essentially I need to get the BiomeBase of a minecraft:<biome name here>
when you run what ? .... do you try to add custom biomes ?
Nope, trying to replicate some behaviour from LocateBiome
so you got a Resourcekey of a biome and want to get the BiomeBase ?
what is your resourcekey ?
ResourceKey[minecraft:root / minecraft:worldgen/biome] is my resource key, then I am calling d with that resource key as argument, from there i can get the biome base using a MinecraftKey
what minecraftkey do you use ?
you could also print all resource keys that the biome has registered ?
minecraftKey doesnt matter just yet
it isnt getting that far yet ๐
but I might have just found the bug, I might just be poking the wrong iRegistry
this will print all biome-keys
Ill figure this out tomorrow I think, been at it for some hours now. Time for dinner :"D
Maven error cannot access net.minecraft.nbt.NBTTagCompound. Ideas? imported from local repo that generated using BuildTools. 1_18_R1
its no longer NBTTagCompound. Its somethign like CompoundTag
if not rempped
or if remapped...
But import is net.minecraft.nbt.NBTTagCompound ._.
not anymore
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.18-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
why do you import from local repo ?
Is there any public repo for NMS?
No
CompoundTag is mojang while NBTTagCompound is from spigot
<!--Bukkit/Spigot NMS -->
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>${project.spigotVersion}</version>
<classifier>remapped-mojang</classifier>
<scope>provided</scope>
</dependency>```
Spigot uses Mojang names now
Could not resolve dependencies for project me.DenBeKKer.ntdLuckyBlock:luckyblock-nms-v1_18_R1:jar:2.5.0: Could not find artifact org.spigotmc:spigot:jar:remapped-mojang:1.18-R0.1-SNAPSHOT
run buildtools with the flag --remapped
Schould i build a new jar using buildtools?
right
No it doesnt
How you code using CompaundTag and compile to NBTTagCompound?
they rename the classes from mojang -> obfuscated -> spigot but the class-var/method remain in obfuscated
Those are Mojang names
if you use maven its easy
Second image
CompoundTag yes,
NBTTagCompound not
Top one is old
Dont tell me that you are code unobfuscated and compile to obfuscated
top one is litterly the finished class spigot uses to run the server
For what version
same me...
1.18
CompoundTag is with what i code... after that maven remapps everything...
CompoundTag will then be NBTTagCompound
Thats what i do exactly
Do you have 1.18 method .setString ?
And does it compiled to .l?
yes (maybe did not test, but i know that methods and variables are obfuscated to abcdefg)
._____________.
How
I am always coding using abcdef
Finding this variables and using it
i did 2 days ago too ... maven is nice
made this small website for finding out what is the mojang name https://timcloud.ddns.net/mapping/
you use maven right ?
Yes, i have used Eclipse without maven for 4-5 years, but mojang decided to make same nms classes, so i switched to maven and intellij 2 days ago
this is my pom.xml ... somewhere in <plugins> is the remapping from mojang to spigot/obfuscated and also what dependencys you have to use
And what is your imports?
no imports... maven
how can i fix this?
did you change from smth to maven ?
it doesnt happen immediately
maybe connection problem ?
i cleaned my pom
and probably removed a spigot file ?
prob
how to disable fix-curing-zombie-villager-discount-exploit if there is no paper.yml folder?
if this config are only in paper then you cant remove this things in spigot or vanilla (?
do you use paper or spigot ?
how do i play an animation to someone. I want to play the totem anim as part of a command
paper.yml is not a folder
Spigot
its an YAML file
hmm yes
then there is no paper cfg
You need Paper for that option
i remember a method like playeffect for the totem and this use the item in your hand for this..
so how to disable it?
okay thank you
@fleet impyeah its ::.playEffect(EntityEffect.TOTEM_RESURRECT);
thx
It helped for NBTTagCompound, but now cannot access org.bukkit.craftbukkit.v1_18_R1.inventory.CraftItemStack XD
thats not NMS so would not be affected by mappings
Suggestions to fix?
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>craftbukkit</artifactId>
<version>1.18-R0.1-SNAPSHOT</version>
</dependency>
gives Could not find artifact org.bukkit:craftbukkit:jar:1.18-R0.1-SNAPSHOT
without it gives cannot access org.bukkit.craftbukkit.v1_18_R1.inventory.CraftItemStack
<dependencies>
<dependency>
<groupId>me.DenBeKKer.ntdLuckyBlock</groupId>
<artifactId>luckyblock-nms-interfaces</artifactId>
<version>2.5.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.18-R0.1-SNAPSHOT</version>
<classifier>remapped-mojang</classifier>
<scope>provided</scope>
</dependency>
</dependencies>
``` gives `cannot access org.bukkit.craftbukkit.v1_18_R1.inventory.CraftItemStack`
remove "remapped-mojang" if you dont want to remap again
its already in your spigot dependency
gives cannot access net.minecraft.nbt.NBTTagCompound
can you import CompoundTag ?
did you reload the pom ?
NBTTagCompound fixing with adding remapped-mojang. But it gives Could not find artifact org.bukkit:craftbukkit:jar:1.18-R0.1-SNAPSHOT as well
bruh no tabcomplete on console
try using this, but you will need to rewrite everything related to nms .... but you can then use methods with good names and not abcdfg
change yoru spigot-api to just spigot as you want access to the implementation too
of course you will need to change some names
It is not spigot-api now
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>luckyblock-nms</artifactId>
<groupId>me.DenBeKKer.ntdLuckyBlock</groupId>
<version>2.5.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>luckyblock-nms-v1_18_R1</artifactId>
<dependencies>
<dependency>
<groupId>me.DenBeKKer.ntdLuckyBlock</groupId>
<artifactId>luckyblock-nms-interfaces</artifactId>
<version>2.5.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.18-R0.1-SNAPSHOT</version>
<classifier>remapped-mojang</classifier>
<scope>provided</scope>
</dependency>
</dependencies>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
</properties>
</project>
how do i tab complete with materials?
you need both if you want to access both, spigot and a remapped spigot
add also spigot-api i think
^ but remove the -api
you want implementation aswell
spigot-api = Bukkit
spigot = CraftBukkit + Bukkit
thats why spigot is there too
cannot access net.minecraft.nbt.NBTTagCompound
I feel like I'll hang myself today
If you're using remapped you need to use CompoundNBT
did you reload the pom ?
Yes
<dependency>
<groupId>me.DenBeKKer.ntdLuckyBlock</groupId>
<artifactId>luckyblock-nms-interfaces</artifactId>
<version>2.5.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.18-R0.1-SNAPSHOT</version>
<classifier>remapped-mojang</classifier>
<scope>provided</scope>
</dependency>
</dependencies>
what is the java version of the project?
8
But i want plugin that will run on 1.8 - 1.18
Or do you mean adding java 17 only for this module
is it possible
How do you set where a jar is compiled by maven? For example if I just run maven it compiles it in the workplace folder under "target"
for some reason i can use 1.17 and 1.18 with java 8 on my modules
i don't know how i do that
I have added magic lines
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.4</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
<configuration>
<outputDirectory>E:\NTD Studios\plugins\ntdLuckyBlock\maven</outputDirectory>
</configuration>
</plugin>
idk what it means
something like building plugin i guess
NMS will only work for one version. You need one module per version or use reflection
so i just need <outputDirectory>
I am making per module NMS
Currently fighting with 1.18
In fact i have class using reflection that works great for 1.8 - 1.17
I just want make 1.18 support using nms
You can use reflection in 1.18 too
Because 1.18 version have another method names than 1.8 - 1.17
Yeah
instead of choosing the file in the code
i made a filechooser
and its current directory is set to where the file is so its easier
Its not a great solution you know
Reflection is slow
Yeah
Also i have already made all using NMS
Set Java version to 17
Couldnโt spigot easily return an entity from the #getKiller method on a player death event?
Not sure why it has to return a player exclusively
invalid target release: 17
Update maven
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.3.1</version>
<configuration>
<outputDirectory>my-target-dir</outputDirectory>
</configuration>
</plugin>
``` Added this and it worked.
not sure.. i think this method check the last damage from player only.. dont know if is a thing of vanilla or make by spigot
Intellij includes old maven
How to update
With all due respect itโs not that slow and itโs gonna get faster if a jep in jdk 18 gets through
Install maven manually instead of using the bundled version
Sounds kinda hard
how to send actionbar/title on 1.18?
Are you talking about IntelliJ plugin or installing it as a program outside from intellij?
properly
?jd
Search title or action bar
to be exact I meant it via packets, seems like sendPacket was removed from playerconnection?
Why would you use packets
I found an nms method from the nms player object that returns the killing entity like a year ago
So basically I know it would be stupid easy to implement Iโm just wondering if thereโs a weird design philosophy behind it
can i have two event listeners changing the outcome of the same event or am i supposed to put them into a single event listener
for NMS
Why would you use NMS
hmm not sure.. but you can open a ticket for request this (? o try make a PR for this
this takes like 2 seconds to respond to ;) please
you can... maybe you can use the priority in case of... like in lower make X and in high make H
for supporting older versions?
You said 1.18 though
yeah because I'm adding 1.18 compat
Outside of Intellij and then telling Intellij to use that install
and the reach for 1.17 doesn't seem to work anymore, that's why I asked for 1.18
hmm thanks mate
Why not use the API for versions that have it
It seems like you are using a module system
alos when it comes to the event priorities it is the lowest that executes first right?
Probably will
didnt help
i have installed latest maven as program and invalid target release: 17
Are you using Java 17 in your project
No
Then that's why
If i will use 17 my plugin wont run on 8
Tell maven to compile to Java 8
So i can set project version 17 and tell maven 8? And plugin will work on 8 - 17 java?
Yes
Ok, i will try
Great, i have changed java version to 17 and now intellij says that class Object is missed
Is it still indexing
you messed up with smth big ๐
wait i will try corretto java 17
cannot find symbol
great exception indeed
There is no exceptions in code
Ideas? Line 7 cannot find symbol. But there is no exception
no it wasnt
just got obfuscated
ok
You can easily send titles and action bar messages to players on 1.18
player.spigot().sendMessage
There's one that allows you to send the action bar, and you can just use Player#sendTitle for titles
EntityPlayer.b.a(packet)
Why not use remapped
Ok but why
;/
Why use packets at all for that when it is officially supported in the api
have you been considered
Plugin not loading on server startup
Can I store a class in a persistentdatacontainer or just primitives and strings ?
does anyone here know how to code forge
i have a simple question so u dont have to be an expert
Oh, Im seeing I can convert it to a byte array, lemme check that out
lets reinvent forge
how to force a player to right click
hack its mouse
ur not funny either ๐ญ
KeyBinding.onTick(Minecraft.getMinecraft().gameSettings.keyBindUseItem.getKeyCode()); as it seems
oh
but i just copy&pasted it from the first google result
so it might be wrong
it prob is
lool
PlayerControllerMP then probably
yeah but with that you can fire it
as this should do
cant you just call an event?
i mean it doesn't makes sense for me since its not really describing what its doing but anyways
first guess would be that this method will perform this keybind every tick
second guess it performs this keybind on the next tick
o
hey you cant use locations in onenable right?
i mean if the world isnt loaded
should I put it into onEnable method?
are you even getting a world that exists?
i would add a null check
how can i make clickable text that makes u execute a command
either use this or a textcomponent
https://github.com/FourteenBrush/MagmaBuildNetwork/blob/aafb5787835b4cdc8a65cc8a0b8cf2db572748b2/src/main/java/io/github/FourteenBrush/MagmaBuildNetwork/commands/CommandHome.java#L155
whoa
how can i make clickable text that makes u execute a command?
where
.
hehe, I might need someone to quickly explain how to serialize a class or rather give me a site to learn how to, cause Im getting nowhere here with what Im finding
is that built in spigot
when was it added
?
net.md_5.bungee.api.chat.ComponentBuilder;
Stop using 1.8 anyways
nah
Hahahahahaha
Hahahahahaha
jokes aside my kitten cries everytime when someone uses 1.8
So if jokes are aside, what would this be called? A pun?
I wish maven had legitimate reasons to not work instead of me just doing the same thing a bunch of times and it finally deciding to just work.
SG is out now: https://DjSnake.lnk.to/SnakeOzunaMeganLisa
Follow DJ Snake:
https://instagram.com/djsnake
https://tiktok.com/@djsnake
https://twitter.com/djsnake
https://facebook.com/djsnake.fr
https://djsnake.com/
Follow Ozuna:
https://www.instagram.com/ozuna/
https://www.facebook.com/ozunapr
https://twitter.com/ozunapr
Follow Megan Thee ...
oh development channel
anyways
I have source to a long abandoned plugin. It does not contain gradle or pom file and readme is not helpful.
How would I go about compiling it, just create a pom file, guess the dependencies and hope for the best?
How I can check if an item have efficiency 4?
i think theres a getEnchants
Could I use an enum to refer to a specific class ?
Cause it seems that enums can have values attached to them, like bools and similar, but can I do the same with classes ?
but how would it look like, thats what Im failing at, cause I've seen the constructors and such (didnt know about the abstract, that might be useful, but Im not planning on doing alot with enums)
what does adding final before the event name in @EventHandler do
I have the following rn, which makes sense in my head, but doesnt seem to work
public enum CustomMobEnum {
DesertSpider {
@Override
public Class returnMobClass() {
return com.Conorsmine.net.Entities.CustomMobs.DesertSpider;
}
}
public abstract Class returnMobClass();
}
I was missing a ";" ffs, also it's being a annoying with the class
anyone knows?
you won't be able to assign a different value to the variable
@EventHandler
public void on(final PlayerDeathEvent event) {
event = new MyOtherEvent(); // Will not work
}
oh
means that you can't reassign it
forgot the ".class"
sure that works
you might find DesertSpider(DesertSpider.class) with a CustomMobEnum(Class) constructor less verbose though
oh yeah, I can do that now
Id assume something like this:
public enum CustomMobEnum {
Desert_Spider(DesertSpider.class);
private final Class entClass;
private CustomMobEnum(Class type) {
this.entClass = type;
}
public Class getMobClass() {
return entClass;
}
}
yes
๐
Raw types ๐ซ
shhhh
Hey guys! I'm really new to maps, my first day of properly using them. I've been trying to use hashmaps from my main class in listeners, but when i add them like this:
MainJava mainplugin = new MainJava();
.. and then utilize my functions of the hashmap
it gives me the java.lang.IllegalArgumentException: Plugin already initialized! error, that's not the way to do it. How would i go about including a hashmap from my main class into my listeners?
Heyo, what happened to ((CraftPlayer) target).getHandle().b.sendPacket(... in 1.18?
I search for the PlayerConnection, which was labeled b in 1.17.
why does spigot decide to teleport me back after a couple of seconds when I teleport the player to a different world than the default one when I join?
i'm trying to block the command /yo
public void onPlayerCommand(PlayerCommandPreprocessEvent event) {
if(event.getMessage().equals("yo")) event.setCancelled(true);
}```
not working
i tried = as well
i think you cant cancel command events
nevermind me xD
when is that code triggered?
wait so you created a command called /yo
...
or is it an external command? xD
i'm trying to block a command
registered the event in main class?
yeah
maybe use PlayerCommandPreprocessEvent
and @EventHandler(priority = EventPriority.LOWEST)
Why dont you all read the javadocs...
All commands begin with a special character; implementations do not consider the first character when executing the content.
You forgot the /
yo -> /yo
incompetence on my side, sorry about that!
title:
- |
i:
==:org.bukkit.inventory.ItemStack
v: 2230
type:
If I wanted Light blue dye, what would I do? because light blue dye simply just falls under minecraft:dye
God I hate when spigot deprecates methods, then deprecates the methods that are suppose to be used.
SkullMeta.setOwner("MHF_ArrowUp") - deprecated.
SkullMeta.setOwningPlayer(OfflinePlayer) -> OfflinePlayer = Bukkit.getOfflinePlayer("MHF_ArrowUp") - deprecated.
All because spigot 1.18 doesn't load player skulls in the hand of an armorstand ๐คฆ
All because spigot 1.18 doesn't load player skulls in the hand of an armorstand ๐คฆ
does vanilla?
have you made a bug report?
or are you just being unhelpful as per usual
Any ideas...? I am kind of an idiot and google simply doesnt like light blue dye
what are you trying to do
Its a custom fishing thing
How to use an anvil without wasting experience?
thing?
in 1.13+ it doesnt
I just needa know how to refer to a light blue dye
it would just be light_blue_dye
md_5
Yes, but that didnt work. White for example: COOKED_BEEF Did
While*
is 2230 a current version
no I dont think so
did you define api-version in plugin.yml
Gotta figure out how to spawn what I need to test in vanilla lol
if in doubt just set the itemstack with code and see what the result is
How do I know the bukkit version I'm running
declaration: package: org.bukkit.inventory, class: InventoryView, enum: Property
Because I'm following a sort of tutorial but only kind of, that was for a different thing
if in doubt just set the itemstack with code and see what the result is
nvm I found it
Ty
How would I get block dig block protocollib?
I can't get the skull to to be in the armorstands hand
/summon minecraft:armor_stand ~0 ~0 ~0 {ShowArms:1,HandItems:[{id:player_head,tag:{SkullOwner:yapperyapps}},{}]}
Off topic... Wondering traders go invis at night lol
i need some help with recipes
for example, i hava a crafting table recipe
and i want to build a lore with the required items
as we know, the recipe accepts any wood
so the lore must display
- 4x Woods
check RecipeChoice.MultipleChoice or whatever
It's for fake clientside blocks though
I do not want them to disappear
once they have been destroyed
oh, tags arent persisted into MaterialChoice
๐
i remember that in old versions the RecipeChoice.getItemStack returned an ItemStack with a specific durability
it still returns that
but i would like to it work with custom recipes too
so in case of a choice that accepts 1 sappling or 1 wool wouldnt be cool to display only the sappling in the lore
edited the code (https://paste.md-5.net/keyilumofi.php)
now the result is that
as i said, i would like x4 Wood Planks
anyone know a way to have a different text on each client in the scoreboard?
Hello I'm trying to find a way to remove the villager I'm trading with when I close the inventory but I can't find any remove method, could you help me? Here's what I've got so far: ``` @EventHandler
public void onInventoryClose(final InventoryCloseEvent event) {
if (event.getInventory().getType() == InventoryType.MERCHANT && event.getPlayer().hasMetadata("Trading")) {
MerchantInventory inventory = (MerchantInventory) event.getInventory();
inventory.getMerchant().
}
}```
isnt there literally .remove
declaration: package: org.bukkit.entity, interface: Entity
will need to cast merchant
Oh yes, thanks!
does anyone know how to work with protocollib
Oh so you wanna spawn armorstands clientside?
One message removed from a suspended account.
English only
One message removed from a suspended account.
Well I never used plib, I would just use some API which lets you do that
Try searching on forums
Spawning armorstand client side
I mean plib is an API for that
Heyoo, I've seen GUIs with items that changes text over time while the gui is active. Is that the GUI itself changing with the item meta changing or does it control the items while it's active?
they probably store the inventory instance and set slots
Ah yea that sounds like a better way. Cheers!
np
i'm tryna do animations with armorstand and i have decided to use packets to make it less heavy on the server, but when the player gets too far the armorstand obviously disappears. How can I make it spawn back?
@brittle loom You should be able to do something along this as well if you dont want to have to get the inventory first.
@EventHandler
public void onInventoryClose(final InventoryCloseEvent event) {
if (event.getInventory().getType() == InventoryType.MERCHANT && event.getPlayer().hasMetadata("Trading")) {
((Entity)event.getInventory().getHolder()).remove();
}
}
@misty current the armor stand doesn't "despawn." At it is an entity you would need to potentially adjust the render distance on the client and/or entity ranges in the server config.
since it's an entity spawned in with packets i know it's normal that it disappears when a player gets too far
i was asking how can i detect when the player is close enough to it so i can respawn it
getPlayer().getLocation().distance({Location of ArmorStand})
Any idea how to change player name in 1.17.1? This approach is no longer working;/
@gleaming grove have you looked into .setDisplayName() and/or .setPlayerListName()?
setDisplayName is not working for some reason
anyone got any idea how i can change a biome client sided
using nms ofc
I want to trick the client into making it snow
instead of rain
@gleaming grove i just tried both and they seemed to work on 1.18 for both List and Chat. not on tab complete though.
Listen for the outgoing chunk packet and change the biome id
if (!globalDataFile.exists()) {
globalDataFile.mkdir();
try {
globalDataFile.createNewFile();
} catch (IOException exception) {
exception.printStackTrace();
}
}```
why does this create a folder
not a yml file
globalDataFile.mkdir(); <-- .mkdir()
how do i fix it
@primal kite I have managed to changed name like this ๐
anyway thanks for help
@gleaming grove thumbs up emoji. i avoid NMS if there are other ways.
should i remove that line?
Yeah but if it contains efficiency 4?
getEnchants() will only work if the enchant are just eff4 and if it is for example eff4 and umbreaking 1 the if statement won't work?
I mean if contains the enchant
?
@primal kite yea this is good practice, but since 1.17 mojang will not longer set java packages names with minecraft version
here is example
That wasnโt Mojang, that was spigot
@peak granite you have to check and create the datafolder first. then the file.
@gleaming groveI would still stick to the spigot provided ".set" and then override the tabCompletionEvent for player names. Seems a little cleaner, easier to follow code, and less likely to break between versions.
Cant remember if this is a javascript thing or not, but can you have 2 different switch values do one thing by doing this in java?
this works in any language i know that has a switch statement
oh wtf! It works without inner braces holy crud were evolving now boys
Yeah i just wasnt sure if it was a javascript only thing as java syntax's are more strict that JavaScripts
How do I make a plugin that adds an armor set
nvm i forgot pom.xml java versions existed
Ive been doing java for 3+ years now, and i never knew this about switch statements lmfao, thats so cool
You would need to make some type of loop that continuisly checks if a player is wearing a set of armor
Or listen to when the player puts armor on, and then handle it there, and when the player removes it remove the effects
the forbidden discord lag? just me
Not helpful I want to make my own armor
Like, with your own custom effects and whatnot? material, textures etc
Yes
Textures arent possible without using Optifine to render the 3d models (They will however render just the item icon without it, they just wont show the custom texture when worn)
Material would rely on texture so you would force a resource pack and the material basically == the texture of that armor set
From there you would need to edit the armor set to have any modifiers and effects you need
You can edit the item texture just using CustomModelData
texture = dataPack/resourcePack.
effect = recipies/coding changes
I heave heard of custom armor models without optifine, I think it has something to do with core shaders
I know Customitems works when you have optifine for CustomModelData
Idk if any plugins exist that dont require optifine to render armor models
i did plenty of custom items without optifine using resourcepacks and setting server.properties
Yes but that was likely just for the actual item stack like this huh ?
You can do custom blocks and custom ItemStack textures without optifine, unless theyre is something with core shaders that can be done
both the item stack AND the rendered item on the player.
armor can be done with some interesting effects. helmets and held items are easy. other armor i would be replacing certain "dyed leather" with my custom textures
You can't replace the model of dyed leather with a texture pack
you can if you intercept the packet
isnt the color for leather armor changed at runtime?
Yes
This has nothing to do with packets
so telling the client what to render on a screen has nothing to do with the packets that are sent from the server?
Yes?
Because rendering is all client side
You can tell the client the player is wearing something they aren't but that still doesn't help you
yes, but if the client has a texture, from something like a texture pack, then the server can say that "this" is what the client should see. it is the same concept as what optifine is using.
do we have a way to force javac to compile even with errors
w h y
.
oh
you really have no idea what youre doing do you
i think...?
Yes but that does not apply to armor models
i dont even need to use deobfuscator
You can only have 1 armor model per item, CustomModelData doesn't work for that
i just use the deobfuscated and using some searching technique to find the class containing the c00handshake
๐
@young knoll you are right, at least from my attempts a few years ago. I just checked my code and I was using a lot of messed up stuff with armor stands and packets to get chestplate, leggings, and boots to look like they where on the player. the helmets and items held in hand though where still straight out of resource packs.
i only changed the obfuscated java file which is bdg (C00Handshake) from 47 to 477
you think the only thing that changed in over 400 versions is 1 number?
no...?
Are you telling me ViaVersion does more than just change a number?
by disconnecting you with an error
How long does cursefprge take to approve its been 3 days
Ask them?
why would you ask this on the spigot server
Cuz thats where people publish there plugins
Most people publish to spigotmc
lol
hey guys we just started programming spigot in the new 1.18 with eclipse do you guys know how i can solve this important issue
Spigot has a place where you can publish?
have you even been to the spigot website
Yes
Oh then uh lemme chack again
make sure you imported the spigot api...
you can check here for more info https://www.spigotmc.org/wiki/spigot-plugin-development/
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
Did you add the spigot api to build path
yes we imported the api and applied it to he build path however may it be an issue with eclipse?
no its an issue with your config
you need to import the API, you cant just import the server jar
so the API is seperate now from the server jar?
always has been
i have general question: since 1.18 has come out me and my team are trying to create plugins with spigot on eclipse, is this doable?
yes of course
Edit: 1.18 release is now available.
Dear All
As we mark the 9-year anniversary of SpigotMC.org, it is my pleasure to announce that...
Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or use a dependency manager such as Maven or Gradle to handle this automatically.
you need to depend on spigot-api not spigot
thank you so much for this
my team are programmers however I am also interested in creating some plugins
i guess my question would be where I can get some help to learn the setup and some basics overall
its the same as every other version if you were doing things properly
your answers here apply to this post right? https://www.spigotmc.org/threads/eclipse-add-spigot-1-18-as-external-jar-doesnt-work.536517/
Yes
so where would I find this l spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar
Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or use a dependency manager such as Maven or Gradle to handle this automatically.
Currently trying to use the nice new pattern matching with instanceof feature from Java 16, in Java 17. I get this error when trying to build my plugin with Maven:
pattern matching in instanceof is not supported in -source 8
I cannot figure out a fix for the life of me. I'm using Intellij, and everywhere I look my language level/sdk is set to 17, including maven targets and everywhere else. Any ideas?
I had a similar issue to you earlier, but i fixed it by changing my compiler plugins java version, but seems you already tried that
I didnt even have java 8 installed and it gave me a similar issue to yours
I tried switching it from 17 to 16, I'll try it again I suppose
?paste your pom
Ah, nevermind, didn't look thorough enough.
Karma for copying and pasting my compiler plugin from previous plugins, I forgot to change the source & target versions here in the </plugins> area.
<configuration>
<source>17</source>
<target>17</target>
</configuration>
Does anyone know how to change the Server Branding the F3 screen? I know there is a plugin called F3Name that does it, but i've been looking through their source code and can't find anything (or I may of skimmed past it).
it just sends a packet
Thanks! i'll take a look
debug
Does GSON support reading and writing Enums like this, or should i just store the enum as string and parse it when its needed?
Try and see?
Hello i need help with my plugin who can help
Wont be able to for a bit, still writing a bunch of stuff before i test this
I know GSON can parse other class instances that are in the Object being serialized, just not sure about enum values
ill be able to try it in a bit
sup?
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Create a thread in case the help channel you are using is already in use!
I coded my plugin to say in chat when i type /gravity but i want it to teleport too
you can teleport players using Player#teleport
https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/entity/Entity.html#teleport(org.bukkit.Location)
declaration: package: org.bukkit.entity, interface: Entity
well at the place where you want to execute it of course
so if it's a command, in your command executor
when you have a player called "player" you can do
player.teleport(someLocation);
No i want @a
then you have to loop over all online players
and teleport them all individually
something like this:
for (final Player player : Bukkit.getOnlinePlayers()) {
player.teleport(yourDestination);
}
Ok thanks i will screenshot my code later and tell me where i put it ok?
didn't you say you already print a message when running the command?
you will probably want to put it there
Next to the message?
well if you really don't know that may I suggest that you learn some more java beforehand
I use eclipes
you'll have a hard time in doing plugins when you don't understand basic stuff like "where do I have to put my code?"
Ok
?learnjava here's some decent tutorials ๐
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
But can u teach me to where to put it
Ok thanks
np
btw where do you want to teleport the players to?
World.getHIghestBLockAt
oh you already removed your message lol
declaration: package: org.bukkit, interface: World
there's also some methods that use Location instead of int x, int z ๐
nice
if you just need the Y coordinate: getHighestBlockYAt exists too
Any workaround for method names colliding when using remapped NMS resulting in obfuscated names after specialsource remaps it? Or am I stuck just renaming the ones that override remapped NMS so they no longer override
what exactly do you mean? do you get any error when overriding methods using the mojang mappings?
or are you talking about custom classes that you wrote that extend already existing NMS classes, and now your once unique names get renamed by accident too?
Any method they have that matches mojmap seems to get reobfusicated
Which makes complete sense.. I'd want it to do that except when im overriding an interface for an API which then my overridden interface method no longer exists ๐
Yeah thatโs actually a difficult issue
Itโs actually why you sometimes see a random interface in MC isnโt obfuscated
Thereโs no good way to solve it
Yeah only way I could think of is it check for an annotation but not sure how easy that is with my quick glance of specialsource from last night
Maybe you could make specialsource generate a trampoline if a method appears in two hierachies ๐
Prolly a lot of work though
No cause then you wouldnโt override the nms method
You need a trampoline method
What I want is to not override the NMS method in my case
Oh well thatโs easy
My example is Mob#setBaby exists in mojang mapped but I have my own setBaby. Since it overrides specialsource remaps it 'incorrectly'
But your setBaby is in a subclass of mob
So its overriding even before the remap process
Thatโs an issue with your code
can I be your baby md5?
The only way SS could cause an issue in that context is if your api used one or two letter method names
Well it wasn't overriding with spigot naming, only became an issue with mojang map > spigot
Yes but that was just luck
It's kind of an unlucky situation and I don't really expect a workaround to exist but I'd just like to avoid renaming setBaby
Decouple the API implementation from the NMS implementation
Ie wrappers, like what spigot does
ohyeah guess I forgot about that workaround
I can definitely swap around what interfaces I call and extend
Spigot is basically a Crunchwrap Supreme
Probably something I have to do anyway for more future changes I want. I also somehow forgot about it even though i remember thinking about changing up my interface setup as a solution
whats the event for clicking on an item in the inventory?
how can i get the meta of the item clicked from the event?
i tried event.getCursor().getItemMeta() but it gave null
InventoryClickEvent#getCurrentItem#getItemMeta
is there a way that i can detect when an item is enchanted?
EnchantItemEvent doesnt work for me when it is outside of the enchantment table (which is what the docs say)
woah spigot ainโt shit
Still building it
Also
Is the code u send coordinates?
I need coordinates
I have an event ClanChatMessageEvent, which is called once a player does /clan chat and types a message, I use this event in another plugin which uses JDA and checks when that event is run (It is definitely being triggered), but it does not seem to work, no error has been popping up.
WifeBot plugin;
public ClanChatEvent(WifeBot inst){
this.plugin = inst;
}
@EventHandler
public void onClanChat(ClanChatMessageEvent event){
Player player = event.getSender();
String content = event.getContent();
String clanName =event.getClanName();
plugin.getWifeBot().sendMessage("916711450733596782", "**(" + clanName + ") " + player.getName() + ": " + content + "**");
}```
```h
private JDA jda;
private String token;
public DiscordBot(String token){
this.token = token;
}
public void connect(){
try {
jda = JDABuilder.createDefault(token)
.build()
.awaitReady();
}catch (LoginException | InterruptedException e){
e.printStackTrace();
}
}
public void sendMessage(String channelID, String message){
TextChannel textChannel = jda.getTextChannelById(channelID);
textChannel.sendMessage(message).queue();
}
public void sendEmbed(String channelID, EmbedBuilder embedBuilder){
TextChannel textChannel = jda.getTextChannelById(channelID);
textChannel.sendMessage(embedBuilder.build()).queue();
}
}```
ClanChatMessageEvent is being triggered but nothing is happening when I try to do something with it.
๐ Make debug messages ๐
See where it gets stuck
?
do u know how to teleport people to a coordinat
Thanks Efinfxch_Finn, Olivo, yapperyapps, FreeSoccerHDX, ElgarL for helping, i got it to work.
But now i have a small trouble. I have used remapped dependence
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.18-R0.1-SNAPSHOT</version>
<classifier>remapped-mojang</classifier>
<scope>provided</scope>
</dependency>
``` and now compiled jar contains incorrect nms classes. (`net.minecraft.nbt.CompoundTag`)
I have added
<plugin>
<groupId>net.md-5</groupId>
<artifactId>specialsource-maven-plugin</artifactId>
<version>1.2.2</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>remap</goal>
</goals>
<id>remap-obf</id>
<configuration>
<srgIn>org.spigotmc:minecraft-server:1.18-R0.1-SNAPSHOT:txt:maps-mojang</srgIn>
<reverse>true</reverse>
<remappedDependencies>org.spigotmc:spigot:1.18-R0.1-SNAPSHOT:jar:remapped-mojang</remappedDependencies>
<remappedArtifactAttached>true</remappedArtifactAttached>
<remappedClassifierName>remapped-obf</remappedClassifierName>
</configuration>
</execution>
<execution>
<goals>
<goal>remap</goal>
</goals>
<id>remap-spigot</id>
<configuration>
<inputFile>${project.build.directory}/${project.build.finalName}-shaded.jar</inputFile>
<srgIn>org.spigotmc:minecraft-server:1.18-R0.1-SNAPSHOT:csrg:maps-spigot</srgIn>
<remappedDependencies>org.spigotmc:spigot:1.18-R0.1-SNAPSHOT:jar:remapped-obf</remappedDependencies>
<outputDirectory>...</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
``` trying to fix that (Like FreeSoccerHDX build configuration)
and getting `Failed to create remapped artifact, project main artifact does not exist.`
@spiral light ideas?
Contact me privat I will take a look at it later if you want and still need help
how do u do it inside box @lapis lark
I cannot dm you or send friend request, please dm me first or add me as a friend
wdym?
abcde
Is there any clear example using specialsource-maven-plugin or a thread with fixing Failed to create remapped artifact, project main artifact does not exist.?
How project main artifact does not exist could happen, if without specialsource-maven-plugin all works
?
With what
Bukkit.getOnlinePlayers().forEach(n -> n.teleport(location));```
Is that coordinates
yes a Location object is for coordinates
Location location = new Location(world, x, y, z);
In place where you want to run your code ._.
Bukkit.getOnlinePlayers().forEach(n -> n.teleport(world, 821 32 917));```
Is it like that
Location loc = new Location(world, 821, 32, 917);
Bukkit.getOnlinePlayers().forEach(p -> p.teleport(loc));``` more like this
u need commas between the parameters (the world and the x y z) in Location
So i just copy this and put it in my code?
u could, maybe
Also @a?
Thanks for renaming variable from n to p and location to loc. It better now indeed
n to p makes sense, loc because im lazy and didnt want to type location
lol
I am always using n for predicates
