#help-development

1 messages Β· Page 504 of 1

tardy delta
#

if you really care about uniqueness just have an atomicinteger counter πŸ₯²

quiet ice
#

There are only 2^32 possible identity hashcodes and over the full lifetime of an application there can be much more than 2^32 objects. So some are bound to have duplicated hashcodes

glossy venture
#

so no 2^32 objects at once

ivory sleet
#

System::identityHashCode is fine as default impl for Object because whenever Object::equals is true, Object::hashCode should be the same for the 2 objects

#

And that obeys contract

tardy delta
#

isnt Object#hashcode native?

quiet ice
ivory sleet
#

It returns identically to identityHashCode

#

iirc

slim wigeon
#

Let me say this, I had a hashmap check function where the block.getDrops(item) is if( Arrays.asList(BlockFace.UP,BlockFace.DOWN).contains(face) ) { for(int x = -size; x <= size; x++){ for(int z = -size; z <= size; z++){ if( !(x != 0 || z != 0) ) { continue; } if( !block.getRelative(x, 0, z).getDrops(item).isEmpty() ) { block.getRelative(x, 0, z).breakNaturally(item); } }} }But if you had the hashmap with 25-100 objects, what is there to improve?

tardy delta
#

hmm

glossy venture
#

but 4 billion objects is a lot

#

more than enough

quiet ice
#

That max address size for 32 bit applications if 2-4Gb fyi

glossy venture
#

yeah but an object reference isnt an address

wet breach
wet breach
quiet ice
wet breach
#

this is because that each object doesn't take up a full 32bits to address and also how Java addresses objects as well

glossy venture
#

if u had 4 billion Objects im pretty sure the headers would already be over 32 gb of memory

glossy venture
#

how

#

at once

quiet ice
#

The identity hashcode field is already 64 bits long

#

However since the object is not aware of it's own address I can fairly state that no, there can be more than 2^32 objects at the same time

tardy delta
#

16 byte object headers sometimes πŸ™

glossy venture
#

isnt the first 64 bits multi purpose

#

not just identity hash code

quiet ice
#

But the identity hashcode part is 64 bit long

glossy venture
#

where is that stored

quiet ice
#

Ah no. I read it wrong

wet breach
glossy venture
#

theres physically no way to reference more than 2^32 objects with 32 bits

wet breach
#

that means in a single 32bit address size, you could store 4 objects

quiet ice
#

The identity hashcode is - contrary to popular belief - not the memory address, so the fact that it is 31 bit long is irrelevant

glossy venture
#

no shit its an int

quiet ice
#

Ugh. Let me just do a test then

glossy venture
#

object references?

wet breach
quiet ice
glossy venture
#

wtf now we talking abt cpu instructions??

tardy delta
#

bytecode ig

glossy venture
#

you mean addresses

glossy venture
#

what if another object gets that reference normally

#

without compressing

#

you still only have 2^32 possibilities

#

right

wet breach
#

if java didn't compress yes

glossy venture
#

that doesnt give u more possibilities in a 32 bit number

wet breach
#

I think you are not understanding

#

here is an analogy in how you can fit more in less

glossy venture
#

im 100% sure im not understanding

wet breach
#

if you have 32 slots, but 64 things. Nothing said you could double up the things in a single slot. So therefore, you could place 2 things in each slot

#

the amount of things exceeded the number of slots

#

but it still stored them

quiet ice
#

If I had more than 32 Gb of memory I might be able to test it for use but as it seems I am unable to obtain enough space vm-wise

tardy delta
#

are we talking about storing partial objects in an address space πŸ‘€

glossy venture
quiet ice
#

But it still seems to be able to use up 20 Gb no problemo

glossy venture
#

im talking about object references here not addresses

glossy venture
wet breach
quiet ice
#

Aren't they the same thing fundementally so?

glossy venture
#

nah a reference is not an address into memory im pretty sure

quiet ice
#

...

#

You mean reference?

glossy venture
#

object reference

wet breach
glossy venture
#

that 32 bit number

tardy delta
#

isnt that an address offset?

wet breach
#

but there does have to be at least 1 pointer

quiet ice
glossy venture
#

yeah?

quiet ice
#

I already said it before lol

glossy venture
#

all i know is that i read in the jvm spec that object references are 32 bit unless youre on a 64 bit system and have more than 32 gb of memory allocated to the jvm

quiet ice
#

There is bound to be duplication in the i-hashcode

glossy venture
#

i mean at once

#

a reference doesnt need to account for past objects

wet breach
quiet ice
#

Even at once there could be more than 2^32 but you need a very beefy PC for that

glossy venture
#

and if there is one

#

dont use java

glossy venture
quiet ice
#

In the future you might see such usage

glossy venture
#

right

#

ig theyll update the jvm then

wet breach
glossy venture
#

ok yeah

#

how can one pointer point to 2 8-byte objects

wet breach
#

because you have an offset

glossy venture
#

to memory?

#

does java multiply the object reference by 32 bytes and use that or smth?

wet breach
#

yes, and as well as if memory didn't have one you could just have your program remember the offset of a given address

glossy venture
#

im so confused

#

so one object reference can point to two objects?
im not talking about pointers into memory im talking about jvm object reference
the values passed around on the stack and shit during execution of a java program to reference objects on the heap

wet breach
#

jvm object references requires at least 1 pointer

glossy venture
#

so the object reference points to a table which has a pointer to the object in memory

tardy delta
#

how would you exhaust the amount of addresses on the stack πŸ‘€

#

i believe im mixing up between the word address and reference lol

glossy venture
#

or does a reference contain the pointer into memory

#

for an object

wet breach
#

typically they contain the pointer into memory, otherwise some equality checks wouldn't really be possible

glossy venture
#

but that would limit it to 32-bits of memory

#

so like 4 gb

#

which it isnt

wet breach
#

if we assume each object takes up an entire memory address width

glossy venture
#

wtf is a memory address width

#

you mean like a byte for normal pointers

#

how big one block is?

tardy delta
#

seems to contain a ptr and a header

#

now everyone's gone and i dunno why :(

glossy venture
#

yeah a pointer to the class

#

and the mark word

tardy delta
#

which is the header with hashcode info

#

and gc info etc

glossy venture
#

yeah

#

but thats not the reference right

#

thats the header

#

for the data

tardy delta
#

ye

#

but what reference are we talking about cuz im messing up πŸ’€

glossy venture
#

object reference

#

s

#

on the stack

wet breach
# glossy venture how big one block is?

it can vary, however it should be noted that I refer to modern stuff therefore PAE is most likely going to be enabled/available on a given system. PAE makes use of virtual addressing that is then mapped to physical addresses. Thus allowing you to use less of the physical addresses at once

glossy venture
#

isnt that on every single OS ever
virtual memory

wet breach
#

it is similar how you can have 300 threads, but your processor only have 2 logical threads

wet breach
#

you are thinking of paging

tardy delta
#

is that the thing that the cpu caches when it requires smth within that page?

#

like block of memory

glossy venture
#

if i write

*((void*)0)

in c++ that doesnt try to access address 0 of my physical memory right

#

the process has its own memory space

wet breach
tardy delta
#

me trying to free nullpointers uwu

glossy venture
#

well yeah ofc it depends on the system its something the OS has to do but every modern OS does that

tardy delta
#

average programmer

wet breach
#

you don't know about for loops?

#

packages in java are just directories

tardy delta
#

Class.forName

#

you were given the solution

#

or well a wack solution

wet breach
#

lol

#

a solution regardless though

#

no one said it had to be the ideal one πŸ˜›

tardy delta
#

why would you even need that, too lazy to register classes yourself?

#

just wondering

#

its good to be lazy

glossy venture
#

for unloaded classes

tardy delta
#

ye <insert for loop and try with resources here>

#

isnt there a reflections dependency thing

#

org.reflections

glossy venture
#

yeah

tardy delta
#

i believe

glossy venture
#

idk if that works for unloaded classes though

#

and if it does it has to do it a similar way

tardy delta
#

better hope so

#

i would just implement it myself

#

how many items?

#

i smell hardcoded things

#

i was thinking about loading items from json files but loading behaviour doesnt really work πŸ’€

glossy venture
#

load from lua

tardy delta
#

ew

#

straight up assembly ofc

#

πŸ’€

cinder abyss
#

Hello, how can I kill a player with a custom cause ?

#

then show this custom cause in the chat

tardy delta
#

isnt there a SomeEvent#setDeathMessage

remote swallow
#

PlayerDeathEvent

#

you just kill her and keep track that you were the one that killed her and keep track of the cause

vocal cloud
#

When you kill the player add some PDC you can read and remove in the death event?

remote swallow
#

^^

tardy delta
#

you just kill her

#

wow

#

you got something to say on that?

remote swallow
#

i dont remember typing her

#

or he

#

or anything relating to that

tardy delta
#

tell that in court

remote swallow
#

what date

tardy delta
#

bruh this somehow explains my current situation

remote swallow
#

i wanna do that

#

sounds fun

tardy delta
#

who ever said relational databases were fun

#

even json files feel more appropriate for this

#

i dont really get the relational part

flint coyote
#
  • it's easy to implement a changelog
remote swallow
#

anyone have intellij say it cant access a class but said class is in the same package

flint coyote
#

huh?

#

screenshot and further explanation?

tardy delta
#

intellij is having strokes recently

remote swallow
#

ive got an abstract class and a normal class in my lib, same package but the class is unable to access it, still builds fine just visual error

flint coyote
#

sounds like you wanna clear caches

remote swallow
#

i should do that shouldnt i

#

love the fact it worked and i forgot about caches

pseudo hazel
tardy delta
#

about three months ago

vocal cloud
#

Increase ram usage to 10GB

exotic zinc
#

Bukkit recommends Netbeans anyway

remote swallow
#

thats because md uses it

eternal oxide
#

Use whatever you prefer, but support is most likely on InteliJ and Eclipse

vocal cloud
#

Most support is for intellij

tender shard
#

netbeans is a shit IDE

#

I gave it a try many times

#

it cannot even auto-complete pom.xml files

#

I understand that md uses it, because that's probably how he learnt java, but honestly speaking, it's a shitty IDE that has next-to-none maven support

#

I hate IntelliJ every day, but it's still the best thing out there as of today

eternal oxide
#

free tops my requirements πŸ˜‰

exotic zinc
#

community edition

tender shard
#

eclipse is "okay" too but unfortunately the auto-complete is utter garbage

exotic zinc
#

is there any advantage of eclipse over IJ?

tender shard
#

"oh, you wanna get the display name of an itemstack? why don't you cast it to player?" ~eclipse be like

tender shard
#

imho IntelliJ is shit but still better than anything else

exotic zinc
#

why is it shit?

tender shard
#

it's not shit, but there's many issues with it. For example, please Ctrl+B into some random class, then try to "find references". it won't find any, even though there's refenceres in the same class

#

with "random class", I mean "decompiled classes"

exotic zinc
#

what

quiet ice
#

Yeah, if it has the sources available it can find references

tender shard
#

you'll quickly see what I mean

quiet ice
#

Eclipse has huge issues when sources are not attached

tender shard
quiet ice
#

You need to attach sources for it to find the references

tender shard
#

in the same class?!

#

lemme explain

quiet ice
#

Even in same class

tender shard
#

gimme a minute

quiet ice
#

ECD is total garbage

exotic zinc
#

intellij can download sources automatically

#

you dont need to attach anything by hand

quiet ice
#

CB does not have sources

tender shard
#

you guys don't understand the issue I'm describing

#

maybe I explained it badly

#

I will attach a screenshot in a few minutes

quiet ice
#

Well it's not that suprising that it is garbage given that ECD is based on literal malware

exotic zinc
tender shard
#

people saying "skill issue" are usually 14 year old jerks

exotic zinc
#

how did you guess my age?

quiet ice
tender shard
#

no usages found for "entityId"? I found at least 3 usages just by looking at it

quiet ice
#

Ah that is IJ

#

Thought you were talking about Eclipse

tender shard
#

yeah, as said, IJ is shit

tender shard
exotic zinc
#

thats maybe because it cant find usages in decompiled class files?

quiet ice
#

Because Eclipse has a similar issue there

tender shard
exotic zinc
#

yeah

quiet ice
exotic zinc
#

idk i thought you were talking about bugs

daring bear
#

Hi guys im intrested in creating a plugin anyone can help me setup the first file?

tender shard
exotic zinc
tender shard
#

it says there's no "usages" while they are clearly there, in the same file

tender shard
#

another issue is jetbrains "support" which is basically non-existent

#

(for the paid version, that is)

exotic zinc
daring bear
tender shard
daring bear
#

yea

#

im in the menu

exotic zinc
quiet ice
#

Quiltflower (Fork of FF) supports Tokenization and is used in Enigma for example. However IJ uses stock FF which does not support that feature

tender shard
#

that was like a year ago

exotic zinc
#

ok then it's really shitty

tender shard
#

I still agree that IJ is the best IDE out there

exotic zinc
#

but it doesn't make intellij shitty just because of this

tender shard
#

that is true

#

I'm just angry at jetbrains

exotic zinc
#

intellij has thousands of useful features. i forgive it for some minor things.

tender shard
#

true. but I pay for it, and I demand bugs to be fixed within like, at least a year

exotic zinc
#

then go to jetbrains

tender shard
#

as I said, I did

#

"working on it"

exotic zinc
#

no, i mean work at jetbrains

tender shard
#

how slow are their devs working

#

I cannot work there, I'm a lawyer, not a coder

#

I never studied any IT stuff

quiet ice
#

The main problem with IJ I have is that it only supports one project per window. That is why I still stick to Eclipse and won't ever dare to think about switching to IJ for the foreseeable future

tender shard
#

I also demand that a company is supposed to fix bugs themselves, even without me applying for a job there

#

is that too much to ask?

tender shard
#

idk about linux

quiet ice
#

And the main problem with Eclipse I have is that their debugger is a bit iffy if you don't have a setup that can be described as orthodox

#

On linux I haven't been able to replicate Eclipse's workspace feature to any degree

tender shard
#

tbh I switched to IJ 5 years ago because I hated this whole "workspace" idea lol

#

I want to have one project per window

exotic zinc
#

it has been reported 8 years ago

quiet ice
#

I truely love it if I am working with 2 - 5 projects at a time

exotic zinc
tender shard
#

imagine opening some project and eclipse opens 287 other projects

#

like

#

why?

exotic zinc
#

yeah thats funny haha

tender shard
#

I never understood it

#

what's the purpose of that

quiet ice
#

Ah, you probably are talking about m2e automatically resolving dependencies between projects

#

Really nice feature I must say

grizzled oasis
#
      let id = event.target.id;
      if (id.contains(button)) return;

Doesn't work on html/javascript someone knows an alternative to this?

quiet ice
#

Sadly it's not a thing in gradle world unless you use subprojects

exotic zinc
tender shard
quiet ice
#

No. it eclipse's maven integration that does it

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.

grizzled oasis
quiet ice
#

It basically sees "hey, project X is depending on Y. However project Z is actually Y, so we can make project X depend on project Z"

tender shard
vocal cloud
#

It's probably because the method they're looking for isn't contains but includes

tender shard
#

but I guess everyone here knows that "gradle = maven - features"

quiet ice
#

Well the issue with maven is that it is far too locked down

tender shard
#

how so?

#

wdym

quiet ice
#

You can't add dependencies through plugins

tender shard
#

ofc you can, but why would you

#

that is easily possible?

quiet ice
#

You cannot. At least not conventionally

tender shard
#

every plugin can add dependencies

#

but, as said, why would you?

quiet ice
#

Ah yeah they can, but the IDEs will fail to find them

#

The IDEs only evaluate the POM but never execute them

tender shard
#

that's eclipse's fault then

quiet ice
#

Also applies to IJ back when I tested

#

Hence "The IDEs"

tender shard
#

maybe, idk. I just declare dependencies when I need them

exotic zinc
#

wym by executing the pom?

tender shard
#

he means "eveluating"

quiet ice
#

No

tender shard
#

then idk

quiet ice
#

I mean executing a noop task (such as :nothing in gradle)

tender shard
#

why dont you just add the dependency

quiet ice
#

Because it is computed at compile-time

tender shard
#

wtf

exotic zinc
#

but really,,,,, if you need such features switch to gradle....

tender shard
#

gradle users be like "i want my build to reproducable" and then they they are like "oh I want this dependency to be computed at run-time" erm whjut

quiet ice
#

Basically it deobfuscates a jar and sets the access of classes and their members based on an accesswidener file that is dependent on a per-project basis

tender shard
#

it "deobfuscates" it? how? for what? to compile?

#

why don't you simply have the deobfuscated version in your local maven repo

quiet ice
tender shard
#

just use the mojang mapped artifact?

quiet ice
#

However I cannot do that the way you are familiar with since I am using the accesswidener system

#

So I'd need a jar for every project and that'd get messy real quick

tender shard
#

how so? just run buildtools with the -remapped flag

#

then you got the "unobfuscated" version in your maven repo

quiet ice
#

it's not minecraft-related. I'm just using minecraft-related comparisions since you have no clue what I am doing

tender shard
#

you only mentioned minecraft, so that's the only thing I can talk about

wet breach
#

lol

tender shard
#

but you do you, ofc

#

I'll go take a bath now

quiet ice
#

Technically it is 95% minecraft-based technologies being applied on a non-minecraft setting

exotic zinc
#

again, why are you use maven where it seems to be much more complicated than just using gradle and write your own task to do things?

tender shard
#

but you can use it, if you want to, ofc

quiet ice
#

gradle has the issue of being a bit hard to debug

daring bear
#

@tender shard followed the tutorial and got to here:

package me.Sylent1305.skyblockplugin;

import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.plugin.java.JavaPlugin;

public class SkyBlockPlugin extends JavaPlugin {
    @Override
    public void onEnable() {
        getLogger().info("Yo bro, my awesome plugin is indeed working!");
    }

    public void onJoin(PlayerJoinEvent event) {
        Player player = event.getPlayer();
        if (!player.hasPlayedBefore()) {
            player.sendMessage("Welcome to the server, " + player.getName() + "!");
        }
    }
}

but its not working can you help me understand why?

tender shard
#

you are fine to use gradle if you want to

exotic zinc
remote swallow
tender shard
quiet ice
#

Though I have figured out that you can append --debug to the gradlew command to debug gradle from your IDE

tender shard
#

imagine needing to study for 4 years just because you wanna do a simple thing

#

nah

wet breach
twilit roost
#

im trying to optimize my plugin (minigame)
which makes new void world for instance

I tried unloading all worlds and loading them only on demand, but this resulted in Loading terrain when player tries to access them, even tho I loaded that world before hand.

any ideas why it occurs?

my load world:
https://paste.md-5.net/bopotahuce.java

tender shard
#

"how to shade a library in gradle and relocate it?"

OH I forgot, it's not possible in gradle πŸ₯²

daring bear
#
package me.Sylent1305.skyblockplugin;

import org.bukkit.entity.Player;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.plugin.java.JavaPlugin;

public class SkyBlockPlugin extends JavaPlugin implements Listener {
    @Override
    public void onEnable() {
        getLogger().info("Yo bro, my awesome plugin is indeed working!");
    }

    public void onJoin(PlayerJoinEvent event) {
        Player player = event.getPlayer();
        if (!player.hasPlayedBefore()) {
            player.sendMessage("Welcome to the server, " + player.getName() + "!");
        }
    }
}

like that @remote swallow ?

exotic zinc
tardy delta
#

dont you need an @EventHandler

remote swallow
tender shard
#

just use the maven-exec plugin?

wet breach
quiet ice
exotic zinc
remote swallow
tender shard
#

okay first of all, you should NOT use your build tool to start a server.
BUt if you wanna do it, just add the maven-exec plugin to your pom, then tell it the args "java", "-jar", "server.jar", and that's it?

#

I don't understand how that'd be an issue

remote swallow
remote swallow
#

a gradle plugin

exotic zinc
#

gradle task to run a server

tender shard
#

lmao funny

#

that's all you need in maven

remote swallow
#

we can also do it without a plugin

#

most people just cannot be bothered

exotic zinc
remote swallow
#

run paper also downloads the jar

tender shard
exotic zinc
#

what has that to do with the incomplete explanation on what is responsible for what. we have bukkit and its implementation craftBukkit and we have spigot. When do i make changes to (craft)bukkit directly and when do i make changes on spigot?

remote swallow
#

craftbukkit has changes for the bukkit api

tender shard
#

gradle is great for people who just wanna do things without understanding. they just copy/paste stuff and then "keep it like that" because "it works in gradle 7.3"

#

it's also great for people who spent 2 years into understanding how exacrtly it works

#

it's bad however for everyone inbetween

exotic zinc
#

idk. Somehow you all have different opinions than everyone else i have talked about this topics.

wet breach
#

probably because we understand the two different build systems

tender shard
exotic zinc
tender shard
exotic zinc
quiet ice
#

90% of what you can do with gradle can be done with maven, same vice-versa suprisingly enough

wet breach
#

gradle is nice if you want a more procedural build system, utilizing scripts and the sorts

#

where as maven is all about making use of plugins

wet breach
#

as far as performance goes, both are the same unless you got a super massive project but even then it still depends in what it needs

#

otherwise small projects you will never notice a difference between the two

exotic zinc
#

yeah

#

for small projects maven works fine

#

i also rather use maven over gradle for plugins

wet breach
#

maven works fine for large projects too. Just most people don't know you need to tell maven to use more resources before it actually will. Maven is conservative where as gradle is the opposite in this regard

exotic zinc
#

just dont understand why spigot doesn't m or at least provide a way to test the changes without me having to definite 17 run configurations

tender shard
#

gradle usually takes like 30 minutes longer

#

it needs to downloads itself

#

then it sets up its own repo in the project folder

exotic zinc
#

you can just downloaded gradle from its website and tell IntelliJ to use that one?

#

over the wrapper

wet breach
#

it depends on the project

tender shard
#

you can, but how's that going to work if this specific build file only works with "gradle 6.3.1"

quiet ice
#

Well at least you have the wrapper

exotic zinc
#

then you shouldn't use them.

exotic zinc
tender shard
#

funny

quiet ice
#

It's worse when the dunce that uploaded the project doesn't include the wrapper

tender shard
#

"I just cloned this repo that only works on gradle 6.3.1. But I use gradle 8.0. Guess I'll just not use it" lmao

#

funny idea

exotic zinc
#

yeah

#

why rely on old shit

tender shard
#

you do you

exotic zinc
#

fork it and make it work for new versions

tender shard
#

you do you

#

maven builds are reproducable on basically every version

exotic zinc
#

it has been 2 major versions in-between? time to update.

tender shard
#

3.6? 3.8? who cares

#

it works

tender shard
quiet ice
exotic zinc
#

this is like ah "uh oh why does this not work on my 1.8 Minecraft server" buddy you expect a 2014 released Minecraft server to have the up to date features?

wet breach
#

maven works so well, that a lot of the times, I forget to update maven plugins XD

tender shard
exotic zinc
#

same difference

quiet ice
#

Nor is there no 3.8.0 iirc - but 3.8.1 does exist

exotic zinc
#

outdated shit, shouldn't be used

wet breach
eternal oxide
#

tell that to my car

quiet ice
wet breach
exotic zinc
wet breach
tender shard
#

yeah whatever, you're a bit weird, I don't feel like talking to you anymore. Everyone knows that gradle breaks build files on every update, while maven does not. Everyone also knows that maven build files are detailled and just work fine on the next update, while gradle cannot even decide on which language to use (kotlin, groovy, and the other thing they used earlier). There's also no archetypes in gradle, btw. But granted, gradle fanboys like to just copy/paste other people's stuff, so that's fine, I guess

exotic zinc
tender shard
#

let's all agree, 1.8 is dead and shit

#

maven, gradle, whatever ... 1.8 is shit

#

and dead

#

and should be dead

quiet ice
#

frostalf is making a good point in that it is really a personal matter. At long as someone uses it it isn't truely dead

tender shard
exotic zinc
echo basalt
#

even hypixel is doing the switch

slim wigeon
wet breach
slim wigeon
#

But know this is the dev channel we talking on

echo basalt
wet breach
#

I agree 1.8 is old and people shouldn't use it, however my reasoning for people not using it is mostly because they are going to encounter issues they don't know how to fix on their own even though they were warned

slim wigeon
#

Or viaVersion for 1.8 but yes, its backwards

exotic zinc
tender shard
#

yeah anyway, whatever. gradle is an awesome piece of software. it just doesn't come close to maven, which actually is able to do reproducable builds

remote swallow
wet breach
zealous scroll
#

Is there a way I can check if a player's hitbox will collide with a nearby non-passable block (like a door or solid block, but not grass) upon teleporting them to a location? If they do collide, I want to be able to shift their hitbox out of the way of the collided block.

I've tried checking for collisions using Player#collidesAt and World#hasCollisionsIn but they only return a boolean and not the points the box collided with, so I can't shift the location back out of the obstacle's way

Example of what I mean:

tender shard
zealous scroll
echo basalt
#

it is

zealous scroll
#

yeah i've tried raytracing but that does a single line and i need to account for the player's hitbox. and ray sizes are only taken into account for entity collision checks

slim wigeon
# wet breach not everything outdated has security problems

Running a outdated version of MineCraft is not a bad thing, When I was searching stuff I don't remember on Bukkit on how to use a API. All I seen is threads on 1.16 and in 2016. I knew that code was not going to work on the latest version of MineCraft or 1.19.3 in my case. I think I was trying to add a custom enchantment and I seen a function is deprecated. I did not know what was happening

#

Its like trying to run newer programs on Windows 98 for a example, there is a cause of something not working

#

So don't be scared to run any of these versions, just create a new profile and set a directory for that profile so it does not interfere with the .minecraft folder. I done talking about this

exotic zinc
#

idk if its only on paper but their javadocs mostly provide a reason why it is deprecated and, if there is one, a replacement

slim wigeon
#

I know

tender shard
#

the paper javadocs basically deprecate everything

exotic zinc
#

no paper depreciates everything

opal juniper
#

Adventure

exotic zinc
#

and in most cases the deprecation has a valid reason

exotic zinc
remote swallow
exotic zinc
#

Adventure is great,,,, once you get used to it

tender shard
#

Paperβ€˜s deprecated. The spigot works just fine

slim wigeon
remote swallow
tender shard
exotic zinc
#

yes

tender shard
#

i still wonder why they called themselves "paper", which obviously gets destroyed by a spigot. why did they not call themselves "hydrant", which is basically a "super-spigot"

#

but yeah we all know, paper staff is a bit slow

exotic zinc
#

but i can understand why you are so pissed about paper. They take your work and make it better.

tender shard
#

I have never contributed anything relevant to spigot

exotic zinc
#

you = plural in this case

tender shard
#

ah ok

#

better? Nah, I doubt that

#

they have accomplished to turn a nice fork into sth that's incompatible with upstream

#

but this is not the correct place to discuss this

#

paper was nice a few years ago

exotic zinc
#

at this time its probably just a matter of fact until paper drops spigot support and goes for the hardfork

slim wigeon
#

...```irectory of D:\Home\Servers\MineCraft.Launcher - PAUSED\Versions\Paper

[.] [..] 1.10.2.jar 1.11.2.jar 1.12.2.jar 1.13.2.jar 1.14.4.jar 1.15.2.jar 1.16.1.jar
1.16.2.jar 1.16.3.jar 1.16.4.jar 1.16.5.jar 1.17.1.jar 1.17.jar 1.18.1.jar 1.18.jar 1.19.1.jar
1.19.2.jar 1.19.3.jar 1.19.4.jar 1.19.jar 1.8.8.jar 1.9.4.jar
22 File(s) 878,368,543 bytes
2 Dir(s) 665,099,268,096 bytes free```

tender shard
exotic zinc
#

haha no

tender shard
#

I hope they won't do it

#

paper is, and was, supposed to be an "addition" to spigot

eternal oxide
#

I hope they won;t. I've no interest in plugin deving for Paper. Not going to do it.

tender shard
#

if they actually wanna "do their own thing", they gotta listen to what others said, and claim "spigot's api is copyrighted" and stpo using it

#

yk

#

can't claim "craftbukkit is copyrighted", then keep on using it

slim wigeon
eternal oxide
#

"helpful" Is that marketing speak for toxic?

tender shard
#

that's just ChatGPT

tardy delta
#

Similarly, if gnomes snuck into your house at night and replaced the internals of your TV remote with a different (but compatible) technology, you probably wouldn’t even notice! lol

ivory sleet
#

guys this type of debate doesn't suit in this channel

tender shard
#

true

#

let's rather talk about chickens

exotic zinc
slim wigeon
tender shard
#

is this a beautiful chicken, or is it not?

eternal oxide
#

he's looking at me

tender shard
#

at you too?!

#

I thought I was the only one

eternal oxide
#

he definitely has eyes for me

slim wigeon
eternal oxide
#

ask a question then πŸ™‚

tender shard
#

I'll help your mom to develop, but she didnt ask any question

opal juniper
#

programmatic differentiation without using first principles?

exotic zinc
#

can i have en example of the state pattern please?

slim wigeon
#

Back to my plugins I guess

eternal oxide
#

I'd push my glasses up the bridge of my nose and compile an answer... but I know you were not serious πŸ™‚

opal juniper
#

i saw it in an AI video recently but it made me cringe seeing them pluging in 0.00000000000000000001 as h

#

πŸ˜„

glossy venture
#

?paste

undone axleBOT
tardy delta
#

i still keep calling it async spigot

worn tundra
#

Is there any reason why a spigot commandexecutor only spits this out in chat if there's an error in any code that affects the command, but nothing in the console? I'd expect a stacktrace, but it's almost as if the commandexecutor eats the error up in a try catch somewhere?

glossy venture
wet breach
#

only exceptions cause there to be stacktraces

#

so, that means there could be something like not registering the command

#

being the problem

slim wigeon
tender shard
#

or gradle

wet breach
tender shard
wet breach
#

that paper provides a secure software

tender shard
#

haha erm ok

wet breach
#

I just said they don't provide security

tender shard
#

yeah this is one of those 50/50 chances where I agree with you

glossy venture
#

so im trying to download and load them at runtime

#

with eclipse aether

eternal oxide
#

why not do your own? its quite basic

cinder abyss
#

Hello, how can I get the players in a chunk ?

glossy venture
young knoll
#

Does Chunk have a getPlayers?

#

If not World#getPlayers and filter

cinder abyss
remote swallow
#

stream and filter it

cinder abyss
# remote swallow stream and filter it

I've got this but I can't convert :java List<Player> player = (List<Player>) Arrays.stream(event.getChunk().getEntities()).filter(e -> e instanceof Player).toList();

remote swallow
eternal oxide
#

yes, if you change the address

cinder abyss
#

Inconvertible types; cannot cast 'java.util.List<org.bukkit.entity.Entity>' to 'java.util.List<org.bukkit.entity.Player>'

young knoll
#

You need to add a cast in your stream

cinder abyss
remote swallow
#

Arrays.stream(event.getChunk().getEntities()).filter(entity -> entity instanceof Player).map(entity -> (Player) entity).collect(Collectors.toList());

cinder abyss
#

I replaced .collect(Collectors.toList()); with .toList to get a List πŸ‘

eternal oxide
#

teh Collectors.toList() is just backwards compatible

ivory sleet
wise mesa
#

does ItemDisplay#isDead() always return true

cinder abyss
#

My plugin is only compatible with 1.19+ so I think I can use this

tardy delta
#

ye

chrome beacon
twilit roost
chrome beacon
# twilit roost yes that screen

That's client side loading. The client needs to get the chunks from the server also Mojang hardcoded a 2 second minimum loading time (This has been fixed in a snapshot I believe)

twilit roost
#

just why would they hard code it :D
also that loading screen goes forever

#

or atleast 1 minute

chrome beacon
#

You can install that to help

twilit roost
#

looks good
but how can I actually make it load, since it just won't ever load those chunks

#

or so I think

#

I can't see whats in that world

young knoll
#

The 2 second hardcode is gone in latest

twilit roost
#

great

eternal oxide
#

yes Teams

young knoll
#

Seems they did it to hide the client falling through the ground

#

lul

twilit roost
#

my problem isn't waiting for it to load
idc 'bout that

i only have problem with it loading the world or chunks
since I can't seem to ever load into that world (no matter that 2 sec)

eternal oxide
#

then packets

slim wigeon
#

How do I access a plugin from one plugin?

young knoll
#

Bukkit.getPlugin(name)

#

Or the other plugin may have some sort of api

slim wigeon
#

I trying to make a shop plugin and have my farm rod plugin add its custom items to the shop

quaint mantle
#

Anyone want me to make them a free custom plugin? DM me

tardy delta
#

?services

undone axleBOT
slim wigeon
#

Do I need to do what vault did? private boolean setupEconomy() { if(getServer().getPluginManager().getPlugin("Vault") == null) { return false; } RegisteredServiceProvider<Economy> rsp = getServer().getServicesManager().getRegistration(Economy.class); if(rsp == null) { return false; } economy = rsp.getProvider(); return economy != null; }

young knoll
#

You can

tardy delta
#

if you dont have a service provider, no

young knoll
#

If you want to

quaint mantle
#

Anyone want me to make them a free custom plugin? DM me

quiet ice
#

that being said using services is rather rare

slim wigeon
#

I just trying to access my plugins from one. Like a core plugin if you call it

quiet ice
#

The only plugin making active use of the service interface that I know of is vault. But that is about it

eternal oxide
#

and permission plugins

slim wigeon
#

I don't want to combine all my plugins to one huge plugin just to add a server shop with my Timber Axes, Hammers, Shovels, Portable Chests and Gps Compasses

#

And Farm Rods

#

6 different plugin files (.jar)

young knoll
#

Then like I said

#

Just use getPlugin

#

Or provide some kind of api to obtain an instance

quiet ice
#

Or design your plugin(s) in a way that the plugin instance is not needed

slim wigeon
quiet ice
#

no. I'm talking about the forbidden keyword

slim wigeon
#

Forbidden?

pseudo hazel
#

your plugins sound like they dont need to know about the core plugin at all

chrome beacon
quaint mantle
#

Anyone want me to make them a free custom plugin? DM me

quiet ice
pseudo hazel
#

?services

undone axleBOT
ornate patio
#

How can I tell if a player hit another player from behind? I'm trying to implement a feature where if you hit a player from behind you do bonus damage

#

It's just a lot of math with vectors which idk how to do

eternal oxide
#
    /**
     * Is the Player behind the Entity?
     *
     * @param player
     * @param ent
     */
    public boolean isBehind(Entity player, Entity ent) {
        Vector playerDir = player.getLocation().getDirection();
        Vector entityDir = ent.getLocation().getDirection();

        double relativeAngle = (Math.atan2(playerDir.getX() * entityDir.getZ() - playerDir.getZ() * entityDir.getX(), playerDir.getX() * entityDir.getX() + playerDir.getZ() * entityDir.getZ()) * 180) / Math.PI;

        return (relativeAngle <= 60 && relativeAngle >= -32);
    }```
echo basalt
#

grab the player's view angle

#

and compare

ornate patio
slim wigeon
young knoll
#

That’s why we have a forum thread

#

Which is moderated

ornate patio
#

too much maths

ornate patio
eternal oxide
#

sorry that shoudl be relativeAngle

young knoll
#

60 and -32

#

Interesting values

eternal oxide
#

wasn;t my code but I pinched it

ornate patio
#

alr testing it rn

#

Works perfectly, tysm

#

I should rlly study up on this tho

eternal oxide
#

that one is a bit tough to be honest

young knoll
#

Now how do I detect what body part got hit :p

eternal oxide
#

Ask him where the bad man touched him

slim wigeon
#

That is what this channel is for

eternal oxide
#

No, when you've been here longer than me I'll allow you to dictate how I behave.

young knoll
#

We’ve already told you

#

The simplest way is just Bukkit.getPlugin(name)

eternal oxide
#

^ you have already been given your answer, more than once

storm scaffold
#

Is there a way to make custom advancements in Spigot?

eternal oxide
#

Three ways, Create your own RegisteredServicePrivider, Use Bukkit.getPlugin(... or create an API in your plugin you can access via an instance.

young knoll
#

There is an experimental method to load a advancement from a json string

#

Or you can just have your plugin deploy a datapack

river oracle
#

I'm trying to make a simplified connection string for my config, but I'm kinda stuck when its coming to the regex to match the parts
nitrite:user@password:/home/user/path/to/database
(\S*?):
Currently I've come up with this regex but it only matches if there is a : character after the portion I'd like to match the end portion as well

Current:

Group 1:
- Match 1: nitrite
- Match 2: username@password

What I want:

Group 1:
- Match 1: nitrite
- Match 2: username@password
- Match 3: /home/user/path/to/database
eternal oxide
#

why regex and not String.split?

river oracle
#

different params in the future rn I'm hoping to start semi simple though I suppose String.split works for now

echo basalt
#

string.split does regex internally anyways

worldly mountain
#

Does anyone know if it’s possible to get the skin of a player and change the colors code wise? So I can for example make stone statues of players that way

#

If not it doesn’t really matter, just a fun idea I was forming in my head

eternal oxide
#

No skins come from Mojang and are signed

regal scaffold
#

Can I not make items take longer to eat using NBTAPI

nbtItem.setInteger("UseDuration", ticks);

#

I did it and now it seems like I can never actually eat the item, it's eating forever

ornate patio
#

How can I alter the speed of a particle effect

worldly mountain
eternal oxide
#

modifying it IS changing

worldly mountain
#

Yes but I don’t want to change it on the player

#

Get what I mean?

eternal oxide
#

yes I know, the answer is still the same

worldly mountain
#

Okay sadge

eternal oxide
#

Skins are downloaded by the client from Mojang not the server

young knoll
#

I’ve seen citizens load skins from a random image file

#

Idk how

worldly mountain
#

Yeah they do it

#

Skins have 2 values

#

A texture and signature or smth

#

And there’s tools, for example mineskin.org , to convert an image of a skin into those values

eternal oxide
#

they use the skins API (I forget the name)

#

still comes from Mojang

#

Mineskins

worldly mountain
#

yes that website

young knoll
#

Ah it uses that

#

Magic

slim wigeon
#

Anyone there that can help me with accessing this plugin?

young knoll
#

Sounds like you have 2 classes with the same package and name?

slim wigeon
#

Yes, same name. Is that my issue?

young knoll
#

Yes

hollow plume
#

How can I set a custom head skin (i'm using the last api verion 1.19.4-R0.1-SNAPSHOT)... i don't don't understand how to create a PlayerTexture object (and if i want to use a base64 code for the skin for example). It's even possible in this version?

young knoll
#

Yes

hollow plume
#

Ok, that a great starting point, how can i do this?

hollow plume
#

❀️ Tanks

slim wigeon
#

Still the same error, I renamed com.mrnategeek.serverShop.Main to com.mrnategeek.serverShop.ServerShop_Main

young knoll
#

You need to be using the same import

#

You can’t just magically cast it to a completely different class

slim wigeon
#
        if(getServer().getPluginManager().getPlugin("MGN_ServerShop") == null) { return false; }
        this.shop = (ServerShop_Main) getServer().getPluginManager().getPlugin("MGN_ServerShop");
        return true;
        /*
        RegisteredServiceProvider<Economy> rsp = getServer().getServicesManager().getRegistration(Economy.class);
        if(rsp == null) { return false; }
        economy = rsp.getProvider(); return economy != null;
        */
    }```
#
            getServer().getConsoleSender().sendMessage(ChatColor.YELLOW + "+ " + getName() + " Disabled (Server Shop not found)");
            getServer().getPluginManager().disablePlugin(this); return;
        }
        
        getServer().getConsoleSender().sendMessage("Creator: " + shop.creator);```
#

I tried everything

ornate patio
#

How can I get every mob within view of a player

young knoll
slim wigeon
young knoll
#

Did you make the same class in both plugins

slim wigeon
#

What you mean? com.mrnategeek.<pluginname>.<rootclass>, the pluginname and rootclass is the only thing different

young knoll
#

Oh you are trying to cast the main of one plugin to the main of the other

#

Yeah you can’t do that

#

You have to cast it to the main of the plugin it belongs to

slim wigeon
#

Can you show a example? I seeing examples of this being done by static and all that. I don't want to use that unless I have to

young knoll
#

Well

#

If I had a plugin called MyPlugin with a main class of me MyPluginClass

#

I would do

#

MyPluginClass <name> = (MyPluginClass) Bukkit.getPluginManager().getPlugin(β€œMyPlugin”);

slim wigeon
young knoll
#

Alright

#

How are you depending on the other plugin

ornate patio
#

is there an entity death by entity event

#

cause i cant seem to find one in the docs

remote swallow
#

that doesnt really show anything, do you have the other plugin as depend in plugin.yml

young knoll
#

Are you using maven

#

Gradle

#

Just depending on the jar?

slim wigeon
#

Maven

brave sparrow
young knoll
#

Are you accidentally shading the one plugin into the other

young knoll
remote swallow
#

what does the dependency look like

brave sparrow
ornate patio
slim wigeon
ornate patio
#

Any suggestions on how to get every mob within a player's views?

brave sparrow
#

Depends on what you define as the players view

ornate patio
#

Any mob within 90 degrees of where a player is looking, up to 20 blocks away i guess

eternal oxide
#

get all mobs within a 20 block range, then use the code I gave you (rewrite) to check if they are in the 90 degree arc of the getEyeLocation().getDirection()

ornate patio
#

i dont understand how to do the second part

eternal oxide
#

just reverse teh last line so it checks the correct angle, and change teh first to use the eye location not the players facing

#

I have a feeling those angles shoudl be 45 and -45 currently, so invert that for in front 135 and -135

#

I believe they are 60 and -35 currently as the player doesn't face directly forwards.

#

or somethign close

young knoll
#

The players body faces different from their head

#

Idk why they didn’t use that vector

eternal oxide
#

no clue

ornate patio
#

I'll see what I can do but im prob gonna come back for questions lol

ornate patio
eternal oxide
#

if you look at teh code you can see it currently uses the players Location

#

instead use the players getEyeLocation

#

then the last line use 135 and -135

#

I've not tried it, doing it from memory as no code in front of me

ornate patio
eternal oxide
#

MC uses 0 to 180 and 0 to -180 for direction

ornate patio
#

ah

#

and 180-45=135

#

also how do I access getEyeLocation

#

it's not a method of Player

eternal oxide
#

yes it is

#

cast entity to Player

young knoll
#

Inb4 1.8

ornate patio
#

oh wait im just blind

#

didnt realize the param was Entity and not Player

brave sparrow
ornate patio
#

I've altered the method to look like this

/**
 * Is the Player behind the Entity?
 *
 * @param player
 * @param entity
 * @param angle
 */
public boolean isBehind(Player player, Entity entity, int angle) {
    Vector playerDir = player.getEyeLocation().getDirection();
    Vector entityDir = entity.getLocation().getDirection();

    double relativeAngle = (Math.atan2(playerDir.getX() * entityDir.getZ() - playerDir.getZ() * entityDir.getX(),
            playerDir.getX() * entityDir.getX() + playerDir.getZ() * entityDir.getZ()) * 180) / Math.PI;

    return (relativeAngle <= 180 - (angle / 2) && relativeAngle >= -135 + (angle / 2));
}
#

oh wait

eternal oxide
#

180?

ornate patio
#

i just realized why am i modifying this

eternal oxide
#

why are you adding in (angle / 2) ?

young knoll
#

:D

ornate patio
#

yeah nvm ima revert it

eternal oxide
#

change method name too

#

to facing

ornate patio
#

Idk why my brain decided to modify the old function

eternal oxide
#

or is Facing

#

so you should end up with 2 methods, isBehind and isFacing

ornate patio
#

yeah ik

#

i just did a stupid

#
    public boolean isFacing(Player player, Entity entity) {
        Vector playerDir = player.getEyeLocation().getDirection();
        Vector entityDir = entity.getLocation().getDirection();

        double relativeAngle = (Math.atan2(playerDir.getX() * entityDir.getZ() - playerDir.getZ() * entityDir.getX(),
                playerDir.getX() * entityDir.getX() + playerDir.getZ() * entityDir.getZ()) * 180) / Math.PI;

        return (relativeAngle <= 135 && relativeAngle >= -135);
    }
eternal oxide
#

looks fine

ornate patio
#

so i'll just loop through player.getNearbyEntities(20, 20, 20)

eternal oxide
#

then loop over whatever mobs are within 20 blocks

ornate patio
#

and run that check

eternal oxide
#

I'd not do 20 up and down

#

well you could I guess

ornate patio
#

ur right actually

#

i'll just make it like 5

eternal oxide
#

so .forEach over it and add any that fit to a Set

ornate patio
#

i feel like i should also check to make sure theres no blocks in the way between the player and the entity

#

i could use a raycast for that right

eternal oxide
#

if you want line of site too, raytrace after checking isFacing

ornate patio
#

yeah ima do that then

young knoll
#

Just send out a million rays to find all entities in view

eternal oxide
#

πŸ™‚

#

use the raytrace with a predicate so you check for that specific mob

ornate patio
#

this is my current code without raytracing

player.getNearbyEntities(20, 5, 20).stream().forEach(nearbyEntity -> {
    if (!(nearbyEntity instanceof Mob)) {
        return;
    }

    Mob mob = (Mob) nearbyEntity;

    if (!mob.equals(event.getEntity()) && isFacing(player, nearbyEntity)) {
        mob.damage(event.getDamage(), player);
    }
});
#

this is within an EntityDamagebyEntity event btw

#

if u couldnt tell goal is to make the attack damage all mobs in view

zealous scroll
#

Is there a way to get the non-passable blocks a player would collide with if he was at a certain location? I know there's Player#collidesAt but that checks they're current location and that also doesn't give me the blocks that he would collide with

eternal oxide
#

its quicker

ornate patio
#

oh

eternal oxide
#

no point in doign a heavy raytrace if it's not inFront

brave sparrow
#

put that bounding box at the target location, and see what blocks are in the bounding box

eternal oxide
#

he's checkign for line of sight

#

or will be

brave sparrow
ornate patio
#

ok wait before i move on to raytracing

#

my current version isnt working

eternal oxide
#

take off the !

ornate patio
#

as in

#

Why

eternal oxide
#

why are you comparign it to the entity from the event?

ornate patio
#

Because i don't want to damage the entity that got hit twice

eternal oxide
#

you are going to have to explain what you are doign better

ornate patio
#

Let's say I punch a chicken

#

It should also punch 20 other chickens that are in my view

eternal oxide
#

ah ok

ornate patio
#

but I don't want to do double damage to the chicken that i punched

eternal oxide
#

so you want to check it IS the same type but not the same entity

ornate patio
#

doesn't need to be the same type

eternal oxide
#

and is inFront

ornate patio
#

Just not the same entity

eternal oxide
#

you just said 20 other chicken

ornate patio
#

i want to be able to punch a cow and hurt a player and a ghast too

eternal oxide
#

ok

#

code looks fine to me

ornate patio
#

ima do some debugging and figure out whats up

#

ok what

#

It just worked somehow idk

#

Maybe i forgot to reload

eternal oxide
#

I always full stop/start for every test

ornate patio
#

it just takes too long tho

eternal oxide
#

not that long

ornate patio
#

like 20 seconds

eternal oxide
#

unless potato

ornate patio
#

ive got a pretty beefy pc

#

still takes like 10 seconds to start server

eternal oxide
#

patience then grasshopper

ornate patio
#

ive rarely encountered an issue where a reload caused issues compared to a restart tho

wet breach
brave sparrow
#

^

young knoll
#

Meh, you eventually get used to what does and doesn’t work through a reload

ornate patio
#

I also usually specifically design my plugins so that they would function on a reload

eternal oxide
#

replacing teh jar is unreliable at best

wet breach
ornate patio
#

yes ik

#

but i'd much rather make it as safe as possible and save time

#

also how do i get the vector of the player towards an entity

#

if that makes sense

eternal oxide
#

targetlocation.toVector().subtract(playerlocation.toVector())

ornate patio
#

thx

#

still no idea how vectors work

eternal oxide
#

imagine a x/y graph

#

x = 1 and y = 1 would draw a line from 0,0 straight up at 45 degrees

#

so thats an arrow pointing in that direction

ornate patio
#

mhm

eternal oxide
#

thats a 2d vector.

#

at Z for depth

ornate patio
#

ohhh wait a min

eternal oxide
#

thats a 3d vector

ornate patio
#

so is the arrow drawn from 0 0 0

#

in a 3d world

eternal oxide
#

yes

ornate patio
#

ok that makes some sense

#

precalc knowledge kicking in again

eternal oxide
#

and a unit vecotr teh sum of x,y and z totals 1

ornate patio
#

yeah im starting to remember

eternal oxide
#

so from 0,0,0 its just an arrow pointing in whatever direction that values of x,y,z plotted on a graph point

#

a vector has no location as it's just a direction

#

what you are doing with the subtracting is reducing them to the smallest value (the difference between locations), so the target or player is at 0,0,0

#

the remainder of x,y,z is teh vector pointing to the target

ornate patio
#

mhm

eternal oxide
#

you shoudl .normalize() to ensure it is a unit vector

wet breach
eternal oxide
#

if you don;t normalize you can vector.length to get the targets distance from the player

eternal oxide
#

it has no world space

ornate patio
#

so with this information

#

does this look fine to you

#
Vector vectorTowardEntity = entity.getLocation().toVector().subtract(player.getLocation().toVector());
RayTraceResult rayTraceResult = player.getWorld().rayTraceBlocks(player.getLocation(), vectorTowardEntity, vectorTowardEntity.length());
eternal oxide
#

yes

ornate patio
#

great

wet breach
eternal oxide
#

not a 3f vector though

wet breach
#

yes

#

a position in of itself is just another vector, but to get it, you need at minimum 2 vectors

#

a single vector isn't enough to know where in space it is at

eternal oxide
#

so as I said not a 3f

wet breach
#

yes a 3f can

#

because its just another vector

eternal oxide
#

no you are using a second 3f to represent teh origin

wet breach
#

vector3fA - vector3fB = vector3fC C would be the position vector

#

but its still a vector

eternal oxide
#

one vector for origin, another for distance and direction

#

no a vector is singular

wet breach
#

what you mean to say, is that 3f vectors don't store anything about their positions in themselves

eternal oxide
#

in every mention I referenced a single 3f vector

#

A 3f vector has no origin.

#

factual

tender shard
#

frostalf, elgar, you are both betrayers

eternal oxide
#

definitely

tender shard
#

you should watch macgyver instead of being here

wet breach
#

possibly

tender shard
#

(the old version, not the shitty new one)

ornate patio
#

its doing something pretty strange now

#

after I added the check it seems to be only hitting random mobs in view

eternal oxide
#

I've watched them all when they were originally aired πŸ˜‰

ornate patio
#

not all of them

wet breach
tender shard
eternal oxide
#

lol

tender shard
#

you must be like 45+

eternal oxide
#

and some

#

about another 10 on that

tender shard
#

great! anyway, what's the issue with okay1204's code?

eternal oxide
#

no clue

tender shard
#

yeah me neither

wet breach
#

they are about the same age as @knotty shell

ornate patio
#

nvm it is working correctly, I just can't hit mobs who are standing behind like grass

tender shard
#

no code = no help

eternal oxide
#

he's not shown us anything complete

#

lol

tender shard
#

oooh

young knoll
#

Gotta code that swing through grass plugin

ornate patio
#

hmm

#

i also want it to go through flowers

#

and ferns

#

all those junk

tender shard
young knoll
#

RayTrace with an ignore set of all the blocks you want to go through

wet breach
#

could just ignore transparent blocks

ornate patio
#

but then it would also ignore like glass

young knoll
#

Nope

#

Glass isn’t that kind of transparent

#

However it does ignore cobwebs

#

Found that out the hard way -_-

ornate patio
#

i thought by transparent it meant like

wet breach
#

we don't care about the webs

ornate patio
#

blocks that redstone can go through

#

like slabs

young knoll
#

Someone on my server got killed through cobwebs and then there was a big accusation of hacking and blah blah

wet breach
young knoll
#

And then I had to fix it

wet breach
#

that short story makes it even better

#

XD

young knoll
#

Stupid cobwebs

echo basalt
#

just a tiny commit

ornate patio
#

how do i ignore transparent blocks

#

nvm i found ignorePassableBlocks

wet breach
# young knoll Stupid cobwebs

you probably spawned a small cult of conspiracy theorists that are now trying to prove how the staff are covering up for the dude hacking

young knoll
#

isPassable is what I used

eternal oxide
#

try using Material#isSolid

young knoll
#

Covers any blocks that you can walk through

ornate patio
#

theres an argument for rayTraceBlocks

#

ignorePassableBlocks

#

anyways now this is all fully working