#help-development

1 messages · Page 1943 of 1

tender shard
#

and just because optifine gives donors a cape isn't in any way bad for mojang

wet breach
#

there is damages and then there is restitution

tender shard
#

and what would be the result of such a lawsuit? that the judge says "okay you werent allowed to do that", and then?

wet breach
#

they would most likely be awarded restitution

tender shard
#

but yeah in USA it's probably very different

wet breach
#

restitution is basically a penalty but paid to whoever won

tender shard
#

I'd actually say that optifine made minecraft more popular

wet breach
#

So restitution is awarded where damages are not

tender shard
#

weird situation imho

young knoll
#

I’m still glad optifine is finally getting replaced

tender shard
young knoll
#

Why

#

It’s closed source

tender shard
#

I like optine. one click and it's installed, it works fine, it has a thousand more options than iris etc

young knoll
#

And doesn’t it use adfly garbage links too

tender shard
tender shard
wet breach
#

I don't use optifine 😛

eternal night
#

tbh starlight sodium combo is pretty unbeatable

tender shard
#

I don't use it too but if i'd actually play, I'd get optifine

young knoll
#

I generally don’t use anything because my game runs fine

wet breach
#

I just use the vanilla client

tender shard
young knoll
#

But the fabric options are better

#

Shaders suck for normal gameplay

tender shard
wet breach
#

use appropriate JVM arguments and generally good to go

young knoll
#

I’ve never found one that doesn’t make everything painful to look at

tender shard
#

but it just looks so awesome

hardy swan
#

sildurs

tender shard
young knoll
#

Oh you’re next to a sea lantern? You’re blind now

tender shard
hardy swan
tender shard
tender shard
hardy swan
#

oh..

young knoll
#

Sure but why is the default flashbang

tender shard
wet breach
#

never been a fan of shaders really

#

considering most don't work on my computer anyways

tender shard
#

shaders probably suck if you like pvp etc

#

but if you just wanna build a nice awesome city on top of a snowy mountain

#

then it's just a whole new level to have shaders

young knoll
#

Game doesn’t need to look super ultra hyper vibrant and realistic

wet breach
#

I don't like pvp. PVP is implemented in quite a dumb way that it makes it not very fun to do at all

hardy swan
#

beautiful ≠ realistic

tender shard
hardy swan
#

it does look better tbh

wet breach
#

well, shaders do no good if you can't use them to begin with 😛

tender shard
#

yeah my macbook would explode

wet breach
#

the extensions required in most shaders simply don't exist for me

tender shard
#

if I ever want to become a terrorist, I just board an international flight and then run minecraft with shaders midflight on my macbook

wet breach
#

so it isn't that my client would lag just outright wouldn't run XD

wet breach
young knoll
#

Fabric

tender shard
wet breach
#

lol, laptops don't have that much explosive power

hardy swan
#

it will explode and kill everyone in render distance

tender shard
#

mine almost explodes just by running 2 MC instances without shaders

wet breach
#

source? because 50 meters is quite a distance and I only know of a few things with that much explosive power and they are not batteries lmao

hardy swan
#

figurative language

young knoll
#

I can’t tell if you are missing the joke

#

Or also making a joke

tender shard
#

I don't have a source because my battery always died before it could unleash its power

young knoll
#

Your battery is an anime protagonist

tender shard
#

you know, macbooks not only explode with a 50 meter radius, they also are empty within 7 minutes

tender shard
young knoll
#

I don’t understand why laptops keep getting more storage space

#

Do you know how heavy they will get once you fill a 1TB hard drive

tender shard
#

lol exactly

#

aint nobody's biceps be able to carry a whole terabyte of hentai

#

oh shit almost 6.30 am

wet breach
tender shard
#

imagine how heavy 8gb must be

wet breach
#

I mean technically you would have to imagine it because we don't have measuring devices to weigh at such fine levels. I mean we do, but you are not going to be able to afford such things lol

tender shard
#

I wonder, if a bag is too heavy for a flight (limit here is usually 23kg or you have to pay extra)... why not just fill it with some helium

wet breach
#

well, helium is flammable first off and second it is a gas

young knoll
#

Airplanes are already completely filled with helium, that’s how they fly, no room for any more

wet breach
#

not sure how other countries will treat that, but in the US you won't get very far with that 😛

tender shard
#

helium isn't flammable

#

and o2 is a gas too

young knoll
#

Hydrogen works too

wet breach
#

ah right was thinking of hydrogen

young knoll
#

Makes a great zeppelin

wet breach
#

carry on

tender shard
#

I know that because I had a helium tank at home for 2 years lol

#

a friend brought it once and then it was left here for 2 years until I just dumped it outside in the night

wet breach
tender shard
#

i dont know

#

noone ever brought any hydrogen tanks to my place

wet breach
#

I mean technically you can have gas tanks of almost any kind in the US

tender shard
#

what I do know is that you are not allowed to use your garage for stuff other than to put a car inside

young knoll
#

What about a tank of sarin nerve gas

#

For recreational purposes only, of course

tender shard
#

that's perfectly fine, you can buy it at any supermarket

wet breach
tender shard
#

the reason is that building permits for garages are only valid for "garages" and a garage is a place to store a vehicle

#

if you want to do other stuff you must not declare it a garage

#

and then it's harder to get a building permit

young knoll
#

Can I store a tank

wet breach
#

in the US we tend to put a bunch of stuff in Garages other then vehicles 😂

tender shard
#

I doubt anyone would mind but e.g. if you only put a billard table inside, that's technically not allowed

wet breach
#

if everyone does that, then you would think they would update their building code stuff to match what people already do with it

young knoll
#

Does it specify only certain types of vehicles

tender shard
#

I once read a lawyers opinion on garages and they saw

#

"it should probably be fine as long as a car still fits inside"

tender shard
wet breach
#

can't argue with that assessment

young knoll
#

Good, I need a place to store my b-52 bomber

tender shard
wet breach
#

what is considered abusing your garage?

young knoll
#

Slapping it

wet breach
#

like hitting it or something? lol

#

sapping it of what? electricity ? lmao

tender shard
#

nah as said, putting so much other stuff inside that a vehicle doesn't fit there anymore 😄

#

but one could argue that a bicycle still fits inside and bicycles are vehicles

young knoll
#

Does it have to be a real car

wet breach
young knoll
#

What about a nice toy car

tender shard
tender shard
wet breach
#

have you seen toy cars?

#

well the ones in the US can actually take you like 5-10 miles

tender shard
#

oh if you talk stuff like bobby cars... hm

#

technically even a bobby car would be a vehicle

young knoll
#

Oh yeah those exist

tender shard
#

to find out, just get a bobby car and drive around it while being black out drunk

young knoll
#

I was planning to drive my hotwheels to work

tender shard
#

if police now fines you for drunk driving, at least you can claim it's a vehicle if you get the 500€ garage fine

#

so it's a win win

#

either you can blackout drunk drive a bobby car or you can use it to cheat on the garage permit

young knoll
tender shard
#

we are all called HEINRICH

young knoll
#

I can bring my own

tender shard
#

lol

#

sure

#

that will do

#

"bring your own bobby to work"-day

young knoll
#

BYOB

#

Bring your own Bobby

tender shard
hexed hatch
#

What a nice family

tender shard
#

and the photos were only 250$

young knoll
#

PS1 faces on PS5 bodies

tender shard
#

what a bargain

#

the phographer must have been trolling for free PR

young knoll
#

Either way, they got their free PR

wet breach
# young knoll I was planning to drive my hotwheels to work
quaint mantle
#

with mp3 damn!

tender shard
#

wtf it's 673 GBP

#

you can get a real car for that price

young knoll
#

Lol the review

tender shard
#

😄

#

yeah but

#

if you order a red bmw and get a white range rover

young knoll
#

I hate it when my white Range Rover turns out to be a red BMW

tender shard
#

oh other way around

#

poor o. Al-Helli

neon nymph
#
onPlayerJoin returns non-void type boolean. This is unsupported behavior and will no longer work in a future version of Paper.
```Ello and good day, what is a non-void type boolean and how would I go aboutt patching this?
neon nymph
#

Oh

#

The event handler itself as void?

tender shard
#
public void onJoin(PlayerJoinEvent event) // ok

public boolean onJoin(PlayerJoinEvent event) // works but not good
young knoll
#

Yes

neon nymph
#

Got it

#

Thenks

minor otter
#

are there any other good ways to make foliage like custom blocks other than tripwire?

minor otter
tender shard
#

I don't understand

fringe mortar
#

Am I supposed to be using getSerializable for deserializing a yaml config to a class.

minor otter
#

grass, flowers, plants

wet breach
young knoll
#

Tripwire has a bunch of states you can remodel

#

Into grass and flower and whatnot

tender shard
minor otter
#

I just would rather not use tripwire if there is a better way

young knoll
tender shard
wet breach
young knoll
#

I can’t think of any better block to use

tender shard
minor otter
#

dang, alright

#

thanks for answering

tender shard
#

most popular plugins use mushroom blocks or noteblocks for custom textured blocks

#

never heard of tripwire being used for this

#

(with most popular i mean itemsadder, oraxen etc)

minor otter
#

I use mushroom blocks but you dont want to use them for anything smaller than a block

fringe mortar
tender shard
young knoll
#

Tripwire is passible

#

What

tender shard
minor otter
#

no collision and it wont turn let you see through the ground

tender shard
#

ConfigurationSErialization.register or sth

fringe mortar
minor otter
#

I think I actually just came up with a idea to replace it

young knoll
#

Do share

tender shard
fringe mortar
tender shard
sullen marlin
#

Idk what that syntax is, double check the docs

minor otter
#

I think im gonna use custom blocks on the ground for this specific situation with the x model above them using blockbench, then put a structure void there or something that wont interfere with the player but I can test for using the player interact event

#

only really works for my specific situation

sullen marlin
#

Just get() definitely works

#

Assuming you implement Serializable and have a deserialize method or construct

worldly ingot
#

Don't think it's generic though. getSerializable() returns T

fringe mortar
#
items:
  ruby:
    display-name: "Ruby"
    type: "basic"
ConfigItem configItem = getConfig().getSerializable("items.ruby", ConfigItem.class);
getLogger().info(configItem.displayName);
sullen marlin
#

Registration is only necessary if you want an alias I think

sullen marlin
tender shard
sullen marlin
#

They need an == with the class

#

If you want it to look like that you need to deserialise yourself

tender shard
#

yeah it must look like this

#
deathCause:
  ==: de.jeff_media.angelchest.data.DeathCause
  damageCause: VOID
  killer: null
sullen marlin
tender shard
#

md I wonder

#

why is == even needed if getSerializable() takes a Class object anyway

tender shard
#

I guess that ==: "your.class.name" tells bukkit which classes' deserialize() method to call

#

if you want to get rid of the need for the ==: your.class.name part, you have to write a method that simply takes a configurationsection and does the same thing as your current deserialize method, and then do stuff like

MyClassObject myThing = MyClassObject.deserializeFromConfigurationSectionOrHowEverYouWantToCallThisMethod(config.get("path-to-your-section"));
fringe mortar
#

Yeah thats what I was doing before but it seemed like an out of the way method

#

Guess not

tender shard
#

if you want your stuff configured by humans, go for the "own method" way

#

if you just want to store data that isn't meant to be changed, use the ConfigurationSerializable

#

because most admins will be confused by the ==: part

quaint mantle
#

how to share variable to other file? public and static dont works (noob in java)

chrome beacon
#

?learnjava Pro tip read one or more of these

undone axleBOT
tardy delta
#

Getter

alpine urchin
#

?learnspigot

warm light
#

java.lang.NoClassDefFoundError: org/json/JSONObject
how to fix it?

quasi flint
#

u shaded it in

#

or provided

warm light
#

what I need to do?

#

nvm fixed

quasi flint
#

how tho? so other people can fix

frosty tinsel
#

oh

#

I somehow made it

#

but would like to hear how's it done correctly anyway

analog hinge
#

hello I just finished updating a plugin I was making to add new features
My plugin's name is StonecutterWoodRecipes but the actual jar file after compilation is always marked as StonecutterWoodRecipes-1.0.jar
I'd like to change the naming convention for it to say StonecutterWoodRecipes _1.1.0_1.18.1.jar is that possible without creating a new project?
I'd prefer not to create a new project as my plugin folder is already a git repo and I'm doing version control with that

#

here's my project tree if that helps to illustrate my point

buoyant viper
#

u can just like change the version field in pom.xml

#

i think

analog hinge
#

oh...

#

I already checked but I didn't see it
checked again rn and yeah found it thanks

tidal skiff
#

do yall know when a mob/player turns red and theyre invincible for that period

#

is there a way to change how long that period is

quaint mantle
#

why

 @EventHandler
    public void onItemPick(EntityPickupItemEvent e) {
  e.getEntity().sendMessage(e.getEntityType().toString());
}
``` is not giving any output
tidal skiff
#

maybe cast e.getEntity() to a player object

quaint mantle
#

still not works

tidal skiff
#

and check if its an instance of a player first

hollow bluff
#

Did u register the event?

quaint mantle
#

it wont even call

#

yes i did

#

other events in the class works

tidal skiff
#

r u implementing listener in the class

quaint mantle
tidal skiff
#

oh

quaint mantle
#

if the event is not working should i work with netty and packet listening ?

quasi flint
#

no god no

#

u will break more than fix

tidal skiff
#

how do i check if an item has an itemmeta but ignore its durability

#

without making it unbreakable

hybrid spoke
#

just call #hasItemMeta

tidal skiff
#

bad wording

#

check if its item meta is equal to another items item meta

#

cuz its a sword

#

and u use a sword

#

and its item meta is apparently different when it has a different durability

#

its fine i fixed it

hybrid spoke
#

why would you compare ItemMetas anyways

tidal skiff
#

to check if its the custom item im trying to use

#

i have an items class with all the custom items in the plugin

hybrid spoke
#

?pdc

tidal skiff
#

and im comparing if the item the player is using is the same to the item in the items class

vocal cloud
#

That's not even his issue. And if it was just use player pickup event

quaint mantle
#

i done it, didnt work

quaint mantle
#

i done another thing not related to drops

#

i ignored the drops

#

nvm

tidal skiff
#

guys i might be a fucking idiot but i need help with a concurrent modification exception

#

so i have this arraylist that im modifying every tick for every item in that array list

#

it has a constructor with a player an int a location and another location

#

basically every tick im making that int go down by 1

#

but when theres multiple things in that list at once it does the concurrent modification exception

#

when theres multiple things in that list at once basically when 2 players have fired this custom weapon at once

vocal cloud
#

How about showing the code and the error

tidal skiff
#

soz for shitty code lol

#

im gonna try changing the lists AFTER the for loop

#

cuz i read that u cant modify it in the for loop itself

vocal cloud
#

If you're just removing use removeif

tidal skiff
#

how do i do i use removeif for my contructor

#

nvm

#

i still dont think thats gonna help

#

with the concurrent modification exception

vocal cloud
#

Do you know why a concurrent modification exception is normally thrown

tidal skiff
#

not really know

#

no

#

why is it

tidal skiff
#

ive read that

vocal cloud
#

````Note that this exception does not always indicate that an object has been concurrently modified by a different thread. If a single thread issues a sequence of method invocations that violates the contract of an object, the object may throw this exception. For example, if a thread modifies a collection directly while it is iterating over the collection with a fail-fast iterator, the iterator will throw this exception.```

tidal skiff
#

what IS thread safe

wet breach
#

Collections.synchronizedList(new ArrayList<YourClassNameHere>())

#

you need to have it synchronized so that no matter what thread is modifying it only one thread at a time will be able to do so

tidal skiff
wet breach
#

I wonder if it got changed or moved

#

nope it didn't change

#

Collections.synchronizedList is a static call

#

shouldn't need to assign it as an object value to make use of it, they probably just didn't import it

tidal skiff
#

i did

wet breach
#

but yeah if you need an object for it

#

do what Okay said

tidal skiff
#

ok lets see if this works

wet breach
#

well it is the only thing I could see that would throw CME right away

#

other then some of the API not being thread safe

tidal skiff
#

can someone join my server lol so i can test

#

my friend just got off

wet breach
#

why can't you test?

#

o.O

tidal skiff
#

its for when 2 people r using it at once

#

thats when the error happens

wet breach
#

just use offline mode and log another client in

tidal skiff
#

i dont have another account

wet breach
#

don't need another account for offline mode

#

one of the acceptable uses of offlinemode 🙂

tidal skiff
#

how do i enable offline mode

#

for the other client

wet breach
#

client doesn't care, but generally need a modded client to change the name

tidal skiff
#

no im saying how do i make the other client be offline

#

if thats what u meant

wet breach
#

the client itself doesn't need to be offline, but to use a client without logging in like that you need to use a modded client

#

vanilla client doesn't allow changing the player name for offline mode which is technically just singleplayer mode according to the client

tidal skiff
#

i dont have that 😭

#

ill just ask someone in general

wet breach
#

lol

warm light
#

EventPriority.LOWEST means event will do its work first?

tidal skiff
#

Also just a Java question

#

Does break;ing out of a for each loop break it out and cancel it for every other item in the list

tidal skiff
sullen marlin
#

First, read the docs

#

?jd

warm light
#

ok ._.

warm light
hardy swan
tidal skiff
#

which breaks out of the iteration its in and goes to the next

hardy swan
#

but you also can't continue in a foreach loop

tidal skiff
#

how and why not

ivory sleet
tidal skiff
#

cuz thts dumb

hardy swan
#

foreach isn't a loop

ivory sleet
#

it is?

tidal skiff
#

well how do i end the iteration then

hardy swan
#

unless you are talking about
for (Integer i : lst)

tidal skiff
#

i am

ivory sleet
#

Yeah

tidal skiff
#

talking about that

ivory sleet
#

That one

#

The higher ordered function forEach isn’t a pure loop but ye

hardy swan
#

ah ok

coarse shadow
#

can we cast getEnchantments as enchantment class?

wet breach
hardy swan
#

i know

#

i mean i know you can break out of it

wet breach
hardy swan
#

i was referring to .forEach() of Iterables

#

well, it is a loop but the function you passed into it isn't

#

so I'm also wrong in that

wet breach
#

well it is an iterable foreach and not quite the same as an enhanced for loop lol

hardy swan
#

yes

wet breach
#

it is also not a replacement for such either if some think it might be 😛

#

two advantages I know of that the iterable foreach is good for is atomically iterating over a synchronized list and parallel execution

terse ore
#

How can I get player's held item with PlayerInteractEvent?

primal vector
#

these 3 ways that I know of

wet breach
#

?jd

coarse shadow
#

Enchantment ench = (Enchantment) Objects.requireNonNull(e.getView().getItem(16).getItemMeta()).getEnchants();

#

why this code produces error on my server

terse ore
#

I was trying to see if I was doing smt wrong

analog hinge
#

I have a plugin that makes wood recipes for the stonecutter since there's no woodmill block
The plugin works just fine and the recipes are loaded correctly
my only problem is when the /reload spigot command is executed it somehow breaks my plugin and no recipes show for wood blocks afterwards
before reload:

terse ore
#

and it was that

analog hinge
#

after reload:

wet breach
analog hinge
#

i guess the server doesn't send the custom recipes I made when I reload.
does somebody know how to change that behavior?

eternal oxide
#

If you /reload you have to get all online players and expose the recipes to them

analog hinge
#

alright so how would you go about this?
I just don't know how to "expose" recipes

eternal oxide
#

same as you do when you register them

#

I forget the method

analog hinge
#

does that have to do with it?

plugin.getServer().addRecipe(new StonecuttingRecipe(new NamespacedKey(plugin, resultMaterialKey), new ItemStack(result, amount), source));
analog hinge
#

alright thanks and also is there something like a onReload method that I have to Override ?

#

i guess i dont really understand how the /reload command behaves

eternal oxide
#

no, in onLoad ( if (Bukkit.getWorlds().isEmpty()) reload = false)

#

then in your onEnable check your reload value

terse ore
#

i've tried with these:

#

event.getItem()

#

player.getItemInUse()

#

I am trying to detect right click

eternal oxide
#

how about event.getHand() ?

terse ore
#

and if item is x i do smt

terse ore
eternal oxide
#

getAction

#

if (event.getAction() == RIGHT_CLICK_BLOCK)

terse ore
#

nono

#

that I already did it

#

the issue is with detecting the item

eternal oxide
#

thats not what you asked

eternal oxide
#

you didn;t ask that in teh last few minutes

terse ore
#

nvm leave that

#

How do I get player's held item in that event

warm light
#

Is there anyway to auto update config.yml?

eternal oxide
#

if (event.hasItem()) event.getItem()

terse ore
#

saveConfig() ?

warm light
#

like I added something new in next version of my plugin's config.yml. and when user put update jar in server, it will add/edit new key in config.yml

eternal oxide
#

set copyDefaults(true) then set your new config as default

wet breach
#

do you just want to replace the file?

#

or do you actually want to update the contents of the file without wiping away user settings

warm light
#

keep old key values and add new keys

wet breach
#

get all the configuration settings, set the old ones to null

#

then set new options then save

#

setting a configuration or a configuration section to null, removes it from the config

eternal oxide
#

if you are not removing entries my method is correct

wet breach
warm light
#

ok thanks

wet breach
#

the link I gave you actually deals with 2 files

#

moves data from config.yml to data.yml but the concept still applies for what you are wanting

vapid vale
#

Hey I had a question with Maven. I am using the Maven Source Plugin in order to create a sources jar. However, I am using Maven Modules to compile multiple modules into one (working with NMS so made an adapter). I was wondering if there was a way to automatically shade all the sources into the same sources jar.

tender shard
#

erm sorry I meant root module

vapid vale
#

Thats the issue, it creates source files for every module seperatly

#

but it does not combine them all into one big source file

#

source jar*

tender shard
#

hm right, I also just noticed

#

i'll take a look at the sourc plugin, maybe there's some option

#

mvn javadoc:aggregate

#

erm

#

source: not javadoc

#

try that on your root pom

#

works for me. the NMS stuff are submodules and the rest is the core submodule, and this is the result of mvn source:aggregate on the root pom

#

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>aggregate-jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>aggregate</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <excludes>
                        <exclude>com.allatori.annotations.**</exclude>
                    </excludes>
                    <includePom>true</includePom>
                </configuration>
            </plugin>
wet breach
#

you need to create a module where the last step is essentially to shade everything

tender shard
#

I hate how windows disallows to delete opened files

vocal cloud
#

Linux has a if you want it gone you want it gone attitude

tender shard
wet breach
#

explorer.exe is a process that for the most part lets you see directories and files in a visual manner. When you right click to delete a file that is opened by another process, explorer.exe essentially does not have the permission to delete it

#

you can if you really wanted to, forcefully delete files that are opened

tardy delta
#

taskkill /F /IM explorer.exe
kekw

#

aways funny

sharp flare
grim ice
#

hey um

#

what if the 2 plugins depend on Library A

#

Library A latest version is x

#

first plugin, depends on the library a with version y
second plugin depends on the library with version x

#

will there be an error?

kind hatch
#

Depends on what changed in between versions.

grim ice
#

not so much

midnight shore
#

Hi guys! I have an inventory with some custom items, i wanted to make this items to update And get the right item meta from the plugin and set it back to the right position in the inventory, so if i modify a custom item, a user that has already that item will get the new version of it

primal vector
#

how do I use launchProjectile()? what am I suppose to put for Class<? extends T> projectile

lapis widget
primal vector
#

oh

#

ty

worldly ingot
#

Sheep implements Colorable so you can call sheep.setColor()

#

World#spawn() can either accept a Consumer<T> (where T is the sheep) or will return the entity as well you can call methods on

#
world.spawn(location, Sheep.class, sheep -> sheep.setColor(DyeColor.RED));```
static siren
#

ok ty

mortal hare
#

yay

#

my nbt serialization works!

quaint mantle
#

nice

#

mind spoon feed me

mortal hare
#

i need to fix things a bit

#

it a bit ugly rn

quaint mantle
#

oh and can you deserialize them afterwards

mortal hare
#

yes

#

it returns Map<String, Object>

#

you put this inside set method inside ConfigurationSection

#

you can output this in either json or yaml

quaint mantle
#

your own library or someone else library with some modific

mortal hare
#

my own

#

there are only two methods

#

it depends on NMS

quaint mantle
#

so does that use any of the default bukkit config sys

mortal hare
#

no it doesn't

#

it just returns Map

quaint mantle
#

okay nice then

#

then default bukkit config sys will serialize

mortal hare
#

it only depends on NMS NBT Tags

quaint mantle
#

1.18+ or what

mortal hare
#

im running this on 1.18 it should work on older versions tho if the fields would be mapped to obfuscated ones

#

you can add your own custom nbt tags inside config too

#

and im pretty sure this would work on entities too

tardy delta
#

is there a way to get the timezone of the player?

mortal hare
#

dont think so

#

well

quaint mantle
#

rce exploit

mortal hare
#

maybe

#

if you use geoip

#

you can get IP location of origin country

#

and by country get the timezone of the player

quaint mantle
#

vpn momento

mortal hare
#

that's not his problem

tardy delta
#

i was wondering how some servers display their time in the players timezone

mortal hare
#

geoip

#

im pretty sure

tardy delta
#

check some event

#

inv click i guess

#

compare the meta

#

and set it back when neccesary?

midnight shore
#

but the question is how do i set an item back to its original position?

#

like, i can simply add it but that will not count the order and its ugly

tardy delta
#

you want to set it on its original position?

#

idk what you mean with original position

midnight shore
#

i can get the contents of the inventory but when i modify an itemstack how do i know where it was in the original inventory?

midnight shore
maiden briar
#

In this example I am getting the values the closest to 6 ordered (rank). 3 is the closest one to 6. I only want the rows with the closest value visible. So that means I only want rows visible with rank 3 here

#
SELECT *, FIND_IN_SET(rating, (SELECT GROUP_CONCAT(DISTINCT rating ORDER BY rating DESC) FROM currentseasonratings WHERE ranked = 1)) AS rank FROM currentseasonratings WHERE ranked = 1 HAVING rank BETWEEN 1 AND 10 ORDER BY ABS(rank - 6);
vocal cloud
#

Jeez that is something

maiden briar
#

I know

#

Something like, HAVING rank CLOSEST BY <value>

static siren
#

I want to make a plugin that makes every sheep a jeb____ sheep. For some reason the sheep does not change color but has the jeb_ nametag. I have also tried to keep changing the color in a while true loop but then my server crashes. Is there another solution?

chilly haven
#

is it possible to check when a player right clicks while holding a item what item it is?

mortal hare
spiral light
#

while true loop O.o

#

you cant block the main thread and also its not good to make stuff like that for every sheep

#

on entityspawnevent you can set the name to jeb__; if this is not working you might test a bit

tardy delta
#

then check the player's held item (which may be null)

chilly haven
tardy delta
#

do you know how to work with events?

chilly haven
#

ye

tardy delta
#

then you know how to listen for the PlayerInteractEvent right?

static siren
#

and what if I check the position of a new sheep that spawned, then kill the sheep place a dispenser with an sheep egg named jeb_ then place a redstone block next to it and then delete the two blocks

#

would you be able to see the two blocks?

chilly haven
tardy delta
#
@EventHandler
public void onInteract(PlayerInteractEvent event) {
  if (event.getAction() == Action.RIGHT_CLICK_BLOCK || event.getAction() == Action.RIGHT_CLICK_AIR) {
  ItemStack heldItem = event.getPlayer().getInventory().getItemInMainHand();
// do your checks here
  }
}```
#

basically it

chilly haven
#

o haha i am stupid i should v know to check the inventory

#

MY bad

tardy delta
#

are you dutch?

chilly haven
#

yea

sage dragon
#

Hey!

Is there literally any way to check if a player opened his own inventory?

InventoryOpenEvent doesn't fire if a player opens his own inventory...

chilly haven
#

you?

ivory sleet
#

yeah, the PlayerInventory is in principle always open, or well, it does not possess the notion of open/closed state

tardy delta
#

im too

sage dragon
# chilly haven What u need it for?

I want to make an ItemStack unlimited.
So... If the player drops it, it should copy it and put it back in the cursor.

It works fine as long as the player doesn't drop items while viewing his inventory

sage dragon
tardy delta
#

formally is with two l's lol

chilly haven
#

shhh

#

it is now

#

with two ll

sage dragon
#

Well, I want to put it back into the player's cursor if he picked it up.

But I just found a way...

I can just use the InventoryClickEvent \o/

foggy estuary
#

does ArmorEquipEvent. not exist anyone or something...?

delicate lynx
#

I don't think it ever existed in the API

#

people created it externally

foggy estuary
#

It's third party event

#

Yeah i just realise

#

d

#

thanks

sturdy ivy
#

How to cancel seeds drop?

late sonnet
#

Not sure if destroy block event can get when seed its dropped but you can try this

sturdy ivy
#

I just want to paste terrain with block.setType();

#

And these seeds are getting dropped.

maiden thicket
#

probably blockphysicsevent?

#

or blockfromtoevent or smthn like that

daring lark
#

My customRecipe don't work.
this is my code, what is wrong?

public class CustomTools {

public ItemStack createLifeStealSword() {
    ItemStack item = new ItemStack(Material.DIAMOND_SWORD);
    ItemMeta meta = item.getItemMeta();
    meta.setCustomModelData(1111);
    meta.setDisplayName(ChatColor.GOLD + "Life steal sword");
    item.setItemMeta(meta);
    return item;
}
public ShapedRecipe recipeLifeStealSword() {
    ItemStack item = createLifeStealSword();
    ShapedRecipe recipe = new ShapedRecipe(NamespacedKey.minecraft("lifeStealSword"), item);
    recipe.shape("DSD"
                ,"DND"
                ,"DPD");
    recipe.setIngredient('D', Material.DIAMOND);
    recipe.setIngredient('S', Material.NETHER_STAR);
    recipe.setIngredient('N', Material.NETHERITE_SWORD);
    recipe.setIngredient('P', Material.SPECTRAL_ARROW);
    return recipe;
}

}

Main class Method i use:

Bukkit.getServer().addRecipe(customTools.recipeLifeStealSword());

ivory sleet
#

I think the client might just not send a packet upon opening the inv possible?

undone axleBOT
maiden thicket
#

what is the error

#

ur having

#

when are you adding the recipe? onenable?

daring lark
#

it's just don't read that recipe exist

maiden thicket
#

are you adding the recipe onEnable?

daring lark
#

yes

maiden thicket
#

are there any errors on start up

daring lark
#

no

maiden thicket
#

show me ur onenable por favor

daring lark
#

i used this method in onEnable

Bukkit.getServer().addRecipe(customTools.recipeLifeStealSword());

wild reef
#

Hey quick question about yaml.
Uhm I wanted to use curly braces as a place where you can put an variable in. But as I saw curly braces do a parser error. So what do I use instead when using yaml or how can I make the curly braces pass the parser?
My example: ```yaml
message-format: You recieved a message from {sender}

ivory sleet
#
message-format: "You recieved a message from {sender}"
message-format: 'You recieved a message from {sender}'
wild reef
#

really didn't thought about just making a string out of it, I'm stupid xd

ivory sleet
#

Yeah its interesting because JSON is a subset of YAML, and since {} in JSON denotes a mapping value , it will even be valid in YAML hence why you get a format issue there.

#

lol ye

wild reef
#

thanks for the quick answer

tardy delta
#

whats the best way to translate milliseconds into a readable date and time?

naive bolt
#

do i need to manually replace the &a with the §a ?

buoyant viper
#

u can use ChatColor.translateAlternateColorCode or whatever its called

tardy delta
#

^^ with params ('&', the text you want to colorize)

naive bolt
#

k

quartz valve
#

Can anyone help me? I never used JSON

String str = "{ \"name\": \"Alice\", \"age\": 20 }";
JSONObject obj = new JSONObject(str);
String n = obj.getString("name");
int a = obj.getInt("age");
System.out.println(n + " " + a);  // prints "Alice 20"

getInt, getString and JSONObject(str) is underlined

buoyant viper
#

code looks like its doing what its supposed to

#

?ask

undone axleBOT
#

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

tardy delta
#

what does it say when you hover over it with your mouse?

quartz valve
#

and required type map

buoyant viper
#

do u have json added as a dependency

elfin atlas
#

Question. How I'm able to check if a block is in the range of 50 blocks from a location?

tardy delta
#

which JSONObject class are you using?

buoyant viper
#

looks like they're using the org.json:json one

tardy delta
#

i never know which one to use lol

ivory sleet
#

or if its called SimpleDateFormat idr

#

there is sth else also

tardy delta
#

something with a calendar?

#

saw this on stackoverflow

ivory sleet
#

m perhaps

maiden thicket
#

well if u use localdatetime

#

and ur looking at a milli long

ivory sleet
#

btw fourteen

#

u can use Instant also

maiden thicket
#

i think its instant.fromepochmilli

ivory sleet
#

ye

maiden thicket
#

or ofEpochMilli

#

and LocalDateTime.from

ivory sleet
#

and then grab whatever date instance whether its offset or zoned

tardy delta
#

i have a long which stores the epoch time when the player joined for the first time available

maiden thicket
#

LocalDateTime.from(Instant.ofEpochMilli(long milliseconds), ZoneId.systemDefault().getRules().getOffset(Instant.now()));

#

i think

modest garnet
#

is it possible to create an event within an event

tardy delta
#

the system default would be from the server right? not the client

#

ye

maiden thicket
#

bro i was getting yelled at the other day for switching Date objects in a small side project to LocalDateTime

#

💀

elfin atlas
#

Question. How I'm able to check if a Player is in the range of 50 blocks from a location?

tardy delta
#

lemme just not worry about that lol

maiden thicket
ivory sleet
maiden thicket
tardy delta
#

good old Date

maiden thicket
#

i believe localdatetime is more modern

#

than date

tardy delta
#

ye

maiden thicket
#

its prolly more recommended to use idk

tardy delta
#

wouldnt do anything if you dont listen for it tho

modest garnet
#

amazing ty

ivory sleet
#

yeah taahanis it is

#

actually nvm what I said

#

its just immensely hard navigating all the time related utility classes since they're so spread out

sturdy ivy
#

Do you guys have better idea of serializing minecraft blocks?

 public static String[] getStructure(Block block, Block block2) {
        long time = System.currentTimeMillis();
        int minX = Math.min(block.getX(), block2.getX());
        int minZ = Math.min(block.getZ(), block2.getZ());
        int minY = Math.min(block.getY(), block2.getY());
        int maxX = Math.max(block.getX(), block2.getX());
        int maxZ = Math.max(block.getZ(), block2.getZ());
        int maxY = Math.max(block.getY(), block2.getY());
        List<String> blocks = new ArrayList<>();
        for (int x = minX; x <= maxX; x++) {
            for (int y = minY; y <= maxY; ++y) {
                for (int z = minZ; z <= maxZ; z++) {
                    Block b = block.getWorld().getBlockAt(x, y, z);
                        if (VirtualRealty.legacyVersion) {
                            blocks.add(x - minX + ";" + (y - minY) + ";" + (z - minZ) + ";" + b.getType().getId() + ";" + b.getData());
                        } else {
                            blocks.add(x - minX + ";" + (y - minY) + ";" + (z - minZ) + ";" + b.getBlockData().getAsString().substring(10));
                    }
                }
            }
        }
        VirtualRealty.debug("Got and serialized blocks in: " + (System.currentTimeMillis() - time) + " ms");
        return blocks.toArray(new String[0]);
    }
tardy delta
#

we got the bible ladies and gentlemen

tardy delta
#

even static holy shit

ivory sleet
#

I mean serialization is ugly

#

and gross

sturdy ivy
#

Ik

ivory sleet
#

so by all means, static isn't probably abused here

tardy delta
#

i like the debug :)

#

thats me

ivory sleet
#

altho a singleton serializer might be more object oriented

#

debug?

#

ye

tardy delta
#

VirtualRealty.debug("Got and serialized blocks in: " + (System.currentTimeMillis() - time) + " ms");

ivory sleet
#

just me being blind as usual

sturdy ivy
#

what's wrong with that?

tardy delta
#

thats me when i startup my plugin

#

nothing

ivory sleet
#

plytki

#

may I ask

sturdy ivy
#

?

ivory sleet
#

is it crucial to store information for every block within the two given blocks

#

because, a lot of stuff can go wrong on the way

sturdy ivy
#

What do you mean?

ivory sleet
#

the data you serialize will be hard to keep up-to-date concerning that the data of the blocks in the server instance itself can change at any given time

#

thus usually, when storing data, we only store absolute key and necessary data

#

hence why for example worldguard stores the minimum point, and maximum point of a region merely

sturdy ivy
#

I'm serializing blocks and then recovering region.

#

"/

#

When necessary

ivory sleet
#

oh in that case probably fine

#

tho if you can

#

avoid the string there, create some sort of pojo representing given data, then serialize and deserialize that directly into a file or whatever other database you may have

sturdy ivy
#

How do I do that?

#

Create an object with necessary data and serialize object?

#

I mean list of objects, right?

maiden thicket
#

cant u just serialize the block into bytes and just unserialize it

tardy delta
#

create a class with fields you want to store

charred blaze
#

hi

tardy delta
#

sometimes my brain goes brr

charred blaze
#

is it possible to detect "L" key press ?

naive bolt
#

if i want no join message do i just set join msg to ""

ivory sleet
#

set it to null in the PlayerJoinEvent iirc

tardy delta
#

but i saw thing which detect it

charred blaze
#

i know it sending "f" key event

charred blaze
ivory sleet
#

no sadly the client does not send every key pressed to the server

tardy delta
#

hijack the client or something

ivory sleet
#

so pretty sure L won't work unless you give the user a special client

charred blaze
#

which keys server detects

ivory sleet
#

really none

charred blaze
#

i know

ivory sleet
#

but it detects for stuff like F

charred blaze
#

F

ivory sleet
#

but thats just due to you having your keybind set to F

charred blaze
#

yes

ivory sleet
#

the client tells the servers about actions rather than individual key-press actions

kind hatch
#

It’ll detect the input, but not the key. You can change your keybinds.

charred blaze
#

one person is telling me he can detect any keys (without any specific client)

#

is it possible?

ivory sleet
#

that's full on mega cap

kind hatch
#

I mean, probably/

ivory sleet
#

at least from server point of view

tardy delta
kind hatch
#

If you never change your keybinds, then it’s pretty easy to assume what keys are pressed. But you can’t get anything past that.

charred blaze
ivory sleet
#

no not rly

#

you have to modify the client essentially

charred blaze
#

lemme check if he is liar or not

modest garnet
#

how could i return multiple things from a event not just one

charred blaze
#

ill change swap item control key

#

lets see what happens

ivory sleet
#

generally methods either return void (nothing), or a single object which must conform to the given type the method promises to return

tardy delta
#

isnt he talking about using the right constructor?

ivory sleet
#

no clue lol

modest garnet
ivory sleet
#

oof

#

well

tardy delta
#

uhh

#

is your brain hurting too?

ivory sleet
#

you could mark the arrow (using sth like pdc or metadata values) in ESBE and then in PHE ensure the projectile is correctly marked, then continue logic there x)

sturdy ivy
#

Can I serialize list of objects?

ivory sleet
#

yes

#

yes

naive bolt
#

it is still sending the custom message

tardy delta
#

atom theme

ivory sleet
#

debug your logic inside those if statements

tardy delta
#

also ?di

#

?di also

undone axleBOT
tardy delta
#

:}

naive bolt
#

ik ive been told

#

but it doesnt matter for plugins that are small

tardy delta
#

you're the first one i see using static event methods lol

#

doesnt matter in fact but yea :)

naive bolt
#

when i change a value in config.yml and then save it reverts to default

#

wait im dumb

mortal hare
#

does anyone know what bukkit configuration api returns from YAML? primitive arrays or lists impl?

wary harness
#

will this give some new options to spigot api?

karmic grove
#

whats the best way to have a timer for a combat log

mortal hare
#

aren't we have already namespaces for registries

spiral light
wary harness
mortal hare
#

oh

#

now i see what are the tags

spiral light
#

the api currently just catches the mojang tags

mortal hare
#

you can add items for example to mineable/pickaxe tag

#

which will make blocks mineable with a pickaxe like in vanilla

#

or in animals_spawnable_on tag

#

if you add for example stone

#

animals would spawn on stone too, not only on the grass blocks themselves

spiral light
#

dafuck ?

mortal hare
#

probs decompilation errors?

spiral light
#

dont know ... is there an online source code for craftserver ?

mortal hare
#

or registry object has its own hashcode

#

implementation

spiral light
#

its a string ...

ivory sleet
#

Check the bytecode perhaps

sturdy ivy
#

Conclure after serialization it weights more then previously.

ivory sleet
#

wym

tardy delta
#

why is it even creating a new offlineplayer when hes not found on the server? that would mean you're working with offlineplayer which dont exist

sacred mountain
#

hey im tryna make a config file for my plugin, but im not sure how to. I want it to look something like this:

goldenheads:
  item-name: "&bHello"
  item-lore:
    - "first line"
    - "second line"
    - "third line"
  effects:
    - ABSORPTION:3:120
    - REGENERATION:3:8

But i dont know how to let my program detect a new line and add it to the lore, and also how to use the syntax in the effects section (<effectname>:<effectamplifier>:<duration(s)>)

tardy delta
#

List<String> loreList = config.getStringList("goldenheads.item-lore")

#

that gets the lore

sacred mountain
#

nice ok

#

how would i use color codes/placeholders in the config?

tardy delta
#

String#replace is something, like %player% as a placeholder

midnight shore
#

Use the & and when you get it as a string replace it with the $ (not dollar, i dont bave the right simbolo )

sacred mountain
#

i can use them in the code, so should i just use my own method ?

like

p.sendMessage(ColorUtil.translateColors("&c " + config.getString("goldenheads.cooldown-msg")))
#
public class ColorUtil {

    static public final String WITH_DELIMITER = "((?<=%1$s)|(?=%1$s))";

    /**
     * @param text The string of text to apply color/effects to
     * @return Returns a string of text with color/effects applied
     */
    public static String translateColorCodes(String text){

        String[] texts = text.split(String.format(WITH_DELIMITER, "&"));

        StringBuilder finalText = new StringBuilder();

        for (int i = 0; i < texts.length; i++){
            if (texts[i].equalsIgnoreCase("&")){
                //get the next string
                i++;
                finalText.append(ChatColor.translateAlternateColorCodes('&', "&" + texts[i]));
            }else{
                finalText.append(texts[i]);
            }
        }

        return finalText.toString();
    }

}
#

thats just the util i use

#

alright thanks for the help i will try it out :)

midnight shore
#

👨🏽‍🔧

#

Guys any ideas for some features? I’m blocked

fringe gale
#

Trying to make an ItemStack with GRILLEDPORK, but it cannot resolve symbol ...

sacred mountain
sacred mountain
tardy delta
midnight shore
tardy delta
#

why all those things

sacred mountain
#

it works so eh

#

it used to have RGB support, which is why i kept it

#

but this plugin is for 1.12 and below

jovial abyss
# spiral light its a string ...

Thats the compiled code when you have a switch-case over a string.

switch("test"){
  case "test": //code
}

gets compiled to

switch("test".hashCode()){
  case /*hashcode of "test"*/: //code
}
sacred mountain
#

so i just removed the rgb part

tardy delta
#

it will loop though the string and change every valid color code to a chatcolor

fringe gale
#

I can make ItemStack of stone_sword and leather_chestplate but not Grilled_pork

midnight shore
tardy delta
#

try normal pork

fringe gale
sacred mountain
#

Name Resource location Numeric ID
Cooked Porkchop cooked_porkchop 320\

modest garnet
#

how do i check if a projectile killed a entity

sacred mountain
#

cooked_porkchop

spiral light
midnight shore
#

Please guys i need ideas 😣😣😣😣

fringe gale
midnight shore
#

😶

sacred mountain
#

the tut you are watching

fringe gale
#

haha ye

#

thx anyways

tardy delta
tardy delta
midnight shore
tardy delta
#

wanna see

midnight shore
#

?

tardy delta
#

mine

midnight shore
#

Sure

midnight shore
#

Nice

sacred mountain
#

from 1.8-1.18 its minecraft:cooked_porkchop idk where u got grilled pork from

#

i didnt. check all the versions in between but im fairly sure they didnt change that

jovial abyss
tardy delta
#

when im bored i take a look at the essentials commands

midnight shore
#

Uhm nice idea

jovial abyss
spiral light
midnight shore
#

Guys is it possible to change the player name on the player character?

jovial abyss
midnight shore
#

Its ok To use NMS or anything

#

I just want to know if it’s possible

#

No no the name of the player

#

Yeah

#

And that will change the name?

tardy delta
#

in chat yea

#

not sure about tablist

midnight shore
#

Like Nametagedit changes also the name above the head of the player, will this change that?

grim ice
#

Uh is it possible to use a plugin as a library? without the plugin itself making one?

#

I mean if there are any dangers or conventions about it

#

for example

#

I have plugin A, i wanna use its methods in plugin B

#

can I just make a fat jar or smth

#

and use it

#

ye

#

but is there any danger

#

doing that

tardy delta
#

or just a dependency?

midnight shore
#

What do you mean by danger?

#

So is it possible?

#

Using packets or smth?

grim ice
#

its a plugin

midnight shore
#

Ty

grim ice
#

alr so u dont shade it?

brave sparrow
midnight shore
#

A plugin that gathers all the materials you mine and change them into Money which you can use to buy pickaxes that when placed mine for you , like minions but with the pickaxe going around a specific point an mining it

tardy delta
#

like a /sell command

mortal hare
#

Honestly, people forget that symbols in YAML like |, |-, |+, > exist

#

there's no need to make lists if you're parsing a string with new lines in it

quaint mantle
#

Mining XP System where u can lvl up etc..

snow compass
#

Is this typo in javadocs? Because 1.18 is the Y value bigger.

Get block data for block at corresponding coordinate in the chunk
Params:
x – 0-15
y – 0-255
z – 0-15
mortal hare
#

probs

mortal hare
#

its not a typo, its just not updated

quaint mantle
#

Increase your mining speed or double/triple loot

#

Nah

#

Dunno

#

Ur choice

#

its just an idea ^^

snow compass
smoky oak
#

do you use '[]' or '<>' for optional arguments, or is there no standard?

lavish hemlock
#

There is no standard

smoky oak
#

oh well

dusk flicker
#

generally tho how I see it is <> is for required, [] for optional

blazing scarab
inland siren
#

purely random and has probably been asked 650 times

#

is a prefix like this doable outside of custom resource packs

#

am v unfamiliar with most 1.17 features

inland siren
#

thought so, thank u kind sir

misty kayak
#

is there anywhere here for hiring paid developers?

blazing scarab
#

?services

undone axleBOT
misty kayak
#

need 20 posts :/

maiden thicket
tardy delta
#

yea

midnight shore
# inland siren

Like , how did they change the player display name above the head here @quaint mantle

tardy delta
#

packets maybe, or scoreboards

#

who knows

#

i've never tried myself 👀 i really should

nocturne trail
#

        Chunk chunk = p.getChunk();

        createChunkFile(chunk, true);

        for (int y = -64; y < 320; y++) {
            Bukkit.broadcastMessage("current y level: " + y);
            writeAndReset();
            for (int x = 0; x < 16; x++) {
                for (int z = 0; z < 16; z++) {
                    Block block = chunk.getBlock(x, y, z);
                    writePalette(block);
                    writeMap(block);
                }
            }
        }
    }

    public void writeAndReset() throws IOException {
        if (!blockCount.isEmpty()) {
            for (Block block : blockCount.keySet()) {
                //Bukkit.broadcastMessage("Block at: X" + block.getX() + ", Y" + block.getY() + ", Z" + block.getZ() + " | " + block.getType() + "(" + blockCount.get(block) + " )");
                int index = chunkFile.getStringList("palette").indexOf(block.getType().toString());
                char c = PALETTE_CHARS[index];

                buffer += String.valueOf(c) + blockCount.get(block) + "/";
                chunkFile.set("blocks", buffer);
                Bukkit.broadcastMessage(block.getType() + " | " + blockCount.get(block));
            }
            chunkFile.save(file);
            blockCount.clear();
        }
    }

    public void writeMap(Block block) {
        blockCount.put(block, blockCount.getOrDefault(block, 0) + 1);
    }```

Hey, I have a couple of issues - I'm wanting map `blockCount` to clear every time `y` increments and I'm wanting the count to increment, but its always 1. What am I doing wrong?
buoyant viper
#

what does writePalette do

nocturne trail
#

It's irrelevant in this case, that method works as expected.

dusk flicker
#

for future notice, use a paste rather than filling up the chat here

#

?paste

undone axleBOT
buoyant viper
#

^

nocturne trail
#

my bad

buoyant viper
#

also u can just use like .entrySet or .forEach on blockCount to get both key and value

#

instead of iterating through keys and then calling .get later in the loop

midnight shore
#

Guys to make an entityplayer make every action another mob does ( i wanted to add AI to an NPC) what should I do?

fringe gale
#

What is the equivalent to Action.RIGHT_CLICK_BLOCK?

nocturne trail
buoyant viper
#

well how could it when ur always clearing it

nocturne trail
#

It should only be clearing when the y loop increments

buoyant viper
#

maybe its bc its on a per-block basis

#

idk if im understanding this correctly but say u had an entire Y layer of dirt

#

ur expecting blockCount for that block to be 256 yeah?

nocturne trail
#

correct

buoyant viper
#

but it wont be

#

because each block is different

#

they have their own data even though theyre the same type

nocturne trail
#

I should use Material as a key, then?

#

I see the issue

buoyant viper
young knoll
#

Block is basically a wrapper around a location

#

So it’s different for each location

nocturne trail
#

Wow look at that, Material as key fixed it

#

Thank you

buoyant viper
#

sounds like a temporary fix that could lead to problems later on when u have similar blocks at different states (ex, crops) but idk

nocturne trail
#

I plan to append states to the end of their material in the palette, such as LEAVES[distance=whatever]

buoyant viper
#

hm

#

fair enough

supple sentinel
#

So when I use a breakpoint, it shows both players in the list, but when I loop through it shows CraftPlayer?

#
        Collection<Player> playerList = new ArrayList<Player>();
        for (Player player : Bukkit.getOnlinePlayers()) {
            if (player.getGameMode() != GameMode.SPECTATOR) {
                playerList.add(player);
            }
        }

my player list

spiral light
#

whats the problem ?

#

CraftPlayer just implements the Player-Interface

supple sentinel
#

So the list shows both players in IDE- but when it runs the code in game it just misses the second player

spiral light
#

the toString() in CraftPlayer just returns its Class and the Player Name

supple sentinel
#

o

spiral light
#

dont know about IDE stuff simulation ^^ @ivory sleet

low temple
supple sentinel
#

Ta

#

Turns out it's because I was removing the player from the list so the for loop sorta broke

wet breach
bold robin
#

Can I conect me to my Minecraft java server using the plugin geyser by a Nintendo switch??

#

Hello?

severe folio
#
  1. wrong channel
  2. probably, if you set Geyser up correctly
#

tho i think geyser requires you run it on a pc

bold robin
#

Ok thanks and sorry

chrome beacon
#

Geyser supports any bedrock edition version

#

So switch should work

sturdy ivy
#

How to get CraftWorld in 1.18.1?

chrome beacon
#

Same way as always

#

Or are you having problems with importing the class

quiet ice
#

Cast world to craftworld