#help-development

1 messages · Page 198 of 1

river oracle
#

Welcome to the better later versions from 1.8 AFAIK all mob eggs have their own entry in the material enum if they don't have a Tag just make a hashset that contains all mob eggs

ornate mantle
#

you'll have to make a clause disregarding regular eggs

tardy delta
#

!= is a thing

rotund pond
#

Oh, maybe I chould check if it contains _EGG so 🤔
thank you, I'll try some things ^^

hazy parrot
#

but if you want just egg ig you can just Item#getItemMeta() instanceof SpawnEggMeta

river oracle
#

Make a hash set or that

rotund pond
river oracle
#

You were going yo die 😳

rotund pond
vagrant hound
#

the command mvn is not found. I reinstalled maven and added to my path, but still not found

river oracle
#

If your on windows who knows

#

Windows is weird

#

If your on Linux just add the vars to your .bashrc and you'll be fine

vagrant hound
#

It's windows 😄

quaint mantle
#

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

ashen quest
#

bro my code ain't working

#

can you send your code so it work

quaint mantle
#

WHAT ISNT WORKING

#

.basic

#

.learnjava

#

?learnjava

undone axleBOT
quaint mantle
#

?wilthiswork

#

?willthiswork

tardy delta
#

no

quaint mantle
#

whats the command

#

?tryandsee

undone axleBOT
silk burrow
#

is there any documentation on the md-5 specialsource-maven-plugin?

#

I can only find a github repo with a relatively empty readme

echo basalt
#

why does redis take 23ms to store data

#

this is not normal

tardy delta
#

only 23 ms 🤡

echo basalt
#

I guess it was just an irregular spike

#

(time is in microseconds)

tardy delta
#

lmfao

icy beacon
#

is there a way to get an anvil block that is used in PrepareAnvilEvent?

serene sigil
#

can some 1 help plz?

native ruin
#

where can i download the mojang authlib library?

tardy delta
#

just use maven or gradle to depend on it

native ruin
#

oh so i can just add the dependency without having to install anything?

native ruin
#

<3

icy beacon
#

is there a way to get an anvil block that is used in PrepareAnvilEvent?

molten hearth
vocal pine
#

Is there an API function to return a random valid enchant within a level range (the one used in NMS for e-table)

tall dragon
#

not that i know of. but you could probably make one yourself

#

although the only way of getting an enchantment's max level is through nms i believe

icy beacon
#

uhh

#

Enchantment#getMaxLevel

tall dragon
#

really?

icy beacon
#

yeah lol

#

it's been there at least since 1.8

tall dragon
#

aperantly so lol

icy beacon
#

yeah

tall dragon
#

well then its really easy

icy beacon
#

and minimum level is normally 1, but just in case you could use Enchantment#getStartLevel

#

in case Mojang decides to add a new enchantment starting at level 2

tall dragon
#

i doubt that but yea. sure

grim ice
#

what would u need that sspeed for

#

wtf

icy beacon
#

cool, thanks, I'll take a look tomorrow!

echo basalt
native ruin
#

what is the best way to test things on "fake players" a localhosted server?

grim ice
#

im so bored

magic raptor
#

Apparently bungeecord 1.19 totally broke serverkickevent

#

in practice now only the disconnectevent gets fired, this is making development harder, i mean, why

wide fern
#

probs being dumb in some way, but java public void onAsyncPlayerChat(AsyncPlayerChatEvent event) { System.out.println(event.getPlayer().getName() + ": " + event.getMessage()); } isn't firing seemingly?

#

oh, ok

#

sorry, new to bukkit/spigot

echo basalt
#

It's fine, you're doing better than 90% of beginners

wide fern
#

and i do have @EventHandler

echo basalt
#

Did you register the listener?

wide fern
#
 public ServerMessage(SaltyBot plugin) {
        Bukkit.getPluginManager().registerEvents(this, plugin);
    }```
echo basalt
#

Did you initialize that constructor?

wide fern
#
new ServerMessage(this);```
echo basalt
#

Okay..

wide fern
#

in my main file

echo basalt
#

And is the plugin loading?

glad prawn
#

Fr

wide fern
#

it is loading, /plugins does list it

echo basalt
#

Okay

#

Now that we have exhausted the common blunders

#

I'll ask to see full code for both classes

#

?bin

#

?paste

undone axleBOT
tardy delta
#

might wanna use the JavaPlugin#getLogger

wide fern
#

ok

#

that returns a logger object or...?

tardy delta
#

yes

#

?jd-s

undone axleBOT
tardy delta
#

instead of using sysout

wide fern
#

ok

#

i know this is probably just java and not spigot spigot specific, but when I try to declare the logger inside the serverMessage class, it complains it can't be referenced from a static context, but if i declare it in the main class, i don't see anywhere to pass it?

magic raptor
#

someone has any idea about bungee kickevent? i mean what's going on

undone axleBOT
serene sigil
#

does any 1 know why this doesnt work when i give an item to an allay?

#

the allay class extends InventoryHolder

#

ignore that plz

#

🙂

#

basically im looping though all entities (that have an inventory) in the world and see if they have a dragon egg

#

it works with a hopper minecart but it doenst work with an allay

wide fern
#

im trying to figure out how to use the logger that bukkit/spigot has since you said to not use System.out.println

serene sigil
#

wait u talk with me or with @wide fern

#

oh okay

wide fern
#

trying this, it says cannot resolve symbol getLogger

serene sigil
#

lmao

wide fern
#

no, im using a dot, i thought i remembered that # was the way to do it in doucmentation or whatever

#
    public void onAsyncPlayerChat(AsyncPlayerChatEvent event) { Bukkit.getLogger.info(event.getPlayer().getName() + ": " + event.getMessage()); }
#

mb

#

yea, i shoudlve caught that in this

#

well, it's logging now, although didnt i see somewhere it was supposed to say what plugin logged it?

#

[15:25:07] [Async Chat Thread - #1/INFO]: kirjorjos: t

#

ok

serene sigil
wide fern
#

ok

#

it is now?

#
[15:25:07] [Async Chat Thread - #1/INFO]: kirjorjos: t
[15:25:07] [Async Chat Thread - #1/INFO]: <kirjorjos> t
```from 1 message sent
native ruin
#

my plugin can't seem to find craftplayer

how can i add it?
im on paper and i use maven

serene sigil
#

jk

native ruin
#

it doesn't find it when i use spigot aswell

#

my plugin can't seem to find craftplayer

how can i add it?
im on spigot and i use maven

serene sigil
native ruin
#

do allays even have inventories?

worldly ingot
#

They do, yes

native ruin
#

holy shit its the dude from thread ive been looking at

serene sigil
serene sigil
frail gale
#

at what after size is good to do a Binary Search?

crimson terrace
#

or what are you searching for anyway?

frail gale
#

basically a general question

ashen bridge
#

Someone can help me with BungeeCord

frail gale
#

needs a Binary Search to implement a Search Function

crimson terrace
#

usually HashMaps are better for most things

frail gale
crimson terrace
#

honestly binary search is pretty quick in any case

ashen bridge
#

? 😄

frail gale
crimson terrace
#

yeah

#

dont. it would undo all advantages of having a HashMap

remote swallow
#

spigot ows bungeecord

crimson terrace
#

same as a list but more memory usage basically

native ruin
#

try console logs to see what it does?

crimson terrace
#

also what "allay" XD

crimson terrace
#

still, whats an allay

remote swallow
serene sigil
crimson terrace
#

oh shit, never seen that

remote swallow
#

mob vote 2021

serene sigil
#

new mob

crimson terrace
#

looks nice

remote swallow
#

they're pretty pointless

#

you give it an item, it picks them up drops them to you or on a noteblock/jukebox iirc

crimson terrace
#

well Allays seem to be LivingEntities and InventoryHolders

frail gale
#

does Java stop the checking when you're using && and the first value is false?

serene sigil
#

so basically u can give them an item but it doesnt count as putting the item in the inv i think

tardy delta
#

mojang adding useless mobs are usual

crimson terrace
#

so I dont know why it wouldnt work. maybe the item they hold is separate from their inventory?

serene sigil
#

but it doesnt work

crimson terrace
#

maybe it requires a different method to get?

fluid river
#

but if you use binary & it won't

crimson terrace
#

i think this is the problem

serene sigil
#

well, i gave it the egg

crimson terrace
#

ah nvm

#

material works

serene sigil
#

entities dont have a hotbar right?

crimson terrace
#

just debug it a bit, check whether the method passes for the allay

serene sigil
#

nvm they dont lol

unborn sigil
#

Ще ми помогнете ли с едно нещо?

#

Ще ми помогнете ли или не?

remote swallow
fading spindle
#

is there any player dmg event?
Example: (when player takes damage)

unborn sigil
#

Знам английски

fading spindle
#

Oh ok

#

great

#

thanks!

remote swallow
fading spindle
#

thanks

unborn sigil
#

Какво ще стане, ако не пиша на английски?

fading spindle
#

for clarification do i put that in the arguments like this -() or when setting the variable use that line

#

ok

#

but it gives me an error

#

thanks!!

#

1 quetsion.

#

why didn't you add static

#

at the start of making the function

#

ok thx i just started coding lol :p

topaz cape
#

where do you get the IP off of a Connection in bungeecord api (a string ip)

fading spindle
#

no worries i fixed it i accidently put it in the argument

hazy parrot
#

You should Google what static exactly mean

#

It basically binds method to class instead of instance

#

It can be easily abused

unborn sigil
#

WILL ANY OF YOU HELP ME OR NOT?

topaz cape
#

well you didn't speak English

eternal oxide
#

?english

#

I thought that was one

topaz cape
#

?language

#

eh i forgor as well

#

?lang

eternal oxide
#

its probably somethign wierd like most of them

topaz cape
#

true

unborn sigil
#

NOW ARE YOU SATISFIED THAT I WRITE IN ENGLISH?

tardy delta
#

yes

eternal oxide
#

we can understand you now

#

?ask

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!

ashen bridge
frail gale
#

I'm from there

fading spindle
#

how do i decrement the worldborder in a player variable

trim creek
frail gale
trim creek
#

Was just wondering... Actually didn't know that lol

topaz cape
#

#getAddress returns a SocketSomething i forgor 💀

ashen bridge
frail gale
#

dm?

fading spindle
ashen bridge
frail gale
#

да

ashen bridge
#

ясно

frail gale
#

Let's stop because this is not Bulgarian channel

trim creek
ashen bridge
#

а разбираш ли от bungeeguard

#

okay

topaz cape
#

you mean #getAdress again in the socket thingy

frail gale
ashen bridge
#

ok srr

topaz cape
#

hmm ill check it out later ig

eternal oxide
topaz cape
#

pinged by accident xd

#

im sorry

fading spindle
trim creek
# frail gale it means yes

Wouldn't have been surprised if it would mean no. Just actually remembered the characters, and just toughts, it says "DA".

#

Which I tough means yes

#

as of using Russian characters

eternal oxide
fading spindle
#

Ah gotchya

trim creek
#

btw, whats the point of this?

@EventHandler
    public void onJoin(AsyncPlayerPreLoginEvent e) {
        Player player = Bukkit.getPlayer(e.getUniqueId()).getPlayer();

just cause it highly returns null and I hate it

#

(UUID is null...)

#

(dont ask how, either why)

#

(idk as well xd)

eternal oxide
fading spindle
trim creek
#

can I manage player permission in LoginEvent then? xd

fading spindle
#

like this

trim creek
#

just because something... seems a bit buggy....

trim creek
#

I mean...

eternal oxide
#

well yes in Login, not in PreLogin

fading spindle
#

ok

trim creek
#

I have prefix on chat, and player list, which means I have the correct permission...

#

but server can't use prefix on join message?

fading spindle
#

ok so, this line creates a variable of the world border that can be effected

eternal oxide
#

yes it can, but it depends on yoru permission plugin. At Login there is no valid world for the player. It will always return the default main world

fading spindle
#

ok thanks so much

eternal oxide
#

or the player

trim creek
#

if reply to me: aswner is kind of... however, it was the same as when I had it as PlayerJoinEvent, and AsyncPlayerPreLoginEvent as well.

trim creek
eternal oxide
pallid oxide
trim creek
#

Ah. So there is a difference between Login and Join

fading spindle
#

so will this block of code make the worldborder smaller by 1 everytime player takes damage

eternal oxide
#

yes

#

Login = they are currently Logging in and there is a partial player object.

#

preLogin = no Player object, only UUID and IP

pallid oxide
fading spindle
#

oh

#

so how do i decrement it

#

OK

#

ok

trim creek
#

Instead we have ItemMeta... 😒

eternal oxide
ivory sleet
#

bukkit doesnt

trim creek
ivory sleet
#

because generally speaking, builder pattern is for immutable objects

eternal oxide
trim creek
#

what the plugin literally does, is just gets the player permission, then returns the prefix, like §4

#

yes using §4 cause I was lazy

#

and what I realized is that since quit message has prefix, permission is not loaded correctly, so setting join message to "", then broadcasting it will do it I guess xd (ofc after a little delay)

#

now it works :D

eternal oxide
#

Theres something up with your permission plugin if the prefix is not already loaded in the PlayerJoinEvent

trim creek
#

like... as always... i am stupid. 🤣

#

anyway thanks for the infos and tips :D

quaint mantle
#

can I store a map in a yml file?

eternal oxide
#

your "can" store anything in yaml file

#

but should you!?

quaint mantle
#

well I want to store player data, with mapping names to locations

eternal oxide
#

Do you need the data when the player is offline?

quaint mantle
#

no

eternal oxide
#

Then the final question is, how much data are you wanting to store?

quaint mantle
#

🤷‍♂️ a lot?

eternal oxide
#

If its a lot then yes use yaml

fading spindle
#

hey it doesn't work, am i doing something wrong?
code line:
serverwb.setSize(getSize -1);

#

oh ok

topaz cape
#

nvm getAddress is deprecated

#

bungeecord

#

there's getSocketAdress which returns a SocketAddress class which is basically EMPTY

#

Serializable

#

that's it

#

idk 😦

#

it's an abstract class though but I can't see any Implementations

#

this is stupid tbh

eternal oxide
#

?jd

rapid vigil
#

Hello, I have a question real quick. What's the difference between PlayerLoginEvent and AsyncPlayerPreLoginEvent.
As far as I know the AsyncPlayerPreLoginEvent is called before the PlayerLoginEvent but what is the difference between disallowing the player from joining using the first one and second one?

eternal oxide
#

You can delay the AsyncPreLogin while you do lookups

#

you can;t delay the PlayerLoginEvent

fading spindle
#

like this serverwb.getSize(-1);?

eternal oxide
#

no

#

getSize doesn;t take an argument

rapid vigil
#

So it takes longer to connect?

eternal oxide
#

no

#

well yes

fading spindle
#

because this is my code related to the worldborder
public static void onPlayerDmg(EntityDamageEvent pdmg){
WorldBorder serverwb = getServer().createWorldBorder();
if(pdmg.getEntity() instanceof Player){

serverwb.getSize(-1);

eternal oxide
#

itsd Async so its running off the main thread. you can do whatever you need (within reason) and only delay that player joining not the whole server

rapid vigil
#

Oh alright thanks

tardy delta
#

running async in async 💀

#

i believe i once did that by mistake

eternal oxide
fading spindle
eternal oxide
#

when teh player joins, set his border

#

then if you want to decrease itjava WorldBorder border = player.getWorldBorder(); border.setSize(border.getSize() - 1); player.setWorldBorder(border);

quaint mantle
#

If I've stored something in a yml using:

pConfig.set("Homes." + name + ".X", loc.getX());
pConfig.set("Homes." + name + ".Y", loc.getY());
pConfig.set("Homes." + name + ".Z", loc.getZ());

How would I go about looping through each name and getting the coordinates? I tried:

Map<String, String> homes = (Map<String, String>) pConfig.get("Homes");
    for(String name : homes.values()) {
        p.sendMessage(name + ": " + pConfig.get("Homes." + name + ".X")+ ": " + pConfig.get("Homes." + name + ".Y")+ ": " + pConfig.get("Homes." + name + ".Z"));
}

But got this error:

#

well they are stored as doubles, and I thought it would map "Homes" to "{name}"

#

either way it still says cannot cast

#

ok so logging pConfig.get("Homes"); shows

serene sigil
#

how do u check if an item is any shulker box (not like a specific color)

worldly ingot
#

Tag.SHULKER_BOXES.isTagged(Material)

quaint mantle
#

yes

#

so how do I get a list of the names of the homes with the x y and z properties

#

:/

serene sigil
worldly ingot
#

yep

serene sigil
#

thx

eternal oxide
#

or getValues() will return you a Map

quaint mantle
#

like this? claerly not cus error

eternal oxide
#

No, the name is the key in the map

quaint mantle
#

here is the format:

Homes.Home1.X: 0.0
Homes.Home1.Y: 0.0
Homes.Home1.Z: 0.0

Homes.Home2.X: 482.0
Homes.Home2.Y: 89.0
Homes.Home2.Z: -1728.0
silk burrow
#

Anyone know how to remap your own plugin to use classes that extend nms in another plugin? :p

eternal oxide
#

your yaml should not look like that

quaint mantle
#

i want a list of the homes (Home1 and Home2) mapped to the X, Y, and Z values

quaint mantle
eternal oxide
#

not with the code you showed

quaint mantle
#
Homes:
  Home1:
    X: 0.0
    Y: 0.0
    Z: 0.0
  Home2:
    X: 283
    Y: 24
    Z: -1278
#

It would look like that

eternal oxide
#
Homes:
  Home1:
    x: 0.0
    y: 0.0
    Z: 0.0
  Home2:```
#

yep

quaint mantle
eternal oxide
#

so if you get Homes you are being returned a MemorySection with keys of Home1, Home2

#
MemorySection homes = pConfig.get("Homes");
homes.getKeys(false).forEach( key -> { 
    sysout (key);
    sysout (homes.get(key + ".X"); });```
#

fixed 🙂

serene sigil
eternal oxide
#

pseudo of course

serene sigil
#

that hard?

eternal oxide
#

Inventory has a contains method

#

Which takes a Material

#

oh different Materials.

#

probably shorter than checking 56 slots 🙂

serene sigil
eternal oxide
#

no, inventory

#

well yes

#

you could use that code and then Inventory.contains(material)

worldly ingot
#

I'd argue that's a worse way to go about it because Inventory#contains() actually does iterate over all slots already

#

You're going to do way less iterations if you iterate over the inventory slots once and check if the tag contains the current slot's material

#

Only 36 iterations in the loop and an O(1) Set check

#
for (ItemStack item : inventory) {
    if (item != null && Tag.SHULKER_BOXES.isTagged(item.getType())) {
        return true;
    }
}

return false;```
#

(I always forget if the iterator contains null items, so uh... should probably double check that)

#

It does. Need a null check

eternal oxide
#

yep

serene sigil
#

getInventory returns a Itemstack[]?

eternal oxide
#

getContents()

serene sigil
#

oh ok

worldly ingot
#

Inventory is Iterable

#

Which iterates over its contents, yeah

quaint mantle
#

now I just need to get sign input working :/

#

https://www.spigotmc.org/threads/signmenu-1-16-5-get-player-sign-input.249381/
trying to use this

public static void getNewName(Player p) {
        SignMenuFactory.Menu menu = SetHome.signMenuFactory.newMenu(Arrays.asList("", "", ""))
                .reopenIfFail(true)
                .response((player, strings) -> {
                    PlayerInteract.signInput = strings[0];
                    return true;
                });
    }
public void onPlayerInteract(PlayerInteractEvent e) {
getNewName(e.getPlayer());
setHome(e.getPlayer(), PlayerInteract.signInput, bedLoc);
#

I don't see the problem

#

as soon as i get this working ill be done and out of ur hair

serene sigil
#

nvm it doesnt return for the shulker box (2nd for)

quaint mantle
#

um

#

if whats is what i think it is

#

im stupid

#

yeah, I never did menu.open(p);

eternal oxide
#

protcol lib packet error

#

version wrong?

quaint mantle
#
signData.getIntegers().write(0, ACTION_INDEX);
``` it's not liking this
eternal oxide
#

I've never used protocl lib

quaint mantle
#

do u know another way to get input from players without using commands or the chat?

#

ig for now I'll put in text input

quaint mantle
winged anvil
#

no lol

#

you might be able to figure it out tho

quaint mantle
#

yeah i did

#

does anyone have a thread on sign / anvil gui input

echo basalt
#

already gave you them

echo basalt
#

all it does is wrapping and reflections

#

it just adds getters to all types of fields so you can get the internal values from packets

quaint mantle
#

yeah i was trying to do that but it gave me some weird error. the error was from the code that person wrote

robust sinew
#

how do I check if an ItemStack is the right tool to break a certain block?

echo basalt
#

Weird data structure question

#

Mostly math

#

How would I go about getting the biggest possible cuboid that contains all the locations within a set (the set can be bigger than the volume, but the cuboid can't contain any location not specified in the set)

fading spindle
#

how would i give a play an item when an event is executed

drowsy helm
#

Add the item to their inventory

verbal slate
#

Hi everybody. Can you tell me why my events don't work?

#

I'm trying to make a GUI that will work as a menu, from where nothing can be taken or put into it. But it turns out that the GUI works like a chest, when you reopen it, you will see the same arrangement of all items inside it as it was when closing (if we put something there or took it from there)

native nexus
#

Have you debugged correctly that you are clicking in the correct inventory?

#

Also you probably don’t need to worry about whether the item stack is an item.

verbal slate
#

I also had the idea to make a getter for inventory, because I think that just inv is already a different inventory

native nexus
#

Or an old fashioned way is getLogger().info() or system.out.println

verbal slate
#

Okay, thank you

fossil lily
#

[20:52:49] [Server thread/WARN]: Illegal Entity Teleport EntityArmorStand['   '/840, uuid='69cd0542-0cd0-46a8-9fd1-85b31f89ad56', l='ServerLevel[world_nether]', x=-41.49, y=58.00, z=-185.70, cpos=[-3, -12], tl=2844, v=false] to ServerLevel[world]:net.minecraft.core.Position@50c1752c java.lang.Throwable: null
Whats an illegal teleport?

native nexus
fossil lily
robust sinew
#

(1.19 with remapped NMS) How do you get the correct tool type to break a block and how do you get the tool type of an item

Or in other words, how do I check if an item is the right tool type to break a block (shovel for sand / dirt, axe for wood, etc)

echo basalt
#

nmsPlayer.hasCorrectToolForDrops(nmsState)

pliant oyster
wide fern
#

so im becoming quite confused on how to initialize a final variable inside the onEnable event, and access it when an event is fired, only place i see to pass it is the register event

robust sinew
glad prawn
pliant oyster
#

ohhh I see now

#

you're returning true to the SignMenuFactory

verbal slate
#

I checked, but why does it turn out that current inv is different from class inv?

fluid river
#

instead of comparing inventories with .equals

#

just add custom inventory holder

#

and then check that holder of the inventory player is clicking on is instance of your custom holder

#

if it is, cancel the click/drag and other events

#

also add a check that clicked inventory is not null on InventoryClickEvent

verbal slate
#

Can you give me an example, please? This is my first time working with inventory

fluid river
#

because if you click outside of the inventory, e.getInventory() would return null

#

instead of null

#

do new MyCustomHolder();

#

create MyCustomHolder class

#

and let it implement InventoryHolder

#

and let it's getInventory() method return null cuz who cares

verbal slate
fluid river
#

yes

#

and now just use it for your inventory

#

and instead of inv.equals(inv2)

#

do event.getInventory().getHolder() instanceof CustomHolder

#

if it is, then inventory is your plugin's menu inventory

#

also

fluid river
#

so you will get NullPointerException when trying to get something

#

you are braking a pattern i guess

verbal slate
#

So, it turns out, I need to create a new CustomHolder in the inventory class constructor. And then compare e.getInventory with CustomHolder?

verbal slate
#

oh..

fluid river
#
Bukkit.createInventory(new CustomHolder(), ...);```
#
if (event.getInventory() == null) return;
if (!(event.getInventory().getHolder() instanceof CustomHolder)) return;```
verbal slate
#

Understood, thanks

fluid river
#

FREEJAVALESSONS

checkmybio

verbal slate
fluid river
#

i mean

#

you register events for new instance of enchantmentgui in onEnable()

#

and create another instances of enchantment gui in your SwordGUI class

#

you are not registering events for these instances

verbal slate
fluid river
#

idk

#

depends on your plugin structure

#

and what do you actually want to achieve

verbal slate
#

got it

fluid river
#

tho

#

you are breaking SOLID Pattern twice

#

Especially S

#

Single Responsibility Principle

#

don't make your class both work around events and also create inventories and stuff

#

you should have one class which listens to events

#

and one class which holds inventories and stuff

#

connect them by

  1. making second class a static utility class
  2. dependency injection
#

?di

undone axleBOT
verbal slate
#

Understood you. I've been doing wiki from spigot

fluid river
#

if you need any help feel free to dm me

CUZ FREEJAVALESSONS

verbal slate
#

ahahah, okay

sturdy elk
#

some one idea?

drowsy helm
#

use some method in constructor

#

or utilise OOP and have a custom item system

sturdy elk
#

i think i found the problem

drowsy helm
#

is that not supported?

sturdy elk
#

It is not

hasty prawn
#

Just remove the spigot()

storm schooner
#

hey how can i add some attrubutes to player for eg fire to a player or else should i use something else

sturdy elk
hasty prawn
#

Heh? What version are you using

sturdy elk
hasty prawn
#

Ah no wonder

sturdy elk
#

but i want compatibility for all

frail gale
#

How I can get the Item’s name?

hasty prawn
jagged monolith
frail gale
#

I mean I’ll maybe gonna need to use some NMS

jagged monolith
#

Try ItemStack#getType#name

frail gale
jagged monolith
#

If you want colors you need to use a displayname

frail gale
#

if you haven’t touched the ItemMeta then displayName is null

#

ItemMeta#getLocalizedName works?

jagged monolith
#

If you've set a localized name, then yes.

frail gale
#

finally I’ll use NMS I guess

fierce whale
#

Is there any way to play custom sound in resource peck?

worn tundra
fierce whale
fierce whale
#

Ahha we have String sound thx 🙂

quaint mantle
#

how do I send message?

quasi flint
#

to only one player

#

or to all players online

quaint mantle
quasi flint
#

ye

#

gimme a sec

quaint mantle
#

all g man

#

it was supposed to be sarcasm but all g

quasi flint
#

ah ok

frail gale
#

if you want to send a String Message use player.sendMessage(message);

#

no need to do player.spigot()

quasi flint
#

i looked at the wrong docks

#

dumb dumb

frail willow
#

hi, I'm a newbie learning to write plugins. I want to customize some item names, like when I use //set command, I hope I can simplify orange_stained_glass_pane to osgp, can anyone provide an idea of ​​how to implement this functionality?

serene sigil
#

there are gonna be probably a few duplicates...

frail willow
fierce whale
#

Whenever I reload my server, my plugin doesn't work.
For example, Every command is disabled. it return only it's usage message.
Above all there was no any error message in console.
Those any one know about this problem? 😢

jagged monolith
#

Let me guess. /reload? @fierce whale

fierce whale
#

yes reload confirm

jagged monolith
#

That is a big No No

#

It will break things.

fierce whale
#

break..?

jagged monolith
#

Yes. It can break plugins and cause them to stop working and have issues

#

Never /reload. Instead Restart the server. Or Stop and then Start it

fierce whale
#

but...

#

It doesn't work even I use stop command

jagged monolith
#

If your plugin doesn't work after you properly stop and start the server then your plugin is broken.

#

But still, don't use /reload ever.

fierce whale
#

ahha..

#

So...

#

If I wanna solve this problem..

#

I have to make new plugin.. than't right..? 😦

jagged monolith
#

No. Just fix what is broken with your plugin

earnest forum
#

/reload surely is fine for a test server right?

fierce whale
#

Ahh... Okay let me find something wrong

jagged monolith
#

PLugins don't get a chance to properly disable and save etc..

quaint mantle
#

Hey guys, as I know the spigot server is not the multi thread server Therefore, is there way to enable multi thread server?

earnest forum
#

can you even do that?

#

i think its a mojang thing

tardy flame
jagged monolith
#

Upto you. I'm just stating a fact. Im not here to debate it or anything. It's just how the command works. It forceably disables and enabled plugins. That's how it "reloads" the server. Which doesn't give plugins time to properly go through their disabling methods.

molten hearth
#

where can I find resources on how the anvil format actually works/what kind of information it stores?

crimson terrace
verbal slate
#

Hi guys. I have a certain number of items. How, having this number, is it possible to place objects in the gui in the center?
For example, if I have 3 different items, then they should be in slots 4, 5, 6 (if we are talking about 1x9 inventory)

jagged monolith
echo basalt
#

math

verbal slate
#

Here is a GUI with 36 slots. Conditionally, we have 10 subjects. Since slots from 0 to 9 are prohibited, then items will be in slots from 10 to 16, and 1 more item in slot 19.

#

When how do I mean that the last item should be in slot 22

lone musk
#

Hey, can we ask about NMS there?

opal juniper
#

you can ask but we might not know

lone musk
#

okay okay 👌

#

With loottable, how can I change the luck of a LootTableInfo ?

#

I tried adding the LOOTING_MOD parameter and also adding an item with the looting enchantment, but the LootTableInfo don't accept these parameters for i'm stuck for now :/

#

Here's my current code:

opal juniper
#

lemme open an ide

lone musk
#

Sure 👌

slim kernel
#

When I restart my bungeecord server it changes one part of my config (plots.root) to {} even tho I never set that anywhere. That doesnt happen on my spigot server. Through what could that happen?

#

The only time I set plots.root is in a command

lone musk
#

isn't it what you're doing at PlotCommand line 182?

#

maybe you don't execute the command through, therefore my question doesn't make any sense x)

slim kernel
lone musk
#

it happens when you restart the bungee right ?

#

is it clearing the section on stopping or starting through ?

slim kernel
lone musk
#

on start or stop ? 😂

slim kernel
#

thats how it looks normal:

  maxPlotAmount: 1
  plotSideLength: 98
  blocksBetweenPlots: 5
  root:
    '1':
      ==: org.bukkit.Location
      world: world
      x: -187.0
      y: 63.0
      z: 487.0
      pitch: 0.0
      yaw: 0.0
    '2':
      ==: org.bukkit.Location
      world: world
      x: -284.0
      y: 63.0
      z: 584.0
      pitch: 0.0
      yaw: 0.0
#

and thats after:

plots:
  maxPlotAmount: 1
  plotSideLength: 98
  blocksBetweenPlots: 5
  root: {}
eternal oxide
#

you are creating an empty root section

slim kernel
opal juniper
lone musk
#

you should check with cfg.has i think

#

it only works for some mobs

opal juniper
#

and you wanna boost it for all mobs?

lone musk
#

so ig some are just not dropping antyhing since i'm not lucky enough

#

that's why i'm trying to increase that luck

opal juniper
#

what happens if you make 50 much higher

lone musk
#

didn't tried

#

pretty much the same

opal juniper
#

hmm im not sure

#

i did try and it didnt really change yea

lone musk
#

there's others fields through for LootTableInfo.Builder

#

one requiring a float, another one with long + random

#

i'm gonna try some of these to see if it changes anything

opal juniper
#

id reccomend using mappings

#

mine is much nicer to read :)

lone musk
#

how did u get the unobf thing ? ;-;

#

it was hell already to add the nms to my gradle project lmao

opal juniper
#

ahahah

lone musk
#

are you using gradle?

opal juniper
#

im using paper userdev at the moment, but with spigot i think its not that hard, there is a guide somewhere for maven

river oracle
#

Just use maven with spigot it's not like gradle is actually better anyways if that's ur reasoning

opal juniper
#

gradle is better, i just dont know it

river oracle
#

Oh boy don't let frostalf see that

lone musk
ivory sleet
#

Ye

lone musk
opal juniper
#

you can only try?

lone musk
#

good point

chrome beacon
#

or if you're fine with Paper API you can use Paperweight

opal juniper
#

userdev is great for looking at source

chrome beacon
#

^

opal juniper
slim kernel
lone musk
#

can't manage to make it work

#

okay nvm, let's just keep obf things

molten hearth
#

where can I find resources on how the anvil format actually works/what kind of information it stores?

serene sigil
#

how do u get an itemStack from a block?

lone musk
#

the items the block drops?

#

or the item used to place the block

#

if it's the item to place it (like emerald ore, you want the emeral ore block), use Block#getType

#

for the items it drops i only know a way using nms, but for newer version i'm sure it's possible through a method like break or smth

serene sigil
#

not itemstack

slim kernel
lone musk
#

or you meant Material ?

#

what's "Item" for you

serene sigil
lone musk
#

that's the entity

#

like the item you drop on the found

serene sigil
#

basically what im doing is checking if the shulker box u placed has a dragon egg inside, however this doesnt work

#

(the 2nd if)

serene sigil
lone musk
#

wait, can event handlers method be static? never knew that x)

#

so you want to get the shulker's content basically?

serene sigil
#

ye, i want to check if the shulker i placed has a dragon egg and if yes, it returns the loaction of that shulker

lone musk
#

cast the block's state to a Shulker

serene sigil
#

it is tho

lone musk
#

Yeah

#

As it extend Container you can use

serene sigil
#

wdym?

languid flare
#

Hello, can someone help me with a code?

lone musk
#

then check the items in it

chrome beacon
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!

tranquil dome
#

I'm getting this error and I do not have two classes that extend JavaPlugin. All I did was copy over one of my previously made plugins, changed the name of it and used it as a base for this one.

Could not load 'plugins\ShinobiMechanics-v1.0.0.jar' in folder 'plugins'
org.bukkit.plugin.InvalidPluginException: java.lang.IllegalArgumentException: Plugin already initialized!
chrome beacon
tranquil dome
#

I don't do that either, I pass 'this' to methods that need to access it

chrome beacon
#

Is that the entire error?

#

or is there a stacktrace

tranquil dome
#
[15:15:16 ERROR]: Could not load 'plugins\ShinobiMechanics-v1.0.0.jar' in folder 'plugins'
org.bukkit.plugin.InvalidPluginException: java.lang.IllegalArgumentException: Plugin already initialized!
        at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:133) ~[paper.jar:]
        at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:331) ~[paper.jar:]
        at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:254) [paper.jar:]
        at org.bukkit.craftbukkit.v1_8_R3.CraftServer.loadPlugins(CraftServer.java:293) [paper.jar:]
        at net.minecraft.server.v1_8_R3.DedicatedServer.init(DedicatedServer.java:202) [paper.jar:]
        at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:549) [paper.jar:]
        at java.lang.Thread.run(Unknown Source) [?:1.8.0_321]
Caused by: java.lang.IllegalArgumentException: Plugin already initialized!
        at org.bukkit.plugin.java.PluginClassLoader.initialize(PluginClassLoader.java:123) ~[paper.jar:]
        at org.bukkit.plugin.java.JavaPlugin.<init>(JavaPlugin.java:66) ~[paper.jar:]
        at dev.bloedarend.plugin.Main.<init>(Main.kt:8) ~[?:?]
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_321]
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) ~[?:1.8.0_321]
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) ~[?:1.8.0_321]
        at java.lang.reflect.Constructor.newInstance(Unknown Source) ~[?:1.8.0_321]
        at java.lang.Class.newInstance(Unknown Source) ~[?:1.8.0_321]
        at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:77) ~[paper.jar:]
        at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:129) ~[paper.jar:]
        ... 6 more
Caused by: java.lang.IllegalStateException: Initial initialization
        at org.bukkit.plugin.java.PluginClassLoader.initialize(PluginClassLoader.java:126) ~[paper.jar:]
        at org.bukkit.plugin.java.JavaPlugin.<init>(JavaPlugin.java:66) ~[paper.jar:]
        at dev.bloedarend.plugin.Main.<init>(Main.kt:8) ~[?:?]
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_321]
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) ~[?:1.8.0_321]
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) ~[?:1.8.0_321]
        at java.lang.reflect.Constructor.newInstance(Unknown Source) ~[?:1.8.0_321]
        at java.lang.Class.newInstance(Unknown Source) ~[?:1.8.0_321]
        at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:77) ~[paper.jar:]
        at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:129) ~[paper.jar:]
        ... 6 more
chrome beacon
#

Could you send your Main class

#

also what plugins are installed?

#

Are both of your plugins installed

tall dragon
tranquil dome
#

Hold on, I've changed the main method to something different. This seems to fix it but I've got another error now

chrome beacon
languid flare
#

How can i create rank plugin (bungee)?

chrome beacon
#

I'd just use LuckPerms

ivory sleet
#

Well, they should use LP

#

Unless you have very good warranted reasons not to

chrome beacon
#

They probably don't

tranquil dome
#

So I've refactored the Main class to ShinobiMechanics. I've also changed the path to the main class in my plugin yml, but I get this error. No idea what it refers to, does anyone know what it means?

[15:21:11 ERROR]: Could not load 'plugins\ShinobiMechanics-v1.0.0.jar' in folder 'plugins'
org.bukkit.plugin.InvalidPluginException: java.lang.NoSuchMethodError: dev.bloedarend.plugin.utils.Configs.<init>(Ldev/bloedarend/plugin/ShinobiMechanics;)V
        at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:133) ~[paper.jar:]
        at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:331) ~[paper.jar:]
        at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:254) [paper.jar:]
        at org.bukkit.craftbukkit.v1_8_R3.CraftServer.loadPlugins(CraftServer.java:293) [paper.jar:]
        at net.minecraft.server.v1_8_R3.DedicatedServer.init(DedicatedServer.java:202) [paper.jar:]
        at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:549) [paper.jar:]
        at java.lang.Thread.run(Unknown Source) [?:1.8.0_321]
Caused by: java.lang.NoSuchMethodError: dev.bloedarend.plugin.utils.Configs.<init>(Ldev/bloedarend/plugin/ShinobiMechanics;)V
        at dev.bloedarend.plugin.ShinobiMechanics.<init>(ShinobiMechanics.kt:13) ~[?:?]
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_321]
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) ~[?:1.8.0_321]
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) ~[?:1.8.0_321]
        at java.lang.reflect.Constructor.newInstance(Unknown Source) ~[?:1.8.0_321]
        at java.lang.Class.newInstance(Unknown Source) ~[?:1.8.0_321]
        at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:77) ~[paper.jar:]
        at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:129) ~[paper.jar:]
        ... 6 more
#

Line 13:

private val configs = Configs(this)
chrome beacon
#

Does that constructor exist

#

Also are both of your plugins installed?

#

and do both of them contain the Configs class

tranquil dome
#
class Configs(private val shinobiMechanics: ShinobiMechanics) {
    // Make the HashMap 'static'.
    companion object {
        private val configFiles: HashMap<String, YamlDocument> = HashMap()
    }

    fun reloadConfigs() {
        for ((_, value) in configFiles) {
            value.reload()
        }

        // Pass the new instance of the configs to the utils.
        shinobiMechanics.messages = Messages(this, shinobiMechanics.modules)
        shinobiMechanics.events = Events(this, shinobiMechanics.helpers, shinobiMechanics.messages, shinobiMechanics.modules)
        shinobiMechanics.commands = Commands(this, shinobiMechanics.events, shinobiMechanics.messages, shinobiMechanics)
    }
}
tranquil dome
#

and both contain the same class yes

chrome beacon
#

There's your problem

#

You have two classes with the same name and package

tranquil dome
#

So I cannot share those for any class or package between plugins at all?

chrome beacon
#

You can share you just can't have two of the same class

#

To prevent conflicts between your plugins you should use unique package names

tranquil dome
#

So this would not work, unless I have different package names

chrome beacon
#

Change your package name to dev.bloedarend.shinobimechanics instead dev.bloedarend.plugin for example

tall dragon
chrome beacon
tall dragon
#

ah nvm

tranquil dome
chrome beacon
#

You can do that if you want it's not required. They can all be dev.bloedarend.shinobimechanics (assuming no conflicting class or package names). It's up to you how you structure your plugin

tranquil dome
#

version specific modules share the same class names

chrome beacon
#

Basically the way Java identifies classes is by their package name + class name

#

if there's more then one it doesn't know what to do

tranquil dome
#

i see

glossy venture
#

domain.project.module is what i usually do

robust sinew
#

I have a problem: Block#isPreferredTool returns true for dirt and wood and leaves and other blocks even if you are using a pickaxe since it still drops items if you break it with a pickaxe. Is there a method that makes it so it only returns true if the block has the correct tool that speeds up breaking it?

molten hearth
#

does anyone know of client-side mods to debug invalid packets?

opal juniper
robust sinew
#

would that be inefficient though?

opal juniper
#

oh yes

robust sinew
#

whatever

#

so I would run that for every diamond type of tool and find the lowest number then?

#

would that work?

tranquil dome
#

I'm trying to spawn a FishHook entity with no gravity that should work on versions 1.8 and up. What would be the best way to do this? Haven't looked into the gravity yet, but something like spawning the entity itself does not work and results in this error:

https://paste.md-5.net/ukafuwutab.pl

robust sinew
#

?paste

undone axleBOT
robust sinew
#

use that instead of flooding the chat with code / errors / stuff

#

its also easier to read

tranquil dome
#

there ya go

robust sinew
#

something is wrong with the way you're spawning the fishhook

#

can you send that PlayerToggleSneakEvent as well

tranquil dome
#

This is how I do it.

  @EventHandler
    fun onPlayerToggleSneak(event: PlayerToggleSneakEvent) {
        val player = event.player

        player.sendMessage("sneakEvent")
        if (player.isSneaking) {
            player.sendMessage("isSneaking")
            val fishHook: FishHook = player.launchProjectile(FishHook::class.java)
            fishHook.velocity = player.location.direction.multiply(2)
        }
    }
robust sinew
#

is this kotlin?

tranquil dome
#

yes

robust sinew
#

I can't help you there I'm pretty dumb sorry

#

someoen else might be able to though

hasty prawn
#

You just can't spawn a fish hook with launchProjectile

#

You have to spawn it some other way

robust sinew
#

oh yeah you need to get the player's world and add it to the world first right?

tranquil dome
#

(in java)

  @EventHandler
    public void onPlayerToggleSneak(PlayerToggleSneakEvent event) {
        Player player = event.getPlayer();

        player.sendMessage("sneakEvent");
        if (player.isSneaking()) {
            player.sendMessage("isSneaking");
            FishHook fishHook = player.launchProjectile(FishHook::class);
            fishHook.setVelocity(player.getLocation().getDirection().multiply(2));
        }
    }
tranquil dome
hasty prawn
#

Try spawnEntity maybe? If that doesn't work then you might have to use NMS

tranquil dome
hasty prawn
#

What'd it say

tranquil dome
#

I get the same error. It was the method I had tried before using player.launchProjectile

hasty prawn
#

Maybe Google it and see if someone else has figured it out with the API

tranquil dome
#

Could only find some old threads that made their own fishhook by extending EntityFishingHook

wet breach
#

that should probably fix your problem 😉

tranquil dome
#

I'll give it a try but it's deprecated

wet breach
#

deprecated doesn't mean unusable

tranquil dome
#

It does spawn it in, but, it doesn't live for too long

wet breach
#

progress at least 🙂

tranquil dome
#

It despawns because I am not holding a fishing rod I assume

wet breach
#

that would be correct

tranquil dome
#

Because when I hold one, it just casts it like normally

#

Is there a way to bypass this?

wet breach
#

Yes there is a way to bypass it

#

you either use the API to trick the server into thinking the player is holding an item that it isn't

#

or you use NMS

robust sinew
#

how do I go from a Spigot BlockState to an NMS BlockState?

eternal night
#

nms block stats is not spigot block state

#

the equivialent would be block data in spigot

robust sinew
#

ah ok

eternal night
#

block states are closer to block entities

robust sinew
#

well how would I turn the block data to the nms blockstate

wet breach
#

there should be methods somewhere to grab it as an NMS copy

#

the data that is

#

no guarantees of it working, generally a pain to go from NMS to API or vice versa

eternal night
#

specifically CraftBlockData#fromData

robust sinew
#

ok thanks

eternal night
#

wait

#

wrong way xD

glossy venture
eternal night
#

((CraftBlockData) data).getState()

tranquil dome
# wet breach you either use the API to trick the server into thinking the player is holding a...

So, to trick it I'd assume you mean to put a fishing rod into the player's hand and then remove it later? I don't really want to do this because the player should be able to hold other items while they are casting the fishing rod. The hook also despawns the moment the player lets go of their fishing rod, so they should be holding it for a long time. So I'm guessing I'll have to use NMS. Is there any method I can use in specific, or do I need to create my own class that extends EntityFishingHook?

wet breach
#

that last part

#

this is why we need more elders of spigot/cb code

#

if I wasn't here, this person wouldn't have gotten closer to solving their problem 😄

tranquil dome
serene sigil
pallid oxide
#

sadly chatpreviews are removed on 1.19.3

robust sinew
#

and it worked somehow

#

but it only works for pickaxes. isPreferredTool would work better for other tools like shovels and axes

cobalt marlin
#

what is the player hunger event called? nvm found EntityExhaustionEvent

tranquil dome
#

These are all private tho. To override the method, how should I get these values?

opal juniper
#

reflection

robust sinew
#

what's the point of making a method private anyways?

#

I've never understood that

#

what does it change?

hazy parrot
#

Principle of oop

#

Encapsulation and data hiding

cobalt marlin
robust sinew
#

I just never ended up learning some stuff about programming

#

I didn't take any classes and I taught myself

midnight shore
#

Hi, how can i get all the blocks a bounding box contains?

wet breach
#

been a while since I had looked at anything with the fishing rod

tranquil dome
# opal juniper reflection

So I can use .getClass().getDeclaredField() to get the field, but which object should I use. Should I create new EntityFishingHook inside the custom class?

robust sinew
#

thats what I got from reading about it

#

then again I am dumb so idk

molten hearth
wet breach
tranquil dome
#

But I want to access EntityFishingHook's private fields

wet breach
#

then spawn your class as the entity since it is extending one already

wet breach
tranquil dome
#

Yea, I googled about reflection and you can get a field by object.getClass().getDeclaredField()

#

but, I am wondering which object to get the field from.

wet breach
#

but I am not sure with updated java versions if you are able to change something from being private though

midnight shore
#

what?

#

what do i iterate?

wet breach
#

well you have two known points

#

an upper point AKA the max, and a lower point AKA the minimum

wet breach
# midnight shore what do i iterate?
Location point1 = <yourfirstlocation>;
Location point2 = <yoursecondlocation>;
Vector max = Vector.getMaximum(point1.toVector, point2.toVector());
Vector min = Vector.getMinimum(point1.toVector(), point2.toVector());
for (int i = min.getBlockX(); i <= max.getBlockX();i++) {
  for (int j = min.getBlockY(); j <= max.getBlockY(); j++) {
    for (int k = min.getBlockZ(); k <= max.getBlockZ();k++) {
     list.add(i,j,k); //or however you are wanting to store the locations
    }
  }
}
mighty pier
#

someone send tutorial on completable futures 👉 👈 😊

mighty pier
#

makes sense

#

when do i use it

#

give example

#

s

#

pls

cobalt marlin
#

read the page i sent

#

literally first sentence

mighty pier
#

code example

hazy parrot
#

/shrug if you are not willing to read I don't think anyone woujld just send plain example

#

Discord smh

echo basalt
#

here

tranquil dome
#

@wet breach So now I've got my own class, but can't seem to launch it as a projectile, even tho it extends EntityFishingHook.

wet breach
#

yeah this is where you are going to have to do some trial and error and digging around 🙂

tranquil dome
solar orbit
#

and yes im calling the #spawnAt method

chrome beacon
#

Have you tried setting the entities position before spawning it

#

instead of teleporting it

solar orbit
#

no, how?

chrome beacon
#

setPos iirc

solar orbit
#

ill test it

chrome beacon
#

Make sure to set it before adding the entity to the level

solar orbit
#

yes

#

no, isnt working

#
        BotIntelligence.botIds.add(uuid)
        this.setPos(location.x, location.y, location.z)
        level.addFreshEntity(this)
        return this
    }```
#

and i use the 1.19.2 if it helps

midnight shore
#

Hi, how can I rayTrace for all the entities? I mean literally how can i make a rayTrace?

languid flare
#

How does HashMap work?

tardy delta
#

It is a collection that holds key value pairs

#

Ig you're not asking about the internal impl

midnight shore
#

How can i get all the nearby entities to a location?

#

with a specified radius

tardy delta
#

Isn't there a method in the bukkit class for that

#

Im in train so Cant really look

midnight shore
#

let me see

tranquil dome
#

How can I get a private field by using reflection that is a custom type such as EntityHuman or Block? I can't cast it

solar orbit
eternal oxide
#

Kotlin and nms, good luck getting a reponse

solar orbit
#

the entitiy is null

#

so the spawned zombie

midnight shore
eternal oxide
#

what entity is null? Your entity is instanced by you.

solar orbit
#

when im using Bukkit.getEnitity(uuid) there is no entity

#

so the entity didnt event get spawned?

river oracle
eternal oxide
#

no idea on Kotlin. In Java you use the nms and call getBukkitEntity

solar orbit
#

okay, wait

#

you can just tell me what to do in java

eternal oxide
#

your addFreshEntity shoudl be creating a Bukkit Entity

#

but that is Kotlin so I have no idea how you are assigning bukkitEntity

#

you seem to have no assignment for it

#

the nms to get the Bukkit entity should be (in the Class) this.getBukkitEntity()

solar orbit
#

ah yeah

#

and what should i do with this entity?

eternal oxide
#

You have a reference to a field bukkitEntity straight after adding to the world but no assignment to set it.

solar orbit
#

yes, this is getBukkitEntity()

eternal oxide
#

I don;t know Kotlin so no idea where/if you are even using that

shadow gazelle
#

Do Spigot mappings use Searge or does Spigot have its own format for mappings?

eternal oxide
#

it doesn;t look like you are to me

solar orbit
#

so the bukkitEntitiy is in java -> this.getBukkitEntity

eternal oxide
#

OK, if that is so then there is no reason for your bukkitEntity to return null

#

If you set the posRot on the Entity you should not need to teleport it

solar orbit
#

yeah, but no entity is spawning

#

this is the problem

#

and sorry, the entity isnt null

eternal oxide
#

Yeah, Kotlin is all I can say. That is so ugly I can;t really help.

drowsy harness
#

Not really Spigot, but here goes: I wish to save statistics on.. everything. If a player breaks a block, it should save the block type. If a player places a block, it should save what block was saved (not really where, etc). I'm hoping to also being able save these with dates of some kind, so you can sort by last week, last month, etc. What is the cleaneast way to structure the database tables for this and also reaching the highest performance? I'm thinking that inserting each block that was broken will quickly flood the database and make it slow.

solar orbit
#

but then the entity is gone

eternal oxide
#

perhaps your location is wrong?

solar orbit
#

but, im just use setPos

#

and no teleport

twin venture
#

Hi , iam working on a way to check if the quest started time is the same as now :
this is my code i will be happy for anyone to help with changes :

#

just want to know if iam doing anything wrong .

solar orbit
#

okay that embarasing

eternal oxide
#

That would do it 🙂

solar orbit
#

thank you

earnest knoll
#

anyone know how to remove Repair from McMMO?

fluid river
#

disable in config?

earnest knoll
#

got it

#

couldnt find it config for me but changed the blocks to unobtainable ones

fluid river
#

JREE FAVA LESSONS

remote swallow
#

jree?

#

fava?

fluid river
#

yes

#

F# + Java

#

Java Runtime Environment Enterprise

robust sinew
#

what event would I use to get whenever the player attacks an entity?

#

thanks

#

in that event, event.getDamager(); is the entity that does the damage, and event.getEntity(); is the entity taking the damage?

grim ice
fluid river
#

no

fluid river
#

if damager instanceof player

robust sinew
#

and if getEntity instanceof monster

#

thanks

molten hearth
#

what packets are required to display a world?

#

im assuming just Chunk Data and Update Light after login and then tp the player to the chunk?

native ruin
#

does anyone know how to deal with this?

Blocked mirror for repositories: [upstream (http://ci.nametagedit.com/plugin/repository/everything/, default, releases+snapshots)]

Since Maven 3.8.1 http repositories are blocked.

Possible solutions:
- Check that Maven pom files do not contain http repository http://ci.nametagedit.com/plugin/repository/everything/
- Add a mirror(s) for http://ci.nametagedit.com/plugin/repository/everything/ that allows http url in the Maven settings.xml
- Downgrade Maven to version 3.8.1 or earlier in settings```
I don't seem to have a settings folder and changing `http` to `https` sends a 503 response
tardy delta
#

best thing i saw today

molten hearth
#

lmao wtf

sacred mountain
#

ello anyone know if creating schematics through the worldedit api purely through written code and not ingame is a thing?

#

like generating schematic files

#

or having a set of blocks with positions to set in-game

tardy delta
#

wondering if i = i == 100 ? 100 : i will be optimized to an if check by the compiler or jit

mighty pier
#

why red bruh

sacred mountain
#

does the operation work before the condition

#

or is that just my python lectures leaking in

mighty pier
sacred mountain
#

nvm nah java ternary operators work different

honest echo
#

i saved custom name on a arrow and when i tried to get it back it returning null

tardy delta
mighty pier
#

woher ist die Comma

tardy delta
#

also check if player::isOnline

sacred mountain
#

if (i != 100) i = 1;

i guess

#

nvm

tardy delta
#

}, 400

sacred mountain
#

i misread

mighty pier
#

a

sacred mountain
#

i thought u were setting it to 1 lmao

tardy delta
#

just wondering

sacred mountain
#

fourteen

#

the performance difference is not really an issue

tardy delta
#

im not talking bout performance, just wondering

sacred mountain
#

for assignment especially primitives i wouldnt think it would make an impact

#

and no thats probs the most compact ur gnna get that unless there's some method i haven't come across

#

i've come across a problem

#

i'm working on a redstone plugin but it's come to the copy-pasting, and everything gets updated, observers, pistons, etc

#

also how do i paste down a block in a certain state like a piston that's extended, or a block that's connected to a piston

#

damn my head hurts imma use the worldedit api

fickle mist
#

Hi all! I have a question how to get the last message of the player, I know that you can receive it through the Scanner, but it is more for the console. Is there a replacement for the scanner? (I need to compare the received number with another later)

sacred mountain
#

scanner?

#

just listen to player chat and store it in a map

#

idk if they changed it in like 1.19.2 tho chat got a bit screwed

fickle mist
sacred mountain
#

well then use ur command listener and store the message?

#

using the default command, the params are a primitive string array i think so you can just String#join(" ")

normal loom
#

Hello folks, is there a method to check when a player's visual is moving?

tardy delta
#

check PlayerMoveEvent

remote swallow
sacred mountain
#

lmao

#

?paste