#help-development

1 messages · Page 1124 of 1

onyx fjord
#

python isnt some special language

lost matrix
#

The common approach would be to write it in python and then throw an endpoint on it for communication.
But TensorFlow has a java library. Not very fletched out tho.

#

Maybe Keras too, let me check

onyx fjord
#

bruh ur telling me this is all the docs

#

the rest is javadocs

umbral ridge
#

😿

pure dagger
#

xD

onyx fjord
#

i refuse to learn python

lost matrix
pure dagger
#

umm... do you know?

onyx fjord
#

playerhelditemchangeevent or something

lost matrix
#

In that case you can simply check all players periodically and see if they have an item equipped which grants them effects.
One runnable you start when your plugin enables.

onyx fjord
#

also a way

#

PlayerItemHeldEvent*

pure dagger
#

it doesnt tetect it

#

probably?

#

or does it

#

i dont know ;c

onyx fjord
#

you want it to work on any slot?

#

like talisman

lost matrix
pure dagger
#

no, in main or offhand

pure dagger
onyx fjord
#

join, helditem, hand swap perhaps

lost matrix
#

Let me just throw out a few i can think of rn

pure dagger
#

for example death, inventory click

lost matrix
#

PlayerDeathEvent, PlayerRespawnEvent, PlayerJoinEvent, PlayerItemHeldEvent, PlayerSwapHandsEvent, PlayerDropItemEvent, PlayerInteractEvent, PlayerPickupItemEvent

#

Those are just a few that can result in your hand items being changed (And there are more)

eternal oxide
#

What kind of effect? If it is a boost to attribute or somethign you can do that on the item itself. If its visual follow7smiles advice

pure dagger
pure dagger
#

literally effect

#

and also ill need thee same thing but for helmet on head

pure dagger
#

instead i did something more complicated

#

actually to acheive a little bit "better" result

#

can i run this once every tick?

#

or is it too often

lost matrix
# pure dagger can i run this once every tick?
public class PlayerItemEffectRunnable implements Runnable {

  @Override
  public void run() {
    Bukkit.getOnlinePlayers().forEach(this::checkPlayer);
  }

  private void checkPlayer(Player player) {
    EntityEquipment equipment = player.getEquipment();
    for (EquipmentSlot equipmentSlot : EquipmentSlot.values()) {
      ItemStack item = equipment.getItem(equipmentSlot);
      checkPlayerItemEffects(player, item);
    }
  }

  private void checkPlayerItemEffects(Player player, ItemStack itemStack) {
    if (itemStack == null) {
      return;
    }
    // Check for item effects
    
  }

}

This should be alright to run for a few dozen players each tick.

#

This covers armor slots, main and offhand

pure dagger
#

yeah, it wont be probably a lot players...

#

umm why not inventory?

#

equipmentslot

pseudo hazel
#

doesnt really matter

#

but equipment api makes it clear you are dealing with the equipment slots

#

instead of like slot 36 or whatever

polar girder
#

Hey, can i get some help with creating my first plugin in Eclipse?
I might be dumb, but i tried to follow every guide on the BuildTools and Development sites, still no success.

lost matrix
#

Which part troubles you?

polar girder
#

One sec I need to verify for sending pictures

#

So i cannot really use the new spigot shaded jar file, it might be that i miss some java installs or something?

eternal oxide
#

Thats quite an old tutorial

#

Today its better to use maven as a build system

lost matrix
#

There is sadly no Eclipse / Maven tutorial...

eternal oxide
polar girder
#

Yeah, i'm not very familier with Eclipse, Maven or Java 😅 So i tried what i've seen

eternal oxide
#

The one I linked is quite good. It has pretty pictures (just update the java/spigot version numbers) 😉

#

just scroll down to "Starting a Plugin Project"

lost matrix
#

Instead of whatever you got in your project right now

polar girder
polar girder
lost matrix
#

Remove the old jar and replace it with the new one.

#

Should be this step

eternal oxide
#

if you really don;t want to use maven, download the api jar from the maven site and add to Eclipse

#

?maven

undone axleBOT
lost matrix
#

I mean he already built it... 🙂

eternal oxide
#

I guess

polar girder
#

I had the built shaded.jar added as a library, and it didn't work 😅

#

But i'll try maven then, thank you!

lost matrix
polar girder
#

Okay, thanks a lot!

pure dagger
pure dagger
lost matrix
#

One runnable for all players and all items. No need to have more than a single runnable for this.

pseudo hazel
#

you always wanna minimize the amount of runnables you have

#

all items you wanna update at the same time anyways

#

so multiple runnables would be terrible

lost matrix
#

It wouldnt be catastrophic, but not scalable at all.
With this approach you can implement as many effects as you want via the PDC and a hashmap for lookups, and maintain O(1) complexity regardless of how many effects you implement down the line.

pure dagger
echo surge
#

what about PlayerItemHeldEvent?

pure dagger
#

wait a sec

#

umm

pure dagger
#

sorry for pinging mr smile

pure dagger
#

yeah... the event doesnt cover all you need

young knoll
#

It only fires when they change hotbar slot

#

Not if they replace the item in the current slot

pure dagger
#

yeah, so it doesnt detect the item, it detects change in selected hotbar

silent cove
#

It is my understanding that you need to compile your plugin against the oldest version of the api that you want to support, right? Assuming that is true, and my plugin deals with mobs, I kinda of need to be using the latest apis, otherwise it will encounter mobs it doesn't know how to deal with, right?

pure dagger
#

I'm literally asking this like 4th or 3rd time... sorry, but i still dont get it, and cannot find the best solution.

So... in my plugin, i need a special bow, special crossbow, special snowball, special egg, my approach is to:
PlayerShootEvent - check if its one of them, then call special method, that adds a key to the item, then in
EntityDamageByEntityEvent - i check if the projectile has the key, and if it has i do something

it doesnt all matter probably this all, but the problem is in detecting if player actually used the item, problem is OF COURSE becasue of stupid offhand, you can for example have a normal bow in 1 hand, a special bow in 2 hand and you can shoot from 1 hand or the other one, its possible to do with both if you get it, how do i detect it? if it was only crossbow, snowball and egg (only 1 click shoot items) or only bow (only hold shoot items) it would be easy, but there are both, maybe i should use PlayerShootEvent and BowEvent but.. how? will it work?

silent cove
#

so make it only work if the offhand is empty

#

or has a shield, w/e

pure dagger
#

usually it was like this: i ask question, someone responds, i try to explain why their approach is bad, then they tell me another, wchich is also bad, and.. i cannot get it right

pure dagger
young knoll
#

Doesn’t the bow shoot event expose the item used

#

add pdc tags to the special items so you can identify them

pure dagger
#

but.. then... how do i check in PlayerShootEvent if the item ISNT bow?

pure dagger
#

thats not the problem ;c

young knoll
#

?

silent cove
paper viper
#

why cant you add it to the item first and then give it to the player

#

i didnt scroll up because too much

pure dagger
pure dagger
silent cove
#

EntityShootBowEvent literally gives you the bow in event

#

as well as the projectile

paper viper
#

and also for snowballs and eggs, the ItemStack PDC is still preserved within the Item entity

pure dagger
#

yeah, so?? i also need to use PlayerShoot to detect the snowbals

paper viper
#

why?

#

if you already set it

#

you dont need to

pure dagger
#

what?

pure dagger
#

if snowball item has key

#

snowball projectile will have it or what

paper viper
#

No, you can use getItemStack from the Item

#

and then will have the PDC still

#

you dont always have to mark the actual entity

pure dagger
#

i got lost i think

paper viper
#

its not an event, im saying is that

#
  1. whenever you give the player the snowball, give them an itemstack with the PDC tag already with it
  2. Snowball has getItem() method from the ThrowableProjectile class, which returns an ItemStack and you can check with PDC from there
#

or am i missing something

pure dagger
#

itemstack that it was before it was thrown?

paper viper
#

Yes iirc it worked for me

pure dagger
#

oh thanks, but otherwise if it was not a thing, would tou be able to give me solution?

paper viper
#

it is a thing

#

i just checked my code

pure dagger
#

yeah but im Just curiious

#

if it wasnt

paper viper
#

also the Arrow also has the ItemStack getItem

pure dagger
#

also, i could run into similar problem in future which cannot be solved with keys

paper viper
#

Wdym?

pure dagger
#

pdc

paper viper
#

whats the similar problem

#

this is how you're supposed to usually mark stuff

#

you'd mark the actual itemstack first, then you'd use getItem to check if the PDC has the key for the entity

pure dagger
#

idk, maybe that's unnecesaey

#

unnecesary

paper viper
#

how else are you going to do it

pure dagger
#

Oki but anyway thanks

paper viper
#

you realize you need to mark the entity somehow

pure dagger
#

entity? like its marked with itemstack pdc

paper viper
#

Yes

#

For stuff like Snowball, Egg, Arrow, like projectile items you can get their ItemStack

#

you mark it within ItemStack PDC because thats persisted when the entity is launched

#

another way, you could do it i guess is to just store some set of entity ids

#

but that's not really as convenient

pure dagger
#

is it persistent also? like if the server is shut down and again or plugin reloaded, will it still return the item staxk ?

#

oh

paper viper
#

i dont recommend the latter option tbh

paper viper
#

wdym

pure dagger
#

yeah maybe, or an arrow in the groumd

#

i know thats a rare case lol but

#

im curious

#

umm i dont care then

#

what set.. wait

#

oh yeah okay

#

anyway, ill test it a Little bit, then implement it, thanks

paper viper
#

I recommend the PDC way either way because i think its easier to do

#

like passing a Set around different classes and stuff can be low key annoyin

#

and also entity ids ugh

#

Yea ig

tardy delta
grave lagoon
#

i love singletons

blazing ocean
#

kotlin objects: rah

river oracle
#

Singleton supremacy

grave lagoon
#

y2k_ is a singleton og

#

2 years of singleton loving

river oracle
#

As someone who uses registries far too often I can't imagine a world without singleton

#

Those DI purists are mad

pure dagger
paper viper
#

Arrow isnt a throwable, but you can still get the item

pure dagger
#

ok ill read

paper viper
#

In fact, you can even get the original weapon ItemStack that shot the arrow

#

using getWeapon()

pure dagger
#

umm, but what getItem() does if getWeapon gives you itemstack

paper viper
#

?

#

one gives you the Arrow ItemStack

#

the other gives you the ItemStack of the bow, crossbow, or whatever item the player used to shoot it

pure dagger
#

umm okay, thats what you meant, becasue if you shoot arrow there are weapon and arrow

#

i forgor

#

am i some dumb or what? why there no method? im sorry XDD

paper viper
#

what version of minecraft are you building on

peak moth
#

Anyone have experience sending a Plugin message in onDisable? Seems the only way around it is reflection

lost matrix
mellow edge
#

using interfaces I can avoid reflection, but how can I then compile the code based on the version, because obviously if I compile the code with 1.21 spigot, I will have errors in 1.8 code class and vice versa and I cannot just exclude them from compilation list because they wouldn't be recongnized as classes.
This is the code I want to achieve:
if(version = R1_8) something = new NMS1_8CLASS();
if(version = ...) something = new NMSX_XCLASS();

I already heard for maven profiles, but am not sure whether this is the solution. any ideas?

young knoll
#

Multiple modules

peak moth
lost matrix
lost matrix
mellow edge
young knoll
#

No

#

Maven modules

#

Which are basically just subprojects

peak moth
umbral flint
#

Do you guys support mutable or immutable configurations

mellow edge
#

ok so I think I need to style my project like that:

common
NMS1.8...
NMSX.X...
NMS1.21...

where each module is basically a version dependent code except common

peak moth
#

where can I check the version history for 1.14-1.21 to see if
Field field = this.getClass().getField("isEnabled"); this field has changed name at all?

young knoll
#

Yes

lost matrix
peak moth
#

yeah just checked

mellow edge
#

also this sounds easier and more elegant than caching reflection classes/methods/fields (to not be too heavy) into arraylist and then using them later

peak moth
#

so its kind of hacky but I'm already very deep into it with this plugin message bs

pure dagger
paper viper
#

I’m using 1.21

pure dagger
#

aaaa 😭

#

then how do i do it

#

as i said... "maybe ill need to solve similar in the future" thats now i guess

paper viper
#

yes and the solution to that problem is to update 🙂

pure dagger
#

i cannot becasue im making plugin for not my server

young knoll
#

Or just

#

Manually apply pdc to the entity in the shoot event

pure dagger
#

😭

#

there is the entire problem

young knoll
#

I don’t see the issue

#

Event -> check if item has pdc -> set the projectile to have the same pdc

pure dagger
#

ok so how do i detect if its a snowball or a bow or what

#

ok how do i get pdc

young knoll
#

ItemMeta#getPersistentDataContainer?

pure dagger
#

i feel like im explaining obvious things over and over but idk, maybe im missin something

young knoll
#

Same for entity

pure dagger
#

yeah, how to get the item

#

how do i know? offhand or main

#

or maybe some other way?

young knoll
#

Check which hand contains a snowball

#

If they both do, main hand takes priority iirc

pure dagger
#

what if it is a bow...

#

lets say both hands are bow

#

i cannot know which one was used

#

left or right

young knoll
#

One will always take priority

#

However for a bow you can just use the EntityShootBowEvent

pure dagger
#

so for bow i use shoot event
for snowball, egg, crossbow (1 click shoot items) i use projectile launch eent?

young knoll
#

Yeah

pure dagger
young knoll
#

You can

#

Check both hands

#

If only one contains the item, that hand was used

echo surge
#

Is there any advantage with PDCs over hashmaps for that topic?

young knoll
#

Otherwise one hand will always take priority over the other

#

Don’t remember which

#

I think it’s main hand

pseudo hazel
#

main hand should always take priority

pseudo hazel
#

pdc and hashmaps have nothing to do with eachother

young knoll
#

PDC is persistent

#

Maps are not

pure dagger
pure dagger
#

literally you can see here

young knoll
mellow edge
#

@lost matrix so if I understood you correctly I create modules, shade all of them into what final jar, and then just from the nms version detect which interface to use? so I will still have one jar no multiple to distribute

young knoll
#

Check which hand has the item

#

If both hands have the item

#

One hand will always take priority

pure dagger
#

look at the screenshot

young knoll
#

Well for a bow you have the bow event

#

So that doesn’t matter, you can get the item directly

echo surge
pure dagger
young knoll
eternal oxide
pure dagger
#

oki but still, i want you to understand its possible

young knoll
#

For bows maybe

#

I don’t see how it would be possible for instant-throw items

eternal oxide
#

You CAN shoot from either hand with a bow in both, BUT the bow event will ALWAYS give you the bow that was used to shoot

pure dagger
pure dagger
young knoll
#

Well there ya go, problem solved

#

The bow event will give you which item is used

pure dagger
#

idk i got lost

#

kinda

young knoll
#

And for the others you just have to determine which hand it was

pure dagger
#

but the solution i think i have it

eternal oxide
#

he understood, which is why he told you to use the bow event, just as I did yesterday

pure dagger
eternal oxide
#

or the day before, I foregt

pure dagger
#

probably

young knoll
#

Tbf I didn’t think about switching thr now in while drawing the other one

#

But it doesn’t matter because of the dedicated bow event

pure dagger
#

yeah okay

#

i wonder what would i have to do if there was no bow event

eternal oxide
#

cry

young knoll
#

Probably

#

Should expose the itemstack in the projectile launch event

#

I assume that’s possible

pure dagger
pure dagger
eternal oxide
#

it means someone create a PR to add to the API

#

wheres Y2K when you need work done?

young knoll
#

Hey I exist too

#

Sometimes

pure dagger
#

ummmmmm

#

bye

#

thanks

eternal oxide
young knoll
#

Doh

eternal night
young knoll
#

I still need to rebase InventoryChangeEvent

tardy delta
#

remember we always kill the volunteers first

young knoll
eternal night
#

your statement sounds rather optimistic

young knoll
#

Sigh

#

What about the hand

eternal night
#

Your statement is very optimistic

young knoll
#

Oh right

#

Dispensers don’t have hands

#

Okay PR to Mojang to give dispensers hands

eternal oxide
#

shoudl only need the ItemStack not hand

#

as its teh ItemStack which people would want to read the PDC from

eternal night
#

At least at the current place the spawn events live (launch is just a fancy one of those) there is 0 info beyond the entity

young knoll
#

Guh

#

I blame Dinnerbone

eternal night
#

So yea, not to that event at least.

#

|| Can just use paper API, that had API for this for the past 6 years now run||

young knoll
#

🔫

eternal oxide
#

I saw that!

young knoll
#

If only that was still threatening

eternal night
blazing ocean
torn shuttle
#

oh no

#

I just saw teh minecraft trailer

#

it might be time to diversify boys

young knoll
#

Wdym it’s amazing

eternal night
#

full buy mojang stock

young knoll
#

I

#

Am Steve

pseudo hazel
#

its aimed at 8 year olds

#

so no wonder

#

still looks like it could have funy moments

torn shuttle
eternal night
#

it has jack black

pseudo hazel
#

cuz you arent 8 now

eternal night
#

it'll be great

pseudo hazel
#

yes

#

thats fact

torn shuttle
#

I remember what I liked and didn't like when I was 8

pseudo hazel
#

jack black carries every movie he is in

torn shuttle
#

I've always been a man with a fully grown beard and impeccable taste

slender elbow
young knoll
#

Bowser and Aquaman

eternal night
slender elbow
remote swallow
eternal oxide
#

slacker

remote swallow
torn shuttle
rotund ravine
#

Ur welcome to buy it and donate it if they want it lol

#

They’re papermc thouguh

remote swallow
#

no im good

silent cove
#

i used to be able to use player.setResourcePack(URL_TO_ZIP_FILE) but im trying on 1.21 and it doesn't get applied. The UI/UX is still normal, the prompt is shown and the screen goes red and "reloads" -- but the pack is never installed. Has there been a change?

chrome beacon
#

Check the client log

silent cove
#

I dont see anything alarming .. there is a line that says found non-pack entry .DS_Store, ignoring.. but i assume that's because mac adds that file to all archives.. that's not going to prevent it from running though, would it?

chrome beacon
#

hm odd

silent cove
#

oh nvm i do see something. thanks for the tip

dapper flower
#

Is it possible to force the player into a swimming animation?

#

even when technically not possible due to no block being on top of them

chrome beacon
young knoll
#

Fake blocks work too

chrome beacon
#

Sadly the head might be visible without a resource pack

#

Fake blocks are also an option but it might cause issues when crawling in tall grass for example

fickle helm
#

Hello, is there an event I can use for when a player trades with a villager?

sullen marlin
#

TradeSelectEvent?

fickle helm
#

There it is. Somehow didn't see that previously

gleaming grove
#

Is anyone here familliar with annotations processing and java bytecode manipulation?. The Class Player after preprocessing and compilation is extended with 2 additional methods jumpOver and sayHello, However those methods are not detected by Intelji

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!

chrome beacon
#

?notworking

undone axleBOT
#

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

gleaming grove
timber crescent
#

is it possible to see every permission inside a array in bungeecord?

karmic phoenix
#

?paste

undone axleBOT
karmic phoenix
#

Hey everyone, I need a little help with fixing the following issue:
The leap system is allowing players to leap more than once without landing.
Right now it's basically allowing them to fly.

How it should work:
Players can leap whenever they want but they must touch the ground at least land once before using the leap again.

What leap does:
It launches the player after they interact with the leap item(feather).

Code:
https://paste.md-5.net/benixixele.java

drowsy helm
#

that means all players share the same hasLanded variable

karmic phoenix
#

Oh, thanks.

#

But I've tested it by myself.

drowsy helm
#

have you verified the onPlayerLand listener is properly detecting the player being grounded?

karmic phoenix
#

Should I make a map instead?

drowsy helm
#

yes

karmic phoenix
#

But then cancels it.

#

Like just for a sec it says that I have landed then it says that I haven't.

#

If I hold down right click then I'm able to continuously leap, which makes me fly around.

karmic phoenix
drowsy helm
#

just sounds like you have to get it to detect the player being grounded properly

karmic phoenix
#

I added a slight cooldown.

#

Now that no longer happens.

#

I'll test it for a bit to see if it has any other issues.

drowsy helm
#

sort of a hacky solution

#

try jump off a really high ledge and spam it

#

you will eventually be able to do it again

karmic phoenix
#

Oh ye I see, but it only allows you to do it twice.

#

Which probably means that it checks that you have landed before it launches you.

#

Since you're already on the ground.

#

Ye that's why, when I jump off the ledge(Being already on the air) then use it, it doesn't happen.

valid basin
#

Does someone know how I can use this to add some sort of anti piracy system from spigot?

#

This is just a placeholder

#

I made this but it doesn't seem to work

        try {
            URLConnection con = new URL("https://api.spigotmc.org/legacy/premium.php?user_id=34677&resource_id=63179&nonce=329559958").openConnection();
            con.setConnectTimeout(1000);
            con.setReadTimeout(1000);
            ((HttpURLConnection)con).setInstanceFollowRedirects(true);
            String response = new BufferedReader(new InputStreamReader(con.getInputStream())).readLine();
            if ("false".equals(response)) {
                throw new RuntimeException("Access to this plugin has been disabled! Please contact the author!");
            }
        } catch (IOException iOException) {
            // placeholder for now
        }
    }```
valid basin
#

Wdym it's not allowed? It's built in to spigotmc?

#

using their API to check

lost matrix
#

Your plugin has to work completely without an internet connection

hybrid turret
#

i want to blatantly persist chunks for a small server in a YAML file.

the structure will look like this:

chunks:
  worldUUIDgoesHere:
    - 1,2
    - 618,111
    - 0,19
  worldUUIDgoesHere:
    - 1,2
    - 618,111
    - 0,19
  worldUUIDgoesHere:
    - 1,2
    - 618,111
    - 0,19
  worldUUIDgoesHere:
    - 1,2
    - 618,111
    - 0,19

I want to load them into a Map<UUID, List<String>>. Strings from the StringList are later handled with split yada yada.

Anyway: How do I load everything from the chunks path and convert it to a map? (Map<String, List<String>> would be enough, I can do the rest. Only the step from config to map, bc I can't just YamlConfiguration#get and cast it afterwards :( )

#

Is this correct use of "blatantly"? Whatever, ykwim

echo basalt
#

Not a fan of this system as .yml files are completely unscalable

#

You can make your own region files that match minecraft's

#

Where you group chunks into 16x16 groups

lost matrix
# hybrid turret i want to blatantly persist chunks for a small server in a YAML file. the struc...
    FileConfiguration configuration = ...;
    ConfigurationSection worldSection = configuration.getConfigurationSection("chunks");

    if(ImIllusion.isNagging() || worldSection == null) {
      throw new NerdInterruptingException();
    }

    Map<String, List<String>> chunkMap = new HashMap<>();
    Set<String> worldIds = worldSection.getKeys(false);
    for (String worldId : worldIds) {
      List<String> chunkList = worldSection.getStringList(worldId);
      chunkMap.put(worldId, chunkList);
    }

    // Do something with the chunkMap
echo basalt
#

erm actually the section can be null 🤓

lost matrix
echo basalt
#

erm ImIllusion isn't a class in your project 🤓

#

Do you even specify that your method can throw an exception

lost matrix
#

I swear, 24w36a is an actual banger update. This is gonna be sick.

echo basalt
#

oo

#

finally we can have background items that have no lore

lost matrix
echo basalt
#

ew

quaint mantle
#

can I deal damage offhand with sword using spigotapi?

lost matrix
#

Yeah like that. You could create an actual card game now

lost matrix
quaint mantle
#

wanna make dualwielding

chrome beacon
#

yes that's been done before

quaint mantle
#

is there a method that allows me to use the offhand?

chrome beacon
chrome beacon
quaint mantle
#

is that a api ?

chrome beacon
#

1st one yes

quaint mantle
#

why have a maven?

#

work for 1.21?

#

i tried this plugin

#

not worked for me

echo basalt
#

brother you can't say you're a spigot plugin dev on your bio and ask why have a maven? 😭

grim ice
#

🙏🏻

lost matrix
#

Im so glad that im in a greenfield project in a week. Ill 100% utilize this background texturing for item rarity.

echo basalt
#

I'm so unhappy to announce that most of my work is for minecraft bedrock so I don't need to bother enough

hybrid turret
#

ImIllusion.isNagging() LMAO

hybrid turret
lost matrix
#

Jup

hybrid turret
hybrid turret
#

oops

#

brain fart moment

chrome beacon
#

Message of the author with download of the pack

blazing ocean
#

amberwat my beloved

chrome beacon
hybrid turret
#

my brain is not braining at my own shit again.

DELETE FROM Banlist
WHERE player_uuid = ?
AND (SELECT banTime FROM Banlist WHERE player_uuid = ?) != 1
AND (SELECT banTime FROM Banlist WHERE player_uuid = ?) < ?;

This is my SQL statement to remove a ban from the DB if it is expired. 1 is set for the banTime field if the ban is PERMANENT otherwise System.currentTimeMillis() is set.

arg1 is the bannedPlayerUUID, arg2 is the bannedPlayerUUID arg3 is the bannedPlayerUUID and arg4 is System.currentTimeMillis()

This should work right?? (please dont ?tas me, i beg u)

#

nvm i realized i could just emulate it in the database instead of actually trying it using players and commands. it seems to work

umbral flint
hybrid turret
#

oh is it?

#

before i changed it to this, I had 2 seperate calls to the database. one for fetching the banTime and one for the delete update. I then checked the logic in the java code instead of the request

umbral flint
#
DELETE FROM Banlist
WHERE player_uuid = ?
AND banTime != 1
AND banTime < ?;

I'm pretty sure this works

hybrid turret
#

i mean

#

wait

#

i'm

#

oh can't say thje r word

umbral flint
#

The spacing might be off because I'm on my phone

hybrid turret
#

oops

#

wait why tf did i use sub-selects?????

#

what am i doing?!

umbral flint
#

Make sure what I sent works first

hybrid turret
#

yeah will do

umbral flint
#

Also, did you mean for ban time to be -1 if it's permanent?

pseudo hazel
#

with hide tooltip on item meta

umbral flint
hybrid turret
#

i used anything and didnt wanna bother if negative numbers could do funky stuff

#

seems to work btw

hybrid turret
umbral flint
#

Is the banTime in units of milliseconds?

hybrid turret
#

but that's a semi-big refactor so eh

hybrid turret
#

it's System#currentTimeMillis

umbral flint
#

In my plugin I'm using seconds

hybrid turret
#

i mean

#

didnt wanna bother to /1000 that every time

#

It does get converted at one point to minutes and the rest is cut off bc the time is suppsed to only be accurate to the minute iirc

#

i may have changed that tho

#

that plugin has gone through a LOT since i started lmao

umbral flint
#

How long have you been working on it

hybrid turret
#

idk tbh lotta years

#

i sadly can't check bc i only started using git like 1.5 years ago 💀

#

and i had like a 1-2 years break of coding bc i was too stupid

umbral flint
#

Damn and you've only just started the database?

hybrid turret
#

nah

umbral flint
#

Oh

hybrid turret
#

i just had a brain fart

#

no idea why i subselected while only being in one table

#

that was stupid and embarrassing

#

when i became a trainee for development i started working on it again

#

and since then its come a loooooooong way

#

(i also hated SQL until i had to learn it anyway for my job training)

#

then i realized it's easy and implemented it in my plugin

umbral flint
#
        PlayerMutePunishment mute = savedMute.get();
        handle.createUpdate(
                    """
                    INSERT INTO player_mute_punishment (
                        id,  target,  issuer,  reason,  time_occurred,  pardoned,  pardoner,  pardon_reason,  duration
                    )
                    VALUES (
                        :id, :target, :issuer, :reason, :time_occurred, :pardoned, :pardoner, :pardon_reason, :duration
                    );
                    """
                )
                .bind("id", savedMute.getId())
                .bind("target", mute.getTarget())
                .bind("issuer", mute.getIssuer())
                .bind("reason", mute.getReason())
                .bind("time_occurred", mute.getTimeOccurred())
                .bind("pardoned", mute.isPardoned())
                .bind("pardoner", mute.getPardoner())
                .bind("pardon_reason", mute.getPardonReason())
                .bind("duration", mute.getDuration().toSeconds())
                .execute();
    }
#

I wanted to learn some APIs when making this plugin

hybrid turret
#

what

#

colons??

umbral flint
#

Does it look good

#

It's Jdbi API

hybrid turret
#

what lang is that

umbral flint
hybrid turret
#

tbh as of rn i'm using plain sqlite and later will by using another (non-file) language

umbral flint
#

Yes that's fine

hybrid turret
#

so i have no idea about sql apis

umbral flint
#

Are you converting your UUID to strings

hybrid turret
#

yea

#

do you just store a pardoned entry instead of deleting the entry?

umbral flint
#

In PostgreSql they have support for UUID

hybrid turret
umbral flint
#

Hm

hybrid turret
#

PostgreSQL is a server language like MySQL i suppose?

umbral flint
#

Kind of

chrome beacon
#

PostgreSQL 👑

blazing ocean
#

real

hybrid turret
#

i mean there are a bunch of different languages and i'm sure in the end it won't matter (as long as it's server based bc sqlite is slow ig)

noSQL, mySQL, PostgreSQL whatever

#

lol

umbral flint
chrome beacon
#

It's faster than you need it to be

umbral flint
#

the way I've designed things allows me to safely do that without breaking any other code though

hybrid turret
umbral flint
#

Oh

#

Nah

hybrid turret
#

so that the entries are gone

umbral flint
#

I want logs

hybrid turret
#

on a big scale i'm sure that would clutter up disk space

umbral flint
#

even Hypixel stores your expired punishments

blazing ocean
#

well yea historic punishments are important for logs and moderating things

hybrid turret
#

huh

#

well

#

tho then

#

you couldnt use the UUID as primary key right?

#

wait

#

you can't do that at all

blazing ocean
#

for punishments you'd want an id

hybrid turret
#

oh no i could with my systems (i dont but i could ig, bc i remove them when temporary punishments are expired)

#

tbh yeah i'll refac my system to this appreach, thank you @umbral flint

umbral flint
#

Ok good luck

hybrid turret
#

ty

wet breach
hybrid turret
#

i just reloaded my maven and now nothing i imported using my pom is recognized by IJ anymore??

#

I can still build the jar but it can't find shit anymore

#

i changed nothing in the pom???

#

wtf

wet breach
#

try clearing caches

hybrid turret
#

and it works fine in my other plugin

#

where do i... uhm

#

do

#

that?

#

._.

wet breach
#

idk

#

its somewhere in the menus

#

I don't use intellij

#

just know that is a thing you can do to try to fix things

hybrid turret
#

hmm i'll rerun buildtools ig and check that way

#

idk wtf happened

#

and if that doesnt work, i'll just reboot bc i did nothing for this to happen lol

#

okay i had to change something in the pom and change it back

#

now it works

hybrid turret
#

wait a HashSet is internally just a HashMap??

chrome beacon
#

yes

hybrid turret
#

what's the point in using a hashset then?

#

i mean

#

i guess it woul be ugly to use a hashmap with some dummy value?

eternal night
#

it implements the Set interface by using a hashmap?

rough drift
#

it just doesn't add a value

#

💀

eternal night
#

Yea, I mean, that is the point of it xD

rough drift
#

I don't know, ig convenience

hybrid turret
#

huh

#

interesting

shadow night
hybrid turret
#

yea true ig

#

ty

rough drift
ornate stag
#

can someone help me with something in my code? pls dm

blazing ocean
#

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

ornate stag
#

i have the error Unresolved dependency: 'org.spigotmc:spigot-api:jar :1.21.0' in my code

ornate stag
#

<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>com.example</groupId>
<artifactId>HeavenOrHell</artifactId>
<version>1.0</version>

<dependencies>
    <dependency>
        <groupId>org.spigotmc</groupId>
        <artifactId>spigot-api</artifactId>
        <version>1.21.0</version>
        <scope>provided</scope>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.8.1</version>
            <configuration>
                <source>1.8</source> <!-- Set your Java version -->
                <target>1.8</target>
            </configuration>
        </plugin>
    </plugins>
</build>

</project>

eternal oxide
#

no repository

#

unless you ran buildtools it will not find spigot

ornate stag
#

i tried running it

#

is there any other way?

eternal oxide
#

?maven

undone axleBOT
ornate stag
eternal oxide
#

pretty sure it shoudl be 1.21.1

ornate stag
#

which one?

eternal oxide
#

current build of spigot is 1.21.1

remote swallow
#

it would be 1.21 not 1.21.0

eternal oxide
#

and yes add that repository

remote swallow
#

but use 1.21.1

ornate stag
#

<version>1.21.1-R0.1-SNAPSHOT</version>??

hybrid turret
#

yes

#

wait

ornate stag
#

thanks

#

wait

hybrid turret
#

no why the snapshot

ornate stag
#

it says the same error

#

wait

#

can you hop on a call and i share screen?

hybrid turret
#

hold on let me look it up

#

nah i'm at work sorry

ornate stag
#

its ok man

ornate stag
ornate stag
hybrid turret
#
    <repositories>
        <repository>
            <id>spigotmc-repo</id>
            <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
        </repository>
    </repositories>

    <dependencies>
      <dependency>
          <groupId>org.spigotmc</groupId>
          <artifactId>spigot-api</artifactId>
          <version>1.21.1-R0.1-SNAPSHOT</version>
          <scope>provided</scope>
      </dependency>
    </dependencies>
#

yea

#

this should work

ornate stag
#

yooo

#

thanks man

hybrid turret
#

np

hybrid turret
ornate stag
#

where can i change the java?

pliant topaz
#

Is there a way I could make the player not being able to jump as high, just as when they would be standing on a honey block? Ik theres an attribute in 1.21 but this would be for 1.20.1

hybrid turret
# ornate stag where can i change the java?

1st of install the correct java version via IJ or from any java distributor.

in the pom: change <source>1.8</source> and <target>1.8</target> to 21 instead of 1.8

like this:

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.12.1</version>
                <configuration>
                  <release>21</release>
                </configuration>
            </plugin>
#

Tho

#

I just realized

#

I have 16 there

#

so i'm not entirely sure what exactly that does lol

chrome beacon
#

<release>21</release> is the new way of doing it

hybrid turret
#

instead of source and target?

chrome beacon
#

yes

hybrid turret
#

what does this line do exactly?

chrome beacon
#

set the release flag of the compiler

#

just like source and target set the source and target flags

ornate stag
#

wait so now what do i do?

ornate stag
#

Error reading file C:/Users/nikol/IdeaProjects/heavenorhell/pom.xml

chrome beacon
#

and what's the error

ornate stag
#

idk

#

thats what it says

hybrid turret
#

?paste

ornate stag
#

'pom.xml' has syntax errors

undone axleBOT
hybrid turret
#

show pom again

ornate stag
#

<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>me.nikosalevromyts</groupId>
<artifactId>HeavenOrHell</artifactId>
<version>1.0</version>

<repositories>
    <repository>
        <id>spigotmc-repo</id>
        <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
    </repository>
</repositories>

<dependencies>
    <dependency>
        <groupId>org.spigotmc</groupId>
        <artifactId>spigot-api</artifactId>
        <version>1.21.1-R0.1-SNAPSHOT</version>
        <scope>provided</scope>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.12.1</version>
            <configuration>
                <release>21</release>
            </configuration>
        </plugin
        </plugin>
    </plugins>
</build>

</project>

#

fixed it

hybrid turret
#

there we go

ornate stag
#

<release>21</release>
</configuration>
</plugin
</plugin>

i had double plugin

hybrid turret
#

what IDE are you using?

chrome beacon
#

Intellij

ornate stag
#

Intellij

#

i also have downloaded a plugin thats called Minecraft Development

hybrid turret
#

okay i'd recommend creating a configuration for packaging

ornate stag
#

how?

#

sorry im new

hybrid turret
#

top right

#

three dots

#

edit configurations

#

look for maven in the left column

#

in the run field type package (it will show a list anyway)

#

then when you want to build your plugin you can just click the nice green play button

ornate stag
#

top right in the maven tab?

hybrid turret
#

no

ornate stag
#

cuz in the other it says Nothing HEre

chrome beacon
#

The maven tab works too

hybrid turret
#

i mean yeah maven tab works too

#

Maven Tab > Lifecycle > package

chrome beacon
#

If you open the maven tab on the right find package under lifecycle

hybrid turret
#

But i find my way more convenient

#
  • you can just Shift + F10 to build
ornate stag
#

i cant add screenshot

#

here

hybrid turret
#

What I personally find very convenient too is:

Setup your local testing server INSIDE the project folder like this:

ornate stag
#

i dont have it local

#

how do i setup one?

blazing ocean
#

you should be using run for that

#

not server

hybrid turret
#

an then define in your pom.xml that you want to build your jar into ${project.basedir}/server/plugins

hybrid turret
#

does that make a difference?

blazing ocean
#

it's the common run directory

#

well no

#

but it's conventions

hybrid turret
#

conventions according toooo?

blazing ocean
#

idk

hybrid turret
undone axleBOT
hybrid turret
#

read this

blazing ocean
#

it's the common run directory

hybrid turret
#

i meannn

#

if it doesn't serve a purpose, i'll just leave it as server

ornate stag
#

ok wait

#

i just ran the plugin

#

no errors

#

BuildTools error tho

#

java.lang.RuntimeException: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target java.util.concurrent.CompletableFuture.encodeThrowable(Unknown Source) java.util.concurrent.CompletableFuture.completeThrowable(Unknown Source) java.util.concurrent.CompletableFuture$AsyncRun.run(Unknown Source) java.util.concurrent.CompletableFuture$AsyncRun.exec(Unknown Source) java.util.concurrent.ForkJoinTask.doExec(Unknown Source) java.util.concurrent.ForkJoinPool$WorkQueue.runTask(Unknown Source) java.util.concurrent.ForkJoinPool.runWorker(Unknown Source) java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source)

blazing ocean
#

use java 21

ornate stag
#

how?

#

i download it?

blazing ocean
blazing ocean
#

i mean that works too

ornate stag
#

oh ok

eternal oxide
#

Many don;t use oracle due to their bad behavior

ornate stag
#

still have the error

hybrid turret
eternal night
#

corretto is nice becuase it does some path shenanigans and sets JAVA_HOME

hybrid turret
ornate stag
#

exe?

molten flower
#

Apologies but may i have some advice on using buildtools?

hybrid turret
#

Should be a jar?

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!

ornate stag
#

i also have a jar file

hybrid turret
#

hold on a sec lamigma

ornate stag
#

okay

hybrid turret
#

i suppose you're running a windows machine?

molten flower
#

For somereason build tools is stuck on a frozen screen where its permanently loading

hybrid turret
#

have you downloaded git as the guide instructed? @ornate stag

molten flower
#

Have installed all the dependencies yep

hybrid turret
#

The GUI is garbage, only had problems with it. Try the command line

molten flower
hybrid turret
#

in the batch file you write:

java -jar BuildTools.jar --revision <your wanted minecraft version>

#

if you want latest either write latest just write java -jar BuildTools.jar

#

just make sure you're using the correct java version

ornate stag
#

Total Time: 1 minute 45 seconds

Success! Everything completed successfully. Copying final .jar files now.
Copying spigot-1.21.1-R0.1-SNAPSHOT-bootstrap.jar to C:\Users\nikol\Downloads\spigot-1.21.1.jar

  • Saved as .\spigot-1.21.1.jar
eternal night
molten flower
hybrid turret
#

yea

#

this should need Java 21 afaik

#

or wait did mc start using java 21 with version 1.20.5?

#

i'm not sure

molten flower
#

The website said 20.5 over

hybrid turret
#

yea okay

#

then it should be 17

molten flower
#

How will i know if the jar file is being created?

hybrid turret
#

more or less

molten flower
#

Because ive pressed the bat and it immediately goes off

hybrid turret
#

if there's a lot of text spammed in the console, you're on a good way

hybrid turret
molten flower
#

Yep

hybrid turret
#

add pause below the line you wrote into the BATCH file

#

then the window will stay open and you can see what the issue is

#

Then send whatever the error is here (preferably in a code block)

molten flower
#

Desktop\buildtools>java -jar BuildTools.jar --revision 1.20.1
Exception in thread "main" joptsimple.UnrecognizedOptionException: revision is not a recognized option
at joptsimple.OptionException.unrecognizedOption(OptionException.java:108)
at joptsimple.OptionParser.handleLongOptionToken(OptionParser.java:510)
at joptsimple.OptionParserState$2.handleArgument(OptionParserState.java:56)
at joptsimple.OptionParser.parse(OptionParser.java:396)
at org.spigotmc.builder.Bootstrap.main(Bootstrap.java:18)

remote swallow
#

its --rev not --revision

safe furnace
#

Anyone who knows how can i make this? with models

#

Or something else.. nevermind. jsut how can I

ornate stag
#

someone see this pls

molten flower
pliant topaz
safe furnace
pliant topaz
#

yep

safe furnace
#

alright.. thanks!

molten flower
#

Can i delete the build tools bat and jar?

#

Its in the same folder as the spigot files

tawdry shoal
#

hi, how do I check if a player's body has touched a certain block? 1.20.1

ornate stag
#

guys

#

when i run the plugins command it says no plugins

#

even tho its in the plugins folder

molten flower
#

Do i need to rename the spigot 1.20.1 jar file to just spigot?

urban trout
eternal night
#

PlayerGameModeChangeEvent is presumably called before the actual change

#

so you'd have to delay that setAllowFlight by e.g. a tick

urban trout
#

bet

molten flower
#

@echo off
java -Xms2G -Xmx2G -XX:+UseG1GC spigot-1.20.1.jar nogui
pause

Can anyone tell me whats wrong with this start.bat file?

chrome beacon
molten flower
#

got it

thin wind
#

Hello is it possible to get a text display entity as a result in a raytrace ?

smoky anchor
thin wind
#

oh ok thanks i'll use shulker

smoky anchor
#

No idea what you're doing but interaction entities exist

#

This one is the opposite, only hitbox.

slender elbow
#

it's one of the parameters in rayTrace method

grim hound
#

what the hell is the restart command in spigot?

chrome beacon
#

It restarts

#

Well more specifically it just runs the script file you tell it to

grim hound
#

why is it so broken

#

like, it doesn't really unbind the netty port

chrome beacon
#

It's not broken?

grim hound
#

I mean like

chrome beacon
#

The script runs before the JVM has fully shutdown

#

Add a slight delay to allow the server to fully stop

grim hound
#

how does it start the server later on then?

lost matrix
#

You need to define a start script in the spigot.yml or sth

worldly ingot
chrome beacon
#

I meant a delay in the script file

#

not in the server/plugin

worldly ingot
#

Config option in spigot.yml, defaults to start.sh in the root

grim hound
worldly ingot
#

There's a separate watchdog thread that doesn't terminate the JVM

grim hound
#

non-daemon?

chrome beacon
grim hound
#

don't these just prevent the jvm from exiting?

chrome beacon
#

You can launch a script in a separate process not related to the jvm

grim hound
worldly ingot
#

Oh, yeah, sorry, watchdog thread is separate lol

chrome beacon
#

which is why you need a delay in the script to ensure that the jvm has time to stop before starting the new one

grim hound
#

well this seems rather flawed

slender elbow
#

i mean all sockets and file locks will be released by the time the process is launched

grim hound
quaint mantle
#

wanna prevent leaves distance change how can i do ?

#

any idea?

tardy delta
#

wha-

quasi gulch
#

I couldnt Find that Method

remote swallow
#

setIngredient(char, MaterialChoice) and use an ExactChoice

quaint mantle
#

wanna prevent leaves distance change how can i do ?
any idea?

glossy laurel
#

How do I open an inventory to a player and then in an onClickEvent check if specifically that inventory was clicked?

glad prawn
#

?gui

glossy laurel
#

ty

tardy delta
#

hashmap moment

wraith delta
#

is it faster to have 1 yml file with every players uuid in it to read a int. or generate a yml file for each uuid and read that single file?

#

im guessing generate a uuid file, because we wouldnt want to use a loop to save a yml with uuid's of people who were offline right?

#

unless of course saving the yml is not a big deal and will only cost the performance of saving one section

quaint mantle
#

u guys help me for my issue
i will be crazy

pseudo hazel
#

if so the answer is 1 file

#

opening a file takes more effort than reading some line

silent slate
#

I have a big switch statement with about 25 cases and it takes the code about 7-8 seconds to return the string without any actual calculations inside the cases, why is that?

pseudo hazel
#

?code

#

?nocode

undone axleBOT
#

It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.

silent slate
#

?code

wraith delta
pseudo hazel
#

dont save after every change

silent slate
wraith delta
# pseudo hazel dont save after every change

what if i need to manually open the file and read it, would the updated amount of money for a player be live? i figure if its saved after each purchase or gain it would be safer

#

also, i think it can only read the new amount if its saved

#

like if i +1 money, itll still read 0 until its saved

pseudo hazel
#

dont read from 2 places at the same time

#

ideally you have a class that manages this file

#

which should have like a map of all current values

#

and then when you save the server or close it you save it to a file

#

or like every x minutes

#

but every time someone does something is kinda wild

wraith delta
#

ill try it

pseudo hazel
#

sounds like a database might be better in this case thougj

wraith delta
pseudo hazel
wraith delta
#

im guessing its not a significant difference between the time saving yml vs sql

pseudo hazel
#

and without the switch there is no 8 second delay?

pseudo hazel
#

but lie 50k files is kinda bonkies anyways

safe furnace
#

Sorry to bother u btw :)

wraith delta
#

1.8 is very outdated

safe furnace
#

I know. but there is server that is 1.8+ and has that option

#

that's why i'm asking

wraith delta
#

they likely dont. it either uses a armor stand, or backwards version compatibility, the entity would be invisible

#

if neither, probably a texture pack

pseudo hazel
wraith delta
safe furnace
#

for to make need probably a lot of armor stands.. thats definetly not. For texture pack i don't know because when i joined for first time didn't asked for to download the server resource pack..

pseudo hazel
pseudo hazel
#

maybe make like 16 files based on the first chaarcter of their uuid or smth

safe furnace
wraith delta
#

google before asking

safe furnace
silent slate
#
                    player.sendMessage(getTextFromLang(getPlayerLanguage(player.getUniqueId()), "player-not-exist"));
                    return false;
                }```
pseudo hazel
#

whats getPlayerLanguage

slender elbow
#

spark in shambles

silent slate
#

a current 1 long hashmap of uuid to string

#
        return playerLanguage.get(playerId);
    ```
pseudo hazel
#

what does hasPlayedBefore do

tardy delta
#

💀

silent slate
pseudo hazel
#

why the skull

silent slate
#

bc its common knowledge

tardy delta
#

what would it do

hazy parrot
#

I would assume it checks if player played before

silent slate
pseudo hazel
#

stop meming and start explaining why a fucking switch takes 8 seconds

tardy delta
#

what

tardy delta
#

impossible

silent slate
#

thats what i thought

pseudo hazel
#

exactly

#

which is why I asked what hasPlayedBefore does

silent slate
#

imma debug it even some after i do some homework

pseudo hazel
#

like idfk

ornate mantle
#

how do i detect a hit on a BlockDisplay entity?

blazing ocean
#

PlayerInteractAtEntityEvent

ornate mantle
blazing ocean
#

not sure tbh

hybrid turret
#

?paste

undone axleBOT
young knoll
#

Neither

#

They don’t have hitboxes

#

Use an interaction entity as a passenger for click detection

blazing ocean
#

what are you trying to do

humble tulip
#

?xy

undone axleBOT
blazing ocean
#

why new york specifically and not the system timezone

#

and why not system timezone

tardy delta
#

get a local date time, offset it with the ny timezone

blazing ocean
#

iirc it's just Clock.now or something in java

acoustic pendant
#

Is the only way to open a book to a player through NMS? I haven't find anything else

chrome beacon
#

The method is called openBook

acoustic pendant
#

Oh, thanks

acoustic pendant
#

By the way, Is it possible to show items in a book? Or am I confusing that with mods ?

chrome beacon
#

You can with a resource pack

acoustic pendant
pseudo hazel
#

click events

#

assuming text in the book are coponents

acoustic pendant
#

I'll try that, thanks

dapper flower
#

My plugin migh have to send tons of packets for block changes and the alike to the player, would it be worth/possible making a thread pool that sends those block updates?

young knoll
#

You could send a multi block update packet

#

Or multiple of them depending on how many blocks you need to change

dapper flower
#

would it make a difference using Player#sendBlockChanges over Player#sendBlockChange?

river oracle
#

yeah

#

sendBlockChanges packs them into the same packet so you can update more blocks with one packet

upper hazel
#

will a non-flying mob move if given a path to the air?

#

and is it possible to somehow control the mob you’re sitting on?

#

not a horse

#

with move buttons

dapper flower
dapper flower
#

would my original idea work? i want to dodge NMS

paper viper
#

I’m not sure about a thread pool but do you mean like spreading it across many ticks?

#

Sending thee packets async is no difference from sending them normal cause they still get sent normally

chrome beacon
#

set the data on it and then copy it to the locations you want

dapper flower
dapper flower
#

BlockData != BlockState

chrome beacon
#

That's two links

#

A chain of method calls if you will

dapper flower
#

wait maybe

chrome beacon
#

I told you how

dapper flower
#

wait

#

how do you set data on it? there is a createBlockData(String) however the documentation isn't clear on what to use there

#

there is no set methods in BlockData

#

what i assume it is doing is that it is getting the location from the blockState, but if the blockState doesn't have a location it won'y work

chrome beacon
#

I meant set the data on the block state

#

but ofc you can modify block data too

#

It entierly depends on what you want to change

dapper flower
#

man, i don't see the methods that allow you to change either BlockData or BlockState, what do you mean

#

there are only getters here

chrome beacon
#

What do you want to change

dapper flower
#

location

#

of a blockstate

chrome beacon
#

my man I told you how

dapper flower
#

you told me to create a block data and then a block state 100% understood that

#

but you cannot change either

#

you can just create them