#help-development

1 messages Β· Page 2076 of 1

noble lantern
#

ill add that method in a few

#

im making a spigot post

#

on how to create a functional interface command api

tender shard
#

we are lizards

arctic moth
#

whats the vector to yeet a projectile at a location

tender shard
tender shard
arctic moth
#

thx

noble lantern
#

yeah wouldnt be added until GC is off vacation anyways :((

#

should be here in the next 1-3 days hopefully

tall dragon
dire salmon
#

same

grim ice
#

i dont even want to

tender shard
viral crag
#

throw a ball

tall dragon
#

sure

tender shard
#

I'll draw something quickly

noble lantern
#

make a spigot post

#

explaining vector programming

#

so we always have access to it

tender shard
#

well

tall dragon
#

there is one.

tender shard
#

it's more abut vectors in math

viral crag
#

haahaa

noble lantern
#

ahh

#

math

dire salmon
#

yes finaly

viral crag
#

throw a ball, the ball travels in a vector when there is no gravity

tender shard
#

my drawing skills are extremely bad

tall dragon
#

cant be worse than mine

tender shard
grim ice
#

here u go

tender shard
#

so imagine this

grim ice
#

yeah

tender shard
#

X1 is at 3|1

#

X2 is at 7|5

#

the vector from X1 -> X2 is the same as X2 - X1

grim ice
#

a vector is the movement from X1 to X2

arctic moth
#

idk whats happening but its just yeeting them at the speed of light and they explode somewhere random in the air

grim ice
tender shard
#

which is the same as
7 - 3
and
5 - 1

#

so the vector from X1 -> X2 is 4|4

viral crag
#

... 4 dimensional movement with a 2 dimensional graphchart?

grim ice
dire salmon
#

uh why dont just use this (idk if you can draw vector thing)

noble lantern
#

speeds past 40 get glitchy

tender shard
#

basically calculating with a 2D vector is the same as adding numbers, but... you have two numbers

#

lol

dire salmon
arctic moth
tall dragon
tender shard
#

(A,B) -> (X,Y) = (X-A, B-Y)

tall dragon
#

ye so u subtract

tender shard
#

yeah, let's imagine you wanna go from "1" to "5". the difference is "5-1"

grim ice
#

it makes sense to me

tender shard
#

that makes sense, right

#

now you do the same thing for the second coordinate

tall dragon
#

yh

grim ice
#

its simple

tender shard
#

and that's everything you need

grim ice
tall dragon
#

alright i guess. i will need to do some investigating on it when im home

tender shard
#

(1,1) -> (5,7) means "x distance is 5-1" and "y distance is 7-1" so the result is (4,6)

tall dragon
#

to see if i get it

viral crag
grim ice
#

even if i get it

arctic moth
#

but why is it yeeting at the speed of light i didnt change the speed

arctic moth
#

unless ig it gets faster with more distance?

grim ice
#

i still annoy ppl asking them for a solution to any vector programming problem i get

tender shard
#

you have to NORMALIZE the vector

arctic moth
#

oh

tender shard
#

have you heard about pythagoras?

#

in math school?

arctic moth
tall dragon
tender shard
#

no, you see, a vector always has a length

dire salmon
#

yes, aΒ²+bΒ²=cΒ² (kinda)

tender shard
#

no I'm talking to Hyper

tall dragon
#

ok

grim ice
#

annoyed the heck out of me

arctic moth
#

same

tender shard
#

the yellow thing is the vector from X1 to X2

#

it has a length of... idk, just guessing, let's say 2

viral crag
#

slope cough cough

tender shard
#

the vector gets longer / larger, the more distant x1 and x2 are apart

arctic moth
#

ye ik longer = more sped

tender shard
#

you however only want the DIRECTION, not the full length of the vector

arctic moth
#

yep

tender shard
#

so, you normalize it. normalize means "turn the vector to a length of one"

#

so no matter how far apart stuff is, you have the same length vector

arctic moth
#

why is that the emoji in the corner

tender shard
#

so yeah just call .normalize() on your vector, and that's it

#

(call it on the FINAL vector, not on x1 or x2)

arctic moth
#

now i need to figure out how to get the head location

viral crag
#

give hypercodec dragonhead

tender shard
#

i wish I could explain the vector stuff better

tender shard
#

it'd be easy with a blackboard lol

arctic moth
#

lol

#

i get it, function with length

arctic moth
tender shard
#

discord isn't really the best place to explain geometry

viral crag
#

no

#

its a coordinate set with a scalar

arctic moth
tender shard
#

idk about that, I mainly reside in coding and lgbt discords lol

arctic moth
#

lol

tender shard
#

i'll write a tiny blog post about BASIC vector and direction stuff tomorrow

viral crag
#

then dot and cross products!

arctic moth
#

also why the fuck are they curving

tender shard
arctic moth
viral crag
#

good question

tender shard
#

most questions people ask here about vectors is just "how to get direction from A to B"

arctic moth
#

lol

#

i always just forget which way is which

#

like destination and starting position

tender shard
#

it's easy

#

you wanna go from A to B

#

so do B - A

arctic moth
#

lol

viral crag
#

not offten the need to multiply and divide multiple vectors

tender shard
#

desination - startingPoint = vector

#

and vector.normalize() = direction

viral crag
#

maybe if you wer rocket boosting an arrow? - or creating a crosswind effect

tender shard
#

a vector is the same as "going from 1 to 5"

#

you wanna go from 1 to 5, you add 4

#

and you get 4 by doing 5 - 1

arctic moth
#

so anyways how do i get the location of the dragon's head?

tender shard
arctic moth
#

its just like above them

tender shard
#

hm I don't think you can get the exact location

#

I'd just substract something from the location if it's always off by the same amount

viral crag
#

head has its own hitbox no?

dire salmon
#

yep

tender shard
#

yeah it has getParts()

#

so you can get the parts, then get the head, then get the location from that

arctic moth
#

and also the fireballs explode when they spawn, how do i make it so they ignore the dragon hitbox

#

EntityDamageByEntityEvent or smth?

tender shard
#

where are you spawning them?

#

at the dragon's head?

arctic moth
#

yes

#

they explode

#

cuz the dragons hitbox is giant

tender shard
#

yeah you'll have to spawn a bit off from the dragon

#

red part is the dragon

viral crag
#

nice image

tender shard
#

the vector starts "inside" their head

tender shard
tender shard
arctic moth
#

so how do u get a position along the vector?

hasty prawn
arctic moth
#

oh

arctic moth
viral crag
#

vector only has a single direction

arctic moth
#

getDirection

#

dumbass

tender shard
# arctic moth so how do u get a position along the vector?

for example:

Location dragonHead; // get it
Vector vector = something.normalize(); // Get the vector from dragon to player, and normalize it, so it has a length of one
Location startingPoint = dragonHead.add(vector); // If this is not enough, multiply the vector, e.g. vector.mulitply(2);
#

startingPoint is where you spawn the fireball then

arctic moth
#

oke

rough drift
#

#help-development is more active and has more content than #general prove me the fuck wrong

tender shard
#

depends on whether optic talks about his anti malware plugin

rough drift
tender shard
#

but yeah help-development is the reason why 90% of people join here in the first place, so it makes sense lol

viral crag
#

anti malware plugin ...

tender shard
tender shard
#

ike have you seen my awesome images?

rough drift
#

help development is a different community lmao

rough drift
#

show me

noble lantern
tender shard
#

ask Adelemphii lol

#

I already have one pinned message in this channel lol

viral crag
#

are we raising funds for better crayons?

arctic moth
#

just curious, what would happen if u created a sin vector and used it on smth

noble lantern
tender shard
viral crag
#

for mfnalex

tender shard
#

I have like 50 pens but I don't have a piece of paper

viral crag
#

i think i have one pen, pretty sure the cats stole the rest

arctic moth
tender shard
viral crag
#

the vector

tender shard
#

do you want the fireball to "follow" the player, or what?

viral crag
#

use different vectors for different directions

arctic moth
#

not just randomly in positive z

tender shard
#

show your code

rough drift
viral crag
#

follow the player and reset the start location

arctic moth
#

no idea what the hell happened with the indents when i pasted that

#

lol

arctic moth
tender shard
#

I see

#

your yeetvec

#

it doesn't involve the player at all

arctic moth
#

closest is the player

tender shard
#

you set yeetvec to a vector between the dragon head and the dragon

arctic moth
#

oh

tender shard
#

wow what the heck is this lmao

arctic moth
#

make it circular

tender shard
#

delete it

#

this is giving me nightmares

#

and I've seen some shit

arctic moth
#

make it more circular

tender shard
#

so delay it? lol

viral crag
#

poltergeist head

tender shard
#

why not

#

that should work fine

#

that definitely makes a head move in a circle

#

100% can confirm

desert musk
#

Why can't i get an entity from its UUID when it's not loaded?

arctic moth
tender shard
desert musk
tender shard
#

one second @arctic moth

arctic moth
#

lol

tender shard
#

lol

#

zacken

#

wtf

viral crag
arctic moth
#

how do u accidentally copy the wrong method

desert musk
arctic moth
#

again, ignore the paste indenting

tender shard
#

maybe you'll find it faster if you keep posting some other methods meanwhile

#

lol

viral crag
#

less than 7 distance to teh dagon?

arctic moth
#

greater than

#

cant have it spam fireballs when its close

#

cuz that would be annoying as hell

viral crag
#

oh yeah sign is the other way!

grim ice
#

i rly wanna play chess but i suck

tender shard
arctic moth
#

ok

tender shard
#

so why don't you just replace "1" with "10" or "5" to make it slower?

#

that way you can tell kids to get fucked slower

desert musk
#

How do you get entities in unloaded chunks?

tender shard
#

well

#

ACHUALLY

#

then they are not entities in unloaded chunks anymore

desert musk
#

how do i load it?

tender shard
#

TL;DR:

  1. You don't get entities from unloaded chunks
  2. If you want to, parse the world files yourself
tender shard
desert musk
#

alright

tender shard
#

sorry

#

switch closest and dragonHead

#

so

#

closest.getLocation().substract(dragonHead...

#

if that still doesn't work, please do this:

  1. Reformat your code (if any line uses more than two variables, it's too long - refactor it so that no line uses more than 2 variables)
  2. Send it again here
  3. Send a video of what currently happens
    Then we'll get it fixed within 2 minutes
#

you may only break rule 1 to assign new stuff, e.g. the following stuff is okay:

Location loc3 = loc2.add(loc1);
#

if there'd also be a "loc4" there, better split it up, otherwise noone can read your code

#

wtf is VexedMC

#

prison?

desert musk
#

actually i just realized this method i'm doing now does not need to load the entity

tender shard
#

I only know prison from counter strike

desert musk
tender shard
#

hm we called it "prison"

#

you were either CT (prison worker) or T (prisoner) and then had to kill all CTs

#

and CTs may only kill you if you behaved bad

#

that was such a weird gamemode lmao

#

shit I gotta join that server IG

desert musk
#

aight

    (NestUUID):
        name:
        level:
        locked:
        members:
            (MemberUUID):
                role:
                lastrewake:
                respawn:
                    X:
                    Y:
                    Z:```

https://paste.md-5.net/bipayofoni.js
https://paste.md-5.net/opepavuwuz.cs

the following code produces an error when /rewake is called on a non loaded entity
#

but, the code that accesses the entity is commented out

#

or so i think

tender shard
#

seems like it always uses the initial vector

arctic moth
tender shard
desert musk
tender shard
#

"produces an error"

#

send the error, then

#

error messages don't have like 20 lines just for fun

#

they are there because they actually tell you exactly where the problem is

#

if you don't send them, noone can help you

desert musk
#

thought not lul

arctic moth
#

yes it did take me that entire time just to fix indents

#

and the if(closest != null) i screwed up the indents again

#

lol

tender shard
#

pls print out what exactly "closest" is

desert musk
tender shard
#

from what I see, it should correctly shoot the fireball at "closest" everytime

arctic moth
#

debug

tender shard
#

add sth like this in your run() method:

arctic moth
#

whatever

#

ok

tender shard
#
System.out.println(closest + " -> " + closest.getLocation));"
#

it seems like "closest" isn't you

#

with "you" I mean your player lol

arctic moth
#

oh

desert musk
#
                
player.setBedSpawnLocation(spawn);             
player.setHealth(0);

this doesnt do what i intended it to do, which is make sure the user respawns in a location

arctic moth
#

its updating

#

very slightly tho

tender shard
#

set the respawn location in this event

viral crag
arctic moth
#

i dont think thats how it works-

#

well yes it is

#

i was sprinting tho

#

no

viral crag
#

you might want to slow down your fireballs throws then

arctic moth
tender shard
viral crag
#

that is the only thing between you and your position diferences

#

you are throwing two fireballs per second based on the timestamps

tender shard
#

anyone ever seen something like this?

viral crag
#

yeah

tender shard
#

oh

#

why

#

did you download a cracked version of one of my plugins?

#

oh hi frostalf

viral crag
#

me or hyper?

wet breach
# tender shard

can't say I specifically seen this however anytime the problem occurs in native code you get something similar

viral crag
#

saw it with the stupid fabric server i admin

wet breach
#

lol

viral crag
#

looks like a heap crash

tender shard
#

it seems like spawnEntity(.., EnderDragon) doesn't do anything

#

well ti does but the dragon is broken

viral crag
#

missing ai or you were in creative?

tender shard
#

broken, just like @tawdry scroll's leg

tender shard
viral crag
#

mean when you spawned it

#

not really tried to spawn an enderdragon in teh overworld

tender shard
#
EnderDragon dragon = (EnderDragon) event.getPlayer().getWorld().spawnEntity(event.getPlayer().getLocation(), EntityType.ENDER_DRAGON);
#

no I wasnt in creative when it spawned

wet breach
#

otherwise it wants to do crazy things and then eventually fly off

tender shard
#

believe it or not, but the following stuff is valid java:

package de.jeff_media.test;


import org.bukkit.event.Listener;
import org.bukkit.plugin.java.JavaPlugin;


public class Test extends JavaPlugin implements Listener {

    private static Test instance;

    static {
        {
            {
                {
                    {
                        {
                            {
                                {
                                    {
                                        Test.instance = new Test();
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }

    {
        https://jeff-media.com
        sayHi();
    }

    public void sayHi(Test this) {
        System.out.println("hi");
    }

}
noble lantern
#

its basically like batch's goto lmfao

#

its stupid as fuck

tender shard
#

<string>?

noble lantern
#

well

#

more like

#

<word>:

#

eg

tender shard
#

oh you mean the label

noble lantern
#
word:
for (LOOPSTUFF) {
    continue word;
}
#

dont really see a point in them

tender shard
crisp steeple
#

useful in loops sometimes

tender shard
#

java would be fucked without labels

crisp steeple
#

yeah it’s native from c iirc

noble lantern
#

oh no, my labels, theyre gone

noble lantern
#

ive never rly used them

tender shard
noble lantern
#

only just seen them in a recent project i had

#

if im being deadass honest

#

couldnt you just do it without them

tender shard
#

by adding a weird boolean

#

like "isLoopDone"

crisp steeple
tender shard
#

that's not really very nice, is it?

#

and that's the reason labels exist

crisp steeple
#

new boolean[18]

#

so clean

tender shard
#

I mean after all streams aren't needed too

#

but they ARE nice

wet breach
#

you also have to take into account the compiler for some of these things

#

if you were to rely on the booleans that would prevent the compiler from optimizing booleans everywhere else

tender shard
#

so people saying "labels are useless" are either a bit slow or weird or haven't really understood yet what labels are for πŸ˜›

wet breach
#

so the use of the labels makes it easier to identify where those specific types of loops are at for the compiler and do their magic πŸ™‚

tender shard
#

exactly

wet breach
#

not everything is for the ease of the programmer

crisp steeple
#

i remember actually using the entire boolean thing in my first java calculator project

tender shard
#

I agree with frostalf and his weird calf

viral crag
#

calf?

tender shard
#

yes

wet breach
#

inside joke >>

tender shard
#

it's a part of the leg

#

you wouldn't understand

#

lol

viral crag
#

not moo cow, okay

noble lantern
#

interesting

#

ill have to use them next time then

#

also why is bbcode so aids

tender shard
arctic moth
noble lantern
#

ender dragons naturally go 0,0 in overworld

#

you need to override theyre AI somehow

arctic moth
wet breach
#

that is because 0,0 is where it spawns in the end world

noble lantern
#

thats java too

arctic moth
#

no whenever i spawn them the just sit there

noble lantern
#

if you spawn one far away, it will B line to 0,0ish

wet breach
#

also the exit portal for the end is at 0,0 too

tender shard
noble lantern
tender shard
#

aaah

noble lantern
wet breach
#

or a plugin stopping it

#

but they do kind of glitch when spawned in the overworld regardless

#

because it isn't really suppose to be there πŸ˜‚

arctic moth
#

and that was 1.13

viral crag
#

that was the other dragon that MS scrapped

noble lantern
#

so it could be possible 1.13 or similar changed it

#

lemme try

wet breach
#

the end dragon is technically 6-7 entities put together

arctic moth
#

mines doing the spinnies

noble lantern
#

yeah mine just sits still on my dev test server 1.18.2

wet breach
#

try shooting it

noble lantern
#

you can override its ai if you rly want to

wet breach
#

might make it do something πŸ˜„

noble lantern
#

negative

#

he just sits there

#

hes sad :((

viral crag
#

maybe they axed the overworld AI for how to train your dragons

wet breach
#

ah well its different on multiple servers

#

varying factors

wet breach
#

I have had an end dragon destroy towns before which is hilarious

noble lantern
#

ohp

#

there he goes

wet breach
#

but at the same time not so much

noble lantern
#

i smacked him like 20 times

#

and he runnning

wet breach
#

and how this happened is we spawned it in the over world

#

and it ran away

#

and we couldn't find it again, this was before you had a command to kill entities

#

but some people did find it again though

noble lantern
#

see @arctic moth he will B-line to 0 0and then do the spinny thing like yours is currently doing

#

so your prolly at 0 0in your world rn

arctic moth
#

mine was spinning at 500xz

viral crag
#

maybe 2hex will write an overworld AI for teh dragon

wet breach
#

it spins because it can't find them end crystals

noble lantern
wet breach
#

the end crystal towers is how it heals

noble lantern
#

yep

#

or hes trying to roost at the portal

arctic moth
noble lantern
#

yep thats exactly what hes doing

wet breach
noble lantern
#

hes trying to roost at 0.0 at the bedrock to portal

#

after thathe flies around normally

wet breach
#

if I ever feel like messing with End Dragon stuff

#

I should make a plugin for those that want medieval fantasy stuff

#

where a dragon comes in to destroy their town

#

and their town savior needs to fend it off

#

or die trying

noble lantern
viral crag
#

should anyway, reduce entity counts

#

you could call it the anti-lag dragon

wet breach
#

lol

viral crag
#

despised by players everwhere

arctic moth
#

@tender shard

#

btw u have to be in survival

arctic moth
#

chill bro

#

he angy

hasty prawn
#

Large anger

worldly ingot
#

Yes

arctic moth
#

i also made creepers strafe and instaexplode

#

people are gonna hate me so much when i release this

noble lantern
#

how to be an asshole 101

#

therea a mod for the nether

arctic moth
#

its not just nether

noble lantern
#

that adds blue flames and when you run into them or mobs do they go crazy like that

arctic moth
#

lol

tender shard
noble lantern
arctic moth
tender shard
#

that is true, but

#

if I'd read every message I had missed on every discord, I'd probably be dead already

noble lantern
#

basically

#

were brainstorming ideas

#

on how to make mobs 10x more annoying

tender shard
#

ah

#

okay

noble lantern
#

like that

#

would be rly annoying

tender shard
#

the most annoying thing imho are baby zombies

noble lantern
#

OMG

#

and make it so its baby zombies

#

steal the item

#

good idea alex

tender shard
#

πŸ˜„

noble lantern
#

How come when i paste code into a spoiler code block i get this shit (forums)

#

its so annoying

desert musk
#
    @EventHandler
    public void onHopperSteal(BlockPlaceEvent event) {
        Player player = event.getPlayer();
        if (event.getBlock().getType() != Material.HOPPER) return;

        System.out.println("foreign hopper placed");

        UUID AOE = inAOE(player);
        if (AOE == null) return;
        if (containsMember(AOE,player.getUniqueId()))  return;

        Location location = event.getBlock().getLocation();
        if (player.getWorld().getBlockAt(location.getBlockX(), location.getBlockY()+1, location.getBlockZ()) instanceof InventoryHolder) {
            event.setCancelled(true);
            System.out.println("cancelled, nice try");
        }
        System.out.println("did that work?");
    }```

The "cancelled, nice try" if statement doesn't do what it's intended to do, it does not detect if the block above the event block is a container
worldly ingot
#

Block will never be an instance of InventoryHolder

#

Its BlockState will be

desert musk
worldly ingot
#

block.getRelative(BlockFace.UP) btw

#

if (event.getBlock().getRelative(BlockFace.UP).getBlockState() instanceof InventoryHolder)

desert musk
#

what's the difference?

worldly ingot
#

More convenient than creating a Location, adding to it manually, etc.

desert musk
#

ok cool

worldly ingot
#

Arguably more readable and you're skipping the unnecessary creation of a Location

desert musk
#

yeah

#

also i've had an issue where i'm trying to make a custom item spawn a custom entity, but it spawns inside the block

#

this looks like it could pertain to that

#

is there a way to make it place the entity normally?

worldly ingot
#

Yeah you would just have to spawn it one block above

desert musk
#

what about for placing it on the ceiling though

worldly ingot
#

Could do block.getRelative(event.getClickedFace())

#

Or whatever the method is to get the face on which the block was clicked

desert musk
#

sweet

worldly ingot
#

Assuming you're using a PlayerInteractEvent, it's getBlockFace()

desert musk
#

ye

regal hinge
#

How do i use nms in 1.18.2

arctic moth
#

Im surprised mentioning a thread actually worked

regal hinge
#

DM me if anyone can help me use NMS lol

sterile token
#

who tag me?

arctic moth
#

They lied to me

crisp steeple
arctic moth
#

What would happen if u make a sine wave vector and set velocity

waxen plinth
#

what is a sine wave vector

#

a vector doesn't represent any path it can only represent a direction and magnitude

#

you can't represent a sine wave with a vector

arctic moth
#

Awww

#

But math functions

wet breach
#

y(x,t)=Asin(kxβˆ’Ο‰t+Ο•) is the formula for a sine wave

frank frigate
#

hi, anyone able to help?

my issue is that when I try to create a namespacedKey to do Persistent data storage, I keep getting erros, where on the plugin I used it in before works

I get the error on this line:

public Glow(String namespace) {super(new NamespacedKey(ImbuementsMain.getPlugin(), namespace)); }
#
package me.nrgking.imbuements.Imbuements;

import me.nrgking.imbuements.ImbuementsMain;
import org.bukkit.NamespacedKey;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.persistence.PersistentDataContainer;
import org.bukkit.persistence.PersistentDataType;
#

these are my imports

#
package me.nrgking.imbuements.Imbuements;

import me.nrgking.imbuements.ImbuementsMain;
import org.bukkit.NamespacedKey;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.persistence.PersistentDataContainer;
import org.bukkit.persistence.PersistentDataType;
wet breach
#

how about showing the error

unreal quartz
#

No

frank frigate
#

it won't let me upload files

wet breach
#

if you verify it will, but you don't need to upload a file

#

?paste

undone axleBOT
frank frigate
#

it isn't a buld error, its a red line in my editor

wet breach
#

what happens if you attempt to build then?

frank frigate
#

its Object in java.lang.object can't be applied to org.bukkit.namespacedkey

#

java: constructor Object in class java.lang.Object cannot be applied to given types;
required: no arguments
found: org.bukkit.NamespacedKey
reason: actual and formal argument lists differ in length

wet breach
#

well might be because you are using super

#

is the method Glow being overriden from somewhere else?

#

if not, then when you do super, you are going to end up calling methods for Object

frank frigate
#

I think its working ty

warm trout
#

Blocking player EntityPlayer['ElonzoNachoFTW'/8, uuid='cf30783b-00c8-48c7-9c79-2270a7c7f019', l='ServerLevel[game-1]', x=-666.64, y=71.00, z=161.60, cpos=[-42, 10], tl=1319, v=true, rR=null](ElonzoNachoFTW at -666.6396443842459,71.0,161.59849194128873) from spectating invalid entity EntityArmorStand['Armor Stand'/9, uuid='ec79de42-6f35-421c-81d9-993761e951ec', l='ServerLevel[game-1]', x=-666.25, y=70.00, z=161.75, cpos=[-42, 10], tl=361, v=false, rR=UNLOADED_TO_CHUNK] getting this error when I go out of a chunk and then make a player spectate the entity after going back into the chunk

#

I've tried using ChunkUnloadEvent and event.setSaveChunk(true) and it didn't work]

wet breach
warm trout
wet breach
#

well, did you make sure the entity was there then

#

after the chunk loaded

#

not sure how you are doing the code or whatever it is

warm trout
warm trout
wet breach
#

ah yes just give me api methods

#

totally helps

#

?paste

undone axleBOT
wet breach
#

until we can see code in how you are attempting it, we can't really provide help except just guess possible things

warm trout
wet breach
#

the reason it makes it easier to see the code

#

instead of just these pieces you keep giving

#

is because odds are it is because you are losing the entity instance

#

entities technically die when a chunk unloads

#

so the instance you had before for the entity will not be the same when that chunk loads again

warm trout
warm trout
#

Thank you

quaint mantle
#

@wet breach Do you have experience with observers?

#

Pinging you as your active atm

wet breach
#

observers ?

#

like for spectating?

chrome beacon
#

Or the block?

glossy venture
#

how would i go about moving any block of items to the top left corner and eliminating any space around it

#

like this

#

its a 1 dimensional array

wet breach
#

put them in the proper slot

low temple
glossy venture
#

yeah im making a system

#

to match recipes

#

would like to have shaped recipes work everywhere on the grid

#

im planning to add support for things like 5x5 grids too

#

so yeah

low temple
#

im kinda confused

#

do u want the recipe to only work when the diamonds are in slot 0 and 1 or anywhere

#

like anywhere where there is a diamond on top of another?

#

like if i put a diamond in 2 and in 5 do u want it to still output the item?

#

@glossy venture

wet breach
#

well if you have a shaped recipe, it should automatically detect it regardless where in the matrix

glossy venture
#

but i want them to be reduced to the smallest size with base index 0

glossy venture
#

its not minecraft shaped recipes

low temple
#

when u make ur shape do <recipe>.shape("D", "D")

glossy venture
#

shall i commit my code?

low temple
#

yeah submit ur code

#

cause idk what u mean by making ur own system

wet breach
#

should probably use a 3 dimensional array

#

for this

low temple
#

I dont think you can make a 5x5 crafting table

wet breach
#

with a 3 dimensional you only need to look at the corresponding spots in each dimension

#

so if the recipe must be vertical, and it can only take up 2 slots, you know that at minimum the middle array will be used, leaving either the top or bottom array having to have something in the same spot as the middle

#

I probably wouldn't try using a 1 dimensional array for this lol

glossy venture
#

it should also work for structures like

D .
. D
``` though
#

D being a diamond

#

or somethign

wet breach
#

so you just want there to be diamonds anywhere in the matrix then?

#

shapeless as it is called

glossy venture
#

no

#

i mean if you define a recipe like shears

wet breach
#

oh you want to do diagonal

#

as well

glossy venture
#

two iron anywhere but they have to be diagonal

#

yeah

#

and horizontal

#

just any block that has items in it

#

i should probably convert it to 2d for that

wet breach
#

well what I said applies, but only just increases the search from just top and bottom to also 1 over on the top and bottom

wet breach
#

not sure why you would go with 2d array on this

wet breach
#

3d array is the best for this since there is typically 3 rows in the crafting

#

exception to this is the player crafting slots

#

in which case you can easily use a 2d array for it

glossy venture
#

look at the worker for CRAFTING_UNSHAPED

#

and then the match(CraftMatrix) method

glossy venture
#

what

wet breach
#

because the math is easier

#

its not hard to check in a 3d array for 2 things being in their corresponding spots in the array

glossy venture
#

im not trying to immediately match the recipe tho, im just trying to free empty space around the square of items

wet breach
#
0, 1 , 2
0, 1 , 2
0, 1 , 2

if we put an item in the top array, we know for a fact there must be one in the second one, but if we detect there is no item in the top array, we know that it must exist in the second two.
#

so with the example above

#

you don't even need to iterate all 3 arrays

#

you could just detect its at index 0, and know for fact it has to be in index 0 or 1 for the second

glossy venture
#

thats a 2d array tho

#

3x3

#

i thought you meant like 3 nested arrays

#

thats a 3d array

wet breach
#

String[][][] this is a 3d array

glossy venture
#

yeah

wet breach
#

it is what I am talking about

glossy venture
#

you display an int[][] there right

wet breach
#

I just used numbers to make it easier to visualize

glossy venture
#
[
  [0, 1, 2],
  [0, 1, 2],
  [0, 1, 2]
]
#

i know

wet breach
#

the numbers correspond to the index in the arrays

glossy venture
#

but thats 2d

#

oooh

#

ok im confused ima just try to look it up again

wet breach
#

you could do 2d array

sullen canyon
#

well I need help with probably the most basic thing, but I can't figure it out in any way, so I would be very grateful if someone could give me a code example. my question is that I have a json that is on the site, the so-called hypixel api and I get player statistics from it, and I needed to do so that I have, for example, a gameTimePlayedOld variable, which should update its value, which will receive from api, for example, every 2 minutes and save them to the same variable (I already know how to get the values) and also the second variable, for example gameTimePlayed, which should be updated every 5 seconds, I understand that this is easy to do, but I have something doesn't work, can anyone help?

grim ice
#

e

#

and array of 3 arrays

#

what i did to understand dimensional arrays is

#

String[][]

#

the bold text is the array type

#

so its just an array of the type string array

wet breach
#

what are you asking? o.O

#

are you not understanding what String[][][] means?

lavish hemlock
#

Multidimensional arrays aren't that complicated

#

Well, as a concept

#

In usage they're fucking terrible when you get past 2 dimensions

sullen canyon
#

In short, I need to figure out how to make the variable update its value to the one that I set every certain amount of time

spiral aurora
#

im trying to get NMS into my plugin - and i changed "Spigot-api" into "spigot" in my pom.xml, but intelliJ tells me that it

in spigotmc-repo (https://hub.spigotmc.org/nexus/content/repositories/snapshots/)
vocal cloud
undone axleBOT
#

Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or the entire contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.

Please read the release notes for further information: https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-1-release.534760/#post-4305163

wet breach
#

the only spigot jars that are hosted on spigots repo is the api, all others need to be obtained via buildtools, and since you are needing to do stuff with NMS, recommend visiting that link above which helps you obtain the appropriate jar as well as setting up your pom properly

supple elk
#

Is there any inbuilt way to get how long a bukkit runnable has been executing for? For like how many ticks it's ran

wet breach
#

when you schedule the runnable you can get the task id and then you can keep track if its still running or not

supple elk
#

kk, not exactly what I need but it shouldn't be an issue anyway

wet breach
supple elk
#

:p

proper pawn
#

how do i save my config file if i’m not in the main class?

supple elk
#

get an instance of your plugin

#

use either dependency injection or a static instance of your plugin

proper pawn
#

okay thank you

supple elk
#
  class MyPlugin {
      static JavaPlugin plugin;

      onEnable() {
          plugin = this;
      }
  }```
#

for example ^

#

then to access call MyPlugin.plugin.saveConfig()

proper pawn
#

ah okay thank you. i’ll try it later. currently at school.

quaint mantle
#

    @EventHandler
    public void blockBreak(BlockPlaceEvent event) {
        Player player = event.getPlayer();

        if (player.isOp()) {
            event.setCancelled(false);
        } else {
            if (event.getPlayer().getLocation().getWorld().getName().equals("world")) {
                event.setCancelled(true);
            }
        }
    }
}```
#

help

#

please

noble lantern
#

?paste

undone axleBOT
noble lantern
#

or use code formatting with 3 "`"

noble lantern
quaint mantle
#

uh okay

#

i dosent even let me use getPlayer();

noble lantern
#

its likely the player either isnt an op, or isnt in the world named "world"

#

wym?

quaint mantle
#

i cant use it

wet breach
#

probably should fix your imports

noble lantern
#

ah your right

#

your probably importing your own class

#

because you named it BlockPlaceEvent

quaint mantle
#

wtf are you talking about?

#

i just made a class

#

in intellij

noble lantern
quaint mantle
#

ah waittt

#

renamed it did nothing

wet breach
#

probably still need to add them imports at the top

#

also, might want to add the spigot api dependency too

quaint mantle
noble lantern
#

did you just rename it by changing the line of code

#

or right click -> refactor

#

in intellij its better to use the refactor feature

wet breach
#

why would they need to use refactor o.O

noble lantern
#

show the imports you use

quaint mantle
#

i think i got it haha wait

noble lantern
#

ill show you

#

oh

#

they fixed it

#

nice

wet breach
#

guess I will never know πŸ™‚

noble lantern
#

before it would make your class file really weird as it thought it was a seperate class inside the file

#

now it dynamically changes it

#

really nice glad they fixed that

wet breach
#

they probably didn't like the fact that netbeans was beating them on convenience and logical features

noble lantern
#

wait did LazyBlu leave lmao

vocal cloud
#

Yeah

noble lantern
#

lmfao

#

mans asked for help, got an answer and left

vocal cloud
#

Probably embarrassed

noble lantern
#

i embarrass myself on a daily basis in here

#

like forgetting --remapped argument in buildtools

#

and shit talking it thinking it was mavens fault lmao

wet breach
noble lantern
#

imagine someone creates a help post on spigot

golden kelp
#

whats the largest GUI size for chest GUIs?

#

max row count

noble lantern
#

and then they delete the post after getting an answer

eternal night
#

9*6 iirc

noble lantern
#

54 slots

golden kelp
#

Aight thanks

#

6 rows, 9 columns?

noble lantern
#

yee

golden kelp
#

Aight thanks

#

nice that its 69

wet breach
#

or is it 9 rows and 6 columns o.o

noble lantern
#

o.O

golden kelp
#

no no

noble lantern
#

i love enums

golden kelp
#

i bet no one hates them

noble lantern
#

have you tried storing a value in an enum yet zacken

wet breach
#

there is times where enums suck

noble lantern
#

okay good

#

i use it for config paths a lot

#

so usefull

golden kelp
#

hashmap<enum, ?>
??

wet breach
#

well storing a value in an enum is pretty much the point of the enum

noble lantern
#

especially if theyre overused

golden kelp
noble lantern
#

when i learned -

#

what

golden kelp
#

Yea one for every outcome

noble lantern
#

bruh

golden kelp
#

i was making a vid on how to make the worst plugin

#

but then stopped it

#

i also used 2 arrays with matching index, instead of hashmap everywhere

#

it was a pain, mroe of a torture

wet breach
#

did you know that enums count against the stack size limit πŸ™‚

noble lantern
wet breach
#

use too many of them and you can crash the JVM because the stack size of the JVM is too small πŸ˜›

golden kelp
#

woah

golden kelp
golden kelp
noble lantern
#

i know of something even worse

#

sec

golden kelp
#

the one method-do multiple thing its godlike

noble lantern
wet breach
#

stack recursion can be fun

#

until it breaks of course

noble lantern
#

java heap: pls help me

lavish hemlock
#

CRUSH THE TINY, INSIGNIFICANT HEAP INTO PIECES

#

MUHAHAHAHA

noble lantern
#

the heap did not deserve that :((

golden kelp
noble lantern
wet breach
#

guess it ain't much surviving after that

golden kelp
#

how

#

did u use a formatter and then deformat it?

noble lantern
golden kelp
wet breach
#

who needs an IDE when we can just commit directly

golden kelp
#
public static void t() {
  Bukkit.getScheduler().runTaskTimer(JavaPlugin.getPlugin(Main.class), () -> {
    throw new NullPointerException("get fucked kid");
  }, 0, 0);
}
noble lantern
#

grr

golden kelp
noble lantern
#

thats how technology on the first space shuttle worked

golden kelp
#

da foq

#

those gods

noble lantern
#

they were hand made too

#

sec

rough drift
#

straight fax

noble lantern
#

ill find a video or picture

wet breach
#

basically why it had all them fancy switches

noble lantern
#

behold

wet breach
#

well, there needs to be a fancy hash in there of the class

noble lantern
#

less than 1mb of ram

golden kelp
#

who the fuck needs to write in bytecode when you can make your own program which writes itself

nvm half way this msg i forgot eevrything

golden kelp
rough drift
noble lantern
#

its called going outside

golden kelp
golden kelp
golden kelp
noble lantern
#

spigot plugin developers touching grass for the first time, circa 2022 colorized

wet breach
#

love the fact that you say colorized

#

implying that they were living in black and white times

noble lantern
golden kelp
wet breach
#

I doubt you are that old

golden kelp
#

nah i m 22 not dat old

noble lantern
#

im 67

wet breach
#

so you born when broadband internet hit the shelves

golden kelp
#

Please take care of yourself for just 2 years the highest

wet breach
#

didn't even get to hear them awesome dial up tones

golden kelp
noble lantern
#

ngl

#

i wonder who the oldest spigot dev is

golden kelp
#

my first coding lang was QBasic, thats how old i am

wet breach
#

@knotty shell

golden kelp
noble lantern
#

nah

wet breach
#

is currently the oldest that I know of

noble lantern
#

hes like 24ish i think

golden kelp
wet breach
#

It surprised me how many people don't know how old MD is

golden kelp
#

if i may know

noble lantern
#

he looked really young in the mincone pic

#

so i imagine mid 20s

golden kelp
#

did md make the md5 hash πŸ˜‚

noble lantern
#

md5 hash is old as balls

wet breach
golden kelp
#

ohhh

#

legend i see

noble lantern
#

oh nvm

#

only since 1992

noble lantern
golden kelp
wet breach
#

if it helps

#

MD is younger then me

golden kelp
#

da foq

noble lantern
#

frost is 30 confirmed

wet breach
#

31

golden kelp
noble lantern
#

SO CLOSE

rough drift
noble lantern
lavish hemlock
#

wait

#

Rivest?

#

is that one of the same guys who made RSA?

wet breach
#

yes

lavish hemlock
#

huh

#

TIL

noble lantern
#

i mean he worked there in that picture i sent

#

so i assume so

golden kelp
# wet breach 31

yo idk why i respect older peeps ( no offence ) online who still code, like i found a 70 year old grand pa yesterday and damnthat dude was contributing to linux

wet breach
#

its not like we magically forget

#

XD

#

its like saying you respect people who still drive cars

golden kelp
#

xD

tall dragon
#

i would prefer advice from older people tbh

golden kelp
#

which one is MD in his twitter header?

tall dragon
#

more likely to be good advice

golden kelp
#

da foq

#

twitter images dont work the way they are supposed to

noble lantern
tall dragon
noble lantern
#

exactly

golden kelp
#

Man will have the Bukkit Scheduler wiki learnt by heart,

Yea so to make it run once you can do this and then that and then that

wet breach
noble lantern
#

i can semi do that rn

#

but not with anything pre 1.13

wet breach
#

Now just need to wait for a new person to blow their minds in that you don't have to do everything in Java and still use it in Java πŸ™‚

#

think I need to wait like another 5 years for a new breed of developers

noble lantern
#

mmm breeding developers

#

just right click a developer with coffee

#

and wait 15 mins

#

okay mr record class

wet breach
#

well might as well just pause the program if you want that

tall dragon
#

πŸ˜„

#

would be so cool

noble lantern
#

i should check the docs

golden kelp
#

everything should be string, and then the value is binary

noble lantern
#

store boolean values as strings

tall dragon
#

all my sql operations should be done synchronous

#

!

noble lantern
#
String isValid = "true";

if (isValid.equalsIgnoreCase("true")) // doStuff
tall dragon
#

ye no idea

noble lantern
#

why are my databases deleted and pwned

golden kelp
#

prepared statements are reallll ficking good

#

ooo guys

#

better plan

#

everything should be hand written

#

then scanned

#

and then printed, and then scanned,. and then run

noble lantern
#

actual menace

golden kelp
#

no its called being recursive without need

noble lantern
#

how to get tab completions working for notepad IRL version

golden kelp
#

sorry we dont support that, its outdated

#

we use notepad++ irl version

noble lantern
#

damn

#

ayo wtf

#

the spigot banner finally loaded for me

#

after like a year

#

oh i just print my data out in my printer

#

and load it with my scanner

wet breach
noble lantern
#

my hp printer is dogshit

tall dragon
#

yea do u guys ur printers just never work too?

#

fricking hp

noble lantern
#

tried printing 2 pieces of sheet music today and it took like

#

45 minutes

golden kelp
#

hp

wet breach
#

I have a laser printer o.o

noble lantern
#

yep sam

#

DeskJet 2600 iirc

golden kelp
#

my dad has a old AF canon lbp 2900

noble lantern
#

im basically an expert after today on my printer

wet breach
#

I have one of them big ones, think its a Brother or Canon

#

so I never have issues really unless it decides to eat a piece of paper or two

noble lantern
#

does it have connectivity issues

wet breach
#

nope

noble lantern
#

mine just doesnt wanna print shit in the queue

#

like ittl queue

#

but

#

doesnt print

tall dragon
#

untill

#

it prints them 50 times

#

cuz u tried 50 times

golden kelp
#

xDDDD

wet breach
#

hmm wonder if HP ever fixed that exploit πŸ€”

noble lantern
#

hi jet and koto

quaint mantle
#

How i can launch the firework? Smth like crossbow function.

noble lantern
golden kelp
#

is there anyone here who uses twitter

wet breach
#

fun fact, fax machines and refrigerators can ddos people

quaint mantle
noble lantern
golden kelp
#

ffs this is the timeline in tech twitter

  • Web 3 Promoter
  • Programming Meme
  • Web Developer showing how hard JS and CSS are
  • Web 3 Promoter
  • Programming Meme
  • Web Developer showing how hard JS and CSS are
  • Web 3 Promoter
  • Programming Meme
  • Web Developer showing how hard JS and CSS are
noble lantern
wet breach
noble lantern
#

you may need to fiddle with its vector too

#

as it might just fly straight up