#help-development

1 messages · Page 6 of 1

eternal oxide
#

You need better googlefu

torn shuttle
#

man rotating with the WE api is a trip

quaint mantle
#

hm

#

I dont think it does

eternal oxide
#

FancyCrafting IS an API

#

from teh looks

hot wolf
#

What is the new method for Team#setNameTagVisibility(NameTagVisibility visibility); ?

#

Because that one doesn't work anymore

eternal oxide
#
team.setOption(Team.Option.NAME_TAG_VISIBILITY, Team.OptionStatus.ALWAYS);```
hot wolf
#

Thx. For some reason others can't see my nametag anyway...
Thats the bit of the code

scoreboard = player.getScoreboard();

        if (scoreboard.getTeam(player.getDisplayName()) == null) {
            scoreboard.registerNewTeam(player.getDisplayName());
        }

        team = scoreboard.getTeam(player.getName());
        team.setPrefix(Color(prefix));
        team.setSuffix(Color(suffix));
        team.setOption(Team.Option.NAME_TAG_VISIBILITY, Team.OptionStatus.ALWAYS);

        switch (action) {
            case CREATE:
                team.addEntry(player.getName());
                break;
            case UPDATE:
                team.unregister();
                scoreboard.registerNewTeam(player.getName());
                team = scoreboard.getTeam(player.getName());
                team.setPrefix(Color(prefix));
                team.setSuffix(Color(suffix));
                team.addEntry(player.getName());
                break;
            case DESTROY:
                team.unregister();
                break;
        }
#

Not my code, just edited it btw, but I understand what it's supposed to do

#

I mean they can see my name tag, but not my prefix, even though prefix and suffix have a value and are not ""

eternal oxide
#

players should be added by name not DisplayName I believe

hot wolf
#

Oh yeah, that might be it lol

bold solstice
#

Why when I use nms in the newer versions of it, its so damn hard to understand the methods

#

why is it like that

eternal oxide
#

because you are not using Mojang mappings

midnight patrol
#

how would one go about getting the held item of an entity(not players)

hushed spindle
#

plus no documentation

#

cast to LivingEntity first

#

Entities cannot hold items, LivingEntities can

bold solstice
#

or whatever

hushed spindle
#

of course first check if the entity is a livingentity

midnight patrol
hushed spindle
#

if(entity instanceof LivingEntity)

#

then do your casting

#

if you dont you might get ClassCastExceptions

eternal oxide
hushed spindle
#

not all Entities are LivingEntities but all LivingEntities are Entities if that makes sense

young knoll
#

LivingEntity#getEquipment#getItemInMainHand

bold solstice
midnight patrol
hushed spindle
#

mappings are basically just renamings of methods and properties and stuff

midnight patrol
eternal oxide
#

mfnalex has a wiki page but I forget teh link (if he has updated it). One sec

hushed spindle
#

mojang mappings are one way these renamings are done

lone ore
#

So i am trying to make it so if Pumpkin is placed on stonecutter it drops carrots (dont ask me why) but its dropping pumpkin when i place it above stonecutter

public class MelonHandler implements Listener {
    public MelonHandler(FirstTest plugin) {
        Bukkit.getPluginManager().registerEvents(this, plugin);
    }

    @EventHandler
    public void onMelonPlace(BlockPlaceEvent event) {
        if (event.getBlock().getType() !=Material.PUMPKIN || event.getBlockAgainst().getType() !=Material.STONECUTTER) {
            return;
        }

        else event.getBlock().breakNaturally(new ItemStack(Material.CARROT));


    }
}
hushed spindle
#

breakNaturally() doesn't take in the argument of the item it should drop lol

young knoll
#

^

hushed spindle
#

it takes in the argument of the tool with which you break it with

young knoll
#

It’s the item used to break it

lone ore
#

Ok so how would i make it drop an item?

young knoll
#

Set it to air and manually drop some carrots

midnight patrol
#

just set the pumpkin to material.air
and drop the carrots naturally

hushed spindle
#

you should instead listen to a BlockDropItemEvent and check if it's a pumpkin and if there is a stonecutter under it, then change the drops

#

or that works too

bold solstice
#

tysm

hushed spindle
#

god bless jeff

#

anyway, say i have like a map with an integer id and some kind of value, is there a specific implementation of map with which i can get the next empty integer id available without iterating through it from start to end

#

so if i have a map where 1 3 and 5 have values assigned it has like a method that returns 2

#

otherwise ill just do the iteration method

shadow zinc
lone ore
hot wolf
#

Can't see the name tag of others, but that of myself

hushed spindle
hot wolf
#

sry, gtg. Food and stuff

noble lantern
#

i use that guide everytime i need a remapped jar

hushed spindle
earnest forum
#

How do i get the previous block type of the block in BlockBreakEvent?

hushed spindle
#

e.getBlock().getType() should return the block type before it was broken

#

keep in mind if you delay this method by as little as a tick it will instead return the "new" block type

earnest forum
#

I'm having an issue with persistent data

#

I have an item which has a custom persistent data type

#

which on BlockPlaceEvent it is also adding it to the block placed

#

but on BlockBreakEvent it doesn't look like the pdc is there

noble lantern
#

because

#

blocks cant have PDC

hushed spindle
#

blocks cant store pdc

earnest forum
#

TileStates

#

im using tile states

#

its a shulker box

eternal oxide
#

Placed Blocks only have a PDC if they are TileEntities

#

ok

hushed spindle
#

did you set the tile state back to the block

eternal oxide
#

you will have to update teh PDC on the placed block 1 tick later

hushed spindle
#

kinda like item meta on an item

earnest forum
#

I didn't see any setState or anything like that

#

so i assumed that it was automatically done

hushed spindle
#

oh maybe its not needed then

#

but yeah update the block

eternal oxide
#

No PDC is not transfered when placed

noble lantern
#

only BlockData is BigBrain

young knoll
#

BlockState#update

hushed spindle
#

im assuming they are setting their pdc to the tilestate manually

#

as they should

earnest forum
#
@EventHandler
    public void blockPlace(BlockPlaceEvent e){
        Block b = e.getBlock();
        Player p = e.getPlayer();
        ItemStack itemStack = e.getItemInHand();

        if (itemStack.getType() != Material.SHULKER_BOX) return;
        PersistentDataContainer container = itemStack.getItemMeta().getPersistentDataContainer();

        if (!container.has(Utils.VAULT_PDC_NAMESPACED_KEY, Utils.VAULT_PERSISTENT_DATA_TYPE)) return;

        VaultData vaultData = container.get(Utils.VAULT_PDC_NAMESPACED_KEY, Utils.VAULT_PERSISTENT_DATA_TYPE);
        TileState state = (TileState) b.getState();
        PersistentDataContainer blockContainer = state.getPersistentDataContainer();

        blockContainer.set(Utils.VAULT_PDC_NAMESPACED_KEY, Utils.VAULT_PERSISTENT_DATA_TYPE, vaultData);
        p.sendMessage("Setting "+vaultData.getVaultType().getName());
    }
#

this is my code

noble lantern
#

dont TileState changes need to be directly saved to the chunk

#

or is that only using nms you need to do that

#

i know when i was messing with the data inside spawners i had to do a really funky update thing, but it was nms so the whole things funky

earnest forum
#

I just added that and it seems to work

#

thanks!

midnight patrol
#

for getNearbyEntities(double,double,double) it is range in xyz?

earnest forum
#
ItemStack vault = vaultData.getVaultType().getStack();

PersistentDataContainer itemContainer = vault.getItemMeta().getPersistentDataContainer();
itemContainer.set(Utils.VAULT_PDC_NAMESPACED_KEY, Utils.VAULT_PERSISTENT_DATA_TYPE, vaultData);

using this, do i need to set the meta back?

eternal oxide
#

Meta is always a clone

earnest forum
#

ah

bold solstice
eternal oxide
#

ran buildtools with --remapped ?

bold solstice
#

yep

#

it worked

#

but the maven still gives me an error

eternal oxide
#

Do I have to try and guess the error?

bold solstice
#

I added the classifier and it says this:'pom.xml' has syntax errors

eternal oxide
#

?paste your pom

undone axleBOT
bold solstice
#

oh wait nevermind im just an idiot

#

sorry for the trouble

earnest forum
#

is InventoryCloseEvent#getPlayer() always going to be an instance of a Player? because it returns a HumanEntity

lone ore
#

Ok so i have made it to drop carrot but i want the pumpkin to break too

public class MelonHandler implements Listener {
    public MelonHandler(FirstTest plugin) {
        Bukkit.getPluginManager().registerEvents(this, plugin);
    }

    @EventHandler
    public void onMelonPlace(BlockPlaceEvent event) {
        if (event.getBlock().getType() !=Material.PUMPKIN || event.getBlockAgainst().getType() !=Material.STONECUTTER) {
            return;
        }

        else event.getBlock().getDrops(new ItemStack(Material.AIR));
        event.getBlock().getWorld().dropItemNaturally(event.getBlock().getLocation(), new ItemStack(Material.CARROT));
        
    }
}
keen spindle
#

hey guys, is it possible to create NPCs without NMS, and while using NMS with Minecraft v19 im getting this error

Unresolved dependency: 'org.spigotmc:spigot:jar:1.19-R0.1-SNAPSHOT'
midnight patrol
lone ore
midnight patrol
#

all good we all look over things

noble lantern
#

ServerPlayer's?

#

or just normal entities like cows and stuff

#

and that dependency error is related to something else

can you send your pom

#

or build.gradle, whichever your using 🙂

keen spindle
#

sure

hot wolf
keen spindle
noble lantern
keen spindle
#

but shouldnt be visible when we do [tab]

noble lantern
#

thats important

#

Players?

keen spindle
noble lantern
#

Gonna say it right now

grim oak
#

Hi guys im trying to do the following :public static Pattern HEX_PATTERN_2 = Pattern.compile("{#([A-Fa-f0-9]){6}}");for "{#([A-Fa-f0-9]){6}}" how do i do the surrounding curly braces because then i do an escape character infront, eg: "\{#([A-Fa-f0-9]){6}\}" it says 'Illegal escape character for string literal'

noble lantern
#
  1. Not possible without nms

  2. With NMS its still relatively complicated

I would say use citizens

#

dont say citizens is slow either pls

keen spindle
noble lantern
#

NMS Its still complicated

You need to do a LOT of stuff for Player entities

noble lantern
#

lemme double check

keen spindle
#

such as CraftPlayer

noble lantern
#

because you need that bottom import

#

you didnt add that one

young knoll
#

Why do you have both

#

Spigot includes spigot-api

noble lantern
#

oo

#

bet

keen spindle
noble lantern
#

Did you run build tools with --remapped option

grim oak
noble lantern
#

that seems to be the issue a lot of the time

#

and make sure your nms remapped import matched my spigot one

#

or you wont get remappings properly

keen spindle
#

im just using the old maven build

#

thing

lilac pier
#

hey guys i got some issue with itemsadder can u help me ?

noble lantern
#

it will auto install to your .mvn local repo

#

and just refresh ur maven after that

keen spindle
noble lantern
#

anywhere

#

doesnt matter

#

i do mine on a folder on my desktop

#

just dont forget --remapped

young knoll
#

?bt

undone axleBOT
keen spindle
#

alright

noble lantern
#

oop forgot about that link

#

why no emoji styling for build tools

keen spindle
#

so basically
java -jar BuildTools.jar --rev 1.19 --remapped

noble lantern
#

yes

lilac pier
#

when i leave my server itemsadder stop working and say that in the tchat but when i reload it's good u know why this appen ?

noble lantern
#

Is this a coding question about items adder api or somethin

reef lagoon
#

🗿

lilac pier
#

any command work

#

i just can't use itemsadder

noble lantern
#

so this isnt a programming question

#

Strictly items adder?

#

My first guess, if i was having issues with a plugin would to be to join theyre discord

#

ItemsAdder support is very good

#

wait no

#

thats CustomItems

#

idk about IA

keen spindle
#

ok so still the same error

#

i installed the build tools in the same directory as the plugin

noble lantern
#

you refreshed maven and fixed that import right

#

you

#

dont

#

need to do that but okay haha

#

if your uploading to github

#

.gitignore it

keen spindle
noble lantern
#

spigot

noble lantern
#

copy paste that one only

#

well

#

cant copy paste

#

sec

keen spindle
#

yea im using that

#

i refreshed maven

#

and yet

#

same error

noble lantern
#

can you send the pom again with the error

#

might wanna link so u can send images

#

!link

#

something like that

#

who knows the command

keen spindle
supple elk
#

Hi, can anyone help me with this error?

#

it's saying that this.spawns is null

noble lantern
#

<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.19-R0.1-SNAPSHOT</version>
<scope>provided</scope>
<classifier>remapped-mojang</classifier>
</dependency>

Copy paste this directly

supple elk
#

this is the code

noble lantern
#

i needs remapped-mojang

supple elk
#

line 29 is the issue

keen spindle
supple elk
#

spawns should not be null though as I initialise it as an empty array

noble lantern
#

also

noble lantern
#

is latest version

tardy delta
#

record(Vector, Vector) 😢

noble lantern
#

of special source

supple elk
#

and I don't set it to null anywhere else I don't think...

keen spindle
keen spindle
noble lantern
#

hmmmm

#

can you try something

#

?paste one sec lemme do something

undone axleBOT
keen spindle
#

um sure ig

supple elk
#

These are the only 4 usages so I def don't set it to null anywhere

#

anyone able to help?

noble lantern
#

idk why you arent declaring that variable in your constructor

#

initializing**

supple elk
#

can I not do it the way I did?

noble lantern
noble lantern
#

try without @Getter and see what happens

supple elk
#

I'll try this first

noble lantern
#

kk

noble lantern
#

that way is typically better, i personally dont like declaring variables like that unless theyre final statics

supple elk
#

same issue, I'll try without lombok

noble lantern
#

lombok shouldnt be an issue now

#

question

#

what class you extending

#

you got a variable named spawns in there too?

supple elk
#

no I don't

#

this is the class I extend

noble lantern
#

hmmm

#

wtf

supple elk
#

same issue with no lombok

#

?????

#

tf is this

noble lantern
#

you only have the one constructor too right

#

in BoatMap

supple elk
#

yeah

#

I'll send the full class

#

GameMap ^

#

BoatMap ^

noble lantern
#

where and how do you call loadMetaData(FileConfiguration) at?

#

do any superceding classes call it? Or is it called on an instance of BoatMap

supple elk
#

ah

#

it is called from the constructor of GameMap

#

now it makes sense

noble lantern
#

Ah yep there we go

supple elk
#

bruhhhh

#

suggestions on how I fix?

#

just init the list in loadMetaData()?

noble lantern
#

hmm

#

i mean

#

yeah thats a simple fix

supple elk
#

how would you fix it?

noble lantern
#

why not cant hurt if you only are loading it once

#

ngl prolly same way im lazy asf

supple elk
#

lol

noble lantern
#

but to be it sounds like the extensions need to be reversed

supple elk
#

wdym?

hot wolf
#

I can't see the modified name tag of others for some reason

scoreboard = player.getScoreboard();

        if (scoreboard.getTeam(player.getDisplayName()) == null) {
            scoreboard.registerNewTeam(player.getDisplayName());
        }

        team = scoreboard.getTeam(player.getName());
        team.setPrefix(Color(prefix));
        team.setSuffix(Color(suffix));
        team.setOption(Team.Option.NAME_TAG_VISIBILITY, Team.OptionStatus.ALWAYS);

        switch (action) {
            case CREATE:
                team.addEntry(player.getName());
                break;
            case UPDATE:
                team.unregister();
                scoreboard.registerNewTeam(player.getName());
                team = scoreboard.getTeam(player.getName());
                team.setPrefix(Color(prefix));
                team.setSuffix(Color(suffix));
                team.addEntry(player.getName());
                break;
            case DESTROY:
                team.unregister();
                break;
        }
#

Not sure why

supple elk
#

it wouldn't make sense if GameMap extended BoatMap

noble lantern
#

Yeah exactly, so likely best way is just make a new list on that event call

tender shard
#

can I somehow disable this stupid "implementations" thing?

noble lantern
#

jk

#

idk how

tender shard
#

D:

noble lantern
#

uhh try right clicking

#

on it

supple elk
#

I'll init the list in constructor anyway, and loading the meta data will just overwrite with a new list, that makes good sense

tender shard
#

It's so messy to fix the formatting when intellij adds weird newlines for those popups

supple elk
#

thanks for the help anyway

noble lantern
#

right clicking has a hide option for me

grim oak
tender shard
noble lantern
supple elk
#

@noble lantern error now gone, ty

tender shard
#

having it on the right is soooooo much better lmao

#

finally I can see again whether I added a new line or not

grim oak
noble lantern
#

1.16 nms z_aCRYYY

#

ohhh

#

Pattern.compile takes characters

#

not a string

#

(iirc)

hot wolf
noble lantern
#

or / and \ is invalid for regex on java

supple elk
#

Anyway to inherit the @EventListener annotation?

noble lantern
supple elk
#

yes

grim oak
supple elk
#

I'm gonna send something really weird but allow it

noble lantern
#

see if using a regex creation website if they come up with something else

#

they might box it in something else to make it valid for java

grim oak
#

okay thanks

noble lantern
#

ive never used Pattern before thou i feel like theres a diffrent class

supple elk
#

So originally there was just the trigger function. That was inherited and worked fine, but I had to add the @fresh templetHandler annotations every time. So I then tried adding the trigger function which isn't overwritten, and then calls the onEvent function which is overwritten. I don't think this works though cause of type erasure

noble lantern
supple elk
#

So if possible, when I extend the class the annotation is automatically inherited somehow

noble lantern
#

why not

#

search your jar for Listener classes

#

and then call new instances via reflection

#

and you never need to Bukkit.registerCommand manually ever again

#

i mean

#

the registerEvents method

supple elk
noble lantern
#

so leave like that xD

supple elk
#

but that's not where the issue is

#

the issue is I have to add @fresh templetHandler every time I extend

#

look

#

I know it's not really an issue

#

but

little panther
#

Hey, i have a problem with my config.yml is empty when i generate it on the server and i have no idea why. Do anyone have a fix?

noble lantern
#

ik theres a boolean for replace

daring lark
#

did entities as a zombie has UniqueId?

noble lantern
noble lantern
peak depot
noble lantern
#

god spigot has some of the weirdest methods sometimes

little panther
noble lantern
#

me neither dw

peak depot
#

you need to do this in oder for the defaults you wanna add to be saved

noble lantern
#

oh so thats how ppl do config versions

#

neat

little panther
#

so i just add it to my onEnable?

noble lantern
#

in a sense yeah

peak depot
#

yes

little panther
#

the weird thing is that i dont have anything like that on other plugins ive made and they still generate a config with text in it. I have no idea why

peak depot
#

well thats spigot

#

some times it works other times it doesnt

#

did it fix it

little panther
#

thanks

peak depot
#

np

tender shard
#

I mean there's no "if(chance <= 50)" or so in the code to make it work only sometimes

peak depot
#

yeah but I think thats like how they tell you in the docs

hardy swan
#

copyDefaults fucks with your config styling

tawdry scroll
#

Thats why it adds empty lines on start when i use it?

hardy swan
#

could be

#

It also converts your arrays to lists

arr: [1, 2, 3]
```will become
```yml
arr:
- 1
- 2
- 3
#

It also adds in default example configs that are intended to be optional.

noble lantern
#

pog change

noble lantern
#

i feel like this could be handled better

hardy swan
#

How, it can at most be a separate file that I somehow know will never be updated?

vast raven
#

There isn't an event such as EntityCollideEntityEvent, should I use EntityChangeBlockEvent?

noble lantern
tender shard
#

that sucks so hard

hardy swan
noble lantern
#

witch: "1-5:0|6-5:1"

#

there

#

simple, easy

hardy swan
#

for me yes

noble lantern
#

parse on server startup

#

its simple for anyone who can config too

noble lantern
#

dont make your dev life a pain to help 9 year olds :))

hardy swan
#

UX

noble lantern
tender shard
noble lantern
#

alex

#

NBTApi exists

tender shard
#

I know

#

I'm just bored

little panther
#

I have no idea, just started coding, and didnt even know super was a thing

noble lantern
#

oh okay

#

was about to say just hard fork it if you need nbt xD

tender shard
noble lantern
#

i hate super() somtimes

#

fucking annoying

little panther
#

is there a reason to use super?

tender shard
#

I actually never needed and never will need NBT, but since my library has NMS stuff already annyway, I thought about adding this too 😄

noble lantern
#

yes when extending classes that have constructor arguments

tender shard
hardy swan
noble lantern
tender shard
# little panther is there a reason to use super?

https://github.com/JEFF-Media-GbR/JeffLib/blob/master/core/src/main/java/com/jeff_media/jefflib/data/tuples/Triplet.java check out this. It's a triplet (a class that can hold 3 values of anything). It extends a Pair, so it only adds stuff for "get third item" etc. Hence it calls "super" (the constructor of the pair), and super.hashCode() etc for the other stuff that's related to the first 2 values

GitHub

Avoid writing the same code over and over again - use JeffLib for your Spigot plugins! - JeffLib/Triplet.java at master · JEFF-Media-GbR/JeffLib

hardy swan
noble lantern
#

alex

#

give me, a distance and an amount

tender shard
#

3 km

noble lantern
#

minecraft distance

tender shard
#

3000 blocks

noble lantern
#

thats it?

#

u sure?

#

go 5k - 50k

tender shard
#

thats what? 😄

noble lantern
#

im gonna afk these npcs

#

and teleport somewhere and see if they pathfind to me overnight

tender shard
#

31234 blocks

#

one km should be exactly 1000 blocks

#

IIRC notch once said that a minecraft block is one cubic meter

noble lantern
#

kk, not sure if i have enough ram to cache 31k points 100 times though for the npcs

#

i think i can maybe do 50 npcs

#

lemme see

vast raven
#

Cancel the collide with projectile on armorstands.

hardy swan
#

tbf, for readability sake anything before super can be a method or sth

hardy swan
noble lantern
#

How resource intensive is calling Collections.shuffle on a List of 50 elements

vast raven
#

to cancel the collide

tardy delta
#

Maybe check the impl?

vast raven
#

Idk how to do it.

noble lantern
hardy swan
tender shard
noble lantern
tender shard
vast raven
tender shard
#

I have two things I need to extend / implement

noble lantern
#

ohh

#

L

#

xD

#

well igot an idea

#

make the 2 classes extend each other

#

bam

tender shard
#

interface NBTitemStack, and abstract class HatchedNBTDataHolder

noble lantern
tender shard
hardy swan
tender shard
#

so yeah both are abstract classes D:

vast raven
noble lantern
#

okay alex time to let the npcs go

hardy swan
rotund pond
#

Hello !
I have a question more about Java '

ᴸᵉᵗ'ˢ ˢᵃʸ ᴵ ʰᵃᵛᵉ ᵃ ˡᶦˢᵗ ᵒᶠ ᵃᵛᵃᶦˡᵃᵇˡᵉ ʳᵉʷᵃʳᵈˢ ᵉᵃᶜʰ ʷᶦᵗʰ ᵃ ʷᵉᶦᵍʰᵗ. ᴴᵒʷ ᶜᵃⁿ ᴵ ᶜʰᵒᵒˢᵉ ᵒⁿᵉ ᵒᶠ ᵗʰᵉ ʳᵉʷᵃʳᵈˢ ᵗᵃᵏᶦⁿᵍ ᶦⁿᵗᵒ ᵃᶜᶜᵒᵘⁿᵗ ᵗʰᵉ ʷᵉᶦᵍʰᵗ ᵒᶠ ᵉᵃᶜʰ ʳᵉʷᵃʳᵈ?

ᴴᵉʳᵉ ᶦˢ ᵃⁿ ᵉˣᵃᵐᵖˡᵉ:
ᵀʰᶦˢ ᶦˢ ᵐʸ ᶜᵒⁿᶠᶦᵍ.ʸᵐˡ:

ʳᵉʷᵃʳᵈˢ:
  ᶠᶦʳˢᵗᴿᵉʷᵃʳᵈ:
    ᶜᵒᵐᵐᵃⁿᵈ: "ᵇᶜ %ᵖˡᵃʸᵉʳ% ʷᵒⁿ ᶠᶦʳˢᵗ ʳᵉʷᵃʳᵈ !"
    ʷᵉᶦᵍʰᵗ: ²
  ˢᵉᶜᵒⁿᵈᴿᵉʷᵃʳᵈ:
    ᶜᵒᵐᵐᵃⁿᵈ: "ᵇᶜ %ᵖˡᵃʸᵉʳ% ʷᵒⁿ ˢᵉᶜᵒⁿᵈ ʳᵉʷᵃʳᵈ !"
    ʷᵉᶦᵍʰᵗ: ¹
  ˡᵃˢᵗᴿᵉʷᵃʳᵈ:
    ᶜᵒᵐᵐᵃⁿᵈ: "ᵇᶜ %ᵖˡᵃʸᵉʳ% ʷᵒⁿ ˡᵃˢᵗ ʳᵉʷᵃʳᵈ !"
    ʷᵉᶦᵍʰᵗ: ¹

ᴴᵒʷ ᶜᵃⁿ ᴵ ᵍᵉᵗ ᵃ ʳᵃⁿᵈᵒᵐ ʳᵉʷᵃʳᵈ ᵗᵃᵏᶦⁿᵍ ᶦⁿᵗᵒ ᵃᶜᶜᵒᵘⁿᵗ ᵗʰᵉ ʷᵉᶦᵍʰᵗ ᵒᶠ ᵗʰᵉˢᵉ ʳᵉʷᵃʳᵈˢ ?
ᴵⁿ ᵗʰᶦˢ ᵉˣᵃᵐᵖˡᵉ, ᶠᶦʳˢᵗ ʳᵉʷᵃʳᵈˢ ʰᵃˢ ⁵⁰%, ˢᵉᶜᵒⁿᵈ ʰᵃˢ ²⁵% ᵃⁿᵈ ˡᵃˢᵗ ʰᵃˢ ²⁵% ᵗᵒᵒ ⁽ᵇᵘᵗ ᶦᵗ'ˢ ᶜᵒⁿᶠᶦᵍᵘʳᵃᵇˡᵉ !⁾

ᵀʰᵃⁿᵏ ʸᵒᵘ

hardy swan
#

nice font

rotund pond
#

Ah

#

xD

#

Discord format

vast raven
noble lantern
#

they become self aware

#

i never gave them flight permissions....

#

theyre in survival mode....

tender shard
#

lol

#

btw I made up a new term

#

sometimes you need to declare an empty constructor for reasons

#

but there's no name for this

#

let's call it Burchard's constructor

#

"Yo Bro, this can't work. You need to add a Burchard's constructor in the super class"
"Ah, thanks, now it compiles"

noble lantern
#

@ivory sleet ?burchard-constructor command when

tender shard
#

lol

noble lantern
#

?learnjava!

undone axleBOT
noble lantern
#

YES

#

i made that gif

#

😄

#

use the command with ! at the end it will send dah gif

tender shard
#

oh lol this will probably offend people even more than the previous message lol

#

aaah it's two commands?

#

perfect

#

then one can send the gif one only when people ignored the first "learnjava"

noble lantern
tender shard
#

yeah lol

#

?learnjava

undone axleBOT
tender shard
#

?learnjava!

undone axleBOT
tender shard
#

perfect

frosty tinsel
noble lantern
#

nah

#

conclure did

frosty tinsel
#

Xd

shadow vine
#

i cant put photos here

tender shard
#

I contributed the ?notworking command and the pinned msg in this channel lol

frosty tinsel
#

You gotta use exclamation mark at the end right?

noble lantern
tender shard
#

!verify

undone axleBOT
#

Usage: !verify <forums username>

tender shard
#

@ivory sleet why is it !verify and not ?verify 😢

noble lantern
#

ikr

#

actual scam

tender shard
#

yeah ffs I'll go to paper. cya

noble lantern
#

yeah paper has pathfinding methods built in

#

lets go paper

tender shard
#

but paper also has @Deprecated everywhere

#

sooooo

noble lantern
#

true

#

alex im sorry to do this to you

#

how do i generate a random number in range starting at a negative value

#

not 0

#

Random#nextInt says bounds must be positive

tender shard
#

ThreadLocalRandom should have that

frosty tinsel
tender shard
#

ThreadLocalRandom.nextInt(-100,-50)

#

should be sth between -100 and -50

frosty tinsel
#

Also from Java 17 Random#nextInt has two Params as well

noble lantern
noble lantern
frosty tinsel
#

Now I am reading the docs and it seems that it actually doesn't

#

But I swear it was there, maybe I had different jre?

#

I mean jdk

hot wolf
rotund pond
#

Hello !
I have a question more about Java ^^'
(Rewritten so it can be read)

Let's say I have a list of available rewards each with a weight. How can I choose one of the rewards taking into account the weight of each reward?

Here is an example:
This is my config.yml file:

reward:
  first_reward:
    command: "bc %player% won first reward !"
    weight: 2
  second_reward:
    command: "bc %player% won second reward !"
    weight: 1
  last_reward:
    command: "bc %player% won last reward !"
    weight: 1

How can I get a random reward taking into account the weight of these rewards ?
In this example, first reward has 50%, second one has 25% and last one has 25% too (but it's configurable, I can't use raw numbers)

Thank you 🙂

dull whale
#

what is the packet to spawn living entities

frosty tinsel
dull whale
#

spawn_living_entity in protocollib seems depreceated now

frosty tinsel
#

Hard to explain

frosty tinsel
#

There's everything

rotund pond
frosty tinsel
#

I am on my phone now

#

So I won't

rotund pond
#

Ah okay

dull whale
frosty tinsel
dull whale
hot wolf
#

There's an addon for that

#

Just lookup Multiverse addons or smth

#

sec

#

Do you mean Multiverse-core?

#

Oh sorry, not sure about this. You could probably use a hashmap lol

#

put the player on the hashmap on join and the value of the hashmap is the world name

#

and when they die you get the world and tp them to that world

#

would be a work-around

#

but if you do it that way, you'd have to change the current world everytime they change world

#

But look if there's a plugin for that for MultiWorld. Would be easier

noble lantern
#

what are the chances of me baing able to hack into this via reflection

#

and changing its max amount?

#

ohh

#

under the hood it uses put

#

i wonder if i could just overwrite it?

#

oih no

#

its final

hot wolf
#

Bukkit is broken lol team.setOption(Team.Option.NAME_TAG_VISIBILITY, Team.OptionStatus.NEVER);
If I use it like that players can see name tags of others if I use it like that
team.setOption(Team.Option.NAME_TAG_VISIBILITY, Team.OptionStatus.ALWAYS);
You can only see your own name tag

#

like bruh

noble lantern
#

other attribute instance have it

vast raven
#

Should cancelling the event cancel the collide?

vast raven
#

IntelliJ gives me error like there is no implementing of the interface Cancellable in this event

chrome beacon
#

What version are you on

tender shard
#

what version are you using

vast raven
tender shard
#

yes

chrome beacon
#

Let me guess 1.8

vast raven
#

1.12.2

noble lantern
#

RangedAttributes maxValue is public 🤔

vast raven
tender shard
#

yeah well then look at the 1.12.2 docs

#

in 1.12.2, the event isn't cancellable

vast raven
chrome beacon
#

Looks like it is

vast raven
noble lantern
#

ill explode if you develop under 1.14

tender shard
#

same

vast raven
tender shard
#

lol

noble lantern
#

you sure

vast raven
#

I do

noble lantern
#

you wanna tell that

#

to the 200 npcs

#

on my server rn

#

on 1.19 lol

chrome beacon
#

1.12 version of a 1.8 player

#

How nice

tender shard
#

some people call it "more optimized", I call it "lack of features"

vast raven
#

idc, it's light to install and is the most compatible version

tender shard
vast raven
#

search it

tender shard
noble lantern
chrome beacon
vast raven
#

Version such as 1.8 are bad

vast raven
noble lantern
eternal oxide
chrome beacon
#

You're using the exact same arguments for running outdated stuff

tender shard
#

"most used version"... 11 % lol

lone ore
#

So i want to make it so that when i right click with a specific item it turns grass block into farmland of radius 10 blocks (i have this but how do i make it so it only replaces grass block and make it farmland in a 10 block radius)

public class PlayerEvents implements Listener {

    @EventHandler
    public static void onRightClick(PlayerInteractEvent event) {
        if(event.getAction() == Action.RIGHT_CLICK_BLOCK) {
            Material material = event.getClickedBlock().getType();
            if(material.equals(Material.GRASS_BLOCK)) {
                if (event.getItem() !=null) {
                    if (event.getItem().getItemMeta().equals(PlayerHandler.gh.getItemMeta())) {
                        Player player = event.getPlayer();
                        player.getWorld().setType(player.getLocation(), Material.FARMLAND);
                    }

                }
            }
        }
    }
}
vast raven
noble lantern
#

i cant

tender shard
vast raven
noble lantern
eternal oxide
#

There is the real reason

tender shard
#

So 1.13+ sucks because one plugin is outdated

#

lol

#

ok

noble lantern
#

im trying

vast raven
#

I mean

noble lantern
#

im horrible at it

quaint mantle
#

cannot access com.mojang.authlib.GameProfile
why dis happen

tender shard
noble lantern
#

dat too

quaint mantle
#

OH

noble lantern
#

okay but does a-

tender shard
quaint mantle
#

1.8

#

with a .8

vast raven
#

1.12.2 has a lot of error like the shields and elytra but is that light version that you use with a lot of feature, since I make a Rp server I prefer using 1.12.2

tender shard
eternal oxide
#
        <repository>
            <id>minecraft-repo</id>
            <url>https://libraries.minecraft.net/</url>
        </repository>``````xml
        <!--Mojang -->
        <dependency>
            <groupId>com.mojang</groupId>
            <artifactId>authlib</artifactId>
            <version>3.5.41</version>
            <scope>provided</scope>
        </dependency>```
noble lantern
#

^

noble lantern
#

1.8 does have game profile iirc

#

doesnt*

quaint mantle
#

ohhh

#

then which version to use

eternal oxide
#

yeah forget 1.8

noble lantern
#

what elgar sent

#

both times what elgar sent ^

quaint mantle
#

but thats for

tender shard
quaint mantle
#

?paste

undone axleBOT
quaint mantle
noble lantern
#

1.19 literally runs 20tps with 100 npcs on a contabo vps

vast raven
quaint mantle
#

here look

noble lantern
#

you cannot tell me 1.19 isnt optimized

tender shard
vast raven
#

Never used them

#

Like if you keep spamming the Q key it calculates as click

eternal oxide
errant narwhal
#

how to get skullmeta from itemstack???

quaint mantle
little panther
chrome beacon
tardy delta
#

(SkullMeta) meta

tender shard
chrome beacon
#

:)

errant narwhal
#

ok thx

tender shard
#

I literally asked "do you use spigot-api or spigot"

#

and you said spigot

vast raven
#

BTW

noble lantern
#

Anyone know if im able to use reflection to change the default value of this?

tender shard
#

yet you use spigot-api

vast raven
#

I need to cancel the ProjectileCollideEvent

vast raven
#

It's possible somehow even in 1.12.2

quaint mantle
tender shard
quaint mantle
#

sorry man

vast raven
#

My idea is to reshot the projectile but I need to calculate things like the speed and so on

tender shard
#

np lol

#

use "spigot" insntead of "spigot-api"

noble lantern
chrome beacon
noble lantern
#

i want to override it to make it higher just for testing

minor fox
#

Do you have to use armorstands to make mob NPCs have name tags or is there a way to show the name tags set by setCustomName?

vast raven
noble lantern
#

ig i could just compile spigot myself

#

with modified value

chrome beacon
noble lantern
tender shard
#

or just tell us what your actual goal is

hot wolf
#

Nvm it just doesn't work and I'm stupid or smth.
I have this bit of code here, which is supposed to change the name tag of players. And it does, but others can't see it.


        scoreboard = player.getScoreboard();

        if (scoreboard.getTeam(player.getName()) == null) {
            scoreboard.registerNewTeam(player.getName());
        }

        team = scoreboard.getTeam(player.getName());
        team.setPrefix(Color(prefix, '&'));
        team.setSuffix(Color(suffix, '&'));
        team.setOption(Team.Option.NAME_TAG_VISIBILITY, Team.OptionStatus.ALWAYS);

        switch (action) {
            case CREATE:
                team.addEntry(player.getName());
                break;
            case UPDATE:
                team.unregister();
                scoreboard.registerNewTeam(player.getName());
                team = scoreboard.getTeam(player.getName());
                team.setPrefix(Color(prefix,'&'));
                team.setSuffix(Color(suffix,'&'));
                team.addEntry(player.getName());
                break;
            case DESTROY:
                team.unregister();
                break;
        }

idk why, I've been trying to fix this for hours but idk where the problem is

noble lantern
tender shard
#

no, the dude who wants to cancel the event

noble lantern
#

oh

vast raven
noble lantern
#

lol

#

xD

vast raven
#

🥲

chrome beacon
#

You could try teams

#

And add the projectile and armor stand to the same one

vast raven
noble lantern
#

team api for mc sounds so scuffed

quaint mantle
#

Cannot resolve symbol 'ENDER_DRAGON'

#

wut whats ender dragon called in 1.8

tender shard
#

cancel the collide? you want to change the position of the arrow?

#

I love how I have to call load to save the data

vast raven
tender shard
#

no

vast raven
# tender shard no

I was going to make an example if u've watched it, I will do it anyways using a gif.

tender shard
#

okidoki

noble lantern
vast raven
noble lantern
#

my save method and reload is always just load() 💀

vast raven
# vast raven

Literally, letting a projectile pass through armorstand @tender shard

tender shard
#

ooh ok

#

you couldn't do that even when cancelling the event

#

I think you'd have to manually set the location on every tick while the arrow is "colliding with" the armorstand

noble lantern
#

^

tender shard
#

cancelling the ProjectileHitEvent will not change any velocity / physics stuff, it's only for cancelling stuff like "taking damage" etc

noble lantern
#

Does spigots optimizations automatically ignore LivingEntity#setCollidable?

tender shard
#

that looks... tasty

vast raven
noble lantern
#

its dangerous

tender shard
noble lantern
#

dont tough, you go flying

vast raven
noble lantern
#

Is there a feature request for spigot?

tender shard
tender shard
noble lantern
vast raven
noble lantern
#

I could do it, but idk how to dev or make prs for spigot

chrome beacon
noble lantern
#

its relatively simple and other types exist already

noble lantern
#

didnt see the new feature one

vast raven
chrome beacon
#

?contribute

tender shard
#

what is your feature request btw @noble lantern ?

noble lantern
vast raven
tender shard
#

I mean, you could just Pr it yourself 😛 because IIRC feature requests on jira tend to get ignored lol

chrome beacon
#

Well yeah you only follow the modifying spigot part

#

Don't actually PR it in to Spigot

noble lantern
#

So would i just edit the built source from BuildTools?

#

PRing into spigot seems overall confusing its such a large project

#

i could do it myself on a private jar but for actual src i have no idea

tender shard
#

yeah it's indeed a bit complicated lol

noble lantern
#

Thought you needed jira access for that

chrome beacon
#

To create a PR you need jira access

#

To make your own fork with changes you don't

vast raven
#

What about this @chrome beacon ?

noble lantern
#

Would be nicer to have it directly added to spigot, no harm in it i mean the max entity speed change is more devestating xD

noble lantern
chrome beacon
#

;/

noble lantern
#

man the amount of times i try it and see are crazy

vast raven
#

Hoping that when the event is fired the entity is not removed yet

noble lantern
lone ore
#

So i have done this but it does not make grass in a certain radius farmland only the single one that i right click on (btw gh is my custom item)

public class PlayerEvents implements Listener {

    @EventHandler
    public static void onRightClick(PlayerInteractEvent event) {
        if(event.getAction() == Action.RIGHT_CLICK_BLOCK) {
                if (event.getItem() !=null) {
                    if (event.getItem().getItemMeta().equals(PlayerHandler.gh.getItemMeta())) {
                        Location playerPos = event.getPlayer().getLocation();
                        int r = 3;
                        for(int x = (r* -1); x <= r; x++) {
                            for(int y = (r* -1); y <= r; y++) {
                                for(int z = (r * -1); z <= r; z++) {
                                    Block block = playerPos.getWorld().getBlockAt(playerPos.getBlockX() + x, playerPos.getBlockY() + y, playerPos.getBlockZ() + z);

                                    if(block.getType() == Material.GRASS_BLOCK) {
                                        block.setType(Material.FARMLAND);
                                    }
                                }
                            }
                        }
                    }

                }
            }
        }
    }
quaint mantle
reef lagoon
#

Where should I store private vaults

noble lantern
#

btw

#

setLocation in NMS is a teleport method

#

oh wait wtf

#

man use 1.14

#

smh

#

all that to spawn an ender dragon

quaint mantle
#

I try to switch versions

#

intellij wont let

noble lantern
#

Thats not intellij thats a maven/gradle thing

#

you change the import of the spigot version you use

noble lantern
#

what storage system are you gonna use?

quaint mantle
#

how?

noble lantern
#

Flatfile? Database?

noble lantern
# quaint mantle how?

you change the spigot import in your pom.xml if your using maven, in the <dependencies> tag

quaint mantle
#

oh

#

from spigot to spigot-api

#

?

chrome beacon
#

No

vast raven
#

Half failure

#

I mean, sometimes it works, but sometimes no

#

I think that it's the same even the plugin I've made.

noble lantern
#

itll show up

dusk flicker
#

?maven

undone axleBOT
noble lantern
#

oh

#

thank you

#

didnt know that existed

chrome beacon
#

I doubt they actually want to change version though

dusk flicker
#

Lol, np

#

tons of commands exist in here

noble lantern
chrome beacon
#

some people aren't that smart

noble lantern
#

1.8 in a nutshell

tender shard
#

WTF is this?! o0

noble lantern
#

HAHA

dusk flicker
#

lmao

noble lantern
#

1.8 spawning for ender dragon

#

"1.8 is the best version ong"

quaint mantle
tender shard
tall dragon
#

how do people make invisable players visable as a "ghost" to some players., does that happen when said players are on the same scoreboard team?

chrome beacon
tender shard
#

1.19 be like

dragon.setPhase(...)
noble lantern
#

for hiding entity from another entity

#

forgot its name

#

sorry im not helpful

#

but thats how ppl do it

quaint mantle
tall dragon
noble lantern
#

Ohhh

tender shard
chrome beacon
quaint mantle
noble lantern
#

prolly entity z_aCRYYY

noble lantern
#

how

tender shard
dusk flicker
#

also hidePlayer is another option

noble lantern
#

how tf you that fast

dusk flicker
#

Lmao

noble lantern
#

man has a AHK setup for the hideEntity method

tall dragon
#

yea its prolly this Team#setCanSeeFriendlyInvisible(boolean b)

dusk flicker
#

Yeah that is what you want

noble lantern
#

i didnt even know seeing ghost was a thing

#

thought it was just a spectator thing

tall dragon
#

yea it is

dusk flicker
#

yeah its cool

tall dragon
#

its cool for team gamemodes

vast raven
tall dragon
#

so u can see ur team members invisable

noble lantern
#

nice

tender shard
#

is there a better way to change entity's NBT data then "savinng" the entity data into a compoundtag. and then "loading" it back later?

charred blaze
#

what obfuscation is this?

tender shard
#

use another decompiler

#

one that at least prints a proper stacktrace lol

charred blaze
tender shard
#

fernflower, CFR, idk

peak depot
#

well just dont decompile plugins xD

tender shard
#

there's many good onnes

#

I suggest recaf, it has 3 decompilers builtin

dusk flicker
#

you should decompile plugins

charred blaze
tender shard
#

you absolutely should decompile plugins

vast raven
peak depot
tender shard
charred blaze
dusk flicker
#

¯_(ツ)_/¯

tender shard
charred blaze
#

this is not plugin

#

this is java program

tender shard
#

okay what program was it? 😄

charred blaze
#

why are you intrested?

tender shard
#

well you asked a question and I tried to answer it

#

I cannot tell you which obfuscator it is if all you send is "// INTERNAL ERROR"

charred blaze
#

you dont need program's name to answer that question

#

its on java

#

ig

tender shard
#

good luck finding out yourself then, I just tried to help

charred blaze
eternal oxide
#

yes

charred blaze
tender shard
#

well noone can help if you dont tell us what you're decompiling and also dont provide any screenshots of decompiled code or whatever

eternal oxide
#

You try and guess where

tall dragon
#

how do you expect help if we dont even know what you are decompiling

peak depot
#

your like "I need your help" hes ok what are you doing, your like "fuck you"

tall dragon
#

obviously....

charred blaze
#

i cant open cfr

#

hm

tender shard
#

download recaf

#

(the version with "dependencies included")

#

recaf will definitely be able to show you some readable code

tall dragon
#

we have established that. does that change anything?

tender shard
#

lol

dusk flicker
#

lol

charred blaze
eternal oxide
#

Ues

tender shard
#

yes

eternal oxide
#

Yes

tall dragon
#

nvm man

tender shard
#

because we could download it ourself and check it out

charred blaze
#

i cant understand. how

eternal oxide
#

ok you do you

tender shard
#

then waiting until the download is finished

#

then dragging the .jar into CFR or fernflower or whatever

#

and then maybe someone could tell you "that looks like stringer / allatori / proguard / whatever"

noble lantern
#

you may need dex2jar if they obfuscate to smali code

#

normally only android tho

#

didnt say that to complicate things at all dont mind me

charred blaze
tender shard
#

what is dex?

charred blaze
#

obfer maybe?

noble lantern
tender shard
charred blaze
noble lantern
#

and when you decompile the dex you get java smali code

#

from smali code you can convert to plain java

tender shard
#

so it's a minecraft client thing that crashes servers with certain packets, or what?

charred blaze
#

education purposes only*

tender shard
#

why don't you just send the file here

charred blaze
tender shard
#

then DM it to me

chrome beacon
#

Me too :)

tender shard
#

also crash bugs cant be fixed if they are not known

charred blaze
#

:DDD

tender shard
#

so tbf I think its fine to send it here

#

if it indeed can crash servers, those bugs should be fixed

dusk flicker
#

watch it be for like 1.8

charred blaze
#

alot bots*

tender shard
#

oh so it's for cracked servers only?

charred blaze
#

VERI VERI MUCH

dusk flicker
#

just dont use cracked servers

#

easy

tender shard
#

yeah

#

+1

charred blaze
delicate lynx
#

offline mode false moment

charred blaze
#

nfas

#

haxers can use it for botting

delicate lynx
#

those accounts will eventually stop working

charred blaze
dusk flicker
#

haxers

#

lmao

tender shard
#

btw who of you knew that this is a thing? be honest pls

chrome beacon
#

I did

dusk flicker
#

BRUH

#

are you kidding me

#

thats a thing????

opal juniper
#

it’s brand new i thought

noble lantern
#

choco showed it a while ago

tender shard
#

you can also randomly insert links into your code lol

noble lantern
#

wtf

#

why

tender shard
#

label

noble lantern
#

ohh

#

yeah

dusk flicker
#

interesting

tender shard
#

http: // this is just a comment

#

and the countdown thing is just "while(variable-- > 10)"

hot wolf
#

I wanted to download iTag and use that in my plugin, but I can't download it for some reason, and setting nameTags with Teams is broken asf

flint coyote
#

true. Labels are quite cool but rarely of use in java

hot wolf
#

Any suggestions?

tender shard
#

most people probably also don't know that you can spam {} everywhere lol