#help-development

1 messages · Page 1481 of 1

wraith rapids
#

as the classloader doesn't know about the jar

#

try loading the kotlin class

opal juniper
#

also classnotfound

jovial nymph
#

i have a question can some one help me i am triang to make a villager unmovable but i am stuck because i use 1.8.8 and i am standing infront of a decision should i update all my plugins and my server to 1.6.5 or 1.12.2 or should i try to work with nms

opal juniper
wraith rapids
#

where is the kotlin class exactly

opal juniper
#

idk

wraith rapids
#

open your jar

#

find the kotlin class

opal juniper
#

the kotlin src isn't in it

wraith rapids
#

then where is the kotlin class

opal juniper
#

i don't have it??

jovial nymph
#

ok then another question would it wotk then with 1.16.5 and via version so that 1.8.8 player can also play?

wraith rapids
#

kotlin/jvm/internal/DefaultConstructorMarker

#

where is this class

#

if it's not in the jar you download, then is it in your plugin jar?

opal juniper
#

no its not anywhere i realise now and i have been stupid. i forgot it was only there when i shaded

wraith rapids
#

shade it in

opal juniper
#

what version

#

is kotlin on

wraith rapids
#

look at the pom or build file of the dependency you're downloading

#

it will have the version information

proud basin
#

it works now thanks

wraith rapids
#

or you can see it in your ide as well, look at your maven dependency tree

opal juniper
#

yeah i got it

#

its not even there

#

i am gonna have to leave this now

#

sorry but i gtg

#

thanks tho

graceful turret
#

is there a way to temporarly block donning armour?

ivory sleet
#

Hmm, can you elaborate a bit?

graceful turret
#

i want to block "suiting up" by clicking rmb on helmet

ivory sleet
#

Oh you wanna block that achievement from being granted?

graceful turret
#

no xDD

ivory sleet
#

or advancement*

#

oh no?

graceful turret
#

just disable placing armor on body when clicking right

#

on helmet

#

cancel this

ivory sleet
#

oh I think InventoryClickEvent would do the work just fine

graceful turret
#

i dont think so

#

is there any suit up event

#

xD?

#

or something

jovial nymph
#

is there a way to get a entity by its custom name?

ivory sleet
#

I think you can find ArmorEquipEvent on github, wait let me see 1 sec.

graceful turret
#

yeah i found smothing like this

hybrid spoke
#

discord helper

ivory sleet
opal juniper
#

I can’t really remember tho

ivory sleet
#

Yeah it does iirc

graceful turret
ivory sleet
#

Redempt is pretty handy

graceful turret
#

u helped me 4months ago

opal juniper
#

True

ivory sleet
jovial nymph
#

ah ok ty

eternal oxide
#

Where did pink go? 😦

ivory sleet
#

Still got the pink crystal beside my name [:

eternal oxide
#

I'm really disliking this Java 16. No injecting to the ClassLoader, no setAccessible.

hybrid spoke
ivory sleet
indigo iron
#

Entity nentity = (Entity) arrow.getNearbyEntities(0, 0, 0);
If I am getting nearby by entities why won't it let me do
nentity.addpotioneffects?

eternal oxide
#

Its going to make it impossible to do certain things

#

I don;t see any point in upgrading past java 11

hybrid spoke
#

isn't getNearbyEntities a list?

ivory sleet
#

It's a collection iirc.

ivory sleet
urban trout
#

hi im making a freeze plugin, how would i make it so if i use /freeze <player> itd cancel their move event if they move and if i use /unfreeze <player> they'll go back to normal

eternal oxide
#

I've not seen anything that tempts me beyond 11

hybrid spoke
urban trout
#

mhm

indigo iron
#
    
   public UUID vials;
   
   @EventHandler
   public void arrowland(EntityShootBowEvent event) {
      ItemStack bow = event.getBow();
      ItemMeta bowmeta = bow.getItemMeta();
      List bowlore = bowmeta.getLore();
      if (bowmeta.hasLore()) {
          
          if (bowlore.contains(ChatColor.GREEN + "- Vials")) {
              this.vials = event.getProjectile().getUniqueId();
           }

        }
  
      }
   @EventHandler
   public void arrowland(ProjectileHitEvent event) {
      if (event.getEntity() instanceof Arrow) {
         Entity arrow = event.getEntity();
         UUID euuid = event.getEntity().getUniqueId();
         Entity entity = event.getHitEntity();
         Entity nentity = (Entity) arrow.getNearbyEntities(0, 0, 0);
         
         if (entity instanceof Player) {
             if (euuid.equals(this.vials)) {
                 nentity.addPotionEffects //wont let me add potion effects
                 
             }
         }
      }
   }
}```
this is my code I still don't see how it's not working
ivory sleet
#

Hmm project valhalla might drag your attention ElgarL if it ever arrives.

urban trout
#

and how would i do that

hybrid spoke
opal juniper
hybrid spoke
#

getNearbyEntites is a collection of the entities within the squared radius 0 0 0

opal juniper
#

We gave you the pseudo

wraith rapids
#

don't cast if you don't know what cast does

opal juniper
#

Unless you get really stuck after trying

hybrid spoke
ivory sleet
indigo iron
wraith rapids
#

you're orange now

ivory sleet
#

Yeah lol

wraith rapids
#

is that role new

#

i don't remember seeing it before

ivory sleet
#

Yup

hybrid spoke
wraith rapids
#

casting doesn't do what you think it does

#

casting is you telling the IDE and compiler "trust me this works, I know it's this thing"

#

but the gig is that you actually need to fucking know that it's that thing

#

casting shit blindly is bound to blow up

hybrid spoke
#

how are you wizarding your messages into the chat without a NNYAJWAJSD is writing...

ivory sleet
wraith rapids
#

it won't magically turn your Collection<Player> into a Player

#

it will explode

#

it looks like it works without exploding in your ide because you're telling your ide to trust you on it

wraith rapids
#

ripcord lets you disable the typing notification shit

dusty herald
#

very cash money

hybrid spoke
#

ah

#

seems like a 2009 app

wraith rapids
#

apps didn't exist in 2009

opal juniper
#

It looks shit

#

But yeah

wraith rapids
#

apps are a modern age invention

#

it looks simple, and i like my things simple

#

not "let's remove some detail from the logo" simple, actual simple

#

no animated gizmos or flashing sidebars or popups or fancy useless bullshit

#

just the content

subtle vector
#

is there a way to get metadeta from a custom made trident that has been thrown?

opal juniper
#

Use a pdc

subtle vector
#

yea but u need a meta for that because pdc name = meta.getpdc something like that

opal juniper
#

Although - what do you mean by custom?

wraith rapids
#

pretty sure you can get the thrown trident itemstack from the entity

#

also

opal juniper
#

That’s what I was then wondering

wraith rapids
#

entities have their PDCs as well

#

it's not exclusive to itemmeta

urban trout
#

holy moly im back my internet died

urban trout
opal juniper
#

Cool

indigo iron
urban trout
#

itd be an arraylist right?

ivory sleet
#

Yeah in that case you'd have to loop over the collection

#
for (Entity entity : entities) {
  entity.addPotionEffect(...);
}```
wraith rapids
#

it's not necessarily an arraylist

#

there are other kinds of lists than arraylist

#

i'm not sure if it's even a list, it might be a collection, idr

urban trout
#

public List<UUID> frozen = new ArrayList<>();
frozen.add(target.getUniqueId());

#

ok, so now to do the frozen thing, would i make an event that is called when a player moves and it checks if theyre in the list

wraith rapids
#

don't use a list

#

use a set

opal juniper
#

Yep, what he said

#

But yea, just replace it with a set and ur good to go

wraith rapids
#

call set.contains to see if the set contains a specific element

#

i'm sure you can put 2 and 2 together and figure out how to go from there

urban trout
#

public Set<UUID> ?

#

Ah yes.

#

ok

#

time to try

indigo iron
urban trout
#

wait a momento

#

my new ArrayList is underline

#

god dang

ivory sleet
#

HashSet

ivory sleet
urban trout
indigo iron
# ivory sleet Can you send the entire code snippet. I presume you changed some stuff since las...

 public UUID vials;
   
   @EventHandler
   public void arrowland(EntityShootBowEvent event) {
      ItemStack bow = event.getBow();
      ItemMeta bowmeta = bow.getItemMeta();
      List bowlore = bowmeta.getLore();
      if (bowmeta.hasLore()) {
          
          if (bowlore.contains(ChatColor.GREEN + "- Vials")) {
              this.vials = event.getProjectile().getUniqueId();
           }

        }
  
      }
   @EventHandler
   public void arrowland(ProjectileHitEvent event) {
      if (event.getEntity() instanceof Arrow) {
         Entity arrow = event.getEntity();
         UUID euuid = event.getEntity().getUniqueId();
         Entity entity = event.getHitEntity();
         Collection<Entity> entities = arrow.getNearbyEntities(5, 5, 5);         
            
         if (entity instanceof Player) {
             if (euuid.equals(this.vials)) {
                 for (Entity entity2  : entities) {
                      entities.addPotionEffects
                 
             }
         }
      }
   }
}```
ivory sleet
#

then you'd have to do this:

for (Entity tempEntity : entities) {
  tempEntity.addPotionEffect(/* ... */);
}```
#

but yeah basically you can't call methods belonging to the Entity interface from the Collection interface

indigo iron
ivory sleet
#

your entire method would be something like this:

    @EventHandler
    public void arrowland(ProjectileHitEvent event) {
        if (event.getEntity() instanceof Arrow) {
            Entity arrow = event.getEntity();
            UUID euuid = event.getEntity().getUniqueId();
            Entity entity = event.getHitEntity();
            Collection<Entity> entities = arrow.getNearbyEntities(5, 5, 5);         
            
            if (entity instanceof Player) {
                if (euuid.equals(this.vials)) {
                    for (Entity tempEntity : entities) {
                        tempEntity.addPotionEffect(/* ... */);
                    }
                }
            }
        }
    }
proud basin
#

Is it possible to change a nickname?

dusk flicker
#

In this server?

#

If so, no.

proud basin
#

no

#

like is there a syntax for nicknames

dusk flicker
#

Nicknames in what

#

We need more information

proud basin
#

In spigot

dusk flicker
#

On the website? Or within a plugin

proud basin
#

within a plugin

#

like is it possible to create your own nick name system

ivory sleet
#

Yeah

dusk flicker
#

Yes

ivory sleet
#

I believe its doable with API

proud basin
#

ok

dusk flicker
#

You would have to edit the message format to use the nickname rather than standard displayname.

proud basin
#

hm

vital ridge
#

Does anybody know the best way to create runnables per entity?

#

Im currently using hashmaps, but this doesnt seem to work at all in my case

#

i have a plugin where when you run a command a chicken starts coming towards you and when he is close enough he gets removed

#

The close enough checking works with a runnable

#

but the runnable gets very fcked when there is more than 1 chicken

#

Ill provide the code

ivory sleet
#

Sure do

vital ridge
#

?pastebin

#

?hastebin

dusk flicker
#

?paste

queen dragonBOT
vital ridge
urban trout
vital ridge
indigo iron
# ivory sleet your entire method would be something like this: ```java @EventHandler p...
   public void arrowland(ProjectileHitEvent event) {
      if (event.getEntity() instanceof Arrow) {
         Entity arrow = event.getEntity();
         UUID euuid = event.getEntity().getUniqueId();
         Entity entity = event.getHitEntity();
         Collection<Entity> entities = arrow.getNearbyEntities(5, 5, 5);         
            
         if (entity instanceof Player) {
             if (euuid.equals(this.vials)) {
                 for (Entity tempEntity  : entities) {
                      tempEntity.addPotionEffect
                 
             }
         }
      }
   }
}
}```
vital ridge
urban trout
#

oH

#

god damn

vital ridge
# ivory sleet Sure do

the problem is that the detector starts messing up when its more than 1 chicken, for example it only deletes one of them and the other chicken's runnable just keeps running

#

Like im not sure if im using the hashmaps wrong

#

or is it something else

#

I always mess up with those per entity runnables

urban trout
#

oHHH it works

#

thanks nuxoria

#

i always forget the simplest things

vital ridge
#

np

dense goblet
subtle vector
# wraith rapids entities have their PDCs as well

does the entity keep there pdc from the item eg. a tridetnt called edward has a namespace key bob and it thrown does the thrown item or entity still have it meta from the edward item? or do thrown Edward trident has namespace key bob as Edward trident namespace key bob

heavy delta
#

how do i make pluginns

urban trout
dense goblet
#

dont torture yourself with eclipse pls

subtle vector
#

um get ide. find something u want to make and do what ever u can to achieve like watching tutorials and other stuff

urban trout
dense goblet
#

intellij is good

subtle vector
#

compile and get the compiled code and put it in ur plugins folder

urban trout
dense goblet
dense goblet
heavy delta
urban trout
#

heyo how would i carry across my public set to all my classes

ivory sleet
#

You probably want to go with a dependency injection design.

urban trout
#

alrighty

#

thanks

dense goblet
worldly ingot
ivory sleet
worldly ingot
#

In that case, Tag.FENCES and Tag.WOODEN_FENCES

#

You can't get the Tag to which a block belongs though, unless you write a method to iterate over all the tags and find which ones contains a Material

torn oyster
#

hey choco

#

do you happen to endorse me

#

for discord helper

worldly ingot
#
public List<Tag<Material>> getTags(Material material) {
    List<Tag<Material>> tags = new ArrayList<>();

    Bukkit.getTags(Tag.REGISTRY_BLOCKS, Material.class).forEach(tag -> {
        if (tag.isTagged(material)) {
            tags.add(tag);
        }
    });

    return tags;
}```
#

Just wrote that through Discord, but it should work fine

dense goblet
#

is it much slower than a normal HashSet contains()?

worldly ingot
#

Tag#isTagged() you mean?

dense goblet
#

yes

worldly ingot
#

It's based on a HashSet, so it's O(1)

dense goblet
#

sweeeet

#

ty

waxen plinth
#

Shoulda been EnumSet 😒

proud basin
#

How could I make a click able text in a written book that will run another command?

urban trout
#

heyo i have this freeze plugin: https://paste.md-5.net/abehileyav.java
i want an error message of your target isnt online or couldnt be found if a player just does /freeze without a player name or /freeze player name that doesnt exist, but i can only get one error message to work at a time

proper notch
#

You check if (args.length == 0) after you request Player target = Bukkit.getPlayerExact(args[0]);

#

Therefore, if there is no player name specified you'll fire an IndexOutOfBounds exception as you're trying to access the index when it doesnt exist.

#

You should check if (args.length == 0), then you can use args[0]

worldly ingot
urban trout
eternal oxide
#

@worldly ingot any chance you can add a wrapper in Spigots ClassLoader for addURL?

#

When java 1.16 hits we'll not be able to dynamically load jars without it

worldly ingot
#

what do you plan on loading?

eternal oxide
#

h2

worldly ingot
paper viper
#

there is this great project my friend created called slimjar

#

it can append to classloader in java 16

#

and also the new plugin.yml supports

#

dependency loading

worldly ingot
#

1.16 lets you specify libaries in the plugin.yml

paper viper
#

^

worldly ingot
#

Downloads and loads them at runtime for you

eternal oxide
#

Yeah, I download it at runtime

worldly ingot
#

Now the server does it for you ;p

#

You just have to specify the Maven artifact

eternal oxide
#

oh nice

worldly ingot
#

Relevant commit

#

Goal of that libraries entry is to solve that very issue. And in the case where developers are trying to load .jar addons, they should be using their own class loaders instead of the plugin class loaders

#

But as far as libraries are concerned... if it's on central, the server can download it for you automatically and load it at runtime

paper viper
#

could you try adding support for custom repo links?

#

perhaps

worldly ingot
#

md declined that. Let me see if I can find the reason

paper viper
#

Ok

worldly ingot
vestal dome
#

uhh.... Can I intervene to post a doubt about something here or you guys occupied lmfao?

worldly ingot
#

Nope. Go for it

eternal oxide
#

Now I just have to find what the entry in plugin.yml is 😉

#

is wiki updated for that commit?

worldly ingot
#

Uhhh it might not be but the commit message has an example

vestal dome
#

I have this while compiling...

worldly ingot
#

In your case,

libraries:
- com.h2database:h2:1.4.200```
paper viper
#

so group:artifact:version?

worldly ingot
#

Yep

paper viper
#

That's cool

worldly ingot
vestal dome
#

this pom is from the second one of the projects...

worldly ingot
#

Oh "Packets" is yours?

vestal dome
#

yes it is imported as a module.

#

and it cannot find it's pom.xml

worldly ingot
#

Just have to local install it to Maven is all

vestal dome
#

well it has one..

worldly ingot
#

Run mvn clean install for Packets

vestal dome
#

why not the normal one?

#

wait not even gonna question it.

worldly ingot
#

;p

vestal dome
#

skip that question

paper viper
#

wdym normal

#

lmao

#

just wondering

worldly ingot
#

I'm also curious. What would you define as normal?

paper viper
#

like mvn install?

#

cause adding clean just regens the binaries

#

with the new source code

vestal dome
worldly ingot
#

package only compiles a binary, it doesn't install it to your Maven repository

paper viper
#

that cleans binaries and compiles into jar (from new sources)

worldly ingot
#

Your computer has a local Maven repository which caches all the dependencies you've ever used while writing a Maven project

#

Additionally, you can install your own artifacts there

vestal dome
#

yup works....

worldly ingot
#

Maven's install goal does that so you can use it in other projects 🙂

vestal dome
#

but this is like a big instance where everything has to be updated to work correctly.

#

since all of them use sockets to communicate between them, etc, etc, etc.

#

not gonna bother you with that.

#

but thanks 🙂

worldly ingot
#

May be worth looking into modular Maven projects if you haven't already

#

Can have a parent, then child projects

vestal dome
#

they are modules.......

worldly ingot
#

oic

proud basin
#

So im doing ```java
StringBuilder builder = new StringBuilder();
BaseComponent[] page = new ComponentBuilder("test").event(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/bc hi")).create();
builder.append(String.format("\n \n➤ %s", page));
bookMeta.addPage(String.valueOf(builder));

worldly ingot
#

Yeah, you don't want to String.valueOf() those

#

bookMeta.spigot().addPage(page)

#

You'll have to also append your \n\n>%s thing to the start of your component

#

You either use components or you use strings, you can't use both

#
BaseComponent[] page = new ComponentBuilder("\n \n➤").event(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/bc hi")).create();
bookMeta.spigot().addPage(page);```
proud basin
#

I don't think 1.8.8 has bookMeta.spigot().addPage(page)

worldly ingot
#

It should PES_Think

proud basin
#

I don't seem to see it

worldly ingot
#

Then again, 6 year old version

vestal dome
proud basin
#

betaMeta.spigot is all I can get

worldly ingot
#

What options do you have available when you have bookMeta.spigot().?

proud basin
#

isunbreakable() and setUnbreakable()

worldly ingot
#

o.O

sullen marlin
#

I don't think 1.8 does

#

As you say, 6 years old

vestal dome
#

meta.addPage() is a thing in 1.8.8

worldly ingot
#

Yeah but that's just strings

#

Doesn't support components

#

i.e. no hover events like jtx is trying to do

proud basin
#

there must be some other way to do this

vestal dome
#

hmm

#

let me see on my 1.8.8

worldly ingot
#

I mean you can update your server, but ToadEyes

#

I know that's gonna be a hard no for most using 1.8

vestal dome
#

neither server owner

proud basin
#

I just don't like 1.9+

vestal dome
proud basin
#

not my style

paper viper
#

BookMeta itself has addPage

waxen plinth
#

That could be streamy :(

paper viper
#

for that version, it seems that BookMeta#addPage only supports string tho

#

and for spigot() yeah only those two methods exist

proud basin
#

aw

#

this sucks

worldly ingot
#

Not everything has to be streamed PES_AngeryKid

paper viper
#

tbh i only like stream for its parallel()

#

lol

proud basin
#

wym streamed

worldly ingot
#

Streams are overused. Change my mind

#

Stream API

proud basin
#

ah

#

so it seems like im stuck without it

vestal dome
proud basin
#

o:

paper viper
#

yea dont think the component api was supported in 1.8

vestal dome
#

it does.

paper viper
#

for this task at least

proud basin
#

So what's the solution

vestal dome
#

I found this while just googling it...

#

might be a good idea to look how it works and maybe do your own

#

or just use it as dependency..

paper viper
#

gitlab page is down

#

lol

vestal dome
#

doesn't matter

#

use the jar as dependency who cares about javadocs

proud basin
#

hm

vestal dome
#

he even explains how to use in the spigot page.

#

so yeah, ur in the money or ur not in the money.

proud basin
#

Is this the only way....

vestal dome
#

unless you do it on your own...

#

and just try to create your own.,.

proud basin
#

ugh

vestal dome
#

hey... it shouldn't be hard...

#

unless it is hard.

#

then it's life

paper viper
#

update and you get +10 ways to solving this

vestal dome
#

hey he doesn't want to update

proud basin
#

^

vestal dome
#

who cares about updates (ok everybody, just being sarcastic)

paper viper
#

that's his loss

#

¯_(ツ)_/¯

#

after all, 1.17 is pretty cool

vestal dome
#

it is gonna be fun updating my api...

#

can't wait

proud basin
#

the problem is with using this I'm gonna basically start from scratch and I've done so much

vestal dome
#

why would that be?=

proud basin
#

I gotta change stuff

waxen plinth
#

Everything has to be streamed

proud basin
#

also am I gonna have to use the jar as a dependency

waxen plinth
#

If I can't write it in a one-liner why would I even write it

vestal dome
#

I guess I'll just have to watch this.

#

unless you look how spigot done to use BaseComponents in newer versions

#

and just go from there...

proud basin
#

yea.... no

vestal dome
#

then I can't help.

#

sry.

proud basin
#

that's even more work I'd think

vestal dome
#

well...

#

better have work done then never

#

ok maybe not...

proud basin
#

haahaha

#

This library doesn't even work

#

Wait can't I use packets?

#

@vestal dome

proud basin
#

nvm

#

I can't

dusk flicker
#

Would anyone have a good resource for hashing players ip addresses in a database and then also dehashing?

#

Can't find much on it with google, would rather see if someone has anything before I go and make it myself

vagrant stratus
#

Why dehash?

dusk flicker
#

In my player object I store IP addresses as String to access quickly, id rather store it in that as the actual ip and in the database as the hash'd version

#

I haven't done much with hashing before so any pointers are appreciated lol

vagrant stratus
#

Can't really think of any hash you can reverse tbh
Best you could do is check if the hash is in the DB and if it is set the player object IP to the ip

dusk flicker
#

Alright

vagrant stratus
#

any decent secure hash would work. I personally use BCrypt

dusk flicker
#

Oh awesome, thanks.

vagrant stratus
#

for checking you'd use BCrypt.checkpw(password, hashedPass);
for hashing BCrypt.hashpw(password, BCrypt.gensalt())

granite stirrup
vagrant stratus
granite stirrup
#

Lmao

#

Just pointing that out rn

dusk flicker
#

I realized

rugged shuttle
#

where would i find plugin developers who i could pay to make me plugins?

paper viper
#

?services

queen dragonBOT
rugged shuttle
#

thanks

paper viper
#

np

proud basin
#

Can someone explain to me why I'm getting this

vagrant stratus
#

either the NBT or json is wrong

proud basin
#

I'm not using NBT

vagrant stratus
#

then how it's being set is incorrect

wraith prawn
#

Hi. Does anyone know why only Premium Players on a offline server Bungeecord can see Player's Skin of others? I used "LoginResult.Property" and some things more to add a Skin on LoginEvent called. The Skin set to Player correctly (others Premium Players can see it), but Non-Premium Player cannot. They only see Player's Skin about TLauncher or nothing if they use another launcher. What could be the problem?

rugged shuttle
#

damn, not high enough level to post on the thread to hire a dev

quaint mantle
proud basin
#

I don't really see how I'm setting it wrong

quaint mantle
#

besides, "no injecting to the classloader", that's a hideous hack, and there are many alternatives, safe and easy to execute

vagrant stratus
wet breach
quaint mantle
#

base64 is not a hash?

#

lol

#

it's just a transform, an encoding of the bytes

wet breach
#

bas64 is indeed a hash algorithm

proud basin
#
if (args.length == 0) {
                        Book book = new Book();
                        Book.PageBuilder page1 = book.addPage();
                        page1.add("t");
                        page1.add("\n");
                        page1.add(" " + ChatColor.translateAlternateColorCodes('&', "&cTest")).clickEvent(Book.ClickAction.Run_Command, "/bc hi").hoverEvent(Book.HoverAction.Show_Text, ChatColor.WHITE + "Click here to be shown as blblbl").build();
                        page1.build();
                        Book.openBook(player);
                        return true;
                    }
quaint mantle
quaint mantle
#

hashing is one way only

vagrant stratus
# wet breach bas64 is indeed a hash algorithm

Base64
In programming, Base64 is a group of binary-to-text encoding schemes that represent binary data in an ASCII string format by translating the data into a radix-64 representation. The term Base64 originates from a specific MIME content transfer encoding. Each non-final Base64 digit represents exactly 6 bits of data.

wet breach
#

there is such things as two way hashes

quaint mantle
#

ideally*

quaint mantle
wet breach
#

base64 is one of them

quaint mantle
#

no it's not

#

lmfao

#

encoding is not hashing

wet breach
#

encoding isn't really a function

vagrant stratus
#

Base64 is an encoding and decoding technique used to convert binary data to an American Standard for Information Interchange (ASCII) text format, and vice versa.

quaint mantle
#

you put data in, you get data out, and it's reversible

wet breach
#

therefore still a hash mechanism

quaint mantle
#

hashing is (ideally) not reversible

wet breach
#

the other hash mecanisms you are talking about, are not reversible and thus preserve the integrity of the data

quaint mantle
#

okay okay

#

link me to sources saying that base64 is a hash algorithm

wet breach
#

hashing isn't for the purpose to secure data, rather ensure the data in question hasn't changed

quaint mantle
#

and?

proud basin
quaint mantle
wet breach
#

A hash function is any function that can be used to map data of arbitrary size to fixed-size values.

#

base64 fits that

#

it just depends how you are using base64 in whether it is encoding or hashing.

quaint mantle
#

base64 has no business in being used for verifying the integrity of the data

wet breach
#

The definition of hashing doesn't say anything about verifying the integrity of the data, just that is the problem most hashes set out to resolve

#

However there is other reasons to use Hash mechanisms though and doesn't have to be for data integrity

quaint mantle
#

hashing isn't for the purpose to secure data, rather ensure the data in question hasn't changed
hashing doesn't say anything about verifying the integrity of the data

#

👏

wet breach
#

or don't read what I said

#

that is fine

quaint mantle
#

or go read some books

#

that's also fine

wet breach
#

don't need to

waxen plinth
#

Hashing is generally implemented very differently depending on what it will be used for

#

It is very important for security and it secures data by effectively allowing you to destroy it while retaining a way to check if a new piece of data matched the original

#

But to treat that type of hashing as if it's the same as what's used for hash tables is a stretch

#

In essence they do the same thing but they achieve it in extremely different ways because in one case you don't care much about collisions and in the other collisions are fatal

quaint mantle
#

hold on a second

#

i can encode stuff in UTF-8

paper viper
#

Yeah one thing I recall in crypto is salt hashes

quaint mantle
#

and call it a hash function

waxen plinth
#

You can call anything a hash function

#

It doesn't even have to transform the data in any way

wet breach
#

UTF-8 is a character standard

waxen plinth
#

Hashing an int returns the same int in java

quaint mantle
waxen plinth
#

The effectiveness of a hashing function like that is up for debate

quaint mantle
#

it encodes data which you can later interpret however you like, just like base64

#

therefore utf-8 can be used for hashing

wet breach
#

UTF-8 doesn't encode data

waxen plinth
#

If you're using it for security you want to ensure the original data cannot be derived from the hash and collisions are extremely rare

paper viper
#

Salt hashes

waxen plinth
wet breach
#

UTF-8 is a standard for defining the range of characters and their character points

waxen plinth
#

"it doesn't encode data" what

#

It's literally an encoding

wet breach
#

it in of itself does not encode anything

waxen plinth
#

Yeah also known as an encoding

#

???

paper viper
#

I can’t understand that statement lol

waxen plinth
#

sha-256 is just a standard it doesn't do anything to data itself only defines what should be done to it

wet breach
#

alright not going to argue you semantics here

waxen plinth
#

Tell me

#

If I have a "standard"

#

In which each number represents a character

#

Like 1=a, 2=b, etc

quaint mantle
waxen plinth
#

And you can take 1 2 3 4 and it is encoded into a b c d

#

Then it is an encoding

#

A caesar cipher is an encoding

#

utf-8 is just a glorified cipher so weak that everybody knows the key

#

It's an encoding and to say it's not an encoding is just willful ignorance

paper viper
#

It’s for a different purpose

#

Not for security

waxen plinth
#

Literally all of these say "encoding" within the first sentence describing what utf-8 is

waxen plinth
#

Encrypt does

#

But encode just means to translate basically

#

Using virtually any method

#

Transform the data in any way and you have an encoding of some sort

wet breach
#

both of you really should go to school for crypto then you would understand what is and isn't a hash function

waxen plinth
#

???

#

I know what a hash function is

#

What

quaint mantle
#

"UTF-8 doesn't encode data"

waxen plinth
#

lmao

quaint mantle
#

and you're telling us to learn things

#

sure

waxen plinth
#

This isn't the first time you've been a dumbass I've argued with you over stupid shit like this before

paper viper
#

Lol

waxen plinth
#

A hash function is typically just a function that turns some data into an integer that can be used for hash tables and such

paper viper
#

I remember the global warming or climate change thing lmao but that was so long ago

wet breach
waxen plinth
#

A hash algorithm typically implies it's used for security (password storage, file verification)

waxen plinth
#

.-.

#

I'm talking about the terminology, most things that are called hashing algorithms are used for security

#

While most things that are called hash functions are used for data structures

proud basin
quaint mantle
#

ensure the data in question hasn't changed
(password storage, file verification)
wrong

waxen plinth
#

@proud basin I think the book tag is invalid

paper viper
#

Well doesn’t the function itself use some sorta algorithm too

proud basin
#

What does it mean by book tag

waxen plinth
#

It does

#

But the way you refer to it can suggest its use

paper viper
#

Ngl we all need to learn English lol

wet breach
#

There is one way hashes, and two way hashes also known as public algorithms

waxen plinth
#

People don't usually call java hashCode implementations hash algorithms

#

They call them hash functions

wet breach
#

typically one way hashes are combined with security because of their nature being one way

waxen plinth
#

The only thing that is really important to qualify as a hash function is that, given the same input, it will always give the same output

#

Which is why the hashCode implementation for integers counts as a hash function even though it does nothing to the data

#

Given the same input, you will always get the same output

wet breach
#

You are right it does count as a hash function 🙂

waxen plinth
#

What's your point then oh my god

wet breach
#

That base64 is a hash algorithm

waxen plinth
#

That's not its purpose but it technically qualifies

#

It doesn't really accomplish any of the main goals of hashes for either use

#

For data structures it doesn't reduce the size of the data or "summarize" it, it tends to make it even bulkier, which isn't useful

#

For security, the original data can easily be derived from it, so it's not useful for that either

#

And again it's not any shorter than the original data so it doesn't have any use for file verification

#

So it fails at every purpose a hash function usually fulfills

#

It meets the technical definition of what a hash function does but if it can't be used for the same things a hash function is typically used for it's safe to say it's not one

#

On a technical level you'd be wrong to say it's not a hash function but that's just pedantry

#

Nobody in their right mind would use base64 as a hash function

wet breach
waxen plinth
#

They're used either for data structures or for security

#

Those are the two primary uses

#

Base64 is useful for neither

wet breach
#

you are confusing hash functions with security for things like checksums, fingerprints, ciphers etc

waxen plinth
#

Checksums use hashing algorithms

#

Which are just hash functions but more complicated and meant to make the original data irretrievable

#

Fingerprints, checksums, whatever you want to call them

#

They are hashes

wet breach
waxen plinth
#

Checksum algorithms are hash functions

#

When fed the same input they will always give the same output

#

But they meet a few extra specifications that make them useful for security

#

They give fixed-size outputs, they're irreversible, and they're not nearly as fast as the hash functions used for data structures

#

If you're gonna sit here and tell me base64 is a hash algorithm how the fuck can you say sha-256 is a "checksum algorithm" and not a hash function

#

You're just trying to change the words to make it seem like you have a point but you're just giving me bullshit

wet breach
waxen plinth
#

It's a hash function

#

A specialized one

#

But it is still a hash function

#

A square is a rectangle and you're not wrong to call a square a rectangle

wet breach
#

therefore because of that, sha-256 is not a checksum algorithm

waxen plinth
#

???

#

It's literally used for checksums though

proud basin
waxen plinth
#

hmmmmmmmm

#

print or check SHA CHECKSUMS

#

HMMMMMM

quaint mantle
waxen plinth
#

No but please go on and tell me how sha-256 is not a "checksum algorithm"

quaint mantle
waxen plinth
waxen plinth
quaint mantle
#

thanks

waxen plinth
#

It's called SQLHelper not SQLManager but still

quaint mantle
#

got it

waxen plinth
#

You gonna use it?

quaint mantle
#

yeah

waxen plinth
#

Here's the wiki page

#

Enjoy

proud basin
#

That's the problem idk what I did to get that output

waxen plinth
#

We're gonna need to figure that out if you want to fix the problem

wet breach
#

@waxen plinth you can use sha256 for the purpose of creating a checksum, but it isn't a proper checksum algorithm due the reasons I have explained

waxen plinth
#

So sha-256 creates checksums

#

But it is not a checksum algorithm

#

A checksum algorithm not being an algorithm which generates checksums?

#

Do I understand you correctly

wet breach
#

or you didn't read what I stated what a checksum algorithm has

waxen plinth
#

It's almost like algorithms can be specialized for certain things

#

There are checksum algorithms that do that

#

Wait why are we arguing about checksum algorithms in the first place

#

When did I ever say anything about those

#

I just mentioned sha-256 as a hashing algorithm that can be used for checksums

#

And you started spewing shit about how it's not a "checksum algorithm"

#

By the way

wet breach
#

because you said it was

#

I am saying it isn't

waxen plinth
#

The page for sha-256 literally lists it under the "checksum algorithms" category

proud basin
#

Thinking about it more I think this may be giving that output ```java
Book book = new Book();
Book.PageBuilder page1 = book.addPage();
page1.add("t");
page1.add("\n");
page1.build();
Book.openBook(player);````

waxen plinth
#

So on all counts you are a headass

wet breach
waxen plinth
#

.-.

quaint mantle
#

you literally linked no sources at all

#

just whatever you pulled out of your own ass

wet breach
#

neither have you @quaint mantle

waxen plinth
#

This man is more credible than a vigilantly-moderated knowledge repository

wet breach
#

except for the unicode standard on utf-8

paper viper
#

Fefo is a LuckPerms dev don’t mess with her

quaint mantle
#

pf

#

lol

waxen plinth
paper viper
#

/s

#

Lmao

proud basin
#

What makes you think that?

wet breach
#

@quaint mantle ah I didn't see that link

waxen plinth
paper viper
#

I messed it up again

#

also I would use Emily

#

But spigot nicknames smh

waxen plinth
#

¯_(ツ)_/¯

#

I can't speak for her but in my experience trans people don't mind too much as long as you accept corrections and show you're trying

paper viper
#

I hope

quaint mantle
#

spigot acc unlinking when

paper viper
#

You used to have a heart remember

#

Lol

quaint mantle
#

yeah 🙁

waxen plinth
#

That read much darker until I remembered you used to have a heart in your nickname lol

quaint mantle
#

pff bahahaha

keen kelp
#

is armor stand the only way to display text in the air?

#

and if so can I allow players to click through it

paper viper
#

Any entity works

keen kelp
#

oh

paper viper
#

It’s just name tags

#

iirc

keen kelp
#

I see

quaint mantle
#

armor stands are just the cheapest

#

or among the cheapest

waxen plinth
#

Don't armor stands have special treatment?

#

I might be thinking of 1.8

quaint mantle
#

oh they have a hitbox thing I believe

waxen plinth
#

I remember most entities not showing their name tags permanently when invisible even if setCustomNameVisible is true

quaint mantle
#

ah that

paper viper
#

Weird

#

Yeah

keen kelp
#

so if I want text without or smallest possible hitbox, what should I use

waxen plinth
#

Marker stands

quaint mantle
#

^

waxen plinth
#

They have no hitbox at all

keen kelp
#

wait they work?

waxen plinth
#

Yes

quaint mantle
#

p awesome

waxen plinth
#

I've used them in holograms before

keen kelp
#

ik marker meaning it doesn't block anything

#

but I thought they dont show names?

waxen plinth
#

They do

keen kelp
#

it's probably just my memory

quaint mantle
#

the entity itself is still visible

keen kelp
#

true

quaint mantle
#

the name tag drops to its feet though 🤔 because, well, size 0 hitbox

waxen plinth
#

Yeah set them to be invisible + marker and you're good

keen kelp
#

oh btw if I get the location of an entity, would it be top of the hitbox or the middle or what

#

Im trying to make hit markers

waxen plinth
#

Always at the feet

proud basin
#

Do you need BookMeta to have stuff written in a book?

waxen plinth
#

The location of an entity is always in the middle on the X and Z axis, and at the bottom of the Y axis

#

So, the feet

waxen plinth
keen kelp
#

Meter* /j

waxen plinth
#

I haven't heard of any BookBuilder so I'm assuming that's a library or something

proud basin
#

Could that be the reason why im getting invalid book tag

waxen plinth
#

Yes

keen kelp
#

bounding box is the same thing as hitbox right

waxen plinth
#

Yep

proud basin
#

hm I tried to make my own page builder but I guess It didn't work

keen kelp
#

is there a way to tell where the player hit the entity

#

or do I have to raytrace it myself

waxen plinth
#

What are you trying to do?

keen kelp
#

hit markers

#

as I said

waxen plinth
#

Markers have no hitbox

keen kelp
#

like a little thing pops up when players do damage

waxen plinth
#

What I would do is use invisible noAI size 0 slimes

#

Listen for damage events and cancel them

keen kelp
#

wat

#

I mean like when I hit a zombie with a custom sword

waxen plinth
#

Oh

keen kelp
#

it has a 50% chance of "critting"

#

and i need to let the player know if it did

waxen plinth
#

Why do you need to know where the hit landed on the entity then

keen kelp
#

a marker to show hits

#

thus a hit marker

waxen plinth
#

And you want it to be shown right where they hit it rather than above the entity's head?

keen kelp
#

where else should the marker appear

waxen plinth
#

Yeah there's no good way to do that other than do the math yourself

keen kelp
#

getX getZ getheight/2?

#

on top of the head you say?

#

what if it's like a giant

#

I feel like Imma have to do some raytrace bs

waxen plinth
#

Get its bounding box

#

Get the vector for the player's direction

#

Yeah you're gonna have to raycast basically

keen kelp
#

the thing is idk how to raycast so XD

#

wish me good luck

waxen plinth
#

I've heard it's not hard

#

But I don't know how to do it myself

keen kelp
#

it wouldn't be

#

just never did it

quaint mantle
#

doesn't World#rayTraceEntities (or whatever) give the exact hit location?

#

unless you are on that ancient version that doesn't have that method

keen kelp
#

Im on 1.16.5 :P

#

old versions is cringe except 1.8

#

how do I get the vector the player it looking at :/

quaint mantle
#

getEyeLocation.getDirection

waxen plinth
#

getLocation().getDirection() also works

#

Either one

quaint mantle
#

hm fair

#

too used to using the eye location when calling rayTrace lol

odd sentinel
#

Is there a way to avoid the cursor resetting position when opening a new custom inventory from an already open custom inv? Trying to build a custom menu system for a plugin I guess opening another inventory after one was open isn't the right approach, as the cursor jumps back to the center

keen kelp
#

event.getEntity().getWorld().rayTraceEntities(p.getLocation(), p.getEyeLocation().getDirection(), 7).getHitPosition().toLocation(event.getEntity().getWorld());

#

would dis wok

waxen plinth
#

Wow I didn't even know that was a thing lol

keen kelp
#

bruh

#

ok so I did the rt thing with getEyeLocation

#

and stuff

#

but now it's raytracing onto me XD

waxen plinth
#

Yeah that seems like it would work

#

Oh

#

Ok

keen kelp
#

cause Im the first entity

waxen plinth
#

Well offset it

keen kelp
#

lmao

waxen plinth
#

Wait

#

Does it ray trace to the edge of your hitbox?

keen kelp
#

yes :/

waxen plinth
#

That's perfect then

#

Take that location

keen kelp
#

and rt it again

waxen plinth
#

Add the vector times like 0.05 to it

#

And do another ray trace

#

Yeah

keen kelp
#

ideally I would want it to ignore Player

#

but idk how to use Predicate or whatever it's call so :/

keen kelp
#

can i make rayTraceEntities ignore blocks?

waxen plinth
#

Doubt it

#

You'll probably just need to implement ray tracing yourself

keen kelp
#

sht

#

thought I got off easy here

digital plinth
#

hmm how do double jump work

#

i don't think a plugin can detect the pressing of spacebars

#

do the server get an input whenever the client pressed the spacebar?

keen kelp
#

step 1.

#

find a doublejump plugin

#

step 2.

#

look into their source

young knoll
#

Usually the answer is flying

keen kelp
#

step 3.
ctrl c ctrl v

young knoll
#

Since the toggle flight event is called when you double tap space, then you just cancel it and launch them

digital plinth
keen kelp
#

gl

digital plinth
#

there should be a onSpacebar press event?

keen kelp
#

no

digital plinth
#

gogoling....

keen kelp
#

it's impossible

digital plinth
young knoll
#

Jumping is client side

keen kelp
#

cause if the client know the player isn't on ground

#

no packet is sent

#

so it's impossible

digital plinth
#

......

#

uhh

young knoll
#

Flight is what’s used

digital plinth
#

i can say for sure it is possible

digital plinth
keen kelp
#

so when player is i the air

#

let them fly

digital plinth
#

thanks

keen kelp
#

so if player double press space

#

they fly

young knoll
#

Correct

keen kelp
#

then disable fly and do shit

young knoll
#

That is how flying works

digital plinth
#

does wither skulls count as an entity?

#

hmm don't se eit in the docs

young knoll
#

Yes

digital plinth
#

oh found it

#

hmm theres only .ischarge and .setcharged

#

can I launched a witherskull?

#

i can tp it

young knoll
#

It’s a projectile

#

Launch it the same way you launch any of them

digital plinth
#

okie

#

hmm is the wither turning color documented in the api?

#

theres no special command in the wither docs

young knoll
#

Believe it’s based on the age NBT tag

digital plinth
#

okie

#

so i do this stuff to the Entity wither

young knoll
#

Huh, I really thought that would be exposed in the API

digital plinth
#

NBT?

#

also how do I spawn aprojectile?

young knoll
#

launchProjectile

#

I believe it’s on all living entities

digital plinth
#

woah this is like a mod

#

i never knew plugiins can do this

young knoll
#

Commands can do that

#

Attributes aren’t that fancy

digital plinth
#

right*

#

found it

quaint mantle
digital plinth
#

the Entity class does not have a .setEyeDirection command or something related?

young knoll
#

No

#

You have to teleport them

digital plinth
#

im trying to make a mob turn their head

digital plinth
#

i never canceled a task

#

,yet

young knoll
#

getEyeLocation.setDirection iirc

digital plinth
#

uhh which class is it in

#

Entity?

young knoll
#

Probably

young knoll
#

?jd

digital plinth
#

oh just realized that the overview had a search function

keen kelp
#

you kill armorstand with armourStand.remove() right

young knoll
#

Mhm

keen kelp
#

thax

digital plinth
#

anyone knows how long does the wither do the blue and black blinking thing till it explodes?

#

around 4 sec?

keen kelp
#

how do I summon an invisible entity without it appearing for a moment

keen kelp
#

thx

quaint mantle
digital plinth
#

is there a way to mark a wither without like changing its anme?

#

name*

dusty herald
#

what do you mean mark

digital plinth
#

like differentiate a specific wither

dusty herald
#

you could always get the entity's unique id

digital plinth
#

oh okay

#

thanks

digital plinth
#

weird

digital plinth
#

why unsupported

chrome beacon
#

Create an array list don't use emptyList

digital plinth
#

also is there a way to disable a SPECIFIC entity to be unable to push other entities but still take damage?

#

ping if you can help imma afk

digital plinth
#

.setCollidable also works i think

#

also is canceling hitboxes WITHOUT messing with packets a thing?

chrome beacon
#

Teams ;/

#

But you probably want packets

digital plinth
chrome beacon
#

Aight

quaint mantle
digital plinth
#

so theres no way around it?

chrome beacon
#

Didn't setCollidable work?

late dove
#

How do I check if a player's inventory is full? I need to give him an item in the nearest empty slot.

dusty herald
late dove
dusty herald
#

I mean do you want to count armor slots?

digital plinth
dusty herald
#

if you don't, you could always Inventory#getStorageContents().firstEmpty(), if there isn't an empty slot it returns -1

chrome beacon
late dove
digital plinth
#

weirdly enough now after i set my collision to false im still getting pushed

digital plinth
dusty herald
#

the snippet I showed will get the first empty slot where the player can store items

digital plinth
#

ode

#

code*

#

is it bc i gave the player invis

chrome beacon
digital plinth
#

is there a server shutodwn event

#

or reload

late dove
digital plinth
#

im still getting pushed

dusty herald
#

it's getStorageContents and that returns an Inventory, which should have that method 🤔

late dove
sage swift
dusty herald
#

fuck

#

I could of swore it returned an inventory

sage swift
#

just a different one than getContents

dusty herald
#

I'm gonna head to bed lmao

digital plinth
#

can you make team in the plugin?

#

or do you have to do commands in-game

chrome beacon
#

You can do it in your plugin

digital plinth
#

okay

jovial nymph
#

can some one pls help me i am stuck every time i try to load a world i get this error java.io.IOException: The process cannot access the file because another process has locked part of the file bukkit version 1.16.5

chrome beacon
#

Well is another proccess using that file

#

Like another server

digital plinth
#

that will stop all programs

#

which includes whatever that is locking the files

jovial nymph
#

just tried it still didnt work

digital plinth
#

unless its a malware or something taht is locking it

digital plinth
#

i should work hmm

chrome beacon
#

Send your code

digital plinth
#

who the frick would make a malware to lock someone's minecraft files lol

jovial nymph
#

i have an idee what it could if i execute the command that gets the file into a worldcreator for the first time it gives some other error i check real quick

keen kelp
#

can I make the console not warn about players moving too quickly when using p.teleport?

jovial nymph
#

if i execute the load command for the first time i get: Caused by: net.minecraft.server.v1_16_R3.ResourceKeyInvalidException: Non [a-z0-9/._-] character in path of location: minecraft:classicbwmaps\classicbedrock\parent

chrome beacon
#

You can't use backslashes

jovial nymph
#

who do you mean?

chrome beacon
#

Don't use \

jovial nymph
#

ok i try

#

@chrome beacon it kinda worked thank you

keen kelp
#

can I prevent regular vanilla recipe from being made with my custom items?

#

like if I have an enchanted piece of cobblestone (indicating it's special), you can't use it in vanilla recipes

#

like a furnace

worn tundra
#

if it contains your item -> cancel the event

keen kelp
#

but it would also cancel recipes that actually uses the custom item rho?

worn tundra
#

Check the recipe result

#

it can all be done

vital ridge
#

Does someone know the best way to start runnables per entity?
and to cancel them per entity

tardy delta
#

how can i get the pdc of a door/ trapdoor? (interface Openable)