#help-development

1 messages · Page 590 of 1

smoky anchor
#

yeah no

livid dove
#

Please. It will be worth it I promise.

#

😆

smoky anchor
#

Dude I have work to do and I can't keep delaying it more

livid dove
#

Okay just sun it up in like 2 or 3 sentences

timid hedge
#

Its for 1.8 so i cant

livid dove
#

Trust me pro gamer move time

smoky anchor
#

something something fully player driven economy
something something custom biomes, mobs, items
something something world limit
something something something

quaint mantle
smoky anchor
#

heh, relatable

livid dove
#

CuriosityCore is proud to announce that, thanks to @quaint mantle we have been inspired to make a plugin with a big custom resource driven world, with hard to kill mobs, unforgiving custom biomes, items, and a fully player driven economy based on region locked resources.

Mythic Realms!

Mythic Realms will be fully open source and have a strict not-for-profit licence. To ensure the concept will be easy to implement and never be used by bullshit peddling entrepreneurs. 😎

#

It will be now

#

Sounds like a cool project

timid hedge
livid dove
#

Shame about it getting a non profit licence

smoky anchor
#

stop asking trivial questions and try google

livid dove
#

?java

quaint mantle
undone axleBOT
livid dove
#

Howd they react lmao

smoky anchor
#

He didn't see it I believe

livid dove
#

Damn someone tell.him

smoky anchor
#

or just didn't really react

livid dove
#

I'm sad now lol

#

"Isn't that something curiosity core have just announced they are gonna make"

#

Lmao

timid hedge
# quaint mantle ?learnjava

You are just showing me a new method and i dont know how the hell i am going to fix this
You showed me it..

smoky anchor
#

just make a normal switch if you're on 1.8
I'm sure you can do that at least

chrome beacon
#

I don't think they can

#

You're going to have to bring the spoon

smoky anchor
#

'cause you can't use enhanced switch with that old java

#

I believe that was what they started with and then were told to use switch
not sure tho

livid dove
#

Is this still the world shop guy?

smoky anchor
#

a much fancier switch with no ugly break;

smoky anchor
livid dove
#

USE A DAMN MAP AND CALL IT A DAY JESUS

#

It's a mutable list depending on number of worlds

#

Just use a map

#

Easy

smoky anchor
livid dove
#

Lmaoooo

drowsy helm
#

pretty sure they are fresh to java

livid dove
#

Who cares? You don't hand an apprentice a screwdriver to put 300 screws in cause they've never used a drill before

smoky anchor
#

ye but teaching them advanced concepts will just get them confused even more I believe
you need a strong foundation to use those, and they can't even write else-if properly

livid dove
#

Have em cut their hand and cry a few times

#

Tis how to learn

#

Aka: stupid questions = stupid answers

#

He wants to do a complex thing

#

Show him that he needs complex tools

#

Teaching em bodge jobs because the suitable method is too hard just fuels shit devs

#

As they learn early on "this is the way" when it really isnt

smoky anchor
#

Hmmm I see your point

livid dove
#

You don't build a house if you can't even build a chair

#

The first bit of advice u give the poor sod is "ur not ready yet chief"

drowsy helm
#

you're full of analogies

livid dove
#

I , on occasion, code too lol

#

But yeah I'm a lecturer. We live and breath analogies lmao

#

Tbh I've wanted to make a make series to learn java via spigot because every other series uses shit like case statements for stuff like tab completers and I'm like "MY MAN NOOOO!" 🤣

still meadow
#

I have question.
What happens to player when he get killed while teleporting to another dimension?
I.e. server sends Respawn packet, then player get hit and dies and then server recieves Teleport Confirm.

#

And how Teleport Confirm works in general?

livid dove
#

... I have no idea and that is cool as hell.

Go test it , report back, hell, make a spigot article about it

#

Go my mad little spigot scientist

#

Be free!

#

*best way to learn is try to teach it to someone else.

#

Imo ofc

#

And with funky edge cases like that, experimentation I'd ur best bet as I'd bet my big left toe noone considered that when making those events

magic raptor
#

hello, can someone tell me how am I supposed to check if a connection to a server fails using bungeecord api, such as /server server (let's say the target server has a newer version)

sullen marlin
#

there's various events

magic raptor
#

like?

#

serverconnectevent is the one that gets fired and causes all the issues

#

i need to prevent it if the connection fails

#

thank you for solving your api fault i'd say

drowsy helm
#

what

magic raptor
#

still waiting for a response

#

a proper response

eternal night
#

serverconnectevent would always be fired tho ?

magic raptor
#

yep

#

even if connection fails, gets fired and then serverkickevent gets fired one second later

eternal night
#

yes ?

#

intentionally that is

#

the javadocs specifically state the difference between ServerConnectEvent and ServerConnectedEvent

magic raptor
#

still i need to prevent it from happen

#

if connection for some kind of reason fails

eternal night
#

The ServerConnectEvent happens way to early to even know if a connection fails

#

unless you want to invent time travel, this isn't going to happen lol

magic raptor
#

ooops sorry i mean serverconnectedevent

#

my bad

#

somehow i need to prevent failed connections in order to not fire serverkickevent

#

but still, how am i supposed to do something like that?

eternal night
#

I feel like this is a xy problem

#

why do you want to prevent them

magic raptor
#

because it's firing serverkickevent that will cause more issues

#

special things that i'm doing on my plugin

eternal oxide
#

?jd-bc

eternal oxide
#

once a ServerConnectedEvent is fired the Player is assumed to be connected and will be passed to the relevant server

#

What issue is it causing?

buoyant viper
grim oak
#

Hi im trying to create a custom enemy. How would i be able to get a list of all players the enemy if facing. For example if the enemy is facing in the +X direction, select all players that are within 10 blocks in front, but like a width of 5 blocks (kind of like a range of sight)?

eternal oxide
#

lots of math

grim oak
#

And is there a lovely little library that has all the math done for me?😭

eternal oxide
#

get all players in that world.
Check range of player to mob.
calculate angle to player relative to mob getDirection()

#

No lib that I know of

grim oak
#

ohh okay that doesnt sound bad

flint coyote
#

it doesn't sound bad until you have to optimize it because it has to run pretty much every tick for every mob

tender shard
#

well it's just a tiny bit of math, probably things the server does thousands of times per tick anyway

livid dove
ocean hollow
narrow flare
ocean hollow
ocean hollow
narrow flare
ocean hollow
narrow flare
#

Ah yes

#

Sorry

ocean hollow
#

this is my db

narrow flare
#

Ok on ur getHeads Line 319. Arrays is an immutable list. Try to create new Arraylist and add ur resultat set into This list

grim oak
narrow flare
# ocean hollow this is my db

No
Like that
ˋ`ˋString[] result = rs.getString(…).split(…);
List<String> res = new ArrayList<>();
for(String str : result){
res.add(str)
}
return res;``ˋ
Sorry im on my phone

narrow flare
tribal valve
#

Why there's no plugins when there is, also no errors

chrome beacon
#

That jar is looking real small

narrow flare
tribal valve
tribal valve
#
name: freakcore
version: '${project.version}'
main: com.freakcore.FCore
api-version: 1.19
``` that's my plugin.yml
chrome beacon
#

Use maven

#

to package your jar

narrow flare
grim oak
#

how is direction measured in minecraft?

eternal oxide
#

a unit vector

grim oak
#

ohh okay

eternal oxide
#

1 = 1 block = 1 metre

grim oak
#

so its not an angle?

tribal valve
#

when using maven

eternal oxide
#

it's a vector so is a direction with length

#

think of an arrow pointing

chrome beacon
#

target

grim oak
#

yeah i get you

#

so is there a Vector type that it uses?

eternal oxide
#

type?

young knoll
#

org.bukkit.vector

ocean hollow
quaint mantle
#

how do make a mob not burn to death by the sun, not using an item?

tribal valve
chrome beacon
grim oak
#

So how would i get the vector tht an entity is facing

quaint mantle
chrome beacon
tribal valve
young knoll
chrome beacon
grim oak
young knoll
#

getLocation or getEyeLocation*

#

Depends what you want

ocean hollow
quartz pendant
#

any ideas how to disable the dropping of loottables if an player is fishing?
he should only get fishes and not bamboo, books or rods 😄

(data packs arent an option)

dull goblet
#

I have this wall in a prison escape server, i want people to be able to shoot projectiles through the wall, but i don't want them to move through it. Some kind of barriers only for the player itself. How could i do this?

quaint mantle
#

Math

#

add imaginary boundaries that u check if a play moves through

#

if they are outside of said boundaries

#

u cancel the move event

tribal valve
dull goblet
# quaint mantle u cancel the move event

won't that be like very glitchy? like the same with worldguard deny entry. i am using this now for the safe zones when combat tagged but when players fight with each other they get glitched in the wall instead of the invisible wall acting like a wall

young knoll
#

You could potentially do something with per player world borders

grim oak
#

with bukkit util is there an easy way to turn a vector into a unit vector or do i have to do the math myself lmfao

young knoll
#

.normalize

eternal oxide
#

a unit vector is just a vector with a length of 1. any vector.normalize() returns a unit vector

grim oak
tribal valve
spare hazel
#

'combat.getXp() / (combat.getStarterXp() * combat.getLevel())': integer division in floating-point context

how can i fix this warning

eternal oxide
#

That is a basic google java moment

summer scroll
ivory sleet
#

What is wrong with that thingy?

summer scroll
#

i haven't actually tested it but it allows player to modify any lines

#

i mean if there isn't any alternatives, i can use that no problem

ivory sleet
#

I believe u cant restrict that

summer scroll
#

oh right, i'll use that then

#

thank you!

drowsy helm
#

Anyone aware if theres a way to get aroudn the fact that PersistentDataContainer#set(x, y, z) enforces z to be the same type as the PersistentDataType x? I'm doing some fucky type erasure and want to just pass an object

#
        for(Field field : this.getClass().getDeclaredFields()){
            Class<?> clazz = field.getClass();
            if (Modifier.isTransient(field.getModifiers())) continue;
            String name = field.getName();
            if (!PDCUtil.canUseDataType(clazz)) {
                throw new RuntimeException("WARN: Attempted to serialize field " + name
                        + " in class " + this.getClass().getSimpleName() + ". Add the PersistentDataType adapter to the PDCUtil registry to serialize.");
            }
            PersistentDataType<?, ?> pdt = PDCUtil.getDataType(clazz);
            pdc.set(new NamespacedKey(plugin, PDCUtil.toCamelCase(name)), pdt, ???);

        }```
said fuckery:
#

cant just do clazz.cast

tender shard
drowsy helm
#

doesnt that negate the whole point of PersistentDataType then

tender shard
#

well what are you going to store and why don't you know the type of it?

drowsy helm
#

literally anything

#

its meant to serialize a class to pdc

#

so i will have no clue

stiff knot
#

Hey not sure if this is the right place but this is my first time using gradle and the Minecraft Development plugin for IDEA seems to have generated 2 build.gradle files. Which one does it actually use?

tender shard
sterile breach
#

Hello, I have a question,

p.getInventory().addItem(new ItemStack(Material.TNT));

the problem is that if the player's inventory is full he will not receive anything, and it is possible to ensure that if the inventory is full he will drop the rest?

drowsy helm
#

    private <T> void fuck(PersistentDataContainer pdc, NamespacedKey key, PersistentDataType<?, T> pdt, Object val) {
        pdc.set(key, pdt, (T)val);
    }```
#

i have found a hack

#

lmao

tender shard
tender shard
drowsy helm
#

because i cant cast Object to T outside of the method

#

in the reflection method i just know its Class<?> and class#cast only casts to capture of ?

#

which will mismatch

ivory sleet
#

Yeah because <?> is invariant to everything in principle

drowsy helm
#

yeah

#

that method just enforces T is the same then cases val as T

#

its super hacky but in theory it will work because Object is always instanceof T

ivory sleet
#

Yeah, I suppose as long as u don’t pass stupid objects to it ur self

modern ridge
#

hi, i have problem from gradle build on MySQL and i relocate it, it show mysql.cj after i compiled it on gradle

sage patio
#

is IntelliJ doing being IntelliJ?

modern ridge
cinder abyss
#

Hello, how can I set the persistence of a particle (the time before it disappears ?)java e.getEntity().getWorld().spawnParticle(Particle.BLOCK_DUST, e.getEntity().getLocation().add(0, 1, 0), (int) e.getFinalDamage()*200, .2, .2, .2, redstoneBlockData);

modern ridge
#

idk why it show like this

eternal oxide
cinder abyss
eternal oxide
#

depends on the particle type. the data entry is sometimes speed

modern ridge
#

can anyone help this ?

#

when i applied MySQL

#

after check mysql lib class

#

it show like this

cinder abyss
eternal oxide
#

its not block data

#

well sometimes

cinder abyss
eternal oxide
#

you can not affect redstone speed

cinder abyss
#

perfect

tender shard
#

the javadocs for the data classes

modern ridge
cinder abyss
sterile breach
#

Hi,

if (e.getView().getTitle().equalsIgnoreCase(ChatColor.RED + "cstom gui")) {

I use it and if it's true I cancel but I would like its only to do if it's a slot in the menu and not in the player's inventory how to do?

ivory sleet
#

I mean its relocated to be inside ur package, no?

chrome beacon
modern ridge
chrome beacon
tender shard
modern ridge
#

the artifact show mysql.cj

#

i tried remove it

sterile breach
#

yes but i learn spigot si so for now I find it simpler, but what else can I do without using the names?

modern ridge
#

i still get this error

quaint mantle
#

so i suck at math but how do i check if a location is in between 2 other locations? (Like a boundary)

tender shard
#

whenever you create an inventory, put it into a Set<Inventory>. then in the event, check if your set contains that inventory. (don't forget to remove them from the set in InventoryCloseEvent)

ivory sleet
#

Looks good?

modern ridge
#

no

#

but other relocate are normally

quaint mantle
#

i can use BoundingBox

sterile breach
modern ridge
#

this was my first time on Gradle one, normally i use Maven

#

just fix by reussy

remote swallow
#

?paste ur build.gradle

undone axleBOT
remote swallow
#

you relocate mysql there

drowsy helm
#

i think i found a bug with either java or reflection pog

drowsy helm
#

no other way to explain it

eternal ivy
#
@EventHandler
    public void onPlayerJoin(PlayerJoinEvent event) {
        Player player = event.getPlayer();
        Component joinMessage = Component.text(Color.GRAY + "[ " + Color.GREEN + "+" + Color.GRAY + " ]" + player.getName());
        event.joinMessage(joinMessage);
    }

And It doesn't print text, but it prints an object
How do I make it to print text?

eternal ivy
#

Um

#

Is this paper code?

#

only works on paper?

#

ah

#

sorry

#

I didn't know

autumn cave
#

Is it just me or running java -jar BuildTools.jar --remapped --rev 1.20.1 --generate-source --generate-docs does not generate javadocs and sources for spigot? (I tried multiple times, deleting the downloads in .mv2, switching the order of parameters around)

remote swallow
#

it doesnt add them to .m2

autumn cave
quaint mantle
#

best way to quickly create a void world which i can delete later?

autumn cave
#

@remote swallow you mean it generates them elsewhere?

remote swallow
#

it generates them in the folder buildtools is ran iirc

autumn cave
#

which directory of the BuildTools output?

chrome beacon
#

The directory where it was ran

autumn cave
#

I see, in Spigot/Spigot-API/target

chrome beacon
#

unless you specified otherwise

chrome beacon
#

Just the root

autumn cave
#

Its not in the root

chrome beacon
#

Then it's not done yet

modern ridge
autumn cave
chrome beacon
#

There it is?

worldly ingot
#

It doesn't copy docs or sources to the root dir

#

They're under target

modern ridge
#

cuz i just first commuciate with Gradle Repo

chrome beacon
#

oh we talking docs

worldly ingot
#

tbf we could probably copy them to root

chrome beacon
#

PR time choco uwu

remote swallow
#

why dont we just add them to local repo too

worldly ingot
#

If we're doing --generate-docs and --generate-source, clearly the goal is to have access to them

autumn cave
worldly ingot
#

No clue

#

Oversight probably

#

Though you shouldn't really need them. The docs are online so Maven should fetch them automatically

#

Or, rather, you can depend on the Javadocs

modern ridge
remote swallow
#

local repo is .m2

autumn cave
# worldly ingot Or, rather, you can depend on the Javadocs

How, yeah all I'm trying to do is have the javadocs for spigot. I've added:

idea {
    module {
        isDownloadJavadoc = true
        isDownloadSources = true
    }
}

Which does download all the javadocs for other plugins and dependencies of mine, but not for "org.spigotmc:spigot-api:1.20.1-R0.1-SNAPSHOT" for some reason

remote swallow
#

do you have mavenLocal in ur deps

autumn cave
remote swallow
#

yeah you do, it wont check the repo bc of maven local

modern ridge
#

okay

#

i will check it

worldly ingot
#

Scoreboards?

#

I don't have a scoreboard PR

#

Last one I had was criteria

sterile breach
#

Hello again, I ask my question again, in an inventory, how to cancel the event if the clicked slot is in the "added" inventory but allow the player to move other items in his player inventory?

worldly ingot
#

Still waiting

autumn cave
remote swallow
worldly ingot
#

I mean the component methods don't check for 128 char length but that's only because that's hard to do with components, but afaik the limit on prefixes and suffixes are 128 chars

#

Like that's a vanilla limit

#

No?

remote swallow
#

its easier to make a batch script or something to just download sources and javadoc jars and install them to ther epo

modern ridge
remote swallow
worldly ingot
#

Can it support more than 128?

autumn cave
#

I'm confused your saying I need mavenLocal() for full spigot, but on the other hand, if I have it I can't have spigot-api javadoc?

worldly ingot
#

In vanilla*

modern ridge
#

but after build the jar

modern ridge
remote swallow
modern ridge
#

it show class mysql.cj

#

not like mysql only

royal hawk
#

Hello guys in 1.19.2 i have one problem with spawn egg i need get type mob spawn from egg:

I used in old:

SpawnEggMeta spawn = (SpawnEggMeta) playerItemEgg.getItemMeta();
spawn.getSpawnedType() - is type spawned mob

and how now to get the name of the mob that will be at spawn? can anyone come across this?

remote swallow
#

yeah, thats its extra package

worldly ingot
#

Could you perhaps try doing just a 129 char objective name in vanilla? It's possible that's a vanilla limitation. Though yeah if your issue is just that legacy colour codes count towards string length, probably resolvable with components but still limited to 128 chars

remote swallow
#

relocate 'com.mysql.cj', 'com.reussy.development.libs.mysql'

worldly ingot
#

If it's not a limitation then we should remove that check

modern ridge
worldly ingot
#

Yeah that's fine

modern ridge
#

or not mysql driver won't load

remote swallow
#

spigot ships a driver, and you have hikari so idk why ur shading one

worldly ingot
#

Yeah you shouldn't need to shade either a MySQL or SQLite driver, CraftBukkit does this already

modern ridge
#

and it cause an error

#

so i have to recode like this

#

'tx_isolation' varriable on Mysql 5 changed to 'transaction_isolation' on MySQL8

worldly ingot
#

*sigh* legacy

modern ridge
#

if i running 1.16.5 with support 1.8 so Via plugins won't showing full scoreboard

chrome beacon
#

You might need nms

worldly ingot
#

Yeah that's hard API to design

#

Up for frequent debate

royal hawk
chrome beacon
#

No

#

You'll have to take a look at how nms works by reading the code

royal hawk
#

Bad idea with nms

worldly ingot
#

Then perhaps the check should be removed from Bukkit

#

Does it show all 128 chars?

ocean hollow
#

why it doesn't work? It works until it reach "S2"

worldly ingot
#

I'll take a look at server internals later to see what internal limits are

chrome beacon
#

255?

worldly ingot
#

I recall them removing limits for things somewhat recently

#

1.18 or something

#

I just thought there was still an upper limit

chrome beacon
#

Don't forget your list is cleared during restart

ocean hollow
ocean hollow
#

Yeah, I know

chrome beacon
#

Try bee movie script

#

;/

autumn cave
# remote swallow for the javadocs you have to manually install the sources and javadoc jars from ...

Looks like this is not the optimal solution.

By default, Gradle looks for dependencies in the repositories defined in the repositories block. The order of repositories in this block matters because Gradle will try to resolve dependencies from the repositories in the order they are listed.
Reversing the order of my repositories fixed the issue. I now have full spigot + spigot api javadocs (without manual actions)

worldly ingot
#

Yeah figured. I'll look again

median magnet
#

is there a straightforward way to set the book in a bookslot for Chiseled Bookshelves?

shadow night
#

can having a lot of event listeners cause lag?

tender shard
#

what is "a lot"?

#

if you have a few million listeners, then yes

flint coyote
#

probably way earlier. Unless they are all just "return;"

ivory sleet
#

I don’t think the amount of listeners matter as much, more like the amount of EventExecutors, which if u use registerEvents() would create 1 event executor per @EventHandler method iirc

rough drift
storm granite
#

i cant send images here?

#

anyway is having 98% non heap memory usage PERMENANTLY a big problem?

#

or is it evidence of memory leak?

ocean hollow
#

How can I find out which pixel the player clicked on on the map in the ItemFrame?

young knoll
#

PlayerInteractAtEntityEvent includes the position you clicked

#

Should work for item frames

#

You can use that and some math to determine the pixel

shadow night
#

lets just not get deep into errors and stuff but what could this mean? org.bukkit.event.EventException: null

young knoll
#

Presumably something is null

eternal oxide
#

read the stacktrace

ivory sleet
#

But sounds a bit fishy

shadow night
remote swallow
#

check the precondition checks on stash

#

@atomic brook

atomic brook
#

oh

remote swallow
#

why do you keep ghost pingng him what

atomic brook
shadow night
remote swallow
#

preconditions

remote swallow
river oracle
#

I need to check for all players in a specific zone every tick. Should I do this synchronously and async. I personally lean towards async, but I remember being yelled at for using async repeating tasks for something similar on here xD

spare hazel
#

Will the PlayerQuitEvent be called on server stop when the server makes all the players leave or not?

sterile breach
#

hello, i am currently learning the spigot api. I'm working on the menus, I'm trying to make a system where you can't move the top slots, but the bottom slots can, and when I take an item from the bottom to put it up it's supposed to be blocked (this is the case most of the time.) however, by spamming an empty box I sometimes manage to put the item. Is there a way to prevent this?

river oracle
#

are you doing any heavy operations like a DB call?

sterile breach
#

oh no, it's a very light code and I'm in localhost

eternal oxide
cinder abyss
#

Hello, how can I set a display name on an ArmorStand ?

eternal oxide
#

most of the time you would be ok, but in some instances it can error

sterile breach
spare hazel
remote swallow
# atomic brook

idk what this was meant to show from what alex wanted, wait for him to be here later and ask

remote swallow
cinder abyss
remote swallow
cinder abyss
#

indirectly, thanks !

cinder abyss
sterile breach
#

ah also, getClickedInventory can be either p.getInventory (bottom inventory) or

and what is the top inventory called?

remote swallow
#

use getTopInventory or getBottomInventory

sterile breach
#

so i can use it like this?
if (e.getClickedInventory().equals(p.getTopInventory ()))
and getBottomInventory is an alias of p.getInventory?

remote swallow
sterile breach
#

so i can?

remote swallow
#

yeah

sterile breach
#

okay,
and getBottomInventory is an alias of p.getInventory?

remote swallow
#

probably not an alias, but the contents would be the same

#

it would be better to use getBottomInventory in this case

quaint mantle
#

idk if i can ask here but my github is being stupid,
this is my project rn:

#

and its like this in github:

#

it doesnt seem to update

remote swallow
#

yeah

#

did you commit it

#

and push

quaint mantle
#

yea

#

theres nothing left to commit/push

#

i even tried creating a new repository

#

didnt work

remote swallow
#

looks correct to me

sterile breach
# remote swallow it would be better to use getBottomInventory in this case

okay, and do you have an idea for that?

I'm working on the menus, I'm trying to make a system where you can't move the top slots, but the bottom slots can, and when I take an item from the bottom to put it up it's supposed to be blocked (this is the case most of the time.) however, by spamming an empty box I sometimes manage to put the item. Is there a way to prevent this?

quaint mantle
#

one with a capitalised letter

#

and one without

#

for some reason the one WITH contain my new stuff and some old stuff?

#

@remote swallow

river oracle
eternal oxide
#

you can;t access world async

river oracle
#

I thought you could read it

#

hm well okay

eternal oxide
#

possibly

#

but unsafe

river oracle
#

I need to look at my code I've done this before

#

just didn't wanna log into gitlab

#

we had some standard thing built into our game engine for this, but its been a year since I've touched minigames

eternal oxide
#

you may get a CME if a player joins or an entity spawns during your async call

river oracle
#

I'd have to look ig, but I feel like not returning a copy could have some weird affects if you append to the collection

eternal oxide
#

you call is async so it's not on the main thread. Its iteratign the collections async

river oracle
#

oh I suppose I was just thinking about the return value not about the actual method running

eternal oxide
#

if those collections are modified while your async call is iterating you can cause a cme

river oracle
sterile breach
mellow pebble
#

?paste

undone axleBOT
river oracle
brave sparrow
#

It expects armor to be an array

#

Not an object

mellow pebble
#

so im making this queue system for my hub core plugin and i made an error somewhere but i was looking for quite a bit of time and still couldnt figure out what is wrong i know it is big pile of code but yeah i is readable at least

https://paste.md-5.net/lisoyidota.cpp

flint coyote
#

"made an error somewhere". What error?

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.

mellow pebble
river oracle
tender shard
#

your "armor" is an object, i.e. a map with 4 keys: helmet, chestplate, etc. { }

it should however just be an rray of objects [ ], i.e. without "Helmet" keys etc

river oracle
charred blaze
#

is there any active forum where people are requesting developers?

remote swallow
#

?services

undone axleBOT
tender shard
river oracle
#

for itemstack its one I made

charred blaze
#

lol

mellow pebble
# tender shard ?notworking

well it is quite a simple just a normal queue system nothing too extra ordinary or special i believe both classes for queue QueueManager and QueueData are written correctly but i strongly believe it is the problem with PlayerListener.kt and how im accessing functions from that class because i probably messed that up but it would be great for second opinion on that this error occurs on player join event and i showing up every second which means that the problem is inside of bukkit task timer again link to code so you can open it easier from this message https://paste.md-5.net/lisoyidota.cpp

tender shard
mellow pebble
atomic brook
#

nfalex are you here ?

river oracle
atomic brook
#

kk

brave sparrow
#

@river oracle typically it’s based on the order of the items in the array

#

You’ll have to check with your type adapter to see which order it expects

river oracle
#

wdym by thius

#

there isn't even an array anywhere

#

lol

#

its all objects

#

besides the enchantments

grim oak
#

When setting up enums is there a way i could use values from a config file?

flint coyote
#

no. Enums are compile time constants

grim oak
#

what other structure could i use instead of an enum

pseudo hazel
#

class

grim oak
remote swallow
#

public static final fields

grim oak
#

okay

#

thanks

young knoll
#

What

pseudo hazel
#

sTatIc Abosoo

young knoll
#

Are you going to do some cursed codegen to make a bunch of fields based on a config

remote swallow
pseudo hazel
#

just like I have

fluid river
young knoll
#

What's wrong with an enum?

pseudo hazel
#

its just a bunch of final public fields

young knoll
#

That's literally what an enum is

pseudo hazel
#

well yes

remote swallow
#

just be a fuckin nerd like coll is and have a class for the config that you create stuff with

pseudo hazel
#

but with a normal class its easier to fill those values

grim oak
young knoll
#

He's just jealous of it

fluid river
#

he isn't in the mood today

remote swallow
#

oh i just call coll a nerd all the time

remote swallow
#

GO TOUCH GRASS

young knoll
#

Go to school

remote swallow
#

okay fair play

#

well done

fluid river
#

wait epic is still goin to school

young knoll
#

He should be

#

But he never does

fluid river
#

i mean his age

young knoll
#

He's 14

fluid river
#

fr?

remote swallow
#

how could you

#

doxxing me like that

young knoll
#

L

fluid river
#

i doxx myself

#

i'm 20

fluid river
#

now find my house

#

using this info

#

not a real hacker if can't do it

remote swallow
#

russia

fluid river
#

i doxxed it like year ago

#

if not 2

spare hazel
#

have you guys seen jump pads in hypixel skyblock? they get you from point a to b but not with a straight line movement, with a jump movement that exactly puts you in the place. does anyone have an idea whats the math behind it?(using position xyz of start and position xyz of end to calculate how much velocity should we add to the player to throw the player exactly at the end point)

remote swallow
#

i dont have the patience for that

fluid river
#

You throw a rock at vector A(x, y, z)

#

Where would it land if g = 10

#

now inverse the thing

spare hazel
#

in our country physics start from grade 10+ i think

spare hazel
fluid river
#

at first you need to find how gravity works in mc

spare hazel
#

if you dont know it, i dont blame you. you only give Jree fava lessons not pree fhysics lessons

fluid river
#

russians

tender shard
#

everyone?

spare hazel
tender shard
#

this is 5th grade in my country (NRW in germany)

German
Social studies (geography, history, economics-politics)
mathematics
Natural sciences (biology, chemistry, physics)
computer science
English
2nd foreign language (from class 7, in some schools from class 5), usually latin, french or spanish
Art
Music
Religious Studies/Practical Philosophy
Sports
Elective courses: the school offers at least a third foreign language and computer science or a combination of subjects with computer science. It can also offer other subjects or combinations of subjects.
spare hazel
#

where do u live?

remote swallow
#

merica

spare hazel
#

my country is fucked by your country

fluid river
# spare hazel if you dont know it, i dont blame you. you only give Jree fava lessons not pree ...
Location start = jumpPadLocation;
Location end = new Location(world, x, y, z);
Vector vector = end.clone().toVector().subtract(start.toVector());
double flatDistance = vector.clone().setY(0).length();
double Y = calculateY(flatDistance);
player.setVelocity(vector.add(0, Y, 0));
// disable player's fall damage

public double calculateY(double distance) {
    double Y = 0;
    // do some math using mc gravity formula
    return Y;
}
cinder abyss
#

Hello, how can I orient a TextDisplay to a Player ?

kind hatch
spare hazel
hybrid spoke
#

yes

remote swallow
#

yeah

tender shard
#

anyone remember the Vector collection in java?

fluid river
#

i remember it in cpp

tender shard
#

it's like a shitty version of an arraylist

fluid river
#

it has funny method

tranquil prairie
#

Hey how do you cancel item damage for swords? I did this but it only works for armor

@EventHandler
    public void onItemDamage(PlayerItemDamageEvent event) {
        event.setCancelled(true);
  }```
tender shard
#

I always wonder why people make such methods protected or private instead of public

#

I mean it could be useful sometimes

spare hazel
#

oh cmon @fluid river u left some math behind now i have to calculate it with Integrals i believe...

#

right?

remote swallow
fluid river
#

i changed my code a bit

spare hazel
#

okay

young knoll
#

That should work fine for any item

tranquil prairie
#

Yeah thats what I thought too but its not for me

spare hazel
remote swallow
#

according to the ai nerd its (dist * grav) /2

fluid river
#

try it 🙂

spare hazel
fluid river
remote swallow
fluid river
#

try using 13.0

remote swallow
fluid river
#

well, google is shit sometimes

spare hazel
#

double Y = (flatDistance * 13) / 2;

fluid river
#

32*

spare hazel
#

oh

#
public class JumpPadPhysics {
    //CODE PROVIDED BY JREE FAVA LESSONS BY NUKERFALL

    private Vector getVelocity(Location start, Location end){
        double flatDistance = Math.sqrt(Math.pow(end.getX() - start.getX(), 2) + Math.pow(end.getZ() - start.getZ(), 2));
        double Y = (flatDistance * 32) / 2;
        return end.clone().toVector().subtract(start.toVector()).add(new Vector(0, Y, 0));
    }
}
fluid river
#

there is a better method i posted above

#

double flatDistance = vector.clone().setY(0).length();

#

in case your start and end points are on the same height you can remove part with clone.setY(0)

brave sparrow
# river oracle wdym by thius

It expects your armor to be an array of items, not an object like you have it. It expects it to be something like helmet is always array index 0, chestplate is always array index 1, etc

river oracle
brave sparrow
#

It’s expecting an array and receiving an object

river oracle
remote swallow
#

thats crazy

#

Crazy? i was crazy once. They locked me in a room. A rubber room. A rubber room with rats. and rats make me crazy. Crazy? i was crazy once. They locked me in a room. A rubber room. A rubber room with rats. and rats make me crazy.

brave sparrow
#

And it’s not

river oracle
autumn cave
#

What happened to the BLOCK_BREAK packet? What is it now?

silent steeple
#

Block b = e.getBlock();
b.setType(Material.CHEST);

    Chest chest = (Chest) b.getState();
    Inventory inventory = chest.getInventory();
    inventory.clear();

    ItemStack potion = new ItemStack(Material.POTION, 1,(short) 16421);

    for (int i = 0; i < 27; i++) {
        inventory.setItem(i, potion);
    }

nothing is going in the chest any ideas

remote swallow
quaint tapir
#

2 questions,
is there a way to make parts of text in item lore hidden

is there a way to make mobs not despawn

autumn cave
young knoll
#
  1. That is basically just PDC.
  2. Yes, setPersistent
autumn cave
sterile breach
#

hello, i am currently learning the spigot api. I'm working on the menus, I'm trying to make a system where you can't move the top slots, but the bottom slots can, and when I take an item from the bottom to put it up it's supposed to be blocked (this is the case most of the time.) however, by spamming an empty box I sometimes manage to put the item. Is there a way to prevent this?

remote swallow
#

i just found it here lol

young knoll
#

Why is there a special packet for that

remote swallow
#

only block break related thing

young knoll
#

Ah wait it probably shows the breaking animation

remote swallow
silent steeple
#

ok ill try

fluid river
#

@spare hazel i'm doin free physics lessons with my friend

#

wait for me

#

i'm gonna send you the results of our research

silent steeple
remote swallow
#

iirc yeah

silent steeple
#

doesnt work..

charred blaze
#

hey i have uuid of player and i want to get its username

#

bungeecord

#

how do i do that?

#

plugin.getProxy().getPlayer(UUID.fromString(PlayerUUID)

#

when i do this

#

if player is offline it does null exception

silent steeple
#

@Override
    public void onItemPlace(BlockPlaceEvent e) {
        // Change the block to a chest
        e.getBlock().setType(Material.CHEST);

        aHCF.getInstance().getServer().getScheduler().scheduleSyncDelayedTask(aHCF.getInstance(), new Runnable() {
            @Override
            public void run() {

                Chest chest = (Chest) e.getBlock().getState();

                Inventory inventory = chest.getInventory();

                ItemStack potion = new ItemStack(Material.BEDROCK);

                for (int i = 0; i < inventory.getSize(); i++) {
                    inventory.setItem(i, potion);
                }
            }
        }, 1L);
    }

i tried this but it just doesnt work

undone axleBOT
#

You can use the discord code block format to display code or just text in a more pleasing way:
```java
public class MyPlugin extends JavaPlugin {
@Override
public void onEnable() {

}

}```
Becomes:

public class MyPlugin extends JavaPlugin {
    @Override
    public void onEnable() {

    }
}```
charred blaze
#

can anyone help

zenith gate
#

?paste ( FOR ME )

undone axleBOT
hallow hull
#

so when i update to 1.20.1 do i have to change the api version my my plugin.yml or do i keep it at 1.20?

shadow night
#

what event is fired when a player equips an armor piece?

silent steeple
#

making it a code block

quaint mantle
#

my friend is getting this error whilst downloading my project to his pc:

org.spigotmc:spigot🫙remapped-mojang:1.20.1-R0.1-SNAPSHOT was not found in https://oss.sonatype.org/content/groups/public/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of sonatype has elapsed or updates are forced
#

and yes he installed build tools

quaint mantle
#

use smt like mojang api idk

zenith gate
charred blaze
#

hey in my bungeecord plugin i have command /msg. somewhy when i type /msg and press tab list of player names does not appear.

#

how do i add tab completion like that?

quaint mantle
#

if u know how to add a basic tab completion

#

just return all the names of the online players

quaint mantle
#

idk how it works in bungeecord tbh

fluid river
#

@spare hazel

charred blaze
#

can anyone help

primal ermine
#

Hey. I'm trying to use #general message , but receiving The constructor HoverEvent(HoverEvent.Action, Item) is undefined

quaint mantle
primal ermine
pseudo hazel
#

did you import the correct item?

fluid river
#

anybody know how mc acceleration works

#

i mean air acceleration

#

cuz when you shoot player forward, his speed decreases over time

chrome beacon
#

Mc parkour wiki and regular wiki should have detailed information about that

pseudo hazel
#

it works barely

spare hazel
#

does the command args contain the command itself or not ?

pseudo hazel
#

no

remote swallow
#

/command it contains me

zealous arch
#

I need help with worldedit

#

it doesnt appear in my server

#

although it is in server files

pseudo hazel
spare hazel
#

and btw how can i make it so my other plugins can access my plugins data

zealous arch
#

oh ok

spare hazel
#

like getting a players skill level (int) or getting a jump pads location (Location, the bukkit one)

primal ermine
agile anvil
#

You need the other plugins to depend on yours so that they can use your methods

spare hazel
#

its not gonna be publicly available btw

#

not even the plugin

agile anvil
#

Must common way is to create an interface with all the methods you want to make accessible

spare hazel
#

interface?!

agile anvil
#

And make an impl in your plugin

agile anvil
spare hazel
#

what even is that

chrome beacon
#

Learn java moment

pseudo hazel
#

are you actually asking what an interface is?

#

if so thats a big learn java moment like Olivo said

spare hazel
#

?learnjava

undone axleBOT
pseudo hazel
#

i mean its lowkey funny you know what an API is but not an interface

spare hazel
#

gtg bye

primal ermine
spare hazel
#

Interfaces
There are a number of situations in software engineering when it is important for disparate groups of programmers to agree to a "contract" that spells out how their software interacts. Each group should be able to write their code without any knowledge of how the other group's code is written. Generally speaking, interfaces are such contracts.

For example, imagine a futuristic society where computer-controlled robotic cars transport passengers through city streets without a human operator. Automobile manufacturers write software (Java, of course) that operates the automobile—stop, start, accelerate, turn left, and so forth. Another industrial group, electronic guidance instrument manufacturers, make computer systems that receive GPS (Global Positioning System) position data and wireless transmission of traffic conditions and use that information to drive the car.

fluid river
#

is there any way do disable this acceleration

pseudo hazel
fluid river
#

and is 1 meter = 1 block

pseudo hazel
#

yes

fluid river
#

ok

pseudo hazel
#

1 meter is generally 1 block unless stated otherwise

fluid river
#

if i give player a velocity 1.0

pseudo hazel
#

but in code its probably just 1 unit, since thats also how the world coordinates are defined

#

etc

fluid river
#

it would be 1 block per tick

#

right?

pseudo hazel
#

yes I think so

#

which is very fast

#

or decently fast

fluid river
#

ok i gave him 0.4

#

so 0.4 blocks per tick

worldly ingot
fluid river
#

0.4, 0, 0

pseudo hazel
#

well yeah the scale doesnt really add up in most cases

young knoll
#

How so

fluid river
#

should move him 0.4 blocks per tick

pseudo hazel
#

yeah that doc is kinda assuming xD

young knoll
#

6'2" isn't too crazy for an adult

remote swallow
#

josh how tall are you

young knoll
#

That's not the point

remote swallow
#

now it is

#

how tall are you

pseudo hazel
#

I mean the more concerning part is that he is also a meter wide

young knoll
#

He thicc

remote swallow
#

BOI HE THICK

young knoll
#

He can also carry an almost unlimited amount of weight

#

And survive an unlimited amount of pressure

remote swallow
#

in water shore

#

what about gravel

timid hedge
#

Where am i returning false wrong?
When im using the command and dont have permissions it also sends /vagtshop

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (!(sender instanceof Player)) {
            sender.sendMessage("Only players can do this");
            return false;
        }
        Player player = (Player) sender;
        if (!(isPlayerInGroup(player, "testGroup1") || isPlayerInGroup(player, "testGroup2") || isPlayerInGroup(player, "testGroup3") || isPlayerInGroup(player, "testGroup4"))) {
            sender.sendMessage("You dont haver permission to this command.");
            return false;
        }else{
            if(player.getWorld().getName().equalsIgnoreCase("A")){
                new VagtshopA().open(player);
            } else if(player.getWorld().getName().equalsIgnoreCase("B")){
                new VagtshopB().open(player);
            } else if(player.getWorld().getName().equalsIgnoreCase("C")){
                new VagtshopC().open(player);
            }
        }

        return true;
    }
}
remote swallow
#

or snad

fluid river
#

why is gravity counted in b/s then

#

not b/t

#

disgusting

tender shard
#

thanks IntelliJ. But why is this not allowed?

buoyant viper
remote swallow
#

Crazy? i was crazy once. They locked me in a room. A rubber room. A rubber room with rats. and rats make me crazy. Crazy? i was crazy once. They locked me in a room. A rubber room. A rubber room with rats. and rats make me crazy.

zenith gate
shadow night
#

how do you find out what item got put in what slot in InventoryClickEvent? Like, if I want to know when somebody equips pants (leggings), how do I?

spare hazel
#

java documentation

pseudo hazel
#

well yeah

#

java likes elaborate explanations for simple concepts

tender shard
zenith gate
#

does right clicking an item to equip count as an inventory click event?

young knoll
#

Doubt it

shadow night
#

oh gosh

#

do I have to make like a custom event or something?

primal ermine
#

Maybe anyone did [item] plugin by this way?

ItemStack itemInHand = p.getInventory().getItemInMainHand();
String itemName = getItemName(itemInHand);
advertisement = advertisement.replace("[item]", itemName);
TextComponent chatComponent = new TextComponent(advertisement);
chatComponent.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_ITEM, new Item(itemInHand.getType().getKey().toString(), 1, itemInHand.getItemMeta().getAsString())));

I'm using Choco's example from a few days ago, but for new item() it requires third arg to be ItemTag, while in example there is string

young knoll
#

Use the ArmorEquipEvent library

young knoll
#

Yes that one

zenith gate
#

sorry your question just brought up a question of mine.

zenith gate
#

youll have to add it as one yeah.

young knoll
#

Oh no whatever will we do

zenith gate
#

he gives you a step by step how to do it tho.

young knoll
#

It gets shaded anyway

zenith gate
shadow night
#

I don't want extra dependencies ehh

tender shard
#

then you have to reinvent the wheel. By the way spigot is also a dependency

young knoll
#

Well then you can waste time rewriting it yourself for no reason

#

Or you can wait until the author of the spigot PR for that event comes back

zenith gate
shadow night
tender shard
young knoll
#

Or just shade it which is the exact same thing but without the manual effort

zenith gate
#

hey, he doesnt want extra depends … 😆

young knoll
#

That’s why my plugins don’t use spigot

#

Hell they don’t even use minecraft

buoyant viper
#

i think i outright ended up just printing the item name n forgetting abt hover LOL

primal ermine
#

Bruh 😄

buoyant viper
#

forget if NMS was needed or something

fluid river
#

bruh

#

what's wrong

young knoll
#

Easy fix

primal ermine
#

Yeah, i'm trying to avoid NMS at any cost

young knoll
#

:p

fluid river
#
private Vector calculateShootVector(int t, Vector vector) {
    return new Vector(x, 16, z);
}

Vector shootVector = calculateShootVector(2, vector);
player.setVelocity(shootVector);
worldly ingot
#

Oh, ItemTag.fromString() or something like that

#

There's a static method iirc

buoyant viper
#

there might be a serializer rhat i just forgor about

fluid river
#

it doesn't matter what value i set to Y

#

player always ~60 blocks up

young knoll
#

I believe there is a cap

#

If you set it to like 0.1 they won’t go that far

fluid river
#

the problem is

#

i used 64 32 and 16

upbeat abyss
#

anybody able to help me fix an error?

fluid river
#

he goes exact same blocks up

young knoll
#

Yeah the cap is only like

#

10

buoyant viper
#

ah, that speed limit

fluid river
#

probably

buoyant viper
#

its funny bc the vanilla limit is 100

fluid river
#

alr how do i make player stay in air for like 4 seconds

#

how big should the velocity be

buoyant viper
#

its interesting that (craft)bukkit reduces it tenfold

young knoll
#

Vanilla doesn’t care

#

A few tnt and you can yeet yourself to the moon

primal ermine
upbeat abyss
#
[11:34:38 ERROR]: Error occurred while enabling azBasics v1.0 (Is it up to date?)
java.lang.NullPointerException: null
        at net.tonepvp.azbasics.AzBasics.onEnable(AzBasics.java:17) ~[?:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:321) ~[patched_1.8.8.jar:git-PaperSpigot-445]
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:332) [patched_1.8.8.jar:git-PaperSpigot-445]
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:407) [patched_1.8.8.jar:git-PaperSpigot-445]
        at org.bukkit.craftbukkit.v1_8_R3.CraftServer.loadPlugin(CraftServer.java:359) [patched_1.8.8.jar:git-PaperSpigot-445]
        at org.bukkit.craftbukkit.v1_8_R3.CraftServer.enablePlugins(CraftServer.java:318) [patched_1.8.8.jar:git-PaperSpigot-445]
        at net.minecraft.server.v1_8_R3.MinecraftServer.s(MinecraftServer.java:408) [patched_1.8.8.jar:git-PaperSpigot-445]
        at net.minecraft.server.v1_8_R3.MinecraftServer.k(MinecraftServer.java:372) [patched_1.8.8.jar:git-PaperSpigot-445]
        at net.minecraft.server.v1_8_R3.MinecraftServer.a(MinecraftServer.java:327) [patched_1.8.8.jar:git-PaperSpigot-445]
        at net.minecraft.server.v1_8_R3.DedicatedServer.init(DedicatedServer.java:267) [patched_1.8.8.jar:git-PaperSpigot-445]
        at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:563) [patched_1.8.8.jar:git-PaperSpigot-445]
        at java.lang.Thread.run(Unknown Source) [?:1.8.0_371]

Not sure what the issue is

fluid river
#

shit

undone axleBOT
buoyant viper
#

not only are you running Paper, youre running Paper 1.8.8

#

?whereami

young knoll
#

Tbf explains why he’s here

buoyant viper
#

but also NullPointer

young knoll
#

Paper wouldn’t help with 1.8 :p

upbeat abyss
#

oh hsit that's paper

buoyant viper
#

something ur referencing has no value

#

(line 17 in AzBasics.java)

remote swallow
#

pixie were you crazy once

upbeat abyss
#
        getCommand("gmc").setExecutor((CommandExecutor)new gmc());```
buoyant viper
#

is "gmc" registered in your plugin.yml?

young knoll
#

is the command in your plugin.yml

upbeat abyss
#

🤦

young knoll
#

Damn too slow

buoyant viper
#

F

upbeat abyss
#

F

#

lemme see if that'll fix ut

tender shard
#

why are you casting "gmc" to CommandExecutor?

buoyant viper
#

their goals are beyond your understanding

tender shard
#

that only makes sense if they have another method with signature setExecutor(gmc) which they 100% don't have

primal ermine
remote swallow
tender shard
buoyant viper
primal ermine
#

While I'm here, maybe anyone knows a method to retreive item names? It could be in english only, but i know that with some work is it possible to show name according to player language

buoyant viper
#

TranslatableComponent(getTranslationKey()) should work, its what i use :P

primal ermine
#

Bruh why none of that are in spigot forums or any other website. I've spend whole day googling about it before, and here is all info

#

Thanks! ❤️

buoyant viper
#

but now i shrimply steal ur code AiSmug

zenith gate
primal ermine
#

No prob, it was 95% stolen before!

#

😄

tender shard
buoyant viper
#

yeah lol

tender shard
#

I was like "wtf is Translatable" then I remembered that I added that

buoyant viper
#

ah, right, ItemMeta can be null

#

dont mind why its not in the actual Item constructor, was just typing it out to see

river oracle
tender shard
#

getTranslationKey()

buoyant viper
remote swallow
#

makes plugins use my language

#

every plugin should have lolcat

zealous osprey
#

XD

river oracle
#

if not its kinda useless imho

buoyant viper
#

probably with resource packs

#

its not like the server is the one translating it

pseudo hazel
#

its not fully useless, but kinda limited

spare hazel
remote swallow
#

by my language i meant the language i have selected

pseudo hazel
#

yeah you can just add more stuff to the lang file, maybe mc will load it automatically

remote swallow
#

as long as mc knows the file, and it has the keys iirc mojank loads it

pseudo hazel
#

thats pretty cool though

#

thats free translation, if you are willing to ship with a resource pack*

#

free translation as in you dont have to write any implementation

buoyant viper
#

yeah :P

young knoll
#

You can indeed add keys with resource packs

buoyant viper
#

do u need to copy the whole lang file over or nah?

young knoll
#

No

buoyant viper
#

are they namespaced

young knoll
#

Don’t have to be

#

But you can easily do that by adding your plugin name to the key

buoyant viper
#

how does minecraft know the regular keys then

pseudo hazel
#

wdym

buoyant viper
#

like whats the path for a custom lang file

pseudo hazel
#

you use the same file I think

#

en_us.lang

#

or whatever

young knoll
#

or any language you want, yes

#

Minecraft will merge it with the built in one

buoyant viper
#

ah

pseudo hazel
#

just like all of resource packs, it just adds on top of what minecraft already has

#

and replaces things you copy from mc

abstract sorrel
#

!nms

remote swallow
#

?nms

abstract sorrel
#

thx

zenith gate
#

How can i set an itemstack color? I want to make a leather chestplate black.

#

getting only outdated results from google...

young knoll
#

ItemMeta

#

Cast to LeatherArmorMeta iirc

zenith gate
#

thank youuu

spare hazel
#

should i round player location with math.floor or math.round?

young knoll
#

For what

spare hazel
#

for storing a location for my jump pad plugin

remote swallow
#

whats it stored in

brazen violet
#

how can i use hex colors in my plugin

spare hazel
remote swallow
#

yeah, where are you storing the map or are you not storing it

brazen violet
#

yep i have this but how can i use them now in an message

spare hazel
remote swallow
#

is the map being saved anywhere

#

database, yaml, json whatever

spare hazel
remote swallow
#

where

turbid ridge
#

How to effectively cancel an event asynchronously

spare hazel
#

no i thought you meant in the code but im gonna soon save it in yaml

brazen violet
#

so you mean p.sendMessage(HexCodes.COLOR_CHAR ); and then + the message?

remote swallow
#

save the location as it

#

set("path", location)
getLocation("path")

brazen violet
#

do you have maybe an example for me?

spare hazel
#

n

#

im making a hypixel skyblock like jump pad plugin

remote swallow
#

use #equals

spare hazel
#

then if the x is 69.420001 then the player has to be on that exact position

young knoll
#

Convert to block locations and compare those

spare hazel
young knoll
#

Location.setX(Location.getBlockX())

#

Etc

spare hazel
#

ok

primal ermine
#

Hm. I can't seem to think a way how to set hover event only for replaced [item] part. Problem is that it might be at start, in the middle or at the end of message. Is there an method to replace with components? o.O

remote swallow
#

make 3 components

#

message start [item] message end

primal ermine
#

Yeah, that makes sense, but what if some player decides to write something like "hey [item] for sale anyone interested [item]?"

young knoll
#

Split at [item]

#

And then combine it back together with the hover component in between each

primal ermine
#

Oh

#

Yeah

#

Thanks!

vast ledge
#

or just use string.replace("[item]", ChatComponentString)

remote swallow
#

sure do love some json in chat

young knoll
#

Yeah that won’t work

zenith gate
#

Armor set bonuses

pseudo hazel
#

can I get the source location from a PlayerChangeWorldEvent?

#

I want to store the position the player is in before entering a certain world

young knoll
#

Should just be the player current location

spare hazel
#

does the PlayerFishEvent trigger when the player catches fish or when the player throws the fishing rod?

pseudo hazel
#

the current location is the player's new location

#

it has a getFrom but that just returns the world

#

hmm

#

but maybe thats all I need

#

since it probably saved what position in the world you were when you left

zenith gate
young knoll
#

I see

#

I assumed the event was called before the actually world change

pseudo hazel
#

no its after

#

but

#

its fine, I can use teh playerTeleportEvent which does have a location

#

🙃

spare hazel
#

what is the event that is triggered when the player catches fish

quaint mantle
#

Hi im trying to do a customConfig class. I made all metods but the thing is that I only want to Create a CustomConfig config and manage all with that. Here is the code: https://paste.md-5.net/kidomosoxi.cs

eternal oxide
#

?configs

undone axleBOT
quaint mantle
#

but that doesn't use YamlConfiguration

eternal oxide
#

you just use config = YamlConfiguration.load(...

young knoll
#

FileConfiguration is just a parent class of YamlConfiguration

eternal oxide
#

has helper methods. I recommend using the try/catch for loading as the example does

quaint mantle
eternal oxide
#

no

quaint mantle
#

oh

#

no idea

ivory sleet
#

Because that makes no sense it you’re trying to do a class out of it

pseudo hazel
#

this may not be the correct discord, but does anyone know if multiverse fires player teleport events when I move from one world to another? from my code it doesnt seem like it does

eternal oxide
#

yes it does

pseudo hazel
#

okay