#help-development

1 messages · Page 2004 of 1

chrome beacon
#

The Minecraft wiki and Javadocs are a good start. Anyways I doubt you'll be needing teams for a duel plugin?

tardy delta
#

oh that teams

viral crag
#

that plugin above deals with factions which is somewhat a different type of team implementation

elfin steppe
fallen sandal
#

so

viral crag
#

"That message recieved event won't be fired on the server thread. Be aware this might cause issues" as Olivo said

fallen sandal
#

he said to use this channel?

viral crag
#

yes they said that too

red sedge
#

is there anyway i can set PDC as a stringlist?

fallen sandal
#

than can i get help in this channel?

viral crag
#

why dont you listen for a command instead of trying to work with a messaging event that might not happen?

trail pilot
#

do uhm

quaint mantle
#

How would I create a function outside of a file in java, and use import to retrieve it and use it?

viral crag
#

register and listen for your own command - then the server will respond when the comamnd gets called

fallen sandal
#

the command will not be executed in game tho..

#

its on discord

viral crag
#

is the discord API actually working fully again? - yeah it looks like it

fallen sandal
#

yes it is working

#

i had made a ping pong command

viral crag
#

it was broken most of yesterday

round finch
#

Hello xnotro

#

how it going with coding?

#

oh dear

fallen sandal
round finch
#

he got lost? hmm

#

oh i see

novel vine
#

hello guys, I use ProtocolLib to get a packet from the server, but I get this error. anyone knows what the problem is?

undone axleBOT
#

"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.

novel vine
#
20:35:32 ERROR]: [Terraplusminus] Unhandled exception number 512 occured in onPacketSending(PacketEvent) for Terraplusminus
com.comphenix.protocol.reflect.FieldAccessException: No field with type [B exists in class ClientboundLevelChunkWithLightPacket.
        at com.comphenix.protocol.reflect.StructureModifier.readInternal(StructureModifier.java:218) ~[ProtocolLib.jar:?]
        at com.comphenix.protocol.reflect.StructureModifier.read(StructureModifier.java:197) ~[ProtocolLib.jar:?]
        at de.btegermany.terraplusminus.Terraplusminus$1.onPacketSending(Terraplusminus.java:87) ~[terraplusminus-1.0-SNAPSHOT.jar:?]
        at com.comphenix.protocol.injector.SortedPacketListenerList.invokeSendingListener(SortedPacketListenerList.java:195) ~[ProtocolLib.jar:?]
        at com.comphenix.protocol.injector.SortedPacketListenerList.invokePacketSending(SortedPacketListenerList.java:149) ~[ProtocolLib.jar:?]
        at com.comphenix.protocol.injector.PacketFilterManager.handlePacket(PacketFilterManager.java:535) ~[ProtocolLib.jar:?]
        at com.comphenix.protocol.injector.PacketFilterManager.invokePacketSending(PacketFilterManager.java:516) ~[ProtocolLib.jar:?]
        at com.comphenix.protocol.injector.netty.ProtocolInjector.packetQueued(ProtocolInjector.java:346) ~[ProtocolLib.jar:?]
        at com.comphenix.protocol.injector.netty.ProtocolInjector.onPacketSending(ProtocolInjector.java:308) ~[ProtocolLib.jar:?]
        at com.comphenix.protocol.injector.netty.ChannelInjector.processSending(ChannelInjector.java:436) ~[ProtocolLib.jar:?]
        at com.comphenix.protocol.injector.netty.ChannelInjector.access$800(ChannelInjector.java:72) ~[ProtocolLib.jar:?]
        at com.comphenix.protocol.injector.netty.ChannelInjector$3.handleScheduled(ChannelInjector.java:376) ~[ProtocolLib.jar:?]
        at com.comphenix.protocol.injector.netty.ChannelInjector$3.onMessageScheduled(ChannelInjector.java:346) ~[ProtocolLib.jar:?]
        at com.comphenix.protocol.injector.netty.ChannelProxy$2.schedulingRunnable(ChannelProxy.java:127) ~[ProtocolLib.jar:?]
        at com.comphenix.protocol.injector.netty.EventLoopProxy.execute(EventLoopProxy.java:95) ~[ProtocolLib.jar:?]
        at net.minecraft.network.Connection.writePacket(Connection.java:401) ~[?:?]
        at net.minecraft.network.Connection.send(Connection.java:348) ~[?:?]
        at net.minecraft.server.network.ServerGamePacketListenerImpl.send(ServerGamePacketListenerImpl.java:2022) ~[?:?]        at net.minecraft.server.network.ServerGamePacketListenerImpl.send(ServerGamePacketListenerImpl.java:2008) ~[?:?]        at net.minecraft.server.level.ServerPlayer.trackChunk(ServerPlayer.java:2162) ~[?:?]
        at net.minecraft.server.level.ChunkMap.playerLoadedChunk(ChunkMap.java:2139) ~[paper-1.18.1.jar:git-Paper-"c50fc3a"]
        at net.minecraft.server.level.ChunkMap.updateChunkTracking(ChunkMap.java:1587) ~[paper-1.18.1.jar:git-Paper-"c50fc3a"]
        at net.minecraft.server.level.ChunkMap.move(ChunkMap.java:1920) ~[paper-1.18.1.jar:git-Paper-"c50fc3a"]
        at net.minecraft.server.level.ServerChunkCache.move(ServerChunkCache.java:1158) ~[?:?]
        at net.minecraft.server.network.ServerGamePacketListenerImpl.handleMovePlayer(ServerGamePacketListenerImpl.java:1528) ~[?:?]
        at net.minecraft.network.protocol.game.ServerboundMovePlayerPacket.handle(ServerboundMovePlayerPacket.java:114) ~[?:?]
        at net.minecraft.network.protocol.game.ServerboundMovePlayerPacket$Pos.handle(ServerboundMovePlayerPacket.java:42) ~[?:?]
        at net.minecraft.network.protocol.PacketUtils.lambda$ensureRunningOnSameThread$1(PacketUtils.java:56) ~[?:?]
        at net.minecraft.server.TickTask.run(TickTask.java:18) ~[paper-1.18.1.jar:git-Paper-"c50fc3a"]
        at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:149) ~[?:?]
```...
quaint mantle
#

When moving commands to an executor, it doesnt work ingame. All that happens is it types "/challange" in chat. Why?

main script:

getCommand("challenge").setExecutor(new ChallangeCommand())

ChallangeCommand.java

public class ChallangeCommand() extends JavaPlugin implements CommandExecutor{
    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args){
        if (sender instanceof Player){
            if(getConfig().getBoolean("damageEvent")) {
                getConfig().set("damageEvent", false);
                new PluginFuncs().sendGlobalMessage(ChatColor.RED + "Challenge has stopped.");
            }else{
                getConfig().set("damageEvent", true);
                new PluginFuncs().sendGlobalMessage(ChatColor.RED + "Challenge has began!");
            }
        }

        return true;
    }
}
novel vine
quaint mantle
#

yep

commands:
  challenge:
    description: Starts the server challenge.
    usage: /<command>
#

Are you not allowed to run "extends JavaPlugin" twice?

misty current
#

does BlockPlaceEvent#getItemInHand() return the placed block when it was an item, based on what hand did the player place it with?

quaint mantle
#

cause if so that MAY be my issue

#

but ill need a workaround

misty current
#

like if the block is placed from ur offhand

#

it returns the item in the offhand

quaint mantle
misty current
#

same for mainhand

quaint mantle
#

wrong ping

misty current
#

dw

chrome beacon
#

?di

undone axleBOT
quaint mantle
#

Oh thats in a seperate script alltogether

#

so I can have seperate functions in a different place

#
package me.emerald.mphone;

import org.bukkit.Bukkit;

public class PluginFuncs{
    public void sendGlobalMessage(String msg){
        Bukkit.getOnlinePlayers().forEach(sender -> sender.sendMessage(msg));
    }
}
#

wym?

undone axleBOT
quaint mantle
#

I see

PluginFuncs.sendGlobalMessage(ChatColor.RED + "Challenge has stopped.");
#

So if I convert it to static I can do this

#

Thats what you mean?

sterile token
#

Also why doing that method when you just do: Bukkit#BroadCast("my awesome text")

#

Sounds ilogic but idk

tall dragon
#

because that requires a perm

quaint mantle
#

Oh.

sterile token
#

What requiere perms?

quaint mantle
#

I made a typo.

#

Might be why it wasnt working.

#

:P\

tall dragon
#

Bukkit#broadcastMessage() requires players to have a perm to see it

sterile token
#

Lol really

#

Which versión talking about

tall dragon
#

1.18

sterile token
#

Ujg

#

Thst the problem

quaint mantle
#

Im using 1.12.2 for the time being

sterile token
#

Emerald we recommend you learning java

#

You cannot use an api without learning the laguage Java()

quaint mantle
#

I mean, I know how HTTP requests, and apis work

#

Ive done them in the past lol

#

GET, POST, etc

tall dragon
chrome beacon
#

?learnjava It's time

undone axleBOT
sterile token
#

You should straight learn the programming laguage to them understand how the api works and use them

#

🤔

quaint mantle
#

By the way, what do you mean here?

quaint mantle
undone axleBOT
sterile token
#

Yeah please read the documentation

#

Its a simple questions that I think google can answer better than us

elfin steppe
#
@EventHandler
    public void onRightClick(PlayerInteractAtEntityEvent e) {
        Player p = e.getPlayer();
        if (e.getRightClicked().getType().equals(EntityType.ARMOR_STAND)) {
            if (e.getRightClicked().getCustomName() == null) {
                return;
            }

            if (e.getRightClicked().getCustomName().equalsIgnoreCase(ChatColor.RED + "Beast")) {
                new SpawnGUI();
                return;
            }
     }
#

Someone who can tell me if this code is right?

#

what does pdc stand for?

quaint mantle
#

I cant find anything about it

#

Except 1 site

tardy delta
#

about what

quaint mantle
#

Which doesnt explain it

sterile token
#

He should learn everything literally

tardy delta
#

wha-

sterile token
#

Java DI, constructors, static, private, etc fields

trail pilot
#

no

quaint mantle
#

Ive done LuaU for 4 years

#

and trying to learn a new language

#

not the funnest change

#

considering its VERY different

sterile token
#

Because how you would be using an api without knowing how static, private, etc keywords works. How to do dependency injection and many things

#

I dont know Lua but Java its oriented to Object

elfin steppe
#

But even without using the name, f.ex. this:

    @EventHandler
    public void onRightClick(PlayerInteractAtEntityEvent e) {
        Player p = e.getPlayer();
        if (e.getRightClicked().getType().equals(EntityType.ARMOR_STAND)) {
            new SpawnGUI();
        }
    }

It is still not opening the gui when I right click an armorstand

tardy delta
#

no need for equals

#

use == instead

#

kekw

#

the spawngui isnt probably opening itself

sterile token
#

I prefer doing equals for comparing object

elfin steppe
#
public class SpawnGUI implements Listener {
    private final Inventory inv;

    public SpawnGUI() {
        inv = Bukkit.createInventory(null, 9, "Spawns");

        initializeItems();
    }

    public void initializeItems() {
        inv.addItem(createGuiItem(Material.BEACON, ChatColor.AQUA + "Center", ChatColor.BLUE + "Click to spawn!" ));
        inv.addItem(createGuiItem(Material.COBBLESTONE, ChatColor.AQUA + "Parkour", ChatColor.BLUE + "Click to spawn!"));
    }

    protected ItemStack createGuiItem(final Material material, final String name, final String... lore) {
        final ItemStack item = new ItemStack(Material.BEACON, 1);
        final ItemMeta meta = item.getItemMeta();

        meta.setDisplayName("Parkour");

        meta.setLore(Arrays.asList(lore));

        item.setItemMeta(meta);

        return item;
    }

    public void openInventory(final HumanEntity ent) {
        ent.openInventory(inv);
    }

    @EventHandler
    public void onInventoryClick(final InventoryClickEvent e) {
        if (!e.getInventory().equals(inv)) return;

        e.setCancelled(true);

        final ItemStack clickedItem = e.getCurrentItem();

        if (clickedItem == null || clickedItem.getType().isAir()) return;

        final Player p = (Player) e.getWhoClicked();

        if (clickedItem.getType().equals(Material.BEACON)) {
            Location loc = new Location(Bukkit.getWorld("world"), 139.5, 8.0, 75.5, 180, 0);
            p.teleport(loc);
            new Beast().giveKit(p);
            return;
        }
    }

    @EventHandler
    public void onInventoryClick(InventoryDragEvent e){
        if (e.getInventory().equals(inv)) {
            e.setCancelled(true);
        }
    }
}
hasty prawn
#

^

#

Gotta call openInventory lol

elfin steppe
#

omg

#

bruh

#

stupid

dire salmon
#

lol

elfin steppe
#

thanks

smoky oak
#

query. Does declaring variables in the function head final convert those variables into final ones or is it a necessity to enter final variables into the function call?

tardy delta
#

i would initalize te items in the constructor too

elfin steppe
#

Can you tell me what i'm supposed to put in the brackets of openInventory() ?

tardy delta
#

the inventory

#

aasuming Player#openInventory(inv)

#

wait nvm that method

#

im doing a related thing lol

elfin steppe
#

Its still red

#

Maybe bc i only made that method under my

#

main method

tardy delta
#

constructor shouldnt really handle the opening

#

👉👈

smoky oak
#

well, that just sounds like openInventory with extra steps

#

yea but

#

why not call directly said function

elfin steppe
#

It's working now t

#

ty

smoky oak
#

I read that

#

but

#

either way you're allowing access to openInventory() from outside the class

#

why not declare openInventory() public and be done with it

#

then why in the world do you write a function which does nothing besides calling openInventory() ???

#

huh i thought it didnt matter

#

since you're only passing the player there

earnest forum
#

that function is redundant

#

why make it?

cobalt tinsel
#

Hi

#

I need help

elfin steppe
#
public void initializeItems() {
        inv.addItem(createGuiItem(Material.BEACON, ChatColor.AQUA + "Center", ChatColor.BLUE + "Click to spawn!" ));
        inv.addItem(createGuiItem(Material.COBBLESTONE, ChatColor.AQUA + "Parkour", ChatColor.BLUE + "Click to spawn!"));
    }

    protected ItemStack createGuiItem(final Material material, final String name, final String... lore) {
        final ItemStack item = new ItemStack(Material.BEACON, 1);
        final ItemMeta meta = item.getItemMeta();

        meta.setDisplayName("Center");

        meta.setLore(Arrays.asList(lore));

        item.setItemMeta(meta);

        return item;
    }

Is that second method really necessary n if not what am i supposed to put in place of inv.addItem(createGuiItem(Material.BEACON, ChatColor.AQUA + "Center", ChatColor.BLUE + "Click to spawn!" then?

crimson terrace
cobalt tinsel
#

final Proton instance = Proton.getInstance();
Intrinsics.checkExpressionValueIsNotNull((Object)instance, "Proton.getInstance()");
instance.getCommandHandler().registerClass((Class)BanCommand.class);

dire salmon
undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!

cobalt tinsel
#

how

smoky oak
#

` three of that symbol

#

followed by java

#

followed by code

#

followed by ` three times again

crimson terrace
#

thats how to make a code block

cobalt tinsel
#
        Intrinsics.checkExpressionValueIsNotNull((Object)instance, "Proton.getInstance()");
        instance.getCommandHandler().registerClass((Class)BanCommand.class);
dire salmon
#

yea

#

where java

earnest forum
tardy delta
cobalt tinsel
#
final Proton instance = Proton.getInstance();
        Intrinsics.checkExpressionValueIsNotNull((Object)instance, "Proton.getInstance()");
        instance.getCommandHandler().registerClass((Class)BanCommand.class);
tardy delta
#

and what do we need to do with that?

dire salmon
#
final Proton instance = Proton.getInstance();
        Intrinsics.checkExpressionValueIsNotNull((Object)instance, "Proton.getInstance()");
        instance.getCommandHandler().registerClass((Class)BanCommand.class);
earnest forum
#

like picking up an item from the ground

cobalt tinsel
dire salmon
#

we dont know what Proton is

#

and what is the problem

cobalt tinsel
#

my plugin is kotlin code, so I don't know how to make parse the final, to kotlin

#

since there's no final in kotlin, only var and val

tardy delta
#

owo

dire salmon
#

i dont think you can make plugin in kotlin

earnest forum
#

you can

dire salmon
#

oh ok

dire salmon
elfin steppe
tardy delta
#

why kotlin tho?

#

setItem i mean

#

lol look at the methods available

#

and te signature

earnest forum
#

that's not an item stack constructor

#

@elfin steppe

elfin steppe
#

Then how am i supposed to add a name and a lore

earnest forum
#

it's (material, amount)

#

itemmeta

young knoll
#

You need to get the meta, set the name and lore, and then set the meta back

earnest forum
#

ur method before was perfectly fine

elfin steppe
#
protected ItemStack createGuiItem(final Material material, final String name, final String... lore) {
        final ItemStack item = new ItemStack(Material.BEACON, 1);
        final ItemMeta meta = item.getItemMeta();

        meta.setDisplayName("Center");

        meta.setLore(Arrays.asList(lore));

        item.setItemMeta(meta);

        return item;
}

You mean this?

earnest forum
#

yeah

cobalt tinsel
elfin steppe
#

But if i want to add a second item it gives me an error

#

unreachable statement

earnest forum
#

why are those variables final

#

they don't need to be

#

can you send the error?

elfin steppe
#

I j followed the Create a GUI guide

#

yeah alr

#

Wait first

young knoll
#

They don’t need to be, but they might as well be

elfin steppe
#

If i want to add a second item, am i supposed to do it in the same method or in a diff one?

earnest forum
#

same

#

whole point of a method like that is to simplify code that repeats

#

that u run multiple times

elfin steppe
#
    protected ItemStack createGuiItem(final Material material, final String name, final String... lore) {
        final ItemStack item = new ItemStack(Material.BEACON, 1);
        final ItemMeta meta = item.getItemMeta();

        meta.setDisplayName("Center");

        meta.setLore(Arrays.asList(lore));

        item.setItemMeta(meta);

        return item;

        final ItemStack item2 = new ItemStack(Material.COBBLESTONE, 1);
        final ItemMeta meta2 = item2.getItemMeta();

        meta2.setDisplayName("Center");

        meta2.setLore(Arrays.asList(lore));

        item2.setItemMeta(meta);

        return item2;
    }

Error: unreachable statement (line final ItemStack item2 = ...)

#

Sorry if it's bad this is kinda new for me

earnest forum
#

you returned

#

return item;

#

closes the function

young knoll
#

Run the method twice

elfin steppe
#

ohh so bc it returns it stops the code

earnest forum
#

yeah

young knoll
#

Don’t add more to the method

earnest forum
#

yes

elfin steppe
#

i see

tardy delta
#

🥺

#

you cant do stuff under a return statement

elfin steppe
#

n at the end do i j return item2 then

earnest forum
#

unless if it's like in an if statement

earnest forum
quaint mantle
#

How do you get all the PermissionAttatchents from a player?

elfin steppe
#

oh no returns at all

#

alr

earnest forum
#

run the function again with the other information

#

No you need the first return item

tardy delta
#

dont modify the method, just call it again but wit different parameters

#

so for each item

earnest forum
#

^

tardy delta
#

kinda owo uwu

sterile token
earnest forum
#

every time you want an item stack call that

#

function

#

change the arguments

tardy delta
sterile token
tardy delta
#

still

sterile token
#

Didnt he have problems with menu items?

elfin steppe
sterile token
#

Or ima wrong

earnest forum
sterile token
earnest forum
#

Call the function with your arguments

#

And then when you need to create the second item

#

Call that function again but with the second items information

tardy delta
#
inv.setItem(2, createItem(Material.WEED, "weed or something", "just", "no"));
inv.setItem(3, createItem(*/ some other stuff /*))```
earnest forum
#

^

tardy delta
#

ah there is no weed ingame

quaint mantle
tardy delta
#

so the point of that method is that you can call it multiple times to create different items

sterile token
elfin steppe
#

Ohhh okay i understand now, thanks @earnest forum & @tardy delta :)

earnest forum
#

No problem

#

Good luck with your plugin

sterile token
#

Vuxer if you have more dudes just rember to ask

elfin steppe
sterile token
#

dw?

#

Allright thanks

quaint mantle
#

I still down understand after research zach.

#
this.JavaPlugin = JavaPlugin
#

It doesnt seem to work when doing this

#

?

sterile token
#

?learnjava moment

undone axleBOT
tardy delta
#

JavaPlugin is a class name, javaPlugin is a variable name

sterile token
#

So prob its ignoring time now....

quaint mantle
#

Well I ask for legimate help, and I check those sites

#

NONE OF THEM help me with that

earnest forum
#

learn java before doing spigot

sterile token
earnest forum
#

JavaPlugin is a class name

#

You have to set that variable to

#

your main class

#

the one that extends JavaPlugin

quaint mantle
sterile token
quaint mantle
#

clearly it is

sterile token
#

So why you ask btw

earnest forum
#

Classes shouldn't start with lowercase

sterile token
#

😂

quaint mantle
#

Cause im confused on how to do that

dire salmon
#

lol

quaint mantle
earnest forum
#

But yes

loud haven
#

Your main class already extends JavaPlugin. You need to pass the instance of the main class on to the common executor class. The common way to do that is called Dependency Injection.

dire salmon
#

?di

undone axleBOT
earnest forum
#

@quaint mantle where are you trying to make the variable?

quaint mantle
#

I need JavaPlugin in order to access getConfig

#

so I can overwrite a setting

loud haven
#

you're not supposed to extend JavaPlugin again. Only your main class should extend it.

young knoll
#

You can only have 1 class that extends javaplugin

earnest forum
#

you can only have 1 class that extends JavaPlugin

quaint mantle
pliant oyster
#

uhhh I'm new to intellij but how can I make spigot functions and stuff show when I type it

young knoll
#

?di

undone axleBOT
earnest forum
#

Your main class

quaint mantle
#

*From other areas

hexed hatch
#

You really should learn Java before attempting plugin development, but you’re going to want your JavaPlugin instance (of which there is only one allowed) in your command class

earnest forum
#

"TestPlugin"

loud haven
#

I told you, dependency injection

hexed hatch
#

This will only be a miserable experience for you if you don’t learn Java beforehand

earnest forum
#

@quaint mantle

#

Make a variable with the TestPlugin type

#

TestPlugin plugin;

pliant oyster
earnest forum
#

And then you create a constructor with the TestPlugin object as an argument

#

public ClassName(TestPlugin plugin) {

this.plugin = plugin;

}

#

Sorry I'm on phone I can't do the code block

quaint mantle
#

OH WAIT

#

SO THEN I CAN ACCESS IT ELSEWARE

#

im an idiot

earnest forum
#

yes

loud haven
#

yes

quaint mantle
#

im extremely sorry

earnest forum
#

or if you want

#

Make a static object in your main class

#

So you can just do TestPlugin.plugin

quaint mantle
#

But thats fine lol

#

Ill just do it the slightly longer way

sterile token
#

This one of main reason why its straightly recommend to learn Java before trying to use an api

quaint mantle
#

I just wasnt understanding what was being said or meant

#

So I was confused

sterile token
#

Okay?

quaint mantle
#

Not about an hour ago

earnest forum
#

I didn't learn java before doing spigot and it was very annoying

quaint mantle
#
public class PluginFuncs{
    public static void sendGlobalMessage(String msg){
        Bukkit.getOnlinePlayers().forEach(sender -> sender.sendMessage(msg));
    }
}
tardy delta
#

doesnt Bukkit::broadCastMessage work?

pliant oyster
#

can I get some help with something basic, I'll tell u what it is a vc screenshare

quaint mantle
sterile token
quaint mantle
#

to actually send

tardy delta
#

in 1.18 or what?

sterile token
quaint mantle
#

yep

young knoll
#

No

#

Only broadcast requires a permission

sterile token
#

So

young knoll
#

Which you specify

earnest forum
#

There is 2 methods right?

sterile token
#

BroadcastMessage() doesnt require?

tardy delta
#

yes

young knoll
#

Yes

earnest forum
#

one with and without a permission

sterile token
#

So he probably should do: Bukkit.broadcastMessage("text here")

tardy delta
sterile token
#

Looks really weird

pliant oyster
#

can someone help me with something basic in general 1

tardy delta
#

idk probably returns the amount of players reached

earnest forum
#

yeah

#

that sends to console too tho and maybe they didn't want that

tardy delta
#

why should it matter

#

well mye if its a big message

#

still

earnest forum
#

some servers have like messages that advertise stuff

#

like store or discord or something

#

Probably clogs up console

young knoll
#

Then don’t use it

#

Just loop all online players

bright wind
#

some body know how to break a block?

waxen plinth
#

What do you mean

#

You can set its type to air

#

You can call breakNaturally()

earnest forum
#

break naturally drops the block

waxen plinth
#

Yes

earnest forum
#

I wish it played the break noise too

dire salmon
#

would be cool

young knoll
#

You can make a player break it too

bright wind
dire salmon
#

cant you do breakNaturally() and play sound?

earnest forum
#

block.setType(Material.AIR)

earnest forum
waxen plinth
#

.-.

earnest forum
#

But I don't wanna make a whole hashmap for each block break sound

dire salmon
#

lol

earnest forum
#

they've changed nms blocks

#

haven't found any pages on how to get the sound of it breaking yet

red sedge
#

how would i go about checking if the player can have X of itemstack

#

without going overboard

waxen plinth
#

You mean if they can fit it into their inventory?

red sedge
#

yes yes

#

english

waxen plinth
#

Loop their inventory contents

young knoll
#

You can do it with API

waxen plinth
#

An empty slot += the the stack size of the item you're trying to fit

#

A slot with another item = 0

young knoll
#

Block.getBlockData().getSoundGroup().getBreakSound()

tardy delta
#

Inventory#getFirstEmpty != -1 ?

earnest forum
#

is that actually a thing

waxen plinth
#

A slot with the same item += the max stack size minus the amount of the stack

earnest forum
#

that saved me so much time thanks

waxen plinth
#

I didn't know that was a thing that's awesome

young knoll
#

You can also make the player break a block

earnest forum
#

what does that return?

young knoll
#

Probably makes a sound

red sedge
earnest forum
#

Sound object?

young knoll
#

A Sound

earnest forum
#

That's so useful

waxen plinth
#

Does calling breakBlock on a player call a BlockBreakEvent

tardy delta
#

afaik it returns -1 as default

young knoll
#

Yes

waxen plinth
#

Or does it just break the block straight-up

#

Oh cool

#

Since when has that been a thing

young knoll
#

That’s why it’s useful

red sedge
young knoll
#

1.17 I bugged choco to add it

#

I think

waxen plinth
#

lol

tardy delta
#

?ischocoreal

undone axleBOT
#

No, Choco is not real. I was not programmed to say this by Sam.

waxen plinth
#

Choco is a real one

#

Still no TNTIgniteEvent though

young knoll
#

BlockIgniteEvent

waxen plinth
#

I don't think that gets fired when it's triggered by redstone

young knoll
#

Idk if that’s tnt or fire tbh

waxen plinth
#

Pretty sure that's fire

young knoll
#

I’m sure we can arrange a TNTIgniteEvent

#

I want a CreeperFuseStartEvent too

waxen plinth
#

I opened a feature request for it

#

It was closed as duplicate and then never added lol

young knoll
#

Link?

waxen plinth
#

Lemme try and find it

quaint mantle
#

@earnest forum Found a smaller way to do it in the process!
Again tysm!

public static JavaPlugin jp;
jp = this;
TestPlugin.jp.getConfig() //works
earnest forum
#

put the jp=this in onEnable

quaint mantle
#

I did

tardy delta
#

just dont make it public but write a static method to access it

earnest forum
#

ok nice

young knoll
#

I’ll look at it when I get home later

#

Jira mobile is trash

river oracle
#

I used to get yelled at on forums for using static access. so I started using dependency injection (for retrieving main plugin)

young knoll
#

Ehhh

#

It’s an arguable area

earnest forum
#

I just do Main.get()

#

static method

tardy delta
#

?main lol

earnest forum
#

is that like really bad to do?

young knoll
#

MyMainClass.getInstance looks nicer

tardy delta
#

call it getInstance or getPlugin or something ._.

river oracle
#

lots of arguments around how you actually should do it from what i've seen dependency injection is the better way overall, but with spigot the static access doesn't matter too much

young knoll
#

As for if a static getter for your plugin is bad

#

Ehhhh

#

Hard to say

#

It’s a singleton anyway

sacred mountain
#

hey does anyone know how to use the lombok setter with bukkits fileconfiguration? i know how to use getter already

sterile token
#

Dependency Injection - Should be used to access to every classes
Singleton - For access to utility clases or libraries

#

That what ima understand

young knoll
#

The problem with DI for your plugin class is you sometimes end up passing it around a lot

#

Since you need it for some things, like runnables

river oracle
sacred mountain
#

this is my getter

#

works nicely

#

but i have to use config.getBoolean so i cant set a fileconfig getter so

river oracle
sacred mountain
#

im just having confusion

trail pilot
#

soo

#

its been so long

young knoll
#

Honestly I might start using the singleton again

#

I don’t think it gets a premium plugin denied, so that’s all that counts :p

wet breach
#

why would singleton use get a premium plugin denied?

sacred mountain
young knoll
#

There’s a lot of argument about treating your main class as a singleton

sacred mountain
#

like it will create the method setConfig(Fileconfiguration config)

wet breach
#

singletons have legitimate uses in Java o.O

wet breach
river oracle
young knoll
#

Oh no it’s conclure

#

Hide

tardy delta
ivory sleet
#

I mean to be fair, most of the times singleton causes more trouble than the benefits you get from it

#

hello

tardy delta
#

🎶

young knoll
#

Imma make a plugin with only singletons

ivory sleet
#

It scarcely has a correct usage

young knoll
#

Just for the spite

river oracle
sacred mountain
sterile token
#

?paste

undone axleBOT
wet breach
#

otherwise internally wise, singleton use is perfectly fine

wet breach
#

also singleton is really the only way to ensure a singular object exists

#

and that someone doesn't accidentally create another one

sterile token
young knoll
#

Oops I accidentally reflected another one into existence

sterile token
wet breach
#

sometimes

#

just depends on why you need it, as stated most people don't use them correctly

river oracle
#

for my personal library I just call JavaPlugin over any specific instance 🤷‍♂️ easier for me though I'm sure theres probably a better way there almost always is lol

wet breach
#

so for example in that plugin, I use a singleton for TutorialManager

#

because I need to ensure only one of those exists

trail pilot
#

so how i cna make my perm node?

wet breach
#

perm mode?

quaint mantle
#
ItemStack deco = new ItemStack(Material.STAINED_GLASS_PANE);

for ItemStack, how would I make it a colored stained glass?

#

EX: The color red

young knoll
#

What version

quaint mantle
#

1.12.2

young knoll
#

Ew

wet breach
trail pilot
young knoll
#

Iirc it’s material, amount, data

#

I think they data for red is like

#

14

river oracle
#

red is 14 yea

red sedge
river oracle
#

look up bytes needed on google there is probably somtehing

young knoll
#

So glad those magic values are dead

river oracle
#

agreed

wet breach
#

one of few areas I hated magic numbers

dire salmon
#

how do i check for online players?

young knoll
#

Bukkit.getOnlinePlayers

river oracle
#

Bukkit.getOnlinePlayers

dire salmon
#

Player player = getServer().getOnlinePlayers(); dont work

river oracle
#

you type faster than me ahh

wet breach
young knoll
#

We really need a /jd <method/class>

dire salmon
young knoll
#

All online players

#

Are not a single player

wet breach
#

Player isn't an array type or collection type

#

now Player[] is though

#

seems you need to learn your Java types

young knoll
#

I just use object for everything

wet breach
#

have no idea what you are doing, but I doubt you really want a Player[] array object though

tardy delta
young knoll
#

I am yes

#

That’s what it is, to be fair

red sedge
dire salmon
river oracle
#

uhm why

young knoll
#

What player

kindred valley
#

Hey guys im trying to freeze someone when his heart is half how can i do

dire salmon
red sedge
#

player#isOnline?

#

idk?

young knoll
#

Then loop over getOnlinePlayers

river oracle
#

if they are not online it won't play?

wet breach
viral crag
dire salmon
#

for(Player players : Bukkit.getOnlinePlayers()) {} got no errors

young knoll
#

The heck is FREEZE

wet breach
#

you could optionally use OfflinePlayer().isOnline() as well

kindred valley
#

that command does not even work im trying to fix it

young knoll
#

you can freeze a player several ways

red sedge
#

tf is freezing ffs?

young knoll
#

Make no move

red sedge
#

ohh

dire salmon
#

p.addPotionEffect(slowness)

red sedge
#

check damage event

young knoll
#

High slowness and jump boost is an option

hexed hatch
#

Set movement speed to zero, give the player a negative jump boost effect, and cancel move events that change their location, not their facing direction

young knoll
#

setWalkSpeed is an option

#

The move event is an option

red sedge
#

ya but you can still jump for the setWalkSpeed

young knoll
#

Yeah

dire salmon
#

p.addPotionEffect(new PotionEffect(PotionEffectType.SLOWNESS, timeInTicks, 255))?

young knoll
#

So combine with jumpboost

quaint mantle
#

Teleport them back to loc is also an option.

hexed hatch
#

That’s what the boost is for

young knoll
#

Although even then you can still creep forward

red sedge
#

minecraft should add a way to set jump hight without jump boost

dire salmon
#

negative jumpboost? :thonk:

viral crag
#

pretty much anything else might show a result rather than the jump potion effect

kindred valley
young knoll
kindred valley
#

is there any problem?

river oracle
#

you can just cancel the player move event if they are frozen too

young knoll
#

A jump height attribute

red sedge
#

yes!!!

hexed hatch
young knoll
#

For players, not just horses

hexed hatch
#

I don’t remember which

red sedge
viral crag
dire salmon
#

i would be the mule type

red sedge
#

yes!

#

turning players into horses will fix every single issue in the game

viral crag
#

if a player is dead then <=0 is valid, you need to go back to <1 - at least you are no longer checking a dead player to see if they have health

digital nova
novel vine
digital nova
#

Hmm

#

how are you sending said packet?

red sedge
#

because <1 is dead

red sedge
#

youre looking for <2 that would mean they are on 1(half) heart

novel vine
digital nova
#

Hmm any example of specific params that causes the issue?

viral crag
dire salmon
#
if(p.getHealth()>=0.0 && p.getHealth()<=0.5){
//returns half heart
}
red sedge
#

r u sure

young knoll
#

Health is a double

dire salmon
young knoll
#

You can technically be on 0.00001 health

#

0.5 hearts is 1 health

novel vine
kindred valley
#

what is the default walk speed?

viral crag
young knoll
#

If it matches the attribute it’s like

#

0.1

#

Movement speed is weird

digital nova
kindred valley
#

thanks

#

i want to ask how can i use playerdeathevent on another event

novel vine
viral crag
kindred valley
#

like if(e.getPlayer.Respawn == true)

viral crag
kindred valley
viral crag
#

depends when you want the action to happen

kindred valley
#

No, when i set entity's walk speed 0 if he dies, after he respawns he continues with same walk speed

#

want to freeze the entity

young knoll
#

Use the respawn even to set it back

muted sand
#

is it possible to see what ip/port combination a user connected with, and then run bungeecord commands that way?

kindred valley
young knoll
#

Why

viral crag
#

does potion effect get canceled on respawn? i'd think it would

kindred valley
#

    public void onDying(PlayerRespawnEvent e) {

        if(e.getPlayer().getWalkSpeed() == 0) {
            
            e.getPlayer().setWalkSpeed(0.2F);
        }

    }```Like this?
kindred valley
#

oh forgot

young knoll
#

Controversial

river oracle
#

Curly brackets look better lol

young knoll
#

Ew

#

Inline is only good for returns

viral crag
#

at that point why bother with the if, lose an extra char

digital nova
#

@novel vine Assuming your using an idea such as intellij that can decompile class files, check all the fields of ClientboundLevelChunkWithLightPacket class

#

cause No field with type [B exists in class ClientboundLevelChunkWithLightPacket.

#

Ah shit its not a class lmao its a custom exception

#

just gonna throw this here btw

kindred valley
#

do i need to control players health from damage event?

#

is there any other event which control healths?

somber hull
#

Should I use a hashmap for per player variables over persistent data?

dire salmon
#

25k chars long

lost matrix
young knoll
#

Hashmap isn’t persistent

lost matrix
#

If you want it to be persistent then hashmaps need extra work

somber hull
#

Well saving it to a file

young knoll
#

Meh

#

Small data is fine in pdc

#

If you don’t need it offline

lost matrix
kindred valley
lost matrix
kindred valley
lost matrix
#

EntityDamageEvent

dire salmon
#

ye

quaint mantle
#

in the config file, how would i create an array and overwrite it?
ex:

Challanges:
  Hunger: false
  BreakBlock: true
#

I know how regular ones work

#

but not maps

#

If its not possible however lmk

dire salmon
#
if(p.getHealth()<=1.0&&p.getHealth()>0.0){
code
}
#

smth like this

lost matrix
quaint mantle
#

setting hunger to true or smth

#

As it seems that I cant do that

lost matrix
dire salmon
#
public EntityDamageEvent onGetDamaged(Player p){
 if(p.getHealth()<=1.0&&p.getHealth()>0.0){
return healThing
}
}
quaint mantle
#

thats what getConfig() is for

#

part of JavaPlugin

lost matrix
# quaint mantle config.yml
        FileConfiguration configuration = getConfig();
        configuration.set("MaxHealth", 40.0);
        saveConfig();

This overwrites the MaxHealth path inside the config.yml

quaint mantle
#

the way im doing its an actual array

#

inside of it

#

would i do idk

#
configuation.get("Challanges").set("Hunger", true)
lost matrix
#

I see. One moment.

kindred valley
#

In this when he fells or he gets damage from lava p.setwalk not working

lost matrix
lost matrix
lost matrix
quaint mantle
#
SomeValues:
  - "Foo": true
  - "Bar": true
  - "Baz": true
  - "Han": true
SomeValues:
  - "Foo": false
  - "Bar": false
  - "Baz": false
  - "Han": false
#

Like so

lost matrix
quaint mantle
#

cause im overwriting the bools not the name

lost matrix
#

Oh wait. What you posted is something completely different

#

Thats an array of objects... quite weird to handle

#

Why dont you just do

SomeValues:
  Foo: false
  Bar: false
  Baz: false
  Han: false

And then overwrite SomeValues.Baz

quaint mantle
#
FileConfiguration configuration = getConfig();
configuration.set("SomeValues.Bar", true);
#

@lost matrix ???

lost matrix
#

Sure

quaint mantle
#

what

marble rivet
#

is there a way to convert yaw into 0 to 360 instead of -180 to 180?

lost matrix
#

yaw + 180 lol

sacred mountain
#

when using fileconfiguration.set() if the key is already there will it set the key? and if its not there will it create the key?

dire salmon
#

yaw = 360 lol

sacred mountain
#

or is that setdefaults

lost matrix
sacred mountain
#

where will it it put it

#

just at the end of the file? or in a space

#

between lines

lost matrix
#

Depends on if parts of the path already exist

echo granite
#

How to handle java.lang.Record cannot be resolved to a type?

sacred mountain
#

lets say completely random path

#

for testing

#

where would it go

sterile token
echo granite
#

It's 17

lost matrix
sacred mountain
#

if the file had return gaps and stuff

echo granite
#

I'm trying to create a very simple record

#

In fact, even without any fields the error is still thrown

lost matrix
lost matrix
echo granite
#

okay for some reason the error vanished... ._.

quaint mantle
#

@lost matrix You. Are. Amazing.

echo granite
#

most likely a reload bug

quaint mantle
#

Thank you SO much

pliant oyster
#

How can I set a player to max health using attributes?

dire salmon
#

player.setHealth(20.0)

lost matrix
dire salmon
#

or that

echo granite
dire salmon
#

a

pliant oyster
#

alr thx

sterile token
pliant oyster
dire salmon
#

whats the difference between += and =+?

#

dont send ?learn java '-'

vocal cloud
#

?google

undone axleBOT
vocal cloud
lost matrix
dire salmon
#

oh kk thanks

viral crag
#

yeah... broken operator

ornate patio
#

how can i have two clickevents in the same line

#

for a TextComponent

viral crag
#

the same way you debounce switches?

ornate patio
#

what

#

im saying like i wanna send a message in chat

viral crag
#

onclick offclick

ornate patio
#

<-- --> like this

#

where clicking on back arrow fires an event

#

clicking on foward also fires an event

#

but they're both in the same line

sterile token
#

I dont think you can do that

viral crag
#

dunno, i cant use those

ornate patio
ornate patio
sterile token
#

You can use hover event

viral crag
ornate patio
#

i mean that doesn't mean its broken though

#

they just didnt implement it

viral crag
#

okay

sterile token
loud haven
#

@ornate patio Make separate TextComponent, one for left arrow and one for right arrow. Set a different click event for each of these text components. Then append them together.

ornate patio
sterile token
#

// Hover message
TextComponent component = new TextComponent(Chat.style("&sMy message"));
component.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder(Chat.style("Hovered message")).create()));

// Hover message that execute a command
TextComponent component = new TextComponent(Chat.style("&sMy message"));
component.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder(Chat.style("Hovered message")).create()));
component.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/gamemode 1"));

@okokay1204

ornate patio
loud haven
#

component1.addExtra(component2) ...

ornate patio
sterile token
#

You can just create a somehting like this

#

// create each comoponent
TextComponent right = new TextComponent("text");
TextComponent left = new TextComponent("text");

// Main component
TextComponent base = new TextComponent(Chat.style("&sMy message"));
base.addExtra(right);
base.addExtra(left);
ornate patio
#

i just needed to know .addExtra()

sterile token
#

You can find it on the too

#

?jd

sterile token
#

Just search the class TextComponent and read the methods

fiery gale
#

I am trying to ENTITY_DESTROY my snowball.class projectile but I am getting an error code not sure how to properly destroy the projectile but keep the passenger so that the projectile is invisible

still verge
#

whats that website that has imgs of all mc blocks/items

undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!

sterile token
fiery gale
#

?ask I am trying to ENTITY_DESTROY my snowball.class projectile but I am getting an error code not sure how to properly destroy the projectile but keep the passenger so that the projectile is invisible

undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!

sterile token
sterile token
#

Sorry i confuse you

fiery gale
#

aw ur good

#

is this not the right channel?

young knoll
#

You do know spigot has an api to hide entities now

fiery gale
#

no i don't what is it

#

i want to hide a projectile snowball

#

thought you had to use packet destroy but what is the api to hide entity?

#

or... projectile

sterile token
sterile token
#

Send it on ?paste

fiery gale
#

aw so you can just hide it

sterile token
#

?paste

undone axleBOT
fiery gale
#

yea gotchya

young knoll
#

Just use the api

sterile token
#

Yeah dont complicate your life using packet when you can use the api

fiery gale
#

is it just hideEntity?

young knoll
#

I sent you the docs

sterile token
young knoll
#

Read them

sterile token
#

Why people doesnt like reading the docs?

still verge
sterile token
fiery gale
fossil lily
#

Is there an event for when a player puts something in their offhand?

hexed hatch
#

PlayerSwapItemEvent something

#

PlayerSwapHandItemsEvent

fossil lily
#

Amazing

#

Thanks

young knoll
#

Iirc that only runs when they do it using F

#

idk tho

tall dragon
#

yea

#

using the hotkey indeed

pliant oyster
young knoll
#

?jd-s

undone axleBOT
pliant oyster
#

thx

quaint mantle
#

guys but if I wanted to make a plugin that assigns specific permissions like I write "/ perm @user plugin.fly" assign the specific permission can it be done?

tall dragon
#

yes

#

but why reinvent the wheel

pliant oyster
#

yes it can be done

quaint mantle
#

is there any guide?

pliant oyster
#

no

quaint mantle
#

.-.

pliant oyster
#

I would prefer using luck perms or something

tall dragon
#

^

quaint mantle
tall dragon
#

why do you want your own permission plugin tho

pliant oyster
#

well you would have to be advanced in both java and spigot to recreate a plugin like luckperms

quaint mantle
pliant oyster
#

I don't see the point

tall dragon
#

me neither, Luckperms has everything you could hope for & is bug tested extensively

pliant oyster
#

yeah

quaint mantle
#

uhm..

#

rip

#

.-.

young knoll
#

But we need to reinvent the wheel

#

I mean look at wheels, they suck

tall dragon
#

of course

#

we should make em triangles

#

that would be so much better

sterile token
#

So if you wanna you can add me and them we can take a look together

quaint mantle
#

im italian

sterile token
#

Doing permissions plugins

quaint mantle
#

okay

#

dm

#

me

sterile token
young knoll
#

Good luck

pliant oyster
#

^^^

tidal hollow
#

How can I create a repeating task?

young knoll
#

?scheduling

undone axleBOT
tall dragon
#

?sche ah well coll has fast hands

nova fossil
#

Do you guys know how to run a synchronous task after an async is done? After asynchronously trying to put up an item to auction (using sql), I want to return them the item if it fails and think I should do that in sync right?

young knoll
#

Use a future

tall dragon
#

maybe CompletableFuture

young knoll
#

Those have stuff for handling exceptions and syncing back to the calling thread and all that

nova fossil
#

Yeah I’m currently using a completable future with a while loop, but Idk if that’s the best way

tall dragon
#

show your code

dusk flicker
#

in a paste

young knoll
#

A while loop?

#

Don’t futures haves methods for doing stuff when they finish

#

Like thenAccept

tall dragon
#

yea they do

nova fossil
#

Oh I’ll look into that

pliant oyster
#

uhh I got an error and I'm confused on what I did wrong

#
java: no suitable method found for registerEvent(com.blebdapleb.firstplugin.listeners.WelcomeListener,com.blebdapleb.firstplugin.FirstPlugin)
    method org.bukkit.plugin.PluginManager.registerEvent(java.lang.Class<? extends org.bukkit.event.Event>,org.bukkit.event.Listener,org.bukkit.event.EventPriority,org.bukkit.plugin.EventExecutor,org.bukkit.plugin.Plugin) is not applicable
      (actual and formal argument lists differ in length)
    method org.bukkit.plugin.PluginManager.registerEvent(java.lang.Class<? extends org.bukkit.event.Event>,org.bukkit.event.Listener,org.bukkit.event.EventPriority,org.bukkit.plugin.EventExecutor,org.bukkit.plugin.Plugin,boolean) is not applicable
      (actual and formal argument lists differ in length)```
#

``package com.blebdapleb.firstplugin;

import com.blebdapleb.firstplugin.commands.AddCommand;
import com.blebdapleb.firstplugin.commands.FeedCommand;
import com.blebdapleb.firstplugin.commands.HealCommand;
import com.blebdapleb.firstplugin.commands.MultiplyCommand;
import com.blebdapleb.firstplugin.listeners.BlockBreakListener;
import com.blebdapleb.firstplugin.listeners.WelcomeListener;
import org.bukkit.Bukkit;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.plugin.java.JavaPlugin;

public class FirstPlugin extends JavaPlugin {
@Override
public void onEnable(){

    //Commands
    getCommand("hello").setExecutor(new HelloCommand());
    getCommand("add").setExecutor(new AddCommand());
    getCommand("multiply").setExecutor(new MultiplyCommand());
    getCommand("heal").setExecutor(new HealCommand());
    getCommand("feed").setExecutor(new FeedCommand());

    //Events
    Bukkit.getPluginManager().registerEvent(new WelcomeListener(), this);
    Bukkit.getPluginManager().registerEvent(new BlockBreakListener(), this);
    getLogger().info("Hello world");
}

@Override
public void onDisable(){
    getLogger().info("This plugin has been disabled");
}

}``

young knoll
#

registerEvents

eternal night
#

registerEvents

tall dragon
#

shoulnt you use registerEvents

pliant oyster
#

?

tall dragon
#

yep

pliant oyster
#

fuck

#

im stupid

#

mb

young knoll
#

Ur ide should be yelling at you

mighty bane
#

Okay so we are at a complete loss. We're trying to make an invisible arrow. Everywhere we've looked says to use packets however we have absolutely no clue how to use packets.

pliant oyster
young knoll
#

Assuming you are on latest

mighty bane
#

We've looked at the api.

young knoll
#

Player#hideEntity

mighty bane
young knoll
#

Yes

mighty bane
#

Thanks

young knoll
#

is often used to denote instance methods

hexed hatch
#

there's no use in obfuscation

#

if someone wants it deobfuscated, it will be deobfuscated

dusk flicker
#

cause its useless

hexed hatch
#

because what do you have that's worth protecting?

dusk flicker
#

makes debugging a bitch, can be bypassed immeditly

young knoll
#

My amazing code

hexed hatch
#

even if someone rips your plugin apart, changes it, and uses it for themselves

#

so what?

dusk flicker
#

what actually does your plugin do

young knoll
#

Support open source

dusk flicker
#

like, anticheat, core, etc?

hexed hatch
#

oh

dusk flicker
#

Public or private?

hexed hatch
#

now that is a somewhat useful case

young knoll
#

Meh

hexed hatch
#

but even then

#

it'll be deobfuscated

young knoll
#

The cheat developers know how to unobfuscate

dusk flicker
#

Id recommend you look into MCMs policys regarding obfuscation

#

Not sure if they have one or not, I know Spigot does for example

young knoll
#

MCM doesn’t really care

#

Afaik

#

Well yeah

#

It’s java

#

It’s always going to be convertible to something readable

dusk flicker
#

to your original question, most things will be deobf very fast, it's def a short list that take a little bit longer than instantly to deobf

young knoll
#

Meh

#

Who cares if you slow down the cheat devs by like

#

A day

dusk flicker
#

Optic would prob know some decent ones, if they are willing to share them

nova fossil
#

Do you guys ever upload open source plugins under your real names, or is it a good idea to use a separate Minecraft-username-GitHub account?

young knoll
#

I mean I think most people use a username

#

But that’s up to you

dusk flicker
#

do you mean by real name like main github account?

#

Or something else

wet breach
#

thing is with Java is that a plugin doesn't need to be deobfuscated to use it

nova fossil
#

Yeah like my main GitHub for irl stuff, versus my Minecraft one

dusk flicker
#

they're a spigot resource staff, Optic prob sees obfuscation on a daily basis lol

hexed hatch
#

he would know more than you think given his background

mighty bane
# young knoll Player#hideEntity

Okay so question about this. According to the api. This method is deprecated. Does that mean they made anew method for doing it or are they just removing it in newer versions?

dusk flicker
#

I personally just use my main

wet breach
#

this is why obfuscation is mainly pointless

wet breach
#

the only valid use case for it is optimization purposes

#

as obfuscation can make things smaller

mighty bane
young knoll
#

There you go

mighty bane
#

What does that mean?

dusk flicker
#

it's a draft of a feature I presume

young knoll
#

It means it’s a work in progress

#

But it works fine

mighty bane
#

Ah okay

#

Thanks

wet breach
#

you can still attempt to use obfuscation if you want. Just don't be surprised if people still get around it. Like myself, I don't need to actually see your code to know how it works, I can just read the bytecode to figure it out.

young knoll
#

I wonder why spigot doesn’t make like

#

An @Draft annotation

#

I wonder how many anti cheats exist now

nova fossil
#

The only reason I want to use my main(real name) GitHub is because I want to put the project on my resume. But at the same time I don’t want my Minecraft name linked to my irl name. I’m in a tough spot. I might post the open source project on my real GitHub and create new accounts for everything (like spigot to post it) to protect my anonymity alittle. What would you do in my situation?

wet breach
#

most people use proguard

#

its sufficient enough usually

wet breach
young knoll
#

Because if someone knows your real name they can uhh

#

Idk

#

Eat your soul

wet breach
#

well that is shame, my soul has been eaten already

#

so no soul to give

nova fossil
#

The same reason banksy doesn’t want their identity to be revealed xD

lost matrix
young knoll
#

Lol

#

Your real name isn’t really that personal

#

Especially if it’s just your first name

lost matrix
#

I agree. Making your first name public is like disclosing the color of your dogs hair. Not really that personal.

nova fossil
#

No it’s first and last

young knoll
#

Meh

lost matrix
young knoll
#

Unless you have the worlds most unique name combo, it doesn’t really matter still