#help-development

1 messages ยท Page 2091 of 1

crude loom
#

I'm trying to get the next page of a list

past vapor
#

?

crude loom
crude loom
last ledge
#

Russian?

pliant oyster
#

well

crude loom
#

When I click the barrier I want to get the next player

pliant oyster
#

when you create the new inventory

last ledge
#

I love your coding videos

#

thanks

pliant oyster
#

do getInventroy()

pliant oyster
last ledge
#

Storing Player Data! | Spigot/Paper Plugin Tutorial

pliant oyster
#

shush plz

last ledge
#

thanks

pliant oyster
#

delete msg

#

NOW

last ledge
#

come dm or

pliant oyster
#

fuck sake I'm leaving this disc

#

disabling dms

last ledge
#

Come to dm and teach me something

#

or me leaking the link

past vapor
#

@crude loom use a hashmap
<Player, GuiObject>

pliant oyster
#

oh no

#

deleting channel rq

crude loom
last ledge
#

Kids tryna act cool with 2 lines of codes in front of me

#

lmao

pliant oyster
#

last time someone found out, I got roasted hard

last ledge
#

he litreally 14

past vapor
#

the page can be an variable in the GuiObject instance

last ledge
#

ig

#

nice background music

#

whats the name?

pliant oyster
#

idk

last ledge
#

*Cyperpleb java *

pliant oyster
#

OH FUXCK AKE

#

yeah that was my first tutorial

#

I sucked

last ledge
#

VALORANT when their drunk

pliant oyster
#

BRO

#

NO

#

NO

#

NO

#

STOP

last ledge
#

wtf indian song

#

tu rung tu rung tung tu rung turung tara ra

glass mauve
#

how can I make all commands in this String clickable? whats the shortest and best way?
String message = Use <command help> to do this... or this ... <command2 dosmth arguments>!
Goal: <> all these commands to be clickable and have a hovertext

glass mauve
grim ice
#

Not really but its better to use ==

crimson terrace
#

ive had it not work at all with equals

grim ice
#

What

#

no it should work

crimson terrace
#

I had to fix a bug in my plugin where something wouldnt work and the fix was to change the equals to ==

grim ice
#

I dont know what ur talking about

#

comparing enums with equals

#

is fine

pliant oyster
#

in the past I had issues with == to

grim ice
#

== works best

pliant oyster
#

.equals is the only one that works with material for me

crimson terrace
#

All I know is after i changed it to == it worked

grim ice
#

You both did something wrong

pliant oyster
#

prob

last ledge
#

Survivor VS Full Netherite Hitman

grim ice
#

Haha

#

Objects.equals(o, o1)

grim ice
#

maybe one of ur values

#

was null

#

yea

#

who cares

#

about that one 0.01 nanosecond

#

bitches*

crimson terrace
# grim ice who cares

I dont get why people have that attitude to something that has benefits while taking less time than what they were doing

#

.equals(object) takes longer to type than == object aswell

crisp steeple
#

they both have different use casesโ€ฆ

crimson terrace
#

we are exclusively talking about enums rn

crisp steeple
#

well yeah for enums itโ€™s a better idea

tardy delta
#

because people are idiots

crimson terrace
#

fair

wet breach
#

they are not the same

marsh burrow
#

anyone know where I can get a list of all major releases of spigot?

crimson terrace
wet breach
#

doesn't matter, they are still not the same

past vapor
#

== is memory location
.equals is values iirc

#

correct me if iโ€™m wrong ๐Ÿคทโ€โ™‚๏ธ

wet breach
#

that is correct MattMX

past vapor
#

!!!

crimson terrace
#

I know they do different things, we established that

wet breach
#

then, it shouldn't be a case of which takes longer, rather which type of equality you are wanting to check

crimson terrace
#

I was saying, that the better way to check for enums being the same is also the shorter thing to write it

#

no downsides, yet people still use .equals() (for comparing enums that is)

last ledge
#
Iron_block
Diamond_block```

  ```if(block.getType().equals(plugin.getConfig().getString("Blocks")){```
crimson terrace
#

that wouldnt work

last ledge
#

what do I have to do

crimson terrace
#

I dont see the path "Blocks" in your example config

wet breach
last ledge
#

Thats example config ignore it

wet breach
#

thus .equals() would be the only way to check

#

however, a constant that has a value, the value can have a pointer though

crimson terrace
#

frost, lets stop. we were exclusively talking about enums and its getting old

wet breach
#

so am I

last ledge
#

Shreb help me pls

crimson terrace
#

youre trying to compare wether the config contains the type of block youre comparing with?

last ledge
#

code is wrong

visual tide
last ledge
pliant oyster
#

also I'm pretty sure you have to use Material.BLOCK

#

And cast it to a block

crimson terrace
#

could also use Material.valueOf()

pliant oyster
#

Or that

crimson terrace
#

cant really help without seeing the actual code since what you sent isnt a config which would work with the code

#

?paste

undone axleBOT
last ledge
#

if(block.getType().equals(Material.valueOf(plugin.getConfig().getString("Block")))){

#
  COAL_ORE:
    50: #This is the percentage
      - 'eco give %player_name% 50' #This is commands
      - 'give %player_name% diamond 1' #Would like it to support multiple commands
    50:
      - 'eco give %player_name% 50' # All % has to add up to 100%
      - 'give %player_name% diamond 1'```
#

example

crimson terrace
#

or block.getType().getName()

#

try catch is my friend ๐Ÿ™‚

#

put all the code inside a try and catch Exception ignored

last ledge
#

You guys seem so much experienced, for how much time have u been doing this things for ๐Ÿ‘€

river oracle
#

1 year

crimson terrace
#

spigot plugins?

#

damn

river oracle
#

He's an OG

crimson terrace
#

I need your time travel abilities, where they at

pliant oyster
#
String blockName = plugin.getConfig().getString("BLOCK");
Block block = (Block) Material.valueOf(blockName);

if(urBlock.getType().equals(block)){
  // your code 
  
}```
#

Idk if that will work never tried it but that's the concept of it

#

@last ledge

#

also use a try catch

wet breach
crimson terrace
visual tide
#

material is simply an enum value

pliant oyster
#
try{
  String blockName = plugin.getConfig().getString("BLOCK");
  Block block = (Block) Material.valueOf(blockName);
  
} catch(IllegalArgumentException exception) {
  getLogger.info("block does not exist");
  
}```
visual tide
#

while a block describes a block in the world

pliant oyster
#

nah

#

lmao

#

I don't do much with materials

visual tide
#

same way you can cast a CraftServer to AnnotatedParameterizedType

#

gonna be a classcastexception

crimson terrace
#

Heres your monthly call to clean your PC if you havent in a while. fixed my fan making weird sounds by blowing on it a bit earlier

wet breach
#

Depends how you cast it really

#

you could cast it using ordinals

visual tide
#

commpiter

crimson terrace
#

mociapter

#

its called abstraction ๐Ÿ˜›

wet breach
#
public <F extends Enum<F>> F castByOrdinal(Enum<?> e, Class<F> fClass) {
    return Iterators.get(EnumSet.allOf(fClass).iterator(), e.ordinal());
}

If anyone is curious in regards to casting by ordinal in relation to enums

sterile token
#

Any idea im still fucked 2d days with the same problem and still cannot find the solution because the plugin doesnt either explote or send exception of what happening

@EventHandler
public void onPlace(BlockPlaceEvent event) {
        Player player = event.getPlayer();
        if (this.claims.getClaim(event.getBlock().getLocation()) == null) this.claims.create(new Claim(player.getUniqueId(), "test", event.getBlock().getLocation()));
        Claim claim = this.claims.getClaim(event.getBlock().getLocation());
        RadiusCuboid cuboid = new RadiusCuboid(claim.getLocation(), 2);
        if (cuboid.contains(event.getBlock().getLocation())) event.setBuild(false);
        if (claim.getUuid().equals(player.getUniqueId()) || claim.getMember(player.getUniqueId()) != null) event.setBuild(true);
        player.sendMessage("You cannot build on claim " + claim.getName());
    }
#

But really its not funny

#

More than 2 days and still cannot fix lmao

wet breach
sterile token
#

Literally nothing happens hen i place the protection block

wet breach
sterile token
#

Yeah i ill do

wet breach
#

with what you sent we don't know either because we don't know what Claim code looks like

undone axleBOT
#

"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.

midnight shore
#

how can i listen for a furnace open event?

terse ore
#

How can I bone meal all blocks in a radius 3 from x location?

pliant oyster
midnight shore
#

i tried and it doesn't work

terse ore
#

I remembered skript had something like loop all blocks in radius 3

wet breach
#

you will come out a bit more experienced in doing so

sterile token
#

Yeah i think my issue is that i dont put debug message

midnight shore
#

ty for your sympathy

wet breach
#

Put some debug code so you know when each piece of code is being executed or supposed to be

#

when a debug message is missing or thrown depending how you code it, then you know where about the issue is ๐Ÿ™‚

pliant oyster
midnight shore
pliant oyster
#

Idk how to do that tho lmao, I never used it

last ledge
#

[17:58:34 ERROR]: Could not pass event BlockBreakEvent to PercentageBlocks v1.0
java.lang.IllegalArgumentException: No enum constant org.bukkit.Material.MemorySection[path='Blocks', root='YamlConfiguration']
at java.lang.Enum.valueOf(Enum.java:273) ~[?:?]
at org.bukkit.Material.valueOf(Material.java:105) ~[paper-api-1.18.1-R0.1-SNAPSHOT.jar:?]
at net.pyrobyte.percentageblocks.events.BlockBreak.onBlockBreak(BlockBreak.java:26) ~[PercentageBlocks-1.0.jar:?]
at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor2071.execute(Unknown Source) ~[?:?]
at org.bukkit.plugin.EventExecutor.lambda$create$1(EventExecutor.java:75) ~[paper-api-1.18.1-R0.1-SNAPSHOT.jar:?]
at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:80) ~[paper-api-1.18.1-R0.1-SNAPSHOT.jar:git-Paper-184]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[paper-api-1.18.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:628) ~[paper-api-1.18.1-R0.1-SNAPSHOT.jar:?]

undone axleBOT
last ledge
#
            player.sendMessage("Success");```
wet breach
pliant oyster
#

I sent above

wet breach
tardy delta
sterile token
#

I prefer using equals instead of ==

#

I think the coode looks cleaner

wet breach
#

they don't do the same thing

tardy delta
#

mwoa your opinion lol

wet breach
#

they are using Material.valueOf()

sterile token
#

Frost do i forget some debug?

last ledge
#

if(block.getType() == (Material.valueOf(plugin.getConfig().getString("Blocks").toUpperCase()))){

pliant oyster
#

bRO

last ledge
#
  COAL_ORE:
    50: #This is the percentage
      - 'eco give %player_name% 50' #This is commands
      - 'give %player_name% diamond 1' #Would like it to support multiple commands
    50:
      - 'eco give %player_name% 50' # All % has to add up to 100%
      - 'give %player_name% diamond 1'```

CONFIG
pliant oyster
#

zacken you're really helpful

last ledge
#

how

#

๐Ÿ’€

pliant oyster
last ledge
#

;0

#

Blocks example

#

stone

pliant oyster
#

Yeah cuz rn ur getting "Blocks" but not the actual blocks inside

last ledge
#

I'm getting confused

#

๐Ÿ˜ญ

pliant oyster
#

don't listen to zacken I gotchu

sterile token
#

YOu want to get 1 block or lot of blocks?

last ledge
#

and check player mined one of them

#

I want to check for all blocks

#

whatever people put in config

#

that block

pliant oyster
#

Alr so

#

I actually have no idea how to do this but

wet breach
#

while what you have said may be true, the way you are attempting to help isn't really helpful

pliant oyster
#

loop through everything inside Blocks

#

lmao

wet breach
#

in a demeaning way

pliant oyster
#

imagine zacken being your coding teacher

#

we didnt ask

wet breach
#

yeah that isn't the only thing you have said either

maiden thicket
#

isnt blocks

#

forge

#

not spigot

pliant oyster
#

nono that's in config

maiden thicket
#

oh

#

custom?

wet breach
#

stop typing single word lines

#

-.-

maiden thicket
#

sorry chief

wet breach
#

I don't wonder

maiden thicket
pliant oyster
maiden thicket
#

yo imagine going into a dev channel and being rude to ppl trying to help u

#

different breed

sterile token
#

Frost im an idiot completly i never registered the listener

#

Im so idiot

maiden thicket
#

rip

pliant oyster
#

oof

wet breach
#

but, you also succeeded in debugging it on your own too ๐Ÿ™‚

sterile token
#

Because i tested and no debug message came, so i check main class and fin the surprise

maiden thicket
#

is it a list of block materials

#

or keys w sections

wet breach
#

Blocks is most likely going to be a list

#

ah didn't see that

maiden thicket
#

o

sterile token
#

Andn then how you get the value?

#

I never find that

wet breach
#

that is easy

#

I can show example code

last ledge
wet breach
#

its open source

#

MIT even

sterile token
#

he? But get the value of ech section

#

Let say:

Section:
key-1: "My value"
key-2: "My other value"

#

How do you get that values rom confic section

sterile token
grim ice
#

I didnt ask you

grim ice
#

do

#

section.getString("key-1");

maiden thicket
#

u loop thru keys

#

to get the value

grim ice
#

otherwise

#

loop through keys

sterile token
#

Because with config section you loop the keys but then i dont know how to get the value.

#

Oh ook

grim ice
#

if u have smth like

maiden thicket
#

loop through keys, u have the key now, so do getString("Section." + keyVariable)

grim ice
#

section:
childsection:
key-1:

#

then u have to loop

sterile token
#

Yeah that what i have

grim ice
#

u have what i told u ?

last ledge
#

๐Ÿง˜โ€โ™‚๏ธ

sterile token
#

Section:
section-1:
key-1: ""
key-2: ""
section-2:
key-1: ""
key-2: ""

wet breach
#

you could just go to the link I put in here

#

and look at example code

maiden thicket
#

๐Ÿง˜๐Ÿฝ

grim ice
#

and u wanna do smth for each

#

section*1

#

right

#

ok

wet breach
#

well, sure but they are asking questions that would be answered if they just looked

last ledge
#

plugin.getConfig().getConfigurationSection("Blocks").getKeys(false) ๐Ÿฅบ

#

what to do

river oracle
#

Example code pfff I prefer to just spend 2 hours trying to figure something out

sterile token
maiden thicket
grim ice
sterile token
grim ice
#

thats if u want a specific value

last ledge
#

for (plugin.getConfig().getConfigurationSection("Blocks").getKeys(false)){

grim ice
#

thats boomers talk

gleaming grove
#

Can someone explain to me why after changing an object's property the hashcode of the objects changes? How does default implementation of hashcode works?

grim ice
#

no one likes boomers talk

last ledge
#

for (plugin.getConfig().getConfigurationSection("Blocks").getKeys(false)){ like this?

maiden thicket
#

yeah i learned from copying and pasting

grim ice
#

nah

sterile token
#

Sometimes zacken is helpfull but he doesnt explain good what he means

grim ice
#

i read the code

last ledge
#

You learn from the process

grim ice
#

that was copy pasted to me

maiden thicket
#

i didnt learn java on my own i learned it from copying and lasting and spigot

#

xd

sterile token
maiden thicket
#

never went out of my way to "learn java"

grim ice
#

when someone gave me code i would read it

grim ice
#

people have it easy now

maiden thicket
#

yeah but then i managed to somewhat study c# python js ts lua golang on my own

#

so i mean something worked

grim ice
#

u just mentioned all the languages i dont like

#

Good job

maiden thicket
#

lmaoo

grim ice
#

except golang

wet breach
grim ice
#

ye i said that

maiden thicket
#

i hate go only because bad OOP and pointers

grim ice
#

lol

maiden thicket
#

and dont get me started on c++

grim ice
#

C# is just worse java

#

Lmao

gleaming grove
maiden thicket
#

i like it more

#

thats just me

#

and a lot of others

#

xd

gleaming grove
maiden thicket
#

i somewhat learned c++ then i saw u have to do some wizardry just to access an array in a function

wet breach
maiden thicket
#

so then i closed out of CLion

wet breach
#

Sun Microsystems rejects Microsofts implementation

#

so instead of just throwing everything away Microsoft created C#

sterile token
#

Hex something like that?

config.getConfiguractionSection("Section").getKeys(false).foreach(key -> {
     ConfiguractionSection child = config.getConfigurationSection(key);
     getLogger().logInfo("Path: Section." + key + ".key-1");
    getLogger().logInfo("Data: " + config.getString("Section." + key + ".key-1"));
});
maiden thicket
#

yes go does not have good oop

#

and doesnt do inheritance

#

i like me some OOP

#

im just not used to go's oop

#

i mainly hate the pointers part

sterile token
#

Now that i think, why config section doesnt have getter for values?

maiden thicket
#

yes i mean that lol

maiden thicket
#

have a hashmap return on a function

sterile token
#

Like you cannot do:

ConfiguractionSection section = getConfig().getConfigurationSection("Section");
section.getString("key-1");

crisp steeple
#

?

#

pretty sure you can

grim ice
#

no

sterile token
#

Why u cant?

grim ice
#

cuz key-1 is under child

#

of the Section

#

if it was
Section
key-1: "e"

#

then yeah

#

u can

sterile token
#

How you do?

grim ice
#

then u can

sterile token
#

Because section.getString()

grim ice
#

what u just did

sterile token
#

Doesnt exists

grim ice
#

it does

sterile token
#

Wft i just get an event exception

#

๐Ÿค”

crisp steeple
#

youโ€™re sure itโ€™s named โ€œSectionโ€?

#

send the code then

sterile token
#

I will use paste md5

hot fjord
#

Does the api allow for creating custom pathfinding for mobs? I've been looking around and it looks like anyone who has ever done it has used NMS

sterile token
#

Because discord shity dosnt allow to paste the error

#

Yeah tell me?

#

Yeah i try

#

But i didnt understand the Supplier part

maiden thicket
#

not sure abt spigot without nms

hot fjord
#

Okay ill look into it, thank you!

regal anchor
#

anyone knows the org.bukkit.enchantments.Enchantment for sweeping edge ?

delicate lynx
#

it's just called SWEEPING_EDGE

sterile token
regal anchor
#

thanks it works but I didn't see it in the javadoc

sterile token
#

What do you think zacken?

terse ore
#

How can I bone meal/fertilize a crop?

eternal night
#

simulates bonemeal usage

sterile token
#

What?

#

im passing the arguments

mighty pier
#
    public void onEnable() {
        if(Bukkit.getPluginManager().getPlugin("PlaceholderAPI") != null) {
            new SomeExpansion(this).register();
        }``` main class
placeholderapi class:
https://paste.md-5.net/remejateva.java
placeholders dont work
sterile token
mighty pier
#

noone replied in 2 hours

sterile token
#

Oh ok

sterile token
mighty pier
#

actually as i said that someone replied

sterile token
#

What?

#

But "doesnt work" its like not problem

#

We need more information to understand what happening

lavish hemlock
#

?notworking

undone axleBOT
#

"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.

coarse finch
#

how would i loop all the items in my config file?

past vapor
#

for (String key : config.getConfigurationSection(path).getKeys(false))

#

or getKeys(true)

#

root section is just config.getKeys(false)

kind hatch
#

No itโ€™s not.
A root section is a section that exists at the top of the chain. You can have multiple root sections in a YAML file.

rootsection1: true
rootsection2:
  subnode1: โ€œHelloโ€
  subnode2: 16

Using #getKeys(false) on the config as a whole would return rootsection1 and rootsection2.

#

Thatโ€™s why you need to specify the node you want to start at with getConfigurationSection()

#

Using my example.
#getConfigurationSection(โ€œrootsection2โ€).getKeys(false);
It would return subnode1 and subnode2

past vapor
#

yeah

#

thatโ€™s what i said, or at least tried to sum up briefly

terse ore
#

How do I bone meal a block? I use block.applyBoneMeal() but it returns false

pale pendant
#

hello! im coming with a question, how do i check if a player crafter a wooden pickaxe then clear it, and adds a diamond pickaxe with enchantements?

kind hatch
grim ice
kind hatch
grim ice
#

use Cuboid cuboid = new RadiusCuboid if u want

pale pendant
#

i could send my listener

#

?paste

undone axleBOT
sterile token
#

Im to much stressed for that shit

kind hatch
earnest forum
#

I think there's an event for the craft prepare

sterile token
#

Too much time for a shity project that no advances i did on it

earnest forum
#

or maybe that's just for anvils

pale pendant
#

alright, imma check that

#

yes im looking that in the plugin its registered

earnest forum
#

what's not working

pale pendant
#

the code

#

it doesnt replace the pickaxe when in inventory

earnest forum
#

cancelling the event stops you from crafting

pale pendant
#

oh yeah

earnest forum
#

I assume you are trying to replace the wooden pickaxe that is crafted?

pale pendant
#

yes

earnest forum
#

well I guess you could remove the pickaxe from the inventory on craft

#

you should just create a new recipe tho

earnest forum
#

?jd

tardy delta
#

@earnest forum owo

pale pendant
#

or how do i add the enchant on a new pickaxe that is crafted?

kind hatch
pale pendant
#

alright

earnest forum
quaint mantle
#

How do I make the item not "use" or "bop" or whatever when im changing the nbt?

earnest forum
#

There's a PrepareItemCraftEvent

earnest forum
#

you could try set the crafted slot to the pickaxe on that event

quaint mantle
#

wait does that bop as well

#

hold on lemme show

earnest forum
#

make a noise?

kind hatch
#

You mean the animation played when they interact?

quaint mantle
#

yeah

terse ore
#

@kind hatch you know why?

#

.

earnest forum
#

cancel playerinteractevent

quaint mantle
#

ig

earnest forum
#

is that cancellable?

#

it is

quaint mantle
#

not really possible actually

#

in my case

#

its complicated

crisp steeple
#

itโ€™s client side

quaint mantle
#

yeah I thought so

#

no urgency tho I can make the arm swing instead if I really want to

crisp steeple
#

you could technically hide all nbt from being shown to the client but thatโ€™s even more complicated

kind hatch
terse ore
#

oh

quaint mantle
crisp steeple
#

no

quaint mantle
#

anyways doesn't really matter ty for the help

crisp steeple
#

it just involves a lot of packet stuff

#

yea

terse ore
#

If someone knows the issue I get false when using block.applyBoneMeal()

#

using it in wheat seeds

manic furnace
#

How can I teleport a player that is currently laying on the ground?

tardy delta
#

laying on the ground wha-

manic furnace
#

yes with a fake bed you know

tardy delta
#

no

#

i do that sometimes

#

fake bed

#

just laying on the ground

#

๐Ÿ’€

echo basalt
#

maybe 100 lines of code

manic furnace
coarse finch
#

oops i had the wrong jar

#

btw whats the best/fastest to start server for testing?

crisp steeple
timid quail
#

how can i set a persistent data container value with a variable as persistent data type?

#

example:

tardy delta
#

depends on what kind of variable you want to set

pale pendant
#

?paste

undone axleBOT
pale pendant
timid quail
#

there is my code

#

but it sais:

Required:
CapturedType(*)!
Found:
String```
tardy delta
#

and then a string as data

timid quail
#

yes but i want it to be a variable

#

cause its a function argument

#

so you can pass in PersistantDataType.INT and an int value or an PersistantDataType.STRING and a string value

pale pendant
#

oh wait i made a mistake

#

its @fresh templetlistener

#

im sorry for that person who i pinged-

tardy delta
pale pendant
#

can someone help me?

tardy delta
pale pendant
#

damn, no one wants to help me

coarse finch
#

intellij has been loading my gradle changes for like 10m now

glossy venture
#

when is PrepareItemCraftEvent called?

#

is it called if no recipe is selected or matched

pale pendant
#

can someone help me?

glossy venture
#

so whenever you modify the matrix

#

or when a recipe is prepared

glossy venture
undone axleBOT
#

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

glossy venture
#

but sure

pale pendant
glossy venture
#

youre not calling the method

#

you need to call it like recipePickaxe() in your onEnable

#

its not an event

pale pendant
#

oh yeah

#

but what if i want it to check everytime?

glossy venture
#

also you dont need air

#

you can just leave those spots empty with spaces

glossy venture
pale pendant
#

the recipepickaxe

#

because i need to check if a person

#

you know

#

crafted a wooden pickaxe

#

then i want it to change to a diamond pick

glossy venture
#

for that you need to use PrepareItemCraftEvent

#

well idk actually

#

i think you can overwrite the vanilla recipes

#

test the code with calling the method

#

also remove the @EventHandler

coarse finch
#

i get Caused by: java.lang.ClassNotFoundException: com.tchristofferson.configupdater.ConfigUpdater when trying to use ConfigUpdater

#

i think gradles not including it correctly

pale pendant
glossy venture
#

oh ok

pale pendant
#

also how can i call it?

#

the event?

glossy venture
eternal night
#

are you shadowing the config updater dependency

glossy venture
coarse finch
glossy venture
#

like are you using shadowJar?

coarse finch
#

oh hang on

#

im using https://hub.spigotmc.org/nexus/content/repositories/snapshots/

#

i think

eternal night
#

?paste

undone axleBOT
eternal night
#

maybe just paste your build.gradle.kts

#

you need to invoke the shadow plugin

#

in order to shade the dependency

glossy venture
#

no but what task are you using to build it

eternal night
#

so it is available to you at runtime

glossy venture
coarse finch
eternal night
#

you just said you were using gradle

glossy venture
#

just the build.gradle

eternal night
#

oh

#

groovy people

#

lol

glossy venture
#

bruh groovy is fine

eternal night
#

"fine"

coarse finch
tardy delta
#

is groovy smth like maven or gradle?

eternal night
#

nah

#

a lang

tardy delta
#

aight

glossy venture
eternal night
#

Yes you didn't even define the shadow plugin

#

^^

coarse finch
glossy venture
#

it includes the dependencies declared as implementation into the final jar

eternal night
#

just google

#

on how to use shadow plugin

glossy venture
#

at the top

#

and then instead of running build or whatever run shadowJar under the group shadow

#

then take the jar suffixed with -all instead of the normal ones

eternal night
#

or you just configure build to depend on shadowJar

glossy venture
#

oh ye

#

but not really needed

eternal night
#

true

glossy venture
pale pendant
terse ore
#

Can I summon a mob that doesn't attack a specific user?

next zinc
#

Is there a way to use the spyglass ability through code if that makes sense

#

like if I hit right click not using a spyglass it could still show the zoom effect

earnest forum
#

set the result to the pickaxe

#

as that's what you wanna get from crafting

#

adding the item will just put it in the first available slot inside the crafting grid

next zinc
#

so it wouldn't be possible?

echo basalt
#

you can zoom in using some fancy packets but not with the outline

next zinc
#

oof

#

that stinks

#

but ty for the help

coarse finch
#

!bool will return true if its not true correct?

static pendant
#

yes

#

!negative = true

#

!true = negative

#

the ! inverses what's standing next to it

coarse finch
#

ok

#

then idk if my logic is good

#

OHH

#

im using or when i should be using and

midnight shore
#

is there a way to listen for a crop growth event? for example when the pumpkin stem creates the Pumpkin block?

sacred mountain
#

doesnt bool ^= true negate a boolean?

midnight shore
grim ice
#

funny that most people dont even know what groovy is

grim ice
floral forge
#

Ohh, like you need the block that the stem gets attached to? hmmm

grim ice
#

check

#

for the block relatives

#

and check if one of them is a pumpkin

#

possibly

midnight shore
#

wouldn't this break if there are other pumpkins near?

#

i want only the one that generated from the stem

grim ice
#

Well you prob cant

midnight shore
#

thats wierd

#

i wanted to make custom plants by just replacing the pumpking generated with a player head

floral forge
midnight shore
#

i'm trying to use relative faces methodรน

muted sand
#

So modifying bukkit methods in a async context isn't a good idea, but I can test it on events, and see if console complains?
if there aren't any error, i can assume it's safe to use or no?

midnight shore
#

How can i set a block to be a custom player head?

#

i have the player head as an itemstack

coarse finch
#

my logic is messed up

#

idk how to fix it

#
if (!loopPlayer.hasPermission("generalutils.kickall.exempt") && !Config.getConfig().getBoolean("kickall-exempt-enabled")) {
    loopPlayer.kickPlayer(Config.getConfig().getString("messages.kickall-message"));
} else if (!loopPlayer.hasPermission("generalutils.kickall.exempt")) {
    loopPlayer.kickPlayer(Config.getConfig().getString("messages.kickall-message"));
}```
#

wait

#

my brain

#

is dead

small lynx
#

package me.RafaelAulerDeMeloAraujo.Listeners; import org.bukkit.event.EventHandler; import org.bukkit.entity.Player; import org.bukkit.Sound; import org.bukkit.Material; import me.RafaelAulerDeMeloAraujo.SpecialAbility.Join; import org.bukkit.event.player.PlayerInteractEvent; import me.RafaelAulerDeMeloAraujo.main.Main; import org.bukkit.event.Listener; public class Soup implements Listener { private Main main; public int vida; public int fome; public Soup(final Main main) { this.vida = 7; this.fome = 7; this.main = main; } @EventHandler public void UsarSopa(final PlayerInteractEvent e) { if (e.getItem() == null) { return; } final Player p = e.getPlayer(); if (p.getHealth() < 20.0 && Join.game.contains(p.getName()) && p.getItemInHand().getType() == Material.MUSHROOM_SOUP) { e.setCancelled(true); p.playSound(p.getLocation(), Sound.valueOf(this.main.getConfig().getString("Sound.Soup")), 2.0f, 5.0f); p.setHealth((p.getHealth() + this.vida >= 20.0) ? 20.0 : (p.getHealth() + this.vida)); p.setFoodLevel(20); if (this.main.getConfig().getBoolean("KeepBowl")) { e.getItem().setType(Material.BOWL); } else { e.getItem().setAmount(0); } } } }

quaint mantle
#

who needs multiple lines

small lynx
#

Why when KeepBowl is false the soup dont disappear

coarse finch
terse ore
#

How do I detect if a block is ageable?

                                Block block = world.getBlockAt(x, y, z);
                                if (block.getBlockData() instanceof Ageable) {
                                    Ageable data = (Ageable) block.getBlockData();
                                    System.out.println(data.getAge());
                                }

coarse finch
#

what wher

#

e

quaint mantle
coarse finch
#

thats for maven

quaint mantle
#
dependencies {
    compile('com.tchristofferson:ConfigUpdater:2.0-SNAPSHOT')
}
coarse finch
#

thanks

small lynx
quaint mantle
#

thats not an erorr

coarse finch
#

ik but it bugs me

quaint mantle
coarse finch
#

it makes it gray

dire salmon
#

how do i use water bottles for things? i know its potion but i dont know how

noble lantern
noble lantern
#

If block.getState() instance of Skull

#

Might be PlayerSkull im not sure

#

SkullMeta might be another option

midnight shore
#

Yeah but i don't want to set it to a player skin, i want it to be set to a specific custom skull

noble lantern
#

Idk its changed so much over the years lol

small lynx
#

``package me.RafaelAulerDeMeloAraujo.Listeners;
import org.bukkit.event.EventHandler; import org.bukkit.entity.Player; import org.bukkit.Sound; import org.bukkit.Material; import me.RafaelAulerDeMeloAraujo.SpecialAbility.Join; import org.bukkit.event.player.PlayerInteractEvent; import me.RafaelAulerDeMeloAraujo.main.Main; import org.bukkit.event.Listener; public class Soup implements Listener {

private Main main;

public int vida;

public int fome;

public Soup(final Main main) {

this.vida = 7;

this.fome = 7;

this.main = main; }

@EventHandler public void UsarSopa(final PlayerInteractEvent e) {
if (e.getItem() == null) { return; }

final Player p = e.getPlayer();

if (p.getHealth() < 20.0 && Join.game.contains(p.getName()) && p.getItemInHand().getType() == Material.MUSHROOM_SOUP) { e.setCancelled(true);

p.playSound(p.getLocation(), Sound.valueOf(this.main.getConfig().getString("Sound.Soup")), 2.0f, 5.0f);

p.setHealth((p.getHealth() + this.vida >= 20.0) ? 20.0 : (p.getHealth() + this.vida)); p.setFoodLevel(20);

if (this.main.getConfig().getBoolean("KeepBowl"))
{ e.getItem().setType(Material.BOWL);
} else { e.getItem().setAmount(0); } } } }``

quaint mantle
midnight shore
#

using its value

#

like this

#

eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNGJkM2M5NWNkMDQ4NTkxN2YxNDljM2NiZTk2MDJjYTViNmIwMjYwY2I2ZTMwMzE1Mzg1M2FiOTM4ZTRhMDViYyJ9fX0=

noble lantern
#

Even using that you set it through a player skull option

#

You'll have to Google it

#

There bunch of threads about this

terse ore
noble lantern
#

Imajin whats the name of that hash again he sent

terse ore
#

i dont understand why

quaint mantle
#

hashtable

#

oh that hash

noble lantern
#

Ik html uses it too

quaint mantle
#

probably base64

noble lantern
#

Ah yes

noble lantern
#

Google that @midnight shore how to set skull skins via base64 hash

#

Should pull up a bunch of results

#

Iirc im pretty sure you need to use GameProfile for that, but like I said the api for skulls has changed over 5 times lmao

coarse finch
# quaint mantle thats not an erorr

this is an error 3:14 PM Gradle sync failed: Could not find method compile() for arguments [com.tchristofferson:ConfigUpdater:2.0-SNAPSHOT] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler. (9 s 178 ms)

midnight shore
#

i already know how to do this for items, my concern is it possible to do that also with blocks?

dire salmon
noble lantern
#

For blocks its waaaay more complex

quaint mantle
noble lantern
#

You need to use block states, custom texture packs, prevent state changes on those blocks

midnight shore
noble lantern
small lynx
midnight shore
#

but i've seen this things on Hypixel and they don't use any texture pack

noble lantern
quaint mantle
#

why dont you have formatting

noble lantern
#

Sorry im on mobile yall

#

Cant remove embed

coarse finch
noble lantern
#

I used this for my custom blocks feature will, it should help a ton

midnight shore
noble lantern
noble lantern
#

Theres no other way to add in custom blocks without using a texture pack and unused block states

small lynx
noble lantern
#

You can use PDC and armor stand heads which is very large, but it still uses texture packs

midnight shore
#

but wait

#

then how can i place this skulls?

noble lantern
#

You said blocks not skulls?

midnight shore
#

and they are placed without any texture pack

noble lantern
#

I told you how to do the heads then you said for blocks lol

coarse finch
midnight shore
noble lantern
#

The Skull/SkullMeta class should work for placed skulls

midnight shore
#

should i use MaterialData?

small lynx
noble lantern
midnight shore
#

nope

#

i'm on 1.17

noble lantern
#

For blocks meta use getBlockMeta

coarse finch
midnight shore
#

but other methods are deprecated

dire salmon
noble lantern
#

Or getState one of the two work

quaint mantle
dire salmon
#

xD

noble lantern
#

getBlockData isn't deprecated

#

Neither is getState

small lynx
dire salmon
#

should do getBoolean()==true

coarse finch
noble lantern
#

It extends BlockMeta

#

So use getState on your block

quaint mantle
coarse finch
#

idk

dire salmon
#

im on pc so should be something wrong, but try this @small lynx

midnight shore
#

uh

#

wait

#

BlockState?

noble lantern
#

Click on BlockState

#

You'll see Skull is valid for it

#

Tells you everything that can use BlockMeta and Skull is there

#

So you use getState

muted sand
#

How do I throw a potion with a left click action instead of a right?
i found something, tweaked a bit, but i am not sure how to do it for every type of potion

    @EventHandler
    public void onInteract(PlayerInteractEvent e) {
        if (e.getAction().equals(Action.LEFT_CLICK_AIR) || e.getAction().equals(Action.RIGHT_CLICK_BLOCK)) {
            if (e.getPlayer().getItemInHand().getType().equals(Material.SPLASH_POTION)) {

                ItemStack item = e.getPlayer().getItemInHand();

                if (item.getItemMeta() instanceof final PotionMeta meta) {
                    final PotionData data = meta.getBasePotionData();
                    System.out.println(PotionType.valueOf(data.getType().name()));
                }



                ThrownPotion tp = e.getPlayer().launchProjectile(ThrownPotion.class);
                tp.setItem(item);
                int amount = e.getPlayer().getItemInHand().getAmount();
                if (amount == 1) {
                    e.getPlayer().setItemInHand(new ItemStack(Material.AIR));
                } else {
                    e.getPlayer().getItemInHand().setAmount(amount-1);
                }
                e.getPlayer().updateInventory();
            }
        }
    }
noble lantern
#

BlockState* not meta sorry

midnight shore
#

i don't understand how does this work

noble lantern
#

^^

#

Looking from that its really straight forward

midnight shore
#

yeah but then how do i put that in the block? ๐Ÿ˜…

noble lantern
#

Once you change the block data its updated once you use block.getState().update(true)

coarse finch
#

has imajin forgotten me

midnight shore
#

how do i change the block data ? ๐Ÿ˜…

noble lantern
#

Block data isn't like item meta

midnight shore
noble lantern
#

You just call the methods you need and getState().update(true)

#

No need to replace its meta/state

#

Blocks dont work like that

#

ItemsStacks do though

midnight shore
#

my god

noble lantern
midnight shore
#

why is this so hard

noble lantern
coarse finch
noble lantern
#

Its not hard

midnight shore
#

but thats for ItemStacks

coarse finch
#

and i know not a lot about gradle

noble lantern
#

Skull can be both a item stack or block

noble lantern
#

You add the repo url to grade repository

midnight shore
#

i think you linked the wrong article then, this one changes Skull__Meta__

coarse finch
coarse finch
#

well it doesnt work

noble lantern
coarse finch
# noble lantern Yep!

it returns java.lang.ClassNotFoundException: com.tchristofferson.configupdater.ConfigUpdater

midnight shore
#

like this?

noble lantern
#

Try it it could possibly work if not

#

ItemMeta has BlockStateMeta should work this way as well

coarse finch
#

can someone please tell me why i get java.lang.ClassNotFoundException: com.tchristofferson.configupdater.ConfigUpdater

noble lantern
#

It lets you cast in your ide currently though, so it should work

midnight shore
coarse finch
#

yes

noble lantern
#

One or the other should work

coarse finch
#
    name = 'maven-central'
    url = 'https://oss.sonatype.org/content/groups/public'
}```
midnight shore
#

ty really much, i'll see tomorrow how does it perform

noble lantern
coarse finch
#

ok

noble lantern
#

Not a mavel one

#

When you use mavenCentral() in grade it knows you want to use maven central

coarse finch
#

wait so do i do url {}?

modest acorn
#

[17:26:16 ERROR]: Error occurred while enabling PlayerKiller v1.0 (Is it up to date?)
java.lang.NullPointerException: Cannot invoke "org.bukkit.configuration.ConfigurationSection.getKeys(boolean)" because the return value of "org.bukkit.configuration.file.FileConfiguration.getConfigurationSection(String)" is null

#

help

coarse finch
#

wait

noble lantern
#

like that but different url

coarse finch
#

i already have maven { name = 'sonatype' url = 'https://oss.sonatype.org/content/groups/public/' }in the gradle file

noble lantern
noble lantern
#

delete the new repo you added and try importing then

coarse finch
#

ok

coarse finch
noble lantern
#

im not entirely sure then

#

you could clone that and compile it

#

and import it as a jar

coarse finch
#

huh

noble lantern
#

compileOnly fileTree(include: ['*.jar'], dir: 'libs') // Add everything in the libs folder.

Create a libs folder in your project and you can use this to import libs

noble lantern
spring minnow
#

boys

noble lantern
#

and import the jar

spring minnow
#

just a random question

noble lantern
#

sup?

spring minnow
#

Very important

spring minnow
#

How can i raid a whatsapp number ?

noble lantern
#

๐Ÿ˜

spring minnow
#

like when 200 people write you

#

i have to do it to a person who did to me

#

please i need this information

onyx fjord
#

@spring minnow @ancient plank

modest acorn
spring minnow
noble lantern
#

do note

onyx fjord
noble lantern
#

if file exists already it wont overwrite

spring minnow
#

doesn't regard Discord so why you reporting mods

noble lantern
#

bc we dont wanna deal with ppl like you

spring minnow
#

;_;

noble lantern
#

just ignore the person msging you

#

not hard

echo basalt
#

man came into a minecraft help channel asking how to operate a botnet

spring minnow
noble lantern
#

this is for development help anyways ^

coarse finch
#

@noble lantern how do i compile it? ive never used maven

noble lantern
#

not help me have someone channel

spring minnow
noble lantern
echo basalt
#

or package also works

noble lantern
#

wait install works too lmfao

echo basalt
#

or just use intellij's tabs on the right

spring minnow
noble lantern
#

why does maven have so many ways to compile lmao

onyx fjord
#

And so does gradle

#

build and assemble

echo basalt
#

I don't know what you're talking about

noble lantern
#

tbf though a lot of those wont actually make a jar

coarse finch
noble lantern
#

oops

echo basalt
#

except for maven

#

ehh

noble lantern
#

i fucked my arrow placement up

echo basalt
#

one thing that mildly bothers me is people having colorful image backgrounds on their ide

echo basalt
#

you're coding, not watchin a movie

onyx fjord
#

@noble lantern mind screenshotting the WhatsApp guy and sending it to #general ?

coarse finch
noble lantern
#

wym i watch movies when i code all the time

echo basalt
noble lantern
modest acorn
vocal cloud
echo basalt
coarse finch
#

@noble lantern what am i looking for on the right of intellij

echo basalt
#

Always assume someone else will look at your code

#

makes it easier

noble lantern
gentle stone
#

Does SpigotMC offer any methods for direct downloads without being blocked through Cloudflare? At least for downloads that redirect to other pages such as Github. It would be a shame if it's virtually impossible or troublesome to download plugins without a browser.

noble lantern
coarse finch
noble lantern
#

yes

#

and compile it using its src

coarse finch
#

ok

modest acorn
gentle stone
# onyx fjord Check spiget

Spiget only offers direct downloads outside SpigotMC Cloudflare for latest versions. Older versions or SpigotMC downloads are still through Cloudflare

onyx fjord
#

Then it's not possible

gentle stone
#

shame

midnight shore
modest acorn
noble lantern
#

kkk?

echo basalt
#

let's keep the chat in english, I'm not proud of my country

modest acorn
stuck flax
#

how do you set the players yellow number in tab

midnight shore
#

and espanol is similar to italian : )

#

assassino is the same in italy

onyx fjord
coarse finch
midnight shore
#

for example

onyx fjord
#

Wait no

#

Scoreboard

noble lantern
#

i would have no idea then

coarse finch
#

:(

noble lantern
#

i normally just make my own config updaters tbh

coarse finch
#

how hard is it

noble lantern
#

not good to rely on libs for small things like that

stuck flax
noble lantern
onyx fjord
modest acorn
noble lantern
coarse finch
#

ok

noble lantern
static pendant
#

Guys, I have a Listener in a separate class next to my main Javaplugin class. Is there a best-practice way how I can access fields from my main-plugin from my listener?
I feel like creating an instance of the listener class at startup just to pass the main plugin for reference is a bit... clonky

noble lantern
#

or why it would be saving just the one field and not the other one

onyx fjord
#

I use static for instance

static pendant
#

hmmm.. yeah could do

noble lantern
#

use dependency injection or static plugin instance like kacper said

echo basalt
#

ew static

#

dependency injection 1000%

noble lantern
#

ik

#

but some people dont like DI for some reason

onyx fjord
#

That's the usage for static tho

static pendant
#

true dependency injection

coarse finch
static pendant
echo basalt
#

static variables are great for constants, not for accessibility to your main

noble lantern
noble lantern
#

youll piss people off changing theyre already set values in configs

modest acorn
#

someone save me

lavish hemlock
#

If you set the field to null, I believe it allows the GC to reclaim the memory of a previous value.

#

But that's only if the field is mutable.

#

So static final will never be garbage-collected, yes.

noble lantern
#

orrr

#

dependency injection

echo basalt
#

if you're manually managing your memory, just to use static

noble lantern
#

like a sane person would do

echo basalt
#

then just dependency inject

coarse finch
lavish hemlock
#

I mean I'm not advocating for static

#

Just stating that you're (partially) wrong, I'm right, ez no g

noble lantern
#

havent used yaml in quite some time for editing them

echo basalt
#

make a proprietary file that you can only debug with a hex editor

#

like a true developer

noble lantern
#

end users when editing that file ^

echo basalt
#

man's using a .yml to save data, no sane person would edit that

#

keep in mind it's also 1 yml file

noble lantern
#

wait fr

#

kidney