#help-development

1 messages · Page 1527 of 1

fiery inlet
#

ahh

#

smart

sage swift
#

849584954.34 % 1 == 0.34

fiery inlet
#
int x = player.getLocation().getBlockX() % 1;
targetBlock.setX(targetBlock.getX() + x);

like that?

sage swift
#

well no

fiery inlet
#

oh wait no getblockx is int

sage swift
#

you can't set the x position of a block

fiery inlet
#
double x = player.getLocation().getX() % 1;
targetBlock.setX(targetBlock.getX() + x);
#

targetblock is a location

#

that i want to tp to

sage swift
#
Location location = targetBlock.getLocation()
.add(player.getLocation().getX() % 1, 0, player.getLocation().getZ() % 1)```
fiery inlet
#

and the 0 is the y i have i guess

sage swift
#

well if youre searching for the top position of a block it would be odd to teleport them halfway into the air above the target block

fiery inlet
#

think i figured it out

#

apparently not xd

#

oh it was old code that screwed me

wet breach
#

yes they are Block Entities

#

believe you would do that by getting its state

hexed hatch
#

Uh, are you sure item frames are block entities?

#

I don’t think they are at all, no

#

They’re entities

#

No you can definitely force multiple item frames into a single block

#

I’ve seen it done

#

It’s definitely not a block entity, I’m pretty sure of that

wet breach
#

actually I remember it wrong

hexed hatch
#

That’s weird

wet breach
#

you are right

hexed hatch
#

I don’t think that’s true

#

Yeah okay, thought so

wet breach
#

Its in BE they are block entities 😂

#

in JE they are entities

hexed hatch
#

Yep they are in Bedrock lol

#

They’re janky as fuck in Bedrock too

#

@quaint mantle can you explain what you’re trying to do with more context?

#

You’re trying to locate an item frame, right?

#

What circumstances are these item frames placed? Are they ones that already exist in the world or newly placed item frames?

#

I’m still a bit confused as to what you’re trying to do

#

Does this happen when the player right clicks that item frame?

#

I think PlayerInteractEntityEvent would work if that's what you're asking

#

you can get the location of the entity you right clicked from the event method

#

no getNearbyEntities method would be needed for that

shadow pulsar
#

How does one fix this? This moves a location sideways relative to its rotation but it goes slightly back if sideways is postive and slightly forward if it is negative.

loc.setX(loc.getX() - sideways * Math.sin(yaw - 90));
loc.setZ(loc.getZ() + sideways * Math.cos(yaw - 90));```
sage swift
#

well youre subtracting 90 from the yaw

#

so of course its gonna be forward/backward instead of left/right

shadow pulsar
#

It is going left/right but it is slightly forward/backward

#

If I don't subtract 90, it does go forward and backward completely

eternal oxide
shadow pulsar
#

I'm moving sideways from where I am facing.

eternal oxide
#

if you don;t want Y axis just zero it in the direction

#

if you want sideways then rotate the direction

hoary tiger
#

I would I get the location of a command sender. If the sender is an entity?

shadow pulsar
#

Rotating the direction only works if you're working with 90 degree angles

eternal oxide
#

you use the rotate method of Vector

shadow pulsar
#

I was just wondering if there is any math I am missing to the code snippet?

eternal oxide
#

and no it doesn;t have to be 90 degrees. They are Vectors.

shadow pulsar
#

That doesn't really help..

eternal oxide
#
Location locClone = loc.clone();
locClone.setYaw(90 - loc.getYaw())
Vector direction = locClone.getDirection());
// Slide left or right
loc.multiply(direction); or loc.multiply(-direction);```
shadow pulsar
#

How would you set it to how many blocks you want to go sideways?

eternal oxide
#

direction.multiply(5)

hexed hatch
#

I can't think of any other way unless you change your saving method

#

I think getNearbyEntities is your only practical choice

shadow pulsar
#

I appreciate the help

eternal oxide
#

np

hoary tiger
#

Sorry for the repost but, I would I get the location of a command sender. If the sender is an entity?

summer scroll
#

Can someone help me with this? I'm having a problem with my computer.

#

I still have 12gb of available RAM

#

Last time I tried to install java 16, but I failed and now I get something like this.

hoary tiger
valid totem
#

whats the event for when someone stops spectating an entity

quaint mantle
#

i dont think there is one

valid totem
#

...

#

does player.getSpectateTarget() return null when there is none?

eternal oxide
#

?jd will tell you

quaint mantle
#

wtf is that

valid totem
#

sry i meant getSpectatorTarget

eternal oxide
#

read teh javadocs

quaint mantle
#

ye

valid totem
#

ok i see

subtle kite
summer scroll
#

i have total of 16gb

valid totem
#

i have 32 gb i think

subtle kite
#

your pic says 12

#

?

eternal oxide
#

12 free

#

4 used

valid totem
#

why is scheduleAsyncRepeatingTask deprecated

subtle kite
#

makes sense

summer scroll
#

i can't even open the jdk installer

eternal oxide
valid totem
#

ok nvm i read the javadocs

stone sinew
granite stirrup
valid totem
#

ye ik

granite stirrup
#

32 bit only supports a max of 2gb ram for some reason

valid totem
#

The method runTaskTimer(Plugin, Runnable, long, long) is ambiguous for the type BukkitScheduler now what

summer scroll
granite stirrup
valid totem
#

nvm fixed

granite stirrup
#

Otherwise u have a max hard limit of 2gb of ram on Java

summer scroll
#

I mean, it keeps saying OutOfMemoryError

subtle kite
#

^ I think

#

if that works you are not on 64 bit

#

idk

summer scroll
#

I can run with -Xmx4G before I tried to install jdk 16.0.1

#

Run without any issues.

granite stirrup
#

Reinstall jdk 16.0.1

#

U might of gotten the 32 bit version

summer scroll
#

I don't even know if it's properly installed.

#

It's 64 bit version.

granite stirrup
#

Do java -version

quaint mantle
#

java -version

#

what they said

summer scroll
subtle kite
#

aglerr
do
window Key
search : View ram info
and it should tell you the System type

summer scroll
#
java version "1.8.0_291"
Java(TM) SE Runtime Environment (build 1.8.0_291-b10)
Java HotSpot(TM) Client VM (build 25.291-b10, mixed mode, sharing)
quaint mantle
#

you have java 8 installed

#

is that all it says?

summer scroll
#

I know, but that's not the problem.

quaint mantle
#

thought you were trying to install 16?

granite stirrup
#

?java16

undone axleBOT
summer scroll
eternal oxide
#

try 4096M instead of 4G other wise you have a 32 bit JRE

valid totem
#

The local variable task may not have been initialized

#

what does that mean

quaint mantle
#

i think you have the 32 bit version, cause with mine it says Java HotSpot(TM) 64-Bit Server VM (build 25.291-b10, mixed mode)

#

@summer scroll

summer scroll
#

But I don't have any problems before I tried install java 16

quaint mantle
#

well its not even trying to use java 16

#

its still using java 8

summer scroll
#

I still don't know If I'm installed Java 16.

eternal oxide
#

your path is pointing to java 8

quaint mantle
#

^

summer scroll
#

Because I can't open the jdk installer, I downloaded the jdk from Oracle.

sage swift
#

dont download the jdk from oracle

quaint mantle
#

why cant you open it?

#

the oracle jdk is fine pfft

summer scroll
quaint mantle
#

you just double click the installer..

valid totem
#

im getting error The local variable task may not have been initialized

summer scroll
sage swift
summer scroll
#

After I press the "Yes" button on the administrator.

quaint mantle
#

🤨

#

check task manager

#

see if the process is running

#

it could just be taking forever, idk

summer scroll
#

Nothing on the task manager also.

quaint mantle
#

whats the file name out of curiosity

#

you might just be better off going with openjdk instead at this point

summer scroll
#

I can install the Java 16 using this one.

#

?java16

undone axleBOT
quaint mantle
#

thats openjdk...

summer scroll
#

I got no problem using that one

quaint mantle
#

yeah, im just saying that thats the one i was referring to when i said

you might just be better off going with openjdk instead at this point

valid totem
#

code looks like this

BukkitTask task = Bukkit.getScheduler().runTaskTimer(Main.instance, () -> {
  if (((Player)sender).getSpectatorTarget() == null) {
    task.cancel();
                    
                    
  };
}, 0, 1);

getting error The local variable task may not have been initialized
how to fix

summer scroll
quaint mantle
#

for example: "C:\Program Files\Java\jre_blabla\bin\java.exe" -jar server.jar

valid totem
#

it is

#

on line one

quaint mantle
#

you didnt define it

#

its a local variable

granite stirrup
#

Lol

summer scroll
eternal oxide
#

if you used Adopt there will be an Adopt folder

valid totem
#

why is GameMode.getValue() deprecated

granite stirrup
#

Cuz it's old maybe

valid totem
#

what the replacement

granite stirrup
#

Idk

summer scroll
valid totem
#

it doesnt say in jd

eternal oxide
quaint mantle
summer scroll
quaint mantle
#

show the command you used

summer scroll
#
"C:\Program Files\Java\jre1.8.0_261\bin\java.exe" java -Dfile.encoding=UTF-8 -jar server.jar
PAUSE
quaint mantle
#

why did you put a random java in there?

#

"C:\Program Files\Java\jre1.8.0_261\bin\java.exe" -Dfile.encoding=UTF-8 -jar server.jar

summer scroll
#

oh

#

k it's working, thanks!

quaint mantle
#

I also had to slaughter a lot of villagers

proud basin
#

np

quasi flint
quasi flint
#

Oh god no 👍

#

Wrong emoji 😂

hexed hatch
#

No, that’s the right emoji

quaint mantle
#

lmao

prisma badge
#

hello

#

i need help

#

how do i make a try catch thingy

eternal oxide
#

?learnjava

undone axleBOT
prisma badge
#

nvm

#

how do i make

#

a method

sage swift
#

fun fact: you can send sentences in one message instead of three!

prisma badge
#

ok

#

nvm how do i make a method

eternal oxide
#

same answer

prisma badge
#

i have 10 years of java experience

#

i just wanna know how to make a method

#

thats all

eternal oxide
#

Sure

sage swift
#

then you should definitely know how to

prisma badge
#

no i dont

sage swift
#

then you don't have 10 years of java experience

#

and should follow the above tutorials

prisma badge
#

i do

eternal oxide
#

Perhaps he means coffee

prisma badge
#

i have known what java is for 10 years

sage swift
#

as have i; that does not mean i have 10 years of experience in it

eternal oxide
#

You have not written a single line of Java code. Read the tutorials.

prisma badge
sage swift
#

experience means active usage and development

eternal oxide
#

Damn I'm a brain surgeon and never knew it

prisma badge
prisma badge
#

ur sus

quaint mantle
prisma badge
#

xD

#

who doesnt play among us xD

#

so good game

#

i love it when i am impostar

quaint mantle
prisma badge
#

who here LOVES among us

#

i love it when i am perpindiculer

#

and photothesinsizing

dusty herald
#

👮

#

what is going on in here

eternal oxide
#

trolls

prisma badge
#

i like among us

#

leeman is sus

dusty herald
quasi flint
#

Megasus

prisma badge
#

leeman what does that mean

sage swift
dusty herald
#

?ban @tidal cairn

undone axleBOT
#

Done. That felt good.

quaint mantle
sage swift
#

gg!

quaint mantle
#

wazzup

cinder thistle
#

I made it just in time

quaint mantle
#

lmao

sage swift
#

!ban @sage swift

dusty herald
#

oh no

quaint mantle
#

oki bye now pepeleave

prisma badge
#

i dont like sharing my voice

sage swift
#

so shut the fuck up

cinder thistle
#

Imagine being unverified

prisma badge
#

megasus impostar

#

XD

sage swift
#

do you want to kiss

prisma badge
#

bro that sussy

sage swift
#

add me as a freidn

#

we will ksis

dusty herald
#

gecko is a hecko

prisma badge
#

no ):

#

i already have a girlfriend

#

i dont want another girl

dusty herald
#

gecko is a girl?

prisma badge
#

thats cheating /:

prisma badge
quaint mantle
dusty herald
#

have fun hecko

sage swift
#

i am a girl

#

@dusty herald vouch?

#

just heard me talk

dusty herald
#

gecko is a girl

#

i heard their voice

sage swift
#

@quaint mantle you did too

#

they will tell you it's true

quaint mantle
#

I wasnt really paying attention tbh

prisma badge
#

bro stop being a SUS IMPOSTAR

#

LOLLOLOLOLOLOLOL

sage swift
#

my voice was too high to hear

quaint mantle
#

All i heard was a dude

prisma badge
#

abadabadabadabadabadabadabadaba

#

e

#

baba

#

boobs

dusty herald
#

might wanna stop spamming

#

ive got a trigger finger

prisma badge
#

no you dont

#

i like boobs

dusty herald
#

👀

#

no but pls stop spamming

prisma badge
#

:cock:

sage swift
#

mistyped

quaint mantle
#

(.)-(.)

sage swift
#

let me try again

#

say trigger but replace tr with m

hasty scaffold
#

hey daddys

prisma badge
#

ban 19

#

he is mega sus

hasty scaffold
#

i just joined 😦

sage swift
#

he's playing lunar client 1.8 he cant be banned

hasty scaffold
#

see

hasty scaffold
quaint mantle
#

sus

hasty scaffold
#

no u

#

IMPOSTER SUSSY BAKA

quaint mantle
#

@dusty herald banbanban

sage swift
#

?paste

undone axleBOT
quaint mantle
hasty scaffold
#

dont be a pussy baka

#

sussy*

eternal oxide
#

just ignore him and let him talk to himeslf.

maiden shore
#

s and p are nowhere near each other on the keyboard

hasty scaffold
#

can i marry you your dong is longer than my brain cell

#

lana rhoades is so hot

quaint mantle
#

wtf dude

hasty scaffold
#

what she is

#

you gotta agree though

gloomy edge
#

Why does CraftChunk#getEntities iterates all entities in the world?

cinder thistle
dusty herald
#

what

cinder thistle
#

Lazy ass

dusty herald
#

i already kicked them 😂

cinder thistle
#

Oh yeah?

#

Then why are they verified 😂

dusty herald
#

idk

prisma badge
#

hi

#

sorry

dusty herald
#

creeper they're not verified

#

😂

#

are you ok

quaint mantle
#

lol

cinder thistle
dusty herald
#

yes

cinder thistle
#

So that means they’re verified right????

dusty herald
#

no

cinder thistle
#

Yes??

dusty herald
#

no

maiden shore
#

where do you see the verified role

cinder thistle
#

Tf

#

Where do you not see it

maiden shore
#

Y'know what that's a good point

outer sorrel
#

how can i check if there are other entities in a players boundingbox?

modern fractal
#

a

quaint mantle
prisma badge
#

h

#

h

#

h

#

oops

#

sorry

#

plz dont ban

sage swift
quaint mantle
#

it is an enum

#
public enum Blocks {
CLAY_POT(create(Material.STICK, "block.archaeology.clay_pot", 10, "clay_pot"), Material.BARRIER),
    POT(create(Material.STICK, "block.archaeology.pot", 20, "pot"), Material.BARRIER);

    private final ItemStack item;
    private final Material material;

    Blocks(ItemStack item, Material material) {
        this.item = item;
        this.material = material;
    }

    public Material getType() {
        return material;
    }
    public ItemStack getItem() {
        return item;
    }

    public static Blocks getBlock(String custom_block) {
        return Enum.valueOf(Blocks.class, custom_block.replace("\"","").toUpperCase());
    }
}
sage swift
#

what's the package

quaint mantle
#

Error from:

for (Blocks blocks : Blocks.values()) { // <---
            blocks.getType();
        }
quaint mantle
#

and Blocks class

eternal oxide
#

Try in your Enum.valueOf(Blocks.class using Blocks and not the class. Its asking for a type, not an actual class.

chrome beacon
#

Well Blocks is a class

#

I assume?

quasi flint
#

blocks.class

quaint mantle
#

it's enum

eternal oxide
#

I have no ide up and about to hit the sack so can;t help, sorry

sage swift
#

cant you do Blocks.valueOf

sage swift
#

show the Blocks.valueOf code

quaint mantle
eternal oxide
#

have you got a bad import or something? Like wrong class?

quaint mantle
#
for (Blocks blocks : Blocks.values()) { // <---
#

error line in main

quaint mantle
sage swift
#

are you maybe using the NMS Blocks import somewhere

#

ElgarL might be right

quaint mantle
#

hm

#

i don't think so

#

that calls ru.zacustoms.blocks.Blocks

sage swift
#

the Blocks enum in nms is like Material

quaint mantle
#

yup, there is

#

but it is not my happening

quaint mantle
quaint mantle
#

Make it expandable

#

If you ill make it as regular class and use some form of registry it gonna be expandable

#

Other developers can add their own custom blocks as addons 🙂

quasi flint
#

but harder

quaint mantle
#

why i need this if enum is exists?

#

Again, extensibility, р а с ш и р я е м о с т ь

#

Bukkit material enum was a big mistake

#

Same with biomes, potions, entity types

quasi flint
#

i like enums md_5

#

personally

quaint mantle
#

public static final fields is awesome too

quasi flint
#

ough

quaint mantle
#

rewrite the code for the fourth time. I will try.

#

public static final String
FIRST = "first",
SECOND = "second",
THIRD = "third";

sage swift
quaint mantle
quasi flint
#

welp

sage swift
#

яйцо

quasi flint
#

mami

#

Ghe

#

the rusdisns are coming

sage swift
#

как курица

#

бак бак

quasi flint
#

weoweo

#

dont understand i do

#

Rindfleischettiketierungsgesetz

copper dove
#

so i have been working on a project that i have had to code a custom WebSocket server for a plugin but i have never messed with it in java and i was wondering if someone would be able to point me in a direction to learn how to use websockets within a plugin

eternal oxide
#

you use them exactly as you would in any java project. No differences

opal juniper
#

Well - dont use them from within an event listener if it is blocking

copper dove
#

well the websocket server i have coded is reading data from an api and the data i am getting from that api will be sending it to this plugin and depending on the data i get it will spawn a horde of mobs around a player that has it enabled for them to use

opal juniper
#

Why is the websocket necessary, cant you just go spigot -> api?

#

it seems like an extra step

copper dove
#

well the api i am using isnt a websocket itself the api it using something called SignalR

opal juniper
#

Right, well you can continue using your websocket then. What is the trigger for this horde. is it an event listener or a command?

#

or something different

#

Cause i would reccomend doing this async rather than sync in order to prevent delays

copper dove
#

well this will be the data that i am gonna using from the api in the plugin

countByFrames: { Bronze: 1, Silver: 0, Gold: 0, Designer: 0, Platinum: 0 }

i am wanting to take the data from the bronze silver gold and platinum then each tier with the number next to it have it spawn a mob with that number and each tier will have a certain mob that it will spawn

opal juniper
#

Yes - but when do you want this to happen

#

how often &/or on event?

copper dove
#

well the websocket will be an open connection so when ever it gets the data from the api it will just send it so i was just planning on making some so that it would just do it when it got the data from the websocket

dense remnant
#

Hey, I am currently trying to register a scoreboard in 1.17 but it doesnt work:

java.lang.NullPointerException: Cannot invoke "net.minecraft.network.chat.IChatBaseComponent.mutableCopy()" because "this.e" is null
        at net.minecraft.world.scores.ScoreboardObjective.g(SourceFile:46) ~[spigot-1.17.jar:3160-Spigot-f773da8-295ab08]
        at net.minecraft.world.scores.ScoreboardObjective.<init>(SourceFile:24) ~[spigot-1.17.jar:3160-Spigot-f773da8-295ab08]
        at net.minecraft.world.scores.Scoreboard.registerObjective(SourceFile:57) ~[spigot-1.17.jar:3160-Spigot-f773da8-295ab08]
        at org.bukkit.craftbukkit.v1_17_R1.scoreboard.CraftScoreboard.registerNewObjective(CraftScoreboard.java:48) ~[spigot-1.17.jar:3160-Spigot-f773da8-295ab08]
        at org.bukkit.craftbukkit.v1_17_R1.scoreboard.CraftScoreboard.registerNewObjective(CraftScoreboard.java:34) ~[spigot-1.17.jar:3160-Spigot-f773da8-295ab08]
        at org.bukkit.craftbukkit.v1_17_R1.scoreboard.CraftScoreboard.registerNewObjective(CraftScoreboard.java:1) ~[spigot-1.17.jar:3160-Spigot-f773da8-295ab08]

In 1.15.2 it works tho

opal juniper
#

Send the code Leoo

dense remnant
#
Main.sc = Bukkit.getScoreboardManager().getNewScoreboard();
Main.sc.registerNewObjective("Tribe Wars", "", "");

Lines 364 and 365

#

(line 365 is the error)

eternal oxide
#

post the full error as there is nothign but MC/Spigot there

dense remnant
#
java.lang.NullPointerException: Cannot invoke "net.minecraft.network.chat.IChatBaseComponent.mutableCopy()" because "this.e" is null
        at net.minecraft.world.scores.ScoreboardObjective.g(SourceFile:46) ~[spigot-1.17.jar:3160-Spigot-f773da8-295ab08]
        at net.minecraft.world.scores.ScoreboardObjective.<init>(SourceFile:24) ~[spigot-1.17.jar:3160-Spigot-f773da8-295ab08]
        at net.minecraft.world.scores.Scoreboard.registerObjective(SourceFile:57) ~[spigot-1.17.jar:3160-Spigot-f773da8-295ab08]
        at org.bukkit.craftbukkit.v1_17_R1.scoreboard.CraftScoreboard.registerNewObjective(CraftScoreboard.java:48) ~[spigot-1.17.jar:3160-Spigot-f773da8-295ab08]
        at org.bukkit.craftbukkit.v1_17_R1.scoreboard.CraftScoreboard.registerNewObjective(CraftScoreboard.java:34) ~[spigot-1.17.jar:3160-Spigot-f773da8-295ab08]
        at org.bukkit.craftbukkit.v1_17_R1.scoreboard.CraftScoreboard.registerNewObjective(CraftScoreboard.java:1) ~[spigot-1.17.jar:3160-Spigot-f773da8-295ab08]
        at ro.ang3l.battle.Tools.Tag(Tools.java:365) ~[?:?]
        at ro.ang3l.battle.Main.onEnable(Main.java:43) ~[?:?]
opal juniper
#

Google is your friend for that

eternal oxide
dense remnant
#

Nope I am not

opal juniper
#

Can you send the whole method

eternal oxide
opal juniper
#

ohh thats a point ^^

dense remnant
#

I am working on someone elses code (which is horribly miserable) and it worked with empty strings in 1.15 and I entered random characters and now it works

opal juniper
#

maybe try and find some character to fill it instead then

#

minecraft doesn't support the full unicode

#

but there may be some character that you could use

dense remnant
#

I cant post screenshots here, right?

opal juniper
#

You have to verify

#

if not - use imgur

dense remnant
#

k

wraith rapids
#

make sure to link the image, not the webpage

opal juniper
#

lmao

#

it doesn't matter - i can repost the link

wraith rapids
#

the site is slow as shit and full of trash and bloat and ads and scripts

dense remnant
#

I have this problem that whenever I try to place a block at a negative location, it is one block off.

https://i.imgur.com/BhQPCDz.png

I think it has something to do with the block coordinates being one block off when the regular ones are negative. And no, it doesnt have to do anything with rounding bc when I am standing at exactly -279 the blockcoordinates are still -280.

wraith rapids
#

good job

opal juniper
#

it rounds

#

block positions are based on the corners of the blocks

dense remnant
wraith rapids
#

like I explained yesterday

#

the values are rounded towards negative infinity

#

-79.018 rounds to -80

dense remnant
#

And what about -79 exactly?

wraith rapids
#

79.018 rounds to 79

#

that is either -80 or -79

#

i don't remember which

#

doesn't matter, either

dense remnant
#

-80

wraith rapids
#

as a player can not practically stand at the exact border

#

without either hacks or sommands

opal juniper
#

something of a challenge

wraith rapids
#

and no, the block coordinate is not "off"

#

the block coordinate is the coordinate of the block you are in

#

if the coordinate appears to be "off", you are fucking it up somehow

plain quest
#

is it possible to create a coloured command argument suggestion like in vanilla commands?

eternal oxide
#

if you are trying to set teleport coords or something use the block Location add(0.5,0,0,5). That will set you at the block center.

wraith rapids
#

yes, use brigadier

opal juniper
#

brigadier does colours?

#

i didn't know that

dense remnant
wraith rapids
#

you should not need to do that

#

again, if the location appears to be "off", it's because you're making it "off"

eternal oxide
#

are you storing the location and then loading it back in?

dense remnant
#

yes

eternal oxide
#

I guarantee you are converting to an int at some point

opal juniper
#

🤯

eternal oxide
#

thats doing your rounding

dense remnant
#

umm

eternal oxide
#

The fix is to stop storing it as ints

dense remnant
#

lemme check

eternal oxide
#

doubles

dense remnant
#

Nope it doesnt round

#

It only removes the floating point

opal juniper
#

lmao

eternal oxide
#

it does round if you store as ints

dense remnant
#

Like -102.556 goes to -102

eternal oxide
#

it is impossible for it not to

#

yes, its being rounded

wraith rapids
#

yes, and that is what makes it wrong

#

it should go to -193

#

not -192

eternal oxide
#

^

dense remnant
#

Typing mistake

eternal oxide
#

answer is still the same

dense remnant
#

uhh okay

opal juniper
#

afaik it will not just truncate off the decimals

eternal oxide
#

you storing as ints is causing it to be rounded

#

store as doubles and you will be fine.

wraith rapids
#

if you absolutely need to store it as ints, Math.floor it

dense remnant
#

Works now thanks, the mistake wasnt obvious enough for me (but it was still weird that a negative integer somehow turned into something different when converted to double)

wraith rapids
#

numbers can be strange sometimes but each operation performed on them is discrete and documented

#

if you run through your code and look up the operations you're performing, it will make sense

#

the lesson to learn here is that rounding and truncating aren't as simple as one might think; there are many ways to do each

eternal oxide
#

If at any point you are using doubles and something seems up ALWAYS suspect rounding issues.

wraith rapids
#

i had 2.5 million logs in my chests

dense remnant
#

Umm next problem (or isnt but I didnt find anything on google)

I need to place written signs and playerheads onto a wall.

Problem: https://i.imgur.com/5ZOB1om.png

wraith rapids
#

after smelting 6 million logs into coal, I has 13 million coal

opal juniper
#

ignore physics Leoo

sage swift
wraith rapids
#

it took 4 hours to smelt one item

dense remnant
dense remnant
sage swift
#

well signs and heads on walls are wall_head and wall_sign

dense remnant
#

ok

sage swift
#

wall_oak_sign etc. respectively

wraith rapids
#

get the clicked block face

opal juniper
#

sorry - i thought you meant they were being destroyed

wraith rapids
#

if it's top, use a standing sign

dense remnant
tame coral
#

I started a plugin with the bukkit API but now i need some features from spigot, is there anyway i can replace bukkit by spigot ?

sage swift
#

it's 3 am

wraith rapids
#

if it's anything other than top or bottom, use a wall sign

dense remnant
#

ty didnt know it was so easy

sage swift
wraith rapids
#

set its directional property to the opposite of the clicked blockface

opal juniper
tame coral
opal juniper
#

you can just change your dependency

#

and you should be good

wraith rapids
#

if it's a standing sign, you need to use orientable i think

#

no that's for logs

tame coral
#

In my pom.xml file i guess

wraith rapids
#

i don't remember what standing signs use

eternal oxide
wet breach
eternal oxide
#

We need a pointy stick we can jab gecko with when he misbehaves.

wet breach
#

if so, then yes

tame coral
wraith rapids
#

gecko is too based and redpilled to give a shit about your sticks

tame coral
#

Where can i find what to but as a dependency though

wet breach
#

Spigot-API

tame coral
#

I have ```xml
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
<version>1.15.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>

opal juniper
eternal oxide
#

org.spigotmc and spigot-api

tame coral
#

okay thanks !

wet breach
#

or your link works too @opal juniper

dense remnant
#

How do I add text to a sign and change its orientation?

wraith rapids
#

text is in blockstate

#

orientation is in blockdata

opal juniper
#

^^

wraith rapids
#

get the state and data and cast to the corresponding type, then invoke the needed methods

sage swift
#

is this normal? what...

wraith rapids
#

then update state by calling state.update

#

and update data by calling block::setblockdata

eternal oxide
opal juniper
sage swift
opal juniper
#

not in 1.16

dense remnant
wraith rapids
#

seems kind of silly

opal juniper
#

but - they may now

wraith rapids
#

getstate

opal juniper
#

i reckon it is either player made or a bug

sage swift
#

player made, on my test server

opal juniper
#

wtf

#

why you ask then 🙃

sage swift
#

shitty vines

opal juniper
#

idm them

wraith rapids
#

generation sucks

opal juniper
#

adds some mood lighting

sage swift
wraith rapids
#

all of the structures are shit and generate like ass

opal juniper
#

ahh ok

sage swift
#

as in, not player made

wraith rapids
#

villages especially

opal juniper
#

yeeah

sage swift
#

hey nnyak

#

what should i do if i want to lobotomize villagers

opal juniper
wraith rapids
#

there's a plugin for it

#

i heard the author is a pretty cool guy

#

oh that reminds me

#

is there an api way of forcing a sapling to grow

sage swift
#

yes

wraith rapids
#

even setting the age to max age still requires it to receive a random tick to grow

quaint mantle
#

how i can to create a list of custom blocks in class, like enum?(enum works shitty)

opal juniper
wraith rapids
#

that seems really dumb but I guess i'll give it a shot

opal juniper
#

while (block.getType() != Material.(wood)) block.applyBoneMeal()

or some shit like that

opal juniper
#

what

wraith rapids
#

watch the server crash when I try to do that with a sapling that can't grow

opal juniper
#

maybe put some logic in there 😄

wraith rapids
#

yeah i'll have to i guess

opal juniper
#

wait i take that back

#

there is

#

yeah use the tag LOGS

quaint mantle
#

🙂

quaint mantle
opal juniper
#

yeah

wraith rapids
#

that will surely be performant

dense remnant
#

Umm

CraftWallSign sign = (CraftWallSign) loc.getWorld().getBlockAt(tmp).getBlockData();
sign.setFacing(bf);
loc.getWorld().getBlockAt(tmp).setBlockData(sign);

Doesnt do anything

wraith rapids
#

why are you casting it to a craft sign

opal juniper
#

why CraftBukkit

#

yeah

quaint mantle
#

don't use nms there

dense remnant
#

uhh well I casted it to Sign and the error was "craftwallsign couldnt be casted to sign" so I used this xD

quaint mantle
#

why are you casting craftwallsign to sign?

#

create new Sign

#

don't cast it

#

you shouldn't cast it

wraith rapids
#

Sign is for the block state

#

the block data is like Directional or something

quaint mantle
quaint mantle
dense remnant
#

Can anyone just send an example on how to place a wall sign, add text and specify the orientation?

opal juniper
#

im not gonna

#

sorry 🤷

quaint mantle
#

that isn't long

#

wtf

[13:15:47 ERROR]: Error occurred while enabling zACustoms v1.0-SNAPSHOT (Is it up to date?)
java.lang.ExceptionInInitializerError: null
        at ru.zacustoms.Main.onEnable(Main.java:54) ~[?:?]
for (Blocks blocks : Blocks.values()) {
opal juniper
#

What is Blocks

quaint mantle
#

is enum

#

or i need to decide this problem
or i need to create class instead enum, but idk how

#

😕

dense remnant
#

Okay setting text works now.

How do I set the facing exactly?

quaint mantle
#

that is blockstate

quaint mantle
#

make a for

summer scroll
#

I mean, what is your goal?

quaint mantle
#

run method Blocks.ALL_FROM_BLOCKS.getItem() and no more

summer scroll
#

Oh, is that an enum that you created?

quaint mantle
#

it is

summer scroll
#

Oh, I don't know then, sorry.

wraith rapids
#

exceptionininitializer would imply that the class can't be initialized

dense remnant
#
org.bukkit.block.data.type.WallSign matSign = (org.bukkit.block.data.type.WallSign) b.getBlockData();
matSign.setFacing(bf);
 sign.setData(matSign);
``` Uhh
wraith rapids
#

check your enum declarations and static initializers and shit

quaint mantle
# wraith rapids exceptionininitializer would imply that the class can't be initialized

i've the next:

Caused by: java.lang.IllegalArgumentException: ru.zacustoms.blocks.Blocks is not an enum class
       at java.base/java.lang.Class.enumConstantDirectory(Class.java:3791)
       at java.base/java.lang.Enum.valueOf(Enum.java:267)
       at ru.zacustoms.blocks.Blocks.valueOf(Blocks.java:26)
       at ru.zacustoms.blocks.Blocks.getBlock(Blocks.java:77)
       at ru.zacustoms.blocks.NoteBlocksWrapper.<init>(NoteBlocksWrapper.java:18)
       at ru.zacustoms.blocks.Blocks.create(Blocks.java:86)
       at ru.zacustoms.blocks.Blocks.<clinit>(Blocks.java:28)
opal juniper
#

?paste it

undone axleBOT
quaint mantle
wraith rapids
#

you don't want to call Blocks.valueOf in a static initializer of Blocks

quaint mantle
#

?

eternal night
#

Seems like quite the circular dependency you got there

wraith rapids
#

read the stack trace

quaint mantle
eternal night
#

basically your enum isn't done initialising but you are already asking for its values

wraith rapids
#

is it even an enum

eternal night
#

from the code send, looks like it

quaint mantle
#

using for

wraith rapids
#

that's not relevant

#

you are querying the enum's contents inside the enum's initializer

#

read the stack trace

eternal night
#

basically move the notes block wrapper from the create method to somewhere outside of the enum

#

concerning that it "wraps" the blocks enum, that shouldn't be an issue

#

tho like new NoteBlocksWrapper(custom_block, note, instrument); a constructor that isn't assigned is also a bit fishy xD

quaint mantle
#

ah

#

i see now

quaint mantle
#

i need to avoid it

desert sedge
#

With bukkit config api, is possible to stop breaking long lines in two parts?

#
    - chance:(10), display:(ACACIA_BUTTON 1 name:ieat lore:ieat), item:(ACACIA_BUTTON
      1 name:ieat lore:ieat)```
This should be in one line
wraith rapids
#

not that i know of

#

that said you might want to revise that line a bit

desert sedge
#

That's not something I can do

wraith rapids
#

you're writing it down, surely you can change it too

desert sedge
#

Is the format used by CrateReloaded and my plugin - GUIHelper - is a tool to create configs for other plugins

#

So ...

#

Unlees I misunderstand you

opal juniper
#

i mean that is just a serialised hashmap looking thing right?

desert sedge
#

I personally use a string builder

#

But I guess it can be seen like that

opal juniper
#

deserialise it then

desert sedge
#

I think we are talking about different things

opal juniper
#

what are you trying to split

desert sedge
#

I serialize items to that format, the entire system is done, only this little thing that break lines at some point is left

quaint mantle
#

After my mate pushed some stuff to our repo I can no longer package my plugin

#

Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project SpigotServer: Fatal error compiling

#

Fixed by updating Lombok.

desert sedge
#

Hope you meant removing

quaint mantle
#

why is that

#

@desert sedge

desert sedge
#

Lombok is cursed

sonic bronze
#

Hello guys and girls,
I am having a problem Placeholder API related and didn't find a thread talking about this problem or this approach. Now that you know what its about I will tell you the exact problem I have:

I want to use dynamic Placeholders, which means that I do not hardcode my placeholders, like you would normally do it (%plugin_name_of_player%) but I want a dynamic, which generates on start of program.
So lets say my plugin creates groups, that you can add players to. These groups can be configured in my config.yml. In this example, we say I created group x and y
Now I want to return a String via Placeholder API of all users inside of group x. Normally I would create a Placeholder looking like %plugin_players_of_x% but we do not want to hardcode x.

I tried to solve this by creating a case where the Placeholder, that will be requested in my Plugin, just has to start with "players_of" and then iterate through the groups I got from my config. But it seems that it does not work that way.
Do you know what would be best practise here?

quaint mantle
#

someone knows how i can retrieve properties from other plugin? this one isnt working

ivory sleet
#

Gaby not that link here

quaint mantle
ivory sleet
#

Lombok is kinda cursed lol

quaint mantle
#

how come

ivory sleet
#

I mean if you really disturb yourself on a language with extreme verbosity you better go with kotlin imo.

quaint mantle
#

Well I mean it's an extremely popular tool

wraith rapids
#

LOMBOOOK

#

windows 10 is extremely popular too

#

hypickle as well

#

shit is popular among the flies

ivory sleet
#

Yeah but it fucks with source codes cuz decompiled code won’t look like source code

quaint mantle
#

Yeah but is that really a bad thing

ivory sleet
#

Which fucks with IntelliJ but else than that lombok has great features

desert sedge
#

As conclure said, if you dont like the boilerplate, use kotlin

#

@ivory sleet help me if you are a helper smh conclure

wraith rapids
#

he's not a helper

#

he's a mod

#

who doesn't moderate

ivory sleet
wraith rapids
#

in other words he is orange

ivory sleet
# quaint mantle in what way

For me it didn’t add the class properly to the classpath but long time since so probably fixed by now I hope

quaint mantle
#

prolly

ivory sleet
wraith rapids
#

satan worshiping month is almost over

desert sedge
#

Lol

ivory sleet
#

Satan worshiping thonking

wraith rapids
#

yes

#

let me explain

#

basically

#

pride = satan worship

desert sedge
#

Not in here though

wraith rapids
#

pride is the first of the 7 deadly sins

#

the pride flag has 6 colors instead of the biblical 7

#

in the bible 7 represents completeness and perfection

ivory sleet
#

Lmao I guess

wraith rapids
#

6 represents imperfection and imitation

#

666 is the number of the beast

#

the pride flag lacks indigo, which represents unity with and belonging to god

#

god creates, satan imitates

#

pride month is an elaborate ruse by the deep state to get the masses to worship satan

ivory sleet
#

I mean I would just say pride month is pride month

wraith rapids
#

and pride is a sin

#

why do we celebrate a sin

#

if not for satan

ivory sleet
#

Yeah well most people don’t think of/ associate pride as that sin prolly.

wraith rapids
#

and that's because of decades or centuries long brainwashing by the underground powers that follow satan

ivory sleet
wet breach
wraith rapids
#

i'm not

wet breach
#

then why are you worried about if its a sin? lol

wraith rapids
#

because lots of people still care about religion and sin and whatever

#

i'm just playing the devil's advocate

wet breach
#

lol

wraith rapids
#

but yes, I do have a religion

#

it is one I made myself

#

I call it maninism

#

in maninism, the ultimate form of all life and existence is the real man

wet breach
#

o.O

#

I thought that was men's right movement stuff?

wraith rapids
#

i don't know about that

#

a movement like that probably exists

#

and probably by the same name

wet breach
#

these days anything is posssible 😂

hybrid spoke
#

can we join your custom religion?

wraith rapids
#

do you seek to be real men?

hybrid spoke
#

just if your religion also have smth like a jesus

#

what is your jesus?

#

mensus?

wraith rapids
#

the real son

hybrid spoke
#

the real son of who

wraith rapids
#

the real man

hybrid spoke
#

what does they look like

#

nerdy, bodybuilder, suit ups?

#

all in one?

wraith rapids
#

they look like whatever they want

#

and whatever they want is how they look

#

their forms are perfect, but perfection is defined in terms of being the real man; the real man is not defined in terms of perfect

hybrid spoke
#

so will the real man turn into a real lad, if he wants one?

wraith rapids
#

the real man is a real man regardless of appearance

hybrid spoke
#

interesting

#

do i have to apply?

wraith rapids
#

anyone who seeks the path to be a real man is automatically a member of maninism

#

we currently have over 6 million members

hybrid spoke
#

oh nice. brb. will write it down into my instagram description.
member of maninism
he/him/man

quaint mantle
#

How to make recipe visible to player?

dense remnant
#

How do I place a skull onto a block?

#

Like not on the wall but on the bottom

wraith rapids
#

wall skull vs skull

opal juniper
#

^^

weary geyser
#

How do I do something like while(player.getInventory().getHelmet != null)

#

Or would that work

versed violet
#

getEquipment

hybrid spoke
#

if the players helmet is null you will freeze the server.

#

use a scheduler

weary geyser
#

Aight

crude axle
#

Does the getMaxHeight() method in World provide any extra height provided by data packs?

opal juniper
#

Ummm

#

i mean i guess it depends on the implementation of the datapack

#

i would assume yes but idrk

#

i guess you gotta just try it and see

hybrid spoke
quaint mantle
#
   player.sendMessage(Color.BLUE + "You have used the strength ball you will receive strength for 30 seconds");```
#

so

#

it gives me strength for only 1 seconds and strength 3

#

and the chat message just does "Color:[rgb0x00FF]You have used the strength ball you will receive strength for 30 seconds"

shy wolf
#

can i edit an a hologram with a boolean?

#

like whan boolean is true the holo will say "true"
and whant the boolean is false the holo will say "false"

#

...

summer scroll
quaint mantle
burnt current
#

Hey, quick question:
I tried to create a wand that shoots a fireball which is invisible and creates red particles.
I got some help from somebody else. He sent me the following class:
https://hastebin.com/wufugoyimo.java
and the following listener, which then makes the fireball shoot.
https://hastebin.com/egosazefip.csharp

The fireball is shot, but it is not invisible and the following error is displayed in the console:

Caused by: java.lang.NullPointerException: Cannot invoke "com.comphenix.protocol.ProtocolManager.addPacketListener(com.comphenix.protocol.events.PacketListener)" because "this.manager" is null
        at de.straussfalke.questplugin.listener.EntityHider.<init>(EntityHider.java:83) ~[?:?]
        at de.straussfalke.questplugin.listener.ItemListener.handleFireWand(ItemListener.java:56) ~[?:?]

does anyone know how I can solve this? Thanks in advance

chrome beacon
#

Did you forget to depend on Protocollib

burnt current
#

that could be. I have also already received the tip that I could enter the following in the plugin.yml:

depend:
- Protocollib

But then nothing worked on the server anymore

chrome beacon
#

You need to add that

burnt current
#

ok but how?

chrome beacon
#

Like you just said

#

depend:

  • Protocollib
burnt current
#

hmm ok. Does this have to come before the compartment "commands" or after?

fringe valve
#

Hello everyone, random question, can't seem to find this anywhere on google: when is an entity's entity id (the integer one) get set? Is it on spawn?

fringe valve
burnt current
# fringe valve I put it before, haven't tried after. Better put it before, just to be safe.

Ok, I have done that now. However, when I start the server I now get the following error message:

Could not load 'plugins\questplugin-1.0.jar' in the 'plugins' folder.
org.bukkit.plugin.UnknownDependencyException: Unknown dependency Protocollib. Please download and install Protocollib to run this plugin.

By the way, my Plugin.yml looks like this:

name: QuestPlugin
version: ${project.version}
main: en.straussfalke.questplugin.Main
api-version: 1.16
authors: [sf]
depend:
  - Protocollib
commands:
  qcreate:
    Permission: quest.spawn, quest.kill, quest.edit
  giveitem:
    permission: item.fireball, item.command

Does anyone know how to download protocollib properly, or have a tutorial from youtube or a website for me?

granite stirrup
#

in the plugins folder

#

;-;

opal juniper
granite stirrup
#

also maybe chage it to ProtocolLib

granite stirrup
#

but i guess thats how it works ;-;

weary summit
#

Am I doing anything wrong? The potion effects aren't being removed and it's printing "here"

    System.out.println("here");
    playerJoined.getActivePotionEffects().removeAll(playerJoined.getActivePotionEffects());

I looked if there was a function to update it (like the inventory one) but couldn't find one

burnt current
opal juniper
granite stirrup
#

second of all its case sensitive i think so try putting there ProtocolLib

opal juniper
#

Can you get all the blocks a player can see

acoustic pendant
#

how can i solve this problem? i make the class in another class

acoustic pendant
#

where?

#

oh ok

opal juniper
#

U put registerEvent

acoustic pendant
#

thanks

granite stirrup
acoustic pendant
#

@opal juniper

quaint mantle
#

What are you doing?

acoustic pendant
#

this thing

#

now i have there a problem that idk what is

granite stirrup
quaint mantle
#

You have one too many parenthesis

#

Put your mouse over the error and it tells you btw….

acoustic pendant
#

maybe is something about this class?

granite stirrup
acoustic pendant
#

Cannot resolve method 'registerEvent(example.example.Example, example.example.MyListener)'

#

that error always appears

granite stirrup
acoustic pendant
#

now

#

other errors appears xd

#

@granite stirrupthat thing

granite stirrup
#

k i thought it was plugin then listener

#

getServer().getPluginManager().registerEvents(new MyListener(), this); <-- do this sorry

acoustic pendant
#

ooh

#

finally

#

ty :3

burnt current
junior breach
#

I know this might not be the place to ask; but out of pure curiosity, how on earth do you make a custom server experience on Bedrock Minecraft, is it possible without if you arent a 'verified' or partnered company? I would love to make a bedrock server but I see no resources on how to even start. Just wondering if anyone knows if its even possible?

granite stirrup
#

to change

#

it to

dusk flicker
granite stirrup
#

ProtocolLib

#

in ur plugin.yml

burnt current
#

I have already done that too

granite stirrup
#

try restarting the server

#

and not using /reload

burnt current
#

okey

proven sonnet
#

Hi. I'm using intelliJ and trying to do a plugin with a config but it isn't working: it's not generating the "config.yml" in plugins folder from server ... Can somebody help?

granite stirrup
#

uh what?

burnt current
#

oh sry

eternal night
#

time to throw the entire code into a translator again

hybrid spoke
burnt current
# granite stirrup try restarting the server

ok, I have also tried. Now I get the following error message:

Error occurred while activating QuestPlugin v1.0 (Is it up to date?)
java.lang.NullPointerException: Can't call "org.bukkit.command.PluginCommand.setExecutor(org.bukkit.command.CommandExecutor)" because the return value of "de.straussfalke.questplugin.Main.getCommand(String)" is null
        at de.straussfalke.questplugin.Main.onEnable(Main.java:20) ~[?:?]`

the following is my main:

package de.straussfalke.questplugin;

import de.straussfalke.questplugin.commands.CurrencyCommand;
import de.straussfalke.questplugin.listener.ItemListener;
import de.straussfalke.questplugin.listener.NPCHandler; import de.straussfalke.questplugin.listener.NPCHandler;
import de.straussfalke.questplugin.listener.JoinEvent; import de.straussfalke.questplugin.listener.JoinEvent; import de.straussfalke.questplugin.listener.JoinEvent
import org.bukkit.Bukkit;
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.java.JavaPlugin;

public final class Main extends JavaPlugin {

    @Override
    public void onEnable() {
        NPCHandler npcHandler = new NPCHandler();
        ItemListener itemListener = new ItemListener();

        getCommand("giveitem").setExecutor(itemListener);
        getCommand("qcreate").setExecutor(npcHandler);
        getCommand("currencycreate").setExecutor(new CurrencyCommand());
        PluginManager manager = Bukkit.getPluginManager();

        manager.registerEvents(new JoinEvent(), this);
        manager.registerEvents(npcHandler, this);
        manager.registerEvents(itemListener, this);
    }

    @Override
    public void onDisable() {
        // Logic to shut down the plug-in
    }
}

and

 getCommand("currencycreate").setExecutor(new CurrencyCommand());

is line 20

#

yes

#
name: QuestPlugin
version: ${project.version}
main: de.straussfalke.questplugin.Main
api-version: 1.16
authors: [ sf ]
depend:
  - ProtocolLib
commands:
  qcreate:
    permission: quest.spawn, quest.kill, quest.edit
  giveitem:
    permission: item.fireball, item.command
#

not?

#

Oh, you mean the Command... I thought you meant ProtocolLib

#

Thank you for the advice 😅

#

Ohh Cool :D

#

ok so far everything is working again for now. However, the fireball that is fired is still not invisible.
The Error Message:

java.lang.NullPointerException: Cannot invoke "com.comphenix.protocol.ProtocolManager.addPacketListener(com.comphenix.protocol.events.PacketListener)" because "this.manager" is null
        at de.straussfalke.questplugin.listener.EntityHider.<init>(EntityHider.java:83) ~[?:?]

this refers to the following class:
https://hastebin.com/wufugoyimo.java

and the line specified in the error message is this one:

 manager.addPacketListener(
eternal night
#

the error even tells you what is wrong 😭

lunar schooner
#

Hey there quick question, for Player#addPotionEffect, does this automatically stack with existing effects or should I do that manually?

eternal night
#

automatically stacks

lunar schooner
#

Awesome. Thanks!

burnt current
eternal night
#

Well, ProtocolLibrary.getManager seems null

#

concerning you assign it prior

burnt current
#

so I should add the line this.manager = ProtocolLibrary.getProtocolManager();
after manager.addPacketListener(?

eternal night
#

no no

#

protocol lib is installed as a plugin right ?

burnt current
#

yes

eternal night
#

are you calling this constructor at some very weird point in your plugin initialisation phase ?

quaint mantle
#

how i can set Entity for spawner? I need to use entity equipment

eternal night
#

like, during construction of your main class or something

#

don't think there is API for that aniby

quaint mantle
#

Hey guys ! IIRC I saw once a plugin that make not required to restart server each time we reload a modified plugin ? what was it ?

#

methods must be.

quaint mantle
eternal night
#

so you are creating this instance in your onEnable ?

quaint mantle
eternal night
quaint mantle
#

i needn't spawn it

#

i need simply put entity in spawner

#

custom blocks is so hard.

eternal night
#

Yea no, there is no API for this

quaint mantle
#

NMS maybe?

eternal night
#

well yes

#

but not an API

#

more like, "pass me the NBT Tag"

quaint mantle
#

bad

quaint mantle
astral depot
#

is it a good way to store not accessible data? Something like discord bots, they store information that people can't get

astral depot
#

I want to store player information that that player can't get, like someone can download this plugin but can't get any information

hoary knoll
#

does worldborder.getSize get the radius or diamter?

#

diameter*

quaint mantle
#

create class, create hashmap, create public state DATA data for your information and create class constructor

hoary knoll
#

oh good idea, dont know how i didnt think of that

proven sonnet
quaint mantle
proven sonnet
quaint mantle
proven sonnet
lethal knoll
#

Does anyone know how to store custom objects in the PersistentDataContainer?

quaint mantle
burnt current
lethal knoll
#

is there?

quaint mantle
hybrid spoke
#

what code are you using to actually generate the file

quaint mantle
hybrid spoke
#

the file in your ide doesn't mean its embedded in your code

#

its just there

#

maybe there is something in the file

#

but if you never generate that file it will never be in your plugins folder

hybrid spoke
#

use ?paste

#

?paste

undone axleBOT
lethal knoll
quaint mantle
hybrid spoke
#

and deserialize it if you get it back

proven sonnet
hybrid spoke
#

what is your problem now? your config.yml or your pom?

proven sonnet
hybrid spoke
#

show me your main

quaint mantle
#

Hey there,

I'm trying to spawn a floating item using packetwrapper and i tried this but it doesn't show up anything without an error...

public FloatingItem(Player player, ItemStack itemStack, Location location) {

        this.spawn = new WrapperPlayServerSpawnEntity();
        this.destroy = new WrapperPlayServerEntityDestroy();
        this.eID = (int) (Math.random() * Integer.MAX_VALUE);
        this.spawn.setEntityID(eID);
        this.spawn.setUniqueId(UUID.randomUUID());
        this.spawn.setX(location.getX());
        this.spawn.setY(location.getY());
        this.spawn.setZ(location.getZ());
        this.spawn.setObjectData(0);
        this.spawn.setType(EntityType.DROPPED_ITEM);
        this.spawn.sendPacket(player);
    }

any idea?

cold pawn
#

Quick question dose anyone know why this dosen't work? It dosent print an error or anything it just dosent do anything, did I do smthing wrong?

quaint mantle
cold pawn
#

I do

eternal oxide
cold pawn
#

Yeah that one was a mistake im just testing things out

#

It messages a player its pretty self explanitory

gloomy ore
#

Hello, I am trying to make it so people keep their potion effects on their deaths. I save it in a HashMap. But when I die with potion effects I get this error message in console.

Caused by: java.lang.NullPointerException: Cannot invoke "java.util.List.add(Object)" because the return value of "java.util.HashMap.get(Object)" is null

Here is my code:


    public HashMap<String, List<PotionEffect>> effects = new HashMap<>();

    @EventHandler
    public void onDeathEvent(PlayerDeathEvent event) {
        Player plr = event.getEntity().getPlayer();
        for (PotionEffect e : plr.getActivePotionEffects()) {
            effects.get(plr.getName()).add(e);
            return;
        }
    }

    public void onRespawnEvent(PlayerRespawnEvent event) {
        Player plr = event.getPlayer();
        for (PotionEffect e: effects.get(plr.getName())) {
            plr.addPotionEffect(e);
        }
    }
}

ivory sleet
#

effects.get(plr.getName()) returns null