#help-development

1 messages · Page 858 of 1

tender shard
#

yes

hardy cairn
#

dam

#

nice

#

it doesnt really work as i want

#

if you find a error please let me know

tender shard
#

what's the issue?

hardy cairn
#

like the player isnt getting the item

#

when he respawns

tender shard
#

does it send the message "You respawned with your items"?

hardy cairn
#

nope

tender shard
#

then hasRequiredItems(player) is false

hardy cairn
#

strange it shouldnt do that

tender shard
#

i don't really understand what hasRequiredItems is supposed to do - you're checking the player's inventory contents inside that (even though the player will be dead, so the inventory will most likely be empty)

hardy cairn
#

ill just use your library thanks

#

👍

#

im new so im kinda dumb

#

yk

tender shard
hardy cairn
#

I can't really read messy code and I don't really remember things later when I continue my work on the plugin so I comment it and make it look good. I thought everyone did that. (Also my some other developer friends see my code so I gotta impress them :D)

#

My code may look clean but it doesn't work half the time ;/

tender shard
#

I'd probably do the whole thing like this:

  1. We need to identify our custom "keep on death" items using a PDC tag:
public final NamespacedKey soulboundKey = new NamespacedKey(this, "soulbound"); // tag to identify keep on deah items

public NamespacedKey getSoulboundKey() {
    return this.soulboundKey;
}


// returns true if an item should be kept on death
public boolean isSoulbound(ItemMeta meta) {
    return meta.getPersistentDataContainer().has(getSoulboundKey(), PersistentDataType.BYTE);
}
  1. In the death event, we have to loop over all items and store all those that have our custom tag in a list or map.
    If you want to keep the exact slot, you'll have to iterate over the whole inventory and use a map <Integer,ItemStack> to remember the slot.
    If you don't care about the slot, we can just iterate over getDrops()
    // Save items for later
    @EventHandler
    public void onDeath(PlayerDeathEvent event) {
      List<ItemStack> keptItems = new ArrayList<>();

      event.getDrops().removeIf(item -> {
        if(isSoulbound(item.getItemMeta()) { // Items with our custom PDC tag will be ...
          keptItems.add(item); // ... kept on death ...
          return true; // ... and removed from the death drops.
        }
        return false; // other items will not be removed from the death drops list

      }

      event.getPlayer().getPersistentDataContainer().set(soulboundKey, DataType.asList(DataType.ITEM_STACK), keptItems);
    }
  1. in the respawn event, do the opposite: check if the player has our custom PDC tag, and if yes, get the list of itemstacks and add them back to their inventory (either by just adding it to the inventory if you used a list before, or by setting each slot manually if you've used a map before)
hardy cairn
#

YOOOO

tender shard
#
@EventHandler
public void onRespawn(PlayerRespawnEvent event) {
  List<ItemStack> keptOnDeath = event.getPlayer().getPersistentDataContainer().getOrDefault(soulboundKey, DataType.asList(DataType.ITEM_STACK), new ArrayList<>();

  for(ItemStack item : keptOnDeath) {
    event.getPlayer().getInventory().addItem(item);
  }
}

or when using a map:`

Map<Integer,ItemStack> keptOnDeath = ...getOrDefault(soulboundKey, DataType.asMap(DataType.INTEGER, DataType.ITEM_STACK), new HashMap<>());

for(Map.Entry<Integer, ItemStack> entry : keptOnDeath.entrySet()) {
  Integer slot = entry.getKey();
  ItemStack item = entry.getValue();

  if(player.getInventory().getItem(slot) == null) // might also be AIR, check for that too {
    player.getInventory().setItem(slot, item); // set back to the same slot
  } else { // oh no, the original slot is meanwhile full, idk maybe other plugins also kept items on death or sth? who knows
    player.getInventory().addItem(item); // so we just add it to any slot
hardy cairn
#

thank you so much homiee

tender shard
#

np

hardy cairn
#

💖

#

🗿

median trench
#

Any clue why the server thread dump thing appears occasionally when using setLore()? (assuming it is setLore() because of the dump)

#

Seems to have something to do with Regex and I assume colors?

echo quarry
#

Send a screenshot.

median trench
echo quarry
#

Your server is most likely running out of resources.

undone axleBOT
median trench
#

will ask about the resources but it does quite more complex things without hanging up

median trench
echo quarry
#

Send the entire dump.

tender shard
#

also try whether it only happens on paper or on spigot too

median trench
echo quarry
#

Send both the full stacktrace and the class if possible.

median trench
#

class is not much bigger but has nothing to do with the failure

tender shard
median trench
#

yes

#

basically it is
ItemMeta meta = itemStack.getItemMeta();
meta.setLore(lore.toList());
itemStack.setItemMeta(meta);

tender shard
#

how does RegistryViewer look like?

median trench
tender shard
#

also try using spigot and see if the same thing happens

median trench
wet breach
#

does this happen on spigot?

#

you are using paper, and having issues with paper, this is spigot discord, not paper

median trench
#

I will try in a sec, but I am unable to reproduce it

wet breach
#

then it seems to be an issue with paper

median trench
#

well I am using spigot api and having issues with a spigot plugin on a paper server

wet breach
#

you are using paper

#

doesn't matter what api you are using

tender shard
#

wouldn't be the first time that something works on spigot but doesn't work on paper

echo quarry
#

Eh, in fairness, I have never had a plugin break when going from Spigot to PaperSpigot.

wet breach
tender shard
#

which isn't often, but it still sometimes happens

median trench
#

it certainly does in this case, paper makes me use Components (AdventureAPI) and I am using strings that's why I wanted to ask here

tender shard
wet breach
#

anyways point is, unless you can reproduce the problem with spigot, you should be telling paper about the issue because there is nothing spigot can do when its another fork that is the cause

median trench
#

and also, I wanted to know if that is a known issue and/or if I am setting the lore wrongly in some way. Anyways I will try to reproduce on spigot in a moment, although I couldn't reproduce it in paper either

wet breach
#

as far as I know, you are the only one right now having issues with lore in regards to spigot

tender shard
wet breach
#

or should say, there hasn't been others reporting issues with spigot

#

in regards to lore

#

however, people have issues with paper and generally because they are under the belief that paper and spigot work the same

#

which they do not

median trench
#

then it might be a server resource issue or paper specific, will try

blazing ocean
#

how can I iterate over all blocks in a world?

tender shard
#

?xy

undone axleBOT
wet breach
blazing ocean
#

i need to find every block in a world with a specific material

echo quarry
#

In a render distance?

wet breach
#

you are better off scanning the region files themselves

tender shard
#

do you need them all at once or only when the respective chunks get loaded?

tender shard
#

RIP then

echo quarry
#

Also, loded chunks only? Or should this method load unloaded chunks?

#

aka, ungenerated chunks

tender shard
#

you cannot get blocks from ungenerated chunks

#

they are ungenerated

blazing ocean
echo quarry
#

You can if you generate it.

wet breach
#

well can't get blocks from unloaded chunks as well

#

lol

#

moment the chunk loads it generates as well if it wasn't generated already

echo quarry
#

That is why I asked, I do not know how far he wishes to go with this.

blazing ocean
#

i just want to get all the blocks that have a specific material in already generated chunks

median trench
#

I once did this in search of chests in an area of 10000x10000 and it was quite fast tbh. Using a large amount of threads. There might be better ways though

blazing ocean
#

ill just set some corners manually ig

echo basalt
#

make sure the item has meta before checking

#

@tender shard

#

nvm it scrolled down all the way ffs

echo basalt
#

I'd recommend just reading the region files with auh

hushed spindle
#

why are we storing attributemodifiers as both a map and a set? 🤔

echo basalt
#

thread pool

hushed spindle
#

this is remapped

#

unless im looking in the wrong place

#

sec

#

i dont think it really matters regardless because looking at the code itself, attributemodifiers are both removed from both collections and added to both collections with their respective calls

#

so the values in c should match d

#

but ive been having painful ass bugs coming from here and i think its because somehow the map and set dont match

hushed spindle
#

yeah those

#

very painful

#

got like knives as arms and shit

tender shard
#

not b, c, d

hushed spindle
#

i mean i dont know how to see otherwise

#

this is the remapped jar

#

decompiled so i could see what goes on

grim hound
#

would a premium player and a cracked player of the same name have a different uuid?

shadow night
#

If it's an offline server then they shouldn't iirc

grim hound
wet breach
#

if we are just purely talking about both joining an offline mode server with nothing modifying anything, then no both would have the same uuid and both wouldn't be able to connect if I recall

shadow night
#

Yes

wet breach
#

however, we don't support offline mode servers here either just fyi

shadow night
#

Offline mode is poor people mode ig

grim hound
wet breach
#

the only difference between a proxy and a full mc server is that a proxy handles connections and just supports the protocol and nothing beyond that

tidal kettle
#

can you enchant an item with more than 255 level with addEnchant?

grim hound
tidal kettle
#

so you can't?

grim hound
#

yep

wet breach
#

if you could, why would we have this other method?

grim hound
wet breach
#

there is a reason unsafeEnchant method exists, and its so if you want to go beyond what the vanilla normally allows you can, but you have to use this method to do so

tidal kettle
#

o

wet breach
#

also this method doesn't guarantee that nothing bad will happen or that anything different would happen

tidal kettle
#

interesting

#

unsafe enchant don't enchant my sword x)

tribal valve
#

can you put lists in config?

#

lists of location to be exact

lost matrix
grim hound
#

just gotta make your own parser

lost matrix
#

A list of anything thats ConfigurationSerializable or primitive

tribal valve
#

how can i do that

grim hound
#

like -name: yes
x: 678
y: 567
etc.

grim hound
wet breach
#

it depends which location is being used

#

blocks use ints, where as entities use floats

shadow night
#

Why can't I place a block on x 3.471, y 8.5, z 8.109

wet breach
#

lol

lost matrix
#

Wait, arent object lists supported?

    FileConfiguration config = ...;
    List<Location> locations = ...;
    config.set("locations", locations);
    FileConfiguration config = this.getConfig();
    List<Location> locations = (List<Location>) config.getList("locations");
grim hound
shadow night
wet breach
lost matrix
#

Which object, and why would i need to serialize it myself?

wet breach
#

you don't need to serialize it yourself, pretty sure bukkit has methods to serialize them?

lost matrix
#

Location is ConfigurationSerializable, which means the Codec of FileConfiguration serializes it automatically.

#

Or am i missing something here

wet breach
#

Well if its automatic, then awesome, either way it has to be serialized is all I am saying lol

lost matrix
#

lol indeed

blazing ocean
#

what's the event i need to cancel if i don't want the player to open barrels/furnaces/etc...? is it PlayerInventoryOpen?

lost matrix
blazing ocean
#

alright

hushed spindle
#

according to minecraft

tidal kettle
#

i know i use the flag to hide enchant

hushed spindle
#

you can enchant an item past 255 afaik

#

like there were 32k swords i think they were called

#

all enchant at level 32k

tidal kettle
#

not in 1.20

#

i also try

#

/give @p diamond_sword{Enchantments:[{id:"sharpness",lvl:10000}]} 1

#

block at level 255

hushed spindle
#

ah shucks

#

if you want those enchantments you'll have to make them custom as a whole then

tribal valve
lost matrix
# tribal valve wait how to add and remove something from the list?

Load the list, remove an element, write the list back to the config.

But you shouldnt constantly access your configs.
For server scoped data:

  • Load when server starts
  • Save when server stops
    For player scoped data:
  • Load when player joins
  • Save when player quits

And load it into proper classes with meaningful names.
Dont constantly access config files.

tribal valve
lost matrix
wet breach
tribal valve
#

no, like i did that already

wet breach
#

oh, well if you are interested in an alternative method for doing such things I can show you how I did mine 🙂

wet breach
#

I make use of the Conversation API 🙂

blazing ocean
wet breach
#

also, feel free to look at any other things in that project

#

it is MIT after all

minor junco
lost matrix
wet breach
#

but it has some really good things in there though that makes it handy to reference, but yeah not a very good structure there for that 😛

minor junco
#

happens in legacy code :p

wet breach
#

eventually I will update this project

grim hound
#

@eternal night could you tell me the difference between the 2?

tidal kettle
#

in Anvilinventory, the .getResult() didn't work? or maybe i'm dumb

grim hound
#

they just didn't finish them

#

if you just open an invetory gui I'm pretty sure it won't work

lost matrix
grim hound
tidal kettle
#

in 1.20.4

#

try to just change the lore of an item

grim hound
#

I'd wanna know what each of these channel initializers is responsible for

lost matrix
# tidal kettle

Get the result from the event. This event fires before an item is placed in the result slot so that you can change the outcome.

eternal night
#

the other the one that goes to the minecraft servers

grim hound
tidal kettle
grim hound
#

but I can't figure out which

#

is which

eternal night
#

serverChannelInit is the one clients connect to

#

backend is the one that connects to the backends (the minecraft servers)

lost matrix
grim hound
#

Have a good one 👍

eternal night
#

👍

shadow night
#

Holy shit I just got deja-vu'd

grim hound
shadow night
lost matrix
#

Pretty much

#

But in the original you have an accent

#

Somewhere

shadow night
#

On e and a iirc

lost matrix
#

🤷 Sure

#

I mean where else

tender shard
#

stupid french putting wéird stuff on àll letters

shadow night
#

In russian we do that to indicate vowel stress lol

tender shard
#

the proper word is GNOSTIC MEMORY ILLUSION

grim hound
#

would be the correct form

#

so pretty much spot-on

echo basalt
tender shard
#

hello gnostic

elder harness
#

I have a question regarding packets and NMS (surprise surprise). I spawn in fake players using packets, but later I try to change their equipment by directly accessing the NMS entity. However, when I try to set an item in the main hand of the entity, nothing seems to happen. Is this because I spawned in the entity using packets?

#

Oh and I cán change the equipment when I use the "Set entity equipment" packet

eternal night
#

you'll have to use the packet yea

#

given the entity isn't in the server, the server does not tick it or update its state to other players

elder harness
#

Alright, I'm new to the whole packets/NMS thing. Thanks

#

Sending a packet to update the equipment isn't an issue, but how do I check what equipment the entity holds? I can set the equipment, but not get it

eternal night
#

given the entity does not exist beyond the scope of the plugin, only you can set the equipment ?

elder harness
#

I was thinking of simply saving it to a variable after the package is sent so I can use it later, but it feels like bad practice

eternal night
#

Wel if you do construct a nms instance of the entity, you can store it there ?

elder harness
#

Fair enough. I'll do that. Thanks

tribal valve
#

uhhh?

@EventHandler
    public void onPlayerDeath(PlayerDeathEvent event) {
        if (plugin.getManager().getGameState() == GameState.WAITINGPLAYERS || plugin.getManager().getGameState() == GameState.WAITINGQUEUE) {
            event.getDrops().clear();
            event.getPlayer().spigot().respawn();
            event.getPlayer().setGameMode(GameMode.SURVIVAL);
            Location spectatorSpawn = plugin.getConfig().getLocation("blockwars.game.spectatorSpawn");
            if (spectatorSpawn != null) {
                event.getPlayer().teleport(spectatorSpawn);
            }
        } else {
            event.getDrops().clear();
            event.getPlayer().spigot().respawn();
            event.getPlayer().setGameMode(GameMode.SPECTATOR);
            Location spectatorSpawn = plugin.getConfig().getLocation("blockwars.game.spectatorSpawn");
            if (spectatorSpawn != null) {
                event.getPlayer().teleport(spectatorSpawn);
            }
            GameTeam playerTeam = plugin.getManager().getTeamFromPlayer(event.getPlayer());
            if (playerTeam != null) {
                if (playerTeam.getTeamBlock() != null) {
                    if (!playerTeam.getTeamBlock().getIsActive()) {
                        playerTeam.removeAlivePlayer(event.getPlayer());
                    } else {
                        runTimer(event.getPlayer());
                    }
                }
            }

       
valid burrow
#

i have a weird problem. I chache the loaded pages of the auction house in a hashmap and delete it on inventory close

#

problem is

#

every time i change the page

#

it fires inventory close

#

how would yall solve this

valid burrow
#

get entitydamageevent

#

check if damage > players hp

tribal valve
#

im just respawning

valid burrow
#

wdum respawning

#

if theres a playerdeathevent the player will die

#

no matter what you do

tribal valve
valid burrow
#

but why

#

just cancel player damage event

tribal valve
#

i want to make bedwars

valid burrow
tribal valve
#

okay

tribal valve
elder harness
#

How do people handle npcs, that were spawned in using packets, when reloading the server? I use a wrapper class to add behaviour to my NPCs, but all of this information is lost when restarting

muted dirge
#

hmm

tribal valve
#

yea ik but the respawn button after clicking turns gray and stays like that for 5 or more minutes

#

and after i click again to respawn then it does the same again

muted dirge
#
Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() {
    @Override
    public void run() {
        event.getEntity().spigot().respawn();
    }
}, 1L);
tribal valve
#

i'll try doing the ondamage thing and i'll try that

muted dirge
valid burrow
muted dirge
#

@tribal valve

tribal valve
#

wait lemme test my damage code first

valid burrow
muted dirge
#

Is that a problem?

#

work smarter not harder

tribal valve
#

wait i just realised that cancelling the death of player can break other plugins

#

but i don't have other plugins so imma just test my code

elder harness
eternal night
#

eh, well depends on what you are doing

#

given it isn't an actual entity in the world, just client state, you need to do basically all saving yourself

tribal valve
elder harness
eternal night
#

Yea if you don't spawn it, the server won't take care of it

tribal valve
#

bro what 💀

hazy parrot
tribal valve
#

yea

#

the team.removealiveplayer is 81

elder harness
proud badge
#

ok where'd I mess up

#

actually wait, I can just check if the material name .endsWith DOOR

hazy parrot
#

or just Tag.DOORS.isTagged(Material)

molten kestrel
#

how to detect the lured fish?, is there any event for this?

worldly ingot
#

I don't think there is... strangely enough

#

Let me double check

molten kestrel
#

I know its possible, i saw a couple server did it, also hypixel too

worldly ingot
#

Hypixel has its own server software it can maintain and patch into

young knoll
#

How would you know, it’s not like you work there

worldly ingot
#
        if (this.nibble > 0) {
            --this.nibble;
            if (this.nibble <= 0) {
                this.timeUntilLured = 0;
                this.timeUntilHooked = 0;
                this.getEntityData().set(EntityFishingHook.DATA_BITING, false);
                // CraftBukkit start
                PlayerFishEvent playerFishEvent = new PlayerFishEvent((Player) this.getPlayerOwner().getBukkitEntity(), null, (FishHook) this.getBukkitEntity(), PlayerFishEvent.State.FAILED_ATTEMPT);
                this.level().getCraftServer().getPluginManager().callEvent(playerFishEvent);
                // CraftBukkit end
            }

Yeah, doesn't look like we fire a PFE for nibbling

#

(which I assume is what that is)

#

Oh, wait, no, that's for successful attempts

wet breach
worldly ingot
#

Okay, yeah, timeUntilHooked. No event called there either

#

We definitely should call something there tbh

wet breach
#

those are the available states for the event

worldly ingot
#

I think the issue is just that each state is only ever called once, so to introduce a state that is called every tick would be abnormal

#

Maybe a separate event is in order to expose additional data like the angle

wet breach
#

this event is called like 2-3 times

tribal valve
#

is there a bool in villagers to make them invournable to player attacks? or i must use entity damage event??

young knoll
#

with different states tho

wet breach
#

yeah with different states

worldly ingot
#

With different states, yes. This user wants to check when the little dribble of water is approaching the bobber

young knoll
tribal valve
molten kestrel
young knoll
#

setInvulnerable

worldly ingot
#

Maybe a new state for FISH_APPEARANCE and then a new, separate event for the actual movement

young knoll
#

FishySwimEvent

wet breach
#

that wouldn't make sense

worldly ingot
#

Why not?

wet breach
#

since its not an entity or one spawned in, the bubbles are just a particle

worldly ingot
#

I understand that, but it's moving along a set of coordinates

young knoll
#

EtherealFishySwimEvent

worldly ingot
#

This user wants that exposed

wet breach
worldly ingot
#

I'll write some shit for it. Seems easy enough

#

Should probably update the component PR while I'm at it today. I'm actually off lol

young knoll
#

and yet still working

worldly ingot
#

Well, volunteer

#

Weird how that works, huh?

wet breach
#

and from there make whatever it is you are trying to do

molten kestrel
young knoll
#

Good luck detecting particles

#

Without like a packet listener

worldly ingot
#

Yeah, you'd need an outgoing packet listener for that

wet breach
#

regardless it seems the only feasible way for them or reliable way to do whatever it is they are wanting

#

without an appropriate event to aide

tribal valve
#

is there an event that detects player rightclicking on an entity?

tall dragon
#

PlayerInteractEntityEvent

#

iirc

quaint mantle
young knoll
#

Oh you are setting it in the explode event

#

Hmm, I am guessing the explode event is called after the damage event? not too sure

young knoll
#

Well they set in the explode event and check in the damage event

#

And it seems it is not present in the damage event

stiff vine
#

Hi, So I have i simple question. What is better between json or MySQL database for minecraft server. what is the difference between both ?

young knoll
#

Well json is just a file format

#

MySQL is a relational database

#

It depends what you want to store

ivory sleet
eternal night
ivory sleet
#

json is a good way to store config files or similarly yk, but I wouldnt use it to actually store massive amounts of data

#

(altho spigot uses yaml :>)

wet breach
young knoll
#

Nah, tnt is an entity

eternal night
#

the explode events happen after the damage

#

the explosion logic first damages then break blocks

wet breach
eternal night
#

Beds

#

Respawn Anchors

young knoll
#

Also world#createExplosion

stiff vine
young knoll
#

Seems fit for sql

wet breach
stiff vine
#

okay ty

eternal night
wet breach
#

just really weird to apply damage to an entity before anything happened XD

eternal night
#

I mean, you have the compute the damage to the entities first, before you remove blocks that might reduce the damage of the impact

#

sure you could compute first, store in some list, remove blocks then apply

#

but why xD (from a mojang perspective)

wet breach
#

well both are executed simultaneously essentially, neither relies on the other

eternal night
#

the entity damage does rely on the world state

#

which would be mutated by removing/breaking blocks

wet breach
#

for every time the entity is damaged the event is thrown

eternal night
#

indeed

wet breach
#

point is, all the damage isn't applied all at once except for the initial explosion of course in however close they were to it

eternal night
#

yea ? I am confused xD

quaint mantle
eternal night
#

Yes, EntityExplodeEvent is called after the damage of the explosion has been applied already

#

use the ExplosionPrimeEvent

quaint mantle
#

I change to that

eternal night
#

👍

young knoll
#

BlockExplosionPrimeEvent when

quaint mantle
#

but is not getting the persistent data

#

idk why

ivory sleet
#

myea but depends on what reachability that temporary data has

tribal valve
#

i don't want to go to hypixel to test this, does anyone remember if you can open upgrades menu when clicking on the upgrades villager when on other team's island?

eternal night
worldly ingot
#

What's the word I'm looking for

#

The opposite of mutually-exclusive

#

Like intrinsicly tied together

#

Not correlated. There's another word I'm looking for God damn it KEKW

quaint mantle
tender shard
#

interdependent?

worldly ingot
#

lol no but nice try

#

And interdependent isn't quite what I'm going for

ivory sleet
#

complementary or reciprocative?

worldly ingot
#

Nah not quite. Meh. I'll just use "correlated" I guess. There's a math term I'm looking for but I can't put my finger on it

eternal night
#

symbiotic weSmart

worldly ingot
#

Like I want to use "interchangeable" but that's not accurate

#

because they're not interchangeable, they're two different units

#

One just affects the other

eternal night
#

reciprocal ?

worldly ingot
#

That might be it

tender shard
#

uncle-nephew-related

worldly ingot
#

Mmm, reciprocal is inverse

#

So not quite

young knoll
#

coupled?

worldly ingot
#

Coupled is probably fine? I'll just use correlated because it's the closest to what I want I guess

tender shard
#

gewoecht

worldly ingot
#

I think the word(s) I'm looking for are actually "directly correlated"

wary harness
#

is it possible to make YamlConfiguration to be saved in double quotes

#

like Banana: "This is Banana"

eternal night
#

The analysis of reciprocal relations in categorical variables poses methodological challenges. Effects that go in opposite causal directions must be integrated into the same model, and parameters must be interpretable.

worldly ingot
#

Here,

    /**
     * Set the time (in ticks) until the fish will nibble at the fishing hook. The
     * distance from the fishing rod and the time until the fish nibbles are directly
     * correlated whereby an increase in the time until hooked will also increase the
     * distance of the fish from the fishing hook, and the opposite also being true.
     *
     * @param ticks the ticks until the fish nibbles
     */
young knoll
#

Choco is doing a thing

proper cosmos
#

World#getHighestBlockAt() gets first Air at certain location?

worldly ingot
#

It ignores air

ivory sleet
#

vikt? :>

#

ah

#

value = värde, no

#

?

tender shard
wary harness
#

well

#

I got this

ivory sleet
#

yea fair enough

tender shard
young knoll
#

Is the quote thing not exposed in the api?

tender shard
#

last time I checked, no

young knoll
#

Smells like a free pr to me

#

:p

proper cosmos
wary harness
#

I only want values in "

tender shard
undone axleBOT
tender shard
proper cosmos
tender shard
#

no, air is not impassable

#

you can walk through air

proper cosmos
#

💀

#

i've just said that

tender shard
#

you asked if getHighestBlockAt gives you the highest AIR block. And the answer to that is: no

proper cosmos
#

Not highest AIR block

tender shard
#

what even is the "first" air block supposed to be? there can only be one block at any given location

proper cosmos
wet breach
#

it doesn't get any air blocks, it gets the first non-air block

tender shard
#

there is no first block at any given location

#

any given location has exactly one block

worldly ingot
#

If you're asking if it gets the air block above the highest non-air block, then no

wet breach
#

^

worldly ingot
#

If the first solid block is grass, it will return that grass block

proper cosmos
worldly ingot
#

You can getRelative(BlockFace.UP) to get the air block above it

tender shard
young knoll
#

tfw you run makePatches but you forgot something so you need to do it again

worldly ingot
#

I do still sort of want to introduce a flag for makePatches to pass in a list of files you want to patch

#

I just fucking hate bash script

quaint mantle
#

The persistent data is not working 😦

young knoll
#

That would be nice

tender shard
quaint mantle
young knoll
#

Did you change to the prime event

quaint mantle
#

Yes

young knoll
#

?paste code

undone axleBOT
young knoll
#

no no

#

Set the tag via ExplosionPrimeEvent

#

Then check it in EntityDamageByEntity / EntityExplodeEvent

quaint mantle
#

okey

worldly ingot
young knoll
#

Is there no way to make a raw setLocation

worldly ingot
#

Not really because the location is actually just relative to the fishing hook's position based on an angle and the time until the hook

#

So, yes, I can add a setLocation() but it won't move to that location on the next tick unless I calculate the angle change, which I kinda don't wanna do :)

#

I also don't know if the angle is calculated in radians or degrees by the way. I can't tell. I'm going to test it and find out lol, then I'll document it

young knoll
#

Darn

#

I wanted to put it in the sky

proper cosmos
#

What's the best way of getting highestGrassBlock, cause when i use World#getHighestBlockAt() when there's tree it returns me leaves/wood

opal juniper
proper cosmos
#

And what would be correct way of getting highest Grass Block

worldly ingot
remote swallow
worldly ingot
#

It's certainly no PlayerMoveEvent though, that's for sure

tender shard
opal juniper
proper cosmos
#

Looping through every block?

opal juniper
#

Every time I need to listen for entities moving I have to make packet listeners :/

young knoll
#

Just make events faster

#

Via

#

uhh

#

magic

molten hearth
#

reflection

young knoll
#

Thats already how they work

molten hearth
#

double reflection

#

damn i didnt know events used reflection though

tender shard
#

sth like this should work I guess

    @Nullable
    public static Block getHighestBlockAt(World world, int x, int z, Predicate<Block> predicate) {
        int y = world.getHighestBlockYAt(x, z) + 1;
        while(--y >= world.getMinHeight()) {
            Block candidate = world.getBlockAt(x, y, z);
            if(predicate.test(candidate)) {
                return candidate;
            }
        }
        return null;
    }
    
    @Nullable
    public static Block getHighestGrassBlockAt(World world, int x, int z) {
        return getHighestBlockAt(world, x, z, block -> block.getType() == Material.GRASS_BLOCK);
    }
tribal valve
#
        if (event.getRightClicked() instanceof Villager) {
            GameTeam villagerTeam = null;
            for (GameTeam team : plugin.getManager().getTeams()) {
                if ((Villager) event.getRightClicked() == team.getTeamShopVillager() || (Villager) event.getRightClicked() == team.getTeamShopVillager()) {
                    villagerTeam = team;
                    break;
                }
            }
            event.setCancelled(true);
            if ((Villager) event.getRightClicked() == villagerTeam.getTeamUpgradesVillager()) {
                showUpgradesGui(event.getPlayer(), villagerTeam);
            } else if ((Villager) event.getRightClicked() == villagerTeam.getTeamShopVillager()) {
                showShopGui(event.getPlayer(), villagerTeam);
            }
        }
``` why won't this cancel (the villager is waving his head) and why won't this show gui
young knoll
molten hearth
#

magic

#

(idk mane)

#

im used to nodejs events where they just made an EventEmitter

#

i thought something similar would be possible in java

young knoll
#

I'm sure it is

#

If the event system was made now I imagine it would be more lambda based

quaint mantle
#

I have been blocked on spigotmc, idk why

#

I first time visit the site, and I be in block

young knoll
#

Are you using a vpn?

quaint mantle
#

No

worldly ingot
#

What an eager fish

#
    private int iterations = 0;
    private final float change = 8F;
    private final int maxIterations = NumberConversions.floor(360 / change);

    @EventHandler
    private void onFishLure(PlayerFishLureEvent event) {
        if (event.getTimeUntilHooked() % 20 == 0 && iterations++ < maxIterations) {
            float newAngle = (event.getAngleFromHook() + change);

            event.setTimeUntilHooked(event.getTimeUntilHooked() + 1);
            event.setAngleFromHook(newAngle);
            return;
        }

        this.iterations = 0;
    }
#

(it was in degrees by the way, not radians)

young knoll
#

I wonder if there would be any performance impact if the event system was converted to use consumers rather than reflection

worldly ingot
#

Realizing this event is a little bit backwards though. This event is called after the position change because it involves randomness

#

but there's really not much I can do to remedy that

young knoll
ivory sleet
#

yea or artifically construct method handles w lambda meta factory

#

of the event handlers

shadow night
young knoll
#

That was my idea for the backwards compat

#

convert the java.lang.reflect.method stuff into a consumer via LambdaMetafactory

shadow night
ivory sleet
#

its possible to do that

#

with PluginManager#registerEvent alr

#

tho it takes an EventExecutor

#

not a Consumer :,)

shadow night
#

I will ew you into the shadow realm

young knoll
#

Is there a difference between having it as a Consumer vs a MethodHandle?

#

in terms of speed

ivory sleet
#

yes coll

#

depending on how u get the method handle

#

it can be different

young knoll
#

mm

ivory sleet
#

for instance unreflecting a java.lang.reflect.Method with methodhandles just wraps it around iirc

#

but if u construct it w lambda meta factory u basically get invokedynamic

young knoll
#

I see

quiet ice
#

Huh, I thought that unreflecting would also get an invokedynamic

#

Or at the very least the reflection does not show up in the stacktrace

ivory sleet
#

maybe it does in newer versions

#

but before they optimized reflection, it would basically have the same overhead as a normal reflective invocation had

quiet ice
#

I mean unreflecting makes only sense to get private members

young knoll
#

What about functional interfaces

quiet ice
#

those are basically consumers

#

So invokedynamic

ivory sleet
#

yea

quiet ice
#

Or rather said, consumer is an functional interface

young knoll
#

so basically the same

ivory sleet
#

yea

#

well either way I think reflection is fairly optimized nowadays

young knoll
#

Fair

#

It's more about allowing event registration via a consumer

ivory sleet
#

it would be nice

#

there is a slight issue but I think it can be solved

#

and that is that it must implement Listener yk

ivory sleet
#

so maybe if we have a custom functional interface

shadow night
shadow night
#

Why gifs

echo basalt
#

I changed it a lil bit to support unregistering listeners in runtime :)

#

SubscribedListener listener = eventBus.subscribe(PlayerJoinEvent.class, (event) -> {

});

listener.unsubscribe();

#

type deal

velvet hawk
#

is there a way to get the ping of a player

young knoll
#

But it's an average

velvet hawk
#

im on 1.8

shadow night
#

How does dispatchCommand work? Will it freeze my thread or whatever until it finishes or does it do things differently?

echo basalt
#

p much

shadow night
#

Can I make my own command sender that will redirect sendMessage to some other place

quaint mantle
#

is it OK if I like

event.setDamage(0) and set hearts manually to make my own damage system

plucky skiff
#

I'm trying to do some nms stuff on every player apart from the one executing it but for some reason this code, ```for(Player onlinePlayer : Bukkit.getOnlinePlayers()) {

        player.sendMessage(player + "\n" + onlinePlayer);
        if (onlinePlayer == player) return;

        try {
            ((CraftPlayer) onlinePlayer).getHandle().connection.send(new ClientboundSetEquipmentPacket(player.getEntityId(), airItem));
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }``` only gets the player that executed it when there are others when done one account. But when I do it on the other, it does get all of them... WHY??
#

ohh

#

yes it work, ty

#

you mean protocollib?

#

ah

shadow night
#

Maybe he is doing some spoofing

plucky skiff
#

spigot api

#

nah, it's to make the player completely invisible

kind hatch
#

Player#sendEquipmentChange()

plucky skiff
#

without actually removing the items

#

yk, make sword, still do sword damage

wet breach
#

btw, in regards to your dispatch command

plucky skiff
#

I tried it with the spigot-api and it didn't want to work, I asked, and packets were how I was told to make it work

#

and it did eventually work

wet breach
#

you don't need to use dispatch command as most times you can just invoke the command directly especially if its a command from another plugin

#

as command has an execute method

shadow night
# wet breach what do you mean?

I'm making a little remote controlled thingy and I want to redirect the command output (sendMessage stuff) to that remote controlled thing

#

I also do need to dispatch it as I'm getting it as a string

wet breach
#

getting it as a string?

shadow night
#

Remote control

#

I have the command fron the other end which sends a string

wet breach
shadow night
#

what

#

What is this random event that doesn't help me

wet breach
#

you can send commands remotely without using dispatch

shadow night
#

I don't use rcon

wet breach
#

literally uses strings

#

not that hard

orchid gazelle
#

Idk who tf on this world uses rcon

#

lol

shadow night
#

Fr

#

I have no idea how this event helps me at all

#

As I'm not even remotely using rcon

wet breach
#

because you didn't know it could use it -.-

#

anyways no matter, many people re-invent the wheel without realizing the server already has something implemented lol

shadow night
#

Well

#

That thing the server has implemented is really weird and I'll not use that

wet breach
#

it isn't weird

shadow night
#

And it's also lacking some functionality I need I'd guess

wet breach
#

such as?

#

you are executing commands

#

which is what it is literally for

#

o.O

shadow night
#

I'm not only executing commands

#

I wanna make it like give server info if you request

#

Ram usage, etc.

#

Also the player list

wet breach
#

rcon can do that

#

its not limited to commands only

shadow night
#

Can it?

wet breach
#

yes

shadow night
#

Well

wet breach
shadow night
#

I literally told you I will not use RCON

wet breach
#

its implemented in the server, can be used for basically anything including commands

shadow night
#

I'm making a little ws server (because I've been asked to) and it should be useable in stuff like djs bots and websites

wet breach
#

and that means rcon is unusable how ?

#

while many people never heard of rcon, virtually almost everything supports it XD

shadow night
#

I also just am generally against rcon

#

I hate it, no reason for that

wet breach
#

lol

shadow night
#

Well, besides that RCON also doesn't let me implement my own stuff like a plugin I wrote myself

#

I'm not almighty to change rcon, but I can always change my own thing

wet breach
#

nothing needs changing in rcon

#

probably already compatible with what you have or 90% anyways

shadow night
#

What does that even mean

wet breach
#

basically rcon isn't anything complex, just have to send the packets in the appropriate format, which there isn't really much to it, and you send it to a different port

shadow night
#

Can rcon send me data in json

wet breach
#

if it fits in the payload

shadow night
#

Oh and besides that, JUST LET ME MAKE THE FUCKING PLUGIN IF I ENJOY THAT

wet breach
#

lol

river oracle
#

man bro hates rcon for some reason

shadow night
river oracle
#

that's called ignorance

#

you should try to not do that

shadow night
#

Why should I like rcon

wet breach
#

its simple and works and is already implemented in the server with events

river oracle
#

to come into something with an open mind you need it to give you reasons not to use it, not the other way around

shadow night
wet breach
#

the only downside of it, is security, however that is fixed with a DB though where you can just pull the credentials that are changed for both ends

river oracle
shadow night
wet breach
#

not sure how rcon prevents that

river oracle
#

no one is stopping you simply giving you knowledge of a already existing tool

#

grow up

wet breach
#

idk even know what system you are currently using

shadow night
#

If there was no rcon I wouldn't be having this discussion rn

wet breach
#

other then its something you created XD

shadow night
#

I made a plugin to do something that rcon does? Okay, then why not let me do it. Why do you care?

sterile token
shadow night
#

Useless channel

wet breach
shadow night
wet breach
#

also, not everything you make is the best either just remember that, not saying that everything in MC is the best either XD

shadow night
#

Ehh

wet breach
#

when it comes to protocols or rolling your own, real easy to slip in some security vulnerabilities or two

shadow night
#

Lol

sterile token
#

But as i said before if you wanna start with networking i would suggest reading about Redis protocol which is an in memory database

wet breach
#

first, there is two differing kinds of protocols

#

second you don't need redis to learn networking nor would I even recommend it for learning networking

#

anyways, back to the protocol. The first kind of protocol is the hardware protocol, well still technically software but easier to think of it like hardware to help keep it separate from the second kind, which is your software protocol. So the hardware ones being TCP, UDP and few others. You can technically make your own protocol here downside is, its only really useful in a network you fully control all hardware and can install said protocol so all hardware understands it. Then the software ones being something like MC protocol or Http. Both are completely different, but both make use of TCP and nothing says what you learn from http will even apply to some other project because it assumes it uses anything remotely similar

shadow night
#

I like doing websockets so I can test my stuff from my browser lol

#

Websockets are http and http is tcp iirc

wet breach
shadow night
#

No idea

#

Didn't read, too long

tender shard
wet breach
#

4 sentences is too long?

shadow night
#

Yes

wet breach
#

well 4 lines

#

not sentences lmao

shadow night
#

Screen dependant

orchid gazelle
#

oh wait I gotta wait for the CLA to fork CB, oof

#

I wanted to work on my PR lmao

grizzled relic
#

How can i create client-side npcs?

#

Have any docs etc. about it?

sterile token
grizzled relic
sterile token
#

right let try finding some info i havent done much work on latest versions. But i could help

grizzled relic
wet breach
#

you need the CLA for PR's though

orchid gazelle
#

you cannot access your stash account if you do not have the CLA approved

#

-> you cannot fork

wet breach
#

buildtools gives you CB source

orchid gazelle
#

it gives source, yes

wet breach
#

its a git repo in of itself

orchid gazelle
#

I could clone it

#

but not fork it on stash

wet breach
#

ok but that isn't the definition of forking

orchid gazelle
#

well ok

#

that's what I mean tho

quaint mantle
#

Пон н

orchid gazelle
#

what?

sterile token
tender shard
#

google translate also doesnt understand it

orchid gazelle
#

I was also confused

#

my google lens did not detect it

vocal cloud
#

It's russian. Their bio is that of a scammer

tender shard
#

nice

vocal cloud
#

Claiming to sell cheap boosts

shadow night
#

Oh yeah

agile hollow
#

How can i make that public?
Player target = (Player) e.getRightClicked();

hazy parrot
#

what

shadow night
#

Can I make a command take more than one tick? Not in time, but in actual ticks, so I can send the command on tick 1 and get the success (the boolean onCommand returns) on tick 3 for example

#

I somehow can't think of how that could be done

hazy parrot
#

you want to make server lag ?

agile hollow
shadow night
#

Can't you pass it through a method or something

hazy parrot
#

that would be the way ^

proud badge
#

Is block metadata tied to the block, or location?

tender shard
#

BlockStates are tied to a block, BlockData are not

proud badge
#

Like, I want something like PDC but block based, is there something like that?

hazy parrot
#

?blockpdc

tender shard
#

?blockpdc

hazy parrot
#

lol

shadow night
#

Huh

tender shard
#

stoopid bot

shadow night
#

More like slow bot

proud badge
#

damn promoting your own article

shadow night
#

Yeah

#

I think blockpdc is the thing he should promote

tender shard
shadow night
compact haven
#

gotta be qter irl

agile hollow
#

if i do smth like that

        return (Player) event.getRightClicked();
    }``` 
i can't use it anymore in another type of EventHandler like InventoryClickEvent how can i do i can use `getRightClickedPlayer` in all the EventHandler?
warm mica
#

You'd have to store it in e.g. a Map if you want to re-use that entity later again

agile hollow
#

how can i do smth like that?

warm mica
#
agile hollow
#

and how can i check if someone check if he close the gui? like with esc it's possible on InventoryClickEvent?

warm mica
#

No, because InventoryClickEvent only gets called when he clicks on an item

#

InventoryCloseEvent gets called when he closes the inventory

#

It makes logically no sense to combine them

agile hollow
#

oh ok yes XD

wet breach
#

in the event inventoryclose event isn't called

#

you can also monitor if they move

shadow night
hoary light
#

Guys my script umm not UTF-8
Idk why, someone know how it fix?

player.sendMessage("here my text");

even this cannot be UTF-8 (my text is different there on other language) and he should save like UTF-8.
Server is okay can see UTF-8 on other plugins (not by me).
IDE: IntelliJ IDEA Java: 18 (64-bit) Build: Gradle, Spigot | Bukkit

proper cosmos
#

Never used Predicate so i wanted to ask if that's correct

rough drift
#

that will get the first block which has the block above as air though

#

you probably want to check the block type

tender shard
rough drift
#

^

tender shard
#

why didnt you just use the code I sent?

rough drift
#

^

tender shard
#

ah gradle, I see. show your build.gradle pls

proper cosmos
warm mica
tender shard
wet breach
#

saves you from a lot of trouble down the road in regards to cheating etc

#

and its just easier

proper cosmos
# tender shard yes, that'd work.
@Nullable
    public static Block getHighestGrassBlockAt(World world, int x, int z) {
        return getHighestBlockAt(world, x, z, block -> allowedMaterials.contains(block.getType()));
    }

    static List<Material> allowedMaterials = Arrays.asList(Material.GRASS_BLOCK, Material.DIRT, Material.STONE);``` something like that??
warm mica
wet breach
#

if you purposely ignore security vulnerabilities in the things you create you are also part of the very problem

wet breach
#

you don't need to implement everything around cheating but you should always be mindful of things that can be exploited and implement in a way that avoids such things being used. Inventories and a player moving is one of those

warm mica
wet breach
proper cosmos
upper hazel
#

what the PotionEffectType use for "strength" effect

proper cosmos
#

cause when i use World#getHighestBlockAt() it returns me original, not changed

wet breach
#

I am saying those who cheat make use of inventories quite often and this is thanks to developers not being versed in some of the problems in regarding to inventories or other things

#

and thus propagating the problem further

#

However if you want to be part of those I suppose that is your choice I guess, but it doesn't change the fact that developers should be avoiding spreading problems around

warm mica
wet breach
#

no

#

developers that choose to be ignorant are part of the problem

warm mica
#

If that'd be the case then this would be baked into Spigot/Paper

wet breach
#

they are, if you like your plugin being the cause a cheat is able to be used then I guess continue to ignore problems like 90% of developers

wet breach
#

spigot tries to not change vanilla mechanics

#

paper I can't say they do whatever and this isn't paper discord

warm mica
wet breach
#

anyways, I have little interest to debate with someone who much rather be part of a problem though

#

so back to my shows I go

plucky skiff
#

I have this code: ```@EventHandler
public void onItemSwap(PlayerItemHeldEvent event) {

    Player player = event.getPlayer();

    if (isActivated.contains(player.getUniqueId())) {

        player.sendMessage("activated: " + player);
        for(Player onlinePlayer : Bukkit.getOnlinePlayers()) {

            if (onlinePlayer == player) continue;
            onlinePlayer.sendEquipmentChange(player, EquipmentSlot.HAND, new ItemStack(Material.AIR));

        }

    } else {

        player.sendMessage("deactivated");
        for(Player onlinePlayer : Bukkit.getOnlinePlayers()) {

            if (onlinePlayer == player) continue;
            onlinePlayer.sendEquipmentChange(player, EquipmentSlot.HAND, new ItemStack(Material.AIR));

        }

    }
}``` And it's supposed to make the item invisible on item swap if it is activate. But for some reason, it does activate, it does send the "activated", it does get the players, but it doesn't send the equipment change packet... Does anyone know why?
tender shard
#

ItemHeldEvent is cancellable, so I guess the slot change happens only after that event. you'll either have to cancel the event, or do your stuff one tick later

#

maybe both, just gotta try it

plucky skiff
#

mhm

#

alr

#

prob just gonna try a bukkitrunnable one tick later

proper cosmos
#

btw you should not compare objects if (onlinePlayer == player) continue; just compare UUIDs

plucky skiff
#

it's prob what mfnalex said

plucky skiff
wet breach
proper cosmos
#

never comapre raw objects

#

if you really want

plucky skiff
#

ah ok

proper cosmos
#

Objects.equals()

#

and that can be reason

#

why it's not working

plucky skiff
#

nah the for loop itself works normally

proper cosmos
proper cosmos
plucky skiff
#

yep

proper cosmos
#

how?

plucky skiff
#

because I have it in another piece of code...?

plucky skiff
#

for testing ye

proper cosmos
inner mulch
#

yo since when are there records??

#

just noticed they exist

young knoll
#

In java?

tender shard
#

14

young knoll
#

Yeah

#

It’s amazing what you get when you go from 8 to 17

tender shard
#

or 15? i think it was a preview feature in 14

inner mulch
#

what do records do tho?

#

they look like a method

tender shard
inner mulch
#

but they are a class?

young knoll
#

Kinda of

#

They are a record

tender shard
#

records are classes with auto-generated methods for getters, toString, hashcode and equals

#

basically that's it

inner mulch
#

oh

#

so data

tender shard
#

yep

young knoll
#

Mhm

tender shard
#

immutable

shadow night
#

It's like enums, they are still classes but with some extra functionality

inner mulch
#

okay

#

thanks

plucky skiff
# tender shard ItemHeldEvent is cancellable, so I guess the slot change happens only after that...

yeah, so I need to make it 2 ticks later, but with that it makes it makes it appear for a split second, so I tried this: ```
@EventHandler
public void onItemSwap(PlayerItemHeldEvent event) {

    Player player = event.getPlayer();

    if (!isActivated.contains(player.getUniqueId())) return;

    event.setCancelled(true);

    for(Player onlinePlayer : Bukkit.getOnlinePlayers()) {

        if (onlinePlayer.getUniqueId() == player.getUniqueId()) continue;
        onlinePlayer.sendEquipmentChange(player, EquipmentSlot.HAND, event.getPlayer().getInventory().getItemInMainHand());

    }

    player.getInventory().setHeldItemSlot(event.getNewSlot());

    for(Player onlinePlayer : Bukkit.getOnlinePlayers()) {

        if (onlinePlayer.getUniqueId() == player.getUniqueId()) continue;
        onlinePlayer.sendEquipmentChange(player, EquipmentSlot.HAND, new ItemStack(Material.AIR))

    }

}

tender shard
#

you probably can't fully prevent it to look weird for a small time

plucky skiff
#

I mean, there is a way right, but not easily I'm guessing right?

#

maybe not using this event or smth

tender shard
#

as I said, I don't think you can prevent it from flickering because the client normally thinks it can change the held slot anytime, so it won't ask the server "yo can I change the slot". It only tells the server that the player already had changed the slot, and then the server sets it back

glossy venture
#

raycast of 10 billion blocks didnt crash the server

#

sick

plucky skiff
#

the question is if it is possible without bukkitrunnable

#

but I'll look

tender shard
#

simply cancelling the event should be enough

tender shard
#

tbh I dont really understand what you're trying to do anyway with that code

#

player.getInventory().setHeldItemSlot(event.getNewSlot());

^ that's basically the same as not cancelling the event?

plucky skiff
#

event.setCancelled(true);

^ I'm cancelling it beforehand

#

then changing the slot so that it then is happening after

plucky skiff
thin iris
#

does protocolib have a discord?

rotund ravine
#

Probably

thin iris
#

i cant find it anywhere

plucky skiff
rotund ravine
tender shard
tribal valve
#

quick question, im making a blockwars plugin, like bedwars but with block (that has hp and everything) and i want to know if i should change the shop gui a little bit because i just copied it entirely from hypixel bedwars, kinda feel like the plugin im making is really just a copy of bedwars

rotund ravine
#

Up to you

tribal valve
#

bruh

tender shard
#

Just make the gui 100% configurable

tribal valve
#

wdym configurable by the player?

tender shard
#

By the admin

tribal valve
#

oh, im not publishing the plugin anywhere, just for showcase of my java abilities and maybe to play it with some friends

shadow night
#

If your plugin is not customizable then I question your plugining abilities

tribal valve
#

i can make it customizable but i just want to finish it quickly

wooden frost
#

Hello, could anyone explain to me how does one remove the "take out item animation" when rapidly changing the item's nbt data.
basicaly, im just setting the nbt data of an item through item.setItemMeta(meta) . Is there a better method? Or is there a way to remove the animation.
Please let me know.
Thanks :)

tender shard
wooden frost
#

oh wait

tender shard
#

depends, what are you changing?

wooden frost
#

i have not learned packets yet

wooden frost
#

stickFuse:int

tender shard
#

so nothing the player should see? yes, then you could listen to outgoing packets and cancel sending it to the player

wooden frost
#

and if i were to change the custommodeldata?

tender shard
#

depends on what you use it for. if you use it for custom textures, then ofc you want the client to know about the changed value

wooden frost
#

uh

#

hold on

#

so you just listen for the packets and (spoiler i got it wrong) just cancel them?

young knoll
#

Yes

tender shard
#

ofc you only want to cancel sending this exact packet, but yeah

wooden frost
#

ok

#

basicaly

#

i dont know what am i doing

#

but

#

my small ass brain dont work

shadow night
wooden frost
#

actually i was thinking of making a new one, cuz it is kinda ass lmao

shadow night
#

Doesn't look very pfp-y but it does look very cool

wooden frost
#

yeah

#

@tender shard ples help can you like send how that should look like in code? ill try to understand it.

tender shard
#

I'd use protocollib to listen to outgoing packets

wooden frost
#

i hev to go to bed and spend the next 8 hours of my life with closed eyes

wooden frost
tender shard
wooden frost
tender shard
#

and you'll need to add protocollib as dependency in your build.gradle or pom.xml

wooden frost
#

uhhh, in pom.xml it show up as red ( the <dependency>)

#

it says it aint found

tender shard
#

did you add the repository?

wooden frost
#

yuh

tender shard
#

Sometimes, people suggest you to change something in your pom.xml, and then IntelliJ starts to complain: That is totally normal. You simply have to click the “maven reload button” in IntelliJ. Maven will then continue to download the required dependency/plugin, if it’s available. After a few seconds, everything should be fine. You can find the.....

wooden frost
#

eyyy

#

thanks

#

i fix it

#

im stoopid

#

anyway

#

packets

#

gona learn tomorow

#

buy

#

oh

#

BRUH

#

IM FCKIN SLEEP DEPRIVED

#

BRO SAID BUY INSTEAD OF BYE

#

💀:🗣🗣🗣

shadow night
#

💀

#

Your 15 messages could be 3

wooden frost
#

yeha

#

slepe depveration

#

oh fuck

#

hell naw

#

ok im out

#

gn everyone

shadow night
#

Next time you end up with сон deprevation

wooden frost
#

согл сигма фонк

shadow night
#

yes

quaint mantle
#

For reload the config with a command, I have to save the config and then reload it?

tender shard
#

no

#

why would you save it?

shadow night
#

You reload it

tender shard
#

just use reloadConfig()

quaint mantle
#

okey I have it correct