#help-development

1 messages Β· Page 2097 of 1

tranquil viper
#

Ah

#

I would recommend making a custom gui system like hypixel skyblock if you have the time & knowledge

quaint mantle
#

i was

#

LITERALLY

#

telling him how to

#

πŸ˜‚

#

Hey majin mind helping with a basic thing

formal radish
#

its alright he was just tring to help lol

quaint mantle
#

sure wsp

tranquil viper
#

Oh I thought you were telling him something else

#

My fault haha

quaint mantle
#

nah its good

#

i prolly shouldve said

#

I switched to excellentcrates, to make the chest cost a key what do i add to this code

#

Cost:
MONEY: 0.0
EXP: 0.0

#

I wanna remove the money/exp

#

and add the cost of 1 key

quaint mantle
#

Which do u recommend?

#

wait you dont need to edit the config for this

#

goldencrates renamed to excellentcrates for whatever reason

#

they should have a builtin editor gui, or atleast they did the last time i used it

#

Yeah but it only specifies money/exp to open the chest and i want them to use a key

tranquil viper
# formal radish its alright he was just tring to help lol

I'll lay it out for you, not sure why this is so confusing.

A) Make a method that creates your custom crafting table (or make a custom crafting table class/wrapper if you choose)
B) Listen to PlayerInteractEvent for your crafting table, if you're worried about performance don't compare with stripColor or titles, it's really taxing.
C) I would probably make a 2d array of the section that you can use as a crafting section. Then listen in there for your recipe
D) If all the slots are filled for a recipe then put the item to craft in the Recipe Results Section

quaint mantle
quaint mantle
quaint mantle
tranquil viper
#

Well that's your best bet if you're making a custom crafting gui

#

But sure if you just want to add recipes that's fine aswell

formal radish
#

if I can use the work bench one then id rather do that

#

cause it looks a lot better

quaint mantle
#

ok

#

create your workbench gui

#

then listen to the inventoryclickevent

#

if the inventory isnt yours, return

#

Ok so dumb question

#

then loop through the items in the inventory (make sure to ignore the extra spots around it)

#

It gave me a tripwire_hook with nbt tags. How do i know what the ID is to give players

quaint mantle
#

if it does, set the item in the result slot to the custom item

#

easy done

formal radish
#

makes sense

#

thanks for the help

quaint mantle
#

np

tranquil viper
#

If you just want to do custom recipes, you can add custom recipes like so:

ShapedRecipe sr = new ShapedRecipe(NamespacedKey.minecraft("bangun"), banGun);
        sr.shape("   ",
                 "DDD",
                 "S  ");

        sr.setIngredient('D', Material.DIAMOND);
        sr.setIngredient('S', Material.STICK);
quaint mantle
#

not what he wants

tranquil viper
#

Ah ok

#

nvm then

quaint mantle
#

i mean i recommended that to him

summer scroll
quaint mantle
#

even easier with just a normal inventory

quaint mantle
#

cause then you dont need to mess with the shitty item slots of a workebnch

summer scroll
#

what if i want to create a recipe with specific slot

quaint mantle
#

embed fail

summer scroll
#

shaped recipe or something

#

like i only want the recipe to work if they are placed in the configured slot

quaint mantle
#

gotta verify yourself

formal radish
#

ah

#

makes sense

quaint mantle
#

if you werent worried about the order then you'd probably sort by hash (my guess)

rugged cargo
#

huh! i didn't realize you could reference the slots from the general inventory object! good to know for the future. (friendly bystander here) :)

quaint mantle
quaint mantle
#

When i created the key with the plugin it gave me a tripwire_hook with 3 nbt tags. Its a custom name called "votekey" how do i get the item id for that so that i can make it when players vote to give them that id

rugged cargo
quaint mantle
#

only bad thing about you is the c++ pfp picture

#

rust is simply surpreme.

rugged cargo
#

yeah, thats fair enough

#

never tried it, ill have to someday :D. that day ain't today

quaint mantle
#

what are you trying to do exactly

#

So im trying to reward players with the key from that plugin i made to give to players when they vote so they can open the chest

#

what vote plguin are you using

#

nuvotifier

#

and voting plugin

#

link

#

Its not the voting plugin thats the issue though

#

well you need the voting plugin to give the item in the first place

#

I just need to know how im able to get the key id

#

I already know how to give them the key

#

then whats the issue (sorry im just not understanding)

#

So.

rugged cargo
#

would permissions be of use here? (legitamate question)

quaint mantle
#

I got excellentcrates, which yes its goldencrates renamed. When i am in the GUI and created the crate, i also created the key in which it gave me in my inventory slot. I need to know the ID of the key so i can then input that and give it to players when they vote through votifier

#

id being the material id?

#

Yes but when it gave me the key it was named and everything.

#

the code in votingplugin is poop

#

like its really fkin bad

#

So you are not sure how to do so?

#

im not even sure if the plugin is capable of giving custom items

rugged cargo
#

FYI, particles across a water barrier act really strange. i.e. looking into the water from abovfe when there are particles makes them invisible, and reverse for looking out of the water from in it. weird rendering issue that im not sure is fixable. lol. #BugsAreFun

quaint mantle
#

The plugin literally generated the key for me

#

It put it in my hotbar

#

what

sterile token
#

How i check if path is String or List<String>

#

I have tried with path instaceof List<String> and im getting errors

summer scroll
#

For config?

sterile token
#

Yup

summer scroll
#

There is FileConfiguration#get, it will return an Object, but you might as well make the path a list string

#

There's no need to make a path can have different object imo

sterile token
#

Hum

#

I ask because im doing something like:

void send(String path, Player player)

summer scroll
#

What does send do?

sterile token
#

Send the message of the path to player, but i need to first check if its either a String or List<String>

summer scroll
#

Why do you need to check that?

sterile token
#

Because it could break?

summer scroll
#

So the config path can be a List<String> because you want to send a multiple messages, right?

rugged cargo
#

is the PlayerInteractEvent the best event to listen for to detect when a player makes a path block with a shovel?

sterile token
#
Test: "Just a string message"
List-Test:
  - "Just a list string of message"
  - "Just a list string of message"

So having that structure i need to able to send the player a message string when the path is String

#

Or if path is List<String> send it doing a foreach

summer scroll
#

What's the different about this?

test: "Just a string message"
list-test:
  - "Just a string message"
sterile token
#

Do i expΓ±ained?

summer scroll
#

It will send the same message

sterile token
#

Hee?

#

I dont think im explaining what i need

#

:/

#

Oh let go again

#

player.sendMessage() doesnt allow me sending List<String>

summer scroll
#

I know what you mean

#

You can use a string list to send a single message

#

Instead making it complicated, you can make the path only a list string

sterile token
#

You will choose when you configuring the yaml

#

Im just doing a lib

#

So if i only allow sending path of type String then he will want to send a path of type List<String> and it will explote

#

πŸ€”

#

Do i explained?

summer scroll
#

The config value is for sending a message right?

#

I'm saying you could receive the same result If you use only List<String>

sterile token
#

No

#

Because will still explote if List<String> contains more than 1 line

#

😁

summer scroll
#

You could check for the size of the List

sterile token
#

Its possible to check the type or not?

summer scroll
#

Yes

sterile token
#

We are over doing diff

#

When it easy

#

Its simply just check if type i list<string> or string and its done

#

πŸ€”

#

I dont know why its diff to explain it

#

Maybe because im not native english

summer scroll
#

I'm just saying I don't see why you want to do that

#

but anyways

#

Check with FileConfiguration#get, it will return an Object

sterile token
#

Yes i know that

summer scroll
#

You can debug the Object type

sterile token
#

But i dont know how to check if that object is string

#

Because getConfig()#get(path) instaceof List<String> doent work

summer scroll
#

You can debug it first to see

sterile token
#

Oh lmao

#

I will search on google

#

Because i think u dont understand me

summer scroll
#

I completely understand you

sterile token
#

So why are you confusing me?

#

If its simply to check using instaceof

#

πŸ€” πŸ€” πŸ€” πŸ€” πŸ€”

summer scroll
#

I told you to debug the class name so you'll know what to put on the instanceof

sterile token
#

Why?

#

No need if String and List<String> are object types

noble lantern
#

or

#

isEmpty()

sterile token
#

And if its a string

#

Im the same

#

It will explote

noble lantern
#

getString == null
or
isEmpty()

sterile token
#

No one understand

#

Hum

noble lantern
#

if (getStringList() == null || isEmpty() {
getStringHere
}

#

we do you just dont understand what were trying to tell you

summer scroll
#

will getStringList return null or empty?

noble lantern
summer scroll
#

okay xd

noble lantern
#

will take someone 2 seconds to test it

summer scroll
#

afaik it will empty

noble lantern
#

i think so as well, but too lazy to confirm xD

sterile token
#

The config path can either be String or List<String> so if check the path as List<String> and its a string it will explote, and viceversa will happen the same

noble lantern
#

i can check docs

noble lantern
sterile token
summer scroll
#

I told you to debug the class type

sterile token
summer scroll
#

So you'll know what to compare

noble lantern
sterile token
#

I only need to check if the path he is sending is a String send the player the string and if it a List<String> send each string to him

noble lantern
#

So like this correct:

#

sry discord lag

sterile token
sterile token
#

HMN

#

5th round again

noble lantern
#

Check if its a list or string first by checking isEmpty or is null

#

idk how this is that hard to understand...

sterile token
#

HM

summer scroll
#

idk why someone would do that

#

i dont see the use case

sterile token
#

Yeah

#

I need isntaceof

#

But i told many times

#

Since i start

#

πŸ˜‚

noble lantern
#

You dont use instanceof for this

sterile token
#

why?

#

If i need to check what is the type of object

#

πŸ₯Ί

noble lantern
#

check if getStringList is empty

#

if its empty, then its a string

sterile token
#

I cannot check like that because they can leave empty list

#

HUM

#

πŸ€”

#

So will still explote

summer scroll
#

burchard

#

okay

noble lantern
#

is !isList

its a string

#

Read the javadoc i sent

#

look

#

even a isString method

summer scroll
#

you can receive the same result without using instanceof

#

why are you determined to use instanceof

sterile token
noble lantern
#
if (config.isList("value.value")) {
    config.getStringList("value.value");
} else if (config.isString("value.value")) {
    config.getString("value.value"):
} else Bukkit.getLogger().info("Uh oh! Invalid confiuration detected");

#

or similar

sterile token
#

I want to use:

boolean ? is a string : is a List<String>

#

😐

#

I dont want to much lines

#

Because the code looks harcoded

vocal tundra
#

why can't you just do that then how you've described it

noble lantern
#

return isList("path");

or

boolean isList = config.isList("path");

#

your overcomplicating this so much

sterile token
#

My method its a void

#

But that doesnt allow me to use:

getConfig().isList(path) ? getConfig().getStringList().forEach(player::sendMessage) : player.sendMessage(getConfig().getStrign(path));

summer scroll
#

of course you cant do that

noble lantern
#

because that method is used for returning values

#

not voids

summer scroll
#

as i told you, just use string list

sterile token
#

Oh fuck i need yes something for void

summer scroll
#

you can send a single message with string list

noble lantern
#

List<String> list = config.isList("path") ? config.getStringList("path") : null;

if (list != null) list.forEach(player::sendMessage);

iirc

#

if isList is false, null list, if true return list from config

#

idk i dont really use ternarys all that much

vocal tundra
#

how about just make a new list with 1 otherwise

#

then send everything 1 line later

noble lantern
#

or he can just force usage of lists

#

instead of allowing two different values

summer scroll
#

thats what i told him 10 minutes ago

sterile token
vocal tundra
#

Consistency is good πŸ‘Œ

summer scroll
vocal tundra
#

but if he wants to make both ways seriously if it's just a string make a new list with 1 element

sterile token
#

πŸ˜‚ πŸ˜‚ πŸ˜‚ πŸ˜‚

#

Like 5-6 times

summer scroll
#

you keep saying it will explode

noble lantern
#

back to figuring out EliteMobs configuration

sterile token
#

Now i find something else

#

Its possible to do:

send ("Message-Path", player, "{var-1}", var-1-value, "{var-2}", var-2-value)

#

I know that the vars, are just an Array

vocal tundra
#

Does anyone know the secrets behind creating an invisible shield

vocal cloud
#

Packets probably

sterile token
#
Object[] placeholders = {"{name}", "alex", "{age}", 25};
  Map<Object, Object> vars = IntStream.range(0, placeholders.length ).boxed().collect(Collectors.toMap(i -> placeholders[i], i -> placeholders[i++]));```

Why it print this:

alex : alex
{name} : {name}
25 : 25
{age} : {age}
#

When im doing i++ shouldnt be incremenedt, so it get the 1 value from the array ("alex")?

hasty prawn
#

i++ increments after

waxen plinth
#

i is a lambda parameter

vocal tundra
waxen plinth
#

It only exists in the scope of the lambda

#

Can you seriously stop trying to use streams and lambdas for everything

#

It's making your code much worse and you're making it our problem rather than just not using it unnecessarily

sharp bough
#

in this case, would the return stop the foreach?

#

like a for

waxen plinth
#

No

#

Because it's a lambda

#

All it does is return from the call

#

Effectively the same as a continue

#

If you want to, you can use takeWhile or allMatch

#

If you do allMatch then it will stop looping as soon as you return false

#

That being said, are lambdas necessary here?

sharp bough
#

interesting

sharp bough
waxen plinth
#

In this case it's really not

sharp bough
#

using a for loop seems a little robust

waxen plinth
#

Just use a regular enhanced for loop

#

There's no benefit to forEach here especially since you need to be able to break the loop

sharp bough
#

i dont

waxen plinth
#

The allMatch trick is only a workaround

#

Use a loop

noble lantern
#

seriousness is not an option

quaint mantle
#

Wtf how do i remove this

#

Its a chest from a lootchest plugin i installed but its not on my server

#

Its invisible and wont go away. Any way to possibly fix this at all?

noble lantern
quaint mantle
#

Cant send pics here

#

Or in other

noble lantern
#

gotta verify your spigotmc

#

?verify <name>

Cant remember the exact flow of it

chrome beacon
#

!verify

undone axleBOT
#

Usage: !verify <forums username>

noble lantern
#

^ ty

noble lantern
#

Intellij: Hey you know this could be null right
Me: No, its checking for null already
IntelliJ: HEY DID YOU KNOW THIS COULD BE NULL

maiden briar
#

Searching for a math genius: y = cos(x) * sin(0.5x)Β² (need to know x). Ping me if you know the answer

quaint mantle
#

finding x?

quaint mantle
noble lantern
#

This isn't really a development question but more or less a grammar question:

Say I wanted to generate a random name for an item, what would be the best combination of verbs, adjectives, and nouns combination(s) to achieve this? (More or less I just need ideas)

Most I can really think of is:

Noun Adjective Verb

EG:

Dad demonic design

But, that doesn't necessarily sound right IMO LMFAO

maiden briar
maiden briar
frigid rock
maiden briar
#

?

frigid rock
#

idk if you say it like that in english

#

like the Z thingy

maiden briar
#

Integer is number

quaint mantle
#

its just there

simple silo
#

This is a function, not a solvable equation

frigid rock
#

its a number inside the Z numeric set (do you say it like that? idk)

maiden briar
maiden briar
frigid rock
#

just 4 pi then

simple silo
#

Oh, you wanna a x = equation?

maiden briar
#

I have the answer of y

#

Wanna know x

frigid rock
#

y = 0 right?

maiden briar
#

Not in this case

frigid rock
#

mhm

maiden briar
#

Let's say, x is for example 45*

simple silo
#

You need a value for y if you wanna solve it

maiden briar
#

y = cos(45) * sin(0.5*45)Β² = 0.10355...

#

Now I want to revert that back to x

quaint mantle
#

what

simple silo
#

What is y?

quaint mantle
#

the y variable

quaint mantle
maiden briar
#

Yes

noble lantern
#

Sounds like some type of math homework/college homework question lmao

maiden briar
#

I am in secondary school, this is used in the haversine formula

simple silo
maiden briar
#

Yes, y is given

#

I have an y value, just need x

quaint mantle
#

y is the problem...

quaint mantle
maiden briar
#

For example, if x = 45, then y = 0.10355...

#

And if this for example 0.10355, then I want to get x back, in this case 45

frigid rock
#

mhm i think that there are no reverse functions for that, but i'm not sure

maiden briar
#

WolframAlpha doesn't give a clear answer too

#

Any math solves doesn't give a clear answer

frigid rock
#

where did you get this from?

simple silo
#

You would have infinite solutions for x

#

This is how your graph looks like

maiden briar
sullen marlin
#

It will if you constrain it [0, 2Ο€) or whatever your preferred interval is

quaint mantle
#

wish formatting wasnt so bad for math

#

is it this?

#

wait

#

i solved the inverse i think

#

shat

maiden briar
#

Huh inverse of * is /

#

But where is the y?

quaint mantle
#

ok.

maiden briar
#

Btw for the lat I didn't have such function, I could easily solve it

#

But can't for the lon

#

If I am calculating the distance to the equator

frigid rock
#

yo, how do you get the id of a task?

#

nvm got it

slim kernel
sand vector
crude loom
#

I would like to make a plugin with a skywars minigame that resets the map after every game, I plan on duplicating the world and sending the players to the duplicated world, once the game is over, I will delete the duplicated world. Is there a better way of approaching this?

slim kernel
#

Server crashing because of iterating through Json files

simple silo
#

is Vault safe to use on 1.18?

steel swan
#

hey, i kinda need help

#

i tried to add a library to my project, but like i used the modules, added the library and so on... but rn, when i m trying to test the plugin this happens

#

oh wait i cant send a picture

#

ok so :

#

the error : package org.inventivetalent.bossbar does not exist
the way i implement it : ```java

import org.inventivetalent.bossbar.BossBar;
import org.inventivetalent.bossbar.BossBarAPI;

the code its used in : ```java
@EventHandler
    public void onPlayerJoin(PlayerJoinEvent event) {
        Player player = event.getPlayer();
        if (!gamehasstarted){
            BossBar bossBar = BossBarAPI.addBar(player, // The receiver of the BossBar
                    new TextComponent("Hi " + player.getName() + "!"), // Displayed message
                    BossBarAPI.Color.BLUE, // Color of the bar
                    BossBarAPI.Style.NOTCHED_20, // Bar style
                    1.0f, // Progress (0.0 - 1.0)
                    20, // Timeout
                    2); // Timeout-interval
        }
#

if anyone knows how to solve this, could you pls help?

sharp flare
#

fixed this, only happens when a server updates the plugin, sometimes the nbt data gets replaced by a 1b or byte for no reason lol

#

that is for these one

frigid rock
steel swan
#

thats what i used

#

lemem show u

#

how? i just know how to implement it that way

frigid rock
#

<dependency>
<groupId>org.inventivetalent</groupId>
<artifactId>bossbarapi</artifactId>
<version>2.4.1</version>
</dependency>

#

paste this in the <dependencies> tag in your pom.xml

steel swan
#

ooooooh

#

i didnt know u had to thx !

frigid rock
frigid rock
steel swan
#

like this?

frigid rock
#

ye

steel swan
#

and then the reposistory

frigid rock
#

then click the lil' button to reload

steel swan
#

yeah thx

#

error

sullen marlin
sharp flare
#

yeah idk why it still receives illegalargument exception

steel swan
sharp flare
#

but the stacktrace tells the error

#

since It stores string, the data sometimes gets converted to 1b which is also a bool

sullen marlin
#

idk

#

write a reproducer

steel swan
#

bro stop

#

i m just asking for help

#

i did lmao

#

i just dk how this thing works

#

bro

#

i did 1 error and now u are like always making fun of it

#

ima just ignore u lmao

#

i did

#

but imma just not listen to u

#

the others are way nicer (:

#

Yes why

#

if u tell me to change i CANT

undone axleBOT
steel swan
#

and how do i not depend on the local jar

#

k wait 5sec

#

well, i get an other error and that one is cuz im using the bossbar library

#

but if i dont lemme check

steel swan
#

when i compile it i get that

#

i added it as a dependency yes

#

look at the pom i sent u

#

nope thats the whole error

#

when i try reloading the maven

#

i gtg get some food rn brb

chrome beacon
#

Use version 2.4.3-SNAPSHOT

supple elk
#

GUYS

#

I'VE FINALLY DONE IT

#

I'VE BECOME A PIG!!!

#

I am literally the pig

#

I'm not just invisible and over the pig or something

#

I don't know what I did

#

I can't move

#

I sent a packet to spawn in a new entity with an entity id of myself

#

there seems to be no option to set meta data

#

there's this method but that was deprecated in 1.15

eternal night
#

metadata is its own packet πŸ€”

supple elk
#

ah yeah

#

just realised that

#

that's funny tho

#

how can I get a unique entity id?

eternal night
#

you'll need NMS

#

idk if protocollib has something for this ?

supple elk
#

I see

#

I want to spawn fake players

#

npcs

#

I wanted to do it with packets so I could avoid nms and make cross version

#

but then again the packets aren't fully cross version anyway

eternal night
#

Well generally, the server internally just has an ever incrementing counter

#

which you would just have to get and increment

#

to "reserve" your id

slim kernel
#

can anyone help me in my thread pls?

sharp flare
eternal night
#

write a minimal reproduction example

#

and then basically report it

#

however iirc this is already partially known

sharp flare
#

That make sense

eternal night
#

This is the "I write stuff to yaml, get it back from yaml and string is byte" issue right ?

sharp flare
#

Similar to that, mine happens to a pdc

eternal night
#

Yea this is PDC to Yaml uglyness

#

urgh we should have just never made this human readable and just base64 it

#

if you want to save yourself some trouble right now, don't store "true" or "false" as a string for now

sharp flare
#

Yeah but I kept it for the sake of keeping players items, especially if they have other progress inside them or datasets

eternal night
#

I mean, generally the conversion to yaml works

sharp flare
#

It barely happens

#

And only happened to a single item

eternal night
#

just the "true" and "false" string values are an issue

sharp flare
#

Correct

eternal night
#

so if you can, avoid those values for now πŸ˜…

#

e.g. just use a byte with 0 or 1

sharp flare
#

Yeah if i get to receive more git issues regarding it, I'll set it to 0 and 1 instead

#

I'll let it sit for now

#

Since other server already got this temp fix for which they said works well πŸ€·β€β™‚οΈ

eternal night
sharp flare
#

Appreciate the feedback, atleast I thought this thing is unknown

eternal night
#

Generally, I would suggest moving to a 0 and 1 byte

#

and yea, it is just pain to fix

prisma needle
#

Best way to store massive amounts of player data locally?

sharp flare
#

A db would suit that well as long as u do it async

sharp flare
eternal night
#

Yea, welp, you can comment under the issue if you want to bump it (idk the spigot policies or if this is wanted)

#

but besides that, eeek not much

sharp flare
#

Status is open, might bump it later

brave goblet
#

How can i make 1.18.2 plugins on Intellij? Minecraft development it says latest version is 1.18.1

summer scroll
summer scroll
#

What's the best way to create a cooldown system for a rewards plugin? Like reward can only be claimed once every 24 hours.

quaint mantle
#

Looking for a developer! Please message me. Simple task and willing to pay!

eternal night
#

?service

#

?services

undone axleBOT
brave goblet
#
event.getPlayer().getWorld().strikeLightning(event.getPlayer().getLocation());
``` How would i set the damage for that particular bolt to be 0?
i was thinking alone the lines 
```java
event.getPlayer().getWorld().strikeLightning(event.getPlayer().getLocation()).getLastDamageCause().setDamage(0)
#

But am not sure if last damage cause would be that strike

golden turret
#

?docs

opal juniper
#

youll probs have to do a listener for it

golden turret
#

?docs

undone axleBOT
golden turret
#

?jd

golden turret
#

@brave goblet

brave goblet
#

thanks

crude loom
#

How do I get all keys under a specific key in a config?

opal juniper
#

you can get the configuration section

golden turret
#

get the ConfigurationSection

#

and then

#

getKeys

crude loom
#

How do I get the ConfigurationSection?

opal juniper
#

YamlConfiguration#getConfigurationSection

crude loom
#

I see, thanks!

onyx fjord
#

what command api do yall recommend

brave goblet
#

How do i use the spigot api?
Like all my methods are based off bukkit api

opal juniper
#

lol

onyx fjord
#

spigot api extends bukkit api doesnt it

opal juniper
#

yes

#

The spigot API implements bukkit

slim kernel
#

Where is my placeBlockStartLocation getting changed??

System.out.println(placeBlockStartLocation);
        int squareSize = 5;
        Location placeLocation = placeBlockStartLocation;
        for (int i = 0; i <= squareSize; i++) {
            placeLocation.setX(placeBlockStartLocation.clone().getX() + i);
            System.out.println(i);
            System.out.println(placeLocation);
            System.out.println(placeBlockStartLocation);
            placeLocation.getBlock().setType(material);
        }
[14:30:07] [Server thread/INFO]: Location{world=CraftWorld{name=world},x=-282.0,y=69.0,z=775.0,pitch=0.0,yaw=0.0}
[14:30:07] [Server thread/INFO]: 0
[14:30:07] [Server thread/INFO]: Location{world=CraftWorld{name=world},x=-282.0,y=69.0,z=775.0,pitch=0.0,yaw=0.0}
[14:30:07] [Server thread/INFO]: Location{world=CraftWorld{name=world},x=-282.0,y=69.0,z=775.0,pitch=0.0,yaw=0.0}
[14:30:07] [Server thread/INFO]: 1
[14:30:07] [Server thread/INFO]: Location{world=CraftWorld{name=world},x=-281.0,y=69.0,z=775.0,pitch=0.0,yaw=0.0}
[14:30:07] [Server thread/INFO]: Location{world=CraftWorld{name=world},x=-281.0,y=69.0,z=775.0,pitch=0.0,yaw=0.0}
[14:30:07] [Server thread/INFO]: 2
[14:30:07] [Server thread/INFO]: Location{world=CraftWorld{name=world},x=-279.0,y=69.0,z=775.0,pitch=0.0,yaw=0.0}
[14:30:07] [Server thread/INFO]: Location{world=CraftWorld{name=world},x=-279.0,y=69.0,z=775.0,pitch=0.0,yaw=0.0}
[14:30:07] [Server thread/INFO]: 3
[14:30:07] [Server thread/INFO]: Location{world=CraftWorld{name=world},x=-276.0,y=69.0,z=775.0,pitch=0.0,yaw=0.0}
[14:30:07] [Server thread/INFO]: Location{world=CraftWorld{name=world},x=-276.0,y=69.0,z=775.0,pitch=0.0,yaw=0.0}
opal juniper
#

and updates it

brave goblet
# onyx fjord spigot api extends bukkit api doesnt it

well when i try do java strikeLightning(Location loc, boolean isSilent) as stated in the docs it says 'strikeLightningEffect(org.bukkit.Location)' in 'org.bukkit.World' cannot be applied to '(org.bukkit.Location, boolean)'

opal juniper
#

you need to clone it

#

its currently a reference to the same object

#

and you dont need that clone in the loop as its just a getter

slim kernel
slim kernel
golden turret
#

it is in wlib

#

you can see it in my github which is in my profile

tardy delta
slim kernel
brave goblet
slim kernel
lethal knoll
#

Anyone got experience with Mockito and getting the mockStatic to work?

brave goblet
golden turret
brave goblet
#

also

.setCustomName("Bolt");
            }
        }

    }
    @EventHandler
    public void damage(EntityDamageEvent event){
        if(EntityDamageEvent.DamageCause.LIGHTNING.name().equals("Bolt")){
            event.setDamage(0);
        }```
#

:) that helps alot lol

#

Ikr brain time

golden turret
brave goblet
golden turret
#

wdym

brave goblet
#

wait i thought it would play a sound

#

would i need to get close entities then play a sound?

brave goblet
golden turret
grim ice
#

yeah but what r u doing

brave goblet
#

i had weather sounds off

#

:(

brave goblet
golden turret
#

without sounds

#

i guess

brave goblet
#

no it works dw

blazing rune
#

Anyone know how to save an arraylist to config.yml?

golden turret
#

use the set()

summer scroll
#

World#strikeLightningEffect iirc

golden turret
#

i think he dont want sounds

mighty pier
#
        return timer.getOrDefault(p.getUniqueId(), 0) != 0;
    }``` if player's timer isnt 0 it should return true?
steel swan
summer scroll
shrewd sentinel
#
public class CustomMob extends PathfinderMob {

    public CustomMob(Location loc, EntityType type, float maxHealth, float damage, double speed, String displayName, double followRange) {
        super(type, ((CraftWorld) loc.getWorld()).getHandle());

        this.setPos(loc.getX(), loc.getY(), loc.getZ());

        this.setCanPickUpLoot(false);
        this.setAggressive(true);
        this.setCustomNameVisible(true);



        if(this.getBukkitEntity() instanceof LivingEntity) {
            LivingEntity entity = (LivingEntity) this.getBukkitEntity();
            entity.setMaxHealth(maxHealth);
            this.setHealth(maxHealth);
            entity.setRemoveWhenFarAway(false);
            entity.getAttribute(Attribute.GENERIC_ATTACK_DAMAGE).setBaseValue(damage);
            entity.getAttribute(Attribute.GENERIC_FOLLOW_RANGE).setBaseValue(followRange);
            if(speed > 0) {
                entity.getAttribute(Attribute.GENERIC_MOVEMENT_SPEED).setBaseValue(speed);
            }
        }

        this.setCustomName(new TextComponent(ChatColor.GREEN + displayName +ChatColor.RED + " "  + (int) this.getHealth() + "/" + (int) this.getMaxHealth()));
        this.persist = true;
    }

    @Override
    protected void registerGoals() {
        this.goalSelector.addGoal(1, new FloatGoal(this));
        this.goalSelector.addGoal(2, new LookAtPlayerGoal(this, ServerPlayer.class, 4.0F));
        this.goalSelector.addGoal(3, new MeleeAttackGoal(this, 1.0D, true));
        this.targetSelector.addGoal(2, new NearestAttackableTargetGoal<ServerPlayer>(this, ServerPlayer.class, true));
        this.goalSelector.addGoal(5, new MoveTowardsRestrictionGoal(this, 1.0D));
    }



}

I made a custom mob here and I created a list where it spawns everytime it dies but when I leave the world then come back they seem to duplicate, any1 knows why?

mighty pier
summer scroll
mighty pier
#

thanks

golden turret
shrewd sentinel
golden turret
#

which mob are you using

proper pawn
#

When i want to send packets for npc's with mojang remapped i keep on getting this error:

java.lang.ClassNotFoundException: net.minecraft.world.entity.player.Player

And this is how i send packets:

ServerGamePacketListenerImpl connection = ((CraftPlayer) player).getHandle().connection;
connection.send(new ClientboundPlayerInfoPacket(ClientboundPlayerInfoPacket.Action.ADD_PLAYER, npc));
connection.send(new ClientboundAddPlayerPacket(npc));

Could someone please help me?

echo basalt
#

bruh mojang remapped looks so nice

wary harness
#

Should I run socket litener on demon thread?

#

I got custom messaging channel for some data between servers

#

So is it ok just to run socket listener on async thread

echo basalt
#

yeah run it async otherwise server go boom

wary harness
#

Or run it on demonthread

proper pawn
wary harness
#

@echo basalt I know u can't run it on main thread because it would block

echo basalt
#

I never really messed with remapping

wary harness
#

Question is just do I make new runnable and run it async

#

Or I make demonthread

#

And run it there

echo basalt
#

just a regular thread

#

a daemon thread has a lower priority and will die if other threads are done

onyx fjord
#

is there a quick way to send minimessage messages without deserializing and serializing?

echo basalt
#

paper has a sendMessage(component)

onyx fjord
#

im tryna do it in logger

golden turret
#

logger?????

onyx fjord
#

i wanna log colored stuff

chrome beacon
golden turret
#

or

#

Β§

echo granite
#

Hello, how can I make my plugin support NBT or "custom items" as my players define it?

eternal night
#

A little bit of a difference between custom items and full NBT support

marsh burrow
#

I'd hate to interrupt, but would anyone know how you can check if a player has a data file in a world, or has played in a world before?

echo granite
eternal night
#

The spigot yaml configuration does not really support configuring custom NBT data

muted sand
#

How would I make a loop to check if a specific structure was built by a player?
some sort of 3d array then just checking if the block isn't air?

eternal night
#

Any interactions with NBT on your end will require NMS usage

echo granite
#

The question is what exactly I'm supposed to save

torn shuttle
#

my support requests are starting to sound so weird you'd think I'm making them up

#

I guess I'm an idol now

golden turret
#

load a schematic

#

and check if the schematic fits in where the player interacted

muted sand
steel swan
#

hey so i m trying to display the player a bossbar using this :

@EventHandler
    public void onPlayerJoin(PlayerJoinEvent event) {
        Player player = event.getPlayer();
            BossBar bossBar = BossBarAPI.addBar(player, // The receiver of the BossBar
                    new TextComponent("Hi " + player.getName() + "!"), // Displayed message
                    BossBarAPI.Color.BLUE, // Color of the bar
                    BossBarAPI.Style.NOTCHED_20, // Bar style
                    1.0f, // Progress (0.0 - 1.0)
                    20, // Timeout
                    2); // Timeout-interval

but when i try it, when i join the game, the server gives me an error :

[14:19:51 ERROR]: Could not pass event PlayerJoinEvent to VampireUhc v1.0-SNAPSHOT
org.bukkit.event.EventException: null
    at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:310) ~[server.jar:git-Spigot-21fe707-741a1bd]
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[server.jar:git-Spigot-21fe707-741a1bd]
    at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:502) [server.jar:git-Spigot-21fe707-741a1bd]
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:487) [server.jar:git-Spigot-21fe707-741a1bd]
    at net.minecraft.server.v1_8_R3.PlayerList.onPlayerJoin(PlayerList.java:298) [server.jar:git-Spigot-21fe707-741a1bd]
    at net.minecraft.server.v1_8_R3.PlayerList.a(PlayerList.java:157) 
#
    at net.minecraft.server.v1_8_R3.LoginListener.b(LoginListener.java:144) [server.jar:git-Spigot-21fe707-741a1bd]
    at net.minecraft.server.v1_8_R3.LoginListener.c(LoginListener.java:54) [server.jar:git-Spigot-21fe707-741a1bd]
    at net.minecraft.server.v1_8_R3.NetworkManager.a(NetworkManager.java:231) [server.jar:git-Spigot-21fe707-741a1bd]
    at net.minecraft.server.v1_8_R3.ServerConnection.c(ServerConnection.java:148) [server.jar:git-Spigot-21fe707-741a1bd]
    at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:814) [server.jar:git-Spigot-21fe707-741a1bd]
    at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:374) [server.jar:git-Spigot-21fe707-741a1bd]
    at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:654) [server.jar:git-Spigot-21fe707-741a1bd]
    at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:557) [server.jar:git-Spigot-21fe707-741a1bd]
    at java.lang.Thread.run(Thread.java:748) [?:1.8.0_312]
Caused by: java.lang.IllegalArgumentException: Plugin cannot be null
    at org.apache.commons.lang.Validate.notNull(Validate.java:192) ~[server.jar:git-Spigot-21fe707-741a1bd]
    at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftScheduler.validate(CraftScheduler.java:397) ~[server.jar:git-Spigot-21fe707-741a1bd]
    at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftScheduler.runTaskTimer(CraftScheduler.java:123) ~[server.jar:git-Spigot-21fe707-741a1bd]
    at org.bukkit.scheduler.BukkitRunnable.runTaskTimer(BukkitRunnable.java:100) ~[server.jar:git-Spigot-21fe707-741a1bd]
    at org.inventivetalent.bossbar.EntityBossBar.<init>(EntityBossBar.java:54) ~[?:?]
    at org.inventivetalent.bossbar.BossBarAPI.setMessage(BossBarAPI.java:267) ~[?:?]
    at org.inventivetalent.bossbar.BossBarAPI.setMessage(BossBarAPI.java:247) ~[?:?]
    at org.inventivetalent.bossbar.BossBarAPI.addBar(BossBarAPI.java:158) ~[?:?]
    ```
#
at com.vampireuhc.vampireuhc.VampireUhc.onPlayerJoin(VampireUhc.java:275) ~[?:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_312]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_312]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_312]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_312]
    at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[server.jar:git-Spigot-21fe707-741a1bd]
#

anyone knows whats wrong?

vocal cloud
#

Use pastebin jeez

steel swan
#

yeah sorry

eternal night
#

you probably have to initialise BossBarAPI with your plugin instance

steel swan
eternal night
#

No, it looks like the bar api is trying to register a timer task to update the bossbar

#

but fails to do so

steel swan
#

hm yeah but why does it do that

eternal night
steel swan
#

u sure? cuz like what u sent is for 1.16 but the one i have is for 1.8.8

eternal night
#

APIManager
This API is compatible with APIManger.
Click here for information on how to implement it.

steel swan
#

..i am stupif

#

stupid

#

uuuh

#

when i click it

eternal night
#

You basically want to follow

If you are making a Plugin with dependencies:

Make sure the API you depend on supports APIManager
In your plugin's onLoad method call APIManager#require with the API class you require and your plugin instance
In the onEnable method call APIManager#initAPI with the required API class
Add the plugin name of the required API to softdepend in your plugin.yml
You successfully added an API dependency! (Repeat steps 2-4 for all APIs your plugin depends on.)
Finally just compile all of the required API classes with your plugin. Maven is the easiest way to do so.
steel swan
#

i get a 404 error

eternal night
#

yea

#

you are using a legacy af plugin

#

for a legacy af version

#

tbf the version is more legacy than the plugin but still

steel swan
#

yeah ik but i dont have a choice

eternal night
#

I mean follow what I pasted above

steel swan
#

yeah but i cant find the spigot api for my version

spark breach
#

Hello.

eternal night
#

wat

#

what does spigot-api have to do with this

steel swan
#

imma be honnest

#

i m new at plugins i understand half of what u sent above

eternal night
#

Well neither do I

#

that is just what they posted

#

on their spigot page

steel swan
#

yeah but the thing is

eternal night
#

But I would guess you do something like

APIManager.require(BossBarAPI.class);
steel swan
#

they say i need tidepend on supports APIManager

eternal night
#

in your onLoad

#

you already do

#

BossBarAPI depends on it

hasty prawn
#

APIManager seems like such a random thing to depend on for them lol

eternal night
#

I mean

#

The entire concept of APIManager seems pretty eeeek

steel swan
#

i put what u told me to

#

but there is an error

eternal night
#

does BossBarAPI not provide it ?

steel swan
hasty prawn
eternal night
#

like as a transitive dependency

#

ah

#

okay

#

wait

#

no that should actually work

#

what is the error

#

oh

#

you need to also pass your plugin instance

#

e.g. require(BossBarAPI.class, this)

steel swan
#

where do u put that exactly?

eternal night
#

their wiki says onLoad

#

and then APIManager.initAPI(BossBarAPI.class) in your onEnable

#

imagine if all this BS could be skipped by just not coding libs that abuse static state πŸ™‚

steel swan
#

okeyyy no error this time !

#

but lemme check in game

hasty prawn
#

Could also be avoided by developing in latest where Spigot has a built-in BossBar API lol

prisma needle
#

Is there a non-depreciated way to get an OfflinePlayer by name?

eternal night
#

tho tbf the lib is pretty old. Inventivetalent is pretty cool

fleet pier
#

isn't nosferatu

#

a vampire

steel swan
#

making a uhc (vampire hunters uhc) so yeah

smoky oak
#

If i have multiple Diamond itemStacks in a player inventory adding up to 100 or more, does calling player.getInventory().removeItem(new ItemStack(Material.DIAMOND,100)); remove exactly 100 diamonds?

eternal night
#

it should ye

hasty prawn
#

?tryandsee

undone axleBOT
manic furnace
#

How can I make raycasting with vectors? I tried a few things, like add 1 in a loop to a clone of the player's position, but that didn't work.

manic furnace
#

Yeah but I want to get all the location between the player and the target to spawn particles

eternal night
#

Well then yea, define your line at which you spawn the particles as a point of origin and a unit vector

smoky oak
#

divide the vector by the amount of particles you want to spawn then do a for(i=0;i<desired;i++), then add to a location object the unit vector in that loop and spawn a particle at the location object

#

I've done the exact same thing before one sec

eternal night
#

^^

manic furnace
#

ok thanks

smoky oak
#
 dragVector = dragVector.multiply(1.0/precisionA);
for(int vI = 0; vI<precisionA;vI++){
  world.spawnParticle(Particle.DUST_COLOR_TRANSITION,edges[i].clone().subtract(dragVector.clone().multiply(vI)),volume, particle);
                    }
#

something like that

frigid rock
karmic void
#

Why I don't stop the server but it stops

#

help

eternal night
#

I mean

#

it is stopping, but ran into errors

manic furnace
# smoky oak ```java dragVector = dragVector.multiply(1.0/precisionA); for(int vI = 0; vI<pr...

I tried that and it didn't wok:

Vector currentPlayerVector = player.getLocation().getDirection();
currentPlayerVector.add(new Vector(player.getLocation().getX(),player.getEyeHeight()+player.getLocation().getY(),player.getLocation().getZ()));
Vector vector = currentPlayerVector.clone().multiply(1.0/10);
for (int i = 0;i<10;i++){
  player.getWorld().spawnParticle(Particle.ASH,player.getLocation().clone().subtract(vector.clone().multiply(i)),10);
}

Sry if i made a stupid mistake, i am very new to vector programming

karmic void
eternal night
#

it started disabling plugins

#

but ran into errors

#

it should still continue shutting down

karmic void
#

It stops automatically

eternal night
#

okay good ?

#

oh

#

you don't want it to stop

#

check for errors above

chrome beacon
#

Just so you know that's a cracked (offline mode) server

eternal night
#

oh

#

well best of luck then πŸ™‚

karmic void
#

??

eternal night
echo basalt
eternal night
#

well

#

pretty much xD

#

If you abuse the fact that Locations are mutable too you can avoid allocation a new location every iteration

echo basalt
#

that's kinda what I'm doing

eternal night
#

Ye but with vectors

#

which I don't think the API accepts as parameter for particle spawning

echo basalt
#

vector.toLocation(world)

eternal night
#

Yea but that allocates a location

echo basalt
#

vector programming isn't hard

eternal night
#

every iteration

echo basalt
#

Β―_(ツ)_/Β―

#

just use locations instead of vectors

#

also works

eternal night
#

^^

#

what I was saying

echo basalt
#

vector math is fun

#

then you combine that with pathfinders and make those cows shoot fireballs :)

hasty prawn
echo basalt
#

math

#

make a pentagon

#

but instead of drawing lines between each point

#

draw it between point and point+2

eternal night
#

I mean, spigot even has rotation methods for vectors build in

#

not too difficult

karmic void
#

Is that plugins

eternal night
#

I'd hope so πŸ˜…

echo basalt
#

ehh they are plugins

#

but all the code is nms :)

manic furnace
echo basalt
#

yes

manic furnace
#

It doesn't work. I outprinted the location:

 Location{world=CraftWorld{name=world},x=NaN,y=NaN,z=NaN,pitch=0.0,yaw=0.0}

I've never seen something like this before
@echo basalt

brave goblet
#

How would I get plugin? like should i make a return method

#
 public Plugin getThisPlugin(){
        return this;
    }```
i tried this is my main class but it's not picking up this method in other classes
eternal night
#

for other classes to be able to call that method they'd require an instance of your main class

#

at which point, that method becomes useless

#

?di

undone axleBOT
eternal night
#

^^ see how to pass your plugin instance to other objects on creation using dependency injection

brave goblet
#

Thanks ^^

grim ice
#

i recommend u to learn java

#

theres a similar method if u get annoyed by di

#

instance;
instance = this;
static JavaPlugin getInstance() { return instance; }

brave goblet
#

Right

grim ice
smoky oak
#

If not, DON'T add the direction vector, you have to do vector#setDirection(directionVector)

#

they are both vectors, but their purpose is completely different; adding them together doesnt work

manic furnace
#

ok thanks

mighty pier
#
            ItemStack e = new ItemStack(Material.STAINED_GLASS_PANE, DyeColor.GRAY.getData());
            gui.setItem(1, e);
            gui.setItem(2, e);
``` can i set multiple slots at once instead of doing this?
ivory sleet
#

Ig just loop the indices you wanna set

teal notch
#

I can’t login to my spigot side .. only if I change the password every time πŸ˜–πŸ˜–

steel swan
#

hey, so i m using BossBarApi to create a bossbar in 1.8.8 but i m having trouble with like getting the health to go down. here is my code :

public float a
@EventHandler
    public void onPlayerJoin(PlayerJoinEvent event) {
        Player player = event.getPlayer();
        BossBar bossBar = BossBarAPI.addBar(player, // The receiver of the BossBar
                new TextComponent("Hi " + "!"), // Displayed message
                BossBarAPI.Color.BLUE, // Color of the bar
                BossBarAPI.Style.NOTCHED_20, // Bar style
                1f, // Progress (0.0 - 1.0)
                20, // Timeout
                2); // Timeout-interval
        getServer().getScheduler().scheduleSyncRepeatingTask(this, new Runnable() {

            @Override
            public void run() {
                while (a >= 0) {

                    bossBar.setProgress((float) a);
                    a = (float) (a-0.1);
                    Bukkit.broadcastMessage(String.valueOf(a));
                }
            }
        }, 20L, 20L);
}

so the bossbar was acting strange so i decided to send in chat "a" to see the progress and here is what i see :

#

i want to see wmth like 1 then 0.9 then 0.8 and so on

tardy delta
#

(a-0.1f)?

#

instead of (float) a-0.1

steel swan
#

oh

#

lemme try

tardy delta
#

not sure but might be worth a try

steel swan
#

nope

tardy delta
#

why not working with a double?

steel swan
#

i tried

#

if u want i can try with a double with the a-0.1f

tardy delta
#

lol dont combine floats with doubles

steel swan
#

ik but the double alone didnt work so

#

imma just try

#

with double alone or with the 0.1f still same thing in chat

tardy delta
#

why are you even casting a float to a float

steel swan
#

if i dont it gives me an error

#

oh

#

np

#

no

#

that? i was just trying things

#

i tried doing that too ```java
public float a = 1;
@EventHandler
public void onPlayerJoin(PlayerJoinEvent event) {
Player player = event.getPlayer();
BossBar bossBar = BossBarAPI.addBar(player, // The receiver of the BossBar
new TextComponent("Hi " + "!"), // Displayed message
BossBarAPI.Color.BLUE, // Color of the bar
BossBarAPI.Style.NOTCHED_20, // Bar style
1f, // Progress (0.0 - 1.0)
20, // Timeout
2); // Timeout-interval
getServer().getScheduler().scheduleSyncRepeatingTask(this, new Runnable() {

        @Override
        public void run() {
            while (a >= 0) {

                bossBar.setProgress( a);
                a = (float) (a-0.1);
                Bukkit.broadcastMessage(String.valueOf(a));
            }
        }
    }, 20L, 20L);

}

brave goblet
#
 new BukkitRunnable(){
            Location loc = player.getLocation();
            double t = 1;
            double r = 3;
            public void run(){
                t = t + Math.PI/16;
                double x = r*Math.cos(t);
                double y = 1;
                double z = r*Math.sin(t);
                Particle.DustTransition dustTransition = new Particle.DustTransition(Color.fromRGB(255, 0, 0), Color.fromRGB(255, 255, 255), 1.0F);
                player.getWorld().spawnParticle(Particle.DUST_COLOR_TRANSITION, player.getLocation().add(x, y, z), 10, dustTransition);
                player.getLocation().subtract(x, y, z);
            }
        }.runTaskTimer(plugin, 0, 1);

How can I make it so there is less space between the particles?

torn shuttle
glossy venture
#

it only resets on server restarts

#

so maybe bring the float into the method

brave goblet
spark breach
#

Hello, has anyone experienced before when a plugin succesfully launches, shows in the /pl, but doesn't access any commands?

tardy delta
#

you just didnt register the commands

glossy venture
#

what do you mean by accessing commands

spark breach
#

keeping in mind that weirdly enough it had worked before, after the restart it didn't work

tardy delta
#

errors?

spark breach
spark breach
torn shuttle
# brave goblet right ty ty

also here's a pro tip you can get rotation calculations using the vector operators in the spigot api, you don't actually have to rotate thigns yourself

brave goblet
torn shuttle
#

oh wow look at the calendar

spark breach
torn shuttle
#

it says today is the day you start using vector operators

#

what a coincidence!

brave goblet
#

ayo lets go

#

today is also they day i learnt about threading :)

spark breach
brave goblet
#

wait are vector operators built into java or a spigot thing?

torn shuttle
#

both, you want to look at the spigot ones specifically in this case

brave goblet
upper dock
#

how do I execute a console command with the player's name in it, but not send the player a message?

mighty pier
#

how do i set a golden apple itemstack with itemdata 1?

upper dock
#

ex: I don't want it to say "Given 1 grass_block to player"

vast sapphire
#

what's the method to creating a tablist with rotating colors, I tried with this ```java
StringBuilder sb = new StringBuilder(servername);
Main.instance.getProxy().getScheduler().schedule(Main.instance, new Runnable() {

        @Override
        public void run() {

            for (int i=0;i<servername.toCharArray().length;i++) {
                sb.insert(i, "&c");
                if (i==servername.toCharArray().length) {
                    i=0;
                    sb.insert(i, "&f");
                }
            }
        }
    },0,  1, TimeUnit.SECONDS);``` but it doesn't work
upper dock
#

that won't be the output but still

tardy delta
#

servername.toCharArray().length???

#

whats wrong with String#length()?

vast sapphire
#

Yeah i'm turning it into a char[] to get the length so I can insert a color at each char java String servername = "MC.PTCOMMUNITY.NET";

#

i'll use String.length then

tardy delta
#

πŸ€”

vast sapphire
#

i'll watch a tutorial

smoky oak
#

what's the flag to get the remapped server.jar again?

eternal night
#

--remapped

upper dock
#

How do I execute a console command with the player's name in it, but not send the player a message?

grim ice
#

gpg: skipped "2Hex gmail@gmail.com": No secret key
gpg: signing failed: No secret key
error: gpg failed to sign the data
fatal: failed to write commit object
i fucking have a secret key
im tryna set it up with intellij
but the option disappeared
from settings
it was there months ago

upper dock
#

its in Tools and then SSH Configurations

grim ice
#

nothing like that

simple silo
#

Why are the custom events of my api plugin ran on plugin 1 only handled by plugin 1 listeners?

#

and ran on plugin 2 only handled by plugin 2

#

Is there anything special I should know about spigot APIs?

#

it isnt listened by other plugins

#

i think I made something wrong

#

I called the event by the java class in plugin 1, not by RegisteredServiceProvider, might this be the reason?

small lynx
#

``@EventHandler(priority = EventPriority.HIGHEST)
public void onEntityDamageByEntity(final EntityDamageByEntityEvent event) {

 if (!(event.getEntity() instanceof Player)) {
     return;

}
if (!(event.getDamager() instanceof TNTPrimed)) {
return;
}
World w = Bukkit.getServer().getWorld(Main.plugin.getConfig().getString("Spawn.World"));
if (Join.game.contains(event.getEntity().getName()) && event.getEntity().getWorld().equals(w)) {

     event.setCancelled(false);

}
}
}``

#

why the code is not working? it is supossed to allow explosions damage if the player if on the world defined in config and has the game variable in them and the damager is a primedtnt

#

but when i test it the damage is cancelled

#

and i 100% sure there are no other plugins other than my own cancelling the event

small lynx
delicate lynx
#

put some debug messages in there and see which conditions aren't being met

fossil mural
#

Might be stupid by me but can it be the exclamation marks?

small lynx
# delicate lynx put some debug messages in there and see which conditions aren't being met

``@EventHandler(priority = EventPriority.HIGHEST)
public void onEntityDamageByEntity(final EntityDamageByEntityEvent event) {

 if (!(event.getEntity() instanceof Player)) {
     Bukkit.getConsoleSender().sendMessage("Entity Damaged is not a player");
     return;

}
if (!(event.getDamager() instanceof TNTPrimed)) {
Bukkit.getConsoleSender().sendMessage("Damager is not a tnt");
return;
}
if (!Join.game.contains(event.getEntity().getName())) {
Bukkit.getConsoleSender().sendMessage("Player are not in game");
return;
}
World w = Bukkit.getServer().getWorld(Main.plugin.getConfig().getString("Spawn.World"));

 if (!event.getEntity().getWorld().equals(w)) {
     Bukkit.getConsoleSender().sendMessage("The world are not kitpvp world");
     return;
 }


     event.setCancelled(false);
     Bukkit.getConsoleSender().sendMessage("TNT DAMAGES GETS UNCANCELLED");

}
}``

#

like this?

delicate lynx
#

that works

simple silo
#

eventsLibrary = getPlugin(EventsLibrary.class);
any idea why this throws a ClassCastException?

#

in another plugin it works

earnest forum
#

I think you need to pass in the plugin name

simple silo
#

nope

#

the problem was that I forgot the <scope>provided</scope> in pom.xml

earnest forum
#

ah

#

nice

simple silo
#

so it included the api in the end plugin

crude loom
#

Hi, I'm trying to code a plugin that duplicates a world and deletes it after the game played there is over
I'm running this on a server that has 1GB ram and it keeps running out of memory
Am I doing something wrong or is it just heavy? (version 1.18.2)

#

Because up until now, the server was running survival and some plugins pretty nicely

echo basalt
#

1gb ram

#

πŸ’€

low temple
#

Is there any way to call a new BlockBreakEvent?

#

To where it’ll also be listened to listeners

echo basalt
#

Bukkit.getPluginManager().callEvent

low temple
#

Then just pass the event?

#

The new event*

echo basalt
#

yes

low temple
#

Okay cool I’ll try that

sharp bough
#

4 tends to be enough for a test server

mighty pier
#

how do i make an anvil inventory that people can use?

manic delta
#

how can i cancel player commands

grim ice
#

gpg: skipped "2Hex gmail@gmail.com": No secret key
gpg: signing failed: No secret key
error: gpg failed to sign the data
fatal: failed to write commit object
i fucking have a secret key
im tryna set it up with intellij
but the option disappeared
from settings
it was there months ago

manic delta
grim ice
#

Help

#

ok fixed it alone B)

grim ice
slim kernel
#

which one do I choose here if I want to get the project from github?

eternal night
#

The first

slim kernel
#

thank you

grim ice
#

?paste

undone axleBOT
grim ice
#

Why do you think thatsh appening

eternal night
#

check your JAVA_HOME

#

ensure that it is properly setup to your java 11 or above

grim ice
#

oh fuck sake

#

this bitchy ass shi

grim ice
#

and its still like that

#

javac -version and java -version

#

says 17.0.1

eternal night
#

and your java home points to the correct spot

grim ice
#

my java home points to a java 11

#

but it says 17

#

SO UH

eternal night
#

I mean, generally update the JAVA_HOME

grim ice
#

I did its java 11

eternal night
#

no go for java 17

grim ice
#

i dont have jdk 17

#

only 16, 8 and 11

eternal night
#

you have jre 17 ?

grim ice
#

this is weird af

eternal night
#

very confusing

grim ice
#

ye

sleek pond
#

I get confused all the time

#

I have like 6 java versions installed

quaint mantle
#

is Bukkit.getServer().shutdown(); a safe way to shutdown a server?

chrome beacon
#

Yes

quaint mantle
#

allright thanks.

grim ice
#

Why is this happening with heroku lol

#

ass website

mighty pier
#

how do i check if enchanted book is sharpness 2?

chrome beacon
lavish robin
chrome beacon
#

I highly recommend using a proper java IDE instead of vscode

lavish robin
chrome beacon
#

Intellij

#

Anyways if you want to continue with vscode just replace and modify the contents of the pom

lavish robin
#

Do I leave plugins in pom?

chrome beacon
#

Actually it doesn't really matter which IDE you choose for that step since you're working with maven

chrome beacon
lavish robin
#

okay thanks

#

What does it mean by From "MAVEN PROJECTS" pane, right click "BlankPlugin" and select "install" from the menu.

chrome beacon
#

Are you still using vscode?

lavish robin
#

yea. I am familiar with it and its what I have installed

#

never mind I found it

lavish robin
#
18.04 22:23:40 [Server] Server thread/WARN Legacy plugin FireWars v0.1 does not specify an api-version.
18.04 22:23:40 [Server] Server thread/ERROR Could not load 'plugins/FireWars-1.0-SNAPSHOT.jar' in folder 'plugins'
``` this happens upon loading of my plugin. How do I fix this
quaint mantle
#

you're importing a legacy deprecated class

#

or

#

you dont specify an api-version in the plugin.yml

#

which it says

lavish robin
#

did that. now I just get a [Server] Server thread/ERROR Could not load 'plugins/FireWars-1.0-SNAPSHOT.jar' in folder 'plugins' error

delicate lynx
#

you have to post more than that

#

post the full error

lavish robin
#

Oh wait im dumb

flat olive
#

?paste

undone axleBOT
lavish robin
#

nvm i figured it out

sand vector
#

Just added a database to my plugin and was wondering how to make it so that instead of writing to the database it would instead cache it and later on add it to the database. How do you do this. Im using mongodb. TIA

urban trout
#

hey guys, trying to make a little thing that stops entitys/mobs from burning. thought itd be easy and its turned out to be a pain in the butt. this is what i have and it doesnt work at all

package mobsdontburn.mobsdontburn;

import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityCombustEvent;
import org.bukkit.plugin.java.JavaPlugin;

public final class MobsDontBurn extends JavaPlugin implements Listener {

    @Override
    public void onEnable() {
        System.out.print("Mobs Don't Burn has enabled.");

    }

    @Override
    public void onDisable() {
        System.out.print("Mobs Don't Burn has disabled.");
    }

    @EventHandler
    public void onCombust(EntityCombustEvent event) {
        event.setCancelled(true);
    }
}
hexed hatch
#

Register your listener

urban trout
#

i thought you didnt have to do that if it was the same class

hexed hatch
#

Nope

mortal hare
#

You need it

urban trout
#

whattt

#

my life is a lie

#

ok lemme

hexed hatch
#

I mean, you register any listener you want to listen to events

#

in this case, your main class extends Listener

#

so you register it

mortal hare
#

Since @EventListener only hint listener annotation processor that you want to handle this event via annotated method

#

But processor doesnt know exactly what annotations to process if you dont specify class or object instance

worldly ingot
#

You're thinking of commands

#

All commands registered by your plugin will, by default, route through JavaPlugin#onCommand() as it's a CommandExecutor

sand vector
red sedge
#

is there like a isPlayerPlaced method?

#

for like blocks