#help-development

1 messages Β· Page 1950 of 1

tardy delta
#

is there a difference between true | false and true || false?

weak wasp
#

yes

#

| is bitwise operand || is logical or.

tardy delta
#

ah ye but is there a difference in outcome when working with booleans?

weak wasp
#

first of all, I have no idea why you would ever use "if true or false", because that will always be true, and there is no need for an if statement, and for the bitwise operand, the data is only one bit, which will always flip to true. So difference, yes. Different result, no I do not believe so.

tardy delta
#

oh okay

#

and if im storing a WeakReference to a player, how long will it stay active?

#

until the player logs out?

#

and the server clears it internal

chrome beacon
#

Yeah

#

Player needs to logout and server needs to GC

tardy delta
#

alright

#

and when is a player object even constructed?

#

playerjoin event?

#

i guess

#

i cant get the player in the prelogin

desert tinsel
#
        Player p = (Player) e.getWhoClicked();
        final String NAME = ChatColor.GRAY+"Donate for a new Section!";
        if (e.getView().getTitle().equalsIgnoreCase(NAME)){
            switch (e.getCurrentItem().getType()){
                case GRASS_BLOCK:
                    int hype = plugin.getConfig().getInt("PlayerHype."+p.getName());
                    if (hype >= 1){
                        p.sendMessage(ChatColor.GRAY+"You has voted for this section");
                        plugin.getConfig().set("PlayerHype."+p.getName(), hype-1);
                        int sk = plugin.getConfig().getInt("Sections.Survival");
                        plugin.getConfig().set("Sections.Survival", sk+1);
                        plugin.HypeGui(p);
                    }else{
                        p.sendMessage(ChatColor.RED+"You do not have enouch hype "+ChatColor.GRAY+"(1)");
                    }
                    break;
            e.setcancelled(true);
}```

When i click on item nothing is happened, why? 
excuse the parentheses and the spaces between them
tardy delta
#

do you have the event registered and is ther a @ EventHandler?

desert tinsel
#

Oh, how stupit i can be, ty

sudden reef
#

Hello

tardy delta
#

ello

sudden reef
#

I can't seem to be able to use --remapped in buildtools

#

I'm trying with 1.18 and 1.18.1 and it says

#

[WARNING] The requested profile "remapped" could not be activated because it does not exist.

chrome beacon
#

I don't think you need that flag anymore

sudden reef
#

but i found in some repos that have this
spigot-1.18-R0.1-SNAPSHOT-remapped-mojang.jar
spigot-1.18-R0.1-SNAPSHOT-remapped-obf.jar

#

oh?

chrome beacon
#

Keep following the instructions without it

tardy delta
#

oh god me and bitwise

blazing scarab
#

foo.bar() | bar.foo()
Will execute both statements even if first is already true

#

And || will not

tardy delta
#

ooh

left swift
#

where is the velocity for the entity that is hit from? I mean the entity moves in the direction it is hit (and up the right height). Where can I get these values?

tardy delta
#

and im wondering if the player is in the prelogin event, the server already stored the player, so its accessible with Bukkit.getPlayer(uuid)?

#

i think its only accessible in join or even after it

blazing scarab
#

uh i doubt

#

It is PreLogin event for a reason πŸ˜›

tardy delta
#

ye..

#

something stupid actually

#

im constructing this user on prelogin

#

so i guess i'd need to set the user later on

ivory sleet
#

yu

sudden reef
#

nvm i found them in my local m2 repo

tardy delta
#

heh conclure have you seen my message?

#

_<

ivory sleet
#

no, tho I suppose you could link me it

tardy delta
#

i was having some issues

blazing scarab
tardy delta
#

lol

blazing scarab
#

Yes that's better; you would have less repeating code related to asynchronousity

#

Find a better name though

tardy delta
#

but the problem is im doing everything async now by default and i wouldnt need a wrapper anymore

#

like this stuff and then i write an implementation for it

blazing scarab
#

It'e about single responsibility

tardy delta
#

and before i needed to wrap everything with a future where now i dont

#

hmm ye correct but why would i handle that in another class if all the implementations need a future?

tender shard
alpine urchin
#

in prelogin event not everything is accessible yet

#

afaik the player might not be authenticated

tender shard
#

the prelogin event, the UUID might be fake IIRC

tardy delta
#

mhm

alpine urchin
#

yes

#

but you get the player reference

#

if you store it, it can be used later

tardy delta
#

i should better do my stuff in the login event i guess

tender shard
#

are you sure?

#

iirc there's no player in the pre event

alpine urchin
#

Yes

tender shard
#

hm ok

alpine urchin
#

oh

#

my bad

#

thats PlayerLoginEvent

blazing scarab
#

If you are going to make a new Storage impl, then you'd have to use CompletableFutures there - which is boilerplate. Futures needs exceptional handling and executors. With delegate, yoy just write a new storage implementation, and create a new delegating one which will do all asynchronousity for you

tender shard
#

ah

alpine urchin
#

im stupid

tender shard
#

yeah

#

np lol

tardy delta
#

i was thinking of having one

blazing scarab
#

i mean, object

left swift
#

where is the velocity for the entity that is hit from? I mean the entity moves in the direction it is hit (and up the right height). Where can I get these values?

tardy delta
blazing scarab
#

new AsyncStorage(sqlStorage, executor, logger);
new AsyncStorage(mongoStorage, executor, logger);

alpine urchin
#

where is that called

#

do you also wanna tell us what you’re doing

#

maybe theres a different approach

left swift
tardy delta
#

i dont have the code yet but it will be something like

storage.loadUser().whenComplete((user, throwable) -> user.onClientReady(plugin))```
tender shard
#

event#getDamager() then get the velocity from that

alpine urchin
#

what are you making

#

@tardy delta

left swift
tender shard
tardy delta
#

im making a kind of kingdom plugin and im storing a bunch of stuff for the player in the User class

alpine urchin
#

i assume its a directional vector

tardy delta
#

then loading that user when they join

#

and handling some stuff

alpine urchin
#

that you cant use PlayerJoinEvent

tender shard
#

^

tardy delta
#

not as in the prelogin i think

tender shard
#

just use the regular PlayerJoinEvent

alpine urchin
#

so PlayerJoinEvent is fine?

tardy delta
#

i think, but alex isnt playerjoin going to be too late?

#

if the db request isnt blocking (which is like that) the player can be on the server earlier than when its stuff is loaded

blazing scarab
#

The main advantage of pre login event is the asynchronousity

#

You can avoid race conditions

tardy delta
#

yee that

left swift
sacred mountain
#

hello i cant seem to find out how to do this:

Im trying to use a custom syntax in my config file -

<PotionEffect>:<Amplifier>:<Duration>

e.g.

Effects:
  - "ABSORPTION:2:120"
  - "REGENERATION:2:8"

I'm not sure how to split the config string and get the values and insert them into my code.

tardy delta
#

split by : and parse it to int?

#

and make sure to catch exceptions

alpine urchin
#

what data are you extracting

#

as the player isnt authenticated

#

what data will you need later

#

id still use joinevent and an executor service for io operations

patent horizon
#

?paste

undone axleBOT
tardy delta
#

im loading all the homes of that player, the chatchannel he's in and his kingdom

#

like five homes max

grim ice
#

when to use weak references btw

tardy delta
#

im also loading the stats but thats not really something i need from the beginning

sacred mountain
tardy delta
#

just String[] arr = thatString.split(":")
int levelIGuess = Integer.parseInt(arr[1])
int durationIGuess = Integer.parseInt(arr[2])

#

smth liek that
and catch exceptions if the user is stupid to write strange stuff

grim ice
#

oopsie

sacred mountain
#

ghost ping smhsmh

grim ice
#

yep mb

grim ice
sacred mountain
#

yeah i could just print like "invalid config" and gen a new one

grim ice
#

to contain these values

tardy delta
#

gonna take a nap now

#

uhh

sacred mountain
tardy delta
#

if you need it that often

#

maybe

#

night

alpine urchin
tardy delta
alpine urchin
#

drink spigot wayer

#

before sleep

#

water

tardy delta
#

num num

#

water healty

grim ice
#

healthy

#

yall drink from that

alpine urchin
#

so

sacred mountain
#

wrote that on a phone dont judge tthe syntax

grim ice
#

well yeah

#

but u can just make an effect clas

#

to load it then return an arraylist or array of the effects

sacred mountain
#

3d array

#

or

#

wait no

blazing scarab
sacred mountain
#

why do i need a class for it

grim ice
#

its to load from his config

#

wouldnt it make it easier to access

blazing scarab
#

How so

grim ice
sacred mountain
#

its in a for loop so

grim ice
#

wouldnt it look better with a class to just load the effects

sacred mountain
#

it will add the effect going through the config list

grim ice
#

and get info from it

sacred mountain
#

what would it return tho

#

the exact same thing in an array?

grim ice
#

just easier

#

for example

#

Effect.load()

#

will return arraylist of effects

#

or Effect.getByName("ABSORPTION").getAmplifier() for example

#

would be more convenient imo

blazing scarab
#

wat

#

imo, just an overcomplication. you can just make dome static util methods to parse the enchantment

grim ice
#

it looks more organized for me

hollow bluff
#

?learnjava

undone axleBOT
sacred mountain
#

couldnt i just parse it inside the listener, its only a few lines

grim ice
#

that would look ugly but you do you

#

i wouldnt put everything in my listener method

#

i would divide things to seperate methods

sacred mountain
#

well ill try it and see how it works out

#

im not the best at creating methods that return something

#

might have to be spoonfedn

grim ice
#

I mean

sacred mountain
#

do i just return 3 variables

#

after parsing

#

and then use those

#

in the listener

grim ice
#

return an arraylist of Effect (the class u made) if u wanna do what i suggested

#

and the effect class has fields of name, amplifier and duration

blazing scarab
grim ice
#

its to interact with the config

#

anyways good night

weak wasp
#

I had to be spoonfed for like everything. Mangled mashed together stuff, that was honestly good code, simply because there was so little of it. Then you start to make your own code from examples, get real code, and don't ever "need" someone else's examples

gaunt saffron
#

hello?
anyone with LOTS of ram willing to help me?
i need a HUGE .schematic (for example 1.17.1 worldedit) at least 1k x 1k, preferably way larger....
i can't generate higher than 500 x 500 and i know bigger exist

neon minnow
#

What are you even talking about

#

Learn java?

#

What the hell are you on about

#

I literally sent the code with an error message, trying to understand whats wrong

#

You are not helping at all

#

and anyways , this isnt my code

#

this is a json api

#

(part of it) thats causing an error

gaunt saffron
weak wasp
gaunt saffron
weak wasp
#

that's not typical Minecraft answers though

#

If I use textures larger that 8k by 8k, I get spyware that says not doable because of hardware, not the software you just changed. This game sometimes

gaunt saffron
#

tbh 10k x 10k would be perfect

#

but if i try making 1k x 1k my pc freezes lol

weak wasp
#

I duno dude, you usually use a buffer, which is just a partial view of a larger file.

#

for examples if you have a 4GB txt file on XP or something, you can not get the whole thing in ram at once, but you can use memory to view what you need to view.

#

only ever need 4MB of RAM to access the memory which is built into the CPU Cache

#

That's like ancient stuff I have pretty much forgot

#

Want 500TB of storage for $0.99, then end up getting it...

#

but the memory fades, and where are the files?

lost matrix
gaunt saffron
#

i want one big 10 k x 10k blocks or 60 x 60 chunks

lost matrix
#

Doesnt FAWE handle schematics of that size?

chrome beacon
#

It does

gaunt saffron
#

does fave export in same as worldedit?

chrome beacon
#

Yes

gaunt saffron
#

like exactly same

#

ok lemme try

#

because schematics from internet don't work...

#

i'll get fave 1.17.1

midnight shore
#

Is there any way to play custom sounds withou using resource packs?

eternal night
#

Where would the custom sound come from then πŸ‘€

midnight shore
#

Like from an URL

tender shard
#

magic

eternal night
#

no

midnight shore
#

Or from a file

tender shard
#

MC is not garry's mod πŸ˜›

jagged quail
#

you'd have to make a custom resource pack and force the player to install it if you want a custom sound

midnight shore
gaunt saffron
#

mmmm downloading stuff to people's pc....

tender shard
eternal night
tender shard
#

yep and that's running in a browser

eternal night
#

^^

jagged quail
#

i would not click a random link in a minecraft server.

tender shard
#

TL;DR
Only possibility to play custom songs is a custom resource pack, or making people click a link and open that link in their browser

#

there is no other way

gaunt saffron
#

just ask for ssh/rdp...

midnight shore
#

Then is it possible via resource packs? Without overwriting any existing sounds?

tender shard
#

yes

#

sure

eternal night
#

Yes, resource packs can have custom sound files

tender shard
#

I can send you an exampe resource pack from my jukeboxplus plugin

midnight shore
#

And how do you play it

#

In game

tender shard
#

/playsound, or just Player#playSound

midnight shore
midnight shore
tender shard
#

no

#

it works for custom songs as well

#

this is the example resource pack for my jukeboxplus plugin

#

works 100% fine with bukkit's playsound method

#

and also with vanilla /playsound command

eternal night
#

you can basically parse your custom sound (namespace + name)

#

oh

#

urgh

midnight shore
#

Ok ty

#

I’ll try

gaunt saffron
eternal night
#

there ya go @tender shard xD

tender shard
#

haha lmao I never realized

#

that I put this stupid song into my plugin

gaunt saffron
tender shard
#

haha one sec pls

midnight shore
#

So in order for a player to hear the sound it needs to have the resource pack installed and also the sound in the same exact namespace right?

tender shard
#

lmao

#

that's the song included in my example pack

#

I didnt even know itwas included

dusky sky
#

how to turn off portal transfer
i dont want my players to make portal farms

tender shard
#

players? entities?

#

cancel EntityPortalEvent

#

or for players, PlayerPortalEvent

gaunt saffron
dusky sky
#

so portal farms will not work

tender shard
#

as I already said, use EntityPortalEvent and cancel it if applicable

neon minnow
#

for (p in player) server.dispatchCommand(server.consoleSender, "tellraw " + p.name + " " + json)

why does this

Command Dispatched Async: error
[21:35:00 ERROR]: Please notify author of plugin causing this execution to fix this bug! see: http://bit.ly/1oSiM6C
java.lang.Throwable: null

cause this error

neon minnow
# tender shard what is player?

fun sendRawJson(json: String, vararg player: Player) {
val server = Bukkit.getServer()
for (p in player) server.dispatchCommand(server.consoleSender, "tellraw " + p.name + " " + json)
}

tender shard
#

do not access the bukkit API async

quaint mantle
#

How do I delete a resource from my page

tender shard
#

the link literally tells you that

tender shard
neon minnow
tender shard
neon minnow
tender shard
#

Bukkit.getScheduler(), then schedule a synced task

#

?scheduler

#

?scheduling

undone axleBOT
neon minnow
#

or the Jsonapi tellraw

#

class ChatListener : Listener {
@EventHandler
fun onPlayerChat(e: AsyncPlayerChatEvent) {

tender shard
#

for the whole for loop that runs dispatchCommand

neon minnow
#

i got this json chatr api thing

#

from

#

/**

  • Any questions, comments, or suggestions, feel free to contact me at justis.root@gmail.com
  • Version 2.3.0
    */
#

i found it somewhere on google

#

soooo?? what, do i put scheduler on the json around it

tender shard
#

call the whole method from a synced task

#

?scheduling

undone axleBOT
tender shard
#

e.g. BukkitScheduler#runTask

neon minnow
alpine urchin
quaint mantle
#

How long does it talk for resource reports to be responded to

mint mesa
#

is there any way to check if a block is from 1.9+?

tender shard
mint mesa
#

doesnt that return the ID of the block?

alpine urchin
#

?

tender shard
#

what exactly are you trying to do?

#

?xy

undone axleBOT
mint mesa
tender shard
#

so do as I said

#

use Material.valueOf("DIRT")

#

inside a try/catch

#

or use Material.matchMaterial

#

if it's null, the block doesn't exist

eternal night
#

second one is probably easier

tender shard
#

yep

eternal night
#

avoiding those nasty try-catches

tender shard
#

I mean you could use do stuff like

#

Bukkit.getClass().getPackage().split to find out the version

mint mesa
#

thats great thank you

midnight shore
#

How can I get an ItemStack from a configuration section?

tender shard
midnight shore
#

Oh

#

Ty

tender shard
#

np

midnight shore
#

And what if I want to save an enum? And get it back?

#

GetEnum?

#

Or I need to get it as a string?

minor otter
#

what event handles when you break a tripwire and all the wire near it is updated

spiral light
#

probably BlockPhysicsEvent maybe

carmine mica
#

Is there a way to get the current player coordinates?

spiral light
#

yes ^^ xD

#

player.getLocation ?

carmine mica
#

okay thanks

#

What would I import to use that?

minor otter
spiral light
#

then maybe the blockredstoneevent

#

but also possible that there is no event

carmine mica
young knoll
#

Player

carmine mica
#

theres no org.bukkit.player

young knoll
#

Yes there is

carmine mica
#

only gives me offline player

#

entity ?

#

ah

#

found it

#

thanks

#

it was entity.player

young knoll
#

Your ide should handle imports for you

buoyant viper
#

he writin in notepad

carmine mica
#

nah

alpine urchin
#

or as an int

#

with Enum#ordinal

#

it returns the index of that constant

#

hovering over an enum constant in IntelliJ tells you its ordinal(index)

wary harness
#

after a lot of struggle

lost matrix
#

But wait for the cream !

young knoll
#

Structure gel?

#

No wait that’s a mod

wary harness
#

Struklji are better

#

Croatian Struklji check it out on google @lost matrix

lost matrix
wary harness
#

Any one can point me to some PDC tutorial

#

I remember there was one

#

like when thing came out

#

but I am unable to find it

young knoll
#

?pdc

wary harness
#

thanks

#

?help

undone axleBOT
#
CafeBabe Help Menu
*Red V3*
**__Admin:__**

selfrole Add or remove a selfrole from yourself.

**__Cleanup:__**

cleanup Base command for deleting messages.

**__Core:__**

embedset Commands for toggling embeds on or off.
info Shows info about CafeBabe.
licenseinfo Get info about Red's licenses.
mydata Commands which interact with the data CafeBabe has about...
set Commands for changing CafeBabe's settings.
uptime Shows CafeBabe's uptime.

**__Downloader:__**

findcog Find which cog a command comes from.

**__Mod:__**

names Show previous names and nicknames of a member.
userinfo Show information about a member.

**__ModLog:__**

listcases List cases for the specified member.
reason Specify a reason for a modlog case.

**__Permissions:__**

permissions Command permission management tools.

sacred mountain
#

wouldnt the client have to get info from the server to display that tho

#

like get the data of the structure block to display the outline

young knoll
#

Yeah I think you can mess with it via plugin

carmine mica
#

Okay, so I have this Player player; but it wants me to initialize the variable player. what value would I give it?

quaint mantle
#

go use it in constructor

#

btw

young knoll
#

A player

quaint mantle
#

?learnjava

undone axleBOT
young knoll
#

Where you get that player instance is up to you

fervent gate
#

Is this not the right way to work with actionbars?

#

It seems like it doesn't create the new actionbar

#

Because the previous one needs to be removed, which I thought was automatic.

#

Then a new one needs to be created.

worldly ingot
#

Looks like you're in a switch statement

#

With no breaks

#

Switch statements fall through.

int value = 1;
switch (value) {
    case 1:
        System.out.println("1");
    case 2:
        System.out.println("2");
    case 3:
        System.out.println("3");
    case 4:
        System.out.println("4");
    case 5:
        System.out.println("5");
}```
#

1, 2, 3, 4, and 5 will be called here

young knoll
#

Yay labels

carmine mica
#

I figured the player.getLocation() stuff out, but I get this output. Is there a way to just get X Y Z instead of what it does now?

young knoll
#

getX

#

getY and getZ

#

Use the javadocs

#

?jd

carmine mica
#

oh, okay thank you

#

Since getX/Y/Z gives you a float value I looked a bit through the docs but couldn't find a way to just get the int value of the location

young knoll
#

getBlockX/Y/Z

dawn hazel
#

alright so im developing a bungee plugin and i realized i needed to hide commands that have perms from command tabbing. im genuinely confused as to how to properly do it tho cause i cant find any info on it

wicked remnant
#

Is it possible to manually send a player the default no permission message?

carmine mica
wicked remnant
dawn hazel
#

thats exactly what im saying

#

i need to hide the command from players without the permission

#

except this is a bungee plugin

young knoll
#

Spigot handled that for you

#

Does bungee not

wicked remnant
#

also share your code if you want useful help

#

i.e. github link or pastebin

dawn hazel
#

i mean knowing the code doesnt really help

#

cause there isnt any code that would be of any help

#

i need to disable tab complete on bungee

#

but none of the info i can find doesnt help in the slightest

dawn hazel
#

cause you cant use spigot api in a bungee plugin

#

and i know that it is possible to prevent tabcompletion

waxen plinth
#

What exactly are you doing with structures?

dawn hazel
#

and yes i do know that there is a way to prevent tab completion by just blocking it from bungee itself

#

but this is a public plugin so i cant do that

young knoll
#

According to that git issue you just need to bind a permission to the command

dawn hazel
#

that would be nice to know but i cant find any documentation showing how that is

#

cause no one ever develops bungee plugins

young knoll
#

On spigot you just add permission: x.y.z to the command in the yml

dawn hazel
#

if only bungee api worked the exact same as spigotapi

#

it doesnt work that wayu

#

with bungeecord you dont specify the commands in plugin.yml like you do spigot

young knoll
#

Wack

dawn hazel
#

you have to manually reference them in the main class

#

and then
public Command(String command) {
super(command);
}

#

its very annoying and wonky

wicked remnant
#

i'd argue using plugins.yml is way more clunky

dawn hazel
#

except i just realized i am stupid

#

except my monkey brain is wrong again

#

cause that didnt fix the issue

quaint mantle
#

why needdin lobby para

dawn hazel
quaint mantle
#

no

#

the parameter

#

lobby

#

is unsued

dawn hazel
#

yeah i know

quaint mantle
#

*unused

dawn hazel
#

this is what happens if i remove it

#

and im too lazy to fix it

quaint mantle
#

imagine

dawn hazel
#

cant imagine my laziness

#

but i can imagine how much pain my pc is under rn

#

considering im running an entire server network locally

#

i mean im sure its fine

buoyant viper
#

like new LobbyCommand("string")?

dawn hazel
#

mhm

buoyant viper
#

then thats why it gives u an error

dawn hazel
#

yeah i know

#

i know why im getting the error

buoyant viper
#

then fix it >:(

dawn hazel
#

but it isnt causing anything significant or preformance issues

#

sooo

#

idrc

#

ill fix it when it becomes an issue

lost matrix
#

It wont compile. Thats an issue...

dawn hazel
#

i mean

#

and if i replace the string it works just fine

lost matrix
#

Then you fixed it already

dawn hazel
#

i mean

#

i wouldnt call it fixed

#

id call this plugin an absolute mess

#

zero code notations

waxen plinth
#

Not sure but I have a tool that can be used to similar effect

stray crescent
#

Does anyboyd know how to open a .jar file with VScode?

waxen plinth
#

?xy

undone axleBOT
waxen plinth
#

Oh sorry I sent this message and then left lol

#

I have a MultiBlockStructure utility in my library that lets you define, test for the presence of, build, and visualize structures

#

Rotated/mirrored if needed

torn shuttle
stray crescent
#

does anyone know how I can open a .jar file with VScode?

waxen plinth
#

?xy

undone axleBOT
waxen plinth
#

"the only response I got last time I asked was an xy post. guess I'll just ignore that an post the same question again without any extra details"

#

🌚

stray crescent
#

DUde

#

I TRIED so much

#

2 hours

#

on the internet

#

with tutorials and tyring to understand

#

so i thougt

#

why not

#

ask a NICE person

#

but ur just acting like a main character

wet breach
hexed hatch
#

lmao

stray crescent
#

oh yeah

#

a link is gonna help

#

definetly

hexed hatch
#

yeah maybe if you clicked it

quaint mantle
#

vscode is shit

#

its slow, and feels like a text editor

#

you need 30 plugins for it to even be as simple as intellij

#

only reason i'd see people using it are if they are on a lower end pc or are just developing to get a feel

#

both of which i can respect

hexed hatch
#

I can't imagine a good reason to use vscode over intellij or eclipse

quaint mantle
#

correct

stray crescent
#

i keep finding programs were i can like view and edit weirly

#

but i need the whole folder in vscode so i can save it as jar again

#

but ya'll just messing with me wasting my time

hexed hatch
#

No one is messing with you

#

You just have no idea what you're doing and you refuse to be corrected

stray crescent
#

I do have an idea of what I am doing, and I know exactly which files to go into. I'm originally a source developer, and I've never worked with Java and jar shit.

#

Which IDE extension on Eclipse should I use to decompile and compile jar files?

lost matrix
stray crescent
#

Exactly

#

a Plugin file

#

I got both Eclipse and VSCode.

vocal cloud
#

The question we're trying to make you answer is why

stray crescent
#

To change all the help commands that pop up in the chat

#

the plugin didn't give so much optimization

#

and it looks trash

#

so im changing it

#

how is it that interesting

#

Just again, I've seen the files multiple times in programs, I just don't understand the workflow of making an edit in a jar file and then saving it into it

vocal cloud
#

Because if it looks trash why not write a new one from scratch? Editing a jar is something quite beyond a beginner level thing

lost matrix
#

You could also write a plugin that listens to the command, cancells it and prints the commands in pretty.
Anyways: jars are just compressed archives. Like zip for example. What you want to do is get the .class file from the jar,
edit it and put it back into the jar.

#

Not sure if that works to be honest...

#

Let me think how that would look in bytecode

vocal cloud
#

Editing a .class file is a byte code game

worldly ingot
lost matrix
#

Hm yeah so just editing a class file wont work. Maybe decompiling, editing and recompiling would work.

vocal cloud
#

I rewrote a base spigot class file once. That was fun. "Fun". It's doable but you really need a firm grasp on how things work

lost matrix
#

asm

vocal cloud
#

You can use 3rd party tools as well that allow you to edit classes on runtime load the library in modify the class save it and voila

lost matrix
# stray crescent so im changing it

long story short: You cant. Unless you have quite a bit of time on your hand and know exactly what you are doing.
Its probably faster to learn java and write a plugin that listens to the command event...

stray crescent
# vocal cloud Because if it looks trash why not write a new one from scratch? Editing a jar is...

@vocal cloud Because writing what I want from everything I know with Java would take me around 1500 hours, and you might say "oh but it's good that you learn". Well again, us humans co-exist to be good at different things. And I don't want to spend that time when I can work more efficiently. As I said, I develop games with C++ and Lua daily, and I've never stumbled upon having to decompile a jar file so please excuse my beginner levels. I find it annoying that you're all the time trying to sidetrack me and you decide "for me" what I want and not. I've tried to state clearly 4 times what I am looking to do, and though that was right to do since the text-channel is called "help-development" and is very fitting for my purpose of being here. Trust me, I know what I want, and making an edit in this plugin is what I want. And I gave you my answer to why I don't make one from scratch but I can give you an even longer explanation. I'm starting the Minecraft server to hopefully have a smaller and passive income, boo you if you don't believe in it's success - I couldn't care less. So having to write all this code when I could've spent my time on making money other ways and letting all my source/unity knowledge go to waste would be less efficient.

vocal cloud
#

Alright fine you want it that way? Here's how you do it.

#

Download intellij

stray crescent
#

here we go

#

finally

#

alr

vocal cloud
#

You make a project get maven load the jar in as a local library

quaint mantle
#

nope

vocal cloud
#

Then load spigot in as well

quaint mantle
#

download the plugin for intellij named minecraft development

vocal cloud
#

No

quaint mantle
#

why not πŸ˜‚

vocal cloud
#

Because this isn't plugin development

quaint mantle
#

oh

#

hes still want to edit a jar?

#

go decompile it

#

to edit

#

instead of editing a class file

#

use fernflower/forgeflower or quiltflower (better than the previous) to decompile them

vocal cloud
#

Usually decompiling doesn't work for me shrug1

#

But if it works for them then they can go that route

#

very

#

I mean technically speaking we don't even know if this user has permissions to modify the contents of said jar file anyways

quaint mantle
#

who cares if we dont public it

vocal cloud
vocal cloud
quaint mantle
#

😏

vocal cloud
#

No one can reload plugins on my watch

lavish hemlock
#

Aren't there tools for editing decompiled jars?

#

But yeah decompiling has one major problem:

#

Decompilers are not typically perfect

#

They will decompile to broken source as it is hard to interpret source -> bytecode with how much information is lost in translation.

vocal cloud
#

My method will achieve exactly what this person wants no matter how painful it might be to do.

wet breach
#

o.o

lavish hemlock
#

Dude

#

I just had a great idea

#

I should open bytecode modification commissions :)

#

My knowledge of JVM bytecode is stronk

#

(I am aware of the legality issues)

#

(But, this is GPL-licensed software, it allows for modification)

terse panther
#

Hey, I created a custom entity with NMS[A zombie pigman] to replace the natural zombie pigman (canceling the event to spawn the custom entity [Another zombie pigman but angry]) but I'm getting A LOT of custom zombie pigman and I dont know why

#

I think this is because they are not considered on the mobcap, but idk

lost matrix
lost matrix
#

Primitive approach: Dont cancel the event and remove the entity instead. Might just work.

#

If you want to properly replace vanilla entities then you need to overwrite them in the nms registries

kind hatch
#

I'm running into a really weird issue. I have an "item swapper" of sorts for my GUIs and for some reason, when I try to change one specific item with another, it gives me an NPE. The weird part is that the method works perfectly fine in every other class that calls it. So I'm at a loss as to why I'm receiving one in the first place.

ebon arrow
terse panther
stray crescent
#

listen on the name

#

who names their software

#

"bedrock

#

"

#

bed-rock"

#

like what kind of software name is that

#

seriously

terse panther
#

thanks!

ebon arrow
#

It's Minecraft bedrock edition... Not just bedrock, along with a VERY successful company that is making millions and still rising.

lavish hemlock
#

Well the name Bedrock comes from the block Bedrock

#

from Minecraft

#

And fun fact about Bedrock

#

You literally cannot destroy it in vanilla

#

So it's not the worst word they could've picked :p

kind hatch
#

Yea you can. With E X P L O I T S

lavish hemlock
#

Not intended ^

#

Should've said "intentionally"

vocal cloud
#

Vape on it

ebon arrow
#

Technically you could. It just takes like 4 days irl time

vocal cloud
#

Could be worse. Could be attempting to edit the bytecode of an open source project. gunSelf

lavish hemlock
#

I remember hearing that the game sets the block's resistance/hardness to an infinite value.

#

Or that

#

It literally makes it impossible to progress the breaking state

kind hatch
#

Me when I get the block breaking effect on bedrock. o.o

vocal cloud
#

Same as stone so go mine some stone

vocal cloud
kind hatch
#

Actually, can't you now change what blocks have the bedrock like attributes? Something with the new tag system Mojang have been working on.

lavish hemlock
#

Oh god ughhh

ebon arrow
vocal cloud
lavish hemlock
#

Who needs a disassembler when you have HxD

#

Start counting those indices, bitch :)

vocal cloud
#

Be Me
Come in being ask generic question
Get annoyed response
Respond with aggression
Call people entitled
Insist that they know the best way to do it is editing the Bytecode
Plugin I'm trying to edit the bytecode of is open source

sigh

lavish hemlock
#

Hehehe

ebon arrow
#

The amount of plugins that I have tried to decompile, do my edits and then recompile them and then DONT WORK, is.... all of them.

lavish hemlock
#

Yeah that's why decompilation doesn't really work

#

It's good for analysis!

#

But for editing, no.

ebon arrow
#

Oh yeah, I use it to see how people did stuff all the time

vocal cloud
#

Yeah but the original question was

ebon arrow
#

saw that.

lavish hemlock
#

Ugh

ebon arrow
#

I tried using vscode for a bit

#

did not like it

vocal cloud
#

Hey I'm trying to edit the towny jar -> towny open source -> done

#

But it was like pulling teeeth

ebon arrow
#

but now i switched to intellij and i like it so much more

lavish hemlock
#

That's cuz IDEA is designed for Java unlike VSC :)

ebon arrow
#

probably mostly cuz its easier to set up maven with a plugin then eclipse but still

#

I still wanna figure out a way to auto increase the version number of a plugin automatically when I export it, but thats a maven problem

terse panther
#

there is a guide to overwrite vanilla entities with NMS?

kind hatch
ebon arrow
wet breach
#

in a game so give me a few lol

wet breach
# ebon arrow how? :)
GitHub

Bukkit Plugin for in-game player tutorials. Contribute to frostalf/ServerTutorial development by creating an account on GitHub.

GitHub

Bukkit Plugin for in-game player tutorials. Contribute to frostalf/ServerTutorial development by creating an account on GitHub.

#

if use it like I have there, anytime you update the version in the pom, the plugin verison will be the same in the file πŸ™‚

#

no more having to do it yourself lol

vocal cloud
#

Bro I'd have 2000 versions

ebon arrow
terse panther
warm light
#

how to remove drops in BlockBreakEvent?
using event.getBlock().getDrops().clear();
but not working

minor otter
#

is there a good way to update the state of a decent area of blocks without individually going through them all

terse panther
warm light
#

ok thanks. let me try

terse panther
#

But .clear might works

warm light
warm light
waxen plinth
#

?jd

terse panther
#

but on the event

warm light
#

got it😢

terse panther
#

not on block methods

waxen plinth
torn badge
terse panther
warm light
terse panther
#

So, i need to override the mob on NMS but I dont know how :(

torn badge
waxen plinth
#

That, or use BlockDropItemEvent instead

terse panther
#

xD

torn badge
#

What event are you using?

terse panther
#

take entity.remove and e.cancel(true) like the same

#

on essence makes the same thing on this context

torn badge
#

What does isAngryPigman()?

vocal cloud
#

Read the documentation on it

terse panther
#

is a config option, to the user to decide if custom pig or vanilla pig, its a boolean

terse panther
#

There is a way, but I cant find it

torn badge
#

Did you still try to cancel the event instead of removing the entity?

terse panther
sand hinge
#

pls how to remove !!java.util.uuid

#

pls help me

blazing rune
#

How do I loop through a player's team

torn badge
terse panther
# terse panther This

Mob cap is the limit of mobs in a world
If the mob doesnt count for the mob cap, minecraft thinks it can continue spawning mobs, causing a lot of mobs spawn like this

#

because it doesnt have a limit

#

can reach 1000+

quaint mantle
#

mob 🧒 ?

terse panther
blazing rune
#

Ok how do I like loop through a player's assigned te am

#

Anyone?

terse panther
#

But isnt a clean solution

blazing rune
#

Dude

sand hinge
minor otter
#

Im trying to get the surrounding tripwires blockstate and update it using

if (blockBroken.getType() == Material.TRIPWIRE) {
                List<Block> blocks = new ArrayList<>();
                blocks.add(blockBroken);
                blocks.add(blockBroken.getRelative(BlockFace.NORTH_WEST));
                blocks.add(blockBroken.getRelative(BlockFace.NORTH));
                blocks.add(blockBroken.getRelative(BlockFace.NORTH_EAST));
                blocks.add(blockBroken.getRelative(BlockFace.WEST));
                blocks.add(blockBroken.getRelative(BlockFace.EAST));
                blocks.add(blockBroken.getRelative(BlockFace.SOUTH_WEST));
                blocks.add(blockBroken.getRelative(BlockFace.SOUTH));
                blocks.add(blockBroken.getRelative(BlockFace.SOUTH_EAST));
                for (Block b : blocks) {
                    b.getState().update(true, false);

                }
}
#

however it doesnt seem to work, most of the wire, will yes have its blockstate updated but some parts will remains wrong

drowsy helm
#

show your code

#

Looks like you're doing a chatComponent Wrong

#

oh you have a config problem

#

what plugin

minor otter
#

Is it a bedrock only server or cross platform?

#

Does the item appear like that on java?

#

That would be the issue

#

Not sure how you would fix it just in the configuration

desert tinsel
#

what is that error and how i can solve this?
Cannot invoke "me.xsenny.sennyhype.SennyHype.getConfig()" because "this.plugin" is nul

blazing scarab
#

plugin is null

desert tinsel
#

how

hardy swan
#

you need to provide further info for us to be able to help you

lost matrix
# desert tinsel how

Because you dont fill the variable... And a variable without a reference will be null on default

west oxide
#

hello everyone !

am trying to download the 1.18.1 api with buildtools and it wouldnt let me as it says that am using java8 how can i change that ?

simple frigate
#

apologizes if this is a dumb question, but does serializing an ItemStack with ConfigurationSerializable keep data stored in PersistentDataContainer? This was what was stored, and it doesn't seem like it does.

    block:
      ==: org.bukkit.inventory.ItemStack
      v: 2586
      type: COMMAND_BLOCK
      meta:
        ==: ItemMeta
        meta-type: TILE_ENTITY
        display-name: '{"extra":[{"text":"CodeBlock"}],"text":""}'
        blockMaterial: COMMAND_BLOCK
    type: FunctionBlock

EDIT: To anyone who finds this message in the future, yes, it does, I was just saving the wrong data

minor otter
undone axleBOT
quaint mantle
#

1.17 requires java 16 and 1.18 requires java 17

quaint mantle
#

wait

#

you mean that do they serialize the data in pdc or what?

simple frigate
#

here's my thought process:
store data in itemstack's PDC
serialize itemstack when saving server data
deserialize itemstack when loading server
use data inside itemstack's PDC to create objects

west oxide
quaint mantle
#

you can manually change them by go to environment variable

#

use windows search

tame iron
#

is there an open-source implementation of the gui interfaces plugin 1.18?

west oxide
#

cant find the HOME_PATH

quaint mantle
#

lol i mean this

west oxide
#

yeah that's not there

quaint mantle
#

well scroll

west oxide
#

i did

quaint mantle
#

then create one

west oxide
#

oh

#

lol

quaint mantle
#

ig

lost matrix
quaint mantle
#

go to your java 17 folder in the disk

#

then copy the path

#

create a java home

west oxide
#

ok i will try that

quaint mantle
#

if it does not work, then i may remember this wrong. you can use java something + the path to java 17 to use the specific java version

west oxide
#

there's no java17 folder here

#

weird

quaint mantle
#

check other folder

west oxide
#

only here

quaint mantle
#

so just

#

copy the path

#

btw read the link above

#

that goes more in-depth

west oxide
#

ok i will

#

thank you

hardy swan
#

what does PAUSE do in

java -jar ...
PAUSE
jagged quail
#

if it crashes you can see the error

hardy swan
#

ah thanks

midnight shore
#

How do I save a string on an ItemStack using PDC?

simple frigate
#

something like that

midnight shore
#

Well, STRING doesn’t exist

simple frigate
#

hm

#

it should?

quaint mantle
#

what is the event which gets triggered when player uses elytra?

red sedge
#

Is there anyway I can load lile the 30th key in a configuration

#

without loading the rest

midnight shore
#

I can only see Integer, integer arrays

eternal oxide
red sedge
#

so I constantly need to load all of it

#

got it

midnight shore
#

Is there any way to cancel a bukkit task within itself?

midnight shore
#

Okay

#

Ty

vale ember
#

can enum be a listener?

midnight shore
#

how to send a chest open packet in nms 1.17?

spiral light
drowsy helm
vale ember
#

idk i just tried adding implements Listener to enum declaration and intellij didn't tell me anything

#

tho i thought i can't implement interfaces with enums

#

it even compiled

#

no errors

vivid cave
#

can someone give me the basic template for gradle bungeecord build files
build.gradle(.kts) and settings.gradle(.kts)

#

only bungeecord

#

it's to make proxy plugin

visual tide
tardy delta
#

you just cant extend another class in an enum, but you can implement one

vale ember
#

what should i use instead? 'org.bukkit.event.entity.EntityDamageEvent.DamageModifier' is deprecated

#

i want to set weapons base damage, but also don't want to discard other things like crit, and enemy's armor protection

vivid cave
quiet ice
vale ember
#

please help, i am listening to a entitydamagebyentityevent and want to change only base sword damage but not the final damage, how would i do that?

tardy delta
#

attributes maybe?

#

for the sword

vale ember
#

uh, ill try

#

also, do getDamage() and setDamage() use HP or heart count? like diamond sword's damage would be 7 or 3.5?

tardy delta
warm light
#

How get key from value in HashMap?

quiet ice
#

Either keep two HashMaps in place, or iterate over the entryset

eternal oxide
#

BiMap

quiet ice
#

Or dedicated maps

vale ember
#

is there a way to get the damage of sword with it's material without manually createing a map?

glossy venture
#

i dont know but i think it has like attributes

#

the +69 attack damage you see in the lore

#

might be retrievable

spiral light
#

in newer versions you can get the materials base attributes i guess

vale ember
#

1.13+?

spiral light
#

1.18

vale ember
#

i am using 1.13+

spiral light
#

1.13 is not a new version πŸ˜„

glossy venture
#

dudee

#

1.13 was released in 2018

#

i feel old

tardy delta
#

should i made a separate update statement to update users to the database instead of just an INSERT INTO with an ON DUPLICATE?

blazing scarab
red sedge
#

for multi version compability

#

do i just import a earlier version of the spigot api and lower the api version?

spiral light
#

if you only use API then you should use the lowest mc version you want to support

dusk flicker
#

Keep in mind the api does change, so you do need to keep note of any changes in later versions

#

So you would need to test across multiple versions

spiral light
#

yeah but mostly they dont want the api to change behaviour over versions ...

vale ember
#

what can i use as alternative to DamageModifier, cuz it's deprecated

#

?

chrome beacon
#

Check Javadocs

#

?jd-s

undone axleBOT
lean gull
#

how does one put text with custom font symbols in item lore

tardy delta
#

?paste

undone axleBOT
dense geyser
#

this is probably a silly question, are we allowed to maven import spigot and bungee jars and make our own versions of the jars if its only for private use for the sole purpose of adding/removing some features? (like org.spigotmc sits on top of org.bukkit)

tardy delta
#

since when can you do instanceof Player player?

dense geyser
#

yeah

dusk flicker
#

That would be what it's called. As Spigot is a fork of Bukkit, and Paper is a fork of Spigot, and the list goes on

#

It's open source so yes, there's a ton out there already

dense geyser
#

ah yes, programming words

#

oh alright, thank you <3

lean gull
#

how does one use hex colors & custom font symbols in item lore

tender shard
#

but you have to use them like this:

#

&x&f&f&0&0&0&0RED TEXT

#

if you want to use stuff like <#ff0000> just parse it with regex and replace it with &x&f&f&0&0&0&0

tender shard
lean gull
#

alr thanks, how do i do the font stuff tho

tender shard
#

no idea

lean gull
#

ouef

tender shard
#

never used custom fonts

#

but I guess

#

you might need to use a Component/ComponentBuilder

#

maybe that allows to set fonts

lean gull
#

isn't that for chat messages tho

tender shard
#

what do you need it for

#
new TextComponent("asd").setFont("fontname");
lean gull
#

item lore

tender shard
#

idk if lore supports custom fonts

lean gull
#

it probably does

quaint mantle
#

it does

tender shard
#

hm setLore only takes strings

#

maybe

#
TextComponent text = new TextComponent("asd");
        text.setFont("asd");
        text.toLegacyText();
#

no idea whether that works

tardy delta
#

does anyone knows if logger.log(Level.SEVERE, "something went wrong", exception) will also print the stacktrace of the exception?

#

or is it just to create a log record?

echo basalt
#

Question, how do I set a custom skull in 1.18?

#

GameProfile is no longer bundled with spigot's api

tender shard
echo basalt
tender shard
#

GameProfile is inside com.mojang.authlib

#

you have to import that one as well

#

if you use maven or gradle, you can just install authlib to your local repo

echo basalt
#

Seems to work, cheers

lean gull
#

can someone help? idk what im doin lmao
lore.add(ChatColor.translateAlternateColorCodes('&', " &e" + (new TextComponent("\uE000").setFont("custom:custom"))));

tender shard
tardy delta
#

hehehe finally using java16's features

#

wha- 😳

#

dont even know what records are

tender shard
#

you don't?!

#

records are basically the new builtin "data classes"

tardy delta
#

something liek a struct in .NET?

glossy venture
#

i dont like how non-flexible records are

vale ember
#

how can i stop killed mob from dropping exp orbs?

mortal hare
#

Harmony Scoreboard | NMS Async |

tender shard
tender shard
vale ember
tardy delta
#

plugins that can boost your resume?

#

i'd take a look at github projects

glossy venture
tender shard
tardy delta
#

bruh it says can be converted to record while i have a new field

glossy venture
#

the fields are final

mortal hare
tardy delta
#
The field SqlStorage.connectionFactory is private.
Creating a particular public record accessor will weaken the visibility.```
#

dunno what that means

tardy delta
#

ah it will create a getter

tender shard
glossy venture
#

oh

mortal hare
#

so record classes are classes that have public immutable fields?

glossy venture
#

yep

mortal hare
#

i havent used them

#

since they're kinda weird looking

#

and its new

glossy venture
#

but i dont understand why you cant like add your own mutable fields

tender shard
glossy venture
#

they are compiled to normal classes

mortal hare
#

so its syntax sugar

glossy venture
tender shard
#

it also automatically creates toString, equals and hashcode methods

glossy venture
#

yeah

tender shard
#

I don't really use them because I still compile for java 8 and just use Lombok's @ Data instead

tardy delta
#

i dont understand the error message its saying

tardy delta
#

wdym what line, it says it can be converted to a record and then it says this when i try to do it

tender shard
#

but anyway, there's no need to convert it to a record at all

tender shard
tardy delta
#

yes

#

ah i dont want a getter for it that will be te problem

tender shard
#

I don't think anyway that it's a good idea to turn this into a record, that's not exactly what they are meant for

#

then just don't turn it into a record πŸ˜„

#

the blog post I sent explains what records are for

tardy delta
#

stupid intellij

alpine urchin
#

explain records

tender shard
#

just disable this inspection

tardy delta
#

will it create setters too?

tender shard
#

records are "kinda" immutable

tardy delta
#

i dont see any problems too

#

it should be immutable

alpine urchin
#

its cool

#

i love how it says if you cant use records cause your users are still on 1.8(WTF)

#

haha

tender shard
#

1.8 users make me sad lol