#help-development

1 messages · Page 2067 of 1

kind hatch
#

You are right though. PascalCaseIsLikeThis

solar sable
#

how do I give a player effects after it consumes(eat) something

quasi flint
#

But would it be possible to know the Block?

undone axleBOT
quasi flint
kind hatch
solar sable
#

yes but I am asking how because I do not know how

kind hatch
quasi flint
#

Ok

kind hatch
solar sable
kind hatch
#

Compare Material Types.

solar sable
#

I want it to be the recipe I made

kind hatch
#

Or use the PDC

solar sable
#

whats a pdc?

kind hatch
#

If you are making a custom recipe. Add some value in the PDC. That way you can use it for comparisons in the future.

#

PersistentDataContainer. It's an easy way to add custom NBT data to items.

solar sable
#

pls note that I dont have enough wifi to open other browsers than discord that is why i am asking in here without using google :)

kind hatch
#

It also persists after a server restart. hence the PersistentDataContainer

eternal needle
eternal needle
#

yes

eternal needle
kind hatch
#

Did you register the event?

solar sable
#

can you help a bit? idrk how to even use it can you maybe show some examples

eternal needle
kind hatch
#

If you want it to work yes. 😛

#

Register the event in your main class using JavaPlugin#getServer()#getPluginManager()#registerEvents()

eternal needle
#

i have registerd command like this ``` registerCommand("Freeze", new Freeze(),"f")

kind hatch
#

That's the command. Not the event listener.

#

Your event may be inside the class, but it still needs to be registered.

eternal needle
#

how`?

kind hatch
#

So you would have two registrations for that class.

  • 1 for the command
  • 1 for the event
#

^

eternal needle
#

where?

kind hatch
#

Somewhere in your main class.

eternal needle
#

got it in main

#

what do i need to have on plugin. Have not used this befor

kind hatch
#

An instance of your main class that extends JavaPlugin.

kind hatch
eternal needle
#

what how?

#

but way do i get wrong on Freeze

#

it's like this

    getServer().getPluginManager().registerEvents(Freeze, this);
desert musk
#

is there any feasible way to block the "Respawn point set" message?

eternal needle
#

and thats it?

kind hatch
desert musk
#

no, on java edition it shows up in chat

kind hatch
# eternal needle how

The same way you make any other instance.

// obj is a variable name referring to this specific instance.
Object obj = new Object();

How you use it is up to you and your needs.

#

?learnjava

undone axleBOT
sacred mountain
#

cheese

eternal needle
#

oh

sacred mountain
eternal needle
#

but i can't now but i can learn it in some weeks

kind hatch
#

Well yea. It'll take some time to learn the language. It's not as if we are expecting you to learn everything about it overnight. 😛

eternal needle
#

getServer().getPluginManager().registerEvents(new Freeze(), this); just wonder what does this. Does it do so i get a command like /freeze? or?

kind hatch
#

That registers the event code that you created in the Freeze class.

#

It ties that code to your plugin.

eternal needle
#

but how does it fix it? so that work? if i don't have /freeze and don't make players stand still?

kind hatch
#

To go into more detail.

You are telling the server that you have something that you want to listen for. The server needs to know what event you want to listen for and an instance of your plugin so that it knows who all to send the event to. You also need to indicate where the listener code is. Hence the @EventHandler annotation above the method. All of this combined together is what makes the listener.

#

Now, that is only for the event part.

#

Commands are similar though.

eternal needle
#

so that i did was make it send messages and not make player stand still?

kind hatch
#

All you did was make a command that puts the player in a list. The code that utilizes that list is never called because you didn't register the listener.
So the server has no idea that you wanted to listen for that event. That's why the code does not run.

eternal needle
#

ok, getCommand does so i can do /freeze and getServer().getPluginManager().registerEvents(new Freeze(), this); Makes it so the server knows what to do?

atomic violet
#

is there any way to make an entity such as a skeleton, look in the direction of the player, but per player, with packets? so no matter where you go, the skeleton always looks at you?

hardy crystal
#

i need to update this to 1.18.2

import net.minecraft.server.v1_16_R3.BlockPosition;
import net.minecraft.server.v1_16_R3.ChatMessage;
import net.minecraft.server.v1_16_R3.DataWatcher;
import net.minecraft.server.v1_16_R3.DataWatcherObject;
import net.minecraft.server.v1_16_R3.DataWatcherRegistry;
import net.minecraft.server.v1_16_R3.Entity;
import net.minecraft.server.v1_16_R3.EntityHuman;
import net.minecraft.server.v1_16_R3.EntityPlayer;
import net.minecraft.server.v1_16_R3.EntityPose;
import net.minecraft.server.v1_16_R3.EnumGamemode;
import net.minecraft.server.v1_16_R3.EnumItemSlot;
import net.minecraft.server.v1_16_R3.ItemStack;
import net.minecraft.server.v1_16_R3.PacketPlayOutEntity.PacketPlayOutRelEntityMove;
import net.minecraft.server.v1_16_R3.PacketPlayOutEntityDestroy;
import net.minecraft.server.v1_16_R3.PacketPlayOutEntityEquipment;
import net.minecraft.server.v1_16_R3.PacketPlayOutEntityMetadata;
import net.minecraft.server.v1_16_R3.PacketPlayOutNamedEntitySpawn;
import net.minecraft.server.v1_16_R3.PacketPlayOutPlayerInfo;
import net.minecraft.server.v1_16_R3.PacketPlayOutPlayerInfo.EnumPlayerInfoAction;
import net.minecraft.server.v1_16_R3.PacketPlayOutPlayerInfo.PlayerInfoData;
import net.minecraft.server.v1_16_R3.PlayerConnection;
import net.minecraft.server.v1_16_R3.PlayerInteractManager;```
kind hatch
#

The second one.

hardy crystal
#

what is the 1.18.2 corrispettive?

kind hatch
lavish hemlock
#

I prefer

public boolean method(@NotNull Player player) {
    // ...
}
#

Final parameters are just pointless and add to code noisiness

#

(They also increase the amount of time you spend typing)

atomic violet
eternal needle
kind hatch
kind hatch
atomic violet
#

ill look into it

kind hatch
atomic violet
#

is that a server?

kind hatch
atomic violet
#

ohh ok, thanks

kind hatch
kind hatch
#

Depends on the use case.

eternal needle
kind hatch
#

I thought that wasn’t an issue? How are you setting the armorstands visibility?

#

Huh, that’s odd. I’m pretty sure that’s what you are supposed to do to hide the armorstand. Although I don’t know why it would hide the items. Even using the vanilla command still makes the items visible.

crimson terrace
#

or are the items just not being put on the armorstand when you try turning it invisible?

eternal needle
kind hatch
# eternal needle if i wana run this do i need to putt eventhandler in another class file? and use...

You need to do two things in order for what you want to work.

  1. Register the command
  • It seems like you already have this done.
  1. Register the event listener
  • The code for the listener can be in any class you want.
  • You just need to make sure that you are meeting the requirements in order for the event code to be fired.
    • Those requirements are the @EventHandler annotation above the method.
    • For the event to be registered.
ornate patio
#

is there an easy way to detect if a player built a structure

ornate patio
#

i want to specifically check if the player constructed a tier 1 netherrite beacon

kind hatch
eternal needle
grim ice
#

how to push a player backwards to 4 blocks

low temple
kind hatch
#

Change the player's velocity. I think multiplying it would work, but I haven't worked that much with Vector math. It's probably not as simple as that.

marsh burrow
#

Would anyone know of a way to ignore processing a packet that you just sent? I only want to listen to packets not sent via my plugin

keen mica
#

does anyone have a list of everything that can prevent a player from sprinting?

noble lantern
#

if player.isSprinting()

player.setSprinting(false)

eternal oxide
#

Asthma

keen mica
#

no i mean like ingame stuff

solid glade
#

I want a player to essentially be able to right click and riptide through the air, but without it raining

#

What event(s) could I use to achieve this because I'm really lost right now 😂

low temple
# grim ice launch

Then do something like “player.setVelocity(player.getDirection().multiply(NUMBER));”

Make “NUMBER” negative and play around with values

grim ice
#

cant i just do -4

low temple
noble lantern
#

nah 0

low temple
solid glade
#

What about the spin animation

low temple
#

I think there’s a Player#playAnimation()

#

Or something of the sort

solid glade
#

oooh okay

#

tyty

kind hatch
#

You'll likely have to do it manually. Listen for the PlayerInteractEvent, check if they have a riptide trident, then send the animation packets.

solid glade
#

It's meant to be done without the trident

#

but i get what ya mean

marsh burrow
#

Would anyone know of a way to ignore processing a packet that you just sent?

ivory sleet
#

in or out?

marsh burrow
# ivory sleet in or out?

a mix of both, I take in a chat packet, process it (cancel it) and then send out another chat packet, I need to ignore the next time the event is triggered on the one I sent out

spring minnow
#

why sending another chat packet ? Just modify the message of the current chat packet

marsh burrow
#

if I process it synced it lags the server hard

spring minnow
#

AsyncPlayerChatEvent

midnight shore
#

Hi, how can i check if an inventory is full?

#

without counting the armor

#

like is there a way to get how many free slots are there?

marsh burrow
spring minnow
#

oh so you're using a packet listener

marsh burrow
spring minnow
#

not a chatEvent

marsh burrow
spring minnow
#

then idk

marsh burrow
#

you think protocolLib has a discord?

spring minnow
#

idk

spring minnow
marsh burrow
#

I can, but thats not the issue, I need to fully ignore the resulting packet I send out, apparently using the packet.equals(packetPreviouslySentOut) doesn't work for some odd reason

#

the uuid thing I saw was a good idea, but the uuid that shows up is just 00000000-0000-0000-0000-000000000000

spring minnow
#

oh

#

you used packetContainer id?

marsh burrow
#

well kinda, there is a Set of UUIDs

spring minnow
#

access to packetCOntainer from the packet and use getId

#

but that's a deprecated method, probably doesn't even work anymore

marsh burrow
#

bah yeah its deprecated

spring minnow
#

try, may still works

#

if doesn't, idk, i usually don't use ProtocolLib cuz i don't use packets

marsh burrow
#

eh, it just returns the id of the event id

spring minnow
#

oh

marsh burrow
#

PacketType.Play.Server.CHAT returns 15 when you get the id

spring minnow
#

then its useless, sorry i can't help you

marsh burrow
spring minnow
#

good luck trying to find the solution

sage dragon
#
            for (Box box1 : this.boxList) {
                boolean inMaxLocationBounds = false;
                boolean inMinLocationBounds = false;

                if (x <= box1.getMaxLocation().getX() && z <= box1.getMaxLocation().getZ())
                    inMaxLocationBounds = true;

                if (x >= box1.getMinLocation().getX() && z >= box1.getMinLocation().getZ())
                    inMinLocationBounds = true;

                if (inMaxLocationBounds && inMinLocationBounds) {
                    box = box1;
                    break;
                }
            }

Does anyone see something wrong here? inMaxLocationBounds && inMinLocationBounds seems to never return true...

quaint mantle
#

because the conditions are not met/

sterile token
#

So its possible to get current spigot and bungee netty isntance?? Because i didnt find the getters

sage dragon
unique eagle
#

Hello ! it's possible with gradle to import multi version of spigot-api nms?

#

i use ```compileOnly 'org.spigotmc:spigot-api:1.18.2-R0.1-SNAPSHOT'
compileOnly 'org.spigotmc:spigot:1.18.2-R0.1-SNAPSHOT'

compileOnly 'org.spigotmc:spigot-api:1.17.1-R0.1-SNAPSHOT'
compileOnly 'org.spigotmc:spigot:1.17.1-R0.1-SNAPSHOT'```

grim ice
#

im checking player move event to check when player enters a region

#

im doing a for loop in it

#

and checking bounding box

#

is that fine

#

or is it laggy

vocal cloud
#

With a lot of players that could cause a fair bit of lag I imagine

sharp bough
#

how many regions do you estimate to have?

vocal cloud
#

🤷‍♂️ sometimes there is no better option

grim ice
#

Not sure

#

it's not my server

#

it's the server owner choice to have any amount of regions

sharp bough
#

what you could do is instead of registering the player movement event, take the areas and save two opposite corner locations, then in a loop once every 20 ticks check if theres a player within any of the two locations

grim ice
#

nah im using boundingbox

#

im not a legacy freak :) (well i am sometimes depends on the customer)

sharp bough
#

?

sterile token
#

That why its you should use World edit cuboid

grim ice
#

No

#

Why should I ever have a dependency for that

#

thats so dumb

sterile token
#

Because worled edit cuboid its used for to keep server perfomance

sharp bough
#

its a different approach to know when a player enters a region

grim ice
#

wdym

#

a region is a bounding box lol

sharp bough
#

you need to know when a player enters a region correct?

#

like factions or plots

sterile token
grim ice
#

No, regions set in config

sharp bough
#

when a player enters a plot and you get the "you entered X's plot"

sharp bough
sterile token
sharp bough
#

save regions in memory, and loop the corners, check if player is within those two numbers

grim ice
#

thats what I do haha

grim ice
#

BoundingBox abstracts it away for me

sharp bough
grim ice
#
    @EventHandler
    public void onPlayerMove(PlayerMoveEvent event) {
        if(event.getTo() == null) return;
        if(event.getPlayer().getInventory().getArmorContents().length == 0 &&
                ArmoredPVP.getArenaSet().stream().anyMatch(arena -> Arena.contains(arena, event.getTo()))) {
            // entering a pvp arena while naked
            event.getPlayer().sendMessage(ChatColor.DARK_RED + "You are not allowed to enter PVP Arenas " +
                    "when not wearing a single piece of armor, please wear armor.");
            event.setCancelled(true);

        }
    }```
#

always starting with cheaper checks B)

sharp bough
#

then whats the question?

#

that doesnt work?

grim ice
#

any improvements?

#

nah it works

sterile token
grim ice
#

yeah

sterile token
#

Because the claim get protected using a radius

grim ice
#

thats just the way of generating the corners

sharp bough
grim ice
#

it isnt a world guard region lol

sharp bough
#

its an arena?

grim ice
#

ye

sharp bough
#

like a pvp zone or smth

sterile token
grim ice
sterile token
#

But without using world guard or world edit

grim ice
#

well id

#

idk

#

im doing what my customer wants

sterile token
#

You are doing a cuboid location that the correct name

grim ice
#

i dont ask questions

sharp bough
grim ice
#

nah

#

it works

#

and with good design

sharp bough
#

if you are so confident then why are you asking for improvements?

#

what are you expecting? choco to come here and help you with your 10$ plugin?

#

lmao

grim ice
#

why so mad

#

Lol

#

theres always a room for improvement

sharp bough
#

cuz we keep giving you ways of doing it and you reject them

grim ice
#

cuz ur ways arent possible for my case

sterile token
#

If you dont have patient dont help its simply

sharp bough
#

lmao

sterile token
#

You look like my teacher he argue when we have to correct homework but he is the one who sent them

grim ice
#

According to your github that is

sterile token
#

Dont listen him

sharp bough
#

omg bro fuck off

grim ice
#

is he some god for you or smth

#

wow mad

#

chill my dude

sterile token
#

He just shiting you when he dont even have experience

lethal knoll
#

What is this even about?

sterile token
vocal cloud
#

Imo if you come and ask for help with a paid plugin idgaf the only stipulation is you either share the code you need help with or heck off

grim ice
#

"paid" doesnt instantly remove your human rights of learning

vocal cloud
#

Yes like I said. I don't care as long as you're willing to share the code. Some people think they can just ask a question without sharing the code and that's a facepalm

grim ice
#

I shared the code sir

grim ice
#

code relevant to my question

rough drift
grim ice
sterile token
#

Oh lamo people its so mad these days

rough drift
#

can i ask for smt or ya'll already answering sm1?

vocal cloud
#

I only get mad if you have the audacity to ask for help with a paid plugin but you don't want to show the code you need help with

rough drift
#
end.setX(original.getX() + (end.getX() - original.getX()) * Math.cos(Math.toRadians(rotation)) - (end.getZ() - original.getZ()) * Math.sin(Math.toRadians(rotation)));

end.setZ(original.getZ() + (end.getZ() - original.getZ()) * Math.cos(Math.toRadians(rotation)) + (end.getX() - original.getX()) * Math.sin(Math.toRadians(rotation)));

end.setY(original.getY() + (end.getY() - original.getY()) * Math.cos(Math.toRadians(rotation)) - (end.getY() - original.getY()) * Math.sin(Math.toRadians(rotation)));
```I do believe this is wrong... however I don't really know how to do this (FYI: rotating a point around another point in 3D space)
grim ice
#

that seems like pain

rough drift
#

yes

#

I am willing to learn how to do it, don't need the code

#

I just wanna know if there's a formula for it and it's wikipedia page (I am not really good at finding this stuff)

sterile token
#

So its possible to get current spigot netty instance not?

#

Looks like im ignored

rough drift
sterile token
#

But doesnt the spigot server have a getter for it?

rough drift
#

no

#

you can

#

however

#

inject into a player's packet handler

quaint mantle
#

?kick @sharp bough aggression

undone axleBOT
#

Done. That felt good.

sterile token
#

No i dont want player handler i want to inject my custom channel

sterile token
sharp bough
#

why you kicking me lmao

rough drift
#

what

sterile token
rough drift
#

what do you need it for

quaint mantle
sharp bough
#

wtf

fossil lily
#

How do you set a custom name with Protocol Lib?

quaint mantle
#

@grim ice not everything is a competition btw

sterile token
rough drift
sharp bough
#

3 messages 3 tags lmao

rough drift
#

imagine getting mad

#

for 3 tags

sterile token
#

Yeah

#

Before the tags he was already being mad

sterile token
#

Why github copilot doesnt work on intellij

quaint mantle
#

it does

#

did you set it up right

rough drift
#

I use it constantly

sterile token
#

How do i setupt it correct?

#

I just installed and doesnt work

rough drift
#

and link your github

sterile token
#

How join to preview?

rough drift
#

it might take a couple of days, up to months

sterile token
#

I already have a access

#

I just dont know how to set up it on intellij

#

On vscode already works

rough drift
#

hmmmmmmmmmmm

sterile token
#

On intellij doesnt ask for logging

#

Idk why it didnt ask

rough drift
#

there's your prob

sterile token
#

forget about github copilot

#

So its possible or not to inject a custom channel handler to spigot server?

ornate patio
#

how do i set the explosion size of a firework

sterile token
#

And without needing a player or extra port

rough drift
#

I do not believe that's possible

#

unless you make a custom network

#

p2p

sterile token
#

I have heard that you can get the netty instance and register custom channels

rough drift
#

for players yes

#

idk abt server

sterile token
#

And its possible, but i dont know why the spigot doesnt have the netty getter

rough drift
#

because internal api bad

sterile token
#

Its so extrange that

rough drift
#

yes indeed

#

/s

sterile token
#

hat?

#

I didnt understand

rough drift
#

nah i believe they don't want devs to touch internal stuff

#

because yes

sterile token
#

Ah ok

#

Vodo do u have experience with mc protocol?

rough drift
#

a bit

#

i like to read various protocol specifications from time to time

sterile token
#

Because im connecting a socket to a spigot server. I send the client handshake and login packet. The fake client get connected to server. But my issue is that after some seconds it get disconnected

#

I was told im not asnwering a packet that come from server

rough drift
#

and receiving keep alives

sterile token
#

Oh how i do that?

#

Its a packet?

rough drift
#

yes

sterile token
#

Do you have the values?

sterile token
#

Because the wiki just said for example a number but a number can be any

#

Do i explain?

rough drift
#

so

#

whenever a server sends a keep alive

#

you get a clientbound keep alive packet

#

you have to just send it back

sterile token
#

Oh wait i can send code?

rough drift
#

how are you handling packets rn

sterile token
rough drift
#

yeah do that

rough drift
ornate patio
#

im looking at fireworkmeta

rough drift
#

do you want bigger particles?

ornate patio
#

i don't see anything about explosion size

ornate patio
rough drift
#

more explosion damage range

ornate patio
#

you know how you can add a fire charge to a firework star

rough drift
#

like bigger AOE damage

ornate patio
#

that's what im trying to do

rough drift
#

oh

#

hm

ornate patio
#

nevermind i found it

sterile token
rough drift
#

.addEffect(FireworkEffect.builder().with(FireworkEffect.Type.BALL_LARGE).build());

ornate patio
#

yeah i got it

#

thanks

rough drift
sterile token
#

How

#

Oh ok

rough drift
#

so once you established an outputstream

#

also get an input stream

#

and wait for packets

#

(usually its an int with packet id first)

sterile token
#

Allright for wating for pckets how i do?

#

Because i used to get server blocked

rough drift
#

get the input stream from the socket

sterile token
#

Yeah im done

rough drift
#

and wait until a new int

sterile token
#

And them i do

while (true)?

rough drift
#

yeah in a new thread ofc

sterile token
#

How?

rough drift
#

and do in.read()

sterile token
#

I never managed threads

rough drift
#

its pretty easy

sterile token
#

No i never fixed

#

No no sorry i get confused ithought you were talking about the protocol

sterile token
#

That what you mean?

rough drift
#

but

#

don't use Integer

#

use int

#

and between }) and ; add .start()

#

should work

sterile token
#

I tried and didnt receive anything

rough drift
#

hm?

#

show me your full code now

sterile token
#

Is it because im not parsing the int from protocol format?

rough drift
#

no

#

can i just see what you're doing

sterile token
#

Yeah

#

I will do a repo

#

And i ill add u

rough drift
#

kk

fervent gate
#

https://paste.md-5.net/oyimizucot.java
This mob doesn't want to follow me in game. I'm using a repeating task to set the target. Is this the correct method of doing it or should I adjust the yaw and pitch and move it on player move?

rough drift
#

a cow does not follow its target

#

i don't think it does

#

lemme check

fervent gate
#

Yea, that came to my mind too because it is not a hostile mob right?

rough drift
#

yeah

#

it follows only wheat

fervent gate
#

ah

#

How would I go about doing it then? The second way I stated, because I haven't found a pathfindergoal to follow the player

rough drift
#

hm

#

try adding setAware(true)

fervent gate
#

Let's try that

ornate patio
#

if i want to store a world in a database

#

should i store it's name or UUID

rough drift
#

uuid

ornate patio
#

okay thanks

rough drift
#

np

ornate patio
#

wait the UUID will always be the same after a server restart right?

rough drift
#

yes

#

ofc

ornate patio
#

alright

hexed hatch
rough drift
fervent gate
fervent gate
rough drift
#

tick() or tickMovement()

#

at least in fabric

fervent gate
#

Because teleporting wouldn't look natural, I want the walking animation

sterile token
#

IkeVoodoo

#

github name?

eager turtle
#

is it bad to use the same EventHandler in two different classes? or should I try to only use it once in one class for an entire plugin and call my different classes from there..

crisp steeple
#

making only one class with all your eventhandlers is usually a bad idea

echo basalt
#

you can get it through EntityInsentient#getNavigation

#

or if that's obfuscated, look for the method that returns NavigationAbstract

#

If you're using Paper however

#

there's a getPathfinder() method on newer versions

#
public static void makeEntityWalkTo(LivingEntity entity, Location target) {
    ((Mob) entity).getPathfinder().moveTo(target); // Paper

    ((EntityInsentient) ((CraftEntity) entity).getHandle()).D().a(target.getX(), target.getY(), target.getZ(), 1.0D); // NMS 1.18.1
}
eager turtle
cosmic pelican
sterile token
#

@rough drift its sending random numbers to console

#

Anyone know how top stop my fake client being disconnected from spigot server?

brave sparrow
#

Depends

sterile token
#

People told me that im not answering a packet

brave sparrow
#

What’s it being disconnected for

#

Then you’ll have to answer that packet

sterile token
#

but i odnt know which packet im not asnwring

#

To connect fake client im sending handshake and login packet

#
UUID of player FakeClient is 9ea4ad3a-e505-324a-8eec-a6d5be9da656
[19:18:49 INFO]: FakeClient[/127.0.0.1:50433] logged in with entity id 189 at ([world]237.5, 67.0, 259.5)
[19:19:15 INFO]: FakeClient lost connection: Disconnected
[19:19:15 INFO]: FakeClient left the game.
#

That what console said

brave sparrow
#

Do some debug on your client to figure out what packets the server sent you

sterile token
#

That wiki its shit lmao, it say a number but a number can be any of them

brave sparrow
#

The number is the ID of the packet

#

Lmfao

sterile token
#

Oh

brave sparrow
#

Each type of packet has an ID

sterile token
#

Im reading socket input and send random numbers

brave sparrow
#

that would be why it isn’t working

#

Lmfao

sterile token
#

But look i will send full code

#

Because if not it a mess

sterile token
#

Alex do you have experience with protocol?

brave sparrow
#

Yes

#

And before I had source access I pretty much exclusively used wiki.vg to do multi-version support

sterile token
#

I will send full code on paste md4

hexed hatch
sterile token
#

Because if not it mess to ask for help

brave sparrow
rare totem
#

does anyone know the current best way to have a piece of armor confer an effect (eg like speed boost) when equipped?

fervent gate
fervent gate
brave sparrow
brave sparrow
fervent gate
#

I'll look into it, thanks

brave sparrow
#

Otherwise

#

Just Entity#teleport

#

No NMS needed

#

@fervent gate

sterile token
brave sparrow
#

Teleporting an entity small distances is the same as it moving

fervent gate
#

Lemme try that first

brave sparrow
#

It’ll even play the walk animation

fervent gate
#

that's good

#

I just need the direction of the player then?

brave sparrow
brave sparrow
#

All of which is why pathfinder goals are better

fervent gate
#

alright, Ima look into that now

sterile token
brave sparrow
#

But the player direction is just Entity#getLocation#subtract(Player#getLocation)#normalize

brave sparrow
#

47 is 1.8

#

Did you read the link I sent?

sterile token
#

Im testing it on 1..8

#

that why

#

but them i will transform it into 1.18

brave sparrow
#

Those are two different protocols

#

There’s no guarantee you can just do that

sterile token
#

Oh allright

#

So it wont work?

brave sparrow
#

It might, it might not

#

You’ll have to compare the 1.8 protocol to the 1.18 protocol to see if it’s different

#

The protocol has changed significantly over the years

sterile token
#

Yeah them i will see how to changeit

#

My goal is to find hat happening

brave sparrow
#

Why are you using 1.8 at all if you want it to be 1.18

sterile token
#

Just for testing

#

And because my laptop its not so powerfull

#

Im currently not at home

#

And i dont have my pc

brave sparrow
#

So?

#

1.18 isn’t noticeably more draining for doing nothing

sterile token
#

So how would be on 1.18?

#

I have already changed the 47 to 1.18

brave sparrow
#

You mean to 758?

sterile token
brave sparrow
#

Which is the protocol number for 1.18.2

#

Ok

#

Now

#

You need all of that

sterile token
#

I read that the random numbers i received i have to sent them back to server

brave sparrow
#

They aren’t random numbers

#

You’re getting back packets

#

You have to process those packets and respond with your own

sterile token
#

Oh allright

brave sparrow
#

Go to the link I sent you

sterile token
#

Ok

brave sparrow
#

That’s the login procedure

sterile token
#

I already have handshake and login packet

brave sparrow
#

Yeah

#

There’s a lot more to go

sterile token
#

Lol

brave sparrow
#

There’s 34

sterile token
#

all that>?

brave sparrow
#

Yes

sterile token
#

But i dont need a functional client

brave sparrow
#

That’s not a functional client

#

That’s just the login

#

All of that is just to log in

sterile token
#

Oh lol

#

So after all that packets the client wont get disconnected?

brave sparrow
#

Well it will eventually if you don’t do the keep-alive

#

this is what you need for a functional client

sterile token
#

But i just need the fake client to dont get disconnected

#

How i do that?

brave sparrow
#

That’s where the random number thing comes in

sterile token
#

Yeah

brave sparrow
#

But you haven’t gotten there yet

sterile token
#

The randoms numbers come from server

brave sparrow
#

Also that wont stop you getting kicked for flying or anything

sterile token
#

So i have to send that random numbers back to server?

brave sparrow
#

Yes

#

But you have to do the full login first

sterile token
#

i already do login 🤔

brave sparrow
#

No

#

You do the first 2 steps of the login

#

Lmao

sterile token
#

Oh

#

Now i understand

brave sparrow
#

You have to do all 34

sterile token
#

Lol

#

Its amazing i think it was easier

#

0x0F what number should be?

marsh burrow
spring minnow
#

oh

#

Great

sterile token
#

what was he doing=

spring minnow
#

check the messages

marsh burrow
#

trying to ignore a packet I sent out after processing an incoming packet

sterile token
#

Oh ok

sterile token
brave sparrow
#

What’s the packet ID?

sterile token
#

I dont know i just receive random nubmers

#

i will send

brave sparrow
#

You’re not receiving random numbers

sterile token
#

9783
-6720885865635674370
-2872182536071555489
-1515049538550797621
7943598964305392838
3717606306607967019
-1029057608648320701
-4251591123670143769
-7123551701480720475
2590281037082944399
-254437462174330985
-6975290412891477074
-8225930841019027112
386851663906764627
9054916108658622950
-1492152040813417339
5677764234305073562
-4740355608672339880
571169791944419014
-2766222604636435847
-6091975346377233351
3993771747546666686
-3182435462612713593
7810331203703269278
-734298120557228083
-8165026422402125325
-3478688765184661833
-2551898662575015226
-594099067337672740
-5694892160023462700
-5675039433514904482
2823191252383239350
4627864840581915399
9126452892468965909
-253964690211398929
-3178846671983704593
-7702936916218357857
-940939251298788978
-7533897710054311220
2857064993874845871
-7068562884860056475
-8092422504159056566
-5574572059812073218
-1731350453854962325
-6759983271497187499
8681846510485286232
4309746907462484746
-8084788878993680434
3270116568233125363
-5490799802015113273
5827586868297197975
-866100016527914502
-913848820164300889
1969163620840017869
-4590719930314583578
7428593161257066391
-1514659195407709242
-7980493738159129367
-898328948557230163
-2312891804950928979
4971854126967401182
-2712048242715308095
-5551926267243193377
-993529155018585329
-5280753911065266625
8033359881023711103
5467358908350667339
-6991775548809195745
-28509492255031811
-1733476918860470373
-2595561278150521627
-1322050243390674589
-5267612018938054757
8028773268176928750
8499333407467302860

#

And still sending and sending

#

Are u sure that are packets?

#

I dont think

brave sparrow
#

Anything the server sends is a packet

#

If it’s a keep alive packet it will have a random number in the packet body

#

But the server isn’t just sending you numbers

#

I don’t think you understand how this works

#

Every type of packet has an ID

sterile token
#

I dont udnerstand what 00fx means

#

0f0x and than types

#

i already told before

brave sparrow
#

Every packet is comprised of this structure:

sterile token
#

0x0F its a format or what?

brave sparrow
#

VarInt Length (which is the length of ID+Data)
VarInt ID
ByteArray Data

#

The ID tells you what kind of packet it is and how to decode the data

sterile token
#

Ajam?

brave sparrow
#

What?

sterile token
#

So how i get the packet id?

brave sparrow
#

It’s the VarInt after Length

sterile token
#

Im just doing: socket.getOutputStream().read()

brave sparrow
#

Yeah that’s not gonna work

sterile token
#

Ah allright

#

How i read a var int?

#

Now i understand why the random numbers came from

#

Because im not reading in the correct format

brave sparrow
sterile token
#

Allright i will read

#

but i dont udnerstand still

#

Its not so good documented

brave sparrow
#

It’s pretty amazing documentation

#

What are you talking about

sterile token
#

So for reading i will need a readVarInt?

#

Oh allright

buoyant viper
brave sparrow
#

It may be System.currentTimeMillis() in the current implementation but it isn’t guaranteed to be I imagine

buoyant viper
#

its been a time-based key for a pretty long time iirc

#

i can only vouch for as far back as 1.8 since thats where most of my work in mc was but its probably been that way since 1.6 or 1.7 or earlier

brave sparrow
#

I’d have to check to verify if that’s the case, all I know is what it’s documented as

buoyant viper
#

and ive seen the source 😎

sterile token
#

Alex

#

Im ready i already added readVarInt method

#

What know?

buoyant viper
#

also where is your documentation from? checking something like wiki.vg also says its based on time @ alex

sterile token
#

What?

brave sparrow
#

“The server will frequently send out a keep-alive, each containing a random ID. The client must respond with the same payload (see serverbound Keep Alive). If the client does not respond to them for over 30 seconds, the server kicks the client. Vice versa, if the server does not send any keep-alives for 20 seconds, the client will disconnect and yields a "Timed out" exception.
The Notchian server uses a system-dependent time in milliseconds to generate the keep alive ID value.” @buoyant viper

#

The notchian server uses system time you are correct

#

But it’s not guaranteed to be that, it’s just an arbitrary value

buoyant viper
#

hm

#

fair enough

sterile token
#

I dont know how read the packets i receive

#

That what happens

#

I felel so idiot lmao

brave sparrow
#

The ID tells you what packet it is

sterile token
#

I know but how in code?

brave sparrow
#

The way Mojang does it, each packet is it’s own class

sterile token
#

I just have my data input stream from the fake client socket

brave sparrow
#

You use the ID to know which class it is, then decode the data byte array

sterile token
#

Hee??

#

I dont understand

mental moon
sterile token
#

the id its a byte

brave sparrow
#

Say you’re trying to read an encryption request packet

#

ID is a VarInt

sterile token
#

So if console Util.readVarInt(input) will tell the packet id???

#

Allright thanks

brave sparrow
#

The structure of that packet is a 20 character string, a VarInt, a byte array, a VarInt, and a bytearray

#

So to read that packet you’d read those data types from the stream

sterile token
#

All of them are packets?

brave sparrow
#

No

sterile token
#

So?

brave sparrow
#

Like I told you

#

First you have packet length

#

Then packet ID

sterile token
#

I dont understand without examples

brave sparrow
#

then a byte array which is the packet data

#

Then another packet length

#

Then another packet ID

#

Then another packet byte array

#

Think of each packet as a box of stuff

sterile token
brave sparrow
#

Each packet has 3 things in it

#

It has a length, an ID, and data

#

And it sends those things in the stream one by one

#

It doesn’t just send a bunch of IDs

sterile token
#

Oh that why the first system out its a number 3?

#

That number 3 means the leght?

#

Can u please send a code sample

#

Because im so idiot that i cannot understand

brave sparrow
#

I don’t have a code sample I’m on my phone

sterile token
#

oh ok

#

But can u see my code?

brave sparrow
#

I don’t think you understand networking in general enough to do this

#

To be honest with you

sterile token
#

Yeah i never worked with byte buffers

#

so its diff for me

brave sparrow
#

wiki.vg is some of the best documentation I’ve seen, if you can’t figure it out with that then I’m not really going to be able to help you

#

It’s not even about the byte buffers

#

You can’t grasp the concept of a packet

sterile token
#

a packet its a set of data

#

Isnt it?

brave sparrow
#

Yes

#

It’s not just a number

#

You can’t just read once from the stream and get the whole packet

sterile token
#

allright so i first read my input stream?

brave sparrow
#

You have to read from the input stream a lot

#

Wiki.vg tells you what all the packets are and what the structures of those packets are

#

All you have to do is implement that

sterile token
#

Allright

#

I will go to sleep

brave sparrow
#

Ok

sterile token
#

Then i will ask u for help if you ant help

#

And thanks for trying to help

#

really thanks if was another already it ignore me

limber patio
#

Hello i need someone who know polish and can translate some plugin. write me on pv if you want to help

granite burrow
#

how can I tell if a player is sneaking in the PlayerInteractEntityEvent

vocal cloud
#

By reading the docs

ebon topaz
#

so i took a item and changed its texture with setCustomModelData to make a custom item but that item can still be used in the cake recipe but i dont want it to how could i remove it from that recipe but still be able to make custom recipes later on with the custom item?

dense cove
#

hello

#

i got a question

hexed hatch
late sonnet
#

version? im pretty sure the item you wanna is PLAYER_HEAD

#

oh.. deleted message >.<

dreamy sorrel
#

Uh

#

You meant me?

#

Yeah Nah, i thought it was fixed but nah

#

its still there.

sharp bough
#

why does Inventory Framework add this

      PublicBukkitValues:
        backpacks:if-uuid: '[B;-97B,-50B,-21B,-111B,-114B,10B,73B,-75B,-99B,-55B,41B,-36B,57B,-20B,-128B,110B]'

when closing an inv and saving it, current code: http://pastie.org/p/3vqLOybvgLMlwi0kH0qwH1

late sonnet
dreamy sorrel
#

Well i tried with SKULL_ITEM

#

And now it gives me this:

#

Not the Skull i wanted 👀

late sonnet
sharp bough
#

yea its an NBT tag

late sonnet
#

yeah the PDC..

sharp bough
#

the main problem is, when you add that it stops stacking with other items of the same material

late sonnet
sharp bough
sharp bough
west oxide
#

hey am looking for something but am not sure if its even possible am confused

is it possible to access a class of a plugin on a different server if both servers are connected via bungee ?

west oxide
#

idk if am dumb or thats possible or if its even useful

late sonnet
#

@sharp bough
ok in code show the framework add a PDC for a GuiItem for know where is placed...
https://github.com/stefvanschie/IF/blob/ab366c159709a420ec1b21f9747c3b28000ea17f/IF/src/main/java/com/github/stefvanschie/inventoryframework/gui/GuiItem.java#L31

if the player take the item maybe you can try read all the PDC and delete all the customs PDC for allow stack

GitHub

An inventory framework for managing GUIs. Contribute to stefvanschie/IF development by creating an account on GitHub.

sharp bough
#

what i was thinking is once its done loading the gui, take each item and remove the nbt tag

fossil lily
#

How can I get the server the player is on with waterfall api?

late sonnet
late sonnet
#

yeah you can make this.. not sure the effect for make this.. if the UUID is used in another place

sharp bough
# late sonnet yeah you can make this.. not sure the effect for make this.. if the UUID is used...
muted sand
#

if i make a custom event, fire it, does it pass to other plugins or?

quaint mantle
#

yes

brave sparrow
#

Yes

#

As long as they have a listener for it

muted sand
#

woo
so i just have to remake the event class for all the plugins?

maiden thicket
#

they have to use ur plugin as a dependency

brave sparrow
#

^

#

If they exist in different plugins they’re different events

muted sand
#

oh..

muted sand
brave sparrow
#

Maven/gradle, plugin.yml

muted sand
#

oh

#

okay

mental moon
#

Looking for something to detect if a player/entity is being rained on or not.
I thought I had something good for a while, but just realized that glass lets the full sunlight value through so my code will think you're wet when standing under glass.

kind hatch
#

You could get the highest block at the player's location and check to see if they are above it.

mental moon
#

So build a scanner that starts at buildheight and works until it hits something?

kind hatch
#

No, there is a built in method. World#getHighestBlockYAt().

mental moon
#

Oh wow. Didn't know that was there. Thanks!

kind hatch
#

Oh, whoops. You'd actually want to use getHighestBlockAt instead of getHighestBlockYAt. One returns a block and the other returns an integer. (The highest Y coordinate)

mental moon
#

I appear to have misread what you typed initially and used that one by accident anyways 😆

#

Works like a charm now 👍

fossil lily
mental moon
#

Paper or Spigot server?

kind hatch
#

That's a paper server. The stacktrace exposes that.

kind hatch
fossil lily
idle loom
#

.setOwner to set the skull doesn't work in 1.18 so like
what do I do

buoyant viper
#

works fine for me

cinder karma
#

I know it can be done, but could somebody point me in the right direction to display a scoreboard only for specific players, not tied to a team color?

idle loom
#

nvm I figured it out

#

im just

#

dumb

echo granite
#

Hello, I have a java program that allows admins to connect by password, how do I protect it so nobody can edit the code and remove that validation?

young knoll
#

You can’t

#

You can obfuscate all you want, but it will always be editable

echo granite
young knoll
#

Believe it or not

echo granite
#

If it was that simple... the world would be collapsed at this point

young knoll
#

Not every program is written in java

echo granite
#

And reversing exists in all languages

young knoll
#

It’s much more difficult in C

#

But yes, with enough effort you could remove the authentication from anything

crisp steeple
#

if the program is only client side, then yes, everyone can technically be an admin

solemn valley
#

I'm trying to teleport my armor stand (with a shulker as a passenger) but it's not really working out. What would the easiest way be?

#

I've tried something like

en.teleport(new Location(en.getWorld(), en.getLocation().getBlockX(), en.getLocation().getBlockY() + 3, en.getLocation().getBlockZ()));

but doesn't work

echo basalt
#

You can't teleport entities with passengers

#

Nms limits it

#

Try it and see

#

Probably not

#

Dismount, teleport and remount each individual passenger

vocal cloud
echo basalt
#

Oh yeah you can edit bytecode at runtime with bytebuddy or whatever

vocal cloud
#

You can reflect in sensitive classes and what not from a remote server

#

But someone is going to reverse engineer it eventually so 🤷‍♂️. Imo just do what Alex does and require legit owners to prove the ybought it before giving support. You can't prevent piracy but you can prevent helping those who steal

lavish hemlock
vocal cloud
chrome beacon
#

There are tools to dump classes from memory

vocal cloud
#

Yessir

#

But it ups the difficulty of reverse engineering their garbage library

glossy venture
#

how tf do i sign up for mojang bug tracker

#

bruh

chrome beacon
#

I have no idea

#

What bug did you find

glossy venture
#

when i try to register

chrome beacon
#

Ouch

glossy venture
chrome beacon
#

How so?

glossy venture
#

ive asked about it here several times

#

might be able to find one of those messages

vocal cloud
#

I highly doubt you've found a bug with Mojangs stuff that hasn't already been reported

glossy venture
#

.

glossy venture
vocal cloud
#

That's not what the Mojang issue tracker is for

glossy venture
#

because i dont know whats wrong

#

i think its a bug

lavish hemlock
vocal cloud
#

Maybe lol

chrome beacon
glossy venture
#

i think it might have something to do with the encoding, but i remember reading on the bug tracker that all json files are read as utf8

#

and im writing it in utf8

chrome beacon
#

Message could not be loaded ;/

Thanks discord mobile

glossy venture
#

bruh

chrome beacon
#

Could you copy paste it

glossy venture
#

not with the images

#

one sec

#

why doesnt this show the texture?
the file on the right (generated by the code) is located at assets/minecraft/models/item/redstone.json, the custom model file is located at assets/example/models/item/ruby.json and the texture for the ruby is at assets/example/textures/items/ruby.png

#

there

#

the order sucks

chrome beacon
#

And does the client load the resource pack

#

Also where's the model

#

Send it

glossy venture
#

yes

#

colors are fucked up

#

here is the full resource pack

#

i use filebin to host it automatically

chrome beacon
#

Blocked on the network. Will try later when I get home

glossy venture
#

ok thanks

chrome beacon
#

Is the plugin up to date in the repo

#

So I can test it

glossy venture
#

yes

chrome beacon
#

Alright

glossy venture
#

you will need the test mod too

#

both plugins

#

just put them in the plugins folder

vocal cloud
#

I'm confused why not add the item to the mod?

glossy venture
#

the mod adds the item

#

the base plugin does all the heavy work

#

like building the resource pack

#

behaviour

#

item states

#

saving shit

#

loading shit

#

etc

vocal cloud
#

So then what exactly is the issue? The texture?

#

Isn't the mod adding the texture?

glossy venture
#

its not loading the model

#

the resource pack is fine

#

everything is there

#

it just doesnt load it

vocal cloud
#

Send the github I'll fix it

glossy venture
#

but theres nothing wrong

chrome beacon
#

Somethings deffinetly wrong since it doesn't work

glossy venture
#

i can try a different encoding

glossy venture
chrome beacon
#

:)

vocal cloud
#

Wait this is a mod that doesn't require mods?

chrome beacon
#

It's not a mod

lavish hemlock
#

It's a plugin that emulates mods

vocal cloud
#

Oh jeez

glossy venture
#

yeah

#

nope still doesnt work

#

with ascii encoding

vocal cloud
#

I fail to see the issue here? @glossy venture

glossy venture
#

tf

#

how

vocal cloud
#

I'm magic

glossy venture
#

how tho

vocal cloud
#

Literal magic flows through my veins

#

I googled how to do it

glossy venture
#

ok but is this the generated resource pack?

#

or did u make this yourself

vocal cloud
#

I made it myself

glossy venture
#

bruh

#

yeah if i make it myself it works too

chrome beacon
#

That's not the problem

glossy venture
#

but the generated one doesnt

vocal cloud
#

Yeah I've got to rewrite some code. Gimme a bit

glossy venture
#

some?

#

or like 90% of the building code

vocal cloud
#

Some

#

Assuming you used a library for json

glossy venture
#

yeah

#

gson

#

its bundled with minecraft

vocal cloud
#

Ugh gradle.

chrome beacon
#

Love the gradle error messages

glossy venture
#

did u clone the repo

vocal cloud
#

Yeah

glossy venture
#

because it has the gradle settings that should work

#

oh

#

use java 17

#

for gradle

vocal cloud
#

Wait

#

gradle has it owns

glossy venture
#

yeah

vocal cloud
#

Another reason to not like gradle 🤮

#

You have tests for this?

#

Besides

glossy venture
#

lmfao

#

forgot to remove the json tests

#

were for my own attempt at making a json engine

vocal cloud
#

I don't feel like compiling everything I should be able to replicate the issue by making a unit test no?

glossy venture
#

idk maybe

#

not really

#

you have to compile it and load it on the server together with the test mod

#

the resource pack will be at server/carbon/resource_pack/src

rough drift
vocal cloud
#

So the structure looks like this?

#
{
  "parent" : "minecraft:item/generated",
  "textures" : {
    "layer0" : "example/ruby"
  }
}
#
{
  "parent": "minecraft:item/generated",
  "textures": {
    "layer0": "minecraft:item/redstone"
  },
  "overrides": [
    {
      "predicate": {
        "custom_model_data": 1
      },
      "model": "example/ruby"
    }
  ]
}
rough drift
#

that's fine

#

how are you applying the texture?

granite burrow
#

how can I tell if a player is sneaking in the PlayerInteractEntityEvent

vocal cloud
rough drift
#

but idk if they are online

glossy venture
#

and in the guide im following they use different namespaces too

rough drift
granite burrow
# rough drift player.isCrouching() iirc

ohhhhh my godddd, I tried that earlier... It was isSneaking() 😦 I was looking for it for so long and just gave up. Thank you tho it helped me find the right one

glossy venture
rough drift
#

np

rough drift
#

do you do

glossy venture
#

yeah

#

when someone joins

rough drift
#

player.setResourcePack(downloadURL, byteHash)

glossy venture
#

yeah

#

this is the download url

rough drift
#

?paste

undone axleBOT
rough drift
#

use dat

glossy venture
#

for what

rough drift
#

put your listener class there

glossy venture
#

oh

#

you can find it on github

granite owl
#

?Command

glossy venture
#

might make more sense

rough drift
#

kk

#

can you send me the gh

glossy venture
#

but i know it is applied

vocal cloud
#

Idk I feel like if you just built the resource pack the better way it'd work

glossy venture
#

i have it

glossy venture
#

and changing the text

vocal cloud
#

Got an example of it where you built it where it's setup the way I described?

glossy venture
#

nah

#

it was replaced

#

recoding it to build it like that will take a lot of work

#

the weird thing is that whenever i save it in vscode it works