#help-development

1 messages Β· Page 125 of 1

eternal night
torn oyster
#

Is there a way to hide an npc from the player list without removing its skin?

iron glade
#

I solved it thanks to his input

haughty idol
#
            p.spawnParticle(Particle.ASH, p.getLocation(), 50);
        }, 1L, 100L);``` so this would run every tick for 100 ticks
#

right?

iron glade
haughty idol
#

it doesn't work

#

oh

eternal night
#

timers don't stop unless explicitly cancelled

haughty idol
#

ah

#

okay

eternal night
#

1L

iron glade
#

1L = 50ms

eternal night
#

is a tick

#

^

#

so I guess ~50ms

haughty idol
#

how do i get the taskId?

eternal night
#

preferably don't and use the returned bukkit task instance

#

which has a cancel method on it

eternal night
#

if you just wanna execute something 100 times you could just:

final AtomicInteger counter = new AtomicInteger(0);
scheduler.runTaskTimer(plugin, task -> {
  if (counter.getAndIncrement() > 100) {
    task.cancel();
    return;
  }
  ... do your thing
}, 1L, 1L)
#

not, I just wrote this off the top of my head

#

so

torn oyster
#

what packet would i use to remove an NMS player from someone's view

eternal night
#

that might not be valid java code xD

hasty prawn
#

20 ticks/second, 1000ms = 1 second, so 1 tick is about 50ms.

iron glade
#

yes

torn oyster
#

it's an nms player

#

not a real player

eternal night
#

send an entities destroy package

torn oyster
eternal night
#

ClientboundRemoveEntitiesPacket

#

yea

#

notably don't ever send that to the player itself xD

#

that will completely fuck the client up

dawn hazel
eternal night
#

a normal int won't work

#

as you are using it inside a lambda, which requires captured variables to be effectively final

torn oyster
#

is it ClientboundRemoveEntitiesPacket(EntityId)

eternal night
#

yea

torn oyster
#

okay cool

iron glade
#

can use a one size int array

#

that's my goto

eternal night
#

there is a constructor that takes an int varargs

quaint mantle
#

Hey, how can I set up NMS?

#

HashMap?

wise leaf
#

Could you not just use an array?

#

Like an array of tuples

quaint mantle
#

So a hashmap

wise leaf
#

Well then if you need that a hash map is probably the best option

quaint mantle
#

Then a hashmap inside a hashmap

#

no

wise leaf
#

Sounds like you are trying to implement an ORM

#

Why not just use an ORM lib

quaint mantle
#

An ORM basically helps you do stuff with a database

wise leaf
#

Object Relational Mapping, its what you are trying to do

#

Links data from a database to objects

#

so that you can interact with data on your database progmatically without having to handle all the queries yourself

quaint mantle
#

Yea

wise leaf
#

Java has millions of them

#

Hibernate seems to be the most popular one, not sure if its any good though haven't touched java in quite some time

haughty idol
#

it keeps saying that it can't delete this createdfiles.lst file

#

and if i delete it normally its fine

#

but its really annoying

lost matrix
ivory sleet
#

there is a kt one which is much better iirc

#

but thats for kt

snow lava
#

someone knows how to add an id to a block? it's because i created a custom block and i need to identify it to create some functionalities.

lost matrix
snow lava
lost matrix
#

Only through some hackery

paper viper
#

You could create a "fake" ID by using PDC

lost matrix
#

Spawners are persistent data holders. So just use the pdc.

snow lava
#

yeah, but that works as an nbt tag?

haughty idol
lost matrix
snow lava
#

but i tryied to use it and i check if the tag was added to the block and it wasn't there

lost matrix
#

You need to update the BlockState after editing the pdc

snow lava
#

can i add a tag directly like: tiledata.setBoolean("Customblock", true);?

lost matrix
#

Sure. You can also just add an id. data.set(someKey, PersistentDataType.INTEGER, 20)

reef brook
#

How can I relocate the dependencies of my dependencies without writing them all? Because it's endless. Or is there an option to relocate everything? With maven

lost matrix
#

*If the relocated dependency shades its content

reef brook
#
        <dependency>
            <groupId>net.kyori</groupId>
            <artifactId>adventure-platform-bukkit</artifactId>
            <version>4.1.2</version>
        </dependency>

maybe I relocated it wrong

lost matrix
#

You have the maven shade plugin set up, right?

snow lava
opal juniper
#

maybe show the whole pom

lost matrix
#

Maybe its different

lost matrix
#

Its done with the shadow plugin. Let me take a quick look.

reef brook
lost matrix
reef brook
thin delta
#

Alright boys... I fixed my eclipse and now I have my project as a Maven project. I need in export the jar and include this in it as a dependency. Can someone walk me through it?

snow lava
#

this didn't work

lost matrix
snow lava
#

i made it work but it overrides all my nbt tags

glossy venture
#

pdc is goofy

#

use nms 😎

#

nbt

snow lava
#

yeah

#

but i tryied that but i couldn't

snow lava
eternal oxide
glossy venture
#

get the nms world with like reflection, get the tile entity at the blocks position and get the nbt tag

eternal oxide
#

Your Key is invalid

glossy venture
#

nbt can have anything as a key i think 😎

eternal oxide
#

PDC works just fine and shoudl be used over NBT

snow lava
torn oyster
reef brook
#

shade net.kyori

torn oyster
#

i believe you told me yesterday how to remove them from tablist but it removes their skin

eternal oxide
glossy venture
torn oyster
#

should I try delaying the remove thingy a few ticks?

eternal oxide
#

you could try it. I've played with skins/names and updating packets but I've not tested in depth

snow lava
glossy venture
#

looks good right

snow lava
#

at first the tag exist but when i check the block the tag disapears

glossy venture
#

wait

#

im pretty sure tile entities dont store tags

#

at runtime

#

so use pdc

#

the chunk pdc

#

or a map at runtime and save it when the chunk is unloaded

snow lava
#

with pdc the tag is stored

#

but all my other tags disapear

eternal oxide
#

a TileEntity retains its PDC data between sessions. Can you explain your issue again as I've not read that far back.

#

what other tags? Other PDC tags?

snow lava
#

here is the code:

glossy venture
#

those dont work with tile entities

#

they dont store NBT for performance and memory reasons

eternal oxide
#

you are trying to use NMS tags and PDC at the same time?

glossy venture
#

they only save to and load from nbt

#

just like other entities

#

right?

glossy venture
snow lava
#

yeah

eternal oxide
#

first, change your PDC key to a valid key

#

you can;t use upper case letters

snow lava
#

all my nms tags store as spected

eternal oxide
#

that is a PDC tag you are adding. Lower case only

snow lava
#

yes

#

but i have more tags, if you want i can show all the code

eternal oxide
#

That tag will not work correctly as your key is invalid

haughty idol
#

how would i make the player disappear along with their armor, but still be able to be hit (with packets)

snow lava
eternal oxide
#

a key must be ALL lower case. No upper case characters

snow lava
#

ahh ok

#

but can i use nms tags an pdc at the same time?

eternal oxide
#

It should be possible, but not sure why you would want to.

snow lava
#

here works the pdc

#

but all the other tags were gone

snow lava
haughty idol
#

how the hidePlayer works is that it makes the player invincible too

#

:/

#

because i tried it and nobody can hit me :/

eternal oxide
haughty idol
#

they used aoe attacks :/

#

one even autoclicked and couldn't hit me

haughty idol
#

i heard that i have to do it with packets

snow lava
eternal oxide
#

You don;t seem to be setting anythign which is not exposed by the API

#

I'll be away for 15 mins

balmy valve
#

Anyone know how to summon a firework that doesn't have any of the white firework particles in it?

#

will give more context in a second when I have the information easily showable

#

the 2 important things in that photo are the firework in the background and the chat showing the firework meta

#

in the firework you can see that there are white particles mixed with the reds

#

but in the meta no such explosion exists

haughty idol
#

i think you have to edit the meta of the fireworks

balmy valve
#

Anyone know how I can remove those particles?

haughty idol
#

oh

#

my bad

balmy valve
#

lol np, Im manually setting the firework meta alr

torn oyster
#

how come my NMS fake player's skin isn't double layered?

eternal oxide
#

You didn;t send the player meta packet

#

if you are just using packets you send java new ClientboundSetEntityDataPacket(npc.getId(), npc.getEntityData(), true)If they exist in the World you instead wrap the ServerPlayer in yoru own class and set java this.getEntityData().set(Player.DATA_PLAYER_MODE_CUSTOMISATION, (byte) 0xFF)

iron glade
#

Someone's got an idea on how to exctract chat color from a string?

#

Like if the string is &6Some string I only wanna have the &6

delicate lynx
#

probably regex is your best bet

thin delta
#

Alright boys... I fixed my eclipse and now I have my project as a Maven project. I need in build the jar and include this in it as a dependency. Can someone walk me through it?

fervent gate
#

Is there a way to create a mob with a nametag that has multiple lines? I've tried working with scoreboards but that doesn't work on mobs apparently.
Cannot resolve method 'setScoreboard' in 'LivingEntity'

iron glade
# lost matrix Why?

I thought about it and I actually need the last used color in a string (if there's any)

#

e.g. &6Some fance &4String should return &4

strong parcel
#

Hey, I am trying to give a Player_Head a custom texture, but I am having issues with the dependencies. The tutorial I am watching told me to replace "spigot-api" with "spigot" in the pom file, but I get an error saying it can't find that dependency. Does anybody know what I am missing?

opal frigate
#

Install that version with BuildTools

opal frigate
#

Probably just 1

strong parcel
opal frigate
#

Well it all depends what you want to do

#

If it’s basic then why use 2 listeners?

lost matrix
#
    @EventHandler
    public void onEvent(SameEvent event) {
        checkA(event);
        checkB(event);
    }

    private void checkA(SameEvent event) {}
    private void checkB(SameEvent event) {}
strong parcel
# opal frigate Probably just 1

So Intellij is letting me import GameProfile now, but when I compile I get an error saying "cannot access com.mojang.authlib.GameProfile"

eternal oxide
#

Using Maven?

strong parcel
#

Yes

eternal oxide
#

Then build using Lifecycles Package, not artifacts

strong parcel
#

I used install from Lifecycle

eternal oxide
#

?paste teh full error then

undone axleBOT
strong parcel
eternal oxide
#

You are using the wrong version for your target java version

#

what spigot version are you building against?

strong parcel
#

I think I was building against 1.18.2. Is there a way I can confirm?

eternal oxide
#

In that case you don;t need GameProfile at all

strong parcel
#

Oh, what would I use instead?

eternal oxide
#

All spigot now, no Mojang

strong parcel
#

Thanks!

quaint mantle
#

how can i make a different thread every chunk?

#

for prison enchants

eternal oxide
#

why would you want a new thread for every chunk?

#

In PlayerMoveEvent, compare chunk in getFrom and getTo. If not the same, remove old chunk enchants and apply new chunk enchants.

main dew
#

I can get block data after click in PlayerInteractEvent?

quaint mantle
#

since its looping hundreds of blocks

eternal oxide
#

It won't be "better performance"

main dew
quaint mantle
#

but it would be tho :/

eternal oxide
#

why are you looping hundreds of blocks?

quaint mantle
#

looping the blocks on 1 thread would cause lag

#

because prison enchants :/

eternal oxide
#

Yeah, no clue what a "prison enchant" is and no clue why you need to loop hundreds of blocks

#

Spigot is a state change system. you don;t do anything unless you are triggered

quaint mantle
#

like this

#

its looping alot of blocks, which give you money

eternal oxide
#

No clue what that is

quaint mantle
#

;-;

eternal oxide
#

its a screenshot but tells me nothing

#

do the blocks change?

quaint mantle
#

yes

#

they would change to air and give money / tokens

#

but if i do it on 1 thread

#

it'll lag

eternal oxide
#

take a snapshot and process it async

#

jump back sync to make any changes

quaint mantle
#

a ChunkSnapshot?

#

alr

#

wait, so how would i make a thread per chunk?

#

im a little confused

eternal oxide
#

You don't. That would be crazy

quaint mantle
#

so what would you recommend?

#

just a snapshot

eternal oxide
#

yes

#

generally reading blocks Async will not cause issues, but you must be Sync to make changes

quaint mantle
#

yeah

eternal oxide
#

so you do all your processing Async, then jump back sync to make changes

quaint mantle
#

πŸ‘

tender shard
#

I got banned from paper now too

eternal oxide
#

lol

iron glade
tender shard
#

wait

main dew
#

I can get block data after click in PlayerInteractEvent?
For blocks like trapdoor, door, flower pot etc

tender shard
#

but I dont wanna "shame anyone" so yeah

#

there was some disagreement with a person who had kick perms and me, and then I got kicked

#

lets not go into details

iron glade
#

bruh

humble tulip
#

You do you

#

Di is cleaner tho

echo granite
#

Always use DI except for one case which is passing the plugin's instance, Use a singleton for that.

#

Bukkit doesn't allow you to create an instance of your main class, so there is only one - therefore using DI for that is just stupid and takes more code.

ivory sleet
#

testability

#

reusability

#

robustness

#

maintainability

#

modularity

#

logger is fine for instance

#

(since you test loggers by appending them anyway)

#

and no singleton is not cleaner

#

singleton is less verbose probably

#

but it is definitely by all means less cleaner

#

yeah

#

maintainable refers to the future work you have to put in

modular refers to how isolated different functionalities of your plugin is

robustness refers to how resistant your code is towards changes

testability refers to how easy your components are to test, in terms of unit tests, integration tests, sys tests and acceptance tests

reusability refers to how easy a component of your system is to reuse

#

DI means your components depend on dependencies at type level, for instance a constructor is just a function that takes a set of types and returns a type

#

this allows us to depend on high level types, interfaces that is

#

and then they can be mocked for testing

#

when we have classes that depend on abstraction we gain dependency inversion for instance

#

and is a SOLID principle

#

anyway Pvbble

#

we can look at it from the other perspective

#

what are the disadvantages of mono/poly state

#

oh poly state is just the term for static state

#

mono state refers to when you have like a single static state within bounds of a class

#

in other words, the disadvantage of static and singletons

#

first you typically conclude a design where a class depends on your singleton

shadow zinc
#

If runtime.maxMemory() represents the Xmx value, then what is the runtime.totalMemory() method represent?

ivory sleet
#

that leads to that every instance of said class depends on that singleton

#

which in other words make the design tightly coupled

#

iirc current memory allocated kytdk

#

no i mean the classic way

shadow zinc
#

yeah im confused

ivory sleet
#

//inside class
var instanceField = Singleton.instance();

shadow zinc
#

I found this but I still don't understand it

ivory sleet
#

no not really

#

if you have it through the constructor then first of all half of the meaning concerning singleton disappears as you cant have them lazily

and secondly the class becomes mockable through mockito

#

we also see what the class depends on more explicitly

#

no

#

the point of a singleton is to provide a single instance of a class as well as a global access point to that instance

#

by definition

lost matrix
shadow zinc
#

whats the difference between max and total?

lost matrix
#

total is used + reserved

#

max is the max allowed for this jvm instance

#

But the jvm does not reserve all its memory from the beginning.

ivory sleet
#

no

lost matrix
#

You can do that with jvm args (Xms) and you also should do that if you run a mc server.
In this case total == max

ivory sleet
#

used in static context has inherently nothing to do with singleton

#

but it does extend its usecase sure

balmy valve
tidal yacht
#

there is have an event to check if player is walking or not?

shadow zinc
lost matrix
ivory sleet
#

the entire point of static singleton was to have them lazy because they may not actually be called at all thus saving some memory etc

#

that was back in the days when we didnt have obscene amounts of memory

lost matrix
shadow zinc
tidal yacht
lost matrix
drowsy helm
shadow zinc
lost matrix
lost matrix
lost matrix
#

Well then its max.

tidal yacht
lost matrix
tidal yacht
drowsy helm
#

yeah what though

tidal yacht
#

but, can someone tell me about PlayerMoveEvent?

drowsy helm
#

what is something

ivory sleet
#

lyey basically, the whenever the player moves just a little bit that event gets called

drowsy helm
#

even head movement

ivory sleet
#

during the time player moves from x to y the event is called continuously in principle

tidal yacht
#

oh, I understand

#

will it working to check if player is sprinting with isSprinting() in during the player moves?

drowsy helm
#

yep

tidal yacht
#

ok, thanks

ivory sleet
#

oh yeah pvbble ping me when u're done with ur little essay

#

:]

#

(hopefully I can answer it satisfyingly)

#

myes

#

first and foremost, you rarely do use singletons in static context (if you have a robust design)

#

then just because a single instance of the class is what fits your system as of the present moment does not mean you should allude towards the singleton design pattern

#

the issue is that static singletons are usually used like this (which they should be):

class CassandraDatabase {
  static CassandraDatabase instance;

  static CassandraDatabse instance() {
    if (instance == null) {
      synchronized (CassandraDatabase.class) {
        if (instance == null) instance = new CassandraDatabase();
      }
    }
    return instance;
  }
}

class SomeFunctionality {
  void performWork(DatabaseType dbType, Query query) {
    switch (dbType) {
      case DatabaseType.CASSANDRA -> {
        CassandraDatabase.instance().fetch(query);
      }
    }
  }
}```
#

now ofc we can use it like:

record SomeFunctionality(CassandraDatabase database) {

}

//or lazy
record SomeFunctionality(Supplier<? extends CassandraDatabase> database) {

}

the last one is just unnecessarily complicated but is sometimes needed, the former gets rid of lazy initialization

#

alr good luck

#

but like I hope you see, if we use SomeFunctionality(CassandraDatabase database), the dependency becomes transparent through out the class

#

and we depend on a type rather than a single unit

#

which makes it a bit more robust if we want to reuse it

#

lets say with another instance of that database class which is configured differently

#

it does sound a bit nerdy and useless, but much about good software practices has turned into writing code that is extendable to the degree that we can change it without causing the entire system to fall apart

reef lagoon
#

?ask

undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!

quaint mantle
#

Hello everyone, I have a question regarding packets

#

The "minecraft:register" and the corresponding "unregister" channel
Do they actually have an effect inside the server?
Or are they for me to query?

quaint mantle
#

Yeah I read every single source I could gather
Several forum entries, this entire Wiki and even the Dinnerbone posr
But it's still quite unclear to me what's actually happening

#

So is this some sort of handshake?

lost matrix
#

Nope. Just a normal channel where you can send packets which tell the other party that you want to register a new channel
and that it should listen to this new channel for packets.

But this has to be supported by the receiving side. Which is not the case for the notchian client.

#

Wait let me double check on that last part

worldly ingot
#

It's basically custom packets

#

It's just an arbitrary stream of byte data

quaint mantle
#

Yes of course, if either doesn't support it, packet sending would be useless to begin with πŸ˜…
I am just checking on the semantics
If my client sends the registration with the channel name I want
How do I respond on the server
Do listeners listen on the register channel so I can act upon it and send a corresponding registration packet back?

ornate patio
#

What do you guys think the best approach for this is:

I need to generate a randomized 6 character code (made from numbers and letters) often, but I also need to make sure it's unique. How do I ensure that the code is unique in the most efficient way possible?

I was thinking of just generating a code normally and if already exists in a giant list of used codes, generate another. But this doesn't sound like a good idea in my head

(When a code is generated, it'll expire after 2 minutes, in case you're about to say that I'll run out of possible codes eventually)

lost matrix
#

Yeah but the client has no logic for them. So it doesnt matter if the notchian client acks the registration because its useless information to him anyways.

worldly ingot
#

There has to be a mod that does something with it on the client

#

This is where Fabric or Forge comes in

quaint mantle
#

That doesn't matter
I am asking in a mod context, obviously the client won't care (if nothing tells it about a new channel)

worldly ingot
#

Either one of two has to send the register message

quaint mantle
#

All I was wondering is if I send this registration packet, how do I recognise this?
Do I add a listener to the register channel?

worldly ingot
#

If one sends a register, they both understand it exists and can send outgoing or receive incoming messages

lost matrix
ornate patio
#

huh

worldly ingot
#

For Bukkit, we have a messenger class that can register an incoming channel

ornate patio
#

collisions?

quaint mantle
worldly ingot
#

Yes

quaint mantle
#

Ah, that's where the Dinnerbone post confused me with "one sends it, the other does the same"

#

So I just need to do it one way

lost matrix
ornate patio
#

Doesn't matter

#

I could do small letters only too

#

It doesn't even have to be 6 characters- I just don't want it to be a UUID, I need the code to be easily copy/pasted or legible to any user if you know what I mean

lost matrix
#

Ok so then a-z A-Z 0-9
= 62 variations per slot.

#

Your word is 6 slots long meaning there are a total of 62^6 cominations

ornate patio
#

mhm

#

56800235584 possibilties

#

maybe i shouldnt worry about it?

lost matrix
#

Which means you can safely generate them for hours without a collision

ornate patio
#

okay

#

so i have a reasonable way to say that i'm too lazy to add some protection for that

#

thanks

lost matrix
#

So i would just use UUIDs...

ornate patio
#

mhm i figured

#

I dont wanna use UUIDs in this case though

ornate patio
#

its a code someone is gonna copy paste somewhere

lost matrix
#

Which code isnt?

ornate patio
#

I mean like

#

UUIDs just look ugly

#

and not very professional (to see in an application)

lost matrix
#

What...

ornate patio
#

i dont mean using them

#

im saying like

lost matrix
#

UUIDs are used in enterprise applications all the time

ornate patio
#

i know i use them all the time

#

what i mean is

lost matrix
#

its the gold standard for ids

ornate patio
#

it looks very ugly to non-programmers i could say

lost matrix
#

Its as professional as it gets

ornate patio
#

πŸ’€ i know

#

I use it all the time for the internals of my app

#

but

quaint mantle
# worldly ingot Yes

Oh and, now when I send this from the client
Will the server register the channel for me or will I still have to use registerXPluginChannel?

lost matrix
#

Ah i see what you mean

ornate patio
#

what I'm working on right now is supposed to be a code

#

that end users will see

#

and use

lost matrix
#

You dont want ids you want something exposed to the user

ornate patio
#

mhm

worldly ingot
#

That's more or less a Bukkit thing though

quaint mantle
#

Hmm ok, that begs the question why I even need to send a register packet then if I register the channel myself

worldly ingot
#

Right, you don't. What modding framework are you using on the client?

#

Fabric and Forge handle those both for you

#

(this being Bukkit and Fabric)

quaint mantle
#

I am planning to target both of them
So I guess I will just ignore the register/unregister packets altogether

worldly ingot
#

Yeah. With Fabric they use the ClientPlayNetworking class to register incoming listeners, and you can use that same class to send outgoing messages

#

Forge has a whole network protocol API around it as well

#

(I actually really like and prefer Forge's API)

quaint mantle
#

So I guess the way I will do this
Is trying to send a packet from the client to ensure the Plugin is installed and if not, the mod is internally disabled
And the other way around, it's probably simpler
I don't know though, the server will still send a packet though to the client?
And be it into the void of a notchian client?

#

I guess I could send an ACK from the client to queue available clients so the server knows to where it cam send messages

scarlet creek
#

How can you spawn a villager with a profession but not allow trading with the villager?

scarlet creek
#

Ah ok

knotty meteor
#

How do i let my armorstand float on water?
Because if i put gravity on false i cant ride it anymore..

tall dragon
#

put it in an invisable boat πŸ˜„

knotty meteor
#

How can i do that?

tall dragon
#

spawn the boat

reef brook
#

How can I relocate the dependencies of my dependencies? With maven

tall dragon
#

then call EntityBoat#setInvisable(true);

knotty meteor
#

Thank you! :D

reef brook
reef brook
chrome beacon
#

What part do you need help with?

reef brook
#

i have this

        <dependency>
            <groupId>net.kyori</groupId>
            <artifactId>adventure-platform-bukkit</artifactId>
            <version>4.1.2</version>
        </dependency>

and this

                        <relocation>
                            <pattern>net.kyori</pattern>
                            <shadedPattern>${project.groupId}.${project.artifactId}.dependencies</shadedPattern>
                        </relocation>

but adventure dependencies like kotlin are not relocated

#

i've been looking for days and I can't find a solution

chrome beacon
#

Simply add the other relocations

reef brook
#

it's endless

chrome beacon
#

Yeah

reef brook
#

manually it takes me 2 seconds to move the dependencies into the jar

#

there must be an option or something I did wrong in the pom

reef brook
tall jewel
#

How to check if a player put a block on the grass or in the water?

chrome beacon
#

Listen to the block place event and check where it was placed

tall jewel
#

Yes, but, System.out.println(world.getBlockAt(loc).getType().name()); send me a block type, I placed, not water or grass

#

where Location loc = e.getBlockPlaced().getLocation();

tall jewel
#

thanks a lot

kindred valley
tall jewel
#

I just want to prevent players from destroying water and grass by placing a block.

eternal oxide
main dew
#

I can get block data after click in PlayerInteractEvent?
For blocks like trapdoor, door, flower pot etc

lost matrix
#

Its always one tick delay...

main dew
lost matrix
chrome beacon
#

So what are you trying to do with the block data?

#

Why do you need it

main dew
main dew
brittle lily
#

?paste

undone axleBOT
heavy swan
#

Hi folks, does anyone know any code for an ItemStack I've made, I need to make it so that when I change the item's lore, name, or attribute, it also updates it in the player's inventory without having to have it again. Does any of you know how to do it?

chrome beacon
main dew
# chrome beacon Why do you need it

Speed builders check if buildings is perfect copy after BlockPlaceEvent and BlockBreakEvent but should check building is perfect after PlayerInteractEvent

main dew
kindred valley
errant narwhal
#

hey

chrome beacon
errant narwhal
#

is everyone know how to spawn Entity player using bukkit api??

errant narwhal
chrome beacon
#

Not really

errant narwhal
#

worldspawn can't spawn player/humanentity class

#

i have try

chrome beacon
#

Well for that you need NMS

#

Which means not using the api

errant narwhal
lost matrix
chrome beacon
#

You use goals

errant narwhal
#

like it has player model but it is chicken

lost matrix
#

This will be really hard because you cant just spawn a player with ai goals.

chrome beacon
#

Yeah add all chicken goals to the player entity

errant narwhal
#

let my find about that

chrome beacon
#

There is ofc more work than that

#

Since you need to detach the entity from the player connection

lost matrix
#

Its way easier to just use LibsDisguises and disguise a custom entity

chrome beacon
#

Or just use Citizens

kindred valley
#

Yes it can fix all stuff

errant narwhal
chrome beacon
#

Well yeah

#

And a good one

kindred valley
#

I found znpcs api better

errant narwhal
#

hmmm

#

i just want to make my npc can attack player and can be attack it look so hard

chrome beacon
#

If you want the NPC to attack

#

Use Sentinel

lost matrix
#

Just realized. hashCode actually uses the jvm memory address if no implementation is given.
So my take was still technically correct.

reef brook
#

manually it takes me 2 seconds to move

cedar yoke
#

how do i do 2 things in one case ->

#

here is what i want to do

#

case "up_right" -> worldY -= speed, worldX += speed;

#

i can only change the world y or world x but i need do to them both at once and making 2 case statements for "up_right" doesnt work

eternal oxide
#

not using lambdas case statements fall through

quaint mantle
#

Hey, what are InventoryView properties?

#

Alright, so, I need a way to differentiate between inventories. I was thinking of using some sort of id. What would be the best way to do this?

cedar yoke
#

like inventory you created with your code ?

quaint mantle
#

Yes

#

I create an inventory per player, so

cedar yoke
#

add inventory [name] = before the inventory code part

flint coyote
#

how can players do that? Rename an anvil?

#

I didn't know :o

#

That's actually cool. I might use it as a hidden easteregg name then. Thanks

cedar yoke
#

i see so you can make a inventory with the same properties use p.getname and save the inventory data for that player and load it every time the player uses /inv or something

odd wedge
#

Why?

#

That’s not what it’s used for

west scarab
#

hi. Is there any way to disable when interating with redstone ore it hngs to a glowing stae? it messages up my erver.

cedar yoke
#

p is nice and short, you can change it easily as well

odd wedge
#

Compare the inventories yourself

odd wedge
#

It’s not nice

#

We should be able to know what the variables are without looking at the code

#

Same goes for methods etc

odd wedge
#

E could be anything

cedar yoke
#

well if you read the code p is means player and its just shortened

odd wedge
#

Exception event etc

odd wedge
cedar yoke
#

well if I do Object obj = .... then it isn't a problem

odd wedge
#

What if you have a huge method and you use p as a variable

odd wedge
#

Should we read through that whole block just to know

cedar yoke
#

i think that's being too specific i mean how many people dont think Obj is short for object

west scarab
#

Yes I mean like in Java

#

I’ve tried disabling player interact event for red stone ore

#

But doesn’t fix it. At all

odd wedge
#

There should be a state for the block

long zephyr
fervent gate
#

Is there a way to create a mob with a nametag that has multiple lines? I've tried working with scoreboards but that doesn't work on mobs apparently.
Cannot resolve method 'setScoreboard' in 'LivingEntity'

cedar yoke
fervent gate
west scarab
odd wedge
#

@cedar yoke

public void someMethod(final Plugin p, final Player p2) {

do something...


/* 300 lines of code
Hey this isn't working.
do smth with p and p2
*/
}```
#

How would anyone know what those are

#

Without looking at the whole method

fervent gate
#

sure

west scarab
fervent gate
#

It's basically the scoreboard copied from some spigot thread that explains them but swapped the player with my custom mob, which is a Zombie.

ScoreboardManager manager = Bukkit.getScoreboardManager();
Scoreboard board = manager.getNewScoreboard();
Objective objective = board.registerNewObjective("showhealth", "health");
objective.setDisplaySlot(DisplaySlot.BELOW_NAME);
objective.setDisplayName("/ 20");
yeti.setScoreboard(board);
#

I'll need to display a custom variable but I'll figure that out with the thread if the displaying works

odd wedge
#

Something like that

west scarab
#

I tried but like

#

Every time that the block updated at all to a new block it fucks it.

quaint mantle
#

Well, what do I return in getInventory() then?

cedar yoke
#

List<String> name= new ArrayList<>();
name.add(" ");

small current
#

Arrays.asList

odd wedge
odd wedge
#
public abstract class InventoryBase {
   //define your inventory

   private final Player player;
   //getter etc
}

public class InventoryData {
  private static Map<Player, InventoryBase> INVENTORIES = ...;
}
#

Something like this

#

I prefer doing it like this

#

Doesn’t matter in this case

quaint mantle
#

Yeah, don't store the whole player object in a map

odd wedge
#

Not really

quaint mantle
#

Just store the UUID instead of the whole player, you can get the player later on with the UUID anyway

#

Yep

odd wedge
#

It’s removed when they close the inventory

quaint mantle
#

It's still better to store the UUID instead of the Player object though

odd wedge
#

Sure

#

Anyways that how custom inventories should be stored instead of using inventoryholder

#

You might prefer them but it’s still not intended for that

#

You may use whatever you like

odd wedge
quaint mantle
quaint mantle
odd wedge
#

I’m not reinventing anything

quaint mantle
#

with an UUID

odd wedge
quaint mantle
#

???

#

Just make a custom holder, It's that basic

odd wedge
#

But it’s still not intended for that

quaint mantle
#

It still works without any problems though Β―_(ツ)_/Β―

quaint mantle
#

Packets. Use packets.

#

I have seen that armor stand lag so many times now

#

Heck, I've even once made a gravity gun mod, and I had to use packets because of the lag that the normal teleport method has

long zephyr
#

i need an idea, i dont need a code, btw i just teleporting the armorstand to player location with an asynchTimer :c

long zephyr
quaint mantle
#

Hmm, yeah, maybe

#

Bukkit api isn't thread-safe IIRC

long zephyr
#
 new BukkitRunnable() {
            @Override
            public void run() {
                teleportArmorStand();
            }
        }.runTaskTimerAsynchronously(armorStandNMS.getPlugin(),0,1).getTaskId();

public void teleportArmorStand() {
        double y = maxY - teleportValue();
        Location entity_location = entity.getLocation();

        Location location = entity_location.add(0,y ,0);
        clientbound.teleport(location);
        teleportEntity(clientbound.getHandle());
    }

private void teleportEntity(Entity craft){
        ClientboundTeleportEntityPacket teleportEntityPacket = new ClientboundTeleportEntityPacket(craft);
        sendPacket(teleportEntityPacket,clientbound.getPlayer());
    }
#
clienctbound.teleport(location) =>

public void teleport(Location aum){

        try{

            armorStand.getClass().getMethod("teleport",Location.class).invoke(armorStand,aum);
        }catch (Exception e){
            e.printStackTrace();
        }

    }
ivory sleet
#

Hence why UUID is almost always better

#

Though I suppose a WeakHashMap might be a fair choice

tender shard
#

reflection? for this? is this a joke? πŸ˜„

long zephyr
tender shard
#

all versions 1.16 and below*

#

wont work on 1.17+

long zephyr
#

its working xd

#

1.14 - 1.19.2

tender shard
#

what class is "armorStand"?

ivory sleet
#

Also MethodHandles fingerguns

tender shard
#

NMS armorstand?

long zephyr
#

Object

tender shard
#

but what class is it actually?

long zephyr
#

CraftArmorStand

tender shard
#

CraftArmorStand? NMS Armor stand?

#

oh okay

#

yeah but

#

erm

#

why do you need a CRAFT ArmorStand to teleport it?

#

teleport is exposed in the Entity interface

long zephyr
#

bad named xD

tender shard
#

org.bukkit.entity.Entity#teleport

#

works in all versions

#

without reflection

long zephyr
#

mmmm

#

so, craftArmorStand.getHandle().getBukkitEntity().teleport(location) ?

tender shard
#

no

#

you dont need a CRAFTArmorStand

#

just use the bukkit armorstand directly

long zephyr
#

.-. i'm using NMS

tender shard
#

Entity myArmorStand = ...;
myArmorStand.teleport(...)

tender shard
#

org.bukkit.craftbukkit is not NMS

long zephyr
#

no xDD

tender shard
long zephyr
#

org.bukkit.craftbukkit.VERSION.CraftArmorStand

tender shard
#

you have a CraftArmorStand, get the NMS entity with getHandle(), then get the BUkkit Entity again with getBUkkitEntity()?

tender shard
#

Yeah you're trolling lol

#

sorry I didnt realize

#

just joined this chat a minute ago πŸ˜„

#

sometimes people actually do stuff like this so I wasnt sure lol

long zephyr
#

do you know about "org.bukkit.craftbukkit.v1_19_R1.entity.CraftArmorStand " ?

tender shard
#

ofc

#

OBC still contains the package names, yes

long zephyr
#

and "net.minecraft.world.entity.decoration.ArmorStand"

#

?

tender shard
#

sure

long zephyr
#

xd

#

its not the org.bukkit.entity.Entity

odd wedge
tender shard
#

yes, org.bukkit.craftbukkit.v1_19_R1.entity.CraftArmorStand#getHandle returns net.minecraft.world.entity.decoration.ArmorStand. But org.bukkit.craftbukkit.v1_19_R1.entity.CraftArmorStand implements org.bukkit.entity.Entity and that exposes the teleport method, so you can treat any CraftArmorStand like a normal bukkit entity

ivory sleet
#

Yes, but I was just trying to imply the additional complexity Player as K type will provide

odd wedge
#

I mean it doesn’t really

tender shard
#

both works fine

ivory sleet
tender shard
#

no need to use CraftArmorStand when you only use interface methods

long zephyr
# tender shard

btw i'm doing that here armorStand.getClass().getMethod("teleport",Location.class).invoke(armorStand,aum);

ivory sleet
#

Because Player objects are much more fragile due to the state they need to encapsulate

tender shard
#

you can just do armorStand.teleport(aum)

long zephyr
#

armorStand is an Object

#

:c

#

private Object armorStand;

tender shard
#

then cast it to org.bukkit.entity.Entity

eternal oxide
#

Stop instancing it as an Object then

tender shard
#

if you want to go "for all versions", then using org.bukkit.craftbukkit... is the opposite of what you want lol

long zephyr
#

but org.bukkit.entity.Entity ? or net.minecraft.world.entity.Entity;

#

?

tender shard
#

bukkit

#

why do you have a CraftArmorStand in the first place?

long zephyr
#

so net.minecraft.world.entity.decoration.ArmorStand. But org.bukkit.craftbukkit.v1_19_R1.entity.CraftArmorStand into org.bukkit.entity.Entity ?

tender shard
#

the teleport method on org.bukkit.entity.Entity has been around since FOREVER

tender shard
#

EVERY org.bukkit.craftbukkit.v1_19_R1.entity.CraftArmorStand is also a org.bukkit.entity..ArmorStand

long zephyr
#

i didn't know it was possible

tender shard
#

I still think you're trolling, or maybe you watched a tutorial on youtube that's trolling

eternal oxide
#

too many tutorials and code suggestion from the IDE

long zephyr
tender shard
#

?paste your whole class pls

undone axleBOT
tender shard
#

You should always use the interface classes

#

they will work in all versions

#

no need for reflections and stuff

#

and an armorstand should (almost) never be stored as plain Object

#

but simply as bukkit (not craftbukkit) Entity or as bukkit ArmorStand

#

everything else is just making stuff overly complicated and/or slower

long zephyr
#

but then i should do for all versions to get compile well

tender shard
#

holy shit

brittle lily
#

?paste

undone axleBOT
quaint mantle
#

I made a plugin for myself that has a player death event listener. It has a config.yml file but i want to add a "❀️" emoji to show how much health the killer had left. But the plugin's default encoding cannot show that and shows some other random thing. How can i fix this?

eternal oxide
#

be sure you created/saved the config.yml with utf8 encoding

kindred valley
quaint mantle
#

Hey, rookie question but, does an item update in an inventory when you set the ItemMeta?

quaint mantle
dusk flicker
#

lol

brittle lily
#

?paste

undone axleBOT
quaint mantle
#

Hey, how can I show a block to only certain players?

#

The other players cannot see it

agile anvil
quaint mantle
#

Ah, so no need for packets

tender shard
#

yeah, no packets needed for this since 1.13 or so, I think πŸ™‚

brittle lily
#

?paste

undone axleBOT
quasi flint
#

Check if

#

The normal is null

#

Because if it is for some reason

#

U multiply 0 Β° 2

mystic sky
#

you can really improve that

meager trout
tardy delta
#

early returns

mystic sky
# meager trout how
A Java geek

A couple of years ago, I wrote a post focused on how to avoid sequences of if-else statements. In that post, I demo several alternatives: the usage of proper OOP designmapswhen there’s no return, switch statements in a case. Recently, I stumbled upon a slightly more complex use-case. This post describes it, and details what additional options ar...

fervent gate
#

https://paste.md-5.net/atuwexorag.cs

This is some code for a mob I'm working on but line 70 and 77 are just not doing anything. The variable sh is fine when I print it but it doesn't change the nametag.

eternal oxide
#

Early returns are best practice, however they are odd to get your head around. You are instinctively thinking "under what conditions SHOULD my code run" not "when should my code NOT run".

tardy delta
#

-Infinity 🀑

#

me trying to get rid of a field and fucking up other stuff

eternal oxide
#

yeah math hard there πŸ™‚

glossy venture
tardy delta
#

?

glossy venture
#

why dont u just store the value

tardy delta
#

too many if else statements to parse a double by iterating over the chars

#

so made a dedicated class

#

with some validation too

glossy venture
#

oh alr

#

so its for parsing?

tardy delta
#

kinda

glossy venture
#

u could do smth like

StringReader reader = new StringReader(source, 0);
String dstr = reader.collect(/* condition */ c -> isDigit(c) || c == '.', /* skip */ c -> c == '_');
double d = Double.parseDouble(dstr);
tardy delta
#

current logic to modify operands value

undone axleBOT
tardy delta
#

lol

glossy venture
#

how tf

tardy delta
#

a ghost

glossy venture
#

i didnt see anyone send a msg

#

yeah wtf

tardy delta
#

hmm lets just not try to overoptimize things

hasty obsidian
#

does anyone know how to like give something if a player kills someone else

#

cuz apparently playerDeathEvent doesn't work

quaint mantle
#

"doesn't work"

#

code?

limber owl
#

how do I add a server resourcepack to custom gui

tardy delta
#

items with a custom model data

#

meh had to change it

iron glade
#

This channel now called Development showcase

echo basalt
iron glade
#

What's that math project thing about ur working on? @tardy delta

limber owl
#

can I create custom gui, with custom model data and custom slots? it should look like your own inventory, but of another player

tardy delta
#

havent pushed a while tho

limber owl
#

I don't know, I know it should look something like this, but with cobblestone background and on the right shield and sword I think? (can I send pic in DMS?)

quaint mantle
#

u can send here

limber owl
#

I can't, I'm not verified because no staff wants to unverify my account on spigot

#

sent

shadow night
#

what packet is sent to the server when the client gets info about it and how do I modify the info it sends from the plugin?

limber owl
#

it should look like this

#

yea, knew it would be something like this

agile anvil
#

You can do it using resource pack

#

but this one is tricky

limber owl
#

wait, can't I just retexture the chest gui?

tardy delta
#

yes

agile anvil
#

those are just hidden slots

agile anvil
eternal night
#

mcc

quaint mantle
limber owl
#

I think if I use normal chest, retexture it using resourcepack, an put the head as head item, and on the right the shield and on leaft armor

agile anvil
shadow night
agile anvil
#

The server sends a lot of info

shadow night
agile anvil
#

Yes you can change it, use a packet wrapper like ProtocolLIB and change those fields

shadow night
agile anvil
#

But you'll need to do some InventoryClickEvent listening to avoid them using some slots

limber owl
#

thats no problem

shadow night
eternal night
#

why would you use the ping format for non minecraft clients πŸ€”

shadow night
eternal night
#

yea but why not just expose a proper API for that from the server

#

instead of hijacking the minecraft port

shadow night
agile anvil
shadow night
agile anvil
#

As you read, it's strict

#

The client reads specific fields

#

Adding a field or removing one will consider the server as broken

shadow night
#

break-your-server plugin

long zephyr
#

hello ^^
Does anyone know how to avoid the shaking of the
ArmorStand when being teleported?
https://www.youtube.com/watch?v=M1rERVWm2Oo

new BukkitRunnable() {
            @Override
            public void run() {
                teleportArmorStand();
            }
        }.runTaskTimerAsynchronously(plugin,0,1).getTaskId();

public void teleportArmorStand() {
        double y = maxY - teleportValue();
        Location location = entity.getLocation().add(0,y ,0);
        teleport(location);
        teleportEntity(((CraftArmorStand)armorStand).getHandle());
    }

private void teleportEntity(Entity handle){
        ClientboundTeleportEntityPacket teleportEntityPacket = new ClientboundTeleportEntityPacket(handle);
        sendPacket(teleportEntityPacket,player);
    }
public void teleport(Location aum){
        armorStand.teleport(aum);
    }
agile anvil
quaint mantle
#

just don't have servers

agile anvil
eternal oxide
#

why are you teleporting AND sending a teleport packet?

long zephyr
eternal oxide
#

Doesn;t matter. you don;t need the packets at all

#

you are calling Bukkits teleport, you don;t need any NMS

long zephyr
#

yep if i dont send the packet the armorStand dont change the position in the client

#

:(

eternal oxide
#

yes it will

long zephyr
#

i did it and it doesn't :C

eternal oxide
#

It will unless you did something wrong. It can;t fail to update the client.

#

I will test

molten hearth
#

uh does anyone have experience using git, say I changed 5 files from a repo from my knowledge I should create a pull request and not just commit them right?

quaint mantle
#

uhm do I have to wait for his problem to be solved to post my problem?

molten hearth
#

but dont I need to make a whole branch on their repo to create a pull request? πŸ€”

long zephyr
#
ArmorStand entity_armorstand =  new ArmorStand(EntityType.ARMOR_STAND, (Level) worldServer);
            armorStand = (org.bukkit.entity.ArmorStand) entity_armorstand.getBukkitEntity();

//so i send this packets
private void packetsCraftItem(Entity craft, int id) {
        ClientboundAddEntityPacket clientboundAddEntityPacket = new ClientboundAddEntityPacket(craft);

        packetMetaData(craft,id);
        sendPacket(clientboundAddEntityPacket);


    }
agile anvil
agile anvil
quaint mantle
#
public class HandlerOfEvents implements Listener {

    @EventHandler
    public void death(PlayerDeathEvent event) {
        if(event.getEntity().getLastDamageCause().getCause().toString().equals("end_crystal")) {
            event.getEntity().sendMessage(event.getEntity().getKiller() + " Killed you with an end crystal");
        }
    }

}

I'm trying to detect whenever you die from an end crystal and get whoever killed them

molten hearth
#

is there any way to do that after I just git cloned the repo and edited it

agile anvil
quaint mantle
#

idk

#

i tried other things would nothing works

agile anvil
quaint mantle
#

i know

#

i accidently forgot to save code from last night

agile anvil
#

Then when you find the cause name

quaint mantle
#

k

#

i'll do that

#

k

agile anvil
#

What context ?

quaint mantle
#

but how do I get the killer?

molten hearth
agile anvil
quaint mantle
#

should I do this?

@EventHandler
    public void death(PlayerDeathEvent event) {
        event.getEntity().sendMessage(event.getEntity().getPlayer().getKiller().toString() + " & " + event.getEntity().getLastDamageCause().getCause());
    }
tardy delta
#

smh

agile anvil
long zephyr
quaint mantle
#

brb

agile anvil
quaint mantle
#

back

agile anvil
#

or maybe teleporting the armorstand on the playermoveevent but I'm not sure about that

long zephyr
quaint mantle
cobalt tinsel
#

hi

#

which is the number for the healing potion?

eternal night
#

number ?

cobalt tinsel
#

yeah like

quaint mantle
#

i think they mean the id

cobalt tinsel
#

to make the Material.POTION

#

a healing one

eternal night
#

you'd use this method

cobalt tinsel
#

api 1.8 πŸ˜…

eternal night
#

bruh

swift dew
#

is there any way to use a plugin coded in the deobfuscated spigot(nms)?

cobalt tinsel
#

yeahhhhhh :p

eternal oxide
#

?paste

undone axleBOT
eternal night
#

I presume

eternal oxide
#

@long zephyr The stand teleports and moves just fine using only Bukkit teleport. It will only update location 20 times a second as thats the max tick rate. https://paste.md-5.net/ofejiwozod.java

cobalt tinsel
#

pot.setMainEffect(PotionEffectType.HEAL);

heavy swan
#

What version of spigot do I need for my plugin to work for all versions of minecraft?

eternal oxide
#

You build against the oldest version of Spigot you want your plugin to work on

#

and set the API version in the plugin.yml if you are going back a long way so it can understand legacy Materials

heavy swan
#

I want the plugin to work from 1.8 to 1.18 which api should I use more recommended for a 1.8 server?

eternal oxide
#

if you want it to work on 1.8 then 1.8

tardy delta
#

ah a switch doesnt work on a null value :/

eternal oxide
#

not at all or will it fall through to default?

tardy delta
eternal oxide
#

java 18 supports it

eternal night
#

by not using inheritance

tardy delta
#

on java 17 smh

eternal night
#

well that makes no sense xD

#

an object is an object

onyx fjord
#

can i do something more with actionbar than just sending it without any params?

#

(i mean stuff like title that has fade times)

eternal night
#

Well what you want is composition

#

if you want to pass Test2 to Test as a form of "parent"

eternal oxide
#

or implement cloneable

quiet ice
#

no

#

Unless you mean something really differently, the sematics of such code cannot be replicated at all

#

Yeah, then make super have a constructor that takes in an instance of itself to copy the values

#

how would it not work?

tardy delta
#
public SuperClass(SuperClass other) {
  this.smth = other.smth;
  // etc
}```
#

ez

quiet ice
#

If you are a fan of reflections you could use that, but I'd not use that

#

And I am sure that lombok has an annotation for that, but similarly I'd not do that

safe hatch
#

how can I display text above players head. Like how much hearts this player has or something like that

quiet ice
#

its not about liking but also performance along other things

quiet ice
#

not slow, just slower

long zephyr
#

ty i'll check what you did, ty <3

wet breach
quaint mantle
#

Does TextComponent exist in 1.8.8 spigot?
Should I import it through net.md_5.bungee.api.chat.TextComponent or java.awt.TextComponent?

#

ohh wait i can't show action bars in 1.8?

quiet ice
#

java.awt.TextComponent is in the awt package - which like the JFX and swing packages is strictly forbidden to use in spigot

#

While you can use it, it is likely that you shouldn't

untold monolith
#

good, by any chance can you change the name of the spigot website?
if so, how would it be?

quaint mantle
#

Hmm. So, how do I show action bars in 1.8.8?

tardy delta
#

meh i thought you could do Node::token but no thats a method reference

iron glade
#

not really

tall dragon
tardy delta
#

good ol' reflection

torpid sapphire
#

does anyone have a clue why Inventory#setItem doesnt remove the item from a slot? java if (event.getClickedInventory() instanceof AnvilInventory inv) { ItemStack clickedItem = event.getCurrentItem(); if (clickedItem != null && clickedItem.getType() == Material.DIAMOND && event.getSlot() == 2) { event.getView().setCursor(clickedItem); inv.setItem(2, null); } }

untold monolith
#

Or am I supposed to donate for the name change? If so, where did you donate and to whom did you inform?

low condor
tall dragon
#

donations are processed manually, might take a few days

torpid sapphire
#

tried that

#

didnt work either

iron glade
#

that's weird

torpid sapphire
#

i mean its the output slot of an anvil i dont think it really likes that

iron glade
#

use #remove

#

maybe this works

torpid sapphire
#

so remove(clickedItem)

iron glade
#

ye

torpid sapphire
#

same thing

#

doesnt wanna remove it

tall dragon
#

idk what ur tryna do but i think you need to use AnvilPrepareEvent

#

and use #setResult

iron glade
tall dragon
#

well wat u tryna do

iron glade
#

Or you can't, idk

torpid sapphire
#

im adding a second item to the output slot after you take the first one out

iron glade
#

Anvils are weird

torpid sapphire
#

its janky ik but i need it to work

tall dragon
#

you might as well create a custom anvil then..

#

would work much cleaner

iron glade
#

I think u have to also replace the input slot then

torpid sapphire
#

thats what i thought too but how am i supposed to do the text input

iron glade
#

could use chat

torpid sapphire
#

or make a completely custom anvil block and use that for repairs, and the default one for combining and renaming

#

cause i just need this for repairs

grizzled owl
#

can i implement vault economy without downloading external plugins like essentials?

quaint mantle
#

yes

humble tulip
#

Yes

#

It doesn't update

grizzled owl
#

i added vault api and it still throws Disabled due to no Vault dependency found! (i have depend vault in plugin yml and vault installed), how can i fix that

humble tulip
#

Objects aren't stored in the hashmap

#

Just a reference to it

#

It does