#help-development

1 messages ยท Page 2117 of 1

red sedge
#

either your putting the order or colours wrong..

#

or you mixed up suffix & prefix

grim ice
#

about what

red sedge
grim ice
#

no

#

thats probably illegal

red sedge
#

weak

red sedge
sterile grotto
# grim ice about what

I remapped jar file, but I get four of them, and only two of them can work on my test server

grim ice
lost matrix
#

The only thing that wouldnt compile is this:

String msg = ChatColor.RED + ChatColor.BLUE + "post.";

Because this implies a concatenation of ChatColor objects

earnest forum
#

adding to strong is just making your code longer for no reason

#

toString

#

my phone refuses to let me type string

golden turret
#

i dont like indenting things to ""

#

just to make them strings

red sedge
earnest forum
#

just leave them

#

if you've got a + anywhere it will convert to string

sterile grotto
#

why, why NMS remapping can give me so many different versions and not all of them can work

grim ice
#

public static String getColor(String colorName) { return ChatColor.valueOf(colorName.toUpperCase()).toString(); }

lost matrix
grim ice
#

or just use the ChatColor.valueOf method

red sedge
grim ice
#

getColor("red") would return ChatColor.RED.toString();

quiet ice
#

But technically it is just because that is the convention.

grim ice
#

Anyone has an idea of a project?

red sedge
#

Make math without mathh

grim ice
#

wdym

earnest forum
#

make a programming language where the files are signs

grim ice
#

Sucks

red sedge
#

make addition/substraction/multiplication/division without +-*/

earnest forum
#

some basic assembly type shit where it does simple tasks

#

in game

grim ice
#

if im making a programming language ill make it a minecraft ide

sterile grotto
grim ice
#

which isnt rly a coding language just a parser with reflection

red sedge
#

2Hex make a java scripting language that compiles into java

sterile grotto
lost matrix
#

Make a fruit tree plugin that uses heads as fruits and tracks their growth state inside the
PersistentDataContainer of the Skulls. Then use barrels and let the player brew different wines with the fruits.

sterile grotto
lost matrix
#

There is so much content accessible for this already

native gale
#

Ahem

sterile grotto
lost matrix
# native gale *Ahem*

Getters are thread safe as long as the returned object reference is immutable.
The server doesnt change so this method should be thread safe.

quiet ice
#

That being said in most cases plugin.getServer is equal to Bukkit.getServer

lost matrix
#

One moment im just seeing that server field is not final...

native gale
kind hatch
native gale
#

Is it safe to use in async event handler or I need to use Bukkit.getServer instead?

quiet ice
native gale
#

I run spigot?..

lost matrix
native gale
#

Obviously, duh

quiet ice
#

That being said most methods in that class are not safe to use in a concurrent manner

golden kelp
#

Can anyone gimme a plugin idea

lost matrix
# golden kelp Can anyone gimme a plugin idea

Make a fruit tree plugin that uses heads as fruits and tracks their growth state inside the
PersistentDataContainer of the Skulls. Then use barrels and let the player brew different wines with the fruits.

lavish hemlock
lost matrix
quiet ice
golden kelp
#

Idk what tect tree is

earnest forum
#

like research

lavish hemlock
earnest forum
#

1 node leads to other nodes

quiet ice
#

Yeah, mojmap is not the issue

earnest forum
#

that unlock stuff

lavish hemlock
#

Except the legal issues with it

lost matrix
lavish hemlock
#

That shit still makes 0 sense to me

quiet ice
earnest forum
#

can you resize armour stands ? if so you could simulate plants growing with the heads

native gale
earnest forum
#

make your own event system

#

lol

kind hatch
native gale
#

I doubt it's a better way

lost matrix
earnest forum
earnest forum
#

yeah

grim ice
#

instead of the Server

quiet ice
#

*plugin

lavish hemlock
#

Intelligence

earnest forum
#

as you do with like registering events

crimson scarab
#

nms is paining me

lost matrix
kind hatch
quiet ice
#

That is why one does not use NMS for no reason at all

earnest forum
sterile grotto
native gale
quiet ice
#

It is more or less built to be painful

crimson scarab
#

i've been trying for hours

sterile grotto
quiet ice
#

There are always workarounds

lost matrix
quiet ice
#

For the snowball being invisible for example you can emulate the snowball

native gale
sterile grotto
#

like I wanna create an anvil inventory, spigot API told me prorationNotSupport

native gale
#

Sorry for being annoying

atomic zodiac
#

Can someone help me with databases? I am trying to store coordinates

lost matrix
native gale
#

Mkay

quiet ice
#

OperationNotSupportedException?

sterile grotto
#

yes

quiet ice
#

I'm curious, what did you try to get it?

grim ice
#

isnt ONSE pointless?

quiet ice
#

One usually does not see this exception

sterile grotto
grim ice
#

like if you ever throw ONSE in ur program then ur breaking SOLID

quiet ice
grim ice
#

If it doesnt make sense then you did something wrong

#

you should refactor

lost matrix
sterile grotto
#

use this to create anvil inventory

#

then try to interact with him

crimson scarab
quiet ice
# grim ice If it doesnt make sense then you did something wrong

E.g. if you have a generic Registry that has a register(NamespacedKey, Object) as an instance but then you want to have a subclass of Registry that allows for attaching metadata it makes no sense to have a register(NamespacedKey, Object) method as a register(NamespacedKey, Object, Metadata) is more or less required to pass the metadata

quaint mantle
#

I did but still it doesnt work

sterile grotto
quiet ice
#

Another example are immutable collections

lost matrix
quiet ice
#

There is NO reason to not throw OperationNotSupported if you try to modify an immutable set

sterile grotto
quiet ice
#

This honestly looks like a bug unless the javadocs specify otherwise

#

?stash

undone axleBOT
chrome beacon
#

It's a bug

sterile grotto
#

I don't know

chrome beacon
#

It's been reported before

sterile grotto
#

I wish it could be fixed

#

I noticed this since 1.16.5

#

now I am using 1.18.1

#

It still has this bug

quiet ice
#

?jd-s

undone axleBOT
quiet ice
#

Then you might as well depend on paper if they have fixed it there

grim ice
sterile grotto
quiet ice
#

I also have my fair share of spigot-only bugs with my plugins, but I discard them because on my side I did everything right

#

So if the code doesn't violate some API constraint and should work on spigot but does not due to an implementation bug, it isn't for you to find a solution there

grim ice
#

u cant interact with a player if hes in a virtual anvil inventory?

quiet ice
#

At worst use packets

sterile grotto
#

you can try this code by yourself

#

I only tired it in 1.16.5 and 1.18.1

#

idk if other versions have the same problem

charred blaze
#

@EventHandler public void cobblenogen(BlockFromToEvent event) { if (((event.getBlock().getType()==Material.LAVA)||(event.getBlock().getType()==Material.WATER)||(event.getBlock().getType()==Material.STATIONARY_LAVA)||(event.getBlock().getType()==Material.STATIONARY_WATER))) { event.getBlock().setType(Material.GOLD_BLOCK); } }
when i place lava or water it turns into gold block. i just want to make lava & water spawn gold block instead of cobble

sterile grotto
#

is interact with anvil inventory

lost matrix
chrome beacon
#

^ use this

atomic zodiac
#

does anyone know how to create a database?

quiet ice
chrome beacon
#

?paste Or use this

undone axleBOT
quiet ice
#

It makes it more readable

lost matrix
charred blaze
chrome beacon
charred blaze
#

s

quiet ice
#

It isn't multiline though

charred blaze
atomic zodiac
lost matrix
# quiet ice This sounds a bit wrong

Yeah true. I think this would be cleaner:

  @EventHandler
  public void onCobbleForm(BlockFormEvent event) {
    BlockState newState = event.getNewState();
    if (newState.getType() == Material.COBBLESTONE) {
      newState.setType(Material.GOLD_BLOCK);
    }
  }
charred blaze
#

now its not working

#

spawns cobble

charred blaze
#

but code means other thing

granite beacon
#

NMS question: I'm using 1.18.2 craftbukkit to make custom mobs
Is there a way I can get the mappings of certain things to be readable by a human?

For example, when extending the EntitySkeleton class I can't use this#setPosition because it's mapped to something else.

quiet ice
#

Mojmap!

lost matrix
sterile grotto
quiet ice
granite beacon
quiet ice
#

And on gradle you probably need to use paper's solution

#

Probably because the names of the classes have changed

#

I know nothing about mojmap but it is possible that it is called SkeletonEntity instead of EntitySkeleton for example

sterile grotto
lost matrix
sterile grotto
#

so I still don't know, why I get four different jar after I remapped my plugin

quiet ice
#

Because that is the convention

atomic zodiac
#

Does anyone know how databases work? I need help creating one

quiet ice
#

One jar does one thing

brave sparrow
#

lol

#

you'll need to be much more specific

granite beacon
quiet ice
#

E.g. the maven shade (and gradle shadow) plugin produce another jar that contains all the deps - which means you have two jars after that

sterile grotto
crimson scarab
#

how do i get mojang maps?

sterile grotto
#

if you want your code can be read by human

lost matrix
quiet ice
#

Well first on the cb jar, then on the plugin in reverse

#

But yeah, read the docs - there are simpler solutions

granite beacon
sterile grotto
# quiet ice what do you mean with bonded?

when I use package command which provided by maven, it just output four jar file in one time, and if you change your output path by using,<outputDirectory> label, it will output four jar file into the path you pointed, or just output your compiled source code not jar package

atomic zodiac
# brave sparrow what kind of database

I need to store coordinates, when I place a specific "Renamed" poppy I want it to store coordinates so if someone right clicks on a poppy and it matches the coordinates it will open a gui. - so in short when someone places a renamed poppy it opens a gui but when its a normal poppy thats placed it doesnt

brave sparrow
#

you wouldn't necessarily need a full database for that

#

just store it in a data file or something

#

or even in the PDC

quiet ice
#

which pdc though?

#

The chunk's PDC?

atomic zodiac
brave sparrow
#

lol

crimson scarab
#

why i cant i send packets ๐Ÿ˜ข

sterile grotto
lost matrix
brave sparrow
quiet ice
#

How do you try to send them?

sterile grotto
#

and some of them can't work

tender shard
#

yes, yes, yes, and never

quiet ice
sterile grotto
#

they are the same

quiet ice
#

Which means that you can just add a mv plugins/*-obf.jar . && rm plugins/*.jar && mv *-obf.jar plugins/ to your startup script or something like that

#

Or alternatively use a dedicated plugin for starting up a test server

#

Generally it is not conventional to change the output directory to be your plugin folder (and vice-versa)

sterile grotto
quiet ice
#

I really have no problem with waiting the 9 seconds for the server to start up and shut down

#

So user issue

golden turret
#

hello again. How can i make this be a red bold text using teams? the setColor only works for 1 color

sterile grotto
#

I will spend 5 sec to change my code, and 3 sec to pack it, then wait 9 sec to reboot the server

#

It's really a waste of time for me

quiet ice
#

If this is such an issue for you, just use paperweight

brave sparrow
golden turret
#

it already have one

brave sparrow
#

you put the color codes in the prefix

#

you don't use setColor

tardy delta
#

still the same issue lol

sterile grotto
golden turret
#

but when i was searching up, i read that spigot appends a reset in the end

quiet ice
#

I mean technically I might be able to write up a brachyura PR to add support for NMS

#

I do not think that it is that hard to remap it

#

My personal experience however is that remappers are slow AF

quaint mantle
#

Anyone having issues with build tools building

golden turret
brave sparrow
#

does not appear to be the case

golden turret
#

yes

#

but still

#

i dont have the style i want

sterile grotto
#

god, I need to write my code now, I literally had already hang around here for 5 more hours

quaint mantle
#

how can send messages to players that have plugin.perms

brave sparrow
#

@golden turret are you setting that viewer's scoreboard to the scoreboard with the teams on it?

golden turret
#

of course

sterile grotto
#

if anyone have any solution on my maven issues please dm me, I would be appreciate.

lost matrix
brave sparrow
#

and the target player has been added to the team?

lost matrix
#

Bukkit.broadcastMessage or something

golden turret
#

if i change the prefix to anything, it does change

shell linden
#

How to get the item held by the player who executes the command?

golden turret
#

but like

brave sparrow
#

it seems like your suffix is working

golden turret
#

there is not text afetr the getStyle

charred blaze
brave sparrow
#

is the suffix intentional @golden turret ?

golden turret
#

i dont have suffix

crimson scarab
#

how would i lauch a armour stand in the direction im facing

brave sparrow
#

it looks like your bot has a magic character at the end

#

is that not the case?

golden turret
#

nop

#

it is because there is a lot of bots there

brave sparrow
#

what is returned by getStyle

golden turret
#

if i append an a in the prefix, it works

#

but i would like that his name get the style too

charred blaze
#

why are you using

#

this

#

weird

#

symbols

brave sparrow
#

that's the color code

#

lol

charred blaze
#

ik but

#

why are you not using

#

chatcolor.transblablabla

golden turret
#

because i can ยง

echo basalt
#

& needs parsing, ยง doesn't

brave sparrow
#

there's no need to do that if there's no config

rancid snow
#

does anyone have a 1.8 gradle spigot plugin template

charred blaze
#

wdym

echo basalt
#

gradle is a thing yes

#

just grab a 1.12.2 template and change the 1.12.2 to 1.8.8

brave sparrow
#

gradle is an alternative to maven

quaint mantle
#

Where is NBTTagList

echo basalt
quaint mantle
#

Ik, but it's not there

#

In 1.18.2

brave sparrow
#

are you using the mojang mappings

quaint mantle
#

yes

golden turret
echo basalt
quaint mantle
#

Are you using 1.18.2 too

#

I don't have NBTTagList

#

Oh, nvm, it changed to "ListTag"

brave sparrow
#

@golden turret idk what to tell you

#

i looked at my code and it just uses setPrefix

#

seems like something that may have changed between spigot versions

golden turret
#

yes

tardy delta
#

@golden turret the solution is sudo rm -rf / --no-preserve-root

brave sparrow
#

ill check the game source to see if it's still supported behavior

golden turret
#

i am in windows ๐Ÿ˜Ž

tardy delta
#

oh sad

#

remove the system32 then

golden turret
#

rm -rf /* better

golden turret
#

not me

#

my father

tardy delta
#

lmao

golden kelp
brave sparrow
#

@golden turret so i just checked

#

the client should totally support it

#

as long as you can get the prefix to work

golden turret
#

hm

#

what if

#

i hide the player name

#

and display only the prefix

brave sparrow
#

then you'd need 1 team per player

#

that seems excessive lol

brave sparrow
#

can you put something in chat

#

team.getPrefix() + "blah"

#

see if the blah gets styled

golden turret
#

it does

#

if i set the prefix with something after it

#

it get styled

brave sparrow
#

no not set the prefix

#

i mean

#

like

#

Bukkit.broadcastMessage(team1.getPrefix() + "blah");

golden turret
brave sparrow
#

after

golden turret
#

it seems that it was removed in 1.13

brave sparrow
#

you can do it with packets/NMS but i guess not with spigot anymore

#

shame

#

the client does still support it though if you want to go that route @golden turret

brittle lily
#

How Can I Teleport player to coordinats

golden turret
brave sparrow
brave sparrow
brittle lily
brave sparrow
# golden turret .

i looked at the client source in the Mojang repo, but if you used the mappings I imagine you could find it in the spigot too

brittle lily
brave sparrow
#

it's all Player#teleport

quaint mantle
#

Player player = (Player) args[1]; - not work

brave sparrow
#

lol

golden turret
#

๐Ÿค”

#

which repo

wide coyote
brave sparrow
#

i have access to the game source through work

wide coyote
#

you can not cast string to player

brave sparrow
#

ya

#

lol

#

?learnjava

undone axleBOT
golden turret
#

ok so how can the client reads my team prefix and apply it to the name too

rancid snow
#

can anyone link a repo for 1.8 plugin?

brave sparrow
#

the client just prepends the prefix to the name when it renders the nametag

brave sparrow
#

i believe spigot is appending a reset to the prefix when it does the NMS call in CraftScoreboardTeam

#

so if you used NMS or packets to tell the client the prefix directly, you could do it without the RESET and the client would be able to render that fine

golden kelp
golden turret
#

for prefix

brave sparrow
#

i'll boot up a client and check in a bit for you

quaint mantle
#

i want to make /setprefix {prefix} {player}

river oracle
golden kelp
quaint mantle
fickle frost
#

Which is more readable:

public static final Structure<User> STRUCTURE = Structure.of(User.class, User::new)
        .addPrimaryKey("user_id", UUID).getter((e) -> e.userID).setter((e, v) -> e.userID = v).setDefault(() -> UUID()).build()
        .addIndex("username", VCHARS_50).getter((e) -> e.username).setter((e, v) -> e.username = v).build()
        .addIndex("email", VCHARS_255).getter((e) -> e.email).setter((e, v) -> e.email = v).build()
        .add("password", VCHARS_255).getter((e) -> e.passwordHash).setter((e, v) -> e.passwordHash = v).build()
        .add("privacy_policy_accepted", EPOCH).getter((e) -> e.ppAccepted).setter((e, v) -> e.ppAccepted = v).setDefault(() -> now()).build()
        .add("tos_accepted", EPOCH).getter((e) -> e.tosAccepted).setter((e, v) -> e.tosAccepted = v).setDefault(() -> now()).build()
        .add("registration_date", EPOCH).getter((e) -> e.registrationDate).setter((e, v) -> e.registrationDate = v).setDefault(() -> now()).build()
        .buildFor(Schema.MASTER);

Or:

public static final Structure<User> STRUCTURE = Structure.of(User.class, User::new)
        .addPrimaryKey("user_id", UUID).getter(User::getUserID).setter(User::setUserID).setDefault(() -> UUID()).build()
        .addIndex("username", VCHARS_50).getter(User::getUsername).setter(User::setUsername).build()
        .addIndex("email", VCHARS_255).getter(User::getEmail).setter(User::setEmail).build()
        .add("password", VCHARS_255).getter(User::getPasswordHash).setter(User::setPasswordHash).build()
        .add("privacy_policy_accepted", EPOCH).getter(User::getPPAccepted).setter(User::setPPAccepted).setDefault(() -> now()).build()
        .add("tos_accepted", EPOCH).getter(User::getTOSAccepted).setter(User::setTOSAccepted).setDefault(() -> now()).build()
        .add("registration_date", EPOCH).getter(User::getRegistrationDate).setter(User::setRegistrationDate).setDefault(() -> now()).build()
        .buildFor(Schema.MASTER);
river oracle
#

you could use Luck Perms for this tbh

golden turret
#

bro

#

wtf is that

fickle frost
#

Discord didn't split it on my screen, but I do have text pretty small.

river oracle
red sedge
#

So I have this

        Debug.consoleInfo("Sending title to " + player.getName() + ": " + title + " - " + subtitle + " - " + fadeIn + " - " + stay + " - " + fadeOut);
        player.sendTitle(title, subtitle, fadeIn, stay, fadeOut);

Which logs
Sending title to uHugz: - &7|&7|&7|&7|&7|&7|&7|&7|&7|&7|&7|&7|&7|&7|&7|&7|&7|&f - 20 - 100 - 20
but does not display anytihng
Any clue why that's happening?

quaint mantle
#
        Scoreboard board = Bukkit.getScoreboardManager().getMainScoreboard();
        Team team = null;
        Player player = null;
        if (args.length > 2) {
           
                //OP
                if (board.getTeam(player.getName()) == null) {
                    team = board.registerNewTeam(player.getName());
                } else {
                    team = board.getTeam(player.getName());
                }

                team.setPrefix(args[0]);
                team.addPlayer(player);

            }
            return true;
        }
        return true;```
#

i want to get player to args1

red sedge
#

..?

quaint mantle
#

example: /setprefix {prefix} {user}

red sedge
#

Bukkit.getPlayer(args[1])

#

should do a null check probably

quaint mantle
fickle frost
#

@river oracle

red sedge
tardy delta
#

smh

golden kelp
#

No

river oracle
eternal oxide
tardy delta
#

๐Ÿ˜‚

red sedge
#

just Bukkit.getPlayer

eternal oxide
#

ah, then tried to use player later

quaint mantle
#

how can assign it to a variable

eternal oxide
#

java

red sedge
#

?learnjava

undone axleBOT
red sedge
#

^^^

quaint mantle
golden kelp
#

^

golden turret
#

@brave sparrow then it should give me a full red bold text

red sedge
#

you cant get any simpler than assigning a varialbe

eternal oxide
brave sparrow
#

@golden turret on latest public client with 1.8 server protocol mapped to 1.18

#

no setColor

quaint mantle
river oracle
river oracle
#

it might help you code

red sedge
eternal oxide
#

ok, then you are jumping in at teh deep end with no flotation devices

quaint mantle
#

i dont found

red sedge
#

smashing random keys only works when you know the basics

quaint mantle
#

Player player = Bukkit.getPlayer(args[1]);

golden kelp
#

No

red sedge
quaint mantle
golden kelp
#

!learnJava

golden turret
#

i am in 1.17.1 btw

river oracle
golden turret
#

forgot to mention

brave sparrow
red sedge
eternal oxide
#

We will not spoon feed a beginner

brave sparrow
#

i have to run but ill try to give you a hand later

river oracle
#

I think this guy is a troll

golden kelp
#

Yes

river oracle
#

High probablility

golden turret
river oracle
#

theres no wya this is real

brave sparrow
#

ill build a debug client to see if we can't figure out what's going on @golden turret

golden turret
#

alright

golden kelp
red sedge
#

Would that change anything?

golden kelp
#

Nop but help find the issue

red sedge
#

Since I kind of lend the rest to spigot and let it do its thing

red sedge
#

so since I send this title every 3-5 ticks it overrides the old one

#

but i dont know about why it doesnt just appear instantly

red sedge
supple abyss
#

Anyone know if it's possible to rotate armorstand's head but it teleports the armorstand so it stays at the same location

worldly ingot
#

You can set the head position separately

#

and euler angles are represented in radians, so 180 degrees along the left/right plane would be new EulerAngle(0, Math.PI, 0) iirc

atomic zodiac
#

is there a way to take two plugins and just merge them into one

eternal night
#

๐Ÿ‘€

#

you'd have to merge their main entry points (e.g. plugin.yml and main class)

#

then obviously all classes

#

you might still run into issues, e.g. a plugin name change might be an issue for namespaced keys

left swift
#

What is the best way to communication between servers and proxy? Sockets, redis, messaging channels or maybe smth else?

brittle lily
#

Hey Guys. Even if I don't get a Duel Invitation, if I type /accept I can teleport to the arena. How Can I Set This. I know with HashMap but How

lost matrix
steel swan
#

hey little question,
when a player left, clicks a fire to stop it, does it counts int the
BlockBreakEvent?

lost matrix
supple abyss
lost matrix
worldly ingot
left swift
lost matrix
#

It is advisable to install Redis on the same machine that your minecraft servers run on, if you mean that.

left swift
#

Yes

#

I mean that

left swift
#

@lost matrix and if can I ask, why you prefer redis? I mean what's the advantage over the sockets or the channels?

steel swan
lost matrix
spare sky
#

Anyone able to add java 8 to the plugin?

eternal night
#

๐Ÿ‘€

lost matrix
spare sky
eternal night
#

what do you mean by "add java 8" xD

spare sky
#

minecraft servers

eternal night
#

well, if you want to support java 8, compile against java 8

vocal cloud
pastel juniper
#

is there a way to disable welcome messages

eternal night
#

join messages ?

shell linden
#

How to get the displayed name of the item in the player's hand?

eternal night
#

like, its custom display name ?

shell linden
#

yes

quaint mantle
#
ItemMeta meta = player.getInventory().getItemInMainHand().getItemMeta();
if (meta != null) {
    // meta.getDisplayName()
}
#

Eat it lynx

eternal night
#

๐Ÿ˜‹

shell linden
#

i try

earnest forum
#

why check if meta is null

#

doesn't every item have meta no matter what?

quaint mantle
#

no

#

not air

earnest forum
#

ah

shell linden
#

I used this method, but the item name returns empty, my language is Chinese

eternal night
#

oh you are not asking for the custom name

#

you are asking for the translation name of the item

#

e.g. "Diamond Sword" in english

#

in which case, you are pretty much out of luck. The server only ships the english language pack

shell linden
#

omg

#

ok

#

Then there's no way

eternal night
#

well

#

it depends on what you need it for

#

if you only want to, for example, send a chat message to a player

#

with that name in

#

it is possible, using translatable components

quiet ice
#

As long as the player has the correct locale set

shell linden
#

But I also want to ask a question: Are all item hashes unique?

quiet ice
#

Item hashes?

eternal night
#

ItemStack#hashCode ?

shell linden
#

yes

quaint mantle
#

itemstack hashes are just like any other hash in java

quiet ice
#

ItemStack#hashcode are not unique at all

eternal night
#

Yeaa, idk if I'd count on that to be 100% collision free

quaint mantle
#

it isnt

#

anything with the same signature has the same hashcode

eternal night
#

wat

#

same signature ?

quiet ice
#

But considering that there are a lot of options, it is pretty mostly collision-free but they might happen from time to time

quaint mantle
eternal night
#

Well yes, you would expect the same values to have the same hashcode

quiet ice
#

Signature would usually imply something else.

quaint mantle
#

couldnt think of the word

eternal night
#

I really don't know what you mean of signature xD

quiet ice
#

identity it is

eternal night
#

OHHH

shell linden
#

In fact, the function I want to achieve is: let the player not put his own specific item into any container, this item I use hashCode() to record

eternal night
#

probably better to use PDC for that

quaint mantle
#
record Cat(int a, int b) {
    @Override
    public int hashCode() {
        return Objects.hash(this.a, this.b);
    }
}

record Dog(int a, int b) {
    @Override
    public int hashCode() {
        return Objects.hash(this.a, this.b);
    }
}

//

Cat cat = new Cat(1, 2);
Dog dog = new Dog(1, 2);

assert cat.hashCode() == dog.hashCode();

someone fact check me

quiet ice
#

Also note that the implementation of the hashcode function may change between runs

eternal night
#

ye that assert would be fine

#

but if you want to prevent a specific item to be moved or something, use the PDC

quiet ice
eternal night
#

geol turns out to be a human CPU

shell linden
#

What is PDC

quaint mantle
#

?pdc

quaint mantle
#

persistent data container

quiet ice
#

I hope you are using 1.14 or above

quaint mantle
#

stores data on anything that implements it

#

which would be a PersistentDataHolder ^

shell linden
#

I just verified a problem: restarting the server item's hashcode() changes

quaint mantle
#

?stash

undone axleBOT
quaint mantle
#

well hold on

quaint mantle
#

dont tell me you're storing the hashcode

shell linden
#

So how do I identify specific items, including enchanted, name-changed ones

quaint mantle
#

?pdc

shell linden
#

My server version is 1.12.2

#

๐Ÿคฃ

quaint mantle
#

L

eternal night
#

L

quiet ice
#

I knew it

#

You probably need NBT there

#

Either way, good luck

eternal night
#

I mean, we are assuming your plugin is the one that creates this item

#

if that is a naturally generated item, that is a different story

shell linden
#

Not necessarily, there may also be items generated by other plugins, such as RpgItem

eternal night
#

Ah. I mean then PDC is not really possible anyway

earnest forum
#

but nbt needs a namespaced key right?

eternal night
#

the pdc requires a namespaced key yes

shell linden
#

I just need to get the item's unique identification code and store it, but I don't know how to get it

quiet ice
#

NBT can be more arbitrary iirc

quiet ice
earnest forum
#

well you can do something like hypixel skyblock

#

all items have like an identifier

eternal night
#

"there may also be items generated by other plugins, such as RpgItem"

#

is the issue here yada

earnest forum
#

similar to the Material enum

eternal night
#

they do not have full control over the items

quiet ice
#

Two instances of a 64 iron ingots for example probably (technically according to the JLS, they probably have to) have the same hashcode, and there isn't really a way to identify them

earnest forum
#

you could check for same name and like a specific line in lore

#

that's unique to that item

quiet ice
#

The better question is why

#

Chances are there is a better solution

earnest forum
#

yeah

kindred valley
#

?paste

undone axleBOT
opal juniper
eternal night
#

I wanted emojis hehe

quaint mantle
#

How can I go about being able to send a message to a player every 2 seconds using a map<uuid, long> ?

eternal night
#

I mean, you'd basically just have a task timer running

left swift
#

When using redis to communication between servers should I change my main database to redis too, or there is no reason? (from mongo in my case)

compact haven
#

what

#

redis isn't meant to be used for persistent data

#

if you're using it as a database, it's only for cache

#

mongo, instead, would be used for data that needs to stay

left swift
#

O, ok, so I didn't know that, thank you!

compact haven
#

No problem :)

low temple
#

Are you not able to use items with PersistentData values to craft other items?

#

It keeps canceling the event when I try to use em to craft

#

I even remade the recipe as a custom one and its not letting me craft

shell linden
#

Is there any way to prevent the player from putting some items into the container?

shell linden
#

all

low temple
#

into any chest?

shell linden
#

Furnaces, hoppers, chests...

low temple
#

If so, listen to InventoryClickEvent & InventoryDragEvent and cancel if the clicked inventory is not a player's inventory

shell linden
#

i try

#

So how do you know that the click is not the player's inventory?

crude loom
#

Is it possible to create a world in a specific directory?

quaint mantle
#

inside player.sendMessage(); i know you can use color codes with the ยง symbol or with ChatColor.GOLD, but how do you get hex color codes working? ยง#000000 doesn't work

delicate lynx
#

use something like minimessage that can handle hex super easily

ivory sleet
#

and is fast and performant :3

quaint mantle
#

im currently working on the auto complete of a command ive made, what does args[] equal if nothing is parsed?

hybrid spoke
#

1, since the first one is always the command iirc

smoky adder
#

hello for the title talk you told me to create a maven, I simply changed the spigot version I put another 1.8.8 and now p.sendTitle goes but check sendTitle (String, String) does not give ne fadeIn fadeOut then I tried to send the titles with the packets but they don't go! it does not give me any errors but the title simply when I enter the server I do not see anything. Another problem I have is that the symbols I insert in the .yml config are displayed with a smiley face before and the letters like "รจ" are displayed as รƒ or ร‚. can someone help me i'm going crazy for these two things ...

rugged cargo
#

is a there a simple way of managing what types of items are allowed in certain slots of an inventory?

#

maybe use a map to specify allowed items in each modifyable slot?

#

currently liking the sound of this ^ idea, so im going to try it

quaint mantle
earnest forum
earnest forum
#

no

#

getEntity is the player

#

you can't get the killer from the death event

#

(I don't think)

#

because the player can die from fall dmg

#

and then who's to blame?

quaint mantle
#

Thats why i added the else

earnest forum
#

you are basically checking if the player's killer is the player

#

which doesn't make sense

#

and don't use ==, use .equals()

quaint mantle
earnest forum
#

== is checking if the 2 objects are the same object

#

use this for like enums or numbers

#

but for classes that have individual information

#

you use .equals()

#

because it doesn't compare the class, it compares the information inside it

#

if you create 2 new locations with the same exact info, == Will probably not work

quaint mantle
#

oh i see for this example it would be player.getKiller().equals(mob)

earnest forum
#

yes

#

but

#

mob already equals player

#

so you're being redundant

smoky adder
earnest forum
earnest forum
#

sec

earnest forum
smoky adder
#

Okay

earnest forum
#

both are e.getEntity()

#

so you are setting both variables to the EXACT same thing

quaint mantle
earnest forum
#

alright

quaint mantle
earnest forum
#

I'm not sure

#

I haven't been on my pc and coded for a month

#

look at the javadoc for PlayerDeathEvent

quaint mantle
#

maybe an if statement with entitydamage event and instance of monster may work

#

ima try it out

earnest forum
#

can you tell me what you're trying to get, what your issue is, what your code is, etc?

smoky adder
earnest forum
#

packets?

#

why not

#

what's stopping you?

#

does the method not exist?

smoky adder
#

Player.sendTitle have two strings

earnest forum
#

yeah

#

title and subtitle

smoky adder
#

(String1, String2)

earnest forum
#

big text and small text under

smoky adder
#

Yes

earnest forum
#

there should be more values than that which are optional

smoky adder
#

But don't work...

earnest forum
#

can you show me your code?

#

and you are using spigot 1.8.8?

smoky adder
#

In this moment i turn off my pc because I thought that no one would answer and I'm trying to understand what I did wrong because I have followed so many tutorials I have been working on it for practically a day

#

Yes i use 1.8.i

#

8*

earnest forum
#

looks like there's just not a send title method

#

in 1.8.8

#

the only one that exists is the one with 2 strings and that's deprecated

smoky adder
#

after the two strings there is nothing more there should be fadeIn fadeOut but there is nothing ..

earnest forum
#

yeah..

#

let's try packets?

#

are you using mavens

smoky adder
#

Yes i try it

exotic depot
#

is there any benefit to creating an entity with packets vs. just regularly spawning it? It will be an armor stand entity visible to all

earnest forum
#

creating an npc with packets is for if you want only a couple players to see it

exotic depot
#

what would i need an api for?

earnest forum
#

spigot api

smoky adder
earnest forum
#

the methods built into spigot sorry that was badly worded

exotic depot
#

oh

smoky adder
earnest forum
#

or eclipse

smoky adder
exotic depot
#

iโ€™m not using spigot api bc iโ€™m planning on sending packets to update the rotation of the entity and some metadata

earnest forum
#

ok do you know how to import jars as dependency?

earnest forum
smoky adder
earnest forum
#

if you just want all players to see it you can just use the regular spigot functions

smoky adder
#

I dont have a pom.xml

exotic depot
#

when i tested a constantly rotating entity by sending packets it was much smoother

earnest forum
exotic depot
#

and when the player hits the player stand i want to give it the glowing effect for just them

earnest forum
#

yes because the client handles it

#

so yeah you can spawn and move the player on server and then use packets for rotation and glow

#

send rotation to all player and then glow for 1

exotic depot
#

alright ty

earnest forum
#

move entity*

earnest forum
smoky adder
earnest forum
exotic depot
#

another thing is, I want to create a spectator mode in a mini game where the player can use items so would setting them in spectator mode on the server and sending them a a packet to put them in survival be a good idea?

earnest forum
#

that wouldn't work

#

you could put them in adventure with fly enabled

smoky adder
earnest forum
#

it comes with like

#

org.bukkit.player.Player

#

this is a package

smoky adder
#

Ah yes im stupjd

exotic depot
earnest forum
#

do you have the net.minecraft.server packages in your project?

exotic depot
#

bc i donโ€™t want to just send them in adventure and be able to interfere with certain things

earnest forum
#

as you cannot use items in spectator

#

you could try it

#

I've never seen it done before so I don't know the output

exotic depot
#

how do servers normally do it? where spectators canโ€™t block arrows and all that

earnest forum
#

place destroy anything

smoky adder
#

when i did build artifacts untellij completed ik loading of the jar in a complete way without giving errors so i think there is

earnest forum
#

try go into one of your classes

hearty tundra
#

@earnest forum do you know how to do that?

earnest forum
#

and then type in EntityPlayer and see if it imports

earnest forum
smoky adder
#

we're driving yada crazy

#

Lol

earnest forum
#

I'm on my phone too ahahaha

hearty tundra
#

ok. thank you

rugged cargo
#

all helpers on every help server are greatly appreciated!! โค๏ธ

smoky adder
earnest forum
#

that is probably the only way to get titles in your version

#

have you actually googled how to do this?

#

like a tutorial on YouTube

#

it would be much better as it's visual for you and I'm on my phone

smoky adder
#

I exported the plugin without any errors and when I start it it gives no errors so I have encrypted the package

smoky adder
earnest forum
#

bruh i cannot access the spigotmc website

#

I'm at an airport currently

#

waiting for flight back to Australia

#

they've blocked spigotmc lmao

smoky adder
#

Lol

#

if you don't like it maybe we'll discuss it tomorrow ??

earnest forum
#

it looks like there's a packet for subtitles title and times

smoky adder
#

today because of the titles i'm going crazy i tried everything also as i said the method with the packages i.e player connection chatserializer etc.

karmic stirrup
#

I want to do something if a player has either of these permissions and is flying but it only works if they have both.
My code:

if (((!event.getPlayer().hasPermission("PermissionOne")) && event.isFlying()) || ((!event.getPlayer().hasPermission("PermissionTwo")) && event.isFlying()))
smoky adder
#

I used the spigot guide with the 3 methods I don't know if you have read it ...

#

But don't works

earnest forum
#

I can't see it :(

lavish hemlock
earnest forum
#

that's what they're doing

smoky adder
#

it doesn't matter

lavish hemlock
#

Yeah but it's not valid

earnest forum
#

except with another pair of brackets over the isFlying and hasPermission

lavish hemlock
#

It should be

#

isFlying && (hasPermissionOne || hasPermissionTwo)

#

Something like that, I suppose

earnest forum
#

also you could just wrap the whole thing in another if

#

above it

#

yeah something like that

lavish hemlock
#

Also I don't know why you're checking if they don't have the permission

smoky adder
#

I cant send images sorry ahah

lavish hemlock
#

If it should work when they do have it

karmic stirrup
quaint mantle
#

i'm new to spigot coding, how would i add minimessage to my project?

smoky adder
#

nothing works in titleApi that is titleapi.sendTile etc. these api give errors while the packets of the link you sent to do not give errors but when I enter the server I do not see any title said questk I will try to ask for help tomorrow here hoping it can solve night!

karmic stirrup
#

This also doesn't work

if (event.isFlying() && (event.getPlayer().hasPermission("PermissionOne") || event.getPlayer().hasPermission("PermissionTwo")))
golden turret
#

why when i set ignoreCancelled to true in PlayerInteractEvent it completely ignores the click i do in the air?

rugged cargo
#

event.getCursor().setType(Material.AIR); - i tried this
how do you set the cursor's itemstack to nothing in InventoryClickEvent?

#

actually, just decrease the stack size of the cursor stack

echo basalt
#

probably to save bandwidth

golden turret
#

if i dont ignoreCancelled

#

it is called

echo basalt
#

ignoreCancelled shouldn't really affect it

echo basalt
#

it's immutable / a copy

#

ยฏ_(ใƒ„)_/ยฏ

golden turret
rugged cargo
echo basalt
#

it means that modifying the variable provided by the getter doesn't modify the internal variable itself

rugged cargo
#

i should say im trying to replace a glass pane in my custom inventory without being able to actually grab the glass pane

echo basalt
#

cancel the event, get the slot, set new item

rugged cargo
#

that makes sense but actually kind of makes me want to rethink my system a little bit

#

what would the event.getInventory().getHolder() class be for the player's inventory?

hard lake
#

how to Fix the water bucket because it was faulty, For example: put out a bucket of water, it doesn't run around but it flows out to the sides, but when placed in the middle, it doesn't move
-Show how to use engchant books can be merged into dc
-Edit /pv 2 households
-I hope to sell repairs at the shop to have something left engchant (rate 1%:>>)
-Fix me the power ended because it's so annoying
-Fix the shop when writing /shopgui is too annoying and takes a long time (I can't fix it)
-Fixed the experience bottle that may drop experience (cannot be fixed)
-Fixed the sword because it took more than a dozen hits to kill a monster because of the sharp 8th sword

#

help

delicate lynx
#

bro we don't have access to your server

hard lake
rugged cargo
#

what class is this^?

delicate lynx
#

you wrote an essay, providing zero information

#

good luck

delicate lynx
#

that's the player object

ivory sleet
#

the implementation of the interface Player

rugged cargo
#

oh, doi. so the Player is holder of this inventory

#

gotcha

#

thanks

#

or i guess i should use CraftPlayer

hard lake
#

what

delicate lynx
#

it implements Player

rugged cargo
#

thats interesting because CraftPlayer isn't a valid file name for me.. ill do some testing to find out

ivory sleet
#

mye well all things considered, as an api consumer you really dont need to know much about CraftPlayer

rugged cargo
#

k, thanks for the tips

#

is InventoryClickEvent aware of all the currently open inventories? or just the one that is clicked

#

ah event.getView().getTopInventory() and event.getView().getBottomInventory() seem right

cinder karma
#

Herro, quick question. When you perform a Location.add(x, y, z) does it return the original location, the new location, does it modify the original location? The documentation just says "Returns: the same location" and that's...super vague

echo basalt
#

it adds to the original location and returns itself

cinder karma
#

ahhh, okay, so it's returning itself

echo basalt
#

if you use intellij you can just middle-click the method and see how it works

cinder karma
#

is there an easy method to return a new location and leave the original intact?

#

that's what I'm trying to accomplish (and explains why it hasn't been working)

echo basalt
#

location.clone().add

cinder karma
#

ahh, thank you so much ๐Ÿ™‚

#

yup, fixed the problem, ty

neon halo
#

How to add requirements in rankup? I'm using permissionX

echo basalt
#

๐Ÿคฎ

final monolith
#

Invisible armor stands at the water causes bubbles, any method to remove that?

#

tried turn the stands into packets, using the setSilent() method too.

echo basalt
#

setGravity to false could work

final monolith
#

if i disable gravity, the stands will fall into the deep ocean

echo basalt
#

or check if noAI exists

final monolith
#

the AI are disabled

echo basalt
#

as noAI stops ticking

#

hmm

final monolith
#

i think thats client-side bubbles

echo basalt
#

particles are usually made by the server

final monolith
#

the armor stand as packets causes that too

echo basalt
#

huh

final monolith
#

๐Ÿ˜ฅ

compact haven
#

??? If you're sending the armor stands as packets & the bubbles still appear, it has to be client-sided

#

unless you're like also spawning them on the server? why?

rugged cargo
#

the elusive rogue code that should've been commented out condition :)

final monolith
ebon coral
#

Does anyone know if two plugins can use the same connection url via MongoDB?

#

Seems I am havin a bit of trouble using two, so wondering if it's possible.

worldly ingot
#

Don't see why not. The connection URL is literally how it finds the database ;p

ebon coral
#

That's so strange, in both of my plugins it says it connected to the MongoDB fine but when both of the plugins are on the same server only one of the data parts works...

#

If I delete Basics, only prison works lol

#

So confused

ebon coral
#

Found da issue

#

She alive

echo basalt
#

if the bubbles are client-sided

#

then no

#

Although I really doubt your armorstands are clientside

summer scroll
#

Is there in any way to make particle instantly disappear after spawning it?

undone pebble
#

why would you want to spawn it if you're just want to immediately remove it afterwards?

summer scroll
glass mauve
#

How can I test my plugin if I need more than one player but don't want to buy a second account

compact haven
#

you can turn off online-mode and bring in a fake player

quaint mantle
opal juniper
quaint mantle
summer scroll
#

I just changed the particle type

#

On the video I use FIREWORK_STARS

quaint mantle
#

Then show your current state. I bet its going to be still way too much.

summer scroll
opal juniper
#

oh that looks way better

summer scroll
#

agree xd

opal juniper
#

still gonna affect some lower end clients

#

but nowhere near as much

rough drift
#

I like spinny chest

grim ice
#

Low End mode

#

or smth

#

that disables the animation

silk hamlet
#

Fancy animation

#

me like

summer scroll
silk hamlet
#

Particles are quite performance heavy yeh

quaint mantle
silk hamlet
#

^^

summer scroll
#

Okay, I'll get some feedback from the players first.

solid jungle
#

Im Wondering how i can make a custom rank system for a server using 1.8.8
Can Anybody Tell me How do it?

proud hare
rough drift
#

With EntityExplodeEvent, can you check what triggered it?

eternal night
#

Not from the event directly, however things like primed tnt have a source

summer scroll
rough drift
#

Location{world=CraftWorld{name=world},x=208.0,y=67.0,z=904.0,pitch=0.0,yaw=0.0} Location{world=CraftWorld{name=world},x=208.0,y=67.0,z=904.0,pitch=0.0,yaw=0.0}
Yep these two are different, thank you spigot <3

digital hazel
#

Hello. I have one question. How can I do plugin which will be compatible with multiple versions for example 1.8 - 1.18.2 ?

brittle lily
#

Someone Can Help?

tardy delta
#

show your code

eternal night
earnest forum
#

you need to have a check

#

to see what libraries are loaded

#

all versions 1.16 and below have their version in the nms package

#

u can use that to find your version

brittle lily
earnest forum
#

that's very weird behaviour idk why it is doing that

brittle lily
digital hazel
earnest forum
#

it should

#

just test it to make sure

brittle lily
earnest forum
#

maybe try make a new project

brittle lily
#

I tried

#

but same

earnest forum
#

you might've messed something up in settings

brittle lily
#

for example

digital hazel
earnest forum
#

so I can see where your plugin.yml is

brittle lily
eternal night
#

how are you compiling the plugin

#

the plugin.yml needs to live in the resources folder

#

for maven to properly package it into your plugin

brittle lily
#

really? oh..

eternal night
#

Yea

brittle lily
#

Ahhh Its Working

eternal night
#

๐Ÿ‘

brittle lily
#

Thank You And Sorry For My Mistake