#help-development

1 messages ยท Page 1806 of 1

vale ember
#

describe what you need to be done via spigot?

vagrant edge
#

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
slim cairn
vale ember
#

then you need to use worldguard api, also add it as dependecy in plugin.yml

slim cairn
#

their site doesnt explain it

brisk estuary
#
@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?

vale ember
slim cairn
#

Ye thats the site im at

vale ember
#

^ should answer your questions

slim cairn
#

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.

slim cairn
#

sk89q

vale ember
#

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

brisk estuary
#

should i use equals or == to compare pdc's?

#

equals right?

vale ember
#

yes

slim cairn
noble lantern
#

Issue

#

If you use .equals you will get a NPE if that pdt is null

vale ember
slim cairn
vale ember
eternal oxide
#

root = same level as the src folder

slim cairn
#

Its giving me an error in pom.xml

vale ember
#

just reload maven

pastel arrow
#

`
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?

vale ember
#

there's button in top-right corner when you open pom.xml

stone sinew
slim cairn
vale ember
slim cairn
vale ember
#

can you send screenshot of full ide window

slim cairn
atomic violet
#

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)});

eternal oxide
eternal oxide
#

add colour to the string, but parse it if you use &

#

or correctly use ChatColor.

atomic violet
#

ohhh so in the "blah" like comma and then color?

eternal oxide
#

ChatColor.RED + "blah"

atomic violet
#

ah okay thanks

peak granite
#

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

atomic violet
peak granite
#

yeah

#

playEffect is in 1.8

spiral light
#

and what is the error ?

peak granite
#

(target.getLocation(), Effect.CRIT, Integer.MAX_VALUE, 0.5F, 0.5F, 0.5F); is underlined

spiral light
#

effect class ?

slim cairn
peak granite
#

Cannot resolve method 'playEffect(org.bukkit.Location, org.bukkit.Effect, int, float, float, float)'

vale ember
spiral light
lunar schooner
#

Hi folks, where can I find a Spigot jar which has been remapped with the obfuscation maps?

peak granite
#

no

whole nebula
#

Hello, I am looking for how to call one function from another. I was wondering if you have any advice for me?

lunar schooner
#

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 ๐Ÿ˜…

peak granite
#

myFunction();

peak granite
peak granite
#

what

spiral light
#

@peak granite

atomic violet
#
            CompassMeta compass = (CompassMeta) item.getItemMeta();
            compass.setDisplayName(Color.RED + "Teleportation Menu");
            item.setItemMeta(compass);```
whole nebula
peak granite
atomic violet
spiral light
# peak granite yeah?

there is no (target.getLocation(), Effect.CRIT, Integer.MAX_VALUE, 0.5F, 0.5F, 0.5F)

eternal oxide
spiral light
#

effect or particle ?

peak granite
#

particle

#

to a specific player

#

only hem

#

them

gritty urchin
#

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

peak granite
#

no one else can see

vale ember
spiral light
atomic violet
slim cairn
atomic violet
#

specificlly the item. are red

slim cairn
#

oh wait nvm

#

its just my worldguard version

eternal oxide
peak granite
spiral light
#

update to 1.18

peak granite
#

no

visual tide
#

use particlelib if youre forced to use 1.8

atomic violet
eternal oxide
#

instead

atomic violet
#

okay thanks

slim cairn
#

Okay the errors are gone, now what?

grim ice
#

if u dont use any of CompassMeta stuff

eternal oxide
#

habit

#

and good to teach teh correct use

ancient plank
#

you're a compass

#

guide my way

lapis lark
#

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>
eternal oxide
slim cairn
atomic violet
#

im trying to send a photo cause its saying theres stuff wrong, do i need a role or something to send them?

left swift
#

how can I add value to String list to config?

tardy delta
#

i can upload a file

eternal oxide
#

!verify

undone axleBOT
#

Usage: !verify <forums username>

eternal oxide
#

to upload

atomic violet
#

what does it mean by forums unser

#

user

lapis lark
atomic violet
#

like a spigot account user?

eternal oxide
#

your spigot forum account name

finite brook
#

Is it possible to change a shields design via ItemMeta?

eternal oxide
left swift
finite brook
#

Can I get the shields bannermeta?

atomic violet
#

how long do i have to wait before the server recognizes my new account

rough basin
#

What should I use to have an event trigger when an Entity receives Suffocation Damage?
Like zombie stuck in stone blocks bruh

lapis lark
eternal oxide
undone axleBOT
atomic violet
#

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?

misty current
#

does vault not have a method to set a player's balance

eternal oxide
hushed hedge
misty current
#

yea i know but

#

it can withdraw and deposit

lapis lark
#

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>
misty current
#

but not set

whole nebula
#

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.

lapis lark
# hushed hedge

.addItem(new ItemStack[] { new ItemStack(Material.DIAMOND_SWORD) });

#

You are creating ItemStack array, not Material array

mighty pier
#

p.playSound(p.getLocation(), 1, 1, 1); i have no idea how to use playSound

mighty pier
#

oh i think ik what im doing wrong

opal juniper
#

assumingp is a plater

mighty pier
#

yes

rancid hare
#
            ((CraftPlayer) target).getHandle().b.sendPacket(packet);

Why is the PacketPlayOutGamesTateChange packet not WORKING anymore in 1.18?????
WTF

finite brook
#

How can you set a player_head itemstack to a certain skin?

lunar schooner
#

its now called a()

pastel arrow
#

how do i make it so, that i can "turn on/off the listener" ?

lunar schooner
# lunar schooner its now called a()

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 });
rancid hare
#

Why is thgere nmo CraftPlayer????

#

How do I get the connection

#

And why do they make those fucking packet thing EVERY UPDATE more complicated?

ivory sleet
#

Wut

rancid hare
#

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?
#

It is so fucking complicated now wtf

stone sinew
tardy delta
#

saving an inventory to base64 goes brr

finite brook
#

noice

stone sinew
tardy delta
#

i dunno

fleet imp
#

I have a command and I need to convert an argument to Player. How tho

tardy delta
#

maybe it havent reached it

eternal oxide
fleet imp
tardy delta
#

based on the name, so args[x]

stone sinew
rancid hare
fleet imp
tardy delta
#

smh

#

Bukkit.getPlayer(string)

fleet imp
tardy delta
#

no worries

stone sinew
rancid hare
#

Yeah but if I switch to Maven I cannot send Packets

spiral light
rancid hare
#

Yeah but with that stupid ProtocolLib

spiral light
#

no

finite brook
#

Ok, I have a
(PlayerHeadMeta) ItemStack(Material.PLAYER_HEAD).getItemMeta, how can you set the head skin?

fleet imp
#

How do i set a player attribute

rancid hare
#

Hm

spiral light
fleet imp
#

thx

#

if I were to set GENERIC_MAX_HEALTH, 2 would be a full heart, right?

spiral light
#

y

fleet imp
#

for a command im making

left swift
#

how can I put the value in string list in config?

echo hound
#

How can i do monthly stats

spiral light
spiral light
left swift
#

and to refresh it on a current basis, what can I do? adding a value for example

lunar schooner
#

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

lunar schooner
#

Which one? I'm currently replacing .class files in bundler/version/spigot-1.18-R0.1-SNAPSHOT.jar

tardy delta
#

๐Ÿง

spiral light
#

what do you want to change in the spigot jar ?

lunar schooner
#

Some minecraft classes. The ones im putting in are the same functionally but contain a lot of println statements

spiral light
#

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

lunar schooner
#

Oh good one, I can just replace that jar in there

spiral light
#

everytime the server.jar runs the data in bundler/ will get copied out of this jar

lunar schooner
#

Hm, that doesnt quite do it

spiral light
#

what exactly did you do ?

lunar schooner
#

Actually, it might go wrong earlier in the chain ๐Ÿค”

echo hound
lunar schooner
#

i.e at the time I compile my customized classes

echo hound
spiral light
echo hound
#

sql

#

yea

spiral light
#

if you save your data with a timestamp just query with a limit of time then

echo hound
#

no

lunar schooner
#

For some reason, IntelliJ is compiling the wrong class in

#

and I dont know why ๐Ÿค”

spiral light
#

did you check the output of the compiling ?
maybe it has a completly different mapping

lunar schooner
#

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

spiral light
#

if you just added some print-lines you could edit the spigot jar in buildtools and get a clean one ^^

lunar schooner
#

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

chrome beacon
#

Why?

spiral light
#

why

lunar schooner
#

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

spiral light
#

so you want a custom locate cmd ?

chrome beacon
#

I don't see why you need debug in that command?

spiral light
lunar schooner
#

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>

spiral light
lunar schooner
#

Nope, trying to replicate some behaviour from LocateBiome

spiral light
#

so you got a Resourcekey of a biome and want to get the BiomeBase ?
what is your resourcekey ?

lunar schooner
#

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

spiral light
#

what minecraftkey do you use ?

#

you could also print all resource keys that the biome has registered ?

lunar schooner
#

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

spiral light
#

this will print all biome-keys

lunar schooner
#

Ill figure this out tomorrow I think, been at it for some hours now. Time for dinner :"D

lapis lark
#

Maven error cannot access net.minecraft.nbt.NBTTagCompound. Ideas? imported from local repo that generated using BuildTools. 1_18_R1

eternal oxide
#

its no longer NBTTagCompound. Its somethign like CompoundTag

spiral light
#

or if remapped...

lapis lark
#

But import is net.minecraft.nbt.NBTTagCompound ._.

eternal oxide
#

not anymore

lapis lark
#
        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot</artifactId>
            <version>1.18-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
spiral light
#

why do you import from local repo ?

lapis lark
#

Is there any public repo for NMS?

chrome beacon
#

No

spiral light
eternal oxide
#
        <!--Bukkit/Spigot NMS -->
        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot</artifactId>
            <version>${project.spigotVersion}</version>
            <classifier>remapped-mojang</classifier>
            <scope>provided</scope>
        </dependency>```
chrome beacon
lapis lark
eternal oxide
#

run buildtools with the flag --remapped

lapis lark
#

Schould i build a new jar using buildtools?

lapis lark
spiral light
lapis lark
#

How you code using CompaundTag and compile to NBTTagCompound?

spiral light
#

they rename the classes from mojang -> obfuscated -> spigot but the class-var/method remain in obfuscated

chrome beacon
spiral light
chrome beacon
spiral light
chrome beacon
#

Top one is old

lapis lark
#

Dont tell me that you are code unobfuscated and compile to obfuscated

spiral light
#

top one is litterly the finished class spigot uses to run the server

lapis lark
#

I am really noob at maven

#

Started using only 2 days ago

spiral light
spiral light
spiral light
#

CompoundTag is with what i code... after that maven remapps everything...
CompoundTag will then be NBTTagCompound

quaint mantle
#

Thats what i do exactly

lapis lark
#

And does it compiled to .l?

spiral light
#

yes (maybe did not test, but i know that methods and variables are obfuscated to abcdefg)

lapis lark
#

._____________.

#

How

#

I am always coding using abcdef

#

Finding this variables and using it

spiral light
#

i did 2 days ago too ... maven is nice

lapis lark
#

How come on

#

What did you imported

spiral light
spiral light
lapis lark
#

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

spiral light
#

this is my pom.xml ... somewhere in <plugins> is the remapping from mojang to spigot/obfuscated and also what dependencys you have to use

lapis lark
#

And what is your imports?

spiral light
#

no imports... maven

tardy delta
#

how can i fix this?

mortal hare
#

is this a problem in 1.17

#

it kicks me out of the server, after some time

spiral light
mortal hare
#

it doesnt happen immediately

spiral light
mortal hare
tardy delta
#

i cleaned my pom

spiral light
#

and probably removed a spigot file ?

tardy delta
#

prob

high grotto
#

how to disable fix-curing-zombie-villager-discount-exploit if there is no paper.yml folder?

late sonnet
fleet imp
#

how do i play an animation to someone. I want to play the totem anim as part of a command

high grotto
mortal hare
#

its an YAML file

tardy delta
#

hmm yes

spiral light
chrome beacon
late sonnet
high grotto
spiral light
#

use paper

#

if you want this to be disabled

high grotto
late sonnet
#

@fleet impyeah its ::.playEffect(EntityEffect.TOTEM_RESURRECT);

fleet imp
#

thx

lapis lark
eternal oxide
#

thats not NMS so would not be affected by mappings

lapis lark
#

Suggestions to fix?

spiral light
#

wrong imports ?

#

ah wait ... you use maven.... missing dependecy ?

lapis lark
#
        <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

eternal oxide
#

remove that

#

you don;t need craftbukkit

lapis lark
#
<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`
spiral light
#

remove "remapped-mojang" if you dont want to remap again

eternal oxide
#

its already in your spigot dependency

lapis lark
spiral light
#

can you import CompoundTag ?

lapis lark
spiral light
#

did you reload the pom ?

lapis lark
#

NBTTagCompound fixing with adding remapped-mojang. But it gives Could not find artifact org.bukkit:craftbukkit:jar:1.18-R0.1-SNAPSHOT as well

tardy delta
#

bruh no tabcomplete on console

spiral light
#

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

eternal oxide
spiral light
lapis lark
# eternal oxide change yoru spigot-api to just spigot as you want access to the implementation t...

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>
mighty pier
#

how do i tab complete with materials?

eternal oxide
eternal oxide
#

^ but remove the -api

#

you want implementation aswell

#

spigot-api = Bukkit
spigot = CraftBukkit + Bukkit

spiral light
lapis lark
#

I feel like I'll hang myself today

chrome beacon
#

If you're using remapped you need to use CompoundNBT

lapis lark
#

Switched to remapped

#

cannot access net.minecraft.nbt.CompoundTag

#

Come on

spiral light
#

did you reload the pom ?

lapis lark
#

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>
summer scroll
#

what is the java version of the project?

lapis lark
#

8

spiral light
#

:/+

#

you need java 17 for minecraft 1.18 ^^

lapis lark
#

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

stone sinew
#

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"

summer scroll
#

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

lapis lark
#

idk what it means

#

something like building plugin i guess

chrome beacon
stone sinew
#

so i just need <outputDirectory>

lapis lark
#

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

grim ice
#

@eternal oxide

#

im big brain

#

i made a file chooser

chrome beacon
#

You can use reflection in 1.18 too

lapis lark
#

Because 1.18 version have another method names than 1.8 - 1.17

chrome beacon
#

Yeah

grim ice
#

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

lapis lark
#

Reflection is slow

chrome beacon
#

Yeah

lapis lark
#

Also i have already made all using NMS

chrome beacon
#

Set Java version to 17

lapis lark
#

I am only having troubles with compiling

#

17 or 1.17?

#

17 i think

hexed hatch
#

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

lapis lark
#

invalid target release: 17

chrome beacon
lapis lark
#

I have installed intellij 2 days ago

#

i think there is a latest maven ver

stone sinew
late sonnet
chrome beacon
lapis lark
#

How to update

ivory sleet
lapis lark
#

I am only retelling other words

#

I didnt test its speed

chrome beacon
lapis lark
#

Sounds kinda hard

quaint mantle
#

how to send actionbar/title on 1.18?

lapis lark
quaint mantle
#

properly

young knoll
#

?jd

young knoll
#

Search title or action bar

quaint mantle
#

to be exact I meant it via packets, seems like sendPacket was removed from playerconnection?

young knoll
#

Why would you use packets

hexed hatch
#

So basically I know it would be stupid easy to implement Iโ€™m just wondering if thereโ€™s a weird design philosophy behind it

digital rain
#

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

quaint mantle
young knoll
#

Why would you use NMS

late sonnet
digital rain
late sonnet
quaint mantle
young knoll
#

You said 1.18 though

quaint mantle
#

yeah because I'm adding 1.18 compat

chrome beacon
quaint mantle
#

and the reach for 1.17 doesn't seem to work anymore, that's why I asked for 1.18

young knoll
#

Why not use the API for versions that have it

#

It seems like you are using a module system

digital rain
#

alos when it comes to the event priorities it is the lowest that executes first right?

lapis lark
#

i have installed latest maven as program and invalid target release: 17

chrome beacon
lapis lark
#

No

chrome beacon
#

Then that's why

lapis lark
#

If i will use 17 my plugin wont run on 8

chrome beacon
#

Tell maven to compile to Java 8

lapis lark
#

So i can set project version 17 and tell maven 8? And plugin will work on 8 - 17 java?

chrome beacon
#

Yes

lapis lark
#

Ok, i will try

#

Great, i have changed java version to 17 and now intellij says that class Object is missed

chrome beacon
#

Is it still indexing

spiral light
lapis lark
#

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

next spade
#

Try restarting IntelliJ

#

And check if your language level is 17

lapis lark
#

Hm

#

I think language level was 8

#

Thanks in advice, i will try later. I got to go

golden turret
#

just got obfuscated

waxen plinth
#

Don't bother with using packets for 1.18

#

Seriously just use the api

golden turret
#

ok

waxen plinth
#

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

golden turret
#

EntityPlayer.b.a(packet)

chrome beacon
#

Why not use remapped

waxen plinth
#

Ok but why

chrome beacon
#

;/

waxen plinth
#

Why use packets at all for that when it is officially supported in the api

golden turret
#

have you been considered

silent vigil
#

Plugin not loading on server startup

zealous osprey
#

Can I store a class in a persistentdatacontainer or just primitives and strings ?

grim ice
#

does anyone here know how to code forge

#

i have a simple question so u dont have to be an expert

zealous osprey
hybrid spoke
grim ice
#

cipher

#

ur not funny

#

๐Ÿ˜ญ

hybrid spoke
#

had to grin

#

but stop with those metaquestions, whats your question?

grim ice
#

how to force a player to right click

tardy delta
#

hack its mouse

grim ice
#

ur not funny either ๐Ÿ˜ญ

hybrid spoke
grim ice
#

oh

hybrid spoke
#

but i just copy&pasted it from the first google result

grim ice
#

but isnt that only getting the key code

#

lol

hybrid spoke
#

so it might be wrong

grim ice
#

it prob is

tardy delta
#

lool

hybrid spoke
#

PlayerControllerMP then probably

tardy delta
hybrid spoke
tardy delta
#

cant you just call an event?

hybrid spoke
#

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

grim ice
#

i assume ur second guess is correct

#

every tick kinda eird

#

weird

grim ice
tardy delta
#

hey you cant use locations in onenable right?

smoky oak
#

why shouldnt you be able to

#

also how do i null check again? ==?

tardy delta
#

i mean if the world isnt loaded

smoky oak
#

thats in onLoad

#

in onEnable worlds should already be there

#

iirc

tardy delta
#

@silent vigil

#

your getWorld("Practice") is null

silent vigil
tardy delta
#

are you even getting a world that exists?

silent vigil
#

yes

#

I am 100% sure that this is an actual world

tardy delta
#

i would add a null check

peak granite
#

how can i make clickable text that makes u execute a command

tardy delta
#

whoa

peak granite
#

how can i make clickable text that makes u execute a command?

tardy delta
#

lmao i just responded

#

C:

peak granite
#

where

zealous osprey
peak granite
#

is that built in spigot

tardy delta
#

ComponentBuilder is great

#

yea

peak granite
#

when was it added

tardy delta
#

uhh i dunno

#

it will be there probably

peak granite
#

?

tardy delta
#

net.md_5.bungee.api.chat.ComponentBuilder;

quaint mantle
#

Stop using 1.8 anyways

peak granite
#

nah

stone sinew
peak granite
quaint mantle
#

jokes aside my kitten cries everytime when someone uses 1.8

stone sinew
#

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.

lavish breach
#

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?

fast onyx
#

How I can check if an item have efficiency 4?

winged anvil
#

i think theres a getEnchants

zealous osprey
#

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 ?

sullen marlin
#

sure, enums can have constructors and fields

#

you can even have abstract enums

zealous osprey
#

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)

peak granite
#

what does adding final before the event name in @EventHandler do

zealous osprey
#

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

eternal night
#

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
}
peak granite
#

oh

visual tide
zealous osprey
sullen marlin
#

sure that works

#

you might find DesertSpider(DesertSpider.class) with a CustomMobEnum(Class) constructor less verbose though

zealous osprey
#

oh yeah, I can do that now

zealous osprey
sullen marlin
#

yes

zealous osprey
#

๐Ÿ‘

quaint mantle
#

Raw types ๐Ÿ˜ซ

zealous osprey
#

shhhh

ionic hatch
#

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?

timid spear
#

Heyo, what happened to ((CraftPlayer) target).getHandle().b.sendPacket(... in 1.18?
I search for the PlayerConnection, which was labeled b in 1.17.

surreal helm
#

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?

peak granite
#

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

ionic hatch
#

i think you cant cancel command events

peak granite
#

u can

#

lol

ionic hatch
#

nevermind me xD

ionic hatch
peak granite
#

when they do /yo

#

lol

ionic hatch
#

wait so you created a command called /yo

peak granite
#

...

ionic hatch
#

or is it an external command? xD

peak granite
#

i'm trying to block a command

ionic hatch
#

registered the event in main class?

peak granite
#

yeah

ionic hatch
#

maybe use PlayerCommandPreprocessEvent

#

and @EventHandler(priority = EventPriority.LOWEST)

paper viper
#

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

ionic hatch
slim cairn
#
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

stone sinew
#

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 ๐Ÿคฆ

sullen marlin
#

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

slim cairn
slim cairn
quaint mantle
#

How to use an anvil without wasting experience?

sharp bough
#

thing?

sullen marlin
#

in 1.13+ it doesnt

slim cairn
#

I just needa know how to refer to a light blue dye

sullen marlin
#

it would just be light_blue_dye

quaint mantle
#

md_5

slim cairn
#

While*

sullen marlin
#

is 2230 a current version

slim cairn
#

no I dont think so

sullen marlin
#

did you define api-version in plugin.yml

stone sinew
slim cairn
#

Wait

#

I'm not sure

sullen marlin
#

if in doubt just set the itemstack with code and see what the result is

slim cairn
#

How do I know the bukkit version I'm running

slim cairn
sullen marlin
#

if in doubt just set the itemstack with code and see what the result is

slim cairn
#

nvm I found it

gritty urchin
#

How would I get block dig block protocollib?

sullen marlin
#

why

#

what are you trying to do

#

there is probably an API

gritty urchin
#

Get the value

#

and the block type

#

@sullen marlin

sullen marlin
#

why

#

you know there is BlockDamageEvent

stone sinew
#

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

golden turret
#

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
sullen marlin
#

check RecipeChoice.MultipleChoice or whatever

golden turret
#

?paste

undone axleBOT
gritty urchin
#

I do not want them to disappear

#

once they have been destroyed

golden turret
#

this is my current code

sullen marlin
#

oh, tags arent persisted into MaterialChoice

golden turret
#

๐Ÿ˜”

#

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

#

as i said, i would like x4 Wood Planks

pliant tundra
#

anyone know a way to have a different text on each client in the scoreboard?

sullen marlin
#

yes, you can set a scoreboard per player

#

type scoreboard into the javadocs

brittle loom
#

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().
    }
}```
sullen marlin
#

isnt there literally .remove

#

will need to cast merchant

onyx fjord
#

Nice drip md

#

It really matches your outfit

brittle loom
#

I can't see it

sullen marlin
#

cast

#

to entity

brittle loom
#

Oh yes, thanks!

echo hound
#

does anyone know how to work with protocollib

onyx fjord
#

Well

#

First ask yourself, what do you need it for

echo hound
#

create holograms

#

for player

onyx fjord
#

Oh so you wanna spawn armorstands clientside?

gleaming oak
#

One message removed from a suspended account.

onyx fjord
#

English only

gleaming oak
#

One message removed from a suspended account.

onyx fjord
#

Well I never used plib, I would just use some API which lets you do that

#

Try searching on forums

#

Spawning armorstand client side

young knoll
#

I mean plib is an API for that

hollow spindle
#

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?

misty current
#

they probably store the inventory instance and set slots

hollow spindle
#

Ah yea that sounds like a better way. Cheers!

misty current
#

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?

primal kite
#

@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.

misty current
#

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

primal kite
#

getPlayer().getLocation().distance({Location of ArmorStand})

gleaming grove
#

Any idea how to change player name in 1.17.1? This approach is no longer working;/

primal kite
#

@gleaming grove have you looked into .setDisplayName() and/or .setPlayerListName()?

gleaming grove
#

setDisplayName is not working for some reason

magic dome
#

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

primal kite
#

@gleaming grove i just tried both and they seemed to work on 1.18 for both List and Chat. not on tab complete though.

young knoll
peak granite
#
        if (!globalDataFile.exists()) {
            globalDataFile.mkdir();
            try {
                globalDataFile.createNewFile();
            } catch (IOException exception) {
                exception.printStackTrace();
            }
        }```
#

why does this create a folder

#

not a yml file

primal kite
#

globalDataFile.mkdir(); <-- .mkdir()

peak granite
#

how do i fix it

gleaming grove
#

@primal kite I have managed to changed name like this ๐Ÿ˜„

#

anyway thanks for help

primal kite
#

@gleaming grove thumbs up emoji. i avoid NMS if there are other ways.

peak granite
fast onyx
#

I mean if contains the enchant

peak granite
gleaming grove
#

@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

young knoll
#

That wasnโ€™t Mojang, that was spigot

primal kite
#

@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.

noble lantern
#

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?

sullen marlin
#

Yes

#

Remove those inner braces

coral bobcat
#

this works in any language i know that has a switch statement

noble lantern
#

oh wtf! It works without inner braces holy crud were evolving now boys

noble lantern
ivory sleet
#

could use an expression also

#

and then have
"CREATOR", "CREATENODE" -> ...

noble lantern
#

interesting

#

i dont even have java 8 installed on this machine

north trench
#

How do I make a plugin that adds an armor set

noble lantern
#

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

noble lantern
#

the forbidden discord lag? just me

north trench
noble lantern
#

Like, with your own custom effects and whatnot? material, textures etc

north trench
#

Yes

noble lantern
#

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

young knoll
#

You can edit the item texture just using CustomModelData

primal kite
#

texture = dataPack/resourcePack.
effect = recipies/coding changes

young knoll
#

I heave heard of custom armor models without optifine, I think it has something to do with core shaders

noble lantern
#

I know Customitems works when you have optifine for CustomModelData

#

Idk if any plugins exist that dont require optifine to render armor models

primal kite
#

i did plenty of custom items without optifine using resourcepacks and setting server.properties

noble lantern
#

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

primal kite
#

both the item stack AND the rendered item on the player.

young knoll
#

Not the held item

#

Armor

noble lantern
#

^

#

like this, i used CustomItems to render these on a server with Optifine

primal kite
#

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

young knoll
#

You can't replace the model of dyed leather with a texture pack

primal kite
#

you can if you intercept the packet

noble lantern
#

isnt the color for leather armor changed at runtime?

young knoll
#

Yes

young knoll
primal kite
#

so telling the client what to render on a screen has nothing to do with the packets that are sent from the server?

young knoll
#

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

primal kite
#

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.

quaint mantle
#

do we have a way to force javac to compile even with errors

quaint mantle
#

.

noble lantern
#

oh

sullen marlin
#

you really have no idea what youre doing do you

quaint mantle
#

i think...?

young knoll
quaint mantle
#

i dont even need to use deobfuscator

young knoll
#

You can only have 1 armor model per item, CustomModelData doesn't work for that

quaint mantle
#

i just use the deobfuscated and using some searching technique to find the class containing the c00handshake

sullen marlin
#

you cant just change the version and expect it to work

#

the actual packets change

quaint mantle
#

๐Ÿ†—

primal kite
#

@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.

quaint mantle
#

i only changed the obfuscated java file which is bdg (C00Handshake) from 47 to 477

sullen marlin
#

you think the only thing that changed in over 400 versions is 1 number?

quaint mantle
#

no...?

young knoll
#

Are you telling me ViaVersion does more than just change a number?

sullen marlin
#

so then what do you expect changing 47 to 477 does?

#

how will it help you

quaint mantle
#

troll the server

#

to get perm from 1.9+ ๐ŸšŽ

sullen marlin
#

by disconnecting you with an error

quaint mantle
#

lemme test it

#

47 (1.8) --> 477 (1.14)

karmic grove
#

How long does cursefprge take to approve its been 3 days

young knoll
#

Ask them?

hexed hatch
karmic grove
#

Cuz thats where people publish there plugins

young knoll
#

Most people publish to spigotmc

hexed hatch
#

lol

mighty sorrel
#

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

karmic grove
#

Spigot has a place where you can publish?

hexed hatch
#

have you even been to the spigot website

karmic grove
#

Yes

hexed hatch
#

that's like it's main purpose

#

I don't know how you missed it

quaint mantle
#

sus

#

really sus

hexed hatch
karmic grove
#

Oh then uh lemme chack again

late sonnet
karmic grove
mighty sorrel
#

yes we imported the api and applied it to he build path however may it be an issue with eclipse?

sullen marlin
#

no its an issue with your config

#

you need to import the API, you cant just import the server jar

mighty sorrel
#

so the API is seperate now from the server jar?

hexed hatch
#

always has been

mighty sorrel
#

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?

sullen marlin
#

yes of course

#

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

mighty sorrel
#

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

sullen marlin
#

its the same as every other version if you were doing things properly

mighty sorrel
sullen marlin
#

Yes

mighty sorrel
sullen marlin
#

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.

forest edge
#

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?

noble lantern
#

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

forest edge
#

I tried switching it from 17 to 16, I'll try it again I suppose

undone axleBOT
forest edge
#

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>
flat perch
#

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).

tender shard
#

it just sends a packet

sullen marlin
#

debug

noble lantern
#

Does GSON support reading and writing Enums like this, or should i just store the enum as string and parse it when its needed?

sullen marlin
#

Try and see?

solemn igloo
#

Hello i need help with my plugin who can help

noble lantern
#

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

noble lantern
undone axleBOT
#

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

solemn igloo
#

I coded my plugin to say in chat when i type /gravity but i want it to teleport too

tender shard
#

you can teleport players using Player#teleport

solemn igloo
#

Where do i put it

#

In the main class?

tender shard
tender shard
#

so if it's a command, in your command executor

solemn igloo
#

Ok im in the link

#

I read it right?

tender shard
#

when you have a player called "player" you can do

player.teleport(someLocation);
solemn igloo
#

No i want @a

tender shard
#

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);
}
solemn igloo
#

Ok thanks i will screenshot my code later and tell me where i put it ok?

tender shard
#

didn't you say you already print a message when running the command?

#

you will probably want to put it there

solemn igloo
#

Next to the message?

tender shard
#

well if you really don't know that may I suggest that you learn some more java beforehand

solemn igloo
#

I use eclipes

tender shard
#

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?"

solemn igloo
#

Ok

tender shard
#

?learnjava here's some decent tutorials ๐Ÿ™‚

undone axleBOT
solemn igloo
#

But can u teach me to where to put it

tender shard
#

where your message is

#

either before or after sending the message

solemn igloo
#

Ok thanks

tender shard
#

np

#

btw where do you want to teleport the players to?

#

World.getHIghestBLockAt

#

oh you already removed your message lol

rough basin
#

I just want to resend it with more desc Lmao

#

Thanks :)

tender shard
#

there's also some methods that use Location instead of int x, int z ๐Ÿ™‚

rough basin
#

nice

tender shard
#

if you just need the Y coordinate: getHighestBlockYAt exists too

quaint mantle
#

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

tender shard
#

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?

young knoll
#

Any method they have that matches mojmap seems to get reobfusicated

quaint mantle
#

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 ๐Ÿ™‚

sullen marlin
#

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

quaint mantle
#

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

sullen marlin
#

Maybe you could make specialsource generate a trampoline if a method appears in two hierachies ๐Ÿ˜‰

#

Prolly a lot of work though

sullen marlin
#

You need a trampoline method

quaint mantle
#

What I want is to not override the NMS method in my case

sullen marlin
#

Oh well thatโ€™s easy

quaint mantle
#

My example is Mob#setBaby exists in mojang mapped but I have my own setBaby. Since it overrides specialsource remaps it 'incorrectly'

sullen marlin
#

But your setBaby is in a subclass of mob

#

So its overriding even before the remap process

#

Thatโ€™s an issue with your code

tender shard
sullen marlin
#

The only way SS could cause an issue in that context is if your api used one or two letter method names

quaint mantle
#

Well it wasn't overriding with spigot naming, only became an issue with mojang map > spigot

sullen marlin
#

Yes but that was just luck

quaint mantle
#

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

sullen marlin
#

Decouple the API implementation from the NMS implementation

#

Ie wrappers, like what spigot does

quaint mantle
#

ohyeah guess I forgot about that workaround

#

I can definitely swap around what interfaces I call and extend

young knoll
#

Spigot is basically a Crunchwrap Supreme

quaint mantle
#

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

frosty chasm
#

whats the event for clicking on an item in the inventory?

young knoll
#

InventoryClickEvent

#

?jd

frosty chasm
#

how can i get the meta of the item clicked from the event?

#

i tried event.getCursor().getItemMeta() but it gave null

summer scroll
pliant tundra
#

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)

opal juniper
solemn igloo
#

Also

#

Is the code u send coordinates?

#

I need coordinates

restive tangle
#

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.

tacit drift
#

See where it gets stuck

solemn igloo
#

@tacit drift

#

Hey

tacit drift
#

?

solemn igloo
#

do u know how to teleport people to a coordinat

lapis lark
#

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?

spiral light
#

Contact me privat I will take a look at it later if you want and still need help

solemn igloo
#

how do u do it inside box @lapis lark

lapis lark
solemn igloo
#

Is it a box

#

test

#

There we go

#

@spiral light

#

I need help too

lapis lark
#

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

solemn igloo
#

Dni

#

Dani

lapis lark
#

?

solemn igloo
#

Helo

#

Help

lapis lark
#

With what

solemn igloo
#

To teleport all players to a specific coordinates in elcipse

#

Eclispe*

lapis lark
#
Bukkit.getOnlinePlayers().forEach(n -> n.teleport(location));```
solemn igloo
#

Is that coordinates

buoyant viper
#

yes a Location object is for coordinates

lapis lark
#

Location location = new Location(world, x, y, z);

solemn igloo
#

Ok thanks

#

Also

#

Where do i put it

lapis lark
#

In place where you want to run your code ._.

solemn igloo
#
Bukkit.getOnlinePlayers().forEach(n -> n.teleport(world, 821 32 917));```
#

Is it like that

buoyant viper
#
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

solemn igloo
buoyant viper
#

u could, maybe

solemn igloo
#

Also @a?

lapis lark
#

Thanks for renaming variable from n to p and location to loc. It better now indeed

buoyant viper
#

lol

lapis lark
#

I am always using n for predicates