#help-development

1 messages Β· Page 538 of 1

novel flame
#

this is what my start.bat file says:

#

@echo off
java -Xms4G -Xmx4G -jar spigot-1.19.4.jar -nogui
pause

quiet ice
#

Does that file exist?

novel flame
#

yeah

river oracle
#

could also be a onedrive thing too

novel flame
#

in my buildtools folder

river oracle
#

onedrive sucks ass

tardy delta
#

especially for vms πŸ₯Ί

novel flame
#

soooo how do i fix it

river oracle
#

make sure the file exists

#

is in the same directory

#

as your start.bat

#

and

novel flame
#

oh ok

river oracle
#

is not in a onedrive folder

novel flame
#

i moved it to the same directory

#

thanks

#

i feel dumb now lmao πŸ’€

young knoll
#

Is a recipe book click event a player event or an inventory event

#

That is the real question

worldly ingot
#

Probably a PlayerEvent imo

#

It's not really associated with an Inventory, there are no slots

young knoll
#

RaidEvent it is :D

sullen marlin
#

dont we have an event for that

worldly ingot
#

Yes

young knoll
#

For recipe books?

worldly ingot
#

No no, RaidEvent lol

young knoll
#

It's an abstract base but ye

worldly ingot
#

If he did mean for recipe book clicking, then no we do not have an event for it

young knoll
#

Shouldn't be hard

#

It's a key and a boolean

#

Doh we don't have a base interface for crafting recipes

worldly ingot
#

Just Recipe, but it shouldn't matter because the recipe book can show more than just crafting recipes

young knoll
#

Do any recipes other than crafting support automatically moving the items

worldly ingot
#

Yeah, furnace recipes

carmine mica
#

Recipe interface sucks

young knoll
#

If we give the option to set the recipe, I wonder what will happen if they set a crafting recipe in a furnace for example

carmine mica
#

Doesn’t extend Keyed cause someone thought villagers also have recipes

young knoll
#

Will the universe implode

worldly ingot
#

Can probably throw an exception if it's not an instance of the original recipe

young knoll
#

What about shaped vs not shaped

#

Those are interchangable

worldly ingot
#

ehm, new CraftingRecipe interface? πŸ˜…

young knoll
#

Sounds good to me

#

Tbh it would be nice to have

remote swallow
#

what aboot to md

worldly ingot
#

I'm sure there are some common methods you could pull up

onyx fjord
#

I implemented the event as a library

zenith gate
#

?paste

undone axleBOT
onyx fjord
#

It's on my gh doesn't work with jitpack yet tho

young knoll
#

Boo

worldly ingot
young knoll
#

Oh recipes aren't in org.bukkit.inventory.recipe

#

πŸ™ƒ

worldly ingot
#

nupe

remote swallow
#

does dupe rhyme with nupe

young knoll
#

Tf is a nupe

worldly ingot
#

like nope, but with a u

flint coyote
#

Choco did you think about the Registry for registries for 1.20? Otherwise I'll build it myself via Reflection

young knoll
#

Don't forget the RegistryRegistryRegistry

flint coyote
#

That's the most important one

worldly ingot
young knoll
#

We need more registries tbh

worldly ingot
#

Lots more are getting exposed in 1.20

flint coyote
#

Fine I'll probably slack and not be done with 1.20 anyway lmao

mortal hare
#

ConsoleFactory.getSystemFactory().getBinaryFactory(OSType.Windows).getPrintFactory().print();

young knoll
#

I want muh tag registry

worldly ingot
#

There is no tag registry. Tags are a part of individual registries

#

Which I also have a PR for

young knoll
#

Wait really

worldly ingot
#

Yes

young knoll
#

Wtf mojang

river oracle
#

I want registry version to be 1.20 uwu

worldly ingot
#

I should comment on this stating that it's targeted for post-1.20. I'm sure md knows already, but yeah

flint coyote
#

I could become spigot contributor by opening a pull request for a typo in the documentation

young knoll
#

Woo it covers the missing tags too

worldly ingot
#

Yeah it adds all remaining tags that we have API for

onyx fjord
#

I don't wanna sign the cla that's the thing

young knoll
#

that we have API for

worldly ingot
#

Yeah, some things we don't have API for

river oracle
#

like wat

worldly ingot
#

There was one tag type I couldn't add... can't remember what it was

onyx fjord
#

Most packet stuff can be added to the api

young knoll
worldly ingot
#

So long as it isn't exposing the packets directly, yes

river oracle
#

Some stuff i see on the jira is stuff that already exists people just use wrong events or don't know xD

onyx fjord
#

Player jump event

flint coyote
#

Just use the statistics event

river oracle
onyx fjord
#

Probably idk

#

Maybe it's a matter of checking the specific velocity

young knoll
#

Custom Biomes
Pathfinding
A bunch of worldgen stuff
Placed structures

onyx fjord
#

Worldgen really sucks yeah

#

Unusable imp

#

Imo

river oracle
#

funny I've not touched like any of this stuff cuz it sucks to work with xD

young knoll
#

I'm also working on an api for placed structures

#

Which can technically be PDC holders

onyx fjord
#

Structure generate event implements cancellable

#

Hehe

young knoll
#

It does

river oracle
#

I wonder how many of these PRs have been done and lost in the abyss

young knoll
#

And it works

#

A fair amount do get lost

#

I've revived a few recently

#

Like the TNTIgniteEvent from 2016

young knoll
#

Hey look it's Aikar

remote swallow
#

that was before he started paper isnt it

river oracle
#

I'm honestly surprised my PR wasn't lost to the abyss

young knoll
#

As long as PRs are active they generally don't get lost

carmine mica
#

that statement is like a tautology

young knoll
#

But if the author disappears to get stuck on waiting for changes for eternity

river oracle
#

Well I'ma fuck around with PlayerJumpEvent shit πŸ€·β€β™‚οΈ I'm bored

flint coyote
remote swallow
#

careful looking at papers code when making a pr

river oracle
#

I don't

#

I fuck around

worldly ingot
river oracle
#

Looking at Paper's impl would be a terrible Idea

flint coyote
#

He doesn't have to look at it - just use the general idea. I didn't look at it either. Just from what I heard they use it

remote swallow
young knoll
#

Kill the original paper author and claim ownership of their code

river oracle
#

PlayerStatisticIncrementEvent

#

exists

flint coyote
eternal oxide
#

mfnalex put a jump event together in his lib

young knoll
#

I imagine their are some additional checks in paper

#

Idk

#

The statistic event isn't perfect

flint coyote
#

Yup there are more from what I heard. I don't know about those though

eternal oxide
#

in my opinion if MC thinks it's a jump I'll accept it as a jump

young knoll
#

Smh mojang just send something to the server to indicate the player pressed jump

flint coyote
#

The client code is probably just a big mess

#

After all those years

young knoll
#

The server code isn't really much better

remote swallow
#

they're starting to update some stuff im pretty sure

flint coyote
young knoll
#

Pretty much

#

Although we did just get a new lighting engine

#

Idk how good it is tho

remote swallow
#

go find out

young knoll
#

Effort

river oracle
young knoll
#

I know JellySquid and a job at Mojang were discussed

#

Idk if Mojang said no or Jelly said no

flint coyote
#

Non-profit developers are usually more motivated anyway since it's a hobby and not a "job"

#

Giving 150% just to make someone else rich is just demotivating

young knoll
#

I mean they do get paid

flint coyote
#

Yeah and they still get paid with 70% effort

young knoll
#

Tbf now that Mojang is owned by Microsoft I imagine the profits end up more spread out

#

Compared to when it was owned by Notch

flint coyote
#

I could imagine that the sales go downhill aswell. Not because it's a bad game but soo many copies were sold already

young knoll
#

That's why they made bedrock

#

Now kids with nothing but a phone can also buy minecraft

flint coyote
#

And that's why they will abandon java in a few years

young knoll
#

And purchase juicy Minecoins!

flint coyote
#

It's not an "if" question - only "when"

#

Then it's probably up to the community to keep it alive - or everyone shifts to bedrock

river oracle
#

wow mojang really does have interesting names
Mojang Name ServerboundPlayerInputPacket
Spigot Name PacketPlayInSteerVehicle
The names lead me to believe these are completely different things

flint coyote
#

I only hope bedrock gets a lot of bugfixes before they force us to play that glitchy mess

remote swallow
#

i am playing java till the day i die

eternal oxide
#

I'll no tplay bedrock

#

probably ever

young knoll
#

I doubt the Java devs will be happy if they get dropped

#

The Java devs are also the more public facing people in the company

flint coyote
#

Microsoft will be happy with saving 30-40% of their development costs

young knoll
#

They probably automatically translate half the code anyway :p

flint coyote
#

Could be

young knoll
#

C++ and Java are similar enough

flint coyote
#

However they are buying more and more companies anyway - they'll find other spots for the java devs

#

The end of java will be the end of another great childhood memory and I'll probably also ditch mc for good

#

I don't think they'll announce that before 2025 though. I expect it to be in 3-5 years

eternal oxide
#

once they kill java I'll get back to game deving

flint coyote
#

I also don't like their pricetags on the new minecraft games. Minecraft dungeons is fun - it is however not 40€ fun

young knoll
#

I wonder the player count for each

#

Doubt anyone but Microsoft will ever know

flint coyote
#

a lot more players play bedrock - simply because there are a lot more supported devices

#

Content creators usually play java because of the better plugin and mod support

young knoll
#

I wonder how many of them are on Geyser servers

flint coyote
#

Someone asked me to adjust one of my plugins so he can enchant items with impossible enchantments in survival. Like knockback on a stick

#

and I was like "huh? Just use gamemode and an anvil?"

#

turns out that's not possible in bedrock

peak depot
#

thats posible to do in java version?

flint coyote
#

yes with gamemode and enchantment books you can enchant any item

young knoll
#

Yeah you can put anything on any item in creative mode

#

With an anvil

peak depot
#

nice to know

young knoll
#

It's even more powerful than /enchant

#

But that's because /enchant sucks

flint coyote
#

trueee

#

That's why I was asked to create a plugin for it. Made that in a few hours and published it

#

there probably are plugins for that already but I didn't find any that just have a simple command and no other clutter

grand otter
#

Can someone give me an example of a build.grade file that shows how to add apis?

eternal oxide
#

If building with Spigot don;t use Gradle unless you REALLY need to#

flint coyote
#

Why would you need to? o.o

young knoll
#

Man spigot has some weird errors sometimes

#

Preconditions.checkArgument(key != null, "key");

#

not "key cannot be null" just "key"

worldly ingot
#

Kind of been on my list of things to fix tbh

#

At least fleshing out those one line error messages

young knoll
#

Well I got this one since i'm moving it anyway

#

:p

#

What's that one weird error people sometimes get

#

Caused by: java.lang.AssertionError: TRAP

grand otter
#

quicker too

young knoll
#

Meh

worldly ingot
young knoll
#

It doesn't really matter much which you use, but spigot itself uses maven

eternal oxide
#

it has advantages, but it's also more complex. Spigot is based around Maven not gradle

young knoll
#

gradle is perfectly usable until you want to use NMS

#

Then you have some issues

eternal oxide
#

If you try to use Gradle you will be hit with complications.

#

If you are wanting to dev on Spigot use Maven.

grand otter
#

Is maven quick?

eternal oxide
#

plenty

#

for plugins

young knoll
#

You won't see any tangible differnce for a plugin

#

Unless your plugin is massive

mortal hare
#

i mean gradle isnt so hard

#

it just looks like it

#

i've tasted that medicine myself

grand otter
#

Ok, I knew how to build my project to a certain location with gradle, how can I do the same with meven?

mortal hare
#

you just need to learn how gradle DSL's work, if you're using groovy DSL there's plenty of basic tutorials how to work with gradle

#

on youtube

river oracle
#

how do you listen for serverbound packets

remote swallow
#

packet events

mortal hare
#

or injecting your own netty handlers via NMS

subtle folio
#

omfg i found md_5

mortal hare
#

iirc you need duplex handlers and playerconnection's class netty channel inorder to do that

remote swallow
#

i found dinnerbone

subtle folio
#

lemme decompile nms first 1 sec then ill find notch

remote swallow
#

would nms have git history

mortal hare
#

lets find the removed herobrine patch

subtle folio
#

prtty sure it does

quaint mantle
#

can i do this ?:
when i write playername in chat
player see own name like this '@quaint mantleername' in chat

#

so can i do this without packets ?

young knoll
#

Sure

#

Go through each word, check if it's a players name, and then add @ to the front

subtle folio
#

Why does InventoryClickEvent#getWhoClicked return HumanEntity?

#

Shouldn't it be a Player seeing as that event is only for players?

young knoll
#

It's an old event

#

And internally it involves a HumanEntity

#

Most newer events simply cast to Player for you

#

Since player is the only HumanEntity

subtle folio
#

yeah

#

time to pr question mark?

young knoll
#

I think it would be fine to change it to player

#

That shouldn't break compatabilty if my brain is working correctly

#

But idk if MD is down for that

grave lagoon
#

is there a way to hide a custom command from highlights

young knoll
#

Give it a permission and it will only show if the player has that permission

grave lagoon
#

is there a way other than that or nah?

young knoll
#

If you want to completely remove it use PlayerCommandSendEvent

grave lagoon
#

alr

#

thanks

carmine mica
young knoll
#

Really? I though a more specific type would be fine

mortal hare
#

and accessing command dispatcher

young knoll
#

Or just

mortal hare
#

that handles the tab completions

young knoll
#

Use the event I sent

young knoll
#

shite

#

Could just add a second method ig, kinda ugly tho

#

Or yeah, Commodore

mortal hare
#

i might be wrong tho

young knoll
#

Nah

#

All new events have an explicit cast

mortal hare
#

tbh it should return Player

#

instead

#

since this is more backwards compatible

#

and allows better polymorphism

young knoll
#

For example

#
 public static PlayerLeashEntityEvent callPlayerLeashEntityEvent(EntityInsentient entity, Entity leashHolder, EntityHuman player, EnumHand enumhand) {
        PlayerLeashEntityEvent event = new PlayerLeashEntityEvent(entity.getBukkitEntity(), leashHolder.getBukkitEntity(), (Player) player.getBukkitEntity(), CraftEquipmentSlot.getHand(enumhand));
        entity.level.getCraftServer().getPluginManager().callEvent(event);
        return event;
    }
mortal hare
#

but who cares

#

Bukkit API is a big NMS hack anyways

#

99% of GUI frameworks rely on it

young knoll
#

oh?

subtle folio
#

yeah

young knoll
#

Why should it be removed

subtle folio
#

fuck the bukkit goal

young knoll
#

Let's just make it a sealed interface

subtle folio
#

why not just deprecate it

#

and make it getPlayer

mortal hare
#

there's no real alternative to inventory holders atm for storing UI metadata that easily

young knoll
#

Becase there are other holders?

subtle folio
#

oh

#

good point

young knoll
#

Tis called a map

#

That's what my framework uses

mortal hare
#

storing it externally wouldnt allow for plugins to pass data easily between

#

its just easier to use it

#

its a hack, yes.

#

wdym by references?

#

oh i thought you meant different Reference types

young knoll
#

(Or view)

mortal hare
#

WeakReference etc

worldly ingot
#

Yeah just hold an instance of the InventoryView returned by Player#openInventory() πŸ˜›

#

There is an alternative, people just don't use it

mortal hare
#

Yea I do this too, but it would be nice if Bukkit API would add a way to store metadata on the inventory class

#

or inventory view

young knoll
#

Make it implement PDC

#

Wait no that isn't how it works

#

Well also how would you hide it

mortal hare
#

wait till you see Win32 API with 3 different variants of api functions which just do things better than others, and are left out for backwards compatibility

young knoll
#

Yay backwards compat

mortal hare
#

MessageBox(), MessageBoxA(), MessageBoxW(), MessageBoxEx()

young knoll
#

The reason why bukkit packages are wacky too

mortal hare
#

I think you should see how Bukkit command api is implemented internally

#

you would be disgusted

#

πŸ˜„

#

I hate how Bukkit command api hardcoded <args> string inside tab completion command dispatcher

#

you cant literally edit it properly

#

without some kind of hacks

#

because PluginCommand class is Final.

round finch
#

wut?

#

bridge api?

#

ahh so you're gonna work with sockets?

#

nice

young knoll
#

wut

round finch
#

i mean if someone really wants they can use java sockets and data buffers

young knoll
#

Event is done, still need to do the method

small holly
#

how do make a passive mob hostile in 1.8? only specific ones spawned by the plugin

young knoll
#

NMS

#

You'll need to give them attack goals

#

You may also need to give them a attack damage attribute

small holly
#

Will I need to make a class for them? because I need it to be accessable via Lua

#

I can make my own pathfinder goals fine its just the setting the PathfinderGoals that I am curious about

buoyant viper
young knoll
#

You should be able to use the existing goal class

#

It can take any entity type as a target

small holly
wise mesa
#

can't passive mobs not attack

#

like doesn't that crash the server on 1.8

small holly
#

we will find out lol

#

if so I can just use distance to deal damage

wise mesa
#

i think the common method is using packets to disguise a hostile mob as a passive one

wise mesa
small holly
#

Imma ask ChatGPT what it thinks lol

wet breach
#

But sometimes it glitches out and causes this to constantly happen

#

But yeah if the server is set to passive mode or peace mode you wont get mobs to attack at least not properly

young knoll
#

The only issue I had is that they had no attack damage value which caused a crash

#

But you can add one with some reflection iirc

wise mesa
#

ah

small holly
#

also do I need to add some dependency to access PathfinderGoals because they don't seem to be showing up

young knoll
#

Idk what they are called in 1.8

wise mesa
#

does screamingsandals go that far back?

small holly
#

net.minecraft.server doesn't exist

young knoll
#

But as long as you have NMS you should be able to find them

wise mesa
#

not spigot-api

#

run buildtools and it'll install it to your local maven so you can use it

young knoll
#

Bukkit won’t work :p

wise mesa
#

yea idk what the 1.8 development setup looks like

young knoll
#

Pretty sure it’s the same in that regard

small holly
#

Wish our $250 cannon jar also worked for 1.20

wise mesa
#

i just stay on latest and enjoy my life

wise mesa
young knoll
#

πŸ’€

#

Yeah that would work

#

But like, use spigot

wise mesa
#

whyyyyyy

#

yea ofc

young knoll
#

The only reason to ever depend on craftbukkit/bukkit is if you are developing a PR

small holly
young knoll
#

Buying stupid paid forks moment

wise mesa
#

what is a cannon jar

small holly
#

WineSpigot

wise mesa
#

just a fork?

#

why do you need it

small holly
#

because Factions

buoyant viper
wise mesa
#

what feature does it have that you desperately need that you couldn't just get on regular spigot or paper

small holly
#

it makes tnt cannons way way more effective

wise mesa
#

im sure you could find sooommeee plugin that does that

small holly
#

its way faster and stuff

wise mesa
#

and also doesn't cost $250

wise mesa
small holly
#

no because it changes the calculations that are done in the jar

wise mesa
#

is it?

small holly
#

yes

wise mesa
#

like have you benchmarked it yourself

small holly
#

we have noticed a massive difference

#

yes

buoyant viper
small holly
#

Its a lot more than just tnt

wise mesa
#

why don't you just like try porting the changes yourself

#

lmao

buoyant viper
#

ive got a friend that works on a fork for factions-related stuff, TNT cannons are like a ridiculous niche that they care extensively about

wise mesa
#

i just can't see a world in which a fork is worth $250

#

that seems like such a waste

small holly
#

I am but also focusing on a recode for a plugin that is desperately needed

wise mesa
#

nice

#

well hopefully one day you'll make it to 1.20 🀞

#

are there any beta builds for the pre-releases?

buoyant viper
#

spigot doesnt do those iirc

wise mesa
#

can I build /next and it'll magically support 1.20

wise mesa
small holly
#

that is the plan and ideally modular

small holly
wise mesa
#

yea that's probably it

young knoll
#

I remember some paper devs saying all the paid 1.8 forks are just the same broken patches over and over again

small holly
#

I hate that they dont do them but I know why they dont

young knoll
#

And tbh I believe it

young knoll
#

Idk why MD doesn’t do public pre builds

buoyant viper
#

probably starts at TacoSpigot and then has a bunch of stuff hacked ontop of it

#

or NachoSpigot i think is what ppl use now

#

well

#

"now", i think that forks dead too

young knoll
#

Maybe he’s worried people will be dumb, run them, and then foobar their world

small holly
young knoll
#

And…?

#

Paper has nothing to do with us

buoyant viper
#

could still benefit from pre-release releases, gives plugin devs more time to make sure their plugin works on new versions asap

small holly
#

ye

young knoll
#

Like I know a build exists

#

But afaik only MD has access to it

buoyant viper
#

md5got fork when?

small holly
buoyant viper
#

redistributing mc would would be a policy breach methinks

small holly
#

Are we allowed to ping MD to ask why no pre releases?

buoyant viper
wise mesa
#

because spigot contains mc code

young knoll
#

Well

#

Kind of

wise mesa
#

yea

young knoll
#

It contains patched code but yeah, it’s mostly Mojang code

buoyant viper
#

Pog building 1.8.8 with btgui

wise mesa
#

it contains some amount of copyrighted mojang code

small holly
#

I think my Adhd brain is dopamine starved atm

young knoll
#

All mod loaders have a system to patch a vanilla jar

#

And spigot is basically a mod loader but server side only

buoyant viper
#

spigot-client when?

mortal hare
#

forge

buoyant viper
#

forge is not spigot

mortal hare
#

forge implements bukkit afaik

small holly
#

That would be cool having plugins in single player

young knoll
#

lol no

#

Forge does not touch the Bukkit api

buoyant viper
#

oh wow, building 1.8.8 took like no time compared to newer vers

young knoll
#

Forge and fabric both have their own api

buoyant viper
#

never processed the size difference lolwtf

mortal hare
young knoll
#

No

mortal hare
#

i've heard this from somewhere

#

i guess it was a lie

young knoll
small holly
young knoll
#

I wonder if spigot will hit that 70mb milestone in 1.20

buoyant viper
#

spigot 100mb when?

young knoll
#

Let me just shade

#

Uhh

#

Hibernate? Idk

wise mesa
#

and that is it

worldly ingot
young knoll
#

But it’s fast

#

Zooooooom

worldly ingot
#

fast but large

young knoll
#

I thought a lot of it would be the million json files

worldly ingot
#

nah I think 20 megs is fast util

young knoll
#

Damn

#

No potential to minimize?

#

Not that 70mb really matters

worldly ingot
#

Yeah, fastutil is 12mb lol

#

I remember that being annoying when they first added it

river oracle
#

what is FastUtil for

worldly ingot
#

Specialized collections

river oracle
#

ahhh

worldly ingot
#

e.g. IntMap, LongSet, etc.

river oracle
#

12mbs of specialized collections???

#

WTF xD

worldly ingot
#

Yeah it's stupidly overengineered, but it kind of has to be

young knoll
#

It can run doom

worldly ingot
river oracle
#

vigna has a very bad name

buoyant viper
#

its interesting that spigot 1.8.8 is as large as it is tho, the client jar is only 8mb

#

ah wait, its bundled

#

right

worldly ingot
#

Yeah the client's libraries are all external

buoyant viper
#

forgor :v

young knoll
#

Why is this code magic

#

What’s a drv file

worldly ingot
#

lol, a lot of the implementations are automatically generated

wise mesa
buoyant viper
#

trying to download it but i dont have the official launcher lol

#

i run multimc n it has no button to dl the jar like mojangs

wise mesa
#

i mean its on the website somewhere

buoyant viper
#

just for latest ver i think

wise mesa
#

here

#

server.jar is also 7.9 mb

young knoll
#

Oh god help

#

The video is gone but it’s playing

ancient plank
#

Xd

buoyant viper
#

n all its libs are bundled

#

?

wise mesa
#

i have no clue

buoyant viper
#

open it w 7zip or winrar

#

or just extract it

wise mesa
#

im so lazy though

#

ok one sec

#

quite a few packages here

buoyant viper
#

looks like it

young knoll
#

Wtf no relocation

#

Unacceptable

wise mesa
#

lol

buoyant viper
#

u think mojang uses maven or gradle for minecraft

wise mesa
#

probably

#

why wouldn't they

buoyant viper
#

that wasnt a yes or no question

#

that was a which one

wise mesa
#

oh shit

#

im stupid

#

they probably use maven

#

maybe ant

#

lmao

fierce salmon
#

how do I make an event only happen in a particular world?

buoyant viper
ancient plank
buoyant viper
#

ah, CSS

fierce salmon
#

how do I get the name of the world I am in

wise mesa
#

do you mean you want to cancel the event if it isn't in the specific world

#

why do you need the name just grab the instance

#

player.getLocation or whatever.getWorld

#

and compare the instance

fierce salmon
#

ok

wise mesa
#

pass the instance of the world into your listener when you create it

#

the one you're looking for

buoyant viper
#

per-world events api when?

wise mesa
#

ew

buoyant viper
#

PR time ✍️

wise mesa
#

folia skipped straight to per region

buoyant viper
wise mesa
#

alright i really gotta write this paper

#

*finish

eager knoll
#

I'm writing a system to apply enchants to items by clicking on them. I'm having trouble getting the enchantment item meta of the item that the enchantment is being applied to.

Any ideas? Thanks in advance.

public void onInventoryClick(InventoryClickEvent e) {
        ItemStack equipment = e.getCurrentItem();
        ItemStack enchant = e.getCursor();
        Player p = (Player) e.getWhoClicked();

        if (equipment == null || enchant == null) return;
        if (e.getInventory().getType() != InventoryType.CRAFTING) return;
        if (equipment.getType().equals(Material.AIR) || enchant.getType().equals(Material.AIR)) return;
        if (!enchant.getType().equals(Material.ENCHANTED_BOOK)) return;
        if (!ableToApplyEnchantTo(equipment)) return;

        EnchantmentStorageMeta meta = (EnchantmentStorageMeta) enchant.getItemMeta();
        if (meta.getStoredEnchants().isEmpty()) return;

        Enchantment enchantment = meta.getStoredEnchants().keySet().iterator().next();

        if (!acceptableEnchant(equipment, enchantment)) return;

        e.setCancelled(true);

        ItemMeta equipmentMeta = equipment.getItemMeta();
        if (equipmentMeta instanceof EnchantmentStorageMeta equipmentEnchantMeta ) {
            Map<Enchantment, Integer> enchantments = equipmentEnchantMeta.getStoredEnchants();
            if (enchantments.containsKey(enchantment)) {
                int equipmentEnchantLevel = enchantments.get(enchantment);
                if (equipmentEnchantLevel >= 3) {
                    return;
                }
                equipmentEnchantMeta.addStoredEnchant(enchantment, equipmentEnchantLevel + 1, true);
            } else {
                equipment.getEnchantments().keySet().forEach(equipment::removeEnchantment);
                equipmentEnchantMeta.addStoredEnchant(enchantment, 1, true);
            }
            equipment.setItemMeta(equipmentEnchantMeta);
        }
    }
wise mesa
#

it is due in two hours and 17 minutes

young knoll
#

Each block gets its own thread

wise mesa
#

take true advantage of your threadripper

#

which you were using for your 5 player vanilla smp of course

buoyant viper
wise mesa
#

and like

#

event.getlocation.getWorld

#

not that difficult

young knoll
#

There’s a plugin for that

buoyant viper
#

i guess theres usually always enough context somehow to deduce the world an event originated from

young knoll
#

Handles any events that have an accessible world afaik

buoyant viper
#

does it wrap the event?

#

like some sort of

young knoll
#

Not sure

#

All I know is it doesn’t use any NMS

fierce salmon
#

im getting this error when I try to package my plugin

wise mesa
#

that's unfortunate

#

did you ever acquire spigot somehow

buoyant viper
#
public class PerWorldEvent<E> {
  private World world;
  private E event;

  public PerWorldEvent(World world, E event) {
    this.world = world;
    this.event = event;
  }

  public World getWorld() {
    return world;
  }

  public E getEvent() {
    return event;
  }
}``` but like, not as basic
wise mesa
#

as a dependency

fierce salmon
buoyant viper
#

wouldve put <E extends Event> but iirc Event and Cancellable are both their own classes

#

:v

wise mesa
river oracle
river oracle
#

ig it does

#

but its old as fuck

wise mesa
buoyant viper
#

some events obv couldnt be per-worlded

fierce salmon
buoyant viper
#

like what world would a ServerListPingEvent originate from

#

lol

river oracle
#

they have a discord server

wise mesa
young knoll
#

You also want the option to always let some run

#

For example blocking the join event might foobar a lot of plugins

buoyant viper
#

some events just simply dont really originate from a world

#

but rather the server itself

young knoll
#

I mean the join event has a player

#

Players have worlds

buoyant viper
#

True...

#

on a technicality its a world event

#

but in actuality....

young knoll
#

Iirc the available plugin has an option to ignore it

eager knoll
#

if an event has a world there's a way to access it

mortal hare
#

60 fps

young knoll
#

Holy shit is that minecraft2

river oracle
#

no

#

those frames are too high

mortal hare
#

ok i lied

#

that's 30 fps

#

because i forgot that i frame limited it ;D

#

wait

#

are windowed mode applications vsynced by default

#

?

wet breach
#

Well depends on your settings especially with the gpu

#

But non fullscreen applications do miss out on some optimizations though

lethal coral
#
List<CommandElement<?>> subCommandsCopy = Collections.unmodifiableList(subCommands);

does this effectively create a copy of the list?

#

like can I modify subCommands and still use subCommandsCopy in the for loop

young knoll
#

Yes

#

Well actually

#

It creates a view over the list, so I don’t think it’ll help you avoid ConncurentModificationException if that is your goal

lethal coral
#

yeah I thought so

#

intellij doesn't warn though

#

probably cause it doesn't go that deep

young knoll
#

If you are just removing use an iterator

#

If you want to do more than that just make a normal copy

lethal coral
#

now that I'm looking at it I'm not sure why I wanted to do that

#

I'll just create a new list

#
            @Override
            public @NotNull List<String> tabComplete(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args) {
                int index = args.length;
                if (index < 1) return new ArrayList<>();
                Map<Integer, List<String>> completionsMap = new HashMap<>();
                getCompletions(index, 1, completionsMap, CommandElement.this.subCommands);
            }

            private void getCompletions(int reqIndex, int currentIndex, Map<Integer, List<String>> completions, List<CommandElement<?>> subCommands) {
                List<String> completionsList = new ArrayList<>();
                completions.put(currentIndex, completionsList);
                List<CommandElement<?>> newSubCommands = new ArrayList<>();
                for (CommandElement<?> subCommand : subCommands) {
                    if (reqIndex != currentIndex) {
                        newSubCommands.addAll(subCommand.subCommands);
                    }
                    if (subCommand.registerAliasCompletions) {
                        completionsList.addAll(getAllAliases(subCommand));
                        continue;
                    }
                    completionsList.add(subCommand.name);
                }
                if (reqIndex == currentIndex) return;
                getCompletions(reqIndex, currentIndex+1, completions, newSubCommands);
            }

I feel like this is the like most inefficient way ever to do tab completions

#

and would be very laggy

#

(the tabComplete method is incomplete)

#

should I do this after everything is registered and store it in the base command then call that data in the tab complete method?

buoyant viper
#

registering all the tab completes instead of recomputing each time would probably be better yeah

torn shuttle
#

what is the easiest way of making an arrow that disregards collisions?

buoyant viper
#

like thru entities or thru blocks

sour folio
#

how would i make it a specific block cannot be broken by an explosion?

lethal coral
#

where the heck is intellij getting this CmdTest class

wet breach
wet breach
#

There is entity explosion event and primedtnt explosion event

#

Dont remember if there is a third one or not

lethal coral
torn shuttle
#

livingentity#launchprojectile moves the entity around right

#

no, I am an idiot who couldn't find the code I had to rotate the shooter

heavy mural
#

I am currently still trying to find the event that triggers when a chorus flower is destroyed by a shot arrow, anyone know how?
I want to prevent it from being destroyed by the arrow if it's on x chunk.

chrome beacon
#

They get destroyed by arrows πŸ‘€

#

TIL

sullen marlin
#

Is there a ProjectileHitEvent?

torn shuttle
#

yes

sick epoch
#

?paste

undone axleBOT
sick epoch
#

Vault Dependencies

high pewter
#

I'm making a plugin which involves randomized block drops and I want to display these drops in the lore for blocks a player could hover over. I want the player to be able to see this information before they even craft an item, but CraftItemEvent (despite the description, which would suggest otherwise) is only called after the player takes the item out the crafting grid, not as soon as it appears in the output box. I would assume it was just handled client-side, but I remember a video where someone spammed between two reciped in the crafting book in order to crash a server. So, is there an event I can listen to to be able to modify the lore as soon as it appear in the output box of the crafting menu?

echo basalt
#

PrepareItemCraftEvent

high pewter
#

Ah, thanks so much!

tardy delta
buoyant viper
short raptor
#

How can I get the item that was moved when someone shift clicks an inventory using InventoryClickEvent?

I know I can get the slot, but that's the slot that was clicked that is now empty as a result of the shift click. Getting the cursor is also useless because there is no item on the cursor, it got transferred instantly. So how am I meant to know what was transferred, or where it went to in the other inventory?

smoky anchor
#

Does getCurrentItem() not work ?

opal juniper
#

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

short raptor
#

Hm apparently it do

#

I thought it woukdn't

#

sry

copper scaffold
#

and i get this warning:

Cannot resolve resource filtering of MatchingCopyAction. IDEA may fail to build project. Consider using delegated build (enabled by default).
eternal oxide
#

?fork

undone axleBOT
#

SpigotMC maintains the Spigot server. If you are using a fork of Spigot (such as Paper, Airplane, Purpur, or other derivative works), you should seek support in the appropriate Discord servers.

smoky anchor
shadow night
#

https://github.com/RaydanOMGr/GunStop/ here is the source of my plugin. For some reason guns that have 6 shots can shoot 7 times and the ones that have 1 shot can shoot 2 times. Idk how to fix this so I need help, thanks. (I'm bad at maths)

#

I have no footage rn

eternal oxide
#

if bullets >0 then setBullets(player, bullets -1);

#

else it's empty so do your empty bit

quaint mantle
#

if i want to give feature to custom item can i do this only with name,lore,enchants equals ?

young knoll
#

Use pdc

quaint mantle
flint coyote
#

?pdc

quaint mantle
#

ty

shadow night
zenith gate
#

?paste

undone axleBOT
scenic onyx
#

"public void sendBreakAnimationPacket(Player player, BlockPosition position, int stage) {
PlayerConnection playerConnection = ((CraftPlayer) player).getHandle().b;
playerConnection.sendPacket(new PacketPlayOutBlockBreakAnimation(-player.getEntityId(), position, stage));
}" sendPacket go error

fluid river
#

whaterror

#

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

eternal oxide
#

-player.getEntityId()?

#

Why would you be using an inverse of the ID?

agile anvil
#

He reaches the player in the upside down

young knoll
#

Finally a plugin that is compatible with the shadow realm

twilit roost
#

can I set velocity to BlockDisplay?
im setting it but yet the display doesn't move at all
im parsing vector of 1,0,0 and then multiplying it by 100, yet no movement occurrs

young knoll
#

No

#

They don't tick so they don't apply the velocity

twilit roost
#

oh damn
how shall I make my own version of this velocity thingy?
I want them to move smoothly, not like teleportation

vernal gazelle
#

Does someone have experience with mods coded in Kotlin and trying to connect to Bukkit? For some reason this line doesn't work. It's to connect the economy from vault

var econ: Economy? = Bukkit.getServer().servicesManager.getRegistration(Economy::class.java)?.provider
scenic onyx
vernal gazelle
#

It compiles but when I excecute the command it doesn't do anything

eternal oxide
vernal gazelle
#

When a player is opening a GUI

#

with the command /gts

eternal oxide
#

are you getting the provider IN the command or a field in a class?

vernal gazelle
#

It's outside commands

eternal oxide
#

so a Field

#

it will be initialized at instancing, before any eco has been loaded

vernal gazelle
#
class gtsGUI(syncId: Int, player: PlayerEntity, server: MinecraftServer) :
    GenericContainerScreenHandler(ScreenHandlerType.GENERIC_9X6, syncId, player.inventory, SimpleInventory(9 * 6), 6) {

    val LOGGER = LogManager.getLogger()

    val world: ServerWorld? = server.worlds?.first()

    val timer = Timer()

    var currentpage: Int = 1

    var filepath: String

    var p = player

    val pm = ParseableMessage()

    var refreshbool = false

    var previouslistings: MutableList<GtsItem> = ArrayList()

    //RegisteredServiceProvider<Economy> rsp = getServer().getServicesManager().getRegistration(Economy.class);

    var econ: Economy? = Bukkit.getServer().servicesManager.getRegistration(Economy::class.java)?.provider


    init {.......
eternal oxide
#

when do you instance gtsGUI?

vernal gazelle
#

When a player performs the command /gts

#

Then it goes to this class

eternal oxide
#

this class is new every time the command is used?

vernal gazelle
#

Yes

#

It's player based

eternal oxide
#

no clue then. I don;t know enough kotlin to tell if you code is messed up.

#

it looks like you should not need the .java though

vernal gazelle
#

I do, otherwise I get this

Type mismatch.
Required:
Class<TypeVariable(T)!>
Found:
KClass<Economy>
scenic onyx
#

"Location blockLocation = player.getLocation();

    BlockPosition blockPosition = new BlockPosition(blockLocation.getBlockX(), blockLocation.getBlockY(), blockLocation.getBlockZ());
    PacketPlayOutBlockBreakAnimation packet = new PacketPlayOutBlockBreakAnimation(0, blockPosition, -1);
    ((CraftWorld) blockLocation.getWorld()).getHandle().sendPacket(packet);" I tried to fix the code but it doesn't work
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.

scenic onyx
chrome beacon
#

I'm guessing send packet doesn't exist

quaint mantle
#

e.getitem get holding item ? for mainhand and offhand ?

eternal oxide
#

If he gave us teh error we might be able to help

vernal gazelle
chrome beacon
quaint mantle
#

ty

eternal oxide
chrome beacon
#

?interactevent

undone axleBOT
#

The PlayerInteractEvent may be called once per hand. If you only want code to be executed once, you can check the result of https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/player/PlayerInteractEvent.html#getHand(), then decide functionality.

For example, only executing code if the main hand was used:

@EventHandler
public void onPlayerInteract(PlayerInteractEvent event) {
    if (event.getHand() != EquipmentSlot.HAND) { // * if the hand used is NOT the main hand:
        return; // do not progress past this point  |
    }
    // provide functionality
}
scenic onyx
vernal gazelle
#

I can only use javaObjectType or javaPrimitiveType

chrome beacon
#

Most of us here don't use Kotlin

vernal gazelle
#

I know but I thought I could ask, maybe someone knew

half bane
#

If i make a plugin on ex. 1.16 will it work on all versions above or does it need some extra configuration?

river oracle
quaint mantle
#
    @EventHandler
    public void cancelShear(PlayerInteractEvent e){
        Block farmland = e.getClickedBlock();
        ItemStack item = e.getItem();
        if (e.getAction() == Action.RIGHT_CLICK_BLOCK) {
            if (item != null && farmland != null && item.getType() == Material.WATER_BUCKET && farmland.getType() == Material.FARMLAND) {
                e.setCancelled(true);
                Farmland data = (Farmland) farmland.getBlockData();
                data.setMoisture(7);
                farmland.setBlockData(data);
            }
        }
    }```
i do this works but i see this in 1 sec can i block this water ?
remote swallow
eternal oxide
#

The water you see is client side. You can not prevent it

#

it vanishes when you cancel it

quaint mantle
#

ye oke

#

i need find no feature item for watering can

remote swallow
#

yeah

quaint mantle
#

i got

#

nullpointer exception again :/

remote swallow
#

as a warning or error in console

subtle folio
carmine mica
eternal oxide
quaint mantle
#

can i control horse armor slot without packets ?

subtle folio
#

The current hidePlayer is confusing,

#

with this it allows for more intuitive use.

subtle folio
eternal oxide
#

I see no use for it. just easier to confuse.

subtle folio
#

These 3 new functions would make it less confusing

echo basalt
#

hidePlayer and hideEntity are enough

eternal oxide
#

you already have the player objects if you want to hide so the direction of hiding dictates which player object you call hidePlayer on

subtle folio
#

yes but the reverse is what Is implied by the functions

#

but thats not the case

eternal oxide
#

pretty sure it won;t be accepted.

#

The functionality is already there. No need fo rmultiple methods to do the same thing.

subtle folio
#

that wasn't even the question 😭

eternal oxide
#

You asked for feedback

subtle folio
#

I wanted to know if adding a craft bukkit implementation or default methods would be the best approach

eternal oxide
#

Sorry it wasn;t the feedback you wanted

subtle folio
eternal oxide
#

Seems my comments agree with Phoenix616

subtle folio
#

got it. Thanks!

quaint mantle
#
    @EventHandler
    public void cancelShear(PlayerInteractEvent e){
        if (e.getAction() == Action.RIGHT_CLICK_BLOCK) {
            ItemStack item = e.getItem();
            Block farmland = e.getClickedBlock();
            Block crop = farmland.getRelative(BlockFace.UP, 1);
            Farmland data = (Farmland) farmland.getBlockData();
            if (item.getType() == Material.LEATHER_HORSE_ARMOR && farmland.getType() == Material.FARMLAND) {
                    data.setMoisture(7);
                    farmland.setBlockData(data);
            }
            else if (crop.getType() == Material.WHEAT || crop.getType() == Material.CARROTS ||
                        crop.getType() == Material.POTATOES || crop.getType() == Material.BEETROOTS ||
                        crop.getType() == Material.MELON_STEM || crop.getType() == Material.PUMPKIN_STEM) {
                    farmland.setBlockData(data);
            }
        }
    }```
#

i do this for fix this warnings

#

no errors but i got error in console

#

why ?

remote swallow
#

you can ignore thoses 2 warnings

quaint mantle
#

oke i try with this warnings

#

check console error

#

;-;

remote swallow
#

you probably would want to check if the item isnt null

lucid gazelle
#

hi

sour folio
#
                    if (spawnerItemMeta != null && spawnerItemMeta.hasLore()) {
                        List<String> lore = spawnerItemMeta.getLore();
                        for (String loreLine : lore) {
                            if (loreLine.startsWith("x")) {
                                String PigamountStr = loreLine.substring(1);
                                try {
                                    int Pigamount = Integer.parseInt(PigamountStr);


                                    // Get the spawner name

                                    // Get the coordinates of the placed spawner
                                    int pigx = block.getX();
                                    int pigy = block.getY();
                                    int pigz = block.getZ();
                                    String PigworldName = block.getWorld().getName();

                                    // Save the coordinates and amount in the configuration
                                    ConfigurationSection PigspawnersSection = iroconfig.getConfigurationSection("iron_golems");
                                    if (PigspawnersSection == null) {
                                        PigspawnersSection = iroconfig.createSection("iron_golems");
                                    }

                                    String PigcoordinatesKey = pigx + "_" + pigy + "_" + pigz;
                                    ConfigurationSection PigspawnerSection = PigspawnersSection.createSection(PigcoordinatesKey);

                                    PigspawnerSection.set("world", PigworldName);
                                    PigspawnerSection.set("amount", Pigamount);

                                    ```
#
                                    PigspawnerSection.set("expiration", expirationTime);
                                    PigspawnerSection.set("length", timetofill);

                                    PigspawnerSection.set("experiance", expirationTime);

                                    // Save the configuration to file
                                    try {
                                        iroconfig.save(new File("plugins/DonutSpawners/spawners/iron_golems.yml"));
                                    } catch (IOException e) {
                                        e.printStackTrace();
                                    }
                                } catch (NumberFormatException e) {

                                }
                                break;

                            }
                        }
                    }
                }```
chrome beacon
#

?paste

undone axleBOT
sour folio
#

twhy does that code only work when the user is in creative

#

totherwise it treasts it as a pig spawner

chrome beacon
#

Also I hope that isn't IO on the main thread

flint coyote
#

You can't place spawners with set mobs without creative

fierce salmon
#

What event can I use to tell if a player has fallen into the void or not?

flint coyote
eternal oxide
#

are you doing it in teh block place event?

chrome beacon
fierce salmon
#

ok

eternal oxide
#

set the spawner type 1 tick after the event finishes

sour folio
#

also wdym

fierce salmon
#

what is the name of the event for a player taking damage?

eternal oxide
#

?scheduling

undone axleBOT
flint coyote
fierce salmon
#

and one final question: How do I check to see the type of damage taken?

chrome beacon
#

getCause

eternal oxide
#

getCause()

fierce salmon
#

ok ty

sour folio
eternal oxide
#

you are finding all placed spawners are pig spawners, yes?

#

unless in creative

sour folio
#

yes

fierce salmon
#

?paste

undone axleBOT
eternal oxide
#

then set the type 1 tick later

#

creative has it's own set of events

fierce salmon
chrome beacon
#

Don't run a command

eternal oxide
#

don;t use getLastDamageCause

fierce salmon
#

should I just tp them to some coords instead?

chrome beacon
eternal oxide
#

if (event.getCause() = = EntityDamageEvent.DamageCause.VOID)

fierce salmon
#

ok tysm

fierce salmon
eternal oxide
#

player.teleport(world.getSpawn())

fierce salmon
#

ah ok

eternal oxide
#

did you register the listener?

fierce salmon
#

yeah I did in the Main.java

#

ill send it as well

chrome beacon
#

?main

fierce salmon
#

lmao I thought it was the opposite way around

eternal oxide
#

Check you updated the jar on your server

#

yeah plugins are not apps. They have no main

#

anyway, you either didn't update the jar on your server, you missed a build error or you have a startup log error you ignored.

fierce salmon
#

theres no errors and I updated the jar on my server

eternal oxide
#

the code is fine, you missed an error somewhere

hasty prawn
#

You are in a world called "practice" right

fierce salmon
#

yes

#

I used a test case and I turns out that the plugin doesn't even get to the damage caused by void part

eternal oxide
#

?paste your latest.log

undone axleBOT
fierce salmon
#

where do I find the latest.log?

eternal oxide
#

on your server

#

in the logs folder

fierce salmon
#

it says something went wrong when I paste it into the hastebin link you gave me

#

it might be too long

eternal oxide
#

throw the file in here then

fierce salmon
eternal oxide
#

whats your plugin called?

fierce salmon
#

PracticeableUtilities

eternal oxide
#

no startup errors

fierce salmon
#

nope lemme send the build console

chrome beacon
#

Did you put the jar in to the server after building?

fierce salmon
#

yes

eternal oxide
#

so long as your world is correctly named and you DID put the new jar on your server there is no reason for that code to not work

#

test it on spigot

rigid otter
#

Can I spawn an Ender Dragon with its AI? Because EnderDragon#setAI(true) does not work.

fierce salmon
#

do you think part of it might be me using a paper minecraft server?

eternal oxide
#

No idea but there is nothign wrong with the plugin code

chrome beacon
#

It doesn't like being outside of end and the end fight

rigid otter
#

Can you directly tell how to make it work?

#

I also spawn it in the end world

fierce salmon
#

its weird bc thats the name of the world

chrome beacon
#

Do you want to respawn the dragon in the end fight?

#

Or just have a dragon anywhere

eternal oxide
#

sysout the actual world name

fierce salmon
#

ok

rigid otter
#

I don't want to use the default dragon in the end world. I despawn it and create one, so that next time I can confidently create another one after the old death.

fierce salmon
#

lmao

#

I chose the name for the wrong world on accident

#

it works now I think

#

yep it works thanks

eternal oxide
#

you need to add a check it is an actual player

#

else anythign falling into the void will teleport to spawn

fierce salmon
#

ok

chrome beacon
#

Though if you plan on adding your own end crystals you will need NMS for that

kind hatch
#

NMS for setting the crystals?

chrome beacon
#

Yeah so the dragon AI knows where they are

#

and how many are remaining

kind hatch
#

Oh. Is that tracked? I thought the dragon didn’t care for them. I thought the only situation where crystal location matters is when you are respawning the dragon.

chrome beacon
#

ah nvm it looks like it can lookup nearby EnderCrystals within 32 blocks

#

So it's fine

slender cedar
#

Anyone know about the plugin ''Bossland''

#

?

shadow night
chrome beacon
#

oh interessting it appears to be using the spawn position as the end portal location by default I was just close to 0, 0 ;/

eternal oxide
#

do you still get an extra shot?

#

if so change it to >1

shadow night
shadow night
slender cedar
#

No one that can help me with ''Bosslands''

#

?

fierce salmon
slender cedar
#

lemme check

#

nope

fierce salmon
#

All the ones that are on YouTube seem to be in a different language

slender cedar
#

i think so yes

quaint mantle
#

second equal cancel the first equal ?

#

bcs can set moisture with any item

kind hatch
#

?bool

worldly ingot
#

Doesn't cancel out but takes priority

worldly ingot
#

You'll probably want to wrap your ||'s in parenthesis

kind hatch
#

Aw, do we not have a Boolean logic command?

quaint mantle
#

is my code is good ?

tall furnace
quaint mantle
#

Is there an error or unnecessary code?

worldly ingot
#

e.g. if (itemType == Material.LEATHER_HORSE_ARMOR && (blockType == Material.WHEAT || ... || blockType == Material.MELON_STEM)) {

#

&& takes priority, so the parenthesis are necessary

quaint mantle
#

ah alright

worldly ingot
#

There might be a Tag.CROPS btw

#

There is

#

if (itemType == Material.LEATHER_HORSE_ARMOR && Tag.CROPS.isTagged(block.getType()))

quaint mantle
#

crops

#

but only farmland crops ?

worldly ingot
#

Aren't all crops farmland crops?

quaint mantle
#

maybe sugarcane

tall furnace
#

wait, player#swingMainHand() is a method? Or is that your own?

quaint mantle
#

cocoabeans

worldly ingot
#

beetroots, carrots, potatoes, wheat, melon_stem, pumpkin_stem, torchflower_cropβ€Œ[upcoming: JE 1.20], pitcher_cropβ€Œ

#

That's all that's in crops

quaint mantle
#

now

worldly ingot
#

So no

tall furnace
quaint mantle
#

its spigot method i mean

tall furnace
#

Ah ok, thanks

quaint mantle
#

πŸ˜„

tall furnace
#

Had no idea that existed... happy to hear it!

slender cedar
#

Anyone thats good with coding?

#

i got these bosses and they have drops

#

but i cant change the percentage of getting the drop

#

is it the same code everywhere or is it very diffcult?

remote swallow
#

could probably use a set or something for the item list

quaint mantle
#

or custom code ?

fierce salmon
#

How do I get the name of the inventory that is being clicked on by the player?

quaint mantle
#

Is there a site where I can hear minecraft sounds?

eternal oxide
#

don't use inventory names to compare

fierce salmon
#

contents?

eternal oxide
#

inventory instances

quaint mantle
#

im in 1.16 and i can listen dripstone sounds ?

fierce salmon
#

how do I do that?

quaint mantle
#

how ?

slender cedar
eternal oxide
#

if (event.getClickedInventory() == instanceYouStore)

slender cedar
#

I use some elses plugin

#

Bossland its called

quaint mantle
#

ah i don't know

fierce salmon
quaint mantle
kind hatch
shadow night
fierce salmon
tame bay
#

Down below you can see the code I use

#

Even if I dont use unicode my name on the tablist is still white

kind hatch
tame bay
#

Im just experimenting a bit with unicode stuff. Didnt planned on making this a public or production plugin

#

Just some testing. This doesnt solve the problem though

#

ngl I love comments like this.
imagine someone new to coding would ask a question related to code like this. Your comment is just useless and toxic. If you have a better idea then tell the people how they could improve instead of a simple toxic answer.
How is someone new who doesnt know better supposed to learn how to improve?

#

Thats just a fact morice. Comments like those are bs. Either help those people to get better or dont comment at all

agile anvil
#

Doppelbemme, you should first try to do it simple, just a simple line trying to set to the player display name

#

Your code is just terrible

#

Like an heavy fog

#

So please first test with a simple line

tame bay
#

I know it is. Its just for testing around with server texturepacks

agile anvil
#

Don't blame others, if you want help, you need to make it clean

tame bay
#

Sadly

agile anvil
#

I won't help you with that code

#

There could be so many errors

#

On permissions

#

Way of setting name