#help-development

1 messages · Page 1268 of 1

thorn isle
#

it also means that the first lookup can't discriminate recipes that use two different types of stone in the bottom row

#

so if any such recipe exists, i will recurse the process and rebuild the token key mappings for that subset of recipes

young knoll
#

Uhh

#

My brain hurt now

ivory sleet
#

yea thats usually the way to go

#

u might be able to be a bit clever and do some (shorthand) trickery

thorn isle
#

looking at my old benchmark, it looks like all of the recipes at the time, except wooden slabs, wooden pressure plates, wooden gates, wooden doors, wooden stairs, boats, were found in a single lookup

#

some slabs and some stone stairs and walls also required a second lookup

#

in all these cases, since there aren't any material tags involved anymore, it degenerates just to effectively a lookup by material[] key

#

for shapeless recipes, everything was always resolved in a single lookup

#

i'm not sure if any shapeless recipe uses material tags

iron night
#

hm, what if we build a tree such that root contains every recipes, edges are materials (not tags) and the deeper you go - the more splits of original set of recipes from root happen (depth is index of item in grid from 1 to 9 which we observe to split at some vertex). since total splits are = amount of recipes (lets call it n). there will be O(n) vertices in tree. every vertex containing a set of O(n) recipes. Since we have material tags there will be multi-edges, considering that lets call maximum of materials a single ingredient can cover over all recipes = m. Then preprocess to build such tree is O(nn + nm) which should be pretty fast. Height of tree will be 9 or less. Since tree already uses O(nn) memory we can store O(k) array in every vertex where k - amount of materials in the game and array will be storing references to vertices we should go next with this material in a slot. Resulting preprocess is O(nn + nm + nk) but we always get the recipe from grid in 9 tree jumps which is O(1) and since we store O(k) array in every vertex jumps should be fast so it might actually be faster than 1 hashmap lookup (my intuition tells me 1 hashmap lookup is about 20 array lookups)

thorn isle
#

sounds solid at a glance

#

only way to know for sure is to benchmark it

proven fern
#

Why nerd talk @iron night ?

iron night
iron night
thorn isle
#

an issue with such a huge data structure becomes cache locality; hashing into a small hashmap can be faster than accessing a huge array (like a material enummap)

iron night
#

isnt getting ordinal of enum fast?

thorn isle
#

it is, it's essentially just a field read

iron night
#

well then i dont get you

thorn isle
#

but indexing into an array at a position that has to be fetched from main memory is slow

#

conversely a hashmap with a small table is more likely to already be in some cache tier in its entirety

iron night
#

still dont get it, isnt it just an ordinary array lookup by index?

thorn isle
#

whether that's actually slower or faster than computing the hashcode on it is anyone's guess really

#

well... a hashmap is an ordinary array, but we use the hash code of an object as the index

iron night
#

i dont think computing hashcode is the most time-expensive part of lookup

#

not sure

thorn isle
#

depends a bit on what we define as "lookup", but if it's map.get(), it's basically hashcode + array index for key & value, and comparing the keys

#

look i'm just saying that indexing into a lookup table of 1 million elements is probably slower than hashing into a hashmap of 16 elements

#

because as cpus have gotten faster and faster by orders of magnitude, memory hasn't gotten that much faster

iron night
#

there isnt array of 1mil elements, there is 1000 of arrays with length 1000 if this makes a diff

#

i dont know what for i said this

thorn isle
#

roughly the same thing but it all depends

#

benchmark it and we'll see

#

guesstimatine memory latency and how many clock cycles a hashcode is just piss in the wind at the end of the day

#

for the startup time issue, you could do it async in the background

#

start it in say plugin load and then block for the result in onenable

iron night
#

i mean im not implementing it, just was interested to share the algorithm i came up with

#

i didnt fully get how your solution works, is it heuristics?

thorn isle
#

it's uh

#

so the problem with material tags is that we have multiple keys that we want to map to a given value

#

the naïve solution to this is to just have a mapping for each key

#

but this breaks down when your key is a composite of multiple keys

#

take for example the furnace recipe, which accepts i think cobblestone, blackstone, and deepslate, and spans 8 slots (all except the center slot)

#

to produce all the for this, we'd need 3^8 mappings

iron night
#

its n^8 where n is matching materials yeah i get it

thorn isle
#

so instead of doing that, we have an intermediate step where we have 3 mappings for cobble, blackstone, and deepslate, and have them map into a "token key"

#

and then we compose those token keys into the recipe matrix query

#

so, no matter which type of stone you put in any of the slots, the token keys for each slot and hence the composite key of them will be the same, and we get the same result

#

for materials not part of any material tag, there is only 1 intermediate mapping, from that material to a "token key" unique to that material

#

while materials part of one or more material tags get mapped into the same "token key" as any other material in the tag

#

in this way we can map a very large amount of inputs to a single output

#

the downside is that some inputs which we don't want to map to that output will also be mapped to that output

#

taking the furnace example again, since both cobblestone and blackstone map to the same token key, then the composite key for both cobblestone slab and blackstone slab will be identical, so we can't tell those apart

#

so i iterate over all recipes, collect recipes like these into sets, and then i recurse the process for them by rebuilding the token mappings with only the material tags actually involved

#

since neither cobblestone slab nor blackstone slab uses any material tags in the recipe, there are no material tags in this context; every material will map to an unique token key, and we can now tell the two recipes apart

iron night
#

how do we understand whether should we map to cobble/black/deep token used in furnace recipe or unique token used in cobble slab if we dont know what we crafting yet

thorn isle
#

we first try the intermediate mappings that were created from every material tag

#

so when crafting a cobblestone slab, we first produce the composite key that maps to both cobble and blackstone slab

#

then we look at the result of that query; we see that it maps to multiple things

#

and then we repeat the process, but now we use the intermediate mappings created from every material tag in the cobble and blackstone slab recipes (i.e. none)

#

and then we get the cobblestone slab

#

it's essentially a tree, just 99% of the edges point at a leaf

#

for the ones that map into multiple recipes, there's a node and it recurses

iron night
#

okay, but what is there was recipe that requires #1 or #2 and recipe that requires #1 or #3. and we had 3 materials matching #1, #2 and #3 (9 total). what tokens will be created then?

thorn isle
#

by #1 etc. do you refer to material tags?

#

or materials

iron night
#

kinda

#

material tags

thorn isle
#

can you give a more concrete example, i can't really see that working out

iron night
#

the problem is i cant give concrete example

#

i couldnt find recipes where such things happen

#

my question is does your algo absuses the fact that such things dont happen or can it solve them too

thorn isle
#

it'll only fail to converge if there are multiple recipes that could match a given input

#

e.g. if you define a recipe that accepts any of a single block and turns it into a button

#

and then you also define a recipe that accepts 2 of a single block and turns it onto a pressure plate

#

this will fail to converge

#

but the current nms recipe matcher will also give you a random one of the two

#

because it's ambiguous

iron night
#

ohhh

#

i got it

iron night
thorn isle
#

i did think about this at the time and i was going to write a third node type that just returns a random one if there's such an ambiguity, but it doesn't seem like vanilla has any, so i didn't bother

viral widget
#

Hello! do you guys think its possible to optimize villagers by removing their awareness and AI, but keeping their panic brain activity?

thorn isle
#

off the top of my head i think that'll be difficult

iron night
thorn isle
#

i skimmed over this for sake of brevity, but the intermediate key mappings are per-slot

#

so in this case, although the intermediate key for the first slot will be the same for both of the inputs, the second slot will be different

iron night
viral widget
iron night
thorn isle
#

none of those tags overlap, so each of tags 1 2 and 3 will map to an unique intermediate key

#

e,g, cobble,black,deep might map to token 0

#

oak,birch to token 1

#

stone,basalt to token 2

iron night
#

but then you will have to create key with token 0 and key with token 1 for recipe 1 which is bad?

thorn isle
#

recipe 1 is what again?

iron night
#

slot 1 - accepts cobble/black/deep or oak/birch, slot 2 - dirt

#

so youll have to create keys:

  • slot 1: token 0, slot 2: dirt -> recipe 1
  • slot 1: token 1, slot 2: dirt -> recipe 1
    no?
thorn isle
#

that's not possible in the recipe matcher, you can't accept material tag 1 or material tag 2

#

what you can do is merge the material tags together and use it as a new material tag

iron night
#

so 1 recipechoice is only 1 material tag or what?

thorn isle
#

yeah

#

so what you're saying is that recipe 1 requires cobble/black/deep/oak/birch in slot 1

#

and oak/birch in slot 2

#

this means that for slot 1, all of cobble/black/deep/oak/birch will map to token 0

iron night
#

and if recipe 2 requires cobble/black/deep/stone/basalt in slot 1
and nothing in slot 2

thorn isle
#

then the recipes are discriminated by the virtue of there being nothing in slot 2 or not

iron night
#

but you map some token for slot 1?

thorn isle
#

same token whether or not there is anything in other slots, yes

#

but the composite keys will be 0,null if there is nothing in the second slot, and 0,? if there is something

iron night
#

so cobble/black/deep/oak/birch/stone/basalt -> token 0?

thorn isle
#

no because nothing in tag #3 (stone/basalt) overlaps with the other tag

#

stone/basalt will continue to map to token 1

#

if it were cobble/stone/basalt then they'd all be merged into one tag and be assigned token 0

iron night
#

okay okay. but if we say that #1 is (cobble/stone/deep/oak/birch) and #2 is (cobble/stone/deep/stone/basalt)
and recipe 1 is slot 1 - #1, slot 2 - dirt
and recipe 2 is slot 1 - #2, slot 2 - nothing
then cobble/stone/deep/oak/birch/stone/basalt all to token 0?

#

now #1 and #2 overlap

thorn isle
#

myeah

iron night
#

hm.
but if there:
recipe 1: slot 1 - #1 (stone/cobble)
recipe 2: slot 1 - #2(cobble/oak), slot 2 - dirt
recipe 3: slot 1 - #3(oak/birch)

#

#1 and #2 overlap, #2 and #3 overlap.
so stone/cobble/oak/birch all go to token 0?

#

if so, the same tokens will be generated if we put 1 stone in grid and 1 oak in grid, but they are different recipes

thorn isle
#

in the first iteration yes, inserting any of stone/cobble/oak/birch into the first slot will all be mapped to token 0

#

recipe 2 will be discriminated during first iteration by whether slot 2 has dirt in it or not

#

if it doesn't, we go to second iteration with only recipes 1 and 3

#

and now the only relevant tags are #1 and #3, which don't overlap

#

so in the second iteration we can discriminate between recipes 1 and 3

#

but you could make this a pathologic case by also adding cobble into tag #3

#

this'd mean that even in the second iteration, the tags have to be merged because they both contain cobble

#

and it'll fail to converge

#

in this case you can fall back to comparing the recipes one by one as vanilla does

iron night
thorn isle
#

myeah, that's what i meant earlier when i said uh

#

what did i say

iron night
#

yeah

thorn isle
#

that said the argument could be made that it should still work for e.g. when you put in stone and correctly match recipe 1, and for birch correctly match recipe 3, and only fail for cobble which could match either or

#

but i think defining overlapping recipes is probably programmer error anyway, so whatever

iron night
#

recipe 1: slot 1: b/c, slot 2: c/d
recipe 2: slot 1: a/b, slot 2: a/b
recipe 3: slot 1: c/d/e, slot 2: a/e
recipe 4: slot 1: d/e, slot 2: b/c
seems like in this example for every pair of recipes its impossible to put ingredients in a way so it matches multiple recipes, but at the same time all tags at slot 1 are merged and all tags at slot 2 are merged meaning we cant throw away any of recipes to go to the next iteration

#

this is example constructed by hand so its only 4 recipes but who know if there are such example but with 400 recipes, meaning we wont be able to throw any of them away and will still have to iterate through every of them which is O(n)

thorn isle
#

it definitely can degenerate like this, but i'm not sure how probable seeing something pathological like this in the wild would be

iron night
#

so its heuristics

#

it wasnt that easy to come up with such example so ig its fine

thorn isle
#

with some thought, the merging logic could probably be adjusted to prevent runaway merging like this with all the tags being merged, but it didn't show up in my tests so i didn't bother

young knoll
#

Use ai to determine what the output should be based on the ingredients

#

It makes up something not in the game? Have it generate a sprite for it and then use that to serve a resource pack to the client for their new item

crude zephyr
#

okay ive done this

#

now what should i follow to start my first plugin

wraith delta
quaint mantle
#

Holdon

#

Shouldn't the thing have

#

onEnable() and onDisable() ?

wraith delta
crude zephyr
crude zephyr
sly topaz
quaint mantle
crude zephyr
#

ive coded in json and some other things

#

python

#

and whatever QMK uses

quaint mantle
#

It does most of things for you

crude zephyr
quaint mantle
quaint mantle
sly topaz
#

?learnjava

undone axleBOT
#

For Beginners:

Codecademy - Learn Java: Interactive Java programming course from basics to more advanced concepts. Perfect for absolute beginners.
https://www.codecademy.com/learn/learn-java
JetBrains Academy - Java Developer Track: Learn by doing with projects and challenges. It covers Java fundamentals to advanced topics.
https://www.jetbrains.com/academy/
Udemy - Java Programming Masterclass for Software Developers: Updated courses that cover Java 8 to Java 17 features. Suitable for those who prefer structured learning.
https://www.udemy.com/course/java-the-complete-java-developer-course/

For Intermediate to Advanced Learners:

Oracle Java Tutorials: The official guides by Oracle for Java programming—great for understanding the depth of Java.
https://docs.oracle.com/javase/tutorial/
Baeldung - Learn Java and Spring: Focus on Spring Framework and modern Java technologies. Best for intermediate learners aiming to expand their knowledge.
https://www.baeldung.com/

Practice and Hands-on Learning:

Exercism - Java Track: Solve exercises and get feedback from mentors. Great for practicing coding skills.
https://exercism.io/tracks/java
LeetCode: Practice your coding skills and prepare for technical interviews with Java.
https://leetcode.com/

Free Resources and Documentation:

Java Programming and Documentation: A comprehensive collection of Java programming guides, tutorials, and API documentation.
https://docs.oracle.com/en/java/

Community and Support:

Stack Overflow: A vast community of developers. Great for getting help with specific problems or understanding concepts.
https://stackoverflow.com/questions/tagged/java
r/learnjava on Reddit: Join the community of Java learners and get advice, share resources, and discuss projects.
https://www.reddit.com/r/learnjava/

Remember: Learning to program takes practice and patience. Don't hesitate to experiment with code and participate in community discussions. Happy coding! 🎉

quaint mantle
#

woah buddy

sly topaz
#

do any of those courses before starting

quaint mantle
#

That's not nice

#

I was trying to help 😔

crude zephyr
crude zephyr
sly topaz
#

a quick java course is going to help you understand what you're doing

quaint mantle
sly topaz
#

it really doesn't take that long, a few hours tops and you'll probably be good for the rest just by checking the wikis on the forums

quaint mantle
#

Also stackoverflow khajiit

sly topaz
#

better to just not use it

crude zephyr
#

im getting mixed answers

quaint mantle
#

It's fine for me cause I use 1.8 md_5

#

Follow whatever rad and the other dude mentioned

crude zephyr
#

okay @blazing ocean , can you dm me if your free to tutor me

quaint mantle
#

Just use google

sly topaz
#

nobody is going to personally tutor you for free, hence why I recommend just doing a course

quaint mantle
wraith delta
sly topaz
wraith delta
#

for development, you need to get inn a habit of googling

quaint mantle
#

KodySimpson

#

10/10

#

Unless md_5 has a youtube channel

#

🤔

crude zephyr
#

all videos ive seen say to use the minecraft plugin

wraith delta
crude zephyr
#

and i was told by rad not to

sly topaz
quaint mantle
#

Also, why is your package called org.example ?

wraith delta
crude zephyr
quaint mantle
#

your.domain.something

#

io.github.ilikecheese

#

something like that

sly topaz
# wraith delta using the spigot api is a lot easier to get started than straight java

I understand the need to try and do things heads-on, but sadly there are no good courses that are hyper-focused on both learning the language as well as plugin development in of itself so one has to go one step at the time, and the proper first step is learning the language. Otherwise they're just going to be stuck here asking inane questions for a good while before they actually get the hang of things

crude zephyr
#

i havent used github in years

quaint mantle
#

isn't io.github free ?

wraith delta
quaint mantle
#

yeah

crude zephyr
sly topaz
#

?conventions

wraith delta
crude zephyr
quaint mantle
#

I'm not sure how gradle works but in pom, you gotta change the groupId

#

And then the plugin.yml

wraith delta
quaint mantle
#

artifactId supports number iirc

crude zephyr
#

its a red unerline with or without the 5

wraith delta
#

to the left is the package the Main is under also called traders?

quaint mantle
wraith delta
# crude zephyr uhh

Sorry but theres going to be so many questions to be asked. It would be best to find a video online such as youtube which shows how to set up a project for spigot development. Everyone does things differently, so you may need to watch a couple.

crude zephyr
#

i wouldnt mind that

#

all videos ive found tho are using the minecraft plugin plugin maker

#

which i was told not to do

wraith delta
#

eclipse or intellij is fine

sly topaz
#

that's because most videos are outdated, just do one of the courses

wraith delta
#

For sure, scroll through the videos and make sure the date is earlier than 3 years

sly topaz
#

they're gonna end up following mineacademy videos from youtube, and that never ends well

wraith delta
#

If you are still looking at this chat, watch the video first before copying. if you like the result then go back and follow it.

crude zephyr
blazing ocean
#

IJ build system?

#

Wouldn't expect that from kody simpson

#

or whatever his name was

crude zephyr
#

yeah it was from them

#

hi rad

sly topaz
#

don't know why since 99% of the time you won't have to care about how the IDE-specific build system works but welp

blazing ocean
#

why can't people make good tutorials for once

wraith delta
sly topaz
#

I would if I had a good PC to film it but I fear I'd start using my processor as a stove if I were to record while coding in an IDE and also having a minecraft instance as well as a server running on the background

sly topaz
wraith delta
crude zephyr
#

my dyslexic ass does like learning via trial and error

sly topaz
#

you get to not read when you're proficient enough to not have to

blazing ocean
wraith delta
sly topaz
#

I understand the sentiment of trying to help, but sending them to the wolves and just expecting someone else to take the reigns after you leave them with half-directions is irresponsible at best

crude zephyr
crude zephyr
sly topaz
#

you're free to continue with the video or whatever, hopefully that works out great for you

wraith delta
crude zephyr
#

yee

#

ive had to alot when fixing plugins and stuff for the minecraft server im setting up

sly topaz
quaint mantle
sly topaz
#

I guess with wasm being at the state it is now, maybe it'd be possible to just run it all on the client and hope for the best

quaint mantle
#

We should ask md_5 to make tutorial vids ngl

wraith delta
#

I dont think there can be a perfect tutorial. People learn differently and perceive info uniquely. A teacher would have to make a couple videos of the same output but seperate methods

#

Some users have bad comprehension in text. While some have trouble following visuals and must read over and over.

crude zephyr
#

theres no JavaPlugin

wet breach
crude zephyr
wet breach
#

if the bar for comprehension is low, then you must teach so that the level of comprehension doesn't matter

wraith delta
crude zephyr
#

i used the same spigot jar file as my minecraft server

#

i thought that was what i was ment to do

#

im dumb

#

sorry

wraith delta
#

That is not the one to use, there is a specific jar for development

crude zephyr
#

oh ok

#

time to restart again 😢

wraith delta
wet breach
#

either would work, the one for development just doesn't contain the server code which generally you are wanting, but the server jar contains the api as well. Issue might be setting up the dependency properly so that the IDE can import properly

#

or the dependency is set properly just missing imports

#

can't tell from the picture alone other then missing imports

wraith delta
crude zephyr
#

ok
so uhh the link in the description in the video didnt take me to the page they got there pluginapi from

wraith delta
crude zephyr
#

oh ive used build tools before

#

thats how i made the server.jar

wet breach
#

spigotmc hosts the api jar

#

just not the server jar

wraith delta
crude zephyr
#

yes link would be helpfull

orchid brook
#

loopPlayer.stopSound("atlantis_sounds:music.crabe_event");
Why this isn't working ?

crude zephyr
#

link worked!

#

which one most recent
i dont see a date

wet breach
#

go with the one with the highest number at the end

crude zephyr
#

so 32

wet breach
#

the number at the end is the build number

wraith delta
crude zephyr
#

right

#

aw fuck now theres 12 options

wet breach
#

the numbers after r0.1 is the date

#

just fyi

crude zephyr
wraith delta
#

try that one first

crude zephyr
#

ok

wet breach
#

it might be better if you use maven build system to manage dependencies and to build

#

using that setting window you would need to use ant to build

#

not a problem for beginning or a small project

#

but once you need to start shading may be wise to switch to maven

wraith delta
# crude zephyr

you are doing great so far. after those settings are saved, is the red gone from the code?

wraith delta
#

continue that video, the project is fine so far.

wet breach
#

and soon another MC Java developer will be born to wreck havoc in the world of plugins

wraith delta
#

In that code, you will need a function called onEnable be sure to look for that in the video. every plugin will need that

crude zephyr
#

does it auto save

wraith delta
# crude zephyr

That will do! make sure to get the plugin.yml finished, the video might mention it - if not then watch a different one for creating a plugin.

crude zephyr
#

yep thats the next step\

wraith delta
crude zephyr
#

yee i have been

#

been doing it my whole life

#

since i was 10

wraith delta
#

haha, good habit to have

crude zephyr
#

omg that was 10 years ago

#

im OLD

#

😢

wraith delta
#

time flies

wraith delta
#

get back to that video. you are doing good

wet breach
crude zephyr
#

im sure theres someone 3x older

blazing ocean
#

almost!

mortal vortex
#

20 is not old gng

vast ledge
mortal vortex
#

played WoW on Discord with a 60 year old dude once

#

i was like... 11?

wraith delta
#

that said, dont forget to take breaks, go outside. enjoy the time you have while you still have it

vast ledge
#

So now you're 30?

#

Dayum

#

I got blocked

mortal vortex
vast ledge
#

Yea

mortal vortex
#

no??

#

This was a couple years ago man

vast ledge
#

So you a dinosaur?

mortal vortex
#

gang... i was born in 09

vast ledge
vast ledge
wet breach
#

only if you allow it

mortal vortex
#

dinosaur

vast ledge
blazing ocean
#

elgar is a dinosaur

mortal vortex
#

u cant swear here dude.

#

against rules

vast ledge
#

Should I kill him or what?

wraith delta
wet breach
#

but, the being caged unless someone is physically caging you then I guess that is a bit different

vast ledge
wet breach
#

o.O

#

do I smell a potential nemesis

vast ledge
vast ledge
blazing ocean
#

The memories of a stackoverflow in my text builder

vast ledge
wet breach
#

some would say I am

wet breach
#

if they could still talk that is

vast ledge
#

Ah yes

#

Many could account for my skills, if they weren't in my stomach._.

wet breach
#

well fortunately as far as rations go I wasn't desperate enough for cannibalism

vast ledge
#

A bit of salt and pepper and some bbq sauce, and they taste fine

crude zephyr
#

@wraith delta :)

vast ledge
#

I hope nobody ever does a background check on me and sees any of my messages

wraith delta
vast ledge
crude zephyr
#

dream death

#

now i need to figure out how to code what i want

vast ledge
crude zephyr
#

how tf do i do that 😭

vast ledge
crude zephyr
#

when player dies
says "You woke up from a Bad Dream"

wraith delta
vast ledge
#

There are events

#

Look into those

#

You'd have to look if there's a specific one for player awake or smth

blazing ocean
#

?eventapi

undone axleBOT
wraith delta
#

this one probably for the awakening

vast ledge
#

Respawn?

wraith delta
#

the PlayerDeathEvent happens too early

vast ledge
#

Oh frick my brain screwed me

#

I read woke up and thought they were talking Abt a sleeping related event

wraith delta
#

nah its not you, ive lost my mind trying to do stuff with PlayerDeathEvent and it not working, turning out that its just too early

vast ledge
#

Does player respawn still trigger if players dies, disconnects, and then rejoins?

crude zephyr
#

i have instent respawn on so it dosent matter

#

instint

#

insent

#

imediate

vast ledge
#

Ye then u can u respawn without worry

vast ledge
crude zephyr
#

yee that word

vast ledge
#

Just look into how an event listener is made and then adapt it for your use case!

wraith delta
#

pretty much yea, learn about the events. ideally start with PlayerJoinEvent that one is one of the easy ones and youll know it works

#
@EventHandler
public void testJoin(PlayerJoinEvent e)
{
  Player p = e.getPlayer().getName();
  p.sendMessage("welcome");
}
```should look similar to this
crude zephyr
#

i copyed that in and it came up all red (yes ill edit it)

blazing ocean
#

You'll need imports

#

Hover over such a red symbol and it should suggest importing it

wraith delta
#

for future reference tho in the function line after PlayerJoinEvent you can name it whatever you want instead of e

crude zephyr
crude zephyr
#

why is event red

#

or is it green

#

im colour blind XD

#

looks red to me

blazing ocean
#

There's probably some colourblind themes for IJ, and yes, it is red

wraith delta
#

Player p = e.getPlayer().getName(); the p is just a variable that you can name anything

blazing ocean
#

I'd recommend learning java first

wraith delta
#

its the "event" part thats the mistake I had, it needs to match the word after PlayerJoinEvent

crude zephyr
blazing ocean
#

remove that getName

wraith delta
#

thats correct, but i wonder if they removed getname

wraith delta
crude zephyr
blazing ocean
wraith delta
blazing ocean
#

?eventapi now read this

undone axleBOT
wraith delta
crude zephyr
#

thats alot of reading
also black text on white is so hard to read

#

but ill try look through it

blazing ocean
#

you can use dark reader

#

it's a browser plugin that makes sites use dark mode (even if badly often times)

wraith delta
#

at the bottom of the spigot page theres a theme option for dark mode

blazing ocean
#

that's only for donators though right

wraith delta
#

is it?

blazing ocean
#

because I do not have any other themes I can select

wraith delta
#

oh, darn

crude zephyr
#

pay to win 😭

wraith delta
#

i do have donator tho, just didnt know that was a perk since its so long ago

#

if it makes you feel any better, its still hard to read the code in dark mode XD

crude zephyr
#

it didnt say "Welcome To QuinsimeSMP"

vast ledge
#

Did u register it?

crude zephyr
#

idk what that means

random compass
#

try delaying by 1 tick

vast ledge
#

Did you create a class for ur eventhandler or is it in ur main class

crude zephyr
#

this is all the code lmao

vast ledge
#

Okay

#

Normally you would create a separate class for events which is called an event handler but to keep it simple let's keep it in the main class

random compass
#

you havnt implemented listener

vast ledge
#

You'll need to add implements Listener behind the extends JavaPlugin

random compass
#

im just gonna shut up, sry 🙂

vast ledge
random compass
#

sry ive been learning java for 2 weeks and suddenly i think im an expert

crude zephyr
vast ledge
random compass
#

you put it after extends java plugin like that

wraith delta
#

Like George’s pic, add the implements Listener

#

And then register the event in the on enable

random compass
#

ima be real, if you ask chat gpt to code it you get pretty good code. then u can just learn from what it wrote

#

thats what im doing to learn

#

or just ask it to tell u how to fix errors

wraith delta
#

If you are logged in and using model 4o, yes it’s pretty good

vast ledge
#

I have some example code, but it uses a separate event handler class, and you'd need to ignore a bunch of jargon you don't need to know yet

buoyant viper
crude zephyr
random compass
vast ledge
crude zephyr
#

bruh

vast ledge
#

Let's go through this step by step

crude zephyr
#

ok :-)

random compass
#

bedless the 🐐

vast ledge
#
  1. Change the line where you have extends JavaPlugin to have implements Listener at the end before the bracket
#
  1. In your onLoad function add a line that registers your main class as an event listener
#

getServer().getPluginManager().registerEvents(this, this);

crude zephyr
vast ledge
#

Yep

crude zephyr
#

im stuck on step 2 😭

random compass
#

just past the code in your onLoad part

crude zephyr
#

omg im so dumb

#

i cant read for shit

#

dyslexic ass

#

im so confused

vast ledge
#

You see the ```java
public void onLoad(){
System.out.println("DreamDeath Now Running")
}

Replace it with
```java
public void onLoad(){
System.out.println("DreamDeath Now Running")
getServer().getPluginManager().registerEvents(this, this);
}
#

I'm on phone so formatting is gna be horrible

crude zephyr
#

i dont have onLoad

#

i have public void onDisable() {
and
public void onEnable() {

vast ledge
#

On enable soz

crude zephyr
#

so this?

vast ledge
#

yeee

#

Nice

#

Now try running it again

crude zephyr
#

so build and run server

vast ledge
#

Yep

crude zephyr
#

OMG IT WORKS

#

THATS SO COOL

#

how change colour

#

§[Colour]?

vast ledge
#

Ayy nice

#

In your player.sendMessage()

#

You can use ChatColor.RED

#

Or such

#

That's one way

crude zephyr
#

where put ChatColor.RED

vast ledge
#
  1. player.sendMessage(ChatColor.RED + "Welcome Back")
  2. player.sendMessage(ChatColor.translateAlternateColorCodes('&', a "&cWelcome Back"))
  3. player.sendMessage("§cWelcome Back")
#

This is all out of memory so some method names might differ slightly

crude zephyr
#

does it say it to the world or just the player who joined

vast ledge
#

player.sendMessage is to the players istelf

#

If you wanna send to everybody then it's broadcast message or something getServer().broadcastMessage()

crude zephyr
#

cool

cosmic elk
#

Could anyone inform me how I could change the over head nametag of a player using ProtocolLib?

crude zephyr
#

ima grab food then come back and figure out how to do the death message

vast ledge
crude zephyr
#

thanks deus

quaint mantle
#

np khajiit

cosmic elk
#

i have, but that seems to only add prefixes or change the colour, im trying to change the nametag entirely

worldly ice
#

i believe you need to send a player info packet

#

nvm it looks like that's only for tab list

cosmic elk
#

yeah thats the same thing I was thinking :/, like it must be possible I just have no idea how it would be

worldly ice
#

maybe entity metadata?

#

and then change the custom name

wet breach
#
PacketPlayOutPlayerInfo with action REMOVE_PLAYER
PacketPlayOutPlayerInfo with action ADD_PLAYER with a different name (perhaps through reflecting on the packet data)
PacketPlayOutDestroyEntity to all players except you.
PacketPlayOutNamedEntitySpawn to all players except you
mortal vortex
somber scarab
#

Hi guys, in my plugin i have regular world generation when generating a plot of land for the minigame.

I wanted to add also some sort of sky islands on top of the regular plot generation..
I thought about making my own world generator to make those sky islands but im not sure if thats making things too hard..

I want to add considerable variety to these sky islands so that every game can be unique in its pvp landscape.

#

I never dabbled with world generation before but im willing to sink in a month or two to learn enough to make smth like that... just asking if there might be an easier way

crude zephyr
#

can someone help me finish this code?
``@EventHandler
public void onTeleport(PlayerTeleportEvent e) {

    Player p = e.getPlayer();
    p.playSound();
    
}``

i want it to play a pop sound anyone near the player can hear

chrome beacon
#

?jd-s

undone axleBOT
crude zephyr
#

?

chrome beacon
crude zephyr
#

which play sound do i select

#

because i want it to play at the location the player leaves and the location the player goes to

rough ibex
#

look over the javadocs and find the one you want.

crude zephyr
#

sorry i dont know how

cosmic elk
#

here ill give some example code in just a sec

crude zephyr
#

thanks loaf

rough ibex
#

yes, they all do the same thing, but take different parameters, like sound as String or as Sound, optional SoundCategory, etc.

#

the more specific, the better

cosmic elk
# crude zephyr thanks loaf

Heres a breakdown of some code that would work for what youre looking for

    public void onTeleport(PlayerTeleportEvent e) {

        Player p = e.getPlayer();
        Location loc = p.getLocation(); // Gets the location of the player
        World worl = loc.getWorld(); // Gets the world of which the location is in (e.g. overworld, nether, end)

        worl.playSound(
                loc, // Location of where the sound plays
                Sound.ENTITY_CHICKEN_EGG, // What sound plays
                1.0f, // Volume of the sound
                1.0f  // Pitch of the sound
        );
    }```
cosmic elk
crude zephyr
#

hmm okay

crude zephyr
cosmic elk
crude zephyr
#

at both locations?
the new and the old

cosmic elk
#

im not sure how one would go about doing that honestly, but this code would only do it at the ending location

crude zephyr
#

ahh right

#

i want it at both

#

is rad awake

cosmic elk
# crude zephyr i want it at both

This code would achive what youre looking for to my understanding, though i havent tested it

    public void onTeleport(PlayerTeleportEvent e) {

        Location startingLoc = e.getFrom();
        Location endingLoc = e.getTo();

        endingLoc.getWorld().playSound(
                startingLoc,
                Sound.ENTITY_CHICKEN_EGG,
                1.0f,
                1.0f
        );

        startingLoc.getWorld().playSound(
                endingLoc,
                Sound.ENTITY_CHICKEN_EGG,
                1.0f,
                1.0f
        );
    }```
crude zephyr
#

ill test it in a moment

crude zephyr
cosmic elk
crude zephyr
#

oh so i do

#

fixed

cosmic elk
#

you should only need one ; at the end of a line

crude zephyr
#

ye

#

ima test them both now

cosmic elk
#

alr 👍

crude zephyr
#

pop sound works for all players

#

and the death message too

cosmic elk
#

glad to hear that 👍 I'd recommend looking up the basics of Java, its confusing as hell for a while but worth it if you want to do more complex stuff in the future

crude zephyr
cosmic elk
#

np happy to help

cosmic elk
#

LOL

mortal vortex
#

can you spawn a dropped item suspended completely in place?

#

If you were to drop an item into a hole, as a player, and refilled the hole, the item would pop up. Is there a way to force an item to not do this?

cosmic elk
#

so it might be impossible with plugins, but im not 100% certain wither

#

either*

mortal vortex
#

is wither a slur

#

dont call me wither

cosmic elk
#

i just misspelled either 😭

mortal vortex
#

cap

chrome beacon
mortal vortex
smoky anchor
#

wdym 'immutable'

wet breach
mortal vortex
smoky anchor
#

I know what immutable means in the sense of a java object
I don't know what you mean in the sense of Item Display

mortal vortex
#

not going to be moved, subject to being picked up

smoky anchor
#

yew, display entities only display. they can not be interacted with in any way without commands

mortal vortex
#

Thanks dude.

#

You a real one gng

young knoll
#

Immutable means you can’t /mute them

dawn flower
#

how do i stop whatever this is

#

i still want arrows to deal damage though

young knoll
#

Remove them when they hit a block with ProjectileHitEvent

dawn flower
#

is it getEntity()

young knoll
#

?jd-s

undone axleBOT
dawn flower
#

k

young knoll
#

Yes

dawn flower
#

works thanks

crude zephyr
chrome beacon
#

What's the issue?

crude zephyr
#

apparently leaving a boat is considred teleporting

#

so the pop sound plays when you leave a boat

chrome beacon
#

You'd want to check the teleport cause

crude zephyr
#

wdym

chrome beacon
#

When do you want it to trigger

crude zephyr
#

i dont know if i can be asked editing the plugin

#

i mean its the only issue

chrome beacon
#

It's really just one if statement

#

so it wouldn't be too much of an effort to fix

crude zephyr
#

``@EventHandler
public void onTeleport(PlayerTeleportEvent e) {

    Location startingLoc = e.getFrom();
    Location endingLoc = e.getTo();

    endingLoc.getWorld().playSound(
            startingLoc,
            Sound.ENTITY_CHICKEN_EGG,
            1.0f,
            1.0f
    );

    startingLoc.getWorld().playSound(
            endingLoc,
            Sound.ENTITY_CHICKEN_EGG,
            1.0f,
            1.0f
    );
}``

this is the code
would it be a simple line to add?

eternal oxide
#

um

#

that code is fine if you are teleporting in the same world

#

but cross world it will play sounds in the wrong locations

crude zephyr
#

oh hmm

#

its purely astetic so it dosent really matter

#

but a fix would be nice

eternal oxide
#

get the world from the location you will be playing the sound at

#
                endingLoc...```
crude zephyr
#

we already have that

eternal oxide
#

you don;t

#

you have endingLoc.getWorld().playSound( startingLoc...

crude zephyr
#

we have both

quaint mantle
#

You have to switch around the locs

#

Currently you play a sound at the starting location in the ending world and vice versa

crude zephyr
#

but it still works?

eternal oxide
#

only if in the same world

crude zephyr
#

oh i get it now

#

just make it
startingLoc.getWorld(),playsound( startingLoc...

#

and

dawn flower
#

how do i change the max stack size of enchanted gaps to 16

crude zephyr
#

endingLoc.getWorld(),playsound( endingLoc...

eternal oxide
#

yep

crude zephyr
#

okay easy enough

dawn flower
#

is that in 1.21.5 only

smoky anchor
young knoll
#

Pretty sure the api has also had it since 1.20.5

winter jungle
#

What is a unique value that every skin has? So that I can check, for example, whether a player has exactly the one skin

blazing ocean
#

the skin texture value

winter jungle
# blazing ocean the skin texture value

I have tried this, it is the same in a few places, but not in many others

Value 1:

ewogICJ0aW1lc3RhbXAiIDogMTc0NjQ0NjM0ODc0NSwKICAicHJvZmlsZUlkIiA6ICIyYzRlNWUyNjMzYWY0MjU4OWJlMGRkN2NjZDVjMzhlOCIsCiAgInByb2ZpbGVOYW1lIiA6ICJGZWRveCIsCiAgInNpZ25hdHVyZVJlcXVpcmVkIiA6IHRydWUsCiAgInRleHR1cmVzIiA6IHsKICAgICJTS0lOIiA6IHsKICAgICAgInVybCIgOiAiaHR0cDovL3RleHR1cmVzLm1pbmVjcmFmdC5uZXQvdGV4dHVyZS81ZmYxMTA3Zjg4NmNjODgwYWY5ZWVkMjJjM2UwYTRkMjdhZjM4NmM4NTA2ODBlYzExNDlmMzc1YTZlMmMwYTAxIiwKICAgICAgIm1ldGFkYXRhIiA6IHsKICAgICAgICAibW9kZWwiIDogInNsaW0iCiAgICAgIH0KICAgIH0KICB9Cn0=

Value 2:

ewogICJ0aW1lc3RhbXAiIDogMTc0NjQ0NjMwMTIwOCwKICAicHJvZmlsZUlkIiA6ICI0NjZhNmFlZDg0Mzc0MDcxOGRjNmE2OGRiMmZiM2M5ZCIsCiAgInByb2ZpbGVOYW1lIiA6ICJUaW1vbGlhU3BpZWxlciIsCiAgInNpZ25hdHVyZVJlcXVpcmVkIiA6IHRydWUsCiAgInRleHR1cmVzIiA6IHsKICAgICJTS0lOIiA6IHsKICAgICAgInVybCIgOiAiaHR0cDovL3RleHR1cmVzLm1pbmVjcmFmdC5uZXQvdGV4dHVyZS82NTg0ZDEwNzE4NTRkMDY4NWY4ZmRkNDM3MTY3NGZmYjk1ZWNmYjA2ODEwMTQ1ZWEzODk1YTY0YzNiZmVlNzcwIiwKICAgICAgIm1ldGFkYXRhIiA6IHsKICAgICAgICAibW9kZWwiIDogInNsaW0iCiAgICAgIH0KICAgIH0KICB9Cn0=
blazing ocean
#

well that's the skin texture encoded into b64 (iirc)

winter jungle
#

So it's not the value from textures?

drowsy helm
blazing ocean
#

oh are they

#

interesting

#

the skin system is whack

drowsy helm
#

extremely whack

winter jungle
#

damn

drowsy helm
#

thats why inventive talent's MineSkin uses a bot account

eternal oxide
#

the value in base64 is just an encoded web address

blazing ocean
eternal oxide
#

the server never sees nor uses the texture itself. It just tells the client where to find the texture

blazing ocean
#

I was thinking of integrating that into my NPC stuff for my game engine but kinda cba

drowsy helm
#

ah it is just a url

#

thats even more whack

blazing ocean
eternal oxide
#

well its a url wrapped in a bit of json

blazing ocean
#

more like michaelsoft actually

drowsy helm
#

I wonder if that url can be changed or if theres soem verification on client side

#

but yeah, profile Id and name are baked into the texture string

winter jungle
#

I thought the Skin Signature would at least be unique

blazing ocean
slender elbow
#

the signature checks the property value,

ashen wren
#

Can i ask here for resource pack problems and spawning?

chrome beacon
#

Spawning?

tranquil ferry
#

hey how to repond to chargeback saying item not recieved. i dont have data because as soon as he raises chargeback, the resouce access is revoked by spigot. is there any way to prove it @vagrant stratus

winter jungle
drowsy helm
ashen wren
ashen wren
ashen wren
#

models/item not object, deepl problem

smoky anchor
#

{id:"minecraft:paper",Count:1b,tag:{CustomModelData:10001,display:{Name:'{"text":"Test"}'} }
This is not the correct format for few versions now too

drowsy helm
#

Do you have a json for the item in the items directory aswell?

smoky anchor
#

You're running on outdated information

slender elbow
smoky anchor
#

You do not need CMD for this simple thing, use the item model component instead

#

no need to override vanilla item model definitions

ashen wren
#

I would like to keep the original structure, but with a different modal ID I would like to get a different model. But somehow that doesn't work

smoky anchor
#

I would highly suggest using item model component instead of custom model data for these simple models
It makes everything so much easier
And go through the vanilla changelog to see what changed or use wiki, stuff there is fairly well documented.
You can also take a look at how vanilla does stuff, either unpack the vanilla jar or look here

ashen wren
#

What is the exact command?

smoky anchor
#

And if your problem is solved, please resolve the help request on the MCC discord server @ashen wren

ashen wren
smoky anchor
#

On the right you select what component you want and then press + to add it
Then you can configure the component

#

This is the resulting command
/summon armor_stand ~ ~ ~ {HandItems:[{id:"minecraft:paper",count:1,components:{"minecraft:item_model":"my_custom_model"}},{}]}

ashen wren
#

Is there also a way to enlarge the models?

#

make it bigger

smoky anchor
#

yes, make the model itself bigger
or change display size in display properties

#

Oh!
You should be using Item Display Entities for this thing probably.
If the only thing you want to do is to show something.

ashen wren
# smoky anchor this

I currently use armor stands. Can I also apply the model to a block that changes its model when placed, since item_model is different.

smoky anchor
#

I do not fully understand what you're asking.
Item models and block models are different. But I believe the answer is no.
You do not have such freedom with block models as you have with item models.

ashen wren
#

So there is no way to do an override for blocks that I get a different model?

#

But how do I get it to look like a block that has been placed with items?

smoky anchor
#

You can use blocks that have many different (or unused) states
Like noteblocks
But you can't have transparency with noteblocks and there's other issues..

smoky anchor
ashen wren
smoky anchor
#

Btw, are you making a plugin at all ?
Or just doing commands :D

smoky anchor
#

It gives you much freedom in many things and is most performant TPS wise

ashen wren
#

Would like to make a plugin for this... I don't like ItemsAdder.

ashen wren
smoky anchor
#

probably

quaint mantle
#
[WARNING] 'dependencies.dependency.systemPath' for org.spigotmc:spigot:jar should not point at files within the project directory, ${basedir}/library/Spigot-1.16.5.jar will be unresolvable by dependent projects @ line 77, column 23

The more you know about spigot

#

I mean

#

pom

smoky anchor
#

That's not how you depend on Spigot at all!

#

I forgot the command that tells you what to do

blazing ocean
#

?maven

undone axleBOT
quaint mantle
#

Yeah I know

sly topaz
#

or if you're trying to use NMS

quaint mantle
#

Build tools

sly topaz
#

?nms

quaint mantle
#

I gotta reinstall every version

#

😔

sly topaz
#

it takes like 2 minutes per version

quaint mantle
#

yeah but if you are using a potato to run a server

sly topaz
#

if you are on windows, make sure to add build tools to the exclusion folder list

blazing ocean
#

Then don't use a potato

quaint mantle
#

a single version download takes more time than downloading gta 5

blazing ocean
quaint mantle
#

ill try using raddish next time 😔

sly topaz
quaint mantle
#

Do I just

#

throw all of it into d drive?

sly topaz
#

I mean, what are you downloading these versions for

#

if it is for NMS, all you have to do is run build tools, preferably with the --remapped flag so that it gets dumped into your local maven repository

quaint mantle
#

fixing an old plugin

#

which uses all minecraft version for some reason

sly topaz
#

but does it use the API or NMS also?

#

what plugin is it

quaint mantle
#

Yeah

sly topaz
#

it wasn't a yes or no question lol

quaint mantle
#

It uses

#

API AND NMS

sly topaz
#

well then you don't have much of an option, it's either that or just invalidating their impl and using a reflection-based one for the time being

#

you could just forget about the versions you don't want to support by removing them modules from the pom

quaint mantle
#

build tools is virus?!

#

dem

sly topaz
#

I don't think defender has ever detected it as malware for me, but then again I had defender disabled most of the time back when I had windows

#

it just slows down things like build tools a lot

quaint mantle
#

I love false positive

#

Who uses winddos anyways lol

#

cause

#

dad has stored some important stuff

#

and he isn't here rn

sly topaz
#

ideally you'd have everything in a dev drive so that defender doesn't try to scan on every file creation but it all ends up the same

quaint mantle
#

why windows defender so weird

eternal oxide
#

defender is fine

#

its all I use for virus detection

sly topaz
#

it is the only thing anyone should use for virus detection

quaint mantle
#

I use kasperky

eternal oxide
#

I've used all AVs in teh past. personal and corporate and they are all bad

rotund ravine
#

I find a lot of stuff will give false flags on some of the more “sketchy” stuff

eternal oxide
#

kasp isn;t bad unless you are using it in a corporation install, then its a nightmare

rotund ravine
#

Like they were paid to flag some of it

eternal oxide
#

yep, I only use defender now and I've had no virus in 15 years

slender elbow
#

i remember i used to have some goofy ahh chinese av that flagged itself every hour

slender elbow
#

i don't remember what it was called, but it had a panda logo

eternal oxide
#

then again I don;t download torrents or visit dosgy sites

slender elbow
#

and all the text was in chinese

rotund ravine
slender elbow
#

nope

#

which made it all the funnier

rotund ravine
#

Smh

thorn isle
#

in the worst case this will degenerate to the same space complexity as the naïve hashmap solution, i.e. your tree structure will become untenable

#

the tree has a fixed depth of 9, but the degree is only limited by the number of materials in the game

#

suppose there are n materials in the game, and we start by defining n recipes that require an unique material in the first slot

#

the degree of your root node is now n

#

now suppose we define one additional recipe that also requires, say, dirt in the second slot

#

now we have n2 nodes but only n+1 recipes

#

now suppose we add a few more recipes that take a few different materials for slots 3 4 and 5, and the worst case is already larger than will fit in memory

pure dagger
#

why world.getUID() not world.getUUID()

worldly ingot
#

Why the fuck am I everywhere?

smoky anchor
#

Did you eat a granade ?

worldly ingot
#

Valid follow-up question

#

Unknown answer

sly topaz
undone axleBOT
#

No, Choco is not real. I was not programmed to say this by Sam.

rough drift
#

W sam move

slender elbow
#

single abstract method

vagrant stratus
# tranquil ferry hey how to repond to chargeback saying item not recieved. i dont have data becau...

I use the following:

The buyer purchased a digital product from me on SpigotMC.org, specifically the resource titled “<resource_title>” (Transaction ID: <transaction id>) The product is automatically delivered to the buyer's SpigotMC account immediately after purchase, allowing them to download the software directly from the website. Due to the nature of this transaction, as an intangible digital good, the item is non-refundable once accessed.

Link to the product: <link here>

I kindly request that this dispute be reviewed with consideration of the fact that the buyer has already received the digital product in full.

Thank you for your attention to this matter.
#

should work in your case

grim hound
#

it's a copy of the rep

#

and suddenly "nuh-uh, this ain't it"

rough ibex
#

git pull does nothing?

hardy sundial
#

Hi, i know 1.8 is an outdated version but is it possible to run it with JDK 21? The plugin ViaVersion requires JDK 21 and when I run with JDK 21 I get this error 100 times per second:

[18:54:19 WARN]: An exceptionCaught() event was fired, and it reached at the tail of the pipeline. It usually means the last handler in the pipeline did not handle the exception.
java.lang.RuntimeException: Unable to access address of buffer
        at io.netty.channel.epoll.Native.read(Native Method) ~[spigot.jar:git-Spigot-21fe707-741a1bd]
        at io.netty.channel.epoll.EpollSocketChannel$EpollSocketUnsafe.doReadBytes(EpollSocketChannel.java:678) ~[spigot.jar:git-Spigot-21fe707-741a1bd]
        at io.netty.channel.epoll.EpollSocketChannel$EpollSocketUnsafe.epollInReady(EpollSocketChannel.java:714) ~[spigot.jar:git-Spigot-21fe707-741a1bd]
        at io.netty.channel.epoll.EpollSocketChannel$EpollSocketUnsafe$3.run(EpollSocketChannel.java:755) ~[spigot.jar:git-Spigot-21fe707-741a1bd]
        at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:380) ~[spigot.jar:git-Spigot-21fe707-741a1bd]
        at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:268) ~[spigot.jar:git-Spigot-21fe707-741a1bd]
        at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116) ~[spigot.jar:git-Spigot-21fe707-741a1bd]
        at java.lang.Thread.run(Thread.java:1583) [?:?]
chrome beacon
#

Use a maintained fork of 1.8

#

or fork it yourself and update things

hardy sundial
#

Thx

#

Do you know any by any chance?

#

Paper ?

chrome beacon
#

Paper doesn't maintain 1.8 versions

#

PandaSpigot I believe is one

#

but then again you really should update to 1.21.5

hardy sundial
#

Thanks!

#

Well I want to but I want to have a pvp server and really need the old pvp mechanics

#

Idk but downgrading back to 1.8 seems the only feasible thing to do

chrome beacon
#

You can disable the attack cooldown in modern versions

hardy sundial
#

Oh thanks I didn't know!

smoky anchor
rough ibex
#

It suggests you run git pull

smoky anchor
#

define "it"

rough ibex
#

scroll... up?

#

in the picture

#

if its a copy of the repo I'm assuming it's supposed to be up to date

smoky anchor
#

how much do I have to scroll up ?

rough ibex
#

that depends on your screen resolution

smoky anchor
#

You have not sent any pictures here for at least half a month

#

but if you just cloned, yes git pull will do nothing most likely

chrome beacon
#

They were talking about ShadowOfHeavens image right above their message

smoky anchor
#

Aaah sorry, I misunderstood
sorry

echo basalt
#

just found myself debugging code without bothering to look at the console for stacktraces

#

life is beautiful

vagrant stratus
#

kekw

grim hound
rough ibex
#

run git status

grim hound
rough ibex
#

so you have changed things

#

does remote have commits you dont

grim hound
#

no

#

I copied it
Made one push 3 weeks ago
Today I couldn't

rough ibex
#

you can't push?

#

well fetch first then

#

you can't push to a repo that has commits ahead of you

grim hound
#

but it doesn't

#

it really

#

doesn't

grim hound
#

I don't seem to have the option to do that

#

force push isn't an option

tribal wraith
#

Can you make entities glow hex color codes?

#

I have it working for normal ChatColor using scoreboard teams; it uses org.bukkit.ChatColor which doesn't implement hex, is there another way?

slender elbow
#

no

rough ibex
slender elbow
#

the only exception are display entities, but not otherwise

somber scarab
crude zephyr
#

making my second pluin, might need some help
ive made the base plugin but havent started the EXP spawning rule
how would i go about that

#

BlockBreakEvent or something

chrome beacon
#

Depends on how you want it to work

crude zephyr
#

uhh so

#

also hi olivo
i fixed the bug

#

anyways

#

summon exp orb with a value of 1exp point at the location a fully grown wheat/carrot/potato.etc is broken

chrome beacon
#

So if you break that down you need to:
First check if it's a crop, then check it's age and if it's the max amount spawn an exp orb.

Convieniently Minecraft (and therefor Spigot) already comes with a tag for all crops; It's called Tag.CROPS.

To check the age of the crop you need to cast the blockdata to Ageable (make sure to get the right import, there's two of them)

Lastly spawning an exp orb can be done with World#spawn passing in ExperienceOrb.class as the entity class

#

Alternatively you could jus give the xp directly to the player

#

I recommend you take a look around the javadoc and get familiar with how it works

#

?jd-s

undone axleBOT
crude zephyr
#

hmm ok

#

got this but im stuck

#

so uhh

chrome beacon
#

Right now's the time when the Javadoc is useful

crude zephyr
#

theres no crops

chrome beacon
#

If you look up the Tag class you can read about what methods are in it and what they do

#

Use the searchbar in the top right of the page

crude zephyr
#

ok

#

brb getting foof

#

food

crude zephyr
#

back

#

im very stupid

chrome beacon
#

Hm? That's not quite what you need to do

crude zephyr
#

i can tell
its red

#

still wrong

chrome beacon
#

A bit more than that

#

You want to check if the block that was broken is a crop

#

Tag.CROPS contains said crops so you need check of the block you broke is part of it

crude zephyr
#

ohh so find if its a crop first then see if its RIPE

chrome beacon
#

Yes

crude zephyr
#

im so fucking confused

chrome beacon
#

Not sure where you got that extra BlockBreakEvent from

crude zephyr
#

i was trying something

#

sorry

chrome beacon
#

Also you want to see if the tag contains the material of the broken block

#

Not if the type of crop is RIPE

crude zephyr
#

i cant fucking do this 😭

chrome beacon
#

RIPE is not a material it's a state that the crop can be in

crude zephyr
chrome beacon
#

Closer but not quite

#

You want the material of the block you broke

#

And see if that's part of the CROPS tag

#

Anyways I'm off to sleep now it's a bit late for me

crude zephyr
#

oh shoot

#

i know what to do

#

okay ima stop untill someone can help me
im very lost

#

ping me if ya can help

chrome beacon
#

You can start with something easier to get the logic down; like Scratch for example

#

After that I suggest looking at a couple Java tutorials

crude zephyr
#

the kids website?

chrome beacon
#

Yes

crude zephyr
#

i did scratch when i was 10 💀

#

its been a few years since ive been coding

#

hi loaf

chrome beacon
#

It is a useful tool to learn the logic required to break things down

cosmic elk
#

It goes over most of what youll deal with in java

crude zephyr
#

OH WAIT HOLD ON

#

I need to say If

cosmic elk
crude zephyr
#

i watch yt video

cosmic elk
#
                            then do this
                        }```
this is how if statments are structured, you need the () to hold what youre checking for, and usually {} for the code to execute
crude zephyr
#

omg i just broke my esc key

#

but i fixed it

#

im lost again

crude zephyr
#

"code looking stuff"

cosmic elk
cosmic elk
# crude zephyr

thats close but you dont need the do(spawn), because you put the code in the {} just like how the event itself has them that you put the code in as well

crude zephyr
#

oh right

#

theres no summon tag

cosmic elk
#

so its more like this

if (Tag.CROPS.isTagged(Material.WHEAT)) {
// code here
}

crude zephyr
#

like summon(entity)

#

oh i got { } mixed up with ;

cosmic elk
#

yes before you execute a method (a method is just code that can be exucted whenever you call it) you need an object

#

I think you need a world object

#

so you spawn the entity in the correct world

crude zephyr
#

im going to cry

#

do i need to do something with e

cosmic elk
#

yes you do, the event would allow you to return the block that broke, and therefor the location of it

#

here lemme write and example rq

crude zephyr
#

thanks

#

i need examples

#

thats how i learn

#

or so i was told

cosmic elk
# crude zephyr im going to cry

also dont worry if you dont get it right away Java is hard to learn for the first time, it took me a while to fully understand 😭

#
        // An object is usually not a literal object like how a block is or an item
        // Its more so a container that can hold data, like this
        String message = "broke a block!";
        // Even though of course it's not something actually in the world, Java understands this as an object
        // World, String, Player, are all different object types, and they hold different data and function differently

        Block brokenBlock = event.getBlock(); // This gets the block object from the event, or the block that was broken
        Location location = brokenBlock.getLocation(); // This gets the location of the block
        World world = location.getWorld(); // This gets the world the location is in (e.g. overworld, nether, end)

        world.spawnEntity(
                location, // This is where the entity will spawn
                EntityType.BAT // This is the type that will spawn
        );
    }```
#

to my understanding this should work

crude zephyr
#

so what you have put will summon a bat

cosmic elk
#

yes it should

#

ill check and see i always forget how to summon entities

crude zephyr
#

and Sting message = "Broke a block";
will say it in the console

#

so thats optinal

#

optional

cosmic elk
#

its just an example of an object and isnt refranced anywhere else in the code

#

so if you removed it nothing will change

crude zephyr
#

i copyed it in

#

but theres a red word

#

and also it wont check of it is fully grown right?

cosmic elk
cosmic elk
crude zephyr
#

oh yes change event to e

quaint mantle
#

Then it's e.getBlock()

crude zephyr
#

yee i did that

#

how check for fully grown crop

quaint mantle
#

Also why create a string if you aren't passing it? or are you passing it?

cosmic elk
quaint mantle
crude zephyr
#

not sure
it looks not important

cosmic elk
cosmic elk
#

youd need the BlockBreakEvent

quaint mantle
#
Ageable ageable = (Ageable) block.getBlockData();
if (ageable.getAge() == 7) {
}
#

Something like this

crude zephyr
#

why 7

quaint mantle
#

Cause crops are fully grown at 7

#

I think

crude zephyr
#

wouldnt it be RIPE

cosmic elk
cosmic elk
# crude zephyr

also that is deprecated, so it could be removed from the API soon

crude zephyr
#

oh ok

#

so it put together would be this?