#help-development

1 messages · Page 1632 of 1

native nexus
#

Are you having a bet with someone Dufji? xD

quaint mantle
#

uhhhhhm
The method register(CommandMap) in the type Command is not applicable for the arguments (ListLocations) i tried casting it to commandmap to fix the error at first but now i'm getting this runtime one

#

oh i know. they said it was

dense compass
#

yeah, you gotta have a parent server

quaint mantle
native nexus
quaint mantle
tame elbow
quaint mantle
#

this thing apparently i'm supposed to register it a different way but i'm not used to it so i don't quite understand it yet

quaint mantle
native nexus
dense compass
tame elbow
quaint mantle
#

lol

native nexus
#

hmm

dense compass
#

¯_(ツ)_/¯

native nexus
#

I don't play enough mc to know this anymore

tame elbow
dense compass
dense compass
hasty prawn
#

Zoglin is a zombified Hoglin

dense compass
#

try zoglin tho

#

oh

#

nvm

dense compass
#

?paste

undone axleBOT
hasty prawn
#

Pretty sure PigZombie is the right one. What is it if not a Zombified Piglin?

dense compass
#

took like 2 clicks to find

dense compass
tame elbow
#
            
            PigZombie zompig = (PigZombie) event.getEntity();
            
            ItemStack TerribleHelmet = new ItemStack(Material.LEATHER_HELMET);
            TerribleHelmet.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 10);
            ItemStack TerribleChestplate = new ItemStack(Material.LEATHER_HELMET);
            TerribleChestplate.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 10);
            ItemStack TerribleLeggings = new ItemStack(Material.LEATHER_HELMET);
            TerribleLeggings.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 10);
            ItemStack TerribleBoots = new ItemStack(Material.LEATHER_HELMET);
            TerribleBoots.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 10);
            
            
            
            ItemStack KbeStick = new ItemStack(Material.STICK);
            KbeStick.addEnchantment(Enchantment.KNOCKBACK, 50);
            KbeStick.addEnchantment(Enchantment.DAMAGE_ALL, 5);
            
            zompig.getEquipment().setItemInMainHand(KbeStick);
            
        }``` This is also in a creature spawn event listener
#

oops wrong formatting

dense compass
native nexus
#

nande kore wa??!

hasty prawn
dense compass
#

@tame elbow

native nexus
#

That is...

#

Strange

quaint mantle
#

im back now

tame elbow
native nexus
#

Sigh I have gotten so lazy

#

What is happening to me

dense compass
#

who knows ¯_(ツ)_/¯

quaint mantle
rancid snow
#

is it a bug that every time you milk a cow it has a new unique id

quaint mantle
#

Smol now

#

if i hover over the register which is underlined in

getCommand("listlocations").register(new ListLocations(this));

i get this one annnd i might take a bit to get the other from the terminal
The method register(CommandMap) in the type Command is not applicable for the arguments (ListLocations)

#

if you use getCommand("CMD").setexecutor(new CMDCLASS());

#

no

#

i would use

 getCommand("CMD").setexecutor(new CMDCLASS());
#

only use commandmap if you have a custom coded command map too add

dense compass
#

yeah why r u using register

quaint mantle
#

l have a custom command map for all my commands

#

but you are just trying to register a command

#

ohp, sry, i was a bit confused

dense compass
#

lmao

quaint mantle
#

it only cause i have over 230 Commands in my Core

dense compass
quaint mantle
#

imagine having to put them all into the plugin.yml id rather not

#

im under going a recode for 1.17 tho

dense compass
#

lmao plugin.yml like 3gb

quaint mantle
#

so its gonna get fun 🙂

dense compass
#

such fun

quaint mantle
#

ive decided too add a modular System andd add like custom chat and plugins for all gamemodes 🙂

#

so im looking for too my new project

quaint mantle
#

Yeah

tame elbow
# dense compass <@!565653414340460547>

does not work still... ```if(event.getEntity() instanceof PigZombie) {

        PigZombie zompig = (PigZombie) event.getEntity();
        
        ItemStack TerribleHelmet = new ItemStack(Material.LEATHER_HELMET);
        TerribleHelmet.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 10);
        ItemStack TerribleChestplate = new ItemStack(Material.LEATHER_HELMET);
        TerribleChestplate.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 10);
        ItemStack TerribleLeggings = new ItemStack(Material.LEATHER_HELMET);
        TerribleLeggings.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 10);
        ItemStack TerribleBoots = new ItemStack(Material.LEATHER_HELMET);
        TerribleBoots.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 10);
        
        
        
        ItemStack KbeStick = new ItemStack(Material.STICK);
        KbeStick.addEnchantment(Enchantment.KNOCKBACK, 50);
        KbeStick.addEnchantment(Enchantment.DAMAGE_ALL, 5);
        
        zompig.getEquipment().setItemInMainHand(KbeStick);
        
        
        zompig.getEquipment().setHelmet(TerribleHelmet);
        zompig.getEquipment().setChestplate(TerribleChestplate);
        zompig.getEquipment().setLeggings(TerribleLeggings);
        zompig.getEquipment().setBoots(TerribleBoots);
        
    }```
quaint mantle
#

i think the part im most looking forward too is working with PAPI

dense compass
#

but use

#

?paste

undone axleBOT
quaint mantle
#

whats the problem

dense compass
quaint mantle
#

Yeah

dense compass
#

what would be a use of placeholders tho

quaint mantle
#

i use themm for tab and scoreboard

dense compass
#

idk what game modes ur working witth lol

dense compass
#

custom tags and stuff

#

also would probably be useful in configs

#

idk

quaint mantle
#

as i make a custom score boards 1 for Normal player 1 for Donors and 1 for each staff rank display certain infomation

dense compass
#

idk for now im chill with luckperms xd

#

mostly cause mysql

quaint mantle
#

plus it help cause im use LP to make a grant system through GUI like GrantX but making it so there can be more edits made

quaint mantle
#

TBH ive used LP since it came out and im happy with it

dense compass
#

it just kinda works

#

also i couldnt live without the web editor

quaint mantle
#

it works for everyone even if your new too development his documentation is amazing

#

all it's doing now is printing [], i'm back to square one ;-;

#

easy to understand

quaint mantle
#

Hmm

#

you want me too take a look at your project and fix it for you Smol

#

i- i would be grateful if you did

quaint mantle
quaint mantle
#

ill take a look and send too you what i fix ed 🙂

tame elbow
dense compass
dense compass
#

when spawn

tame elbow
#

yes

#

it works for other mobs like regular piglins

dense compass
#

well your missing the omport org.bukkit.event.Listener

#

or is it contracted

#

must be lol

#

idk what im on about

tame elbow
#

its there

dense compass
#

oh here is your problem

#

if(event.getEntityType() == EntityType.ZOMBIFIED_PIGLIN { missing closed bracket

#

for the if statement

tame elbow
#

i have that in eclipse i just miss typed it

dense compass
tame elbow
#

its there

dense compass
#

okay

dense compass
#

idk if that works

#

try getEntity().getType()

tame elbow
#

I know it works for other mobs in the plugin

dense compass
#

ik it seems dumb but might not be EntityType

#

oh okay

tame elbow
#

this works for a regular piglin

dense compass
#

and there isnt any console errors?

#

and its def defined in main class?

#

and also make sure it has @brave glenHandler

#

oops

#

uhh

#

okay nvm was just a person

#

well make sure it has @ EventHandler

tame elbow
#

it does

#

i cant check console because i was testing it on minehut

quaint mantle
#

@quaint mantle show me where they said

#

start reading from here

#

Kid

#

“Change a hologram”

dense compass
#

@tame elbow ur missing a closed curly bracket

quaint mantle
#

it’s a placeholder

dense compass
#

at end

#

they dont match

#

neither doees that paste

tame elbow
#

Its there in eclipse

dense compass
#

resend it exactly the same

tame elbow
#

also eclipse would throw me the error if it was missing

dense compass
#

copypaste

tame elbow
#

?paste

undone axleBOT
tame elbow
dense compass
#

ty

#

thats what i wanted originally lol

tame elbow
#

the other code works so i wasnt going to send it

narrow furnace
#

why so many missing lines

echo basalt
#

This honestly looks like a horrible approach ehh

narrow furnace
#

is that just the paste

dense compass
#

whats with the semi colons

dusk flicker
#

please format that

dense compass
#

after closed curly brackets

dusk flicker
#

lmao

quaint mantle
#

omg

dense compass
#

can zombie pigs even wear armor

#

im confused

tame elbow
#

i also have an item trying to be put in main hand

#

also not going

dense compass
#

well get rid of the ; and try again

#

apart from that i dont see a problem

tame elbow
#

that was auto generated by eclipse i think

dense compass
#

you wont regret

narrow furnace
#

switch to neovim

#

😃

dense compass
#

okay

#

also no

#

but

#

okay

narrow furnace
#

neovim > all

#

its true

tame elbow
#

my original qustion was if there was a different entity identifier for zombie piglin besides pigzombie

dense compass
#

but this very useful

tame elbow
quaint mantle
#

net beans

#

is best

#

because beans is funny word

dense compass
#

;-;

#

just anything thats not eclipse

quaint mantle
#

eclipse is ew

dense compass
quaint mantle
#

i got github dev pack and intellij ultimate is epic

tame elbow
quaint mantle
#

?paste

undone axleBOT
dense compass
#

error?

#

also use paste

pure pecan
#

oh okay

#

The problem I'm facing is that there isn't an error in the console

#

it just doesn't do anything- I know the ItemStack works because if I don't have anything in my main hand, it will have an error.

dense compass
#

yeah you should probably add a null check for that

#

but doesnt matter

#

so it doesnt give the attribute ?

pure pecan
#

it doesn't give it yeah

dense compass
#

oh i see why

#

you forgot to update the actual item

pure pecan
#

oh I see

#

thanks

dense compass
#

np

bright jasper
#

I improved it ```java
@Command(aliases = {"link"})
public class CommandLink {
private final DiscordLink plugin;

public CommandLink(DiscordLink plugin) {
    this.plugin = plugin;
}

@Default
private boolean link(CommandSender sender) {
    sender.sendMessage(plugin.getLocale().getElement("link.example").set("player", sender.getName()).info());
    return true;
}

@Command(
        aliases = {"subcommand"},
        userOnly = true
)
private boolean subcommand(CommandSender sender, @Choice({"coffee", "tea"}) String drink) {
    sender.sendMessage(plugin.getLocale().getElement("link.example").set("player", sender.getName()).success());
    sender.sendMessage("You like " + drink);
    return true;
}

}

i am proud of this lmao
#

🤡

dense compass
#

lol nice

bright jasper
#

it works on fabric too

#

brigadier support soon

#

@quaint mantle hey nice seeing you here too LMAO

#

Mi no espanol

#

currently in a priv vc, in like an hour i prob can

#

🤡

#

I write really complex code that works at 2am and need to clean it a day later but keep it working

#

"Fuck you too, Java!!!"

#

God tier comments

#

Have you seen source engine comments?

#

It gets more hectic as you progress

#

Honestly if you make debug UI in any game just use dear imgui, do not bother making your own fucking table element

#

For menu UI thats fine but like bruh moment for debug uis dont bother

#

you are in java so you kinda have to i think

#

imgui has no bindings does it?

#

I just use ImGui and make a terminal tab on the top that rises from the top of the screen

#

and some draggable windows you can toggle with F keys or menu bar on top

#

but Imgui did 90% of the work for that so yeah

#

For my AP Computer Science assignment i had to use java but was burned out for video games and lwjgl was not helping so i did this https://github.com/Riku32/Chippy8. This is how i learned to never do emulation in java

#

🤡 java has no unsigned 8 bit type

#

We live in a memory leaking universe

#

that is why it stretches

#

I was using Swing but uh when i made it i was using linux and Qt did not mix well with Java

#

so it looked really fucked

#

so i made it look the same on all platforms

#

also was lazy so that code uses lombok, excuse that please

#

I do not use lombok on anything i will actively maintain in the future

young knoll
#

Does java have unsigned anything

#

Except char

bright jasper
#

not sure but there is no 8 bit type

#

a regular char is 16 bytes since its unsigned

#

so it was difficult to emulate number looping since i was emulating a form of binary and overflow is normal in most ASM

#

so it something goes to 257 instead of 0 big problem

#

yeah thats what i did

young knoll
#

That is very not ideal

bright jasper
#

well its the only thing you can do if you are using java for it

young knoll
#

Mhm

bright jasper
#

i had to use java cuz assignment

young knoll
#

I wonder why java doesn’t have unsigned types yet

bright jasper
#

Tfw this is what the add instruction looked like for adding one register to another

#

    // ADD Vx, Vy
    private void op_8XY4() {
        // VF is set to 1 if the result was greater than 255, otherwise 0
        byte sum = (byte) (V[opX()] + V[opY()]);
        V[15] = (byte) (((sum & 0xff) < (V[opY()] & 0xff) || (sum & 0xff) < (V[opX()] & 0xff)) ? 1 : 0);
        V[opX()] = sum;

        pc += 2;
    }```
#

🤡

#

emulation moment

young knoll
#

That’s gonna be a yikes from me

bright jasper
#

I mean it wont look nicer in C++, maybe a few less horizontal length

young knoll
#

Looks like decompiled minecraft code

bright jasper
#

Thats emulating an instruction that a CPU is supposed to do

#

basically emulated a chip8

#

setting opX is the first argument so you are setting the register of the first arg(index) to the sum

#

and the second thing sets the 15th register to something(i forgot) if the sum was something

#

but yeah thats how the CPU works

#

pc += 2 adds 2 to the program counter which is also a register and 2 is the size of a normal instruction so it skips to the next instruction to emulate

#

but some instructions skip more than 1 or just jump so pc += 2 is not ALWAYS the end of the instruction

fluid cypress
#

how do i do this?

public static Map<World, List<Location>> rtpLocations = new HashMap<>();
...
rtpLocations.forEach(list -> new ArrayList<>());

i dont really understand the for each yet, tho i guess a map is not an iterator, can i achieve that with a oneliner?

#

i want to replace all list of locations on each entry of the map, with a new empty list

paper viper
#

its (key, value)

#

(key, value) ->

#

iirc

#

it uses a BiConsumer

fluid cypress
#

idk what a BiConsumer is

paper viper
#

It's like what you did above but 2 args

#

instead of one

fluid cypress
#

like this? rtpLocations.forEach((key, list) -> new ArrayList<>()); will it keep the same keys?

paper viper
#

Wait what are you trying to do

fluid cypress
#

yea i know what a lambda is, but idk if i can use that with maps

paper viper
#

The difference however between map and list is that one has two args, and the other has one argument only

#

because list passes consumer

#

^

bright jasper
#

put whatever after the arrow

fluid cypress
bright jasper
#

k is key, v is value

#

why tf

fluid cypress
#

so the keys will be the same?

bright jasper
#

is my computer autocorrecting

paper viper
#

rtpLocations.forEach((world, list) -> rtpLocations.replace(world, new Arraylist<>());

#

^ this

#

lambdas itself are fast

bright jasper
#

it gets compiled to the same result and there isnt much of a difference im pretty sure in hotspot anyway

paper viper
#

faster than anonymous classes

#

cause it uses invokedynamic

#

and saves computation space/time

fluid cypress
native nexus
#

nerd mode activated

bright jasper
#

hotspot(best java compiler/runtime) optimizes streams and foreach

fluid cypress
bright jasper
#

oracle uses hotspot builtin

paper viper
#

smh

#

lol

bright jasper
#
The OpenJDK is a project under which an open source implementation of HotSpot (and many other pieces of the JDK e.g. compiler, APIs, tools, etc) is developed.
#

pogger

paper viper
#

tbh the performance decrease anyways regardless of the compiler for forEach is negliglble anyways

#

it doesnt build up that much tbh

#

lol

bright jasper
#

i dont use forEach BUT i do like streams actually. They are useful when you need to filter out/change the results

paper viper
#

parallel()

#

^ best feature right there

bright jasper
#

yep

paper viper
#

I am a performance freak too

#

but still that is negligble lol

#

mhm

bright jasper
#

I don't hyperoptimize i just optimize normally and use common sense when writing code and optimize more heavily later

paper viper
#
  @NotNull
  public static Optional<String> getFirstResultVideo(@NotNull final String query)
      throws IOException {
    try (final InputStream in = new URL("https://www.youtube.com/results?search_query=%s".formatted(
        query.replaceAll(" ", "+"))).openStream()) {
      final String content = new String(in.readAllBytes(), StandardCharsets.UTF_8);
      final int start = FastStringUtils.fastQuerySearch(content, SEARCH_KEYWORD) + 10;
      return Optional.of(content.substring(start, content.indexOf('"', "videoId")));
    }
  }

Find first video on youtube with search query

#

without api key

native nexus
#

Poggers

bright jasper
#

for anyone who has no idea what void* is its basically Object

#

could be anything or could be nothing

native nexus
#

Yeah its a pointer

paper viper
#

Honestly C++ is just better than Java sometimes lol

bright jasper
#

its a pointer to data of ANY type

native nexus
#

C++ is better than java most of the time

paper viper
#

Mhm

bright jasper
#

ehhhh

#

different

#

C++ is good for things that need C++

native nexus
#

Who in their right mind decided to code a game in java omfg

paper viper
#

Well, im pretty sure you can say Kotlin is better than Java

#

for sure

bright jasper
#

WHIRVIS DID LMAOO

paper viper
#

right lol

#

Kotlin is def better than Java

#

performs the same job as Java but better

native nexus
#

Use microsoft java instead plz

paper viper
#

Lmao C#

#

my only thing about C# that bothers me are conventions

bright jasper
#

I agree kotlin is nice imo, functional good but i use java anyways just because more people know it

native nexus
#

Kotlin is nice, most of my co-workers are frothing over it

#

Trying to convert our systems from java to kotlin

odd sentinel
#

is there an event for when users hit a hotkey to swap inventory items

bright jasper
#

The thing about Java vs C++ is that its a bad comparison. You can write code in C++ and Java and if you arent paying attention in C++ your code will perform worse than Java

native nexus
#

Just use smartpointers for everything

bright jasper
#

Java has lots of features like annotations and runtime reflection and all types of cool stuff like easier dynamic loading for mods/plugins. C++ dynamic linking aint got shit on that but it is faster if you do it right

native nexus
#

easy peasy

bright jasper
native nexus
#

😛

bright jasper
#

Use regular references on everything and use smart pointers when you NEED them

#

general would be worse for this lmao

#

smartpointers are ref counters, you dont need refcounters most of the time

native nexus
#

I am aware dw, just being a pea brain

odd sentinel
#

yup seems right, thanks!

bright jasper
#

Yeah dont worry but like ive seen plenty of code with just random smartptr and uniqueptr and other shit EVERYWHERE they pass data

#

it just annoys me

native nexus
#

Trust me I have seen it too

odd sentinel
#

actually ya

native nexus
#

I come from a game development degree background and I had to work in groups of people that did that

odd sentinel
#

I forget the specifics but it's when you hit 1 and swap the item you're holding. somehow a player use that to put items into an inventory we use for UI

native nexus
#

I wrote a game for the PS4 Library in C++

bright jasper
#

Anyway bottom line java and C++ have different uses and you shouldnt use one for everything. (Tfw nodejs is what people use for webservers but the main processing is only handled on one thread and all async is is just a queue that functions get added to when they are called so promises/async are a lie in JS)

#

🤡

#

This is why i use Rust/Go for servers

#

I could use Java but i do not

#

Nah C++ is good if you use it right but i agree boost is horrible i will never include it

native nexus
#

What is boost? I have never touched it

bright jasper
#

but i never use a one for all solution

#

LMAO IT DOES

paper viper
#

poor dude

native nexus
#

I just use the native libraries

#

Planning on making a game engine completely done with Data Driven Design in mind.

bright jasper
#

or when classes make more sense

#

if you are going data oriented this advice will help you A LOT

#

if you follow it that is

native nexus
#

I well keep that in mind thank you!

quaint mantle
#

how do i download this

hexed hatch
#

?buildtools

#

uh

#

?bt

undone axleBOT
hexed hatch
#

☝️ 😩 ✋

dreamy scarab
#

how can i start learning plugins?

hexed hatch
#

Learn Java

#

Then proceed to learn the Spigot api

#

?learnjava

undone axleBOT
crude charm
dreamy scarab
#

lol ya

hexed hatch
#

And save you from a lot of frustration that you would face if you just try to monkey your way through it

quaint mantle
#

call me noob idc but someone send me example of how tf to use mongo in my plugin

native nexus
#

I mean depends how your data is handled.

#

Easy data serialization

paper geyser
#

hey so I have this code

    public void JoinMana(PlayerLoginEvent event) {
        Player player = event.getPlayer();
        boolean hasPlayed = player.hasPlayedBefore();
        if (!hasPlayed) {
            Mana.setMaxMana(player, 100);
            Mana.setMana(player, 50);
            ManaRegen.put(player.getUniqueId(), 2);
            player.setHealth(10.0);
            System.out.println("test");
        }
        setMana(player, CurrentMana.get(player.getUniqueId()));
    }```
#

and it's applying everytime

#

so i checked by adding

System.out.println(player.hasPlayedBefore());

#

and it returned false

#

any ideas why player.hasPlayedBefore() is always returning false?

hardy swan
#

Although I am not sure what exactly causes this problem, but I think it is recommended that you use PlayerJoinEvent for this, see if it yields expected results.

hardy swan
paper geyser
#

alright will do

#

ahhh alright

#

i updated it and it still returns false

young knoll
#

I assume you have deleted all player data files

paper geyser
#

nope

#

all player data files are still there

#

and i've tried deleting them before

young knoll
#

Well then they have played before

paper geyser
#

yeah

#

you're right

#

so why is it returning false when they have played before

young knoll
#

No idea

#

Offline mode?

hardy swan
#

shouldn't affect

native nexus
#

What is with that setMana function after the if condition scope?

paper geyser
#

yeah and even if it did its on online mode

young knoll
#

I’ve definitely used it in the PlayerJoinEvent before

paper geyser
#

I thought i wasn't saving it properly

#

OH WAIRT

#

NOP

#

IT ISNT

#

when they first join the server I want to set their mana to something

#

no clue why i said what i said first

young knoll
#

You can just get their saved mana

#

And if it doesn’t exist assume it’s a first join

paper geyser
#

oh wait after the scope

#

yeah i can

#

but the issue is also that its always saying they havent joined before

#

when i can see my player data file right there

hasty prawn
#

My guess is that it's not set until after PlayerLoginEvent fires.

#

So if you use PlayerJoinEvent, it'll probably be true.

hardy swan
#

he tried using PlayerJoinEvent tho

paper geyser
#

it looks like

#

PlayerJoinEvent worked?

hasty prawn
#

Why the ?

paper geyser
#

its not fully doing what i wanted but thats on my end

thick blade
#

in which method should I create a scoreboard?

slim owl
thick blade
maiden thicket
#

oh ez claps

#

C# and java legit same

slim owl
#

ok np

maiden thicket
#

w

dense compass
slim owl
dense compass
#

bro

maiden thicket
#

this isnt a place to ask for commissions

dense compass
#

no one is gonna make you a free plugin

slim owl
thick blade
#

Yes, they are the same, but you still won't learn how to create plugins in one day

dense compass
#

go to the spigot website and search for what you need

maiden thicket
#

yes

#

for programming/development help

maiden thicket
#

not to recruit people

#

what plugin are you looking for

dense compass
#

mm

slim owl
maiden thicket
#

no

dense compass
#

why?

maiden thicket
#

i have dms off

#

just say it here

crude charm
#

tell us here

dense compass
#

guys its not worth your effort

maiden thicket
#

that's mods

#

maybe not

#

hold on

slim owl
maiden thicket
#

tf is a netherite dragon

crude charm
#

thats mods lmfao

thick blade
dense compass
dense compass
crude charm
slim owl
maiden thicket
#

it's

#

a server

#

go play it

slim owl
#

its a uhc

maiden thicket
#

yes

#

go play it

dense compass
slim owl
#

it is aldready passed

#

now I cannot play it

maiden thicket
#

its says in the description

#

to play uhc at the ip given

thick blade
dense compass
#

what makes you think you can play it if you have the plugin?

dense compass
slim owl
#

aldready

#

now I cannot play

maiden thicket
#

regardless of that, nobody's going to make it for free

crude charm
#

@slim owl Learn java & forge and make it yourself

maiden thicket
#
  1. it's a completely different model
#

meaning probably an animated armor stand u can ride lol

dense compass
#

sheesh

crude charm
maiden thicket
#

not necessarily

crude charm
#

yes

#

it is

#

look later

dense compass
#

eh

crude charm
#

its defo a mod

maiden thicket
#

what time

crude charm
#

all throughout

dense compass
#

i mean

crude charm
#

bigger crafting tables

#

custom ores

#

custom pickaxe

maiden thicket
#

all of that is possible

#

with custom model data

dense compass
#

yeah

crude charm
#

ik

#

but

maiden thicket
#

and armor stands / mushroom blocks / mob spawners

#

with plugins

crude charm
#

you know what I mean'

slim owl
#

Ik but can anyone make it for free

crude charm
#

no

maiden thicket
dense compass
#

up

slim owl
maiden thicket
#

regardless, all of that is definitely possible with plugins

crude charm
maiden thicket
#

have you seen originrealms

#

xd

slim owl
maiden thicket
#

shit's all plugins

crude charm
#

noob

#

L

slim owl
crude charm
#

L

dense compass
slim owl
#

you don't even know how to mine dirt

maiden thicket
#

@slim owl nobody here is going to make that plugin for free as it requires custom models and a custom minigame

maiden thicket
#

and again, this is not the place to ask

dense compass
#

@crude charm ur not helping xd

maiden thicket
#

i have been saying it calmly

#

i've said

#

many times

maiden thicket
dense compass
#

and the 19 other times

#

lol

maiden thicket
dense compass
#

rightyo then

#

think they are gone, maybe ran out of patients

#

wawt

#

wait

#

patience

#

i can spell

#

shh

dense compass
#

auto correct, mhm

#

shhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh

#

anyways

#

who actually needed help and didnt just want a enderdragon and free labour

median anvil
#

so im trying to use the task scheduler inside of an event handler, but it requires an instance of the main class, how to I get the instance of the main class to be passed into the event handler.

#

getServer().getPluginManager().registerEvents(new BlockBreaker(), this);I have this inside the Main class, so it should be passing itself through via "this", but i don't know how to access it in the blockbreaker class

#

it says plugin is undefined. and i cant reinitialize the Main class by redefining it so idk what to do.

#

Bukkit.getScheduler().runTaskLater(plugin, () -> {}, 200L); this is in my blockbreaker class

#

but plugin is undefined

young knoll
#

Pass it though the constructor of the event class

narrow vessel
#

lambdas make me wet

#

the bed

narrow vessel
#

Main.getInstance()

median anvil
#

I thought static variables didnt work with task schedulers

narrow vessel
dense compass
#

hey what could I use to uniquely identify a custom item? like some tag called "BUILDERS_WAND" or smth idk
(I also want the identification not to rely on lore/item name)

median anvil
#

got it thank you @young knoll @narrow vessel

dense compass
#

also how do I check if has persistent data

narrow vessel
#

google

dense compass
#

i almost guarantee im doing this wrong lmao

dense compass
narrow vessel
#

yes

#

your key needs to be lowercase

#

otherwise that should be fine except for the nullpointerexception youre gonna get if you try getting the persistentdatacontainer off of a item with no meta

dense compass
#

although it doesnt seem to be working

#

is the problem here?

narrow vessel
#

i dont think so

dense compass
#

huh

#

idk then

#

ill do some research

#

wait nvm im just that intelligent

#

i forgot to add event to main class

#

lmao

narrow vessel
#

but youre checking for equals(”BUILDERS_WAND”) but you set builders_wand

#

use == over equals() btw

dense compass
dense compass
narrow vessel
#

your IDE is literally telling you that

dense compass
#

anyways it works

narrow vessel
#

oh wait its probably screaming about nullability

dense compass
hybrid spoke
#

Strings should be compared by #equals

narrow vessel
dense compass
hybrid spoke
#

== just checks if both objects have the same adress in heap

#

and since Strings are immutable it will be false if you are not comparing a String with himself

dense compass
hybrid spoke
dense compass
#

this might be a stupid question but how do I prevent "double clicking" when right clicking a block with playerinteractevent

hybrid spoke
#

no question is stupid. PlayerInteractEvent is called twice. once for each hand. check for the hand and if its the off_hand return

civic adder
#

Hi, I've been having trouble with the Chat Component API. I have a TextComponent that looks like this:

TextComponent mainComponent = new TextComponent(String.format(event.getFormat(), player.getDisplayName(), ""));

but its converting all the hex colors in my display name to legacy. Is there an alternative to the TextComponent above to keep the hex in my display name?

median anvil
#

is there a way to get a true or false on weather or not a block will drop items based on the tool it is being mined by?

quaint mantle
#

How to show a loading screen to a player if chunks are still not loaded for that player

#

for eg: If I am connecting to my server, some chunks are still yet to load for me, so I want a loading screen to show for me until chunks are loaded

#

use vector

#

?jd

hardy swan
#

I'm have successfully registered a custom dispenser behaviour, but whenever I try to use some of the nms classes as alternatives within the behaviour https://paste.md-5.net/afaxopufam.cs (line 15), I get the following message on dispense and server crashes, even after remapping: https://paste.md-5.net/veqakezaki.bash. Any idea on why some classes are absent during runtime? Or rather some methods are not remapped correctly?

hybrid spoke
#

targetVelo#subtract(zombieVelo)

tacit dagger
#

Anyone knows what wrong with this?

gleaming grove
#

maybe because you set 'ignoreCanelled' to true, and then try to invoke it?

#

just try to set @brave glenHandler instead of @brave glenHandler(ignoreCanelled = true)

tacit drift
#

but you can also use .equals(object)

dense compass
#

since when can you use = in if statements

tacit drift
dense compass
#

wha-

tacit drift
#

He asked about ==

tacit dagger
tacit drift
#

anyway

dense compass
#

lol

tacit drift
#

getNearbyEntities​(5,5,5) would return entities in a radius of 5 blocks each direction?

hardy swan
#

Not exactly radius

tacit drift
hardy swan
#

(5,5,5)-cube

tacit drift
#

Ok thx

quaint mantle
#

How to get strings from paper.yml

hardy swan
#

Nothin is round in minecraft

quaint mantle
#

rabbit nose

#

wait r they round

tacit drift
#

Radius in command blocks can form a sphere or a cube

#

😳

hardy swan
quaint mantle
#

k

hybrid spoke
undone axleBOT
quaint mantle
#

Anywhooooooooo

#

How to get strings from paper.yml

hybrid spoke
#

by using spigots IO api?

gleaming grove
#

@tacit dagger and you should make your code shorter ``` @EventHandler
public void onPlayerManipulationArmorStand(PlayerArmorStandManipulateEvent event) {

    ArmorStand armorStand = event.getRightClicked();
    if (armorStand == null)
        return;

    if (armorStand.isValid() && Stream.of("purifux", "dahlia", "spiritfux")
                                .anyMatch(n -> n.equalsIgnoreCase(armorStand.getCustomName())))
    {
        event.setCancelled(true);
    }
}
hybrid spoke
tacit dagger
tacit dagger
gleaming grove
#

maybe i misspeled the name of armorstands

tacit dagger
#

lemme try that

gleaming grove
#

to make sure your armor stand has name, run code Bukkit.getConsoleSender().sendMessage(armorStand.getCustomName());

tacit dagger
#

TYSM

gleaming grove
#

ah so this is the point

#

so your idea is that, players who placed armorstand will not allowed intereact with it?

tacit dagger
gleaming grove
#

ok

#

send me code that create armorstand

tacit dagger
gleaming grove
#

@tacit dagger I guess this is ultimate solution

tacit dagger
hybrid spoke
#

also by refering to null you are not creating an armorstand

#

your method name is misleading

#

make your hashmap final

gleaming grove
hybrid spoke
#

its not. its an example

#

and examples should be almost right and understandable

gleaming grove
#

sure my bad

visual tide
#

is there a way to make sure world.spawnEntity(location, EntityType.ZOMBIE) doesnt spawn a chicken jockey or a zombie with armor or tools?

quaint mantle
#

what JDK should i use if i want to build plugin from 1.13 to 1.17?

#

Should i just use the 1.8?

eternal night
vast sapphire
#

?paste

undone axleBOT
vast sapphire
#

https://paste.md-5.net/gesokofoxu.cs
java.lang.NullPointerException: Cannot invoke "org.bukkit.configuration.ConfigurationSection.getKeys(boolean)" because "section" is null
Why is section null?

vast sapphire
#

yes, I haven't made a location

#

that happens in my commands class

hybrid spoke
#

so there you have the issue

vast sapphire
#

is there any way to not have the plugin fail if there are no locations?

eternal night
#

null check the section ?

hybrid spoke
#

exceptionhandling?

vast sapphire
#

ok

vast sapphire
eternal night
#

huh ? Yes it should

#

if your config is completely empty, you cannot get a section for something that doesn't exist

quaint mantle
#

What is this error?

vast sapphire
eternal oxide
visual tide
quaint mantle
#

how to add a bot to my plguiins]

#

i dont got all day

eternal night
#

I'll try to replicate this Ivj

#

give me a bit

tidal skiff
#
  1. there should prob be more than 1 of these channels but
  2. i have this command that sets a players .setDisplayName(); but im working on a way to reset to the original username but idk how to
#

how do i get the original username of a player entity

visual tide
tidal skiff
#

oh its that simple? thx lol

visual tide
quaint mantle
#

K

#

alr did

#

u trook to liong

visual tide
#

i just saw it lol

eternal night
#

Welp you are right

#

let me check if this is a 1.17 issue

#

Welp, seems like you don't have much of a choice o.O

#

actually surprised this is called in the first plce

#

tbh pretty useless to randomize spawned entities by default

visual tide
#

awesome

eternal night
#

not even that

#

you would have to listen to the spawn event of the chicken

visual tide
#

and check for passenger

eternal night
#

the passengers doesn't exist on spawn

crystal pike
#

What is the best way to save data? Letting server owner know, to gracefully shut down the server, and listen for the onDisable event, to save all data to files? Or have a seperate command, for just saving my plugin data, and make it run that, both as a command and onDisable so it can be ran manually.

Also maybe even automatic saving every couple minutes to not loose too much progress?

visual tide
hybrid spoke
eternal night
#

baby zombie on a chicken

hybrid spoke
#

oh. delay it.

hybrid spoke
ivory sleet
eternal night
#

those are spider jockeys

ivory sleet
#

legenden what type of data?

crystal pike
ivory sleet
eternal night
#

the others are technically called chicken jockey xD

#

still trash that the API spawns them

#

makes no sense whatsoever

ivory sleet
visual tide
eternal night
#

The code to cause this is there on 1.16

#

I am currently creating a test plugin to validate

#

after that I'll open an issue on spigot for it

visual tide
#

alr ty

crystal pike
ivory sleet
crystal pike
#

It's actually not much player data, it's just storing some identifieres for completed and ongoing tasks.

ivory sleet
#

What version? You could probably use the persistent data container api if it’s spigot to avoid handling the data management yourself.

crystal pike
#

1.16.5

#

Oh dang, maybe I can actually, to save the need of creating a json file, just for storing player data. And only keep the quest files

quaint mantle
#

Hey, is there any event related to bonemeal?

ivory sleet
#

Probably PlayerInteractEvent

#

?pdc

crystal pike
#

Hmm, so incase I want to store a list of strings under one namespace, is taht doable?

Not sure how the Tag container works, or if possible to store an array of Strings

eternal night
#

I think the author of the post actually provides an example implementation for a PersistentDataType<byte[],String[]>

grim ice
#

"the author"

#

tbh pdc are rly easy

grim ice
eternal night
#

Yes xD let me be 😅

grim ice
#

I think that's the case, but you can use Conclure suggestion as well

grim ice
#

i learnt pdc from it

#

and now i use pdc in almost every plugin i make, until ppl started telling me not to lmao

eternal night
#

oh sweet xD Yea the biggest issue with PDC is getting your namespaced keys around 😭

#

Well, if you are storing database things in the PDC you are doing something wrong

spare prism
quaint mantle
quaint mantle
ivory sleet
#

BlockFertilizeEvent also exists

#

Also BlockDispenseEvent (:

#

Check jd

#

?jd-s

undone axleBOT
quaint mantle
#

Can you guide me to setup Eclipse IDE (PHP) with Pocketmine?

eternal oxide
#

pocketmine is not spigot

snow vector
#

Hello! Is it possible to send a boolean from the onDisable to a js file? I'm trying to make a addon for the plugin spicord, and it uses js to send messages and run commands

snow vector
#

ok thxs

#

also i cant easily test but ill make test code

oblique pike
#

Anyone knows some library or API for auto config updating?

echo basalt
#

People just usually use config versions

oblique pike
#

Or some opensourced project with that feature so i can learn something

echo basalt
#

Then, on every update, they update it

#

You can have a github repo with the latest config version but it will always just reset stuff

oblique pike
#

I could just take resource file with the same result

snow vector
#

Hm i have tried

#

it doesn't work

#

js file

#

java file

tidal skiff
#

getName is the same as getDisplayName

eternal oxide
#

no its not

timber willow
eternal oxide
#

getName returns the base players name without any modification

crystal pike
eternal oxide
#

adventure = paper, not spigot

timber willow
timber willow
eternal oxide
#

You are looking for help on a paper only item. You need to ask in the paper discord.

timber willow
#

it's not wrong

timber willow
snow vector
#

How do I import a public method in js? i cannot find anything related on stackoverflow

tardy delta
#

is the normal protection enchantment called protection environmental?

grim ice
#

@eternal oxide the plugin does not work, and there are no errors in console or IDE lol

chrome beacon
#

I think he's trying to make plugins in js

snow vector
#

or boolean

#

from java to js

#

or a public class

#

from java to js

chrome beacon
#

Doubt anyone here knows

snow vector
#

ive got functions

#

but my onStop() one doesn't work

grim ice
#

?paste

undone axleBOT
snow vector
#

why?

#

oh error?

grim ice
#

I'm getting a warning "Malformed recipe for cow" which i dont know why

#

none of the stuff in my code are null

#

so..why?

#

the config is

recipes:
  cow:
    itemStack: COW_SPAWN_EGG
    matrix:
    - DDD
    - SSS
    - DDD
    order: DS
    items:
    - DIAMOND_SWORD
    - STICK
hybrid spoke
#

or do you want to have java & js to communicate with each other?

chrome beacon
#

Ah you're making a Discord bot, why not use one of the Java implementations available?

snow vector
#

to a plugin already made

hybrid spoke
#

so either you have to jump to java

#

or you will have to let them communicate with each other

snow vector
#

communicate

spare prism
hybrid spoke
snow vector
#

is that the only way?

hybrid spoke
#

and send them JSON objects

hybrid spoke
snow vector
#

i have got functions linked

#

the onstop one is just broken

#

onstop is the one that should be transmitting the boolean

#

the eventlistener file

chrome beacon
silver shuttle
#

How can I make the no permission message in the plugin.yml configurable in another file?

#

Do I have to check for the permission in the command itself?

grim ice
eternal oxide
chrome beacon
eternal oxide
#

It was originally an array

#

You changed it to lists so of course it won;t work

grim ice
snow vector
eternal oxide
#

change it back to an array as you need it as an array in teh end anyway

grim ice
#

Okay but i didnt make it a list

#

server made it like thaat itself

eternal oxide
#

yes you did

#

in your yml you changed it to a List

#

server doesn;t change the yml unless you tell it to

grim ice
#

o

#

items: {DIAMOND_SWORD, STICK}

#

like that or

eternal oxide
#

[]

grim ice
#

I have that

#

and it changed it to a list

#

lol

eternal oxide
#

not in the yaml you posted you don;t

grim ice
#

uh ok 1s

#

bro

#

it changed it again

#

do i record a video to show you

#

it legit changed itself wtf

eternal oxide
#

then you are telling it to save

grim ice
#

wait

#

does saveConfig; in onEnable do smth bad

eternal oxide
#

you should only saveDefaultConfig() in onEnable

grim ice
#

mhm ok

silver shuttle
#

sender.sendMessage(messages_prefix + config.getString("messages.xget.must-be-player").replace("&", "§"));

#

Why can that statement not access the message under xget?

#

It's so weird, it works fine with every other command

grim ice
#

is that skript

#

or what

silver shuttle
#

that up there is a config

#

and im trying to access it

#

but it doesnt work with the xget

#

OOOH

#

theres a " missing

#

brackets doesnt show that lmao

oblique pike
#

Is there a way to stop items from stacking rather than adding random UUID to their persistent data container?

grim ice
#

@eternal oxide ok it stopped changing itself but

#

i still get Malformed recipe thingy

chrome beacon
#

Then check what is null

eternal oxide
#

on all recipes?

grim ice
#

i only have one so

#

yes

eternal oxide
#

show the recipe

grim ice
#

1s

#
recipes:
  cow:
    itemStack: COW_SPAWN_EGG
    matrix: [DDD, SSS, DDD]
    order: "DS"
    items: [DIAMOND_SWORD, STICK]```
eternal oxide
#

now paste teh actual code you ended up with

grim ice
#

wait

#

1s

#

?paste

undone axleBOT
grim ice
eternal oxide
#

change the malformed message so you know what one its coming from

grim ice
#

o

eternal oxide
#

not with any precision

#

you can limit the onMove to only trigger your test when teh player moves to another block

snow vector
eternal oxide
#

use getBlockX/Z from getFrom and getTo to compare

rare cave
#

packets

eternal oxide
#

Just as heavy as PlayerMoveEvent

prime mountain
#

I have a command that requires 2 people and my PC doesn't have enough ram to have a server and 2 minecraft instances open

#

how do i...test this stuff

#

yea but then they'll be connecting, i'll send it, it'll say "an error occured", i'll reprogram, comeback an hour later n be like

#

"Heyyyy can you rejoin"

rare cave
#

lmao same

grim ice
#

?paste

undone axleBOT
grim ice
#

@eternal oxide

#

i removed continue; now we get errors too

prime mountain
#

.bash???

grim ice
#

i also added a check for every variable

rare cave
#

and im developing a firewall on my fork of bungeecord, its impossible to say "hey could u pls attack my server"

grim ice
chrome beacon
eternal oxide
grim ice
#

mhm

prime mountain
#

maybe thats it

prime mountain
#

oh

#

this looks like a nightmare

chrome beacon
#

It's cool

#

It's not a client though

grim ice
#

t: [eg, eg, eg] is same as
t:

#
  • eg
#
  • eg
    -eg
#

same thing

#

anyway

#

shouldnt we use getStringList

#

or smth

rare cave
#

seeking for a lightweight server

eternal oxide
grim ice
#

hmmhmhmhmhm

#

ok