#help-development

1 messages ¡ Page 906 of 1

azure zealot
#

but i can

undone moon
#

(not use getBlockAt)

wet breach
#

just fyi, some of us have been using java longer then you been alive

azure zealot
#

sure but having no idea that FAST_INVOKEVFINAL is an real instruction

wet breach
#

well it isn't, only you think it is

azure zealot
#

i can use it in my obfucators lmao

#

you talking shit

slender elbow
#

okay please show me how to use it in my language compiler

azure zealot
#

you cant

slender elbow
#

oh but you can

#

I can't

#

it must hate me

azure zealot
#

you need to code an java class file lib on your own

azure zealot
#

and that you can impkl it

#

just like i did

wet breach
#

So that is Java 17 full list of bytecodes

slender elbow
#

yeah I mean my experimental language compiles to bytecode, 227 is certainly I can write to the classfile

#

why can your classfile use it but mine can't

azure zealot
wet breach
#

it is most likely an obfuscator specific thing and not the compiler

slender elbow
#

yeah :p

wet breach
#

pretty sure if they looked at the class file after compiling, they would see that bytecode doesn't exist in the class 😛

azure zealot
#

are you stupid as well? xd

tall dragon
azure zealot
#

its also not documented

wet breach
#

Well considering I am considered one of the most versed on the JVM as well as Emily

#

I highly doubt you would know more then either of us

azure zealot
#

case Opcodes.FAST_ILOAD:
add(new VariableInstruction(opcode, in.readUnsignedByte()));
break;

wet breach
#

Those are not bytecodes just fyi

azure zealot
#

Bro its bytecode xd

slender elbow
#

I got better things to do like earn money

azure zealot
#

You are just not able to understand

#

Please stop spreading misinformation

wet breach
azure zealot
#

Its not nice

azure zealot
wet breach
#

you haven't shown a single bytecode

quaint mantle
#

Emily can u return and update the 1.8 api

wet breach
#

not even the appropriate formats for them either

dry hazel
#

send a class file that uses the instruction and passes the verifier

azure zealot
wet breach
#

you shown me a class/method name

#

not a bytecode

azure zealot
#

How do java read and execute it if its not in the bytecode

dry hazel
#

it's a hotspot thing

#

if hotspot without verifier runs it, it doesn't mean it works everywhere else

azure zealot
#

You can run it as every other instruction

#

Test it yourself

#

You dont need to believe me

#

Im just telling you it will work

undone moon
#

how to get input from sign in spigot 1.20

wet breach
azure zealot
#

It will not ignore it

#

Just test it please

#

…

dry hazel
#

you literally turn off the verifier and rely on an implementation detail

azure zealot
#

Yeah

eternal night
#

Did you know I can hack the FBI when you turn off their auth infrastructure

azure zealot
#

The verifier cant verify that this will work but if you use it right

#

It will

dry hazel
#

you can't just use it like any other class

azure zealot
#

You dont need the verifier at all

slender elbow
#

the verifier won't verify anything if you turn it off

#

lol

azure zealot
wet breach
dry hazel
wet breach
#

for those that don't know, I highly recommend not using that jvm arg at all

dry hazel
azure zealot
azure zealot
wet breach
#

but the fact you need to disable the verifier to make your code work, already means that whatever you are doing is not part of the specifications

azure zealot
#

But in fact you can

azure zealot
#

As i said

#

Its not documented as valid instruction

wet breach
#

no as the experts have said, it doesn't exist whatever you are talking about in the official JVM

#

so either what you are doing is being ignored by the JVM or you are running a non-official or non-speced JVM

azure zealot
#

It will execute the code

wet breach
#

can you show with a profiler that it does?

#

on the official JVM

azure zealot
#

Please try it yourself

wet breach
#

Thanks, I needed that verification

wet breach
# azure zealot Please try it yourself

I have no interest proving something that doesn't exist in the official specs. I already know the outcome on my system of what will happen or two possibilities

#

either my JVM dies or the JVM is going to ignore it

#

no

#

it loads an int value from the LVT

ivory sleet
#

I temporarily timeout’d the user, given their extremely inappropriate behavior for now

wet breach
#

the one that asked about the bytecode?

#

oh the other person

#

anyways, if I recall FAST just dictates the interpreter to use but I really don't want to go find all my java documents in regards to fast

ivory sleet
wet breach
#

iload is integer load, which loads from local variable table (LVT) or as it states in some of the documentation local variable index

ivory sleet
eternal night
dry hazel
orchid trout
#

how does bukkit have a listener class that doesnt look like this?

eternal night
orchid trout
#

i dont understand

#

i want to make my own events

wet breach
eternal night
orchid trout
#

not for spigot

eternal night
orchid trout
#

like

late sonnet
orchid trout
#

my own event handler

#

my own events

wet breach
orchid trout
#

yes but

wet breach
#

I have custom events in that plugin

orchid trout
#

i know how to do that

late sonnet
#

then?

orchid trout
wet breach
#

an interface sometimes just exists for clarification and not that it needs to add anything

#

also helps with casting

orchid trout
#

yes but the n how this work

#

oh

#

should i do it? or is it not worth the effort

wet breach
#

depends what you are doing, but if all you want is just custom events then as the above no need

waxen ledge
#

guava has an event bus

wet breach
#

you just have to remember that with your custom events you need to invoke said event yourself in your code otherwise it will never be heard by anything listening for it 😛

buoyant viper
orchid trout
#

yeah

buoyant viper
#

smelled it

upper hazel
#

What is better when creating an api, passing copies of objects or giving them directly?

ivory sleet
#

How large is your code base?

upper hazel
#

why this question

dry hazel
#

depends on what objects

#

you probably don't want to pass mutable collections and such

ivory sleet
# upper hazel why this question

It can sometimes be more reasonable for larger code bases, to split certain module layers with a separate api layer where the api isn’t directly implemented, but instead it wraps around whatever it needs to serve its contract

upper hazel
#

I mean that an object is registered through a special class and I don’t know what will happen if the developer works directly with the object without registering it, but at the same time nothing will happen if the registration class does not directly link the object data and the object itself

upper hazel
ivory sleet
#

You asked about passing copies or direct objects, maybe I interpreted it wrongly, if you just meant the collections in particular

upper hazel
#

I'm talking about getting and setting data objects directly or through a copy

inner mulch
#

Does bukkit have an Eventhandler for every Event or does the event get published to one which then proceeds to Check which method is looking for what Event?

ivory sleet
buoyant viper
#

so i did some digging and the only non-hotspot related mention of "FAST" instructions are in an internal class presumably relating to the Verifier

ivory sleet
#

Like ZlataOvce said I believe

#

Tho I do think going by immutability by default is a good mindset unless you need mutability for w/e reason (which implies copies to some degree)

buoyant viper
#

im personally going to start using _shouldnotreachhere in my bytecode

upper hazel
buoyant viper
#

jk

#

(kind of)

#

theres always weird hackery to alleviate perceived slowness for it though, like MethodHandles and that godforsaken LambdaMetaFactory class

dry hazel
#

methodhandles are pretty fast

buoyant viper
#

the chain is like,

Method, MethodHandles, LambdaMetaFactory, Direct Invoke

#

iirc

#

"slowest" to "fastest" that is

#

not a big fan of LMF itself though, im a little stupid and getting MethodHandles to work is a feat in and of itself for me sometimes

#

sometimes the param types just DO NOT like me

ivory sleet
#

Wasn’t reflection also reimplemented with method handles or something like that in a newer jep

dry hazel
#

yes

buoyant viper
#

a lot of my knowledge is still based off of java 8 and mc 1.8 sadly

ivory sleet
#

😔

buoyant viper
#

so what i say IS most likely usually outdated to an extent

#

its where i did my most work :V

wet breach
buoyant viper
#

workin on it

#

my non spigot related projects utilize java 17 at least

#

my spigot ones are still on java 8 just to try and keep a wide support range

ivory sleet
#

yea that’s understandable

buoyant viper
#

21 is LTS right?

ivory sleet
#

Gen zgc is pretty cool, has quite the potential

fluid river
#

yo guys

#

how do i work with tcp streams

valid burrow
#

do you WANT depression?

fluid river
#

yes

#

so

#

basically i have two strings

valid burrow
buoyant viper
ivory sleet
#

Nope :(

#

Since it needs a lot of tuning to work well I reckon:>

#

yea

fluid river
#
string joinPacket = string.Join(";", secret, "join", userName, password); // client sends this
string allowJoinPacket = string.Join(";", secret, "allow_join"); // server answers with this```
```c#
public class Server {
    public void OnInfoReceivedFromClient(TCPClient client) {
        client.GetStream().Read(); // i should read a join packet
        if (userPassword == password) { // if password matches
            client.GetStream().Write(); // i should write allow join packet
        }
    }
}

public class Client {

    public void OnInfoReceivedFromServer(TCPClient server) {
        server.GetStream().Write(); // i should write a join packet
        server.GetStream().Read(); // i read the answer from the server
        if (serverAnswer == allowJoin) {// i should connect and everything is good

        }
    }
}
ivory sleet
#

Soon ™️

eternal night
fluid river
fluid river
#

but anyways

#

it's all the same on java ig

buoyant viper
#

yea ;p

fluid river
#

you need a buffer of fixed length in both languages

azure zealot
#

do it the unsafe way! xd

fluid river
#

which you use to read and write data

#

well, you can use object = null and then call System.gc()

#

not like it actually does that

azure zealot
#

isnt this possible with weak references or something?

fluid river
#

but at least it's close

ivory sleet
fluid river
#

it also calls finalize() so you can have a "destructor" code

azure zealot
#

not force but i till be gced very fast

ivory sleet
#

I think java has the foreign mem and func api in j22

azure zealot
#

yes

#

System.gc

azure zealot
#

and evry weak ref would be collected

ivory sleet
#

it doesn’t really force

azure zealot
#

so ist acctually forced

ivory sleet
#

its more like a request

fluid river
#

well it does, but it requests to gc, not performs it

ivory sleet
#

And a lot of apps disable system gc

fluid river
#

i mean this would work fine:

azure zealot
#

it does not request for garbage collection

#

it just runs it instantly

buoyant viper
#

meanwhile the Minecraft client calls System.gc() in at least 7 different locations fairly frequently (jesus fucking christ mojank WHY)

fluid river
#
public static void main(String[] args) {
    MyClass m = new MyClass();
    m = null;
    System.gc();
}

public class MyClass {

    @Override
    public void finalize() {
        System.out.println("I'm erased");
    }
}```
hybrid spoke
#

it just suggests to gc

#

50/50 chance that it does

azure zealot
#

thats why a said you could use weak references only xd

ivory sleet
fluid river
#

and i get the console message

hybrid spoke
azure zealot
#

yeah but thats agasinst the use of weak references lol

eternal night
#

WeakReference'ign shit is perfectly fine

azure zealot
#

if you want it to get gced you can code it that way

fluid river
ivory sleet
hybrid spoke
#

once the gc collects your object it gets called

#

but finalize is a bad practice anyways

fluid river
#

yeah but it wasn't printed to eclipse console

hybrid spoke
#

isnt it deprecated anyways

eternal night
#

Yea

fluid river
eternal night
#

you use cleaners now

fluid river
#

i just showed finalize output in my java blog to show that it's kinda like cpp

hybrid spoke
#

what

fluid river
#

which has a destructor system

ivory sleet
#

I men there are a lot of issues with finalize

hybrid spoke
#

just that cpp is 100% manually

fluid river
hybrid spoke
#

and java is managed

fluid river
#

but nobody uses finalize() anyways

hybrid spoke
#

because you shouldnt

fluid river
#

i suck at tcp

#

my last attempt gave me a string with length 999

hybrid spoke
#

?gpt

fluid river
#

where actual characters were only like 20

fluid river
hybrid spoke
#

dont you guys have gpt

fluid river
#

no

#

also spotify, all Meta products

hybrid spoke
#

what about bard aka gemini

inner mulch
fluid river
#

also bing chat

#

and github copilot

inner mulch
#

No Spotify in russia?

fluid river
hybrid spoke
#
using System;
using System.IO;
using System.Net.Sockets;
using System.Text;

public class Server
{
    private const string Password = "your_password";

    public void OnInfoReceivedFromClient(TcpClient client)
    {
        NetworkStream stream = client.GetStream();

        // Read join packet
        byte[] joinPacketBuffer = new byte[1024];
        int bytesRead = stream.Read(joinPacketBuffer, 0, joinPacketBuffer.Length);
        string joinPacket = Encoding.ASCII.GetString(joinPacketBuffer, 0, bytesRead);

        // Assuming joinPacket contains user password
        if (joinPacket.Trim() == Password)
        {
            // Write allow join packet
            byte[] allowJoinPacket = Encoding.ASCII.GetBytes("AllowJoinPacket");
            stream.Write(allowJoinPacket, 0, allowJoinPacket.Length);
        }
    }
}

public class Client
{
    public void OnInfoReceivedFromServer(TcpClient server)
    {
        NetworkStream stream = server.GetStream();

        // Write join packet
        byte[] joinPacket = Encoding.ASCII.GetBytes("ClientPassword");
        stream.Write(joinPacket, 0, joinPacket.Length);

        // Read the answer from the server
        byte[] serverAnswerBuffer = new byte[1024];
        int bytesRead = stream.Read(serverAnswerBuffer, 0, serverAnswerBuffer.Length);
        string serverAnswer = Encoding.ASCII.GetString(serverAnswerBuffer, 0, bytesRead);

        // Assuming serverAnswer contains "AllowJoinPacket"
        if (serverAnswer.Trim() == "AllowJoinPacket")
        {
            // Connect and everything is good
            Console.WriteLine("Connected to the server.");
        }
    }
}

gpt output

#

lmao

#

"hey you guys started a war so we take spotify away"

fluid river
#

copilot, bing chat, google shit, spotify, facebook, instagram, snapchat, paypal, access to foreign banking

#

i can't even get paid for making plugins

#

and can't by any 🙂

hybrid spoke
#

what do ukrainian get

#

free spotify premium

fluid river
#

ukrainians get to europe

#

i guess

#

what the hell is this

#

0, length

hybrid spoke
#

¯_(ツ)_/¯

fluid river
#

since russian youtubers would get money otherwise

hybrid spoke
# fluid river what the hell is this

I apologize if there's any confusion in my response. It appears that there might be an issue with my interpretation or the code example provided. Let me clarify and correct any mistakes.

In network programming, when you read from a stream, you typically get back the number of bytes read, which can be used to determine the length of the received data. However, in the example provided, the specific values for lengths and content are arbitrary and simplified for illustration.

If you have specific concerns or questions about certain parts of the code or if you could provide more details about what you find confusing, I'd be happy to help clarify and address any issues.

fluid river
#

can't use them and don't have them

#

free YT premium

hybrid spoke
fluid river
hybrid spoke
#

I apologize for any confusion. The 0 and length in the code snippet I provided are placeholders for actual values that you need to determine based on your specific implementation.

Let's take a closer look at the relevant parts:

csharp

// Read join packet
byte[] joinPacketBuffer = new byte[1024];
int bytesRead = stream.Read(joinPacketBuffer, 0, joinPacketBuffer.Length);
string joinPacket = Encoding.ASCII.GetString(joinPacketBuffer, 0, bytesRead);

In the Read method, 0 represents the offset within the joinPacketBuffer array where the data should be placed, and joinPacketBuffer.Length represents the maximum number of bytes to read. The bytesRead variable then holds the actual number of bytes read from the stream.

Similarly, in the Write method:

csharp

// Write allow join packet
byte[] allowJoinPacket = Encoding.ASCII.GetBytes("AllowJoinPacket");
stream.Write(allowJoinPacket, 0, allowJoinPacket.Length);

Here, 0 is the offset within the allowJoinPacket array from where to start writing, and allowJoinPacket.Length is the number of bytes to write.

These values depend on the specific requirements of your protocol and the data you are exchanging between the client and server. You may need to adjust these values based on your actual packet format and size.

fluid river
#

is that like length of the message to read

#

and 0 is smth i don't know about

#

why do i need an offset?

#

isn't stream flushed or smth?

fluid river
#

since ig if stream is not flushed, i would once reach the end of byte array

hybrid spoke
#

Flushing the stream won't eliminate the need for an offset. The offset parameter in the Read and Write methods indicates the position in the buffer from which to start reading or writing data. It is crucial when you're dealing with partial reads or writes.

If you're always reading or writing the entire buffer, you can set the offset to 0, and it will work effectively as if you didn't use an offset. However, if you have scenarios where you're reading or writing a portion of the buffer, the offset becomes significant.

Here's an example with the offset set to 0:

csharp

// Read join packet
byte[] joinPacketBuffer = new byte[1024];
int bytesRead = stream.Read(joinPacketBuffer, 0, joinPacketBuffer.Length);
string joinPacket = Encoding.ASCII.GetString(joinPacketBuffer, 0, bytesRead);

// Write allow join packet
byte[] allowJoinPacket = Encoding.ASCII.GetBytes("AllowJoinPacket");
stream.Write(allowJoinPacket, 0, allowJoinPacket.Length);

In this example, it's assumed that the entire buffer is being used, so the offset is effectively 0.

Remember that flushing a stream is a different concept; it's about ensuring that all the data in a buffer is written to the underlying stream. It doesn't eliminate the need for an offset in the Read and Write methods, which is more about specifying where in the buffer to start the operation.

fluid river
#

so i won't be able to send or receive any more messages

#

alr so i can just use 0 all of the time for my purpose

#

but is stream flushing automatically?

#

since i can't find a Flush() method

cedar flint
#

I am making custom enchantments. Is it possible to give the enchantment multiple EnchantmentTargets? I want it for Tools and Weapons.

@Override
    public @NotNull EnchantmentTarget getItemTarget() {
        return EnchantmentTarget.TOOL;
    }
#

Ah right thank you, I wasnt thinking :)

upper hazel
#

What are the annotations called that prohibit compiling code under certain conditions?

ivory sleet
hybrid spoke
#

apparently they are called compiler directives

ivory sleet
#

Ah interesting

hybrid spoke
#

but i cant think of any natives

#

only deprecated or functionalinterface and shit

ivory sleet
#

Well Override also but yea

hybrid spoke
#

spring seems to have some

#

@Conditional or @AspectJ

#

supresswarnings probably as well

upper hazel
#

Like notNull

#

But send error

#

For developers

ivory sleet
hybrid spoke
#

^

upper hazel
#

Yes I want create custom

hybrid spoke
#

tell us more about it

#

otherwise we will clutter you with many bs you probably dont even need

upper hazel
#

Thenks

hybrid spoke
#

otherwise baeldung always got your back

cedar flint
#

Sorry, I am pretty new to java, but I cant seem to make the EnchantmentTarget work. In every possible way I have to make the public EnchantmentTarget getItemTarget() a list which isnt possible. I am making custom enchantments and want to add multiple enchantmenttargets

smoky anchor
#

?paste

undone axleBOT
smoky anchor
#

My guess would be that they are overriding/implementing some class, which means he can't change the return type of a method.
And anyways, you should not implement spigot/bukkit classes.

cedar flint
#

This is what I was trying (formatting weird)

public ArrayList<EnchantmentTarget> EnchantmentTargets() {
        ArrayList<EnchantmentTarget> enchantmentTargets = new ArrayList<>();
        enchantmentTargets.add(EnchantmentTarget.TOOL);
        enchantmentTargets.add(EnchantmentTarget.WEAPON);
        return enchantmentTargets;
    }

    @Override
    public EnchantmentTarget getItemTarget() {
        return EnchantmentTargets();
    }
#

Ah ok thank you I will try

pastel juniper
#

Quick question, is there a way to change item's max durability and how(only the way not the code, I don't need spoon-feeding)??? Cause I used pdc and setDurability() and none worked.

chrome beacon
#

max durability is hard coded

#

you cannot change it

#

You'll have to implement your own system for tracking the durability and then scaling the durability damage so the durability bar looks correct

chrome beacon
pastel juniper
#

I just wanted the players to be able to see it in the client

chrome beacon
#

you can put it in lore or smth

pastel juniper
#

yeah I know

#

Thank you both

#

Is there a way atleast to hide item durability(the text not the bar)???

young knoll
#

F3 + H

#

:p

pastel juniper
#

😦

river oracle
#

Server has no control over that

chrome beacon
#

I wonder if you could use a resourcepack

dry forum
#

a falling block is being shot from a location, 1, 1, 1 for example, and im shooting it to the location 10, 50, 10, for example, the fallingblock just wont go above a certain y level, is there any way to fix this

young knoll
#

You could hide the entire tooltip with a shader

#

Idk if you can just target the durability

pastel juniper
#

I ll leave it just as it is and I ll add a lore for the new durability thank you all again.

smoky anchor
dry forum
#

no like it wont go above a certain y level

the x and z work fine like it will shoot towards tghe correct x/z but it just wont go above a certain height

young knoll
#

Are you launching it with one big setVelocity

dry forum
#

im using

        FallingBlock fallingBlock = baseLocation.getWorld().spawnFallingBlock(baseLocation.clone().add(0.5, 1, 0.5), blockMaterial.createBlockData());
        Vector direction = targetLocation.toVector().subtract(baseLocation.toVector()).normalize();
        fallingBlock.setVelocity(direction);
    }```
#

so yeah 1 setVelcocity to get it to the target

eternal oxide
#

you are setting velocity to a unit vector

dry forum
#

yeah?

eternal oxide
#

it's got no magnitude. It's always going to fly at teh same speed

dry forum
#

so it should have a different speed then itll go above a certain y value?

#

but i thought the vector/velocity would take that into account?

smoky anchor
#

Would disabling gravity give you the result you're looking for ?

dry forum
#

i think i tried that a while ago and it just made it go flying but ill try it again rq

chrome beacon
#

if you want to modify the entity that you spawn do use the spawn method that takes a consumer

#

will ensure it's spawned with the data instead of being spawned and then modified

river oracle
#

@young knoll do u know if biomes are translatable or did choco lie to me I can't find 😭

dry forum
#
            @Override
            public void accept(FallingBlock fb) {
                fb.setGravity(false);
            }
        });```

how would i add the blockmaterial to the consumer method?
young knoll
#

I don’t think they are

#

They don’t get translated in F3

river oracle
river oracle
young knoll
#

Not sure

#

Ctrl F the language file :p

river oracle
#

yo facts

wet breach
#

0000000000000023+.6+

#

6

#

+6

#

+6+

#

6+

#

6+

#

6+

young knoll
#

I agree

hybrid spoke
#

exactly

tender shard
#

biomes do have translation keys

young knoll
#

huh

#

Where do they actually get used

tender shard
#

that i dont know

echo basalt
#

F3

young knoll
#

I swear f3 shows the namespace

tender shard
#

I just ctrl-F'd for "plains" in en_us.json

river oracle
#

because they aren't used anywhere from what i can see

hybrid spoke
#

pretty sure thats clientside yes

young knoll
#

art does too

river oracle
young knoll
#

Most stuff is

#

The server doesn't need translations

river oracle
#

seems like SoundCategory is too

young knoll
#

Translatable component hype

echo basalt
#

Oh yeah I had a wacky idea at work

tender shard
#

and F3 also doesnt translate it - it doesnt even show the "biome...." key but only minecraft:plains

young knoll
echo basalt
#

Advancements?

young knoll
#

maybe /locate

river oracle
#

iirc

young knoll
#

nope /locate biome also uses namespace

echo basalt
#

Mf

young knoll
#

¯_(ツ)_/¯

river oracle
#

or not

tender shard
#

it does show the translations in Create World -> Single BIome -> ...

hybrid spoke
#

they are just there to exist

river oracle
#

doesn't look like its exposed on the server anyways

young knoll
#

Weird that they don't use it everywhere

#

Silly mojang

river oracle
#

ayo advancements are!!

#

Optional<IChatBaseComponent> name

echo basalt
#

What if I just used translatable components on everything instead of making a lang system at work

river oracle
#

its optional though sadge

tender shard
#

well it's always just biome.minecraft.<key-name> lol

echo basalt
#

Instead of the player picking the lang on a gui they'd just change their game lang

young knoll
#

If you are already using a resource pack I don't see why not

chrome beacon
#

looks like there's no setter for it ;/

#

Guess you'll need the spawnFallingBlock method

dry forum
#

alr

hybrid spoke
#

why is fallingblock a serveroperator

chrome beacon
#

all entities are

echo basalt
#

uh

chrome beacon
#

no?

hybrid spoke
#

ah because of permissible

#

yeah

young knoll
#

yeah they are

hybrid spoke
#

lmao

young knoll
#

since /execute can make entities run commands

tender shard
#

"you were banned by armorstand"

hybrid spoke
#

"oh no i got banned by a sandblock"

young knoll
#

Sadly I don't think /execute can run that type of command

dry forum
#
        FallingBlock fallingBlock = baseLocation.getWorld().spawnFallingBlock(baseLocation.clone().add(0.5, 1, 0.5), blockMaterial.createBlockData());
        fallingBlock.setGravity(false);

        Vector direction = targetLocation.toVector().subtract(baseLocation.toVector()).normalize();
        fallingBlock.setVelocity(direction);
    }```

the blocks just go to space
#

they dont go back down

hybrid spoke
#

maybe because you set gravity to false

hybrid spoke
#

so it flys higher

dry forum
#

its already doing that though no?

#

Vector direction = targetLocation.toVector().subtract(baseLocation.toVector()).normalize();

hybrid spoke
#

not after normalized

dry forum
#

im kinda confused so what should the y of the vector be? the base location y - target location y?

young knoll
#

Don't normalize it

dry forum
#

i did that but then the fallingblocks went all over the place, they went flying past the target

worldly ingot
#

If you're aiming for a specific block, you're going to have a hell of a time. Velocity's actual metrics are pretty undocumented so a velocity of, say, 3, isn't going to launch it 3 blocks

dry forum
#

so theres no "simple" way to launch a falling block to a location?

worldly ingot
#

A very specific one? No, not really

#

Best way is probably to fake it if I'm being honest. Just teleporting it on a loop in small increments over a predefined path

#

(and by "predefined", I mean calculating an arch between two points - which you'll need to look up the math for)

dry forum
#

welp that sucks

worldly ingot
#

Yeah, but the alternative is velocity which is rather difficult to predict

#

If your increment is small enough, the teleports are interpolated so it should still look relatively smooth

dry forum
#

well ty anywya

spare mason
#

Would It be possible to create vĂŠrtices with block displays?

fickle saddle
#

Hello! I was wondering if there would be a way to make RecipeChoice.ExactChoice() ignore some things such as an item's name?

chrome beacon
#

remember using it a couple of years ago

#

should be somewhere on reddit

proud badge
#

is Gson fine with serializing enums?

#

since its just a string

inner mulch
proud badge
#

yes

inner mulch
#

why wouldnt it be fine? I'd recommend using a try catch tho when deserializing so if you delete an enum that you wont get error and it will just reset to defualt

inner mulch
proud badge
#

yes

inner mulch
#

okay, thats good

#

yeah but when serializing and deserializing I'd always use a try catch so your stuff doesnt break when something it removed

proud badge
#

what is the Effect enum name for minecraft:explosion?

#

also for minecraft:heart?

#

ok I just realised EntityEffect etc exists

#

Damn huh, can I not use EntityEffect at a specific location in playEffect?

dawn flower
#

how do i disable vanilla critical hits?

proud badge
#

damage event, check if damage cause is critical hit, if yes then cancel the event

dawn flower
#

no like

#

i want to remove the damage from a critical hit

proud badge
#

then event.setDamage(0) I think

dawn flower
#

bruh

#

i mean

proud badge
#

if youre using EntityDamageEvent

dawn flower
#

i want all hits to be non critical

golden turret
#

how can i apply the mappings to another dependency? I am using a dependency that uses nms, but i am using it as .jar and it has the obfuscated names. I would like to extend some of its entity classes, but since it has the obsucated stuff, i cant even use the constructor

#

the class i want to extend

#

i am using gradle

umbral ridge
#

hey so on org.bukkit.event.player.PlayerFishEvent getCaught() is always a DROPPED_ITEM, if I cast it to (Item)

#

how can i find out what kind of a DROPPED_ITEM it is??

lean pumice
#

how i can create a licence and use it for my plugin?

icy beacon
umbral ridge
lean pumice
#

tnx

rare cave
#

Hi, is there any cloud system for Spigot that supports auto scaling and containerizing? What I found were CloudNet-v3 and SimpleCloud-v2. However, they do not support docker

vital sandal
#

I got some error with the custom Recipe

chrome beacon
#

yeah don't create an empty shape

vital sandal
rough ibex
#

Your recipe needs a row(s)

#

literally read the error message

vital sandal
#

you mean this?

solid apex
#

How?

chrome beacon
vital sandal
chrome beacon
#

You can't make a recipe without a shape

#

So don't create an empty shape

#

let me know if you need a hint :p

vital sandal
#

yeh I do need it :l

chrome beacon
#

I think you'll see the problem if you read the code

#

go line by line

icy beacon
#

Wait what's wrong though? I don't see anything wrong except for the .shape() on the last line looking weird to me

vital sandal
#

I'm pretty sure the length is 3

icy beacon
#

Ohhhhhhhhh

vital sandal
#

@@

#

a typo

icy beacon
#

LMaoo

#

Accidental save

vital sandal
#

I though it was a wrong in the shape

icy beacon
#

How did it even compile

#

What is .shape()?

chrome beacon
#

I wanted apex to find the issue on their own

#

but I guess that works too :p

icy beacon
#

So I blurted that out lol

#

OHH

#

I got it

#

The methods are builder methods

chrome beacon
#

yeah

icy beacon
#

And when you call .shape() on that it resets

#

Lool that's a hell of a typo

chrome beacon
#

Why would it not compile

remote swallow
#

it compiles because it takes var args and returns the instance

vital sandal
#

yeh

#

just read it :l

inner mulch
#

May it be that the EntityTrackEvent is called twice when an entity is tracked?

young knoll
#

?whereami

inner mulch
#

only paper?

young knoll
inner mulch
#

PlayerTrackEntityEvent

young knoll
remote swallow
#

yep also paper

slender elbow
#

pepper

inner mulch
#

paper

young knoll
#

purpur?

#

Wait no wrong one

flint warren
#

okay so

#

quick problem

#

i've got a list that stores classes with the parameters (string id, Material material),
if i ONLY give the id, would there be any way to get the material?

remote swallow
#

a map

hybrid spoke
#

quick answer: what

flint warren
#

what

#

:():(:)(:):()

flint warren
hybrid spoke
#

ah now it makes sense

#

yeah a map

flint warren
#

yeah that seems to work

#

ty

twilit roost
#

is there some way to stop World from being ticked unless I want to?

I keep some extra worlds loaded and dont want them to be ticked unless someone is on them

proud badge
#

is gson not able to save enums?
[{"uuid":"3b4b5172-4860-4191-bda8-1be9ae7cace8","flair":"MUSICAL"}]
[20:13:23 WARN]: [HTP] Unexpected error while loading Flairs: java.lang.IllegalStateException: Expected a string but was BEGIN_OBJECT at line 1 column 3 path $[0]

#

hmm docs say it can

#

nvm I did a goofy

#

entered the wrong object

solid apex
#

How?

worthy yarrow
#

Probably something like inventory.setSomeSlot(item)

undone axleBOT
solid apex
worthy yarrow
#

You can’t get the input slot from any of the basic inventory methods?

remote swallow
#

its probably just slot ids

solid apex
# worthy yarrow

Yes but Slot 0 & slot 1 not working (with setItem) & with addItem its also not working

remote swallow
#

judging the fact the inv is probably from block state, call update onthe block state

worthy yarrow
#

that just might be your fix

#

Also you're referring to "input slot" as the ones players put items into yes?

umbral ridge
#

what's the best class to use for random numbers and chance system?

eg. I have an item with 5% chance to be caught

using Random for this would be ok but if I generate an int between 0 and 100, everything has an equal chance to be generated? for 0, its 1% to be generated, for 1 its also 1%, etc..

would it be ok to develop a system where actually
a number 0 would have 0% to be generated,
a number 1 would have 1% to be generated
....

but this is where I'd run into issues so instead, I though:
how about I develop a system where
numbers between 0-10 have 10% to get caught
numbers between 11-20 have 20%
numbers between 21-30 have 30%
numbers between 31-40 have 40%
numbers between 41-50 have 50%
and numbers above 50 have 50%
... something like that?

tender shard
#

for 5% just check if the random number between 0 and 100 is <= 5

hazy sail
#

What packets can I send to the minecraft server to keep my bot moving?

I tried that but it didn't work

bot.on('position', (packet) => {
    bot['position'] = packet
    console.log(packet)
})

bot.on('login', (packet) => {
    bot['entityId'] = packet.entityId;

    setTimeout(() => {
        // Send initial packets
        bot.write('position_look', {
            x: bot['position'].x,
            y: bot['position'].y,
            z: bot['position'].z,
            yaw: 0,
            pitch: 0,
            onGround: true
        });

        setInterval(moveForward, 50);
    }, 50)

});

function moveForward() {
    const position = bot['position'];
    const newPosition = new Vec3(position.x, position.y, position.z + 0.01);
    bot.write('position', {
        x: newPosition.x,
        y: newPosition.y,
        z: newPosition.z,
        onGround: position.onGround
    });
}

someone can help me pls

umbral ridge
#

it's like.. every number has an equal chance to be generated, between 0-100

#

so is 5%, numbers in range 0-5 really 5%?

remote swallow
#

why wouldnt it

umbral ridge
#

It's not like higher numbers will be generated more often? (higher numbers have a higher chance to be generated). numbers will just get picked randomly between 0-100

#

1 can be generated with the same chance as 100

#

so 1% is equal to 100%

remote swallow
#

no

umbral ridge
#

yes

remote swallow
#

if its 0-5 you get a 5% if its 0-90 you have a 90% chance

umbral ridge
#

hmmm

remote swallow
#

because theres 5 different numbers that could be generated for it to be that

#

if it was only 1 number to pass, that would be 1%

#

because its 1 number out of 100 to get that

umbral ridge
#

I guess yeah... fair point

remote swallow
#

but then if you wanted it 100 out of 100, theres 100 numbers it could be

tardy delta
#

StringConcatFactory and ObjectMethods might be interesting to take a look at :)

tacit rapids
#

hello i got a problem i created a lifesteal server bungycord and boxpvp so i wona put the lobby on the boxpvp but its says to me a probleam
if someone can help me ill be happy
Image

neat wolf
sterile flicker
#

why doesn't the NPC skin work? 1.12.2 ```java
public static EntityNurse nurse;
public static UUID uniqueId;
public EntityNurse(MinecraftServer server, WorldServer world, GameProfile profile, PlayerInteractManager manager) {
super(server, world, profile, manager);

}

public static EntityNurse create(String name, World world, Location location) throws IOException {

    MinecraftServer nmsServer = ((CraftServer) Bukkit.getServer()).getServer();
    WorldServer nmsWorld = ((CraftWorld) world).getHandle();
    uniqueId = UUID.randomUUID();

    GameProfile playerProfile = new GameProfile(uniqueId, name);
    nurse = new EntityNurse(nmsServer, nmsWorld, playerProfile, new PlayerInteractManager(nmsWorld));
    nurse.getProfile().getProperties().clear();
    nurse.getProfile().getProperties().removeAll("textures");
    nurse.getProfile().getProperties().put("textures", new Property("textures", texture, signature));
    
    nurse.getBukkitEntity().setRemoveWhenFarAway(false);
    nurse.setLocation(location.getX(), location.getY(), location.getZ(), location.getPitch(), location.getYaw());
    nurse.playerConnection = new PlayerConnection(nurse.server, new NetworkManager(EnumProtocolDirection.CLIENTBOUND), nurse);
    nurse.spawnIn(nmsWorld);
    nmsWorld.addEntity(nurse);

    return nurse;
}```
lost matrix
lost matrix
tardy delta
#

seems to contain some trash at the end, oh wait

lost matrix
#

The texture looks fine

{
  "timestamp" : 1588347344589,
  "profileId" : "04b708a335664f2f85ec5eef27d14dad",
  "profileName" : "Violetskyzz",
  "signatureRequired" : true,
  "textures" : {
    "SKIN" : {
      "url" : "http://textures.minecraft.net/texture/4c46f7eb284ce4937d8290fd42ecf6b5adc8f0e4cec5c7d44d732bccf2576c1e"
    }
  }
}

But your signature looks scuffed.

lost matrix
sterile flicker
#

how do I get the skin of any of the players on the server?

lost matrix
#

In 1.12 you need to use nms. Get the GameProfile and then their skin property.

#

Btw i think you are missing a crucial part because simply adding the EntityPlayer to a world wont send their profile information to the other online players.
And this profile information contains the skin.

worthy yarrow
# umbral ridge I guess yeah... fair point

1% chance for any given number to be picked, the only way your percentage increases is if your range does first, ie: as epic was saying 0-5 = 5% chance for .Random to pick 0-5.

sterile flicker
#
@EventHandler
    public void onPlayerJoin(PlayerJoinEvent event) {
       PlayerConnection connection = ((CraftPlayer) event.getPlayer()).getHandle().playerConnection;
        PacketPlayOutPlayerInfo info = new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.ADD_PLAYER, EntityNurse.nurse);
        PacketPlayOutNamedEntitySpawn spawn = new PacketPlayOutNamedEntitySpawn(EntityNurse.nurse);

        connection.sendPacket(info);
        connection.sendPacket(spawn);
        connection.sendPacket(new PacketPlayOutEntityHeadRotation(EntityNurse.nurse, (byte) ((EntityNurse.nurse.getBukkitEntity().getLocation().getYaw() * 256f) / 360f)));
        connection.sendPacket(new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.REMOVE_PLAYER, EntityNurse.nurse));
    }```
#

i removed static abuse

worthy yarrow
lost matrix
#

You are sending the PacketPlayOutNamedEntitySpawn packet but then also adding the same entity to the world (which will result in the same packet being sent again)

sterile flicker
lost matrix
#

Do you want the NPC to be virtual or actually on the server?

sterile flicker
#

What do you mean

lost matrix
#

You are sending packets to make the player believe another player is standing there while the server has no idea about that.
But adding the entity to the world makes the server actually aware of that entity (which will result in the server ticking the entity)

#

I would recommend you to use Citizens or anothe NPC library for now. Im seeing a few red flags in your code (not to mention the dangerous static abuse)

sterile flicker
grim ice
#

because the difference between the two numbers is 10

#

it wouldn't be 90% or 100%

grim ice
topaz iron
#

Hello everyone, I'm currently developing a Minecraft Spigot 1.20.4 plugin and I'm having trouble creating custom enchantments. I create them and apply them to an item, and they are indeed on the item, but the item is not highlighted and doesn't have the enchantment in its lore... Is this normal?

#

This is a text translated into English, sorry in advance...

grim hound
#

Does anyone know the Server Declare Commands Packet?

#

Cuz what even are the arguments

topaz iron
#

ok

valid burrow
#

whats an easy way to make this take into account damage modifiers

#

i always assumed e.getDamage has all damage modifiers

#

but ig now

valid burrow
#

oh okay thxc

grim hound
#

From the event

valid burrow
#

mhm thx

topaz iron
#

<code>

#

oups

#

Is there a command to share code ?

brazen badge
#

?paste

undone axleBOT
topaz iron
topaz iron
valid burrow
#

what issue are you experiencing

topaz iron
#

when i take the item on me i dont see the echant on it ... its normal ??

tender shard
#

yes, the client doesnt have a translation for your custom enchantment

valid burrow
#

what he said

topaz iron
tender shard
#

add lore

valid burrow
#

you could just add lore

#

yh

#

item.getItemMeta

#

meta.setlore

tender shard
#

also you shouldn't extend the bukkit Enchantment class

valid burrow
#

item.setMeta

topaz iron
#

yeah but the item is dont Shine

valid burrow
#

u can add shine

topaz iron
#

how ?

valid burrow
#

add any entchantment

#

and set it to false for displaying

#

meta.addEnchant(Enchantment.LURE, 1, false); // Use any enchantment

topaz iron
#

yeah but the enchant gonna affect the item .....

valid burrow
#

no

#

if you put lure on a sword

#

that isnt gonna do anything

#

lol

tender shard
topaz iron
#

okk i see

valid burrow
#

i thought thats what it is

#

what else is it lol

tender shard
valid burrow
#

oh lol

#

then i was misintepreting my old code

#

mb

topaz iron
#

okk i gonna try thx guys !!

valid burrow
#

well u can still add a random entchant and remove it in the lore ig right @tender shard ?

topaz iron
#

yes

valid burrow
#

yh then do that

#

otherwise

#

you would have to use nms

#

i think

golden turret
#

ik someone will say it is not the right server, but shouldnt it work?

chrome beacon
#

that would probably work if it was groovy

#

and not kotlin

#

you'll need to get the task in another way ig

golden turret
#

but this works on another module

golden turret
chrome beacon
golden turret
#

so, how can i do it?

#

looks like this did the trick

chrome beacon
#

I prefer Groovy

#

so I don't use kotlin

golden turret
#

the code lint for kotlin is more beautiful

#

it is enough reason for me

topaz iron
#

?paste

undone axleBOT
topaz iron
#

hey its me again xDDDD

#

i have this error on paste and my code too

#

if someone know how patch it i ganna be happy for the night ; )

chrome beacon
#

It appears that you're casting something you shouldn't

#

and that you didn't send the right code

topaz iron
#

what do you mean it the right code where is the issue

#

??

chrome beacon
#

fr.plugin.itemCustom.enchants.enventGrappin.onDamage(enventGrappin.java:21)
is where the issue is

#

you also seem to be breaking naming conventions

topaz iron
#

yeah but it was a try with a enchant manager but is the same with this

chrome beacon
#

?conventions

topaz iron
chrome beacon
#

The entire plugin is just a test?

topaz iron
#

yeah

chrome beacon
#

oh well ig

#

you really shouldn't be using that interface for enchantments anyway so 🤷‍♂️

topaz iron
#

witch interface i should use ?

chrome beacon
#

Implementing interfaces from bukkit isn't safe unless explicitly specified so

#

You can use PDC to add data such as your own enchantments to the item

#

?pdc

topaz iron
#

If I understand correctly i must to create a custom class enchant and and on" metadata item" the enchant and read it on evnet ?

manic delta
#

Hello, I am using nms to try to hide a player with #Player.hidePlayer() but show him in the tablist to the other players, I have my reasons and I am not going to use the invisibility effect (some answers that I saw checking other forums), I have this code, I don't usually use packets (it's the first time) and I have this code from a friend of his plugin from 1.18.2 that does that, I tried to use it (I'm on 1.20.4) and it doesn't work, at first I I encounter this error when using the code java.lang.NoClassDefFoundError: org/bukkit/craftbukkit/v1_20_R3/entity/CraftPlayer, I don't know why 1.20.3 comes out if I am using the buildtool 1.20.4-R0.1-SNAPSHOT, I have this code and would like help with it

private static void hide(Player tohide, Player hider) {
        tohide.hidePlayer(NokHidePlus.getPlugin(), hider);
        ClientboundPlayerInfoUpdatePacket packet = ClientboundPlayerInfoUpdatePacket.a(Arrays.asList(new EntityPlayer[] { ((CraftPlayer)tohide).getHandle() }));
        (((CraftPlayer)hider).getHandle()).c.a(packet);
    }
    
    private static void show(Player toshow, Player shower) {
        ClientboundPlayerInfoRemovePacket packet = new ClientboundPlayerInfoRemovePacket(Arrays.asList(new UUID[] { toshow.getUniqueId() }));
        (((CraftPlayer)shower).getHandle()).c.a(packet);
        shower.showPlayer(NokHidePlus.getPlugin(), toshow);
    }
remote swallow
#

1_20_R3 is 1.20.4

manic delta
#

oh so first error fixed!

#

thank you

#

well idk how to make packets works so

#

probably the packet part is wrong

chrome beacon
#

Just use the api

#

ah wait I missed tablist part

manic delta
#

yep

#

i think i can do it with protocolib but

#

idk how to use protocolib either so

chrome beacon
#

I recommend using mappings

#

It will make things easier

#

?nms

manic delta
#

ill try if i use packets someday

#

(damn using packets is so hard)

dusty totem
#

Hey, is there a plugin for bungeecord/flamecord that could do the POST request on a specific URL with a client IP?

chrome beacon
#

not enough information

#

you'll probably have to comission it

#

this channel is for making them

dusty totem
#

I guess if I will not find it I will come back here

buoyant viper
#

couldve sworn MethodHandles was reflect

#

i knew LMF wasnt, but i usually just end up using it with my stuff that uses reflect :V

#

for the quicker method invocation

zinc moat
remote swallow
#

its the internal server code of minecraft

river oracle
eternal night
young knoll
#

Everything is api if you cope hard enough

dusty totem
#

Hey, I can't found solution for my problem, so I need create my own plugin.
In case of IDE i would like to use VSCode, do I need install something else than JDK and Extension on VSC for Java?
Is there a snippet for Bungeecord plugin?

rotund pond
#

Hello everyone
I need to interact with the basalt generation to change it with another block but I can't find which even I should listen to
Can anyone give me some tips please ? :x

drowsy helm
#

Java is the only language I would advise not use vsc though, intellij and eclipse are a lot more specialised

drowsy helm
rotund pond
drowsy helm
#

Ooh gotcha

eternal night
#

block form event handles those cases usually ^

drowsy helm
#

BlockFormEvent

#

Negative sniped

eternal night
#

double answer never hurt nobody

#

and tbf I was guessing kekwhyper

rotund pond
#

Oh I didn't think about this event
I haven't used spigot for a long time, feeling lost sometimes 😦

#

Thank you for your help guys 🙏

cedar flint
#

I am making custom enchantments. I was trying to add that if you put an item in slot 1 of the anvil and a custom enchanted book with lore and a custom enchantment in slot 2 that it would combine in the output slot. Now I cant get something to show up in the output slot. So is it even possible to do this with plugins?

drowsy helm
#

Yes

#

How are you attempting to do it

cedar flint
#

Just experimenting and checking here if it is possible.

cedar flint
#

Now I have this. A few problems with it.

  1. If i put in the items I first have to click on the result slot to make something appear
  2. I cant take anything out of the result slot
ItemStack firstItem = contents[0];
ItemStack secondItem = contents[1];

if (firstItem.getType() == Material.DIRT && secondItem.getType() == Material.STICK) {
      ItemStack result = new ItemStack(Material.DIAMOND);
      anvilInventory.setItem(2, result);
}
young knoll
#

Pretty sure the event has a setResult

pliant kite
#

hi, i'm trying to send a block update to a target block & its surrounding blocks, i tried BlockState#update but that didn't work

young knoll
#

That’s because it’s not part of the api

pliant kite
#

why are people talking about CraftBukkit methods on the spigot forums

#

does anyone know how I can force a block update on a block

river oracle
# eternal night even api ?

Yes it even does api atleast for me but I'm kinda a chad pure NMS developer haven't used the bukkit api since the 90s

cedar flint
young knoll
#

I don’t think we have any api to force an update

#

So you’ll have to go with that method or just replace the entire block I guess

pliant kite
flat olive
#

How can I turn off the auto completion in 1.20.4 for the aliases that my plugin/commands have??

young knoll
pliant kite
pliant kite
#
target.setBlockData(data, true);

BlockState state = target.getState();
target.setType(Material.AIR);
state.update(true, true);
``` this does not update the block either
#

i'm changing the block rotation with setBlockData(data)

#

but rotating a repeater that shouldnt be powered anymore doesnt cause it to update

eternal oxide
#

You are changing the type on target then overwriting it with a state update

#

a BlockState is a snapshot of the Block. It is not live

#

If you call update on a BlockState it will push teh snapshot data to the live Block.

#

if you want teh client to see an update you will likely have to delay your state.update a tick

quaint mantle
#

@river oracle yo

#

I implemented merge sort iterative style

#

That was way more complicated

#

Like fully understanding why it works

#

But it's basically just merge sort but bottom up

river oracle
#

wild

pliant kite
lost matrix
#

Setting the BlockData doesnt require a state update

pliant kite
#

then how do i get the block to update 😭

lost matrix
#

*unless target is of type BlockState

pliant kite
#

target is a block

lost matrix
#

Add a debug message to check if your code is even called.
After that, show us your whole code

pliant kite
#

im trying to send a block update after editing the block rotation data so that if the new blocks rotation has different parameters than its old one (ie a repeater no longer facing a power source) then it will update itself & its surrounding blocks

#

the blockdata call is being called because the rotation is being applied

#

its just not updating the power state

lost matrix
#

Ah, those are calculated on physics updates

pliant kite
#

okay, so shouldnt BlockState#update(true, true) force physics updates with the 2nd bool

#

or am i missing something

lost matrix
#

Hm, my first instinct would be to upate the BlockState like that.

#

Yeah

pliant kite
#

that doesn't work

pliant kite
lost matrix
#

Let me check that out

pliant kite
#

they ended up using NMS

river oracle
#

If we need NMS to update a block this definitely needs to be API I feel like something is missing here

young knoll
#

I think craftbukkit may just skip doing anything if the current and target state are the same

pliant kite
#

unless im just a noob

young knoll
lost matrix
#

The problem might be that the BlockData is an instance of AnaloguePowerable which will be applied as well.
Did we try updating one tick later as well already?

pliant kite
#

can i update a block around it or something?

pliant kite
river oracle
pliant kite
#

doesn't do anything

river oracle
#

Well it should

young knoll
#

I don’t think the repeater itself needs an update

#

I think the block that would be powering it does

pliant kite
#

wouldn't updating the repeater make it check if it should be powered or not?

#

im trying to make this work for more than just repeaters too so i dont want to just case it out and update the back face of it

young knoll
#

I think redstone components update their state in onNeighbourChanged

lost matrix
pliant kite
#

lol

lost matrix
#

Next idea: Lets create a clean new BlockData from the blocks material, apply the rotation and then update the block.

#

If that doesnt work we enslave coll to write a pr

young knoll
#

I have a feeling that’ll make it always unpowered after rotating

#

Even if the new placement should be powered

lost matrix
#

Yes there is a high probability of exactly this happening

pliant kite
#

maybe the block below it, since that will always be a block

lost matrix
#

You can try simply updating all 6 ordinal directions

#

Youll hit the power source then for sure

pliant kite
#

im trying to think of other cases besides repeaters and comparators where this is going to be an issue

#

i think thats kind of it actually

lost matrix
#

I dont think there are any other powered blocks where the rotation is of importance.

young knoll
#

Well

#

There’s wire

pliant kite
#

wire doesnt have rotation

lost matrix
#

I thought about that, but the powered state doesnt rely on its connections

pliant kite
#

it has directions

#

like booleans for cardinal directions

#

like walls

#

im only dealing with Directional, Rotatable, and Orientable blocks

#

holy fuck i did it

pliant kite
#
target.setBlockData(data, true);
Block below = target.getRelative(BlockFace.DOWN);
BlockState belowState = below.getState();
below.setType(Material.BEDROCK);
Bukkit.getScheduler().runTask(Bleef.plugin, () -> belowState.update(true, true));
``` this seems so wrong but ok
river oracle
#

Mojank mojank

pliant kite
#

appreciate the help

echo basalt
#

help I made an impulsive purchase

#

tomorrow I'm upgrading my pc's ram to 64gb swagcircle

#

I can finally open like 19 intellij windows and like 2 chrome tabs

pliant kite
#

for a tick

#

and its ugly af

lost matrix
rough ibex
#

depends on how you register them in the first place

flat olive
#

Because I dont like typing /gamemode and seeing on tab stacked /gamemode and /Gamemode

#

I want my aliases hidden

#

Does that make sense?

#

Please help me

rough ibex
#

I thought commands were case insensitive

#

anyway

#

commands are commands

flat olive
#

It gives an error once they type a capital or something in the first argument

rough ibex
#

I didnt know they werent already

flat olive
#

thats why I added aliases with a capital

rough ibex
#

Okay so just dont

flat olive
#

yeah its very odd

rough ibex
#

Dont type Gamemode?

flat olive
#

I know but if someone were to type the command I want the caps to not matter for the command and it to work

#

it makes the command more unique

rough ibex
#

Make some kind of command preprocessor then

flat olive
#

thanks for this, case insensitive I was looking for these words

rough ibex
#

lowercase command

icy beacon
#

by definition of unique a command with multiple aliases is less unique than a command with no aliases

#

i'm just picking on words

rough ibex
#

Truth

flat olive
#

True

#

I wish it wasnt case sensitive and didnt give an error

#

sorry

#

don't mean to make a commotion, thanks for your help though..

icy beacon
#

nah you are using this channel as intended

#

don't worry

grave terrace
#

i made the plugin using intellij

#

i made a plugin but, i cant seem to get it working

#

can someone please help me

agile anvil
#

Do you have any errors? Logs? Indication about what is "noy working"?

grave terrace
#

no

grave terrace
#

idk what it is

rough ibex
#

Well give us something

#

we cant fix something that doesnt apparently exist

agile anvil
#

Tell us what was your step, what you did, where you're stuck, ...

plucky rock
#

does any1 happen to know how I would push the plaeyr straight up

#
            if (attacker instanceof Spider) {
                if (AttackerName.contains("§5King of Spider's Servant")) {
                    Vector up = new Vector(0, Playerloc.getDirection().getY(), 0);
                    up.normalize();

                    up.multiply(5);
                    player.setVelocity(up);
                    player.sendMessage("Debug3");

                }

            }```
this is what i have
shadow night
#

Oh no, uppercase variable, checking mob by name?

plucky rock
#

yeah

#

is there a better way to do it?

#

i assume yes

#

but i aint that smart

#

also im very new to this

#

this is ~3rd day

#

would any1 be able to explain how vectors work?

#

i mean i get its direction and magnitude

#

ive done physics

#

but like

#

in code

#

how does it work

#

im my head i assume this would work

#

but

#

it doesn't

#

also im not getting any errors

#

i dont want to be spoonfed as i kinda want to learn

agile anvil
#

Why are you making a vector with the player.getDirection().getY(), then normalizing (which mean the norm of the vector will be 1)?

plucky rock
#

oh

#

so i dont normalize it?

agile anvil
#

What you're trying to do is push the player 5 blocks up?

plucky rock
#

yeah

agile anvil
#

Then create a Vector with 5 on the y, and apply it to the player with the #setVelocity as you did

plucky rock
#

ic

#

so would i set x and z to 0?

#

liek what i alrdy did?

agile anvil
#

If you only want a jump then x and z should remain 0

plucky rock
#

if (attacker instanceof Spider) {
                if (AttackerName.contains("§5King of Spider's Servant")) {
                    Vector up = new Vector(0, 5, 0);
                    player.setVelocity(up);
                    player.sendMessage("Debug3");

                }

            }```
#

this is what i have

agile anvil
#

Imagine your vector as the arrow showing where the player should jump

plucky rock
#

yea

#

i get that

#

but like

#

that would work no?

agile anvil
#

Should

plucky rock
#

i tried it

agile anvil
#

Have you tried ?

plucky rock
#

and its not

agile anvil
#

ah

#

What do you mean by it's not ahah

plucky rock
#

well dubug 3 is sending

#

but im not getting launched

agile anvil
#

Please then try to get the player's velocity as based vector. And set the Y to 5.

plucky rock
#

hm

#

ok

#

alr trying it

#

give me a few seconds to test

#
            if (attacker instanceof Spider) {
                if (AttackerName.contains("§5King of Spider's Servant")) {
                    Vector up = new Vector(0, 100, 0);
                    player.setVelocity(player.getVelocity().add(up));
                    player.sendMessage("Debug3");

                }

            }
``` stilld oesnt work
#

changed number

#

to see if it was noticable

#

but it just doesnt change the velocity

grave terrace
#

@rough ibex pls check your dms

plucky rock
#

who ate his butter?

agile anvil
#

Try

Vector up = player.getVelocity().setY(5);
plucky rock
#

ok

#

ty

#

i shall try

grave terrace
#

@agile anvil pls check your dms

agile anvil
grave terrace
#

ok

#

can i send

#

screenshots

agile anvil
#

You need to get verified first

#

(link your spigot account)

grave terrace
#

how?

agile anvil
#

Good question

#

./verify

plucky rock
#
            if (attacker instanceof Spider) {
                if (AttackerName.contains("§5King of Spider's Servant")) {
                    Vector up = player.getVelocity().setY(100);
                    player.setVelocity(up);
                    player.sendMessage("Debug3333");

                }

            }``` still dont work changed msg to make sure made it 100 cause i thought 5 might not be noticable
#

soo

#

at this poitnt i have no clue

#

this is a EntityDamageEntity event

#

so there is some velocity due to the kb on getting hit