#help-development

1 messages · Page 1741 of 1

young thicket
lavish hemlock
#

"meta info," contains information about the files in the jar.

pine island
#

.

lavish hemlock
#

e.g. the main class, the signature used for signing the jar's classes, etc.

lavish hemlock
pine island
#

oh ok

lavish hemlock
#

But yeah Oracle loves renaming zip files.

pine island
#

does

lavish hemlock
#

e.g. <JAVA_HOME>/lib/ct.sym

#

or the jmod format from Java 9+

lavish hemlock
pine island
#

ok the plugin does have the yml what to do now?

lavish hemlock
#

Hm, any errors when the server starts?

quaint mantle
#

hey maow when did u started java

lavish hemlock
#

2 years ago.

quaint mantle
pine island
lavish hemlock
#

Right around the start of COVID-19.

quaint mantle
#

u dont need to care bout that

pine island
#

hmm

#

nope no error

lavish hemlock
#

Okay so, to clarify, does the server show the plugin if you type /plugins?

pine island
lavish hemlock
#

Huh...

pine island
quaint mantle
#

no errors in the start right?

#

start a brand new project because maybe it would waste our time

pine island
#

shall i send the whole start?

quaint mantle
#

maybe yes

pine island
quaint mantle
#

YOU SON OF A

pine island
#

wym?

quaint mantle
#

do you have an eye to track whenever it is an error or normal log?

#

i only need 1 eye, at least 1 eye

#

to notice the error

#

and you dont even have one

last ledge
pine island
#

dude im using cmd how tf am i supposed to know

quaint mantle
#

💩 spigot
🍺

lavish hemlock
#

There should be no problems with your plugin tbh.

pine island
#

so how do i fix it?

lavish hemlock
#

Dunno.

#

Sorry.

quaint mantle
#

use something like directly put ur java path into ur batch file

#

or just uninstall the other java and use only one java

pine island
#

i have only 1 java wym?

quaint mantle
#

U need 2 change your Compiler

#

Ma friend

pine island
#

im new to java give me something more in-depth lol

quaint mantle
undone axleBOT
pine island
#

i use cmd to run it most of them are for eclipse

quaint mantle
#

Are u using eclipse?

pine island
#

nope

#

IntelliJ

#

& use cmd to run server

quaint mantle
#

Dunno how 2 change intellij compiler setting

#

Google is your friend

#

File > Project Settings will allow u to change jdk version IIRC

outer crane
#

Is it possible for 2 teams on the same scoreboard to have the same entry or are they removed when you add the same entry to two different teams?

quaint mantle
#

Im making a skywars server
But i need to make two npcs
First npc gonna teleport player to solo game
Second npc gonna teleport player to team game
Help pls

outer crane
#

wrong channel

outer crane
#

nvm javadoc says #2 is right

azure nova
#

hello, how can i create a block object of chest xd

eternal oxide
#

Look at the javadocs to see if Chest is a sub interface of BlockData or BlockState, then get the relevant and cast to Chest

glossy venture
#

unsupported by the JVM running your server

#

what version are you running?

#

and developing the plugin for?

pine island
#

Version for :1.16.5 ; Making in: Java17 i think

#

@glossy venture

glossy venture
#

1.16.5 uses Java 8

eternal night
#

1.16.5 does not run with java 17 does it ?

#

It allows up to java 16

glossy venture
#

use Java 8 target compatability

#

do you use gradle?

pine island
#

nope

warm igloo
eternal night
#

You can use java 16

#

For 1.16.5

vapid thorn
#

so im taking it this PacketPlayOutBlockAction doesnt seem to work on displaying opening barrels. works fine on chest, trap chests and such but when I do a barrel.. it doesnt seem to do anything about open. do I need to use a different packet, or .. ? (I do want this per player, otherwise I would of just used lidded#open(), etc)

eternal oxide
vapid thorn
#

got to get their equipment

eternal oxide
#

You don;t have to test every armour location, just set the stack size on your ItemStack to zero

vapid thorn
#

player.getEquipment().setBoots(null);

eternal oxide
#

i.setAmount(0);

#

no need for all the test of where it is

warm igloo
#

ok let me try that

#

worked! tysm

pine island
#

how to change comiler in InteliJ?

eternal night
#

Presumably you use a proper build framework such as gradle or maven

#

Which can handle this in a plain configuration file

pine island
#

i have maven

eternal night
#

In which case you simply specify the target version ?

glossy venture
#

im thinking of completely rewriting this

#

i wrote this like a year and a half ago

#

i just made a repo for it

eternal night
#

Are you publically hosting a spigot jar 👀👀

glossy venture
#

oh fuck

#

._.

sand rune
#

Guys

#

I'm making a rank sys

#

So

#

How to make owner on the top

#

I tried way of Scoreboard teams

#

Didn't work

solid cargo
#

how can i make a dropper always face up?

sand rune
#

Also how to set the display name that other players see to another color

#

Setdisplayname don't work

quaint mantle
#

Can't you write it all in one sentence instead of one by one?

sand rune
quaint mantle
#

@sand rune top of what? Tablist?

sand rune
pine island
#

how to fix this even tho im using maven 1.8

chrome beacon
#

Remove api version in plugin.yml

#

Or set it to your version

pine island
#

oh ok got it

quaint mantle
pine island
chrome beacon
#

In your project

crude charm
lean gull
#

hi everyone! i have a question: i have this method for creating items:

    public static ItemStack createItem(String name, Material mat, List<String> lore, int cmd) {
        ItemStack item = new ItemStack(mat,1);
        ItemMeta meta = item.getItemMeta();
        meta.setDisplayName(name);
        meta.setCustomModelData(cmd);
        if (!(lore.equals(Collections.singletonList(null)))) {
            meta.setLore(lore);
        }
        item.setItemMeta(meta);
        return item;
    }```and i want to add a blockstate part to it, so i can set the item's blockstates for when you place the blocks, how do i do that?
chrome beacon
#

Like chest contents for example?

karmic mural
#

So basically I am wanting to check blockbreakevents if the block broken matches a set of blocks from an array.... BUT I want to do it as efficiently as possible, and (while I may be quite dumb) I believe a for-loop is not the best way to go about these things. Anyone got some tips as to what I should be doing?

chrome beacon
#

You can do a binary search

karmic mural
#
public class breakevent implements Listener {

    String[] blocks = {"DIAMOND_ORE", "DEEPSLATE_DIAMOND_ORE", "EMERALD_ORE", "DEEPSLATE_EMERALD_ORE"};

    @EventHandler
    public void onBlockBreak(BlockBreakEvent e) {
        String b = e.getBlock().getState().getType().name();
        for (int i = 0; i < blocks.length; i++) {
            if (b == blocks[i]) {
                Player p = e.getPlayer();
                p.sendMessage("You broke a " + b);
            }
        }
    }
}

what I'm working with currently.... I feel like this is definitely not the most efficient way to do it

chrome beacon
#

That code won't work

eternal oxide
#

add Materials to as Set, then just call .contains

crude charm
karmic mural
karmic mural
eternal oxide
#

HashSet

crude charm
undone axleBOT
karmic mural
eternal oxide
chrome beacon
#

Comparing strings with == shouldn't work??

ivory sleet
#

String::intern catup

karmic mural
karmic mural
pine island
#

@chrome beacon i have been trying to fix this problem for days tysm

chrome beacon
crude charm
chrome beacon
#

Could you just put the entire thing on github

crude charm
#

there is some stuff I need to keep private

#

aka my utils

ivory sleet
#

Why the utils tho?

#

Anyways you could just decide not to commit them

crude charm
#

ik but I just rather not make this code all public

#

if you want anything specific lmk

#

but I dont wanna share everything in it

ivory sleet
#

I’m not the one assisting you but it ought to be a hell for the one who’s helping you if you’re not willing to give them what they need shrug

crude charm
ivory sleet
#

That makes 0 sense tho

crude charm
#

how?

ivory sleet
#

If you give them all the code, then that’s basically the repo

crude charm
#

there is alot of stuff apart from what I need help with

eternal oxide
#

I didn't comment on it as theres simply not enough code to tell if you are doing any of it correctly

crude charm
#

What part do you want?

eternal oxide
#

More. A couple of lines of this and that tells us nothing

#

Do you get teh message that it is null in the test?

crude charm
#

?paste

undone axleBOT
crude charm
eternal oxide
#

Do you get the message you were sending on null? or are you getting an NPE?

crude charm
#

im returning fine

#

but the enum is null

eternal oxide
crude charm
#

and it also does on the sb

eternal oxide
#

sb?

crude charm
#

but thats besides the point

eternal oxide
#

I'll assume you truncated the code as theres a very odd switch in your EventManager

crude charm
#

I don't think I use a switch

eternal oxide
#

line 42

crude charm
#

omfg lmfao why is that there

eternal oxide
#

it should work, its just... odd

crude charm
#

idk why it was there

young thicket
#

Even though I write, team members can hit each other.

        red.setAllowFriendlyFire(false);
        blue.setAllowFriendlyFire(false);

how do i fix it

crude charm
crude charm
fading lake
young thicket
#

@fading lake
@crude charm
https://notes.io/Gg1y
If I use the /takimyap command, the ones in this code work.

crude charm
#

@eternal oxide it works now LMFAO im so dumb, I wrote the code at 3am so no wonder but I think it was because I used to use a switch to check for the event times but I cleaned it up after I tested if it worked

ancient plank
#

yikes use ?paste instead of notes.io when showing code

undone axleBOT
eternal oxide
#

I looked and thought thats a pretty shopping list.

ancient plank
#

wtf is this font

fading lake
#

Thats a nice todo list

#

Love how the {'s are in the middle of the lines

young thicket
#

Even though I write, team members can hit each other.

        red.setAllowFriendlyFire(false);
        blue.setAllowFriendlyFire(false);

how do i fix it
https://notes.io/Gg1y
If I use the /takimyap command, the ones in this code work.

crude charm
#

Thats a nice guest list

fading lake
#

Wonderful wedding invite list

crude charm
#

thats a nice inventory list

fading lake
#

stocks formatted very well

crude charm
#

What a beautiful bukkit list

fading lake
#

wouldn't go that far, bukkit lists r messy asf

crude charm
#

p

#

a

#

s

#

t

#

e

#

wow

#

such a nice spelling list

fading lake
#

yes it is

#

psate

#

paset

#

pstae

fading lake
#

pasta

young thicket
fading lake
#

WOW

crude charm
#

wow

#

this is amazing

fading lake
#

ITS SO VIBRANT

#

AND BEAUTIFUL

young thicket
#

Can you stop kidding and help?

young thicket
#

you're not funny, toxic kid

fading lake
#

lol I think im very funny

#

anywya

crude charm
young thicket
#

so?

#

i'm new
:)

crude charm
#

do you not see whats wrong?

young thicket
#

nah

eternal oxide
fading lake
#

yeah you missed that out on your beautiful list of notes

crude charm
#

also you're not checking for a command

fading lake
crude charm
#

if he doesn't check for a command

young thicket
#

@eternal oxide I think I understand.
thanks

crude charm
#

then how will it know that command

#

?

fading lake
#

if hes done setExecutor("command") then itll only execute on that command

crude charm
#

fr?

fading lake
#

yep

crude charm
#

WOW

ivory sleet
#

setExecutor(string)

eternal oxide
#

its only the JavaPlugin onCommand that fires for all registered commands

fading lake
ivory sleet
#

Yeah I just had to pepestonks

fading lake
#

:angery:

ancient plank
#

mfw when they posted their code I went to thinking "what version is this? #addPlayer is deprecated in recent versions"

crude charm
#

my new fav gif

fading lake
#

why cant I use external emotes >:I

crude charm
#

why cant I send my fav gif

ivory sleet
#

ZoiBox this is not the channel for those gifs

crude charm
#

what channel

tardy delta
#

Heh

ivory sleet
#

Well probably not in this discord

crude charm
#

😦

ivory sleet
#

It’s kind of inappropriate

crude charm
#

what discord

ivory sleet
#

I’m serious

crude charm
#

ok

tardy delta
#

/ban

crude charm
tardy delta
#

Heh

fading lake
fading lake
#

ive scarred the poor child

crude charm
jovial nymph
#

what is the best way to save a building?

quaint mantle
jovial nymph
#

ok

manic crown
#

Hi, i am getting Error occurred while enabling XpBorder v1.0.0 (Is it up to date?) java.lang.NullPointerException: Cannot invoke "org.bukkit.World.getHighestBlockAt(int, int)" because the return value of "org.bukkit.Location.getWorld()" is null

this is the code, where the error came from:

        spawnLocation = spawnLocation.getWorld().getHighestBlockAt(0, 0).getRelative(0, 1, 0).getLocation().add(0.5, 0, 0.5);
    }```

Idk how to fixx it..., can you help me please?
crude charm
#

it tells you EXACTLY what is wrong

manic crown
#

yeah, the return is 0 but why

#

that make no sense for me

crude charm
#

send class

hasty prawn
#

NullPointerException return value of "org.bukkit.Location.getWorld()" is null

crude charm
#

^

eternal oxide
#

read the FULL error

crude charm
#

your instance of the world is null

manic crown
crude charm
#

public Location spawnLocation = new Location(Bukkit.getWorld("world"), 0, 0, 0);

#

@manic crown

#

Bukkit.getWorld("world")

#

should be

#

Bukkit.getWorld.getName.equals("world")

manic crown
#

so the "world" is missing

crude charm
#

?

#

What what you're doing it's looking for smth else

#

you need to check for the name

tardy delta
#

hehe already ready with my exercice while everybody is still busy

hasty prawn
#

There probably isn't a world named "world"

crude charm
#

I've had this issue in the past

#

it's because you need to check for the name

#

not just get the world

tardy delta
#

is there a folder called "world"?

crude charm
#

^

manic crown
crude charm
#

yup

#

its what I said

manic crown
#

but the errorcode is only while starting, not on /reload

crude charm
#

?

manic crown
#

on reload everything works fine

crude charm
#

idk

tardy delta
#

what's even the issue?

crude charm
#

I've told you what is wrong

manic crown
#

on serverstart is the error

crude charm
#

take it or leave it

#

fix it or dont

#

idc

#

but I've told you what u need to do

tardy delta
#

can't you just get plugin.getServer().getWorlds().get(0)

manic crown
crude charm
#

I give up

manic crown
#

i meant the reaction to you

#

the message came in wrong timing

crude charm
#

ok

tardy delta
#

the npr is at Location#getWorld() so the location is null

quaint mantle
quiet ice
#

check if current xp is over the required xp, then optionally call the level up code after you added the xp

hasty prawn
#

Just remember to check after you've added the xp, not before.

quaint mantle
#

ohhhhhh i see my mistake

#

ty

latent dove
#

netheritrefjetuh

#

nice shovel name

quaint mantle
#

German lang ma boi

quiet ice
#

🇩🇪

lean gull
#

how does one set a blocks' blockstates?

#

i want to change a placed block in a BlockPlaceEvent blockstates

quiet ice
#

I believe the blockstate class has an update method

lean gull
#

huh?

quiet ice
#

?jd

lean gull
#

wha- what do i do with this

acoustic widget
#

Hello anyway to get access on org.bukkit.craftbukkit.Main mainclass ? I ran buildtool but crackbukkit doesn't appear in m2

quiet ice
#

call it and you have set the blockstate

lean gull
#

to what tho?

quiet ice
#

your blockstate object

lean gull
#

huh

quiet ice
#

do you even have an blockstate instance?

lean gull
#

idk what that is so i'mma go with no

quiet ice
#

then what is your question about?

lean gull
#

i just want to change the powered blockstate, the instrument blockstate and the note blockstate of a noteblock when it's placed

#

also is there a way to make it so it doesn't update the blockstates? so like if you place a block near a powered noteblock and there's nothing actually powering it, the blockstate will change

#

and i want it to not change

quiet ice
#
var state = block.getstate();
// Optionally cast state
// Modify state by calling methods on it
state.update();
lean gull
#

i don't know how to use this or what it does

#

can someone please explain to me how to do this?

eternal oxide
#

run a BukkitTask 1 tick later to set all your NoteBlock settings

lean gull
#

ok but idk how to set the blockstates

#

anyways i'm gonna eat now, i'll be back with the same question when im done eatin doe

eternal oxide
#

probably somethign like java NoteBlock note = (NoteBlock) block.getState(); //change settings on the note. note.update(false);

#

I didn;t bother to check if its a state you need or BlockData. You need to check that

wide creek
#

Im creating my own plugin for my server and i wanted to create a border every time someone joins the server using WorldBorderAPI. I coded everything, but the method .setBorder() doesn't work, it doesn't throw any error and Java go forward in the code.
Gist: https://gist.github.com/EnderF5027/1cc283e02b08caf6ddae93a08aae5828

I created an Issue on their github but i didnt get any reply (2 Days)

serene plover
#

how do i code java? im trying to make a plugin but that part is difficult and idk how thank you

quaint mantle
plucky crow
#

Can you give me a code where I can get half of the players to another team and the other half to another team?
with "/scoreboard teams join <team> <player>"
I will assign this to a command.

undone axleBOT
serene plover
#

thank you for your help :D

eternal oxide
wide creek
eternal oxide
#

Second, make the logger the same as you did the config. get it from your Main

#

but make it a Field in teh Class so you are not fetchign it every time a player joins

proud basin
#

ElgarL the G

wide creek
eternal oxide
#

Lastly Location is Serializable so you can just playerData.set("WorldBorderInfo.Center", location); and playerLocation = playerData.getLocation("WorldBorderInfo.Center");

eternal oxide
#

if you create a Field in your Listener class it can be private, as you'll only access it within the class

#

One LAST point... Don't call your plugins Entry Class Main. Applications have a Main, these are Plugins and as such should not. Name your Plugin Class the same as yoru plugin

opal juniper
#

?main

eternal oxide
#

Then learn

tardy delta
#

It's not difficult

#

A head from a head database?

#

If you can get the itemstack

lavish hemlock
#

you'd need to look at their API probs

tardy delta
#

Prob headDB

lavish hemlock
#

and uhhh

#

we can't really help you with their API

#

bc not everyone is fucking omniscient

lean gull
#

i still need help

#

pls someone

ivory sleet
#

Be patient

lean gull
#

bruh i sent the first message about this topic an hour ago

ivory sleet
#

Complaining won’t get you help faster, I can assure you

eternal oxide
#

I gave you all you need

#

You didn't understand what to do with it is all

lean gull
#

elgarl you just sent me code and when i didn't understand it you told me to learn

#

this IS how i learn

eternal oxide
#

You want to set the data on a NoteBlock when it is placed.

lean gull
#

and to cancel any updates to the block apart from breaking it

#

or setting it to another block or air

eternal oxide
#

So you schedule for 1 tick after the block is placed (as you don;t want to trigger any updates.

lean gull
#

ok

#

and then what

eternal oxide
#

then you do as I showed you in teh code block, inside the runnable

lean gull
#

idk what a runnable is and idk how that works

#

or how to use it

#

so if you could be kind enough to explain how it works that would be great

eternal oxide
#

inside the runnablejava NoteBlock note = (NoteBlock) block.getState(); //change settings on the note. note.update(false);

lean gull
#

i don't know what this is, what it does, what a runnable is, or how to use this

eternal oxide
#

teh block is the one that was just placed

#

?scheduling

undone axleBOT
lean gull
#

yep, i have

eternal oxide
#

then create a BukkitRunnable for 1 tick after the NoteBlock is placed, pass it the location

#

from that Location you can get teh Block and make all your adjustments

lean gull
#

all i know how to do for that is to make a thingie that only works after a tick

#
Bukkit.getScheduler().runTaskLater(pluginInstance, () -> {
    //do stuff
}, 1L);```
eternal oxide
#

yes, but don;t use a lambda

lean gull
#

idk what a lambda is

eternal oxide
#

as you need to pass a variable to it

#

You got it yet?

lean gull
#

no

eternal oxide
#
    public void onBlockPlace(BlockPlaceEvent event) {
        
        final Block block = event.getBlockPlaced();
        
        if (block.getType() == Material.NOTE_BLOCK) {
            
            new BukkitRunnable() {
                
                @Override
                public void run() {
                    NoteBlock note = (NoteBlock) block.getBlockData();
                    
                    // Make changes here
                    note.setInstrument(Instrument.BASS_DRUM);
                }
            }.runTaskLater(plugin, 1);
        }
    }```
#

Will probably work

lean gull
#

there's no HARP instrument

#

what's sticks? i have never heard of that

jovial nymph
#

can use this: ~ in a command to get a position?

lean gull
#

how do i set the note

eternal oxide
#

really?

lean gull
#

what

#

i tried like 4 different combinations

eternal oxide
#

Try some of those keys on the big pad in front of you

lean gull
#

there's flat and tone and sharp and idk what all those do

onyx basin
#

Hi, how can I check if button is powered?

lean gull
#

btw ur code does not work

lavish hemlock
#

musician Maow is acting why there is both flat and sharp...?

eternal oxide
#

Correct, I left out one line specifically so you would be forced to fix it

lean gull
#

im guessing you mean the plugin thing?

#

at the delay 1 tick at the end

eternal oxide
#

no

lean gull
#

then i have no clue what you're talking about, sorry

eternal oxide
#

all the code there is correct (bar plugin instance). There is one line you have to add to make it all work

#

you have to update the data back onto the block

lean gull
#

ah

eternal oxide
#

no, thats ancient

lean gull
#

then what do i do

#

pls help i am big nub

eternal oxide
#

as I said before you had to check if it was state or BlockData, as it turns out its BlockData as you can see in teh code I recently showed you

#

block.setBlockData(...

lean gull
#

block.setBlockData(note); ding ding ding or no ding ding ding?

eternal oxide
#

yes

lean gull
#

yay!

#

okie but how 2 set note and also stop it from updating

#

dis is for a resource pack btw

eternal oxide
#

what have you tried for note?

lean gull
#

uh idk i deleted it

eternal oxide
#

don;t care, I've never used a resource pack

lean gull
#

sheesh ok

eternal oxide
#

note.setNote(...

lean gull
#

ye i did that

eternal oxide
#

and?

lean gull
#

but idk how to use it

#

it has sharp and tone and whatnot

#

why cant u just set it to a number lol

eternal oxide
#

if you look at teh auto complete suggestions as you type its quite simple

lean gull
#

for ma smol brain it is not simple

eternal oxide
#

it requires a Note, which is comprised of an octave (int) and a Tone

#

eg note.setNote(Note.natural(5, Tone.C));

lean gull
#

wat da tone do

eternal oxide
#

try it and see

warped sage
#

or look it up

sleek pond
#

It gives you one of the 12 notes in music

eternal oxide
#

abcdefg

spare marsh
#

Isn’t this Ultra Spoon feeding?

eternal oxide
#

yes

warped sage
#

yeah

#

ElgarL you're really patient

#

more so than I would be

lean gull
#

isn't there like 24 notes per noteblock instrument tho

sleek pond
#

Man, if you don't know music u probably shouldn't be making it in mc

spare marsh
#

Yeah I’m surprised I would’ve tossed my phone by now

spare marsh
#

Agree

warped sage
lean gull
#

am not makin music, noteblocks are just good for custom blocks since they have like 700 different blockstates

eternal oxide
#

natural/flat/sharp and abcdefg

#

then octaves

lean gull
#

how 2 do harp instrument tho? it's not suggesting me it and when i put it in it red

spare marsh
#

My suggestion would just be to learn Java before because he didn’t even know what A lambda is

lean gull
#

this is how i learn

eternal oxide
#

there is no specific Harp, try them all and see what you prefer

spare marsh
#

This Ain’t learning Java, this is learning the API of Spigot. You’re having issues with basic Java terms.

lean gull
#

i need harp cause that's what i use for the current 5 blocks i have

eternal oxide
#

whatever you are using its one of those listed in the Enum

lean gull
#

also i did octave 0 and tone A and it gave me 3?

#

like it's note 3 now

eternal oxide
#

I've no idea what a "note 3" is

lean gull
spare marsh
#

Wouldn’t A Note Block if HARP in B# be one state and Another one In Bass B# be another state?

warped sage
#

by the way, JUST from checking out the javadocs there's even a contructor of Note that just accepts an integer like you want

#

which will give you the nth note

lean gull
#

idk what a constructor is

eternal oxide
#

oh my

lean gull
#

i think i knew what it was but then i forgot

warped sage
eternal oxide
#

perhaps we shoudl start at the beginning

lean gull
warped sage
#

what "didn't work" about it

eternal oxide
#

Java consists of letters and numbers laid out in a specific order...

warped sage
#

seems to do exactly what you want

lean gull
#

it was red and stuff

warped sage
#

well...

sleek pond
warped sage
#

that means you probably made a syntax error

sleek pond
#

Or something

lean gull
#

that's literally all i did

warped sage
#

and that's wrong

eternal oxide
#

😄

warped sage
#

because that's not using the constructor

sleek pond
#

Judging by the fact that derpy has no musical knowledge, it's probably mistaken a harp for something else

lean gull
#

it literally just says setNote(Integer) in the docs

eternal oxide
#

no its doesn;t

warped sage
#

where?

#

the thing I sent doesn't say that

lean gull
#

am i reading the wrong thing

eternal oxide
#

kinda

lean gull
#

my brain is just pure confusion, please tell me what im supposed to read

warped sage
#

read up on what a constructor is

eternal oxide
#

I've given you full working code now, play with it until you have exactly what you want

prime reef
#

is JavaPlugin a mutable class or nah

lean gull
#

but there's no harp instrument and the note is different from what i put in

#

idk how music works so idk what im supposed to put in for the note

warped sage
waxen plinth
#

🤔

quaint mantle
#

I think u should contact google baba he might know the answer to that question

tardy delta
#

AAARGH

lean gull
#

im guessing i need C then?

tardy delta
#

??

ivory sleet
prime reef
ivory sleet
#

it has some mutable properties

#

However it uses its name’s hashCode iirc which is immutable

prime reef
#

okay good

#

that's what I was wondering, thanks conclure

tardy delta
#

the opposite of unmutable 🌝

warped sage
tardy delta
#

the server runs on the main thread so what

waxen plinth
#

is multithreaded packets possible ?

ivory sleet
#

Oh I was replying to the wrong message my bad photoshop

quaint mantle
#

is multithreaded packets possible ?

warped sage
ivory sleet
#

You can send them async sure though they’ll be queued and handled like the ones you send synced I’m pretty sure

tardy delta
#

waah @quaint mantle you're here too

lavish hemlock
quaint mantle
#

I m everywhere

ivory sleet
#

You ensure the data is O(1) lookup-able

#

No

tardy delta
#

hashmap is O(1)? 🥺

ivory sleet
#

It’s really not

ivory sleet
lavish hemlock
lean gull
#

i found harp

ivory sleet
#

But it can in worst case be O(n) for stuff like remove, contains and put with the presumption that every key in the hashmap has the same hashCode

lean gull
#

apparently it's Instrument.PIANO

lavish hemlock
#

although it's recommended to support databases if select portions of data are required

lean gull
#

am i supposed to try all of the tones until i find 0?

ivory sleet
#

Yeah lol

lavish hemlock
#

that's easily solved by having a decent hashCode impl, which IDEA can gen for you

ivory sleet
#

Indeed

#

Sure

tardy delta
#

player data what

lavish hemlock
#

not sure what you mean by that tbh

ivory sleet
#

If it’s immutable then it’s automatically thread safe pepestonks

lavish hemlock
#

no lol

pine island
#
if(Output === "15000$ have been taken away"){
 ispatchCommand(Bukkit.getServer().getConsoleSender(),"GMC");
else{
Sytem.out.println("say Not enough money to revive")
}

any help is Grateful

code:


import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.event.player.PlayerRespawnEvent;
import org.bukkit.plugin.java.JavaPlugin;
import java.util.concurrent.TimeUnit;
import java.time.format.DateTimeFormatter;
import java.time.LocalDateTime;
import java.util.concurrent.TimeUnit;
import static java.util.concurrent.TimeUnit.*;

public final class HardcorePurge extends JavaPlugin implements Listener{



    @Override
    public void onEnable() {
        // Plugin startup logic
        System.out.println("------------------------------------------------------------------------Hardcore purge was started Initialisation was success No problems were found--------------------------------------------------------------------------------");
        int x = 1;
        getServer().getPluginManager().registerEvents(this, this);
    }

    @EventHandler
    public void onDeath(PlayerDeathEvent event) throws InterruptedException {
        //Even for Dying
        System.out.println("Player Died--------------->");
        Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(), "say Oh no , player has Died! There they go to purge!");
        String PlayerName = event.getEntity().getName();
        //setting GMS
        Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(), "gamemode adventure " + PlayerName);
        //sudo
        Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(),"eco take " + PlayerName + " 15000");





    }


    @Override
    public void onDisable() {
        // Plugin shutdown logic
    }
}```
#

ok so i want to make a hardcore revival system that makes it so that i can use Essential X's economy to revive the player for this i want to read console & make an if statement like this:

eternal oxide
#

?learnjava

undone axleBOT
ivory sleet
#

Lol

lavish hemlock
#

I wanna see the performance diff between immutability and RW locks.

#

Jesus christ

quaint mantle
ivory sleet
pine island
eternal oxide
#

EssentialsX

#

it has an API to read all these things

pine island
#

also is reading the console possible? will need it for future

lavish hemlock
#

object instantiation, especially large objects, are expensive

tardy delta
lean gull
#

can someone please tell me how this works? or like a website with minecraft noteblocks note numbers converted to octave and tone?

warped sage
#

if you are going to change it anyway, yes. I think they mean that an object being immutable just means you don't need any locks and thus don't have the locking overhead

ivory sleet
#

Yes but I said if it’s possible to have certain data immutable it automatically infers you don’t need to mutate the data.

pine island
lavish hemlock
#

okay, Demon, if you don't even know what an API is, stop asking about asynchronousity, you will break things.

ivory sleet
#

Also maow I just came across stampedlock

#

Quite useful

lavish hemlock
#

what's that?

lean gull
#

also i still don't know how to stop it from updating

tardy delta
#

is that one with a timestamp?

ivory sleet
#

Very interesting

#

(:

tardy delta
#

i also saw ones with a condtion

lavish hemlock
#

huh, cool

#

oh wait so the "stamp" is a timestamp then??

#

that's neat

tardy delta
ivory sleet
lavish hemlock
#

"Java 9 StampedLock"
Conclure: sends Java 8 docs for StampedLock

ivory sleet
#

😅

lavish hemlock
#

not sussy baka at all

ivory sleet
tardy delta
#

kinda sus

lavish hemlock
#

there's an imposter among us

tardy delta
#

pfwoa

ivory sleet
#

google always recommend javadocs 8 whenever u google for a class shrug

#

Sometimes even 7

tardy delta
#

baeldung the best

lavish hemlock
#

Java 8 is a good version

ivory sleet
#

True

pine island
#

how can i use Essential X to read console & use that as a var in my own plugin?

quaint mantle
sleek pond
#

Use the essentials api

#

It's not very easy to read console, if possible at all

pine island
#

ah

tardy delta
#

wdym by reading console?

lean gull
#

pls someone help me

quaint mantle
sleek pond
#

Use the api

#

It's can't get any simpler to explain

tardy delta
#

go the the essentials server and ask it there 🌝

pine island
#

any other way to detect A economy command being used(EssetialsX)?

lean gull
#

where can i find all the notes converted into numbers

cinder plume
#

Guys , simple stupid java doubt

quaint mantle
#

just go to the EssentialsAPI and add/remove the money according to that, (u will probably need Vault API tho)

pine island
#

making a hardcore thing which will depend on the same

cinder plume
#

For two given expressions
if(x==1 || y==0)
and second expression
if(x==1 | y==0)

whats the diff

tardy delta
#

| is bitwise

#

i'm too scared to learn what it does

quaint mantle
cinder plume
#

i have an idea

#

:?

#

so in case 1 , if x is false then y will be checked right?
and in case 2 , both will be chcked regardless together right?

quaint mantle
#

yes

#

same with & in boolean condition

#

they have different meanings when they come to numbers tho

tardy delta
#

that's why i'm scared 💀

quaint mantle
#

its not that complex

warped sage
#

|| and && can't be used for numbers, they only work on boolean expressions

#

they do what's called logical short-circuiting

lean gull
#

someone pls help

warped sage
#

the | and & operators are just bitwise OR and AND

lean gull
#

i am going insane here

quaint mantle
#

its quite simple, & means common binary digits, | any binary digit that is 1

tardy delta
#

so & returns a byte?

warped sage
#

it can, if you use it on 2 bytes

#

but larger numerical values like shorts, integers and longs also consist of bits, albeit more

quaint mantle
#

man I already miss the this emote 🥲

tardy delta
#

true

quaint mantle
#

1 = 0001 in binary
2 = 0010 in binary
so 1 & 2 = 0 cuz they have nothing in common (0000 in binary)
and 1 | 2 = 3 = 0011 in binary

warped sage
#

then to make things even more fun there's also the XOR operator ^

tardy delta
#

so & only checks for 1 bits?

warped sage
#

that is a binary logical operator, but java doesn't have NAND

tardy delta
#

🧠 🤯

quaint mantle
quaint mantle
warped sage
#

it needs to be 1 in the first AND (&) the second number

quaint mantle
#

like 0011 = 3 and 0010 = 2
3 & 2 = 2 = 0010

tardy delta
#

ok

warped sage
#

and boolean values act as a single-bit number in this case

#

so 0 & 1 = 0
0 | 1 = 1
1 & 1 = 1
0 | 0 = 0

#

same behavior as && and ||

#

but both are evaluated

#

main distinction is when you have side effects or computations that take longer to evaluate

quaint mantle
#
boolean var0;
boolean var1;

if ((var0 || var1) && !(var0 && var1)) {
  print("XOR");
}

XOR can simplify things like this if statement to

if (var0 ^ var1) {
  print("XOR");
}

this is how XOR looks like in conditions

warped sage
#

why are you asking if async everything is possible

tardy delta
#

that

quaint mantle
#

probably he is trolling 🤣

tardy delta
#

Cheap Vpn Services for minecraft hacking dm me

warped sage
tardy delta
#

smh

warped sage
#

oh lol

#

I just read the same thing

lean gull
#

i still need help, please

karmic mural
#

1000101

warped sage
lean gull
#

dude i have no clue how music works, i don't know what tone and octave i need and i have been googling and found nothin

quaint mantle
lean gull
#

they're saying stuff like F# and i just don't understand

tardy delta
#

what are you even trying to do?

lean gull
#

resource pack

tardy delta
#

what from resourcepack?

#

custom blocks i guess

lean gull
#

yep

karmic mural
tardy delta
#

🥺

karmic mural
#

Wait how the hell did you get 45?

tardy delta
#

1 + 4 + 64?

warped sage
#

it is 45 in hex lmao

#

and 69 in decimal

quaint mantle
karmic mural
warped sage
#

ah lmao

karmic mural
#

I didn't even think of hex

warped sage
#

should've said 0x45 like a real chad

karmic mural
#

What am I, stupid?

quaint mantle
#

u a dangerous man

#

using that as a banner

golden turret
karmic mural
#

They don't allow outside emojis...

#

Okay sorry I took this off-topic for a bit. I'll stop it

#

So how about HashSets? Aren't they awesome? Literally learned about them today lmao

quaint mantle
#

yes

#

hashmap still better

ivory sleet
#

HashSet uses a HashMap (;

tardy delta
#

whats even the benefit with a enumset?

ivory sleet
#

Better lookup time

#

Pretty much ensured to be O(1)

#

For put, contains and remove

quaint mantle
#

ah didn't know that

karmic mural
#

I basically just wanna pull a list of blocks from a config the user can edit, then shove that in something I can search through, but search through efficiently

tardy delta
#

and it should contain constant values?

quaint mantle
#

||no its the time efficiency|| no one saw this got it

young knoll
#

I wish we had a readMaterial for configs

karmic mural
#

Speaking of configs... I've been trying to get a grip but my brain is just smoothing out. Anyone know of a good tutorial I can watch?

young knoll
#

Would be a nice utility

karmic mural
#

It would be nice if I didn't have to do some trickaroos to check for a set of blocks but you know, we work with what we got

karmic mural
tardy delta
#

spigotmc site is blocked at school smh

karmic mural
warped sage
#

just use the google translate circumvention trick

#

oldest trick in the book

tardy delta
#

i forgot my vpn password and i'm too lazy to go search it

tardy delta
quaint mantle
#

forgot password

tardy delta
#

ugh i have too many combos

warped sage
#

click on the "translated" link

#

voila

tardy delta
#

lol

#

never knew that

karmic mural
tardy delta
#

imma try that when i'm at school :kekw:

tulip owl
#

[18:36:26 WARN]: Nag author(s): '[Zax71]' of 'GHSPPAdminTools' about their usage of System.out/err.print. Please use your plugin's logger instead (JavaPlugin#getLogger). how do i get rid of this?

karmic mural
#

We could also open up an admin cmd window and tell other computers in the lab to open their dvd drive 🤣

tardy delta
#

we have blockers that block games but when you put a . after the url it works 😂

tulip owl
#

what do i use instead?

young knoll
#

Read the bottom of the message

quaint mantle
#

read the error message

karmic mural
#

(JavaPlugin#getLogger)

tulip owl
tardy delta
#

plugin.getlogger()

karmic mural
#

^^

tardy delta
#

owo

tulip owl
#

ty, i'm noob at java 😆

tardy delta
#

heh

quaint mantle
#

~~we know ~~ I realized too late

alpine urchin
#

Be kind.

quaint mantle
#

feels like I shouldn't have said that, mb

karmic mural
#

I will avoid going here in the future so I don't get absolutely embarrassed asking a simple question 😅

#

I can take the insults dw ❤️

alpine urchin
#

don’t worry

wide creek
alpine urchin
#

ask rreely

#

freely

#

we ask to learn

karmic mural
#

SMH They're sending a message with an alias and not putting the alias inside of "" I am literally so upset

quaint mantle
#

imma leave before I ruined this chat 🖐️

alpine urchin
#

you can’t progress without help

karmic mural
alpine urchin
#

depends

karmic mural
#

It does help just rubberducking stuff, I've found. Like 80% of the problems I have I resolve myself after just explaining my issue

alpine urchin
#

advice or redirecting to resources counts as help

young knoll
#

🦆

karmic mural
#

Yup, and I've received awesome help here so far. Been here for one day and I am definitely sticking around.

alpine urchin
#

at the begginning people don’t search

#

they ask here

tardy delta
#

🥘

karmic mural
#

I appreciate asking someone for the sake of having a conversation, but if you're just wanting people to do stuff for you that's a whole other thing

tardy delta
#

imagine using bing

#

i was in another coding discord, i asked a question and they said me to put that in bing

karmic mural
#

I couldn't have solved my issue without coming here, though. Being made aware of HashSet was a blessing that actually reignited my passion for learning how to make plugins

alpine urchin
#

you can’t durectly ask questions when reading a site

karmic mural
#

You're definitely right

#

Healthy mix of feedback, advice and searching for stuff is how to get things done

alpine urchin
#

people are used to tutoring

alpine urchin
#

but internet contains misleadimg info

#

lets put our shoes in a beginner

#

they heard of spigot plugons

#

they wanna make one

#

they search spigpt plugin tutorial

tardy delta
#

that's so true

alpine urchin
#

the tutorials often don’t teach java

karmic mural
#

Though yes, what I was trying to ask was if anyone knew a good tutorial I could watch so I can set up a config? I was told JSON configs are superior, though I just don't have brainpower enough to understand that just yet. YML/YAML config seems pretty bearable but I've not found a good tutorial for it... And I don't have enough knowledge to read spigots post about it

alpine urchin
#

so they struggle

tardy delta
#

like wanting to make a plugin before learning java

eternal oxide
#

Spigot yaml support is pretty good

tardy delta
#

?paste

undone axleBOT
karmic mural
tardy delta
karmic mural
tardy delta
#

maybe some things i would have to change

karmic mural
#

It makes more sense seeing something like this, though. Do I just put this in a separate class for my plugin?

tardy delta
#

uhh your choice

karmic mural
tardy delta
#

i would because it doesnt looks clean

#

to put it in the code

karmic mural
#

Yeah I like having it all separated

alpine urchin
#

learning java before spigot can be boring

sleek pond
alpine urchin
#

as your first lang

sleek pond
#

Just so you don't have to copy paste the thing like 5 times

alpine urchin
#

had me thinking is it perhaps the right way

karmic mural
#

So for the onEnable method, how would I call that class? I assume I'm not doing it with getServer().getPluginManager().registerEvents?

tardy delta
#

wdym by copy-pasting?

alpine urchin
#

spigot was a motivation to keep learning

tardy delta
#

i dont get it

sleek pond
# tardy delta wdym by copy-pasting?

Instead of pasting those if statements 5 times for 5 configs, just add the config and name to a map and loop over it, saves you using duplicated code

tardy delta
#

ah

karmic mural
#

Yeah I was gonna say that was probably what they meant. At least I am not full smoothbrain

alpine urchin
#

and noticed this

tardy delta
#

making a map for just 5 things mwoa possible

sleek pond
#

?

lean gull
#

i still need help btw

tardy delta
#

i could do that but couldnt it require more efforts than that long code

sleek pond
#

No it wont

#

I'll try doing it rn on my hpone

#

Phone

tardy delta
#

but which map do you mean?

sleek pond
#

Java map

quaint mantle
tardy delta
#

i mean FileConfiguration, String or something?

karmic mural
#

Would I need to do anything in my main class to have the configmanager work? I assume I do, though I'm not sure how to proceed as I've so far only had getServer().getPluginManager().registerEvents

tardy delta
#

in mine i only have createFiles() which loads everything

#

and the files are already added to the resources folder so i'm not sure how to create one from scratch

karmic mural
sleek pond
tardy delta
#

me too 🥺

#

ah i guess this creates a new file if it isnt included in the resources folder

#

instead of plugin.saveResource("file.yml", false)

#

iirc

eternal oxide
sleek pond
#

I remember I had some really useful config code in a plugin I made

#

But forget what it is

tardy delta
#

am i correct that plugin.saveResource() gets the file from the resources folder?

sleek pond
#

Hover over it, what's it say

quaint mantle
#

hi

tardy delta
quaint mantle
#

sed

tardy delta
#

one dark vivid italic is my theme

quaint mantle
#

ah ok

tardy delta
#

It uhh..

storm chasm
#

is anyone good for making plugins

golden turret
#

maybe

#

define good

storm chasm
#

oh

#

do you think you could help me?

golden turret
#

?ask

undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Create a thread in case the help channel you are using is already in use!

storm chasm
#

why this

#

i asked

quaint mantle
#

The best thing is to write your problem^^ Someone will be able to help you then

storm chasm
#

people here are just annoying with that command just saying
I don't have a problem i just want to know if it's possible i don't want a scam like at the end the person say no.

quaint mantle
#

what command?

storm chasm
iron palm
#

Hi.
how can i set the void death message ?
i also need to get the last living entity attacker data as display name...
is it possible?

#

I tried this

    public void DeathReason(PlayerDeathEvent e){
    Player killer =    e.getEntity().getKiller();
    Player player = e.getEntity().getPlayer();
        }```
But it wasnt working as well cause the player will die because of void so...
warped sage
#

Then do your stuff whenever a player dies to the void

iron palm
tardy delta
#

check if the died cause is void or something

warped sage
#

Sure but you need to be able to reference it later, also check if it's a player damaging another player

#

Not just any entity

iron palm
#

yee i created a new public void for EntityDamagebyEntityevent

warped sage
tardy delta
#

playerdeadevent i guess

warped sage
iron palm
iron palm
#

i need the data of the guy who knocked that player to void

tardy delta
#

uhh google is your best friend i guess then

warped sage
#

He wants to get the last damager even if the death cause is void

young knoll
#

getKiller will persist for a bit

#

But not forever

tardy delta
#

hmm lemme look at that tomorrow if not finished yet

#

goodnight yall

warped sage
#

Right, and he wants it even when it's not persisting normally

#

Gn

young knoll
#

If you want to track the killer regardless, use a map<UUID, UUID> and the DamageByEntityEvent

warped sage
#

Which is what I'm helping him with

iron palm
wide creek
#

I was developing my plugin since i noticed that I had some error on JavaPlugin.java file.

Cannot resolve symbol 'NotNull'
Cannot resolve symbol 'Nullable'
Cannot resolve symbol 'jetbrains'
iron palm
#

should i try event.finaldamage() ?

eternal oxide
#
        <dependency>
            <groupId>org.jetbrains</groupId>
            <artifactId>annotations</artifactId>
            <version>20.1.0</version>
        </dependency>```
plucky crow
#

Is there a plugin that performs the squid game glass game? If not, how do I do it?

wide creek
leaden falcon
#

how do I make it so
a creeper wont drop an effect on death

wide creek
#

Thx

young knoll
clear blade
#

yo, is there a way to delete a key from a FileConfiguration?

young knoll
#

set it to null

plucky crow
#

Is there a plugin that performs the squid game glass game? If not, how do I do it?

iron palm
# warped sage .

uh so i fixed that but how can i take my stored data from another public void ?
like this but it is giving some errors
Player killer = DeathReason.player();
Deathreason is my another public void

warped sage
#

It doesn't work like that, that's why you'll have to create a HashMap to store it in

#

That denotes the last damager per player

lean gull
#

how does one do F# in setNote()?

sturdy elk
#

Hello, I want the BlockBreakEvent event to cancel when I break the block but release the drop

eternal oxide
#

Note.sharp(...

lean gull
#

works, thanks

#

ok second question: how do i stop a noteblock's blockstates from updating

waxen plinth
lean gull
#

hi corman

leaden falcon
#

hi

waxen plinth
#

Ok

eternal oxide
clear blade
sturdy elk
#

event.setDropItem dont work o_O

waxen plinth
#

Get the BlockState

#

Well yeah if you cancel it then the whole thing is cancelled

#

Get the BlockState

lean gull
#

i have a resource pack that replaces noteblocks with certain instrument blockstate, note blockstate and powered blockstate and i need it so the blocks always stay with their correct blockstates until they are broken

waxen plinth
#

Schedule a task for the end of the tick to set the block back using that BlockState

#

BlockState#update(true)

#

I would be careful with this though

eternal oxide
#

I don;t believe you can stop a redstone signal affecting the state

waxen plinth
#

Cause you could place a chest and break it

lean gull
#

where do i put that

waxen plinth
#

Everything inside the chest would drop

#

Then the chest would respawn and still have all those items inside

eternal oxide
clear blade
#

ohh sorry, i didnt know you guys were talking to me lol

#

thanks 👍

ancient plank
#

I bench press 500 stone

warped sage
#

does anyone know the difference between a chunkgenerator's "getFixedSpawnLocation" and just setting the world spawn? will one override the other?

iron palm
warped sage
#

don't use String, use their UUID or just the actual player objects

young knoll
#

UUID is better

#

Don't have to be as concerned about cleanup

warped sage
#

I'm gonna need more context than "doesnt working"

shadow tide
#

how do I work with permissions without the vault API? Its too outdated and I know how to add and remove an attachment from a player but I don't know how to save those permissions

iron palm
# warped sage I'm gonna need more context than "doesnt working"
    public void DeathReason(EntityDamageByEntityEvent e) {
        if (e.getDamager() instanceof Player && e.getEntity() instanceof Player) {
           Entity  damager = e.getDamager();


        }
    }
        @EventHandler
        public void PlayervoidDeath(PlayerDeathEvent e){
 
            e.setDeathMessage(ChatColor.GRAY+"[ "+ChatColor.RED+player.getDisplayName()+ChatColor.GRAY+" ]"+ChatColor.AQUA+" fell in void by " +ChatColor.GRAY+"[ "+ChatColor.AQUA+ killer.getDisplayName()+ChatColor.GRAY+" ]");
        }```
cant get UUID for an entity so i cant also  restore the damager data in Deathevent
lean gull
#

i still need help with the disabling blockstate updates for a certain block

shadow tide
#

first of all, please name it better. EntityDamageByEntityEvent is much broader than just getting the death reason

warped sage