#help-development

1 messages · Page 460 of 1

hard ether
#

very noob question - Should I make my entire main class static as I only want one instance of everything?

misty ingot
#

uh

#

no..?

primal rose
#

im so noob that i dont even understand what ur saying

hard ether
#

but if I only want once instance of a module handler, what do I do then?

lost matrix
wanton spear
#

Hello guys. When I add RGB Color codes to the prefix of a rank in LuckPerms, I do not have the colorcode in my nametag because nametags dont support RGB Color codes and TAB plugin doesn't have a script against it either. The normal color codes work on your nametag and in chat, so the color codes like &e, and rgb color codes also work in chat but not on your nametag. does anyone know a plugin to bypass this or another way to bypass this so that I can use rgb color codes in my nametag

lost matrix
regal scaffold
#
            for (Player p : event.getRecipients()) {
                p.spigot().sendMessage(newMessage);
            }
#

Done

#

I think this should also apply to private messages if priority is set correctly

undone axleBOT
fluid river
#

here you go

minor granite
#

Hello, I am using CratesPlus for my server, everything was working fine but crates started dissapearing every time the server gets restarted. There aren't any console errors, and the data.yml file still says the locations of crates, but the crates turn into normal chests (basically they get removed) anyone had a problem like this?

regal scaffold
minor granite
#

Thanks @regal scaffold

#

Didn't see the channel sorry

primal rose
#

i dont rlly understand what this line does. Is it taking information from the server?

tardy delta
#

it registers a listener

#

and it registers it per plugin or smth, thats why it needs the plugin parameter

quaint mantle
#

Dang

misty ingot
#

ngl acf kinda confusing

tardy delta
#

internals looks wack lol

hasty prawn
misty ingot
#

small brain problems, sorry

desert spade
# wanton spear Hello guys. When I add RGB Color codes to the prefix of a rank in LuckPerms, I d...

i looked into this a couple years ago. there's not really much that is possible here (at least as of version ~1.17)

the only plugin i know of that potentially does something like this is LibDisguises, but ive never used it myself so i don't really know if it'd work as intended in this situation. also it may be pretty resource heavy, iirc it hides the player entity and creates a new entity that follows you around? or something big brain like that. not really sure, i only know of it

tardy delta
#

it just needs 3 strings

misty ingot
#

all I want is for my "/balance" to become "/foobar balance"

tardy delta
#

first one either foobarcommand or foo or f
second bar or b
and third always baz

#

just look at the spaces

hasty prawn
#

@CommandAlias("foobar balance")

misty ingot
#

i zee

#

any way to make all my commands like that without having to do that on all of em?

tardy delta
#

what are you trying to make?

hasty prawn
#

My knowledge of ACF extends to that picture you sent so I have no clue KEKW

misty ingot
#

basically want subcommands but not all bundled up in one big class

#

theres going to be a LOT of subcommands

#

and I mean a seriously big amount

quaint mantle
#

Guys

misty ingot
#

fml hes back

quaint mantle
#

?paste

undone axleBOT
quaint mantle
#

After hours

misty ingot
#

yeah I basically wanna do that (a ton of subcommands) but not all in one class

quaint mantle
#

I got the code

#

The script

regal scaffold
#

If I want to get a player using Bukkit#getPlayer

misty ingot
#

the same thing you did, divided up in several classes (1 per command)

quaint mantle
regal scaffold
#

But the player can be both online or offline

#

Do I use getOfflinePlayer() in both cases?

misty ingot
#

@quaint mantle congrats bro now can you tell us your issue

quaint mantle
misty ingot
remote swallow
#

add the commands to plugin.yml

regal scaffold
misty ingot
#

then offlineplayer

regal scaffold
#

I want to literally check if they are offline or not

quaint mantle
regal scaffold
#

using a UUID

misty ingot
#

or check online

#

get player with uuid then check for online

#

offlineplayer with uuid*

regal scaffold
#

#getPlayer(UUID)

#

Oh ok thought so

misty ingot
#

Bukkit#getOfflinePlayer(UUID)

wise mesa
#

if I want to add a new feature to the api, what's the standard procedure?

regal scaffold
#
Bukkit.getOfflinePlayer(phoneOwner).isOnline()
#

Yes

wanton spear
regal scaffold
#

Thanks

misty ingot
#

I believe that should work

quaint mantle
#

Guys

#

Can someone try it?

wise mesa
#

submit a pr to the api with the feature and submit a pr to the server with the necessary patch?

quaint mantle
#

Im out rn

river oracle
misty ingot
quaint mantle
#

I’ll update u guys

echo basalt
#

no, we won't try your code

#

and no, we don't want updates

quaint mantle
#

And if I need your help

echo basalt
#

We're here to help you write good code, not to spoon-feed you

quaint mantle
#

I’ll just ask it

#

Don’t worry guys, I’ll be back

#

Ok I asked to my friend if he can try it

remote swallow
#

why cant you try it

quaint mantle
remote swallow
#

why are you codingwhile your out

#

do it when you get home

#

so ya know, you can fix bugs

echo basalt
#

unless you're a god-tier developer that is helping their team while they're out

#

just do shit when you actually have time

quaint mantle
#

Im just writing down some lines

#

That’s it

misty ingot
#

will @CommandAlias f with my args? @tardy delta ||sorry for ping||

#

like if I just put it as "mm balance" now will it say that I have 1 args instead of 0

quaint mantle
#

Guys my plugin will come good

#

I hope

remote swallow
#

what does "come good" mean

quaint mantle
#

It will be good

echo basalt
#

guys my plugin will come out good I hope

quaint mantle
#

Probably u made a lot of errors

remote swallow
#

damn how do you see that

echo basalt
#

statistics plugin on intellij

misty ingot
tardy delta
hazy parrot
echo basalt
#

only mistake I've ever made was being born

#

life is mid anyways

quaint mantle
river oracle
#

I have never made a mistake before

remote swallow
#

we dont make errors we only make intentonal bugs

icy beacon
quaint mantle
icy beacon
#

I can tell you my opinion on anything and you can't do shit about it

quaint mantle
#

If I ask for your opinion then yes

icy beacon
#

probably that's why it's an opinion

young knoll
echo basalt
#

y'all having an argument over this shit

#

literal children

icy beacon
quaint mantle
icy beacon
weak meteor
#

I wanna make a GUI Manager to start in advanced spigot develop, but i dont know where to start, smone can help me?

icy beacon
misty ingot
#

@echo basalt he started it mom

echo basalt
weak meteor
#

ive seen it

echo basalt
#

yeah

#

that

misty ingot
echo basalt
#

You can then write some code that can, for example, read stuff from config and apply it

misty ingot
quaint mantle
echo basalt
#

Or make a selection system where you can apply an element to multiple slots at once

misty ingot
#

can we please just have the funny command already

quaint mantle
remote swallow
#

go learn java

echo basalt
#

Egitto you're a literal clown

quaint mantle
remote swallow
echo basalt
#

if you're just here to be a troll then fuck off

quaint mantle
#

Im not trolling?

echo basalt
tender shard
#

why are you guys even still talking to them

quaint mantle
quaint mantle
river oracle
quaint mantle
#

I made some progress

river oracle
#

I just couldn't anymore

icy beacon
#

good point I'll just block him

quaint mantle
#

Why? Lol

remote swallow
quaint mantle
icy beacon
#

oh he said something

#

too bad I can't read it

remote swallow
echo basalt
quaint mantle
remote swallow
#

highly doubt that

young knoll
misty ingot
#

@ivory sleet sorry for the ping but can you just type the funny command already

quaint mantle
remote swallow
misty ingot
#

ready to bet actual money that everyone hates @quaint mantle here already

sterile axle
#

🤨

quaint mantle
#

I don’t hate Egitto

echo basalt
#

Coming here and pretending you're the best because you've asked us to test your own code

misty ingot
#

congratulations! you win the money I bet
I had bet -1 pesos

hazy parrot
misty ingot
#

now pay up

remote swallow
#

"your"* smh

echo basalt
#

and here's literal proof you're egotistical

regal scaffold
#

acf acf acf

echo basalt
#

Is not going to get you far in life

regal scaffold
#

How can I pass a parameter from the command over to CommandCompletion

misty ingot
#

acf kinda pog ngl

ivory sleet
#

dw he is timeout'd

echo basalt
#

So just be humble ❤️

remote swallow
#

thank you conclure

misty ingot
#

FINALLY

echo basalt
regal scaffold
#

Yes

echo basalt
#

Tab completion is odd

misty ingot
#

he will shut up for a bit

regal scaffold
#

But, It's dependant

echo basalt
#

You need to return a string list

ivory sleet
#

1w

regal scaffold
#

Wait wait

echo basalt
#

🔥

remote swallow
#

bet hes gonna try and dm someone for help

regal scaffold
#

Oh wait nvm this won't work

desert spade
#

don't give him ideas

remote swallow
#

too bad he cant dm many of us

regal scaffold
#

I need tab completion dependant on something the player is holding

#

And logically that makes no sense

#

Unless I can pass a itemInHand to tabCompletion in ACF

misty ingot
#

how does CommandPermissions() work in acf? can I edit the action it takes when the user does not have said permissions?

echo basalt
#

I'm so glad I don't use acf

remote swallow
#

acf is confusing

misty ingot
#

hah told you @tardy delta

regal scaffold
#

Ok nvm

#

Acf is sick lol

#
 acf.getCommandCompletions().registerAsyncCompletion("contacts", c ->
                {
                    System.out.println(c.getPlayer().getInventory().getItemInMainHand().toString());
                }

misty ingot
#

if used properly

#

even brainfuck is poggies

regal scaffold
#

That actually works

misty ingot
#

who tf is User

#

(acf)

#

nvm.

regal scaffold
#

How can I create my own ClickEvent

#
.event(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/phone addcontact"))

To replace that, but instead, for example, make it open a specific GUI

tender shard
#

make a command that opens the GUI, then run that command through the event

regal scaffold
#

No better way huh?

#

Interesting

#

So exactly what I have rn xd

young knoll
#

Click events can only run commands

#

They don’t have to be registered commands though

tender shard
#

if I only want players to be able to use the clickevent, but not manually run the command, I just use a random UUID in the clickevent, then in onCommand I check if the UUID is correct

regal scaffold
#

Or I can just hide the command behind something so dumb

#

It would never be found anything

misty ingot
#
@CommandAlias("mm|minememer")
public class bankCommand extends BaseCommand {
    private static final MineMemer plugin = MineMemer.getInstance();

    @Subcommand("bank|balance")
    @CommandPermission("mm.balance.self")
    public boolean viewBankSelf(CommandSender sender) throws Exception {
        if (checkSenderIsPlayer(sender)) {
            Player player = (Player) sender;
            showPlayerBank(player, player.getUniqueId());
        }
        return true;
    }

    @Syntax("<player>")
    @CommandCompletion("*")
    @Subcommand("bank|balance")
    @CommandPermission("mm.balance.other")
    public boolean viewBankOther(CommandSender sender, Command command, String label, String[] args) throws Exception {
        if (checkSenderIsPlayer(sender)) {
            Player player = (Player) sender;
            String rawUUID = getPlayerUUIDByName(args[0]);
            if (rawUUID.equalsIgnoreCase("Player_Not_Found")) {
                sendErrorToPlayer(player, "Player_Not_Found");
                return true;
            }
            UUID tUUID = UUID.fromString(rawUUID);
            showPlayerBank(player, tUUID);
        }
        return true;
    }

definitely looks 10000% cleaner

compact haven
#

bankCommand as a class name

#

good one

young knoll
#

Some server did that with an invsee command that was only supposed to be used from a click event

#

People figured out the command

tender shard
#

yeah just create a random UUID everytime you send the message

hybrid wadi
#

Hey, I am currently working on a chest crate Plugin and now I want to check if the right click Block is a Chest and check the Title of the Chest. My Problem is that neither the getName() nor the getTitle() Method exist, so I don't know how to check the title of a chest. (I am on 1.19.2 btw.)

regal scaffold
twilit roost
regal scaffold
#

No other way to have a custom event for BaseComponent?

tender shard
regal scaffold
#

I could make a class that extends ClickEvent with nms

twilit roost
#

just 7 unicodes
aka in the second link the ???..

regal scaffold
#

Seems like more work that just command tho

fallen fjord
#

how do i have a location always left of the player?

icy beacon
#

elaborate?

misty ingot
#

I think he wants to check the block immediately left of a player

#

or store the loc or sum

desert spade
tender shard
hybrid wadi
desert spade
#

i think inventory title is only available through InventoryView, when the inventory is open. idk if it's accessible through the actual chest block but i may be wrong, never looked at that myself

#

maybe through the blockdata or something

hybrid wadi
#

Ohh okay, thank you 🙂

fallen fjord
tender shard
#

Im in the bathtub, i can send some code in an hour or sth

regal scaffold
#

How can I sent an empty line inside a sender.spigot().sendMessage

warm wren
# hybrid wadi Ohh okay, thank you 🙂

it is possible to get the custom name of the chest, you have to cast the blockstate to Chest. With that you can access the custom name.
also check if the block is a chest before casting

regal scaffold
#

In 1 line that is

#
        sender.spigot().sendMessage(firstLine);
#

Can I include \n inside firstLine?

tardy delta
#

new TextComponent("")?

#

try it id say

misty ingot
#

"\n"?

regal scaffold
#
                .append("\n")
#

Works, good enough

pure dagger
#

How to make timer that goes from 5 to 0 and then teleports player, but if they move cancel it

green prism
pure dagger
#

what\

green prism
#

it's a leaderboard

tardy delta
#

very original 💀

green prism
#

how is it possible?

green prism
#

What do you think about it?

pure dagger
#

its map

#

in item frame

tardy delta
#

hmm

green prism
#

Ik but, it's also a leaderboard

#

data is real

#

and interactive

pure dagger
#

it changes i dont know

tardy delta
#

wanted to say resourcepack but data is dynamic

green prism
#

exactly

tardy delta
#

some map thing then

#

havent really been rendering on maps

#

but its possible

green prism
#

Yeah but, how can I create a thing like that using Java?

#

How can I create that image

#

It's going to be the heaviest task of the server lmao

tardy delta
#

just go into f3 and see if theres a map behind

green prism
#

yeah, it's a map

tardy delta
#

different ones?

rotund ravine
#

It’s just a map

#

More than one obv

green prism
rotund ravine
#

But it’s not that hard to manipulate maps

green prism
#

But, how can I create that base image?

rotund ravine
#

There’s multiple frameworks/libraries to amke it even easier

green prism
#

With colors, positions and so on

desert spade
# fallen fjord how would that look like? xd like having a particle always 1 block left of you (...
Vector facing = player.getLocation().getDirection().normalize().setY(0);
// normal is the vector at 90 degrees. -1 is to the left, 1 is to the right.
// y (pitch) isn't taken into account here.
Vector normal = facing.crossProduct(new Vector(0, -1, 0));
normal.normalize(); //set length of vector to 1. can multiply it from here to set distance
Location left = player.getLocation().clone().add(normal);
tardy delta
#

i believe minestom has opengl support for renderin on maps 💀

lost matrix
tardy delta
#

or smth else

#

lemme find

#

ah glfw

green prism
tardy delta
lost matrix
# tardy delta

This wont help you much unless you have an APU or GPU on your server

tardy delta
#

no clue

#

i always mix up those names

lost matrix
green prism
#

Hmhh... Rendering is the last problem I believe
Creating an updatable leaderboard per player is the main one

round finch
#

map rendering shet that is sick

green prism
tardy delta
#

ofc i lost the screen of my beatiful rendering

lost matrix
#

Just create a BufferedImage with N*256 width and M*256 height
where N is the amount of column frames and M the amount of row frames,
then draw on it by using the Graphics2D capabilities of the image, split
the image up into N by M pieces and apply them on the maps.

tender shard
wild nexus
#

Hi, does anyone know how to keep a mob around a location and if the mob go further the radius it stop following the player ?

lost matrix
wild nexus
lost matrix
fluid river
#

i love <T>

tender shard
#

i don't get why people keep calling it K, T, etc

#

why not <Key, Value>

lost matrix
#

Conventions

fluid river
#

cuz that's just T without pair

tender shard
#

but why is the convention to use single letter stuff

#

when everywhere else, people say it's bad

fluid river
#

?

#

idk we just made this:

#
public static <T extends PersistentDataHolder> T addIntValue(T holder, String key, int value) {
    holder.stuff();
    return holder;
}
lost matrix
tender shard
#

yeah probably

fluid river
#

and this method does return the object of the same type as the one i gave to it, and not a PersistentDataHolder like in this example:

public static PersistentDataHolder addIntValue(PersistentDataHolder holder, String key, int value) {
    holder.stuff();
    return holder;
}
lost matrix
#

Without your IDE coloring everything in it could be harder to make out the generics in something like
<Element, Target, Result> Result combine(Target target, Element element) { ... }

fluid river
#

🙂

#

tho the guy who coded this has another problem

#

itemstacks are not PD holders

#

only the meta is

lost matrix
#

I was about to say: It makes more sense to pass the PDC there

fluid river
#

so if you want to change the itemstack without get/set but with just one method, it won't work

#

like name + pdc's

#

so you need to pass a meta which turns to unreadable shit overall

tender shard
#

everything's a pickaxe if you try hard enough

fluid river
#

😉

pallid escarp
#

How can I access ChunkGenerator of the default world?
Tried with World#getGenerator() but it returns null

lost matrix
#

There is no default implementation of the spigot chunk generator

young knoll
#

It doesn't reflect the vanilla generator

#

Only custom ones

pallid escarp
#

So is there any way I could get base height at given coordinates in world using vanilla generator?

young knoll
#

Is the area generated

pallid escarp
flint coyote
#

Is there an easy way of determining all the impact a block break event/block place event had?
Like when you break a block and it causes a torch to fall of or water to flow, that then turns lava into obsidian or flows away other torches?

I know there's the BlockFromToEvent for water and I could track that but maybe there's another solution that didn't come to mind yet.

young knoll
ivory sleet
#

@tender shard I red ur msg regarding type parameter names that have the same naming convention as classes, Ive tried it, the main problem arises that you can’t differentiate between type parameters and types, which becomes confusing, so I think the reason for the convention is that simple

tender shard
#

Yeah probably, thats what my java book also said

tardy delta
#

java book 👀

#

i ordered a java book but idk when it ll arrive

pallid escarp
weak meteor
tardy delta
#

im clearly better at java than at c++ then

tardy delta
#

there are no args

#

check if args.length > 0

#

or == 1

#

strings in your case

fallen fjord
#

how do i get org.bukkit.Color from string?

icy beacon
#

is it an enum

fallen fjord
#

is there a way tho

icy beacon
tender shard
tawny pine
#

Guys how would I add metadata to an item in a players hand?

icy beacon
pallid escarp
icy beacon
#

but why do metadata if you can do pdc

tawny pine
icy beacon
tawny pine
icy beacon
#

huh

#

this sounds like xy

#

?xy

undone axleBOT
icy beacon
#

?pdc also

eternal oxide
#

wth? How long has freezing to death been in MC?

icy beacon
#

like, quite a long time

#

maybe 117 or 118

eternal oxide
#

ok, I've not really played since about 1.7

tawny pine
#

how can i select the itemstack in the players hand?

tender shard
#

I didnt know either lol

icy beacon
#

?jd-s

undone axleBOT
tardy delta
#

since 1.7 kek

#

thats a long time

eternal oxide
#

perhaps 1.8 but not much 😉

tardy delta
#

i began playing at 1.12

dire marsh
icy beacon
#

I play 1.8 and only join 1.19 when I code

#

sometimes I get confused

eternal oxide
#

I think I played the most 1.7.10

#

or somethign around that

dire marsh
#

I played 1.8 recently, and it made me realise how far the game has come and how many bugs have been fixed

tawny pine
dire marsh
#

but I do think some bugs were part of the fun

tardy delta
#

and how much longer it takes to load 💀

dire marsh
#

i could load like at least 3 1.8 instances in the time it takes 1.19 to start

flint coyote
dire marsh
#

although 1.19.4 is a big improvementa to load speed

#

and it doesn't make my whole computer freeze for a moment

tender shard
tawny pine
tender shard
#

get the itemstack in hand, check if it has itemmeta. if yes, get the itemmeta, check if its instanceof crossbowmeta. if yes, cast it to crossbowmeta

tawny pine
tender shard
#

?learnjava

undone axleBOT
tawny pine
#

i don't know the syntax to use

tender shard
#
CrossbowMeta crossbowMeta = (CrossbowMeta) itemMeta;
flint coyote
#

If you just type
CrossbowMeta meta = itemMeta
The ide should suggest you the cast anyway

tardy delta
#

i was having a genius idea to work with a rust enum alternative, turns out it doesnt work

sage patio
#

anyway to do something like this?

tawny pine
#

i tried using player.getItemInHand().getItemMeta().addChargedProjectile() but addchargedprojectile isn't recognised

#

it cannot resolve method

#

apparently :/

tardy delta
#

im still waiting for java to allow this:

public record(OpCode, Operand...) instruction() {
  return [..]
}```
sage patio
tawny pine
sage patio
#

i didn't worked with new version specially those ones with crossbow but this is the correct way ig, try it

ItemStack item = // get the item
ItemMeta meta = item.getItemMeta();
meta.doYourStuff();
item.setItemMeta(meta);
// set it in player hand
tawny pine
#

has*

sage patio
#

you cannot set item meta in line ig

#

you have to set it on an item

tardy delta
sage patio
tardy delta
#

12, 13 -> { // code }

#

ah

tawny pine
tardy delta
#

case 12:
case 13:
case 14:
code
break;
...

#

smh

sage patio
tawny pine
#

so i'd do itemstack item = player.getinv... ?

sage patio
#

yea

tawny pine
#

ah nice ok 🙂

fallow violet
#

if a player is in an inventory, does the inventory close event get called if he leaves the server?

sage patio
#

yea they're for java 14+

sage patio
true perch
#

I added <outputDirectory>DIR</outputDirectory> to the config section of my pom.xml file.

For some reason every time I build the plugin it starts to add new jars each time. How can I prevent this and just have it override the original plugin jar?

fallow violet
sage patio
#

its not getting called at all

fallow violet
#

wait what

tawny pine
sage patio
#

also the Open one

fallow violet
#

why not

sage patio
sage patio
tawny pine
tender shard
fallow violet
tender shard
tawny pine
#

if(player.getInventory().getItemInHand().getType() == Material.CROSSBOW){ if(event.getAction() == Action.LEFT_CLICK_AIR || event.getAction() == Action.LEFT_CLICK_BLOCK){ ItemStack item = player.getInventory().getItemInMainHand(); ItemMeta meta = item.getItemMeta(); meta.addChargedProjectile } }

tawny pine
fallow violet
tawny pine
#

i havent finished on the meta.addchargedprojectile line

#

bc i got the error

#

:/

tender shard
tawny pine
true perch
true perch
tawny pine
tender shard
#

yes

sage patio
#

does not go after, goes instead of that

#

ow

#

no it does not

#

nvm

#

i'm stuck in 1.12.2

tawny pine
tardy delta
sage patio
tawny pine
# tender shard ^

wait what should i put on line after that i tried CrossbowMeta.addChargedProjectile but error came back 😦

icy beacon
#

I think you should put the learn java on that line

tawny pine
twin crater
tawny pine
icy beacon
#

I think it's class because of the naming convention

tawny pine
tender shard
tawny pine
tender shard
#

CrossbowMeta is the class. you must clall that method on an instance of that class, as it's not a static method

icy beacon
#

learning my doing is a fine approach often

#

but don't do spigot plugins

#

before you learn java

#

?learnjava

undone axleBOT
tender shard
#
CrossbowMeta crossbowMeta = (CrossbowMeta) myItem.getItemMeta();
crossbowMeta.addChargedProjectile(...);
#

and then you have to set back the itemmeta to the itemstack

#
myItem.setItemMeta(crossbowMeta);
vivid skiff
#

How can i check what is a pressure plate or button triggering?

icy beacon
#

get its relative blocks, for a pressure plate it should be the block below (and if it isn't powerable, the block below the block)

#

for the button probably check the direction of the button if that's possible, and get a relative block in that direction

tender shard
#

because detecting it for players is easy, for other stuff, not so much

round finch
#

If it is not a crossbow it will throw error on casting

tender shard
#

they already checked the material of the item

round finch
#

Great 👍

tawny pine
tender shard
#

bruh it refers to your itemstack

tawny pine
pseudo hazel
#

lmao are those yours?

#

i see

#

whqt does the leather builder build

#

armor colors?

#

hmm

tawny pine
#

guys i tried CrossbowMeta crossbowMeta = (CrossbowMeta) myItem.getItemMeta(); but "myitem" cannot be resolved.
i tried replacing it with ItemStack but that didn't work either.

pseudo hazel
#

I mean its quite handy to have these in one place

#

instead of using like 4 different libraries

#

I cant wait for your ItemTrimBuilder in 1.20

#

lol nice

tardy delta
#

put those in one class and make methods that make a static assertion on the held meta type

weak meteor
#

WHY

vivid skiff
pseudo hazel
tardy delta
#

bleh

twin crater
pseudo hazel
#

what kinda things can you build with the item builder

tawny pine
pseudo hazel
#

translate components on item names?

#

yes that makes sense

#

is this your private library or do you post it for others to use as well?

#

i see

#

thats very relatable

tender shard
#

you just mvn deply it somewhere

#

or you just upload it to github and tell people to mvn install it

pseudo hazel
#

yeah

tender shard
#

or you use jitpack but that's so annoying

pseudo hazel
#

but like I like writing my own things instead of using libraries for evrything

#

until it gets to like using nms or whatever

tender shard
#

yeah jitpack sucks. you can just upload your stuff to github, then other people can clone it, run mvn install and then they can use it as dependency

jagged bobcat
#

is there way to get the item if entity was attacked. Like I want to check if kill was done by bow by player and I want to get the bow that was shot
edit: rewriting doesnt make sense

tender shard
jagged bobcat
#

oh

#

ight

young knoll
#

What if you could apply meta with a consumer

#

🤔

rotund ravine
#

You can?

tardy delta
#

welcome to minestom

#
ItemStack firework = ItemStack.of(Material.FIREWORK_WHATEVER).withMeta(FireworkMeta.class, meta -> meta.setFirework(/* idk */));```
tawny pine
#

Guys I'm trying to use addChargedProjectile
The docs give this example:
void addChargedProjectile(@NotNull ItemStack item)
In this item is supposed to be the projectile.
I replaced "item" with "Arrow" but it says that it "cannot resolve symbol".
Does anybody know why this is or how I might be able to fix it?

tardy delta
tender shard
#

you don't know the difference between classes and instances

#

?learnjava!

undone axleBOT
rotund ravine
#

?learnjava!

undone axleBOT
tardy delta
#

smh

tawny pine
hazy parrot
#

I assume all of us know

young knoll
rotund ravine
tawny pine
young knoll
#

oh?

tender shard
jovial vigil
#

Do anyone know how can I do that when I right click a spawner (block) that it runs a command that opens a gui or that when I right click it a gui will be open?

tender shard
#

sure

tardy delta
#

heehee

tawny pine
tender shard
#

what's your group id?

tender shard
jovial vigil
chrome beacon
tawny pine
pseudo hazel
#

lmao

rotund ravine
#

??

jovial vigil
#

the spawner gui

pseudo hazel
#

check if its an arrow from the given itemstack

#

thats all

jovial vigil
#

or that it adds 100$ to economy when right click

chrome beacon
rotund ravine
jovial vigil
#

a gui*

tender shard
#

I'll create you a nexus account, 5 mins

tardy delta
#

kekw

jagged bobcat
# jovial vigil a gui*

You can use java to do that. Or use skript to make it really fast without learning hard stuff

jovial vigil
#

how do I do it im new?

chrome beacon
#

?learnjava Start by learning Java

undone axleBOT
jovial vigil
#

what is skript

tardy delta
#

we dont use skript here

jagged bobcat
#

^
But skript is a plugin made in java to script simple stuff to minecraft servers.

jovial vigil
#

I dont understand anything now

tardy delta
#

are you trying to code smth?

hazy parrot
#

Skript Is scripting language used to make addons

jovial vigil
#

alr so can I make that every minute 100$ gets added in the spawner and when I right click it I redeem it?

#

I use vault and essentials

rotund ravine
#

Probably?

#

Idk skript

jagged bobcat
#

Probably just need to decide how you want to do.

chrome beacon
#

You can but I wouldn't recommend it

#

You're better off commissioning someone to make a plugin for you

tardy delta
#

give me those 100$ instead

#

?services

undone axleBOT
jovial vigil
#

I mean economy money

#

in server

#

?img

undone axleBOT
jovial vigil
#

this command but it executes when right clicking the spawner

quaint mantle
onyx fjord
#

does bungee api contain an enum somewhere that has all versions and their protocol versions?

jagged bobcat
#

istg I hate spigotmc website it logs me out everytime

chrome beacon
onyx fjord
#

and a method to get player version?

rotund ravine
#

?jd-b

#

?jd-bc

onyx fjord
#

JavaScript is disabled on your browser.

#

arghhh

rotund ravine
quaint mantle
#

20:17:24 [WARNING] [ViaVersion] Ignoring plugin channel in outgoing REGISTER: LMC

Please Help
MY Via Version Isnt Working
And I Get This Error Message

chrome beacon
chrome beacon
#

Not the exact method smh

rotund ravine
#

True

jagged bobcat
#

Does LivingEntity#getEquipment work on Player?

rotund ravine
#

Yes

tender shard
#

Ofc, players are living entities

onyx fjord
#

what this

tender shard
#

wdym

chrome beacon
#

You make an if statement that checks the name?

tender shard
limpid nexus
#
Player player = event.getPlayer();
if (player.getname.equalsignorecase("Name")){
}```
earnest wasp
#

hello, How make Player interact armorstand event with name condition?

chrome beacon
#

._.

earnest wasp
#

I remake my question!

#

sorry

limpid nexus
#

oh

chrome beacon
#

You make an if statement with a name and an entity type check

tender shard
#

listen to PlayerInteractEntityEvent

limpid nexus
#

never used armour stands dont know if you can name them

chrome beacon
#

You can name all living entities

earnest wasp
onyx fjord
#

weird naming

unique eagle
#

hi, how to remove a armorstand if there a no player on the server, i use in onEnable, PluginDisableEvent

armorStand.remove();```

but the armorstand is not removed
jovial vigil
#

@chrome beacon where do I download skript?

#

for my server?

chrome beacon
#

There should be some up to date fork somewhere

#

I don't know haven't used Skript in 6 years

jovial vigil
#

ok do I learn something when using it too?

chrome beacon
#

and the spawn it back on chunk load

jovial vigil
#

skript unity

chrome beacon
#

🤷‍♂️

#

or the Skript discord

#

I believe that exists...

unique eagle
young knoll
#

Depends on the version

chrome beacon
young knoll
#

In newer versions you should use the entity load and unload events

chrome beacon
#

ah right I forgot about that

chrome beacon
#

Then use the entity load and unload events

unique eagle
#

i don't see entity unload event

jagged bobcat
#

What would be best way to store ItemStack in PersistentDataContainer?

chrome beacon
#

Use mfnalexs lib

eternal oxide
#

First, why do you want full items in the PDC?

chrome beacon
#

?morepdc

undone axleBOT
jagged bobcat
unique eagle
eternal oxide
#

no point in storing the whole item

#

just store an ID to tell you what item to use when it hits

tawny pine
#

CrossbowMeta crossbowMeta = (CrossbowMeta) ItemMeta;
I get an error saying "expression expected" on this line, why might this be?

chrome beacon
#

ItemMeta is a class

desert spade
#

Looks like you're trying to cast a class not an object there

tawny pine
chrome beacon
#

?learnjava

undone axleBOT
tawny pine
#

I've checked the docs but couldn't quickly find an answer.

chrome beacon
#

sigh

#

Learn Java basics before starting with your plugin

chrome beacon
#

Go through two or three of the courses above

tender shard
tawny pine
#

ive searched the docs already

#

:/

#

i mean ive fixed most of the errors up to a point

#

except 1

chrome beacon
tawny remnant
rotund ravine
#

You never set the meta back for one

tender shard
#

they assume that you already know how java works

tawny pine
#

dw i fixed my issue 🙂

#

but ty still

#

🙂

vivid skiff
#

How can i get the door opened by a redstone circuit like clicking a button witch opens a door i can get the Door instance

primal rose
#

is there any better way to do colors instead of doing ChAtCoLoR.GREEN

#

isnt that what im doing?

#

ow

wary mauve
#

Is there an easy way to check if a player can break a certain block with worldguard?

#

I can't find it

remote swallow
sterile token
#

I cant understand how people till use things based on such an resource intensive plugin

tardy delta
#

uhh

sterile token
#

Cuz worldedit TPS are absolute amazing 💀 💀 💀

wary mauve
onyx fjord
#

how do i concentrate BaseComponent[] into one BaseComponent?

river oracle
#

you don't need to

#

BaseComponent[] can be sent to your target

#

if it can't we probably may need more api in that area

young knoll
#

It can

echo granite
onyx fjord
#

i got it nvm

vivid skiff
#

How could i fix this in nms, set up the corpse spawn location same as the cow because i whant the cow to be perfectly allined with the corpse to give a hitbox to the corpse, but i don't know why the corpse spawn in the opposite way

river oracle
vivid skiff
#

this is the one for the corpse

river oracle
young knoll
#

Does the suggested method not work?

river oracle
#

because its not CraftContainer

vivid skiff
river oracle
#

you might just need to try multiplying -1

vivid skiff
#

it sets the entity pose

river oracle
#

or ContainerBarrell whatever it is

young knoll
#

Are you sure it isn't wrapped by a craftcontainer for those too?

river oracle
#

and it wasn't wrapped

#
if(container instanceof CraftContainer container){
 container.getBukkitView().sendTitleChange(title); 
}else{ 
System.out.println("Container is not a CraftContainer");
}
#

could also be a scope issue

young knoll
#

Check if it's a CraftContainer with Preconditions first

river oracle
#

now that I see it

#

that's not the issue since I'm not modifying the container at all

#

sendTitleChange is the new API I'm working on

river oracle
young knoll
#

Pretty much

vivid skiff
#

Some NMS method, i don't remember what i does exaclty

river oracle
# young knoll Pretty much
java.lang.IllegalArgumentException: Cannot change title of non-CraftContainer
    at com.google.common.base.Preconditions.checkArgument(Preconditions.java:145) ~[guava-31.1-jre.jar:?]
    at org.bukkit.craftbukkit.v1_19_R3.inventory.CraftInventoryView.sendTitleChange(CraftInventoryView.java:81) ~[craftbukkit-1.19.4-R0.1-SNAPSHOT.jar:git-Bukkit-c371d05]
    at sh.miles.testplugin.TestPlugin.lambda$onEnable$0(TestPlugin.java:46) ~[?:?]
    at java.lang.Iterable.forEach(Iterable.java:75) ~[?:?]
    at java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1092) ~[?:?]
    at sh.miles.testplugin.TestPlugin.lambda$onEnable$1(TestPlugin.java:44) ~[?:?]
    at org.bukkit.craftbukkit.v1_19_R3.scheduler.CraftTask.run(CraftTask.java:77) ~[craftbukkit-1.19.4-R0.1-SNAPSHOT.jar:git-Bukkit-c371d05]
    at org.bukkit.craftbukkit.v1_19_R3.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:54) ~[craftbukkit-1.19.4-R0.1-SNAPSHOT.jar:git-Bukkit-c371d05]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
    at java.lang.Thread.run(Thread.java:833) ~[?:?]
``` I got expected error
#

as was previously happening

young knoll
#

That's good is it not

river oracle
#

this occurred when opening a chest

river oracle
young knoll
#

True

river oracle
#

even though you can change their titles I see no reason to make it exclusive to plugin created gui's. There may actually be use cases for not permanently changing the title

young knoll
#

You can always wait for more feedback

river oracle
acoustic gorge
#

is there someway to wrap text in a lore section, I've tried using \n but it doesn't seem to work and just removes everything after

chrome beacon
#

You can split the string

#

since the lore is a list

chrome beacon
#

👀 I did not know that existed

#

That's very useful

young knoll
#

Neither did I 2 days ago

sterile token
acoustic gorge
river oracle
peak depot
#

how can I use the new thing were you can mix 2 colors to gether and then they have like this smooth transiton

sterile token
acoustic gorge
#

gradients?

peak depot
#

yes

jagged bobcat
#

Gradients.

acoustic gorge
#

I think there are gradient to minecraft color code generators out there

river oracle
acoustic gorge
#

or you can install a plugin that will do it for you

river oracle
#

Or my api called DustChat

#

Both utilize gradients in text

peak depot
#

thanks

peak depot
river oracle
#

you need to shade it lmao

peak depot
#

bro

river oracle
#

this is on you

peak depot
#

nvm

#

my bad

acoustic gorge
#

you can post pictures

young knoll
#

And blue

acoustic gorge
#

^

serene sigil
#

how to disable explosions in a world completely? (i legitimately couldnt find anything on google)

wise mesa
#

what does Entity#remove() do

serene sigil
wise mesa
#

okay

#

yea i was gonna ask what marking it for removal means

#

does it mean it will be removed at some point in time

#

then why does it say mark

#

next tick would make sense

#

appreciate it

acoustic gorge
#

I know you can with worldguard

serene sigil
#

ye but i dont want to

acoustic gorge
#

You could use this to see if the entity is tnt and then cancel the event

sullen marlin
smoky adder
#

hello, I'm trying to deactivate the onIncentoryClick event through a command, I use a boolean variable if this is true the event will be setCancelled(true) otherwise it will be false. This is the code https://pastebin.pl/view/74021ae2
When the /edit command is executed, the plugin always remains in true...

bold vessel
#

Hi ! I have a question, can i put a custommodeldata only on leather leggings with by example color code #FFFFFF

sullen marlin
#

Sure, ItemMeta supports custommodeldata

river oracle
#

custom model data does all the lifting you'd need

#

for example if the model data 1 is taken just use 2

#

you have up to 2,147,483,647 possabilities

fluid river
#

guys

#

anyone knows why this freaking square appears

#

project is UTF-8 in both maven and settings

#

never had this issue before

bold vessel
river oracle
#

no as I explained you wouldn't need that anyways

sullen marlin
#

Maybe Minecraft doesn't have that font

sullen marlin
#

The API is all there

fluid river
#

i mean

bold vessel
fluid river
#

i literally had no issues with all my other plugins before i coded this one

sullen marlin
#

I mean that character

fluid river
#

there is no

sullen marlin
#

Have you used that character before

river oracle
fluid river
#

starts with color

river oracle
#
if(leath.colorOrWhatever().equals(myColor){
  leath.setModelData(1)
}
fluid river
#

without the plugin everything works fine

#
Bukkit.broadcastMessage(ChatColor.translateAlternateColorCodes('&', "&3Player &d" + pups.getName() + " &apooped: &e" + message));```
#

wait what

sullen marlin
#

Look at the code block

onyx fjord
#

how long can motd line be before it overflows

sullen marlin
#

Something hidden in that string

#

Delete it

fluid river
#

omgggggg

#

it is not visible in eclipse

river oracle
#

there is no point

bold vessel
#

Ok

river oracle
#

you have 2.7 billion model data

onyx fjord
#

i love invisible whitespace characters

bold vessel
#

its ok

river oracle
#

because you have 2.7 billion integers

bold vessel
#

i understand

#

nvm

river oracle
undone axleBOT
#

It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.

river oracle
#

?paste

undone axleBOT
smoky adder
#

Ok

river oracle
#

why are none of your links embeding

smoky adder
river oracle
#

you know this code does the enabling and disabling for every single player right

#

thats bad design

smoky adder
#

But this isn't work, do you know why??

#

Sorry for the english

river oracle
#

🤷‍♂️ probably has to do with there being multiple players or something

smoky adder
#

I swear I'm going crazy about this

last sleet
#

and instead of keeping local variables, like enableInv, in objects, you can make a config file

last sleet
#

Every time an event or command in the public class BreakEvents is used, a new BreakEvents object is created (I think). Along with that (because the boolean enableInv is not static, a new enableInv field is created. This means that when an inventoryClickEvent is fired, EnableInv will always be false

young knoll
#

An ItemBuilder has already been rejected as a feature

last sleet
#

(because false is the default)

young knoll
#

Yes

last sleet
young knoll
#

Ah

desert spade
copper scaffold
#

is there a way to make more than one default config?

undone axleBOT
smoky adder
mighty pier
#

kamehameha code

smoky adder
desert spade
#

Your main class

#

Send the code for your main class

#

The one that is the java plugin

mighty pier
smoky adder
#

Before i tryed wirh an arraylist of player

#

But don't work too..

mighty pier
#

he means the class that extends javaplugin and has the onenable method

desert spade
smoky adder
#

Ok

#

thank you all👋

wise mesa
#

is there a difference between scheduler.runtask and runtasklater with a delay of 0

young knoll
#

I don’t think so

#

In fact a delay of 1 should also be the same iirc

smoky adder
#

That's work If i make enavleInv static

#

can you show me an example or the piece of code where I went wrong (I'm learning java by myself and I still don't know many things ..)

#

right now I've turned everything off but if maybe you write the steps tomorrow I'll do it

#

Ok

#

Is only Two steps?

#

And if i follow this steps the plugin work without enableInv static?

young knoll
#

Check the config

lethal python
#

when a door breaks because it has no block underneath it is that a BlockBreakEvent or BlockFadeEvent

smoky adder
#

then if i create a variable called for example and and i assign it new BreakEvents() in the main class, the other variable will get a value of ture or false correct me

#

until i see the complete code i don't understand ahha

regal scaffold
#
        event.getPlayer().getNearbyEntities(10, 10, 10).forEach(entity -> {
            if (entity instanceof Player) {
                event.getRecipients().add((Player) entity);
            }
        });
#

Is that the best way to do proximity chat?

smoky adder
#

I have two instances, one that changes the value of the variable, but doesn't let the other know the changed value. the other one doesn't receive the change, so should I cancel one or have the two communicate? (I think delete one)

#

as I told you I'm a beginner I'm trying to learn java because but by myself so I don't know where to start and I base myself on what I need to do, in this case small plugins, but sooner or later I'll do a course sorry for my ignorance

#

Now i understand

#

Tomorrow I'll try to deepen this discussion but I understood what you mean (even if I don't know much English haha)

regal scaffold
#

How to use AsyncChatEvent setFormat and Message

#

If for example I want my format to be

        event.setFormat(ChatColor.GOLD + "<%s, %s>: " + ChatColor.WHITE + "%s: %s");

From left to right:

%s: variable inside the event
%s: variable inside the event
%s: Sender of the event. event.getPlayer()
%s: Message

smoky adder
#

yes, what you said helped me a lot, you also don't understand why I use Google a to write sentences that I don't understand how to say, maybe this is it haha

regal scaffold
#

Different things

#

First I want to change the format

#

I have an idea, 1 sec

#

Does ASyncPlayerChatEvent only trigger when a player sends a message

#

So if I want to edit a receiving message

#

nms

eternal oxide
#

receiving?

regal scaffold
#

If I want to change the message a user receives

#

After it was sent

eternal oxide
#

if you want to change it for ALL players you modify the format/message

regal scaffold
#

Nope

#

Specific

young knoll
#

You can do that too

eternal oxide
#

if you want it different per player there shoudl be a recipients list

young knoll
#

Cancel the event and send it manually

#

Or remove the specific player from the recipients list and then send it manually to them

regal scaffold
#

No broadcast but sending using recipients list is a good idea

#

What about proximity

young knoll
#

Loop all players in the same world and compare distanceSquared

eternal oxide
#

you remove everyone thats out of range

regal scaffold
#

Can't do that async

#

event.getPlayer().getNearbyEntities()

eternal oxide
#

yes you can

regal scaffold
#

Oh you're saying doing it without being async

#

Like

#

Without using the method above

young knoll
#

event.getPlayer.getWorld.getPlayers

regal scaffold
#

Yeah thought so

eternal oxide
#

no you can do a distance calc async

regal scaffold
#

What about performance

#

Is proximity chat bad for performance?

eternal oxide
#

you already have a recipients list in the event so use that to check distance from the sender

regal scaffold
#

Oh true

young knoll
#

True

regal scaffold
#

lol

eternal oxide
#

remove everyone outside yoru specified range

regal scaffold
#

Smart

young knoll
#

Just make sure they are in the same world first

regal scaffold
#

Yeah, to optimize a bit

#

Alright

#

Thanks guys'

ivory sleet