#help-development

1 messages · Page 1874 of 1

thorny python
#

if you mean the return value of onCommand(), it just indicate your command been performed correctly without issue I think

#

normally always return true

analog prairie
#

OK

#

data.set(playerName, player.getLocation().toString());

player.teleport((Location) Objects.requireNonNull(data.get(playerName)));

#

This can't work

thorny python
#

what's the return value of data.get()

analog prairie
#

File f = new File(whes1015.folder, "PlayerData.yml");
dataFile = f;
data = YamlConfiguration.loadConfiguration(f);

thorny python
#

uh you cannot just explicitly cast yml to Location

#

yml have getLocation() iirc

analog prairie
#

I should store each parameter separately?

thorny python
#

wdym

#

the x y z?

analog prairie
#

Y

#

Should I do like that?

#

I solved

thorny python
#

you dont need to do that, just set(path, location)

#

and use getLocation(path) when you need

analog prairie
#

Thanks

analog prairie
random epoch
#

That main looks nasty

analog prairie
#

I use event.getPlayer().getUniqueId()

#

Get all bedrock player as the same UUID

modern vigil
#

What's the event for a grass block turning to dirt when a block is above it

#

I've tried BlockPhysicsEvent and BlockFadeEvent

buoyant viper
red sedge
#

how can I add a list to a yaml file

quaint mantle
red sedge
#

that works?

quaint mantle
#

Why not

red sedge
#

so to get it ill just use get?

quaint mantle
#

getList((

#

Or getStringList

red sedge
#

ohhh

#

whats the difference?

red sedge
modern vigil
quaint mantle
#

I mean, set can accept all types

#

get() method can return only one, fixed type

#

Thsts why there's getString, getStringList and such

red sedge
#

ohhh

#

okay

#

thank you som uch

marble granite
#

SpawnEggMeta#getSpawnedType() is deprecated, what should is use as a replacement?

spiral light
#

isnt the item-type equal to the entity spawned ?

charred echo
#

Why is there no InventoryClickEvent#getInventory().getName method?

spiral light
#

i newer versions ?

spiral light
marble granite
spiral light
charred echo
spiral light
#

using an InventoryHelper like i did makes everything easier 😄

spiral light
#

but you can use event.getView.getTitle ^^

charred echo
#

where can I find this

#

ty

spiral light
potent pecan
#

Hello, I think that I'm trying to do an impossible thing, but why not ¯_(ツ)_/¯

I need send all messages to an endpoint and replace the chat text with the new one from the response(like a translator). I'm already caching responses for same messages but is there a way to not freeze the chat while the translation is in progress?

chrome beacon
#

Someone has understood the usage of threads :)

potent pecan
#

can you make an example?

#

should I cancel the chat event then start the thread and send the message with player.sendMessage()?

chrome beacon
#

Use a BukkitRunnable it's probably the easiest for you

#

Run it async and handle stuff there

potent pecan
chrome beacon
#

Yes

potent pecan
#

ok

quaint mantle
spiral light
potent pecan
#

I know how to use a thread, I was referring to this specific case

buoyant viper
#

isnt chat async, shouldnt it not affect main thread then? 😎

spiral light
potent pecan
modern vigil
#

What's the right priority to ignore an event if it's cancelled by worldguard?

#

i've set ignoreCancelled to true

spiral light
#

then no priority is right

modern vigil
#

so just ignoreCancelled

#

that seems to have fixed it, ty

spiral light
# quaint mantle what

custom entitys dont lose their data on reloads ^^
you can also store plugin data in worlds or entitys as Lists and more ... you will never lose data on reload if you dont want to store it local in files

runic quiver
#

guys how to make a new .yml?

spiral light
#

right click -> new -> create file and rename it

runic quiver
#

bruh

misty current
#

if you mean automatically, use the file class

#

if you just want to create the default cfg file, your main class inherits the methods to do so from Plugin/JavaPlugin

runic quiver
#

oh nvm i found the tutorial xD

#

ok so i have a question, how to setting only the head is visible(sorry my english kinda "BAD")

misty current
#

hey, i'm trying to make a permission that reads the last number and passes it to the code (example: "homes.4" i'd like to get the 4). Is that possible?

#

Sorry if it's phrased badly lol

runic quiver
misty current
#

do you want a player to only have a floating head?

misty current
#

you can equip him with its head and make him invisible

#

if you only want to show the head to some players you need packets

runic quiver
#

doesn't have hand :l

misty current
#

huh

#

what do hands have to do with this now

chrome beacon
#

This way the hand will show

runic quiver
#

how

spiral light
#

packets

runic quiver
#

nms?

misty current
#

or spigot's method

chrome beacon
#

I recommend Protocollib

misty current
runic quiver
misty current
chrome beacon
#

They have a guide on how to use it

runic quiver
#

@chrome beacon do you have the protocollib docs?

misty current
#

google

#

please

runic quiver
#

ok

misty current
#

there are plenty tutorials

misty current
#

i'm pretty sure essentials does something similar

lean gull
#

anyone know if theres a good tutorial for custom chunk generation? i wanna make a chunk generator that has vanilla stuff, and also custom stuff like patches of custom blocks, structures, etc - and all this in a method that can generate expandable chunks, so like if i use the method in one place, and then later i decide i want to add another chunk of terrain beside that original chunk, it will continue that chunk

chrome beacon
#

World Generation is very complex

lean gull
#

ok, but where do i start?

chrome beacon
#

Start by looking at NMS

lean gull
#

there are world gen apis that dont use nms

chrome beacon
#

Well yeah

#

Spigot has chunk generator api

lean gull
#

isnt it depracated?

chrome beacon
#

But to add stuff you need to understand how things work

spiral light
chrome beacon
#

It is

rough drift
#

ChunkGenerator iirc

lean gull
#

freesoccer i mean, you redirected me to terra which doesnt

misty current
#

unless you implement your own perlin noise etc i dont think it is

spiral light
#

nonono

#

i never told someone to look at terra

misty current
#

also chunkgenerator is deprecated now isnt it

chrome beacon
#

I have no idea

spiral light
#

its not possible to generate a chunk new with the ChunkGenerator API and modify it when called custom

spiral light
chrome beacon
#

Either way you're not ready for custom chunk generation iDerpy. I don't know why you keep trying to do the hardest things possible first

chrome beacon
#

You need to lower the scope for your projects

misty current
lean gull
#

i do not care if i "cant do it", i will learn with my own way and work my way up, however, i do not know what i need to know for worldgen so thats why im asking

misty current
#

make a /dupe command

#

it seems more appropriate for your knowledge

chrome beacon
#

You keep comming back here with how to questions of really complex things that not many can awnser and requires NMS. Your best option is to reference the exsisting code

spiral light
#

you cant learn it in your own way if you ask everything here how to do it

misty current
#

^^

misty current
#

if you wanna learn your own way go ahead

#

but dont expect help from us here

lean gull
#

asking people and watching tutorials is my way of learning

misty current
#

thats not the issue

misty current
#

i myself have started coding with tutorials

#

the issue is you wanna skip the hard part

#

that is the most important to get the basics

#

but do you, i couldn't care less

#

and i have told you multiple times already

lean gull
#

ok, what should i learn now then

runic quiver
lean gull
#

to work my way up for things like worldgen

spiral light
#

it was rly pain to understand how the World creation system works and how the ChunkGenerator works too ^^ it is rly complicated and need a lot nms if you dont want to generate boring Worlds

misty current
#

imo 2 things are pain: world gen and ai

#

the rest is very doable

chrome beacon
#

Minecraft AI is quite easy to work with

#

At least in newer versions

#

The goals API is neat

misty current
#

in older ones the obfuscation kinda makes it painful

chrome beacon
#

Well yeah old is pain

lean gull
#

brb, if you want to really help: message me with stuff i should practice for spigot and java

misty current
#

you get to a point where you have object.a().d(something)

#

and go guess what tf it does

visual tide
#

map it yourself 😄

misty current
#

just yesterday i needed to make a stand marker

#

guess what was the method name

#

n()

spiral light
misty current
#

also it's fun how some are obfuscated and some are not

#

smh

chrome beacon
spiral light
#

i would start with how events and commands work ^^ then schedulars, configs and how to create an gamemode like BedWars

chrome beacon
granite beacon
#

Not sure if this would go in here but, how come I'm getting a unexpected value return when running this? (I'm working with loading slime region files)

spiral light
chrome beacon
granite beacon
#

But I don't want it to be sync (since it's loading a world).
And yes you can load async with slime.

chrome beacon
spiral light
misty current
chrome beacon
#

?scheduling read this

undone axleBOT
misty current
#

i've just made a cancellable PacketEvent myself by injecting in the duplex channel and constructing nms packet classes is far better imo

misty current
#

sending spawn entity packets is painful but nms you just pass the entity and it does it for you

#

i love it

chrome beacon
#

NMS packets are arguably easier

granite beacon
chrome beacon
#

But I can be bothered to rewrite the code 10 times

misty current
#

guys what do you think of my nametag api

misty current
spiral light
granite beacon
chrome beacon
#

Fine let's keep using the CompletableFuture

misty current
#

not a frame drop too

#

and it's 4 entities per line

spiral light
misty current
#

lol

#

its just that its not a perfect line

#

for some weird reason

chrome beacon
misty current
#

not like i need it 45 degrees but its still weird

spiral light
#

wtf xD

misty current
#

ikr

#

test ladder

quaint mantle
spiral light
#

you would have finish this in 1 day if you stop using 1.8 xD

misty current
#

i know lol

#

and also if i didn't keep wasting time

#

i need it for a project of mine and also for a commission for a server on 1.8

#

that won't update

#

so

chrome beacon
#

Wrong channel also tells us nothing

misty current
#

^

#

also 1.48ms doesnt seem bad

#

nor does 3% whatever used

chrome beacon
#

Well nothing we can help you with then

granite beacon
#

I feel like that wouldn't work

misty current
#

i've tested different heights

#

but i can't find a good one i like

#

best one yet was bat with a -1 size slime on it

granite beacon
misty current
#

i can't stack multiple ones on top of eachother

#

else the lines would clip into eachother

granite beacon
#

Oh oof

chrome beacon
#

That's why

misty current
#

marker stands work the same way in 1.8 as 1.18

chrome beacon
#

Not sure why you guys are adding laughing emojis though

#

Marker removes the hitbox

#

Does it work in 1.8?

misty current
#

because he is a poor innocent soul that doesn't know what i have been through yesterday

#

lol

misty current
#

i guess i'll stick with bats unless you got any ideas

#

hold on ill show how it looks like

#

also now pain 2 starts

#

listening for player join, leave, enter in render of another player and leave from render

#

yay

#

also compiling with 10 maven imports takes a year

granite beacon
#

Olivo any ideas on how I can return the async completable future?

chrome beacon
#

Yeah return a CompletableFuture with a CompletableFuture in it

misty current
#

looks pretty good

granite beacon
misty current
#

i'd just like to make it a bit lower

#

ah completable futures

#

that reminds me i need to setup a database 😭

chrome beacon
#

Eh it's not that hard

misty current
#

i've had quite a bit of problems when i did it the first time

#

data deletion, desyncronization

#

and all that stuff

granite beacon
#

Still confused on how I can return a nested completable future

misty current
#

ok does the client remember an entity was spawned somewhere? even if i get out of render, the "name" comes back

chrome beacon
misty current
#

ok nvm

chrome beacon
misty current
#

tbf i don't even see why'd u need that

chrome beacon
#

I know the problem I don't really know the awnser

granite beacon
#

To explain what I'm trying to do, I want to load a world file (first future) and then generate the world (nested future) and then return the CompletableFuture so I can do a whenComplete outside of the function.

modern vigil
granite beacon
#

In theory I could just pass a BiConsumer into the function to get the same result (since then I can interact with the final whenComplete) but that seems kinda janky

chrome beacon
#

So futureSlimeWorld.get()

granite beacon
#

Wouldn't that halt the thread?

#

Or should I just run the first future async as well

chrome beacon
#

Yes but it's in another CompletableFuture

#

So it blocks the async thread which is fine

#

I hope I'm understanding this right...

granite beacon
#

Actually you're right, it would block it regardless

#

Since the first thing would be running on the main thread

#

Ok I think I got this

misty current
#

PacketPlayOutNamedEntitySpawn is for players isn't it

chrome beacon
#

Yeah

misty current
#

ty

granite beacon
#

Thanks Olivo

misty current
chrome beacon
#

Probably

#

Do keep in mind these packets aren't always for players

misty current
chrome beacon
#

I'd assume so

misty current
#

i guess i can check if Bukkit.getPlayer(uuid) is not null if it is a player

chrome beacon
#

Yeah

misty current
#

the uuid is just the field "b"

#

aight

quaint mantle
chrome beacon
#

Good to know

misty current
#

if I want to know a client's version, do i need to store data i got from the handshake?

#

I guess i can't get it after the handshake took place

quaint mantle
chrome beacon
#

They won't really be able to connect unless it matches the server version though

#

Now if you're using ViaVersion they have API to get the user version

misty current
#

o nice i'll look into it

#

i wanna do msgs to tell people not on 1.8 that the reccomended version is 1.8

sage patio
#

Some body can tell me what is sound name of Gear Equips ?

#

armor_equipt_generic i found i nvm

minor garnet
#

Try make the entiy with dinnerbone

misty current
#

then you'd be able to see the name

minor garnet
#

No

#

Is there a method

analog prairie
#
URL url = new URL(jsonObject.get("assets").getAsJsonArray().get(0).getAsJsonObject().get("browser_download_url").getAsString());
File destination_file = new File(updateFolder+"/ExpTech-AutoUpdate.jar");
FileUtils.copyURLToFile(url, destination_file);
minor garnet
#

I dont remembrr now

misty current
#

oh right they are invisible

#

you cant

analog prairie
#

Plugin didn't update

minor garnet
#

What

misty current
#

names on invisible entities can't be seen

minor garnet
#

No men

#

Is there a method to make it

misty current
#

yes the customnamevisible

minor garnet
#

makes the entity upside down

#

no and the method of changing the name

misty current
#

i know that you can make upside down entities by naming them either drumm or dinnerbone

minor garnet
#

And that makes the entity look lower

misty current
minor garnet
misty current
#

oh really?

#

is it nms?

#

or api

minor garnet
#

Spigot

#

Oh no

jagged monolith
#

You can't really do it without changing the name. Only hide the name.

misty current
#

that's what i knew

jagged monolith
#

As its client side not server side.

minor garnet
#

setRemoveWhenFarAway(false)

misty current
#

but still if i rename an entity it doesnt matter as invisible entities don't show their name

minor garnet
#

Paper spigot

misty current
minor garnet
#

Just use it

#

but i think do you haver to use paper spigot

quaint mantle
#

hi I just got this error and I have noclue what is going on can someone help me? java.lang.NullPointerException: Cannot invoke "com.nerdxd.colorchatting.Main.getConfig()" because "this.plugin" is null at com.nerdxd.colorchatting.MenuListener.<init>(MenuListener.java:19) ~[?:?] at com.nerdxd.colorchatting.Main.onEnable(Main.java:21) ~[?:?] at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[spigot-1.17.1.jar:3246-Spigot-6c1c1b2-dc764e7] at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:342) ~[spigot-1.17.1.jar:3246-Spigot-6c1c1b2-dc764e7] at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:480) ~[spigot-1.17.1.jar:3246-Spigot-6c1c1b2-dc764e7] at org.bukkit.craftbukkit.v1_17_R1.CraftServer.enablePlugin(CraftServer.java:514) ~[spigot-1.17.1.jar:3246-Spigot-6c1c1b2-dc764e7] at org.bukkit.craftbukkit.v1_17_R1.CraftServer.enablePlugins(CraftServer.java:428) ~[spigot-1.17.1.jar:3246-Spigot-6c1c1b2-dc764e7] at net.minecraft.server.MinecraftServer.loadWorld(MinecraftServer.java:619) ~[spigot-1.17.1.jar:3246-Spigot-6c1c1b2-dc764e7] at net.minecraft.server.dedicated.DedicatedServer.init(DedicatedServer.java:266) ~[spigot-1.17.1.jar:3246-Spigot-6c1c1b2-dc764e7] at net.minecraft.server.MinecraftServer.x(MinecraftServer.java:1010) ~[spigot-1.17.1.jar:3246-Spigot-6c1c1b2-dc764e7] at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:305) ~[spigot-1.17.1.jar:3246-Spigot-6c1c1b2-dc764e7] at java.lang.Thread.run(Thread.java:831) [?:?] this is my main class: https://paste.md-5.net/itaxidicut.java and this is the class using it: https://paste.md-5.net/jufoqomafu.cs

misty current
#

and has nothing to do with what i'm doing

#

the entities i have are spawned in with packets

#

so using this method doesn't affect the entity at all

minor garnet
#

Google it

#

Maybe you can found a packrt

static hollow
#

Hey. I have this command:

public class SpawnCubeCommand implements CommandExecutor {

    public ArmorStand armorStand;

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {

        if (sender instanceof Player) {
            Player player = (Player) sender;
            armorStand = (ArmorStand) player.getWorld().spawnEntity(player.getLocation(), EntityType.ARMOR_STAND);

            ItemStack cubeHead = new ItemStack(Material.DIAMOND_BLOCK);
            armorStand.getEquipment().setHelmet(cubeHead);
            armorStand.setGravity(false);
        }

        return true;
    }
}

How can i get this armor stand from other class?

#
SpawnCubeCommand spawnCubeCommand = new SpawnCubeCommand();
spawnCubeCommand.armorStand.teleport(e.getPlayer().getLocation());

this returns null

misty current
analog prairie
#

How can I disable another plugin using getServer().getPluginManager().disablePlugin();

misty current
#

this method is used for the server to deal with the entity

minor garnet
#

Aaaah

misty current
tardy delta
#

boo

misty current
#

PluginManager#getPlugin(string)

tardy delta
misty current
#

remember kids: don't static abuse

tardy delta
#

getInstance from command class goes brr too

misty current
#

remember kids: don't singleton abuse

quaint mantle
#

Remember kids: Do not use singletones

static hollow
#

sorry, im new to java and spigot api

analog prairie
#

If I want to listen in one plugin for another plugin's variables, is this possible?

tardy delta
#
class Command {
  @Getter
  static final Command instance = new Command();
}```
#

too lazy to write an actual getter

tardy delta
#

idk

#

suprise me

analog prairie
#

I want to get other plugins version

minor garnet
#

What is the api for @Getter I forgot the name

quaint mantle
#

Remember kids: Do not use lombok

minor garnet
#

Ok ty

tardy delta
#

lombok

wild eagle
#

Guys how can i change my plugin's logo
i upload the wrong png

tardy delta
#

plugins logo?

#

i learnt something new today

minor garnet
#

You dont sayeed it

#

🤣

wild eagle
minor garnet
#

yes

tardy delta
#

is there a plugins logo?

minor garnet
#

If you make a fork spigot to see plugins logo you can

static hollow
#

then how am I supposed to do it?

young knoll
#

Right side > Resource Tools > Edit Resource Icon

#

@wild eagle

wild eagle
#

how can i delete my plugin

young knoll
#

Report it and ask for deletion

fast onyx
#

what's the event for kick a player before he joins the server?

#

PlayerJoinEvent?

spiral light
#

PlayerLoginEvent

young knoll
#

AsyncPlayerPreLoginEvent

fast onyx
young knoll
#

No?

fast onyx
#

or i'm wrong

#

okay

#

thanks to both

#

❤️

tardy delta
#

just disallow it

misty current
fast onyx
#

ik

tardy delta
#

are that the silferfish?

misty current
#

marker armor stand riding upside down slimes riding baby pigs

tardy delta
#

ok i'm confused

misty current
#

this keeps getting worse

#

looks like some weird 3d text lmfao

spiral light
#

but it looks nice

misty current
#

fr

#

i might be able to use this somehow

#

imagine animating it

#

i've made a packet riding entity builder just for this stuff lol

wild eagle
#

@young knoll how can i delete my plugin

misty current
#

just delete it smh

young knoll
tardy delta
#

😄

wild eagle
#

really?

tardy delta
#

why would he say it

wild eagle
#

idk for making fun of me

tardy delta
#

ah yes we do that in a help channel

wild eagle
#

or maybe he doesn't know

#

like this guy

wild eagle
#

i can't send the screenshoots

tardy delta
#

?verify

#

!verify

undone axleBOT
#

Usage: !verify <forums username>

wild eagle
#

!verify AvatarAang

undone axleBOT
#

A private message has been sent to your SpigotMC.org account for verification!

wild eagle
#

like this guy

chrome beacon
#

He's wrong

ivory sleet
wild eagle
#

so i wrote it on here too

gleaming grove
#

Hi is there some build in Java observer class that can track changes in whole object, i made own implementation for that task but i don't know if it is the rightt approach

chrome beacon
#

Use setters and getters if you want to detect changes

analog prairie
#
name: Update-ExpTech
version: 22w03-pre1
author: whes1015
main: Update_ExpTech_whes1015.whes1015
depend:
 - Spigot-ExpTech
loadbefore:
 - Spigot-ExpTech
#

Why the plugin still loading before

tardy delta
#

vsc

analog prairie
chrome beacon
#

Ah remove the depend

ivory sleet
analog prairie
#

That plugin has public static String vername

chrome beacon
#

Just access it normally

analog prairie
#

import?

chrome beacon
#

You would need to import that class yes

tardy delta
#

hehe

#

i override the one from an interface

analog prairie
#

I can't import different plugin's class

chrome beacon
#

You need to add it to your project

analog prairie
#

add jar?

chrome beacon
#

Are you using Maven or Gradle

analog prairie
#

Gradle

analog prairie
chrome beacon
#

Then you need to install the first project in to your local maven repo

#

@ivory sleet Gradle help

chrome beacon
analog prairie
quaint mantle
#

is there an onReload() handler or something?

chrome beacon
#

No

#

You will have no idea when it happens

#

One of the few ways to detect it is to check for players in your onEnable

quaint mantle
#

but sounds stupid

ivory sleet
#

Believe there’s an event also

quaint mantle
#

why there is no handler

chrome beacon
ivory sleet
#

onLoad, onEnable and onDisable

chrome beacon
#

There is no onReload

quaint mantle
#

onLoad != onReload

eternal oxide
#

You can check in onLoad for !Bukkit.getWorlds().isEmpty() indicating a reload condition

ivory sleet
#

Yeah true but that’s probably to disambiguate

ivory sleet
analog prairie
#

I need gradle help

ivory sleet
#

there is no onReload

chrome beacon
#

Mhm

ivory sleet
#

These other load callbacks serve this purpose

ivory sleet
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. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!

analog prairie
#

how can I get that plugins version?
That plugin has public static String vername

chrome beacon
# ivory sleet ?ask

A project needs to be installed in to the local maven repo so it can be accessed from another one

ivory sleet
#

@quaint mantle

ivory sleet
#

whes add the maven publish plugin

chrome beacon
quaint mantle
ivory sleet
#

Yes but you have an Enum which represents startup and reload

analog prairie
chrome beacon
#

Ah missed that

ivory sleet
#

Yeah it hasn’t been there for a long time I believe

ivory sleet
analog prairie
#
publishing {
    publications {
        maven(MavenPublication) {
            groupId = 'org.gradle.sample'
            artifactId = 'library'
            version = '1.1'

            from components.java
        }
    }
}
#

this?

spiral light
#

doesnt minecraft allow semi-opacity colors as item models ?

ivory sleet
#

And the maven-publish plugin (is integral if you wanna publish)

chrome beacon
analog prairie
# ivory sleet Ye
A problem occurred evaluating root project 'Spigot-ExpTech'.
> 
> Could not find method publishing() for arguments [build_9stesvepz0uu6g11sddwzv00x$_run_closure1@7a4ad67f] on root project 'Spigot-ExpTech' of type org.gradle.api.Project.
ivory sleet
#

Yes

#

As I said two times already

#

Add the maven-publish plugin

analog prairie
#

😢

#
plugins {

    id 'java'

}

publishing {
    publications {
        maven(MavenPublication) {
            groupId = 'org.exptech.spigot'
            artifactId = 'library'
            version = '22w02'

            from components.java
        }
    }
}

group 'org.example'
version 'Release'

repositories {
    maven {
        url = 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/'

        content {
            includeGroup 'org.spigotmc'
        }
    }

    maven { url = 'https://oss.sonatype.org/content/repositories/snapshots' }
    maven { url = 'https://oss.sonatype.org/content/repositories/central' }
    mavenLocal()
    mavenCentral()
}

dependencies {
    implementation 'com.google.code.gson:gson:2.8.9'
    compileOnly 'org.spigotmc:spigot-api:1.18-R0.1-SNAPSHOT'
}
ivory sleet
#

Ah yes did you miss the plugins block?

analog prairie
ivory sleet
#

Good add maven-publish there then

#

Don’t see what the issue is here

analog prairie
ivory sleet
#

Show the error then

#

?paste

undone axleBOT
analog prairie
ivory sleet
#

You still didn’t add the plugin

#

id 'maven-publish'

#

Idk why it’s so difficult to add that

analog prairie
#

it's ok now

#

Then what's the next step

analog prairie
#

import it in another plugin which I need?

modern vigil
#

What does the Z generic type parameter on PersistentDataType<T, Z> refer to

#

Isn't it the same as the T

unkempt depot
#

So I just bought a server, and I'm trying to find some people to maybe help or playtest it. It's a guided adventure map with a "Dungeon Master" that controls mobs and encounters. Would anyone be interested in that? If someone is interested, please pm me and I'll send you the server ip, show you around and give you a rundown of what my plan is. VC is preferred

unkempt depot
#

So wheres the right one :^)

#

If not help-development

#

the place where you presumably go for help developing

tardy delta
modern vigil
#

i seem to be too stupid to understand

#

is it both the same ?

ivory sleet
#

Well

modern vigil
#

is the first a prediction or something and the second the actual value?

analog prairie
ivory sleet
#

Let’s say you want a UUID pdc type

#

then you need some way to store it

tardy delta
#

its the prrimitive and the complex type

ivory sleet
#

So the best way would be a byte[],UUID

tardy delta
#

so you'd want to store it in a long[] i guess

#

or byte[]

chrome beacon
tardy delta
#

isnt an uuid a long array?

#

internal

chrome beacon
#

I believe so

ivory sleet
#

Yes long[] is possible

analog prairie
ivory sleet
#

There’s no second plugin

#

Just java and maven publish

analog prairie
#

The library one is success build

ivory sleet
#

Arguably shadow if you shade stuff

chrome beacon
chrome beacon
modern vigil
#

i'm too stupid to understand...

chrome beacon
#

The Maven publish

ivory sleet
#

If you have the class UserTransientDataManager

#

How would that be stored by a PDC type

#

Not so easy right

tardy delta
#

imagine storing that in a pdc 😳

ivory sleet
#

So you might wanna serialize it into a byte array of a long array which can be turned back into an instance of UserTransientDataManager

#

But for numbers there is already an concretion so ideally they don’t need to be stored into byte arrays directly in spigot

slow oyster
#

You know how NMS is preferred to use Mojang mappings now, will CraftBukkit dev start using them too? It's pretty confusing having to use Mojang mappings in NMS but then when I go to make a PR it's still using old Spigot mappings

chrome beacon
#

I guess you could PR to fix that

red sedge
#

How can I pull an entity to a location

chrome beacon
red sedge
#

pull

chrome beacon
#

You will need to get the vector between the location and entity

analog prairie
ornate heart
#

Velocity change

chrome beacon
#

Did you rebuild the first plugin

analog prairie
#

yes

chrome beacon
#

Okay good

#

Now open second plugin

analog prairie
#

I don't know how to edit second plugin's build.gradle

chrome beacon
#

In the second build.gradle you need to add the first plugin as a dependency

chrome beacon
analog prairie
analog prairie
#

like this?

chrome beacon
analog prairie
#

compileOnly 'org.exptech.spigot:22w02'

#

Right?

chrome beacon
#

Almost you need the library part

red sedge
chrome beacon
analog prairie
red sedge
#

ohh

#

i got the wrong import

analog prairie
#

I am sure the first plugin build success

red sedge
#

now how do i make it so the entity moves towards that

chrome beacon
red sedge
#

i can add a velocity but that iwll give it once

#

how can i make it so it slowly goes to the location

misty current
#

i am really running out of ideas to space the lines correctly

#

baby horses almost worked

analog prairie
chrome beacon
#

So it works

analog prairie
chrome beacon
#

Good now you can import the class and access your version info in plugin 2

analog prairie
#

import Spigot_ExpTech_whes1015

#

because it is main class

#

Right?

chrome beacon
#

Did gradle publishToMavenLocal work

analog prairie
#

both of them build success

chrome beacon
#

Okay now reload the second project and see if it finds the dependency

modern vigil
#

I have a problem

#

I have made a custom fortune system

#

but now people can mine the blocks where fortune has already been applied on

#

and get more items

chrome beacon
#

You will need to track every placed block

modern vigil
#

I have an idea

#

Set an PersistentDataContainer entry named "IS_MINED"

analog prairie
modern vigil
#

but wait

#

Can you get the item data of the placed block before it was placed?

#

Like

#

u place a block with a persistent data key of "h"

#

set to 1

#

is there a way to retrieve that value on the BlockPlaceEvent

eternal oxide
#

PDC is only available on Blocks with a TileEntity

tardy delta
#

tilestate?

modern vigil
#

If i use e.getItemInMainHand() the hand might be empty

chrome beacon
#

Yeah

#

Block can be in other hand

modern vigil
#

I want to disable fortune from working on a block that has been mined and then placed again

tardy delta
#

i thought it was ((TileState) block.getState()).getPersistentDataContainer()

chrome beacon
modern vigil
chrome beacon
#

Store where the block is placed

#

And stop forune on placed blocks

modern vigil
#

wait

#

is there a way to get the placer

#

the entity who placed it

misty current
#

if you store it yes

modern vigil
#

If mineresetlite places the blocks

#

is the placer console?

#

So then the player would be null

misty current
#

probably you'd check it with playerplaceevents

#

that means that its not called if the api modifies a block

modern vigil
#

ight imma try that

vestal moat
#

do i get the packet event when i send a packet (Protocolib)

grizzled pollen
#

?paste

undone axleBOT
grizzled pollen
quaint mantle
#

then use another method

#

go ask java

#

dont ask me

#

like append it, instead of overwrite the file?

misty current
#

finally...

#

the right height

quaint mantle
#

give code.

#

sharing is caring

#

you have the hint now

#

go search it

misty current
#

it's an armorstand marker riding a slime with size -1 riding a baby pig riding a baby wolf

#

enjoy

quaint mantle
#

misty current
#

it took a long time

quaint mantle
#

@primal loom stop asking in dm, i will block you next time if you do it.

#

?learnjava

undone axleBOT
quaint mantle
#

I think deleting messages is not so good...

#
    /**
     * Gets a player object by the given username.
     * <p>
     * This method may not return objects for offline players.
     *
     * @param name the name to look up
     * @return a player if one was found, null otherwise
     */
    @Nullable
    public Player getPlayer(@NotNull String name);

So... you are saying... there is a possibility it may return even if the player is offline?

#

well

#

where is that method?

#

like which class

#

Server

#

if you got it in offlineplayer, they even return a player even if they never join before

#

i think the server's method just only return the player that has joined.

#

so they might return offline players too

#

uhm...

#

Idk which method to use

eternal night
#

That method definitely does not return a player instance for an offline player that never joined

#

Unless something is breaking the API contract, you won't be getting a non-null return from the player values for a name/uuid that isn't currently playing on your server

quaint mantle
#

ok

spiral light
#

thats not where you add a new recipe ^^

misty current
spiral light
#

Bukkit.addRecipe(Recipe) is the way to create a recipe

dusk flicker
spiral light
misty current
#

it actually didn't

golden turret
#

affter you add the recipe, you need to use the player.discoverRecipe

misty current
#

i stress tested with 300 lines

quaint mantle
#

i just test a new (?) decompiler, so accurate

#

more accurate than fernflower

misty current
#

they moved fine and my fps didnt drop

#

very glad i made it

quaint mantle
#

i can even decompile minecraft and then build it again using maven

#

i think they called it quiltflower?

#

ahh yea it is quiltflower

#

i thought decompiler cant do that?

#

like at least 1 or 2 errors

#

but no

#

there are none

#

cool

#

mc ver 1.8 or something

spiral light
#

they dont need to discover/undiscover smth to use it

#

if they have the right amount of items or smth like that that will auto discover it anyway

#

you can use ItemCraftEvent and cancel it

#

or PrepareItemCraftEvent

#

and set the result to null if player is not jesus

pure oar
#

I'm new to this and I'm having problems with the lore() method for ItemMeta. I don't know how to properly create the Component list, lol. Can someone please help?

spiral light
#

you can ? i wrote that you can use PrepareItemCraftEvent ... check for player and try to guess what he is crafting and set the result to null then

spiral light
#

you can try to use undiscoverRecipe on players too

#

but he can still craft it, if he puts them in the right place

#

and maybe they automatically learn the recipe if inventory has items

pure oar
spiral light
#

your using Paper ?

eternal night
#

You are developing against paper API

pure oar
#

Yea

eternal night
#

Yea

spiral light
#

ignore the depricated ^^

pure oar
#

Okay, ty

#

or should I just develop for spigot instead?

#

guess so

visual tide
#

i mean youre possible gonna reach more people if its a public plugin and youre developing against spigot instead of paper

#

other way round 😄

woeful crescent
#

Saw that falling blocks despawn after a while, what should I do to prevent this? any tags I can set that will make it permanent (no bukkit tasks)?

quaint mantle
#

-1b

woeful crescent
#

?

#

-1b?

#

What's that?

quaint mantle
#

forgot the nbt tag

#

only know the input

#

😒

woeful crescent
#

Oof

#

is it ticks lived

visual tide
#

@woeful crescent Time

woeful crescent
#

Time?

visual tide
#

set it to negative int limit

#

thats the tag

#

Time:-2147483648

woeful crescent
#

So i could set time lived to false?

#

Or just Time

visual tide
#

false??

woeful crescent
#

dw bout it

manic furnace
#

How can i write a log in log4j daily to a new file and roll it when it reached a file size of 20MB, and that without log4j.properties?

visual tide
#

no booleans involved

woeful crescent
#

yeah

#

the other guy said -1b so i was pretty confused

#

But does that actually make it infinite?

visual tide
woeful crescent
#

oh

visual tide
woeful crescent
#

Lol

#

And on server startup I could reset all of them

visual tide
#

should be enough

woeful crescent
#

Yeah

#

NoGravity works too right

visual tide
#

ye

frank steeple
#

Maybe use Integer.MAX_VALUE if u want largest int?

woeful crescent
#

Nah it ticks up every time

#

so

#

not down

frank steeple
#

Oh

weak adder
#

Hello Im making a join message event but i want to remove these backets and send the messages one by one each line.

#
join_message:
  - "&a This Server is Using Plugin &9Hub Core"
  - ""
  - "&bThis Plugin Is Made by &fCOMPHACK"
  - "Download at <Spigot Link>"
#

I want to send these messages in a line

chrome beacon
#

Ugh hate that type of message

weak adder
#

But they are coming like this

chrome beacon
#

Don't send it as a list send it like multiple messages

weak adder
#

let me send u the code

chrome beacon
#

?paste

undone axleBOT
weak adder
#
public class joinmessage implements Listener {
    FileConfiguration config = HubCore.plugin.getConfig();
    Boolean joinMessagesEnabled = config.getBoolean("join-messages", true);
    String nonColoredText = (config.getString("join_message"));
    String joinMsgColorCode = ChatColor.translateAlternateColorCodes('&', nonColoredText);
    String coloredText = ChatColor.translateAlternateColorCodes('&', nonColoredText);

    @EventHandler(priority = EventPriority.HIGH)
    public void onPlayerJoin(PlayerJoinEvent e) {
        if(joinMessagesEnabled);
        e.getPlayer().sendMessage(coloredText);

    }

}
quaint mantle
#

maybe like

woeful crescent
#

not getString

weak adder
#

i used it just now

#

didnt work

quaint mantle
#

String.join("\n", coloredText)

#

oh not

#

lol

#

because of you set it already to String

chrome beacon
#

Get it as a list then send it like multiple messages. If you want it to be one message do what Wyvern said

woeful crescent
#

get it as a list

quaint mantle
#

String nonColoredText = String.join("\n", config.getStringList("join_message"));

quaint mantle
#

it should work

#

blame me if it doesnt

weak adder
#

ok let me compile

quaint mantle
#

?jd

woeful crescent
#

??

#

Why?

weak adder
#

let me try getList

woeful crescent
#

nono

#

this time try player.sendMessage(config.getStringList("join_message").toArray(new String[0]))

weak adder
#

Ok

woeful crescent
#

Why

#

You can send string arrays as messages

chrome beacon
#

That will just send it as an array again

#

It will look like the original

#

Get it as a list. Loop through it and send one message at a time

weak adder
#

but the color codes are gone

#

lol

#

I'll fix it

#

thanks

spiral light
#

i hope that advertisement is not shown to every player joining all the time 😄

weak adder
#

xD

#

i couldnt think what to put there

#

so i put this

drowsy bramble
#

https://paste.md-5.net/egolerevud.xml
[ERROR] No goals have been specified for this build. You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-clean, clean, post-clean, pre-site, site, post-site, site-deploy. -> [Help 1]

fleet pier
#

How do i add space to a string when a specific char was found for example &cChange some settings turn into &c Change some settings

drowsy bramble
#

i would guess "&c" + char <char> + "Change some settings" to "&c " + "Change some settings"
dont take my word for it tho cause i could be crazy

fleet pier
#

i just want to split the string when & was found and the following chat for example &cChange some settings turn into &c Change some settings yk?

drowsy bramble
#

ah

#

ull probs have to wait for someone more skilled then

drowsy bramble
trim surge
#

You could do .replace(“&c”, “&c “)

frank steeple
#

...

radiant estuary
#
            Damageable itemMeta = (Damageable)itemInHand.getItemMeta();
            if (itemInHand.getEnchantments().containsKey(Enchantment.DURABILITY)) {
                reduceDurability(player, itemInHand);
            } else {
                itemMeta.setDamage(itemMeta.getDamage()+1);
                itemInHand.setItemMeta(itemMeta);
            }
        }```
#

why does this not remove durabilty from tools without unbreaking

fleet pier
trim surge
#

Simple

fleet pier
#

its not simple cuz i bet there is an much easier way

trim surge
#

Probably 😂, but it’s one solution

fleet pier
#

why would i check every existing colorcode in the universe to add a space lol

trim surge
#

Well check for & then add a character after that.. So split it into an array, and then check it and boom add a space using the #replace()

ivory sleet
#

there's replaceFirst

misty current
ivory sleet
#

I mean you could turn the string into a char array and just do it manually but toby's solution is somewhat easier for you

trim surge
#

Luv u Conclure ❤️

arctic moth
ancient plank
#

sending the error alongside your "any idea why this spams errors" would be nice information

arctic moth
#

lol

ancient plank
#

?notworking

undone axleBOT
#

"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.

radiant estuary
chrome beacon
#

You're not checking if the item is a damagable

#

You're just casting it anyway

misty current
arctic moth
#

oh um

#

the server just crashed

#

without an error

chrome beacon
#

There is always an error

ancient plank
#

any idea why this spams errors
then what is spamming

arctic moth
#

the hell is happening here

chrome beacon
#

Looks to me like the server stopped normally

arctic moth
#

ik

#

but why

chrome beacon
#

Make sure you didn't call Bukkit#shutdown or smth

arctic moth
#

i didnt

frank steeple
#

Maybe your command was too powerful for server to handle :P

radiant estuary
#

.../down

trim surge
#

/stop will show your errors in-game!!

arctic moth
#

thats the command

trim surge
#

Mans making Fortnite in Minecraft

arctic moth
#

idk why but i wanted to add different player mechanics

ancient plank
#

mfw sees "downed" and thinks fortnite

arctic moth
#

xD

analog prairie
#

How can I get lie player list?

arctic moth
#

Bukkit.getOnlinePlayers()

#

so any idea why it would shut the server down

frank steeple
#

Idk, try printing "got here" before where you think it fails. That is unless someone gives better answer

arctic moth
#

it gets to the part where it sends the message

#

when i restart the server its still running

#

and spams errors

#

but still works

delicate ivy
trim surge
#

Idk

#

Weird that there was no error

#

Check latest.log

delicate ivy
arctic moth
#

that was all the code

delicate ivy
#

um

frank steeple
#

Try putting return after this.cancel()

arctic moth
#

btw the error spam is stackoverflowerror: null

#

thats after server restarts

delicate ivy
arctic moth
#

it seems to be something in PLayerDamageEvent

arctic moth
#

oh

#

in the downPlayer function

delicate ivy
#

hmm, idk

arctic moth
#

but its not even starting the runnable

#

it shuts down after sending the message

delicate ivy
arctic moth
#

idk

#

i cant even find the beginning of the second error

#

theres so much traceback

#

the error spam after restarting the server seems to be with PlayerDamageEvent, but thats probably unrelated and another bug i have to fix

eternal oxide
#

?paste teh error, its easier to read

undone axleBOT
eternal oxide
#

a stackoverflow is generally a very bad loop

misty current
eternal oxide
#

looping all online players every tick

arctic moth
arctic moth
arctic moth
#

Also it's every second

#

Because every 20 ticks it does it

eternal oxide
arctic moth
#

Ik

#

But there's a times thingy and if the times is 20 it does it

eternal oxide
#

at what point do you reset teh PDC?

arctic moth
#

PlayerDeathEvent

winter mesa
#

how to cast Block entity to Chest (i know it's chest for sure)

arctic moth
winter mesa
#

.CraftBlock cannot be cast to class org.bukkit.block.Chest (org.bukkit.craftbukkit.v1_18_R1.block.CraftBlock and org.bukkit.block.Chest are in unnamed module of loader java.net.URLClassLoader @7506e922)
at ttomek.mobarobot.ObaraTrait.openChest(ObaraTrait.java:164) ~[?:?]

eternal oxide
winter mesa
#
Block myChest
Chest chest = (Chest) myChest;
frank steeple
#

I think u imported nms chest

arctic moth
#

Spawned for

winter mesa
#

i want to somehow cast it like this or get Chest

eternal oxide
#

else, when two players are downed you will have two timers running, one for each, but both spawnign particles on all downed players

arctic moth
#

Oh

winter mesa
frank steeple
#

No nvm ur using nms block

analog prairie
#

How can I change Bukkit.getOnlinePlayers() to Array

winter mesa
#

org.bukkit.block

#

don't think it's nms but w/e i need to cast Block to Chest

arctic moth
#

*ig

arctic moth
#

Like the for loop has plr and the person is player

eternal oxide
#

It only damages the downed player, but it spawns particles on every player set to bleed in yoru config

hasty prawn
analog prairie
#

[player,player1]

#

Can I just get like this?

lavish hemlock
#

then do toArray(new Player[0])

arctic moth
#

Lol

random epoch
lavish hemlock
#

I mean it's the intended solution for a typed toArray conversion.

arctic moth
#

Ik this sounds dumb, but I'm curious what would break do if it was inside 2 loops

lavish hemlock
#

Would break the closest loop

#

You'd have to use a label to break the outermost

analog prairie
#

Incompatible types. Actual org.bukkit.entity.Player[]', requires 'com.google.gson.JsonElement'

random epoch
#

I feel like breaking a loop like that doesn’t look clean is there not another way?

lavish hemlock
arctic moth
#

Lol

winter mesa
analog prairie
#

I need jsonarray

#

it return player[]

sterile token
#

What the differente between this mongo update statements?

@Override
public final <K> void updateModel(K... query) {
    this.database.getCollection((String) query[0]).updateOne((Bson) query[1], new BasicDBObject("$set", query[2])); 
}

@Override
public final <K> void updateModel(K... query) {
    this.database.getCollection((String) query[0]).updateOne((Bson) query[1], (Bson) query[2], new UpdateOptions().upsert(true)); 
}

#

Im really confused now

arctic moth
eternal oxide
#

have you actually posted your error?