#help-development

1 messages · Page 628 of 1

buoyant viper
#

personally im a big fan of getServer().getScheduler(), but u can use either or

icy beacon
#

if a language has 2439840 keywords for convenience, then a language that doesn't is at fault for not doing so?

grim ice
#

you scaled the number way too much, although, yes its the language's fault

icy beacon
#

oh god

#

then i don't see the point of continuing this convo

grim ice
#

it's a needed feature, brother

rare rover
#

anything i should do with this?:

    @Override
    @SuppressWarnings("unchecked")
    public <T> void addField(@NotNull String path, @NotNull CachedConfigField<?> cachedConfigField, @NotNull Class<T> Clazz) {
        Class<?> typeClass = cachedConfigField.getValueType();
        SerializationType<T> serializationType = (SerializationType<T>) SerializationHandler.getSerializationType(typeClass);
        configuration.set(path, serializationType.serialize((T) cachedConfigField.getValue()));

        if (cachedConfigField.hasComments()) {
            configuration.setComments(path, cachedConfigField.getComments());
        }
    }``` it looks a bit bulky, i could always split this method too
grim ice
sterile breach
grim ice
#

but you dont see me bitching bout it

icy beacon
#

nobody's stopping you from ending the convo?

#

i am ending it though

#

have a good rest of your day

#

imma continue working

unreal quartz
#

Average SpigotMC conversation

grim ice
#

mediocre java knowledge -> blames api -> "whatever" -> ends conversation

dull goblet
eternal oxide
#

you do nto do new Worth()

#

use the API

dull goblet
#

How? That's what i'm trying to find, and I don't find any documentation

rare sedge
#

Thanks!

eternal oxide
#

good luck with essentialsx API documentation is lacking

#

implement vault instead

remote swallow
dull goblet
#

I've been searching and their main class isn't exposed I think, or i'm just not searching the right way

karmic mural
#

Is there an easy way to check if a block type can be bonemealed? Couldn't find anything in org.bukkit.block

dull goblet
pseudo hazel
#

probably not fool proof

#

the best way is making your own list

#

but like

#

it can depend

karmic mural
#

I'm going to check if applyBoneMeal has a success/fail check

pseudo hazel
#

for example crimson fungus is only bonemealable when planted on crimson nylium

karmic mural
#

ah, it returns true/false if it succeeds or fails

pseudo hazel
#

ah yes then you should use that

karmic mural
#

Thank you for the discussion :) Looks like I should've taken a closer look at the function

civic apex
#

if i wanna have players have different names above their head and in tablist should i create a fake version of the player for tablist and unlist the real one or is there a better way? (using update player info)

lost matrix
remote swallow
#

smiles back

civic apex
lost matrix
civic apex
#

so i should just create a new fake player with the tablist name and send an UPDATE_LISTED info packet to unlist the real one?

#

and about the fake player, how should i handle uuid's?

lost matrix
#

I would simply send this action:

#

UPDATE_DISPLAY_NAME instead of UPDATE_LISTED

civic apex
#

does that ONLY affect the tablist name?

lost matrix
#

Do you want to change the tablist name but not the players overhead name?

civic apex
#

yeah

lost matrix
#

Ah i didnt catch that.
In that case you are right.

  1. Unlist original player [Player Info Update : 3 (update listed)]
  2. Create fake profile
  3. Send fake profile to all players [Player Info Update : 0 (add player)]

UUID doesnt really matter. You need to set the skin
texture if you want to have his face in there.

civic apex
#

UUID doesnt really matter.
does it have to be different from the real player?

lost matrix
#

Well, the uuid does matter actually. Cant be the same as the original players iud

civic apex
#

okay thanks for the help

lost matrix
civic apex
#

also if i keep sending the fake tablist player

#

should i store the "fake" uuid and always use that (or maybe generate it from their uuid in a deterministic way) or just use a random one and remove the other fake one

#

does sending ADD_PLAYER on the same gameprofile cause issues or just replace the old one

silent steeple
#

Bukkit.broadcastMessage(ChatColor.translateAlternateColorCodes('&', messages.getString("hypebox-opening-broadcast")
.replace("%player%",ChatColor.translateAlternateColorCodes('&',player.getDisplayName())).replace("%hypebox%",ChatColor.translateAlternateColorCodes('&', matchingHypebox.getName()))));

zealous osprey
#

Why not make a method that sends msgs to a CommandSender and then just parse all the stuff there. Or use PAPI?

mortal hare
#

is there any way that i can attach custom executor for failing to fulfill with permission requirement of the command

#

like inject some kind of consumer or function

#

if pemission fails

echo basalt
#

SMILE IS ALIVE

#

Finally someone that can outpace my dumb ass

tulip pumice
#

Where is support?

echo basalt
#

?support

undone axleBOT
mortal hare
#

how can i disable tab completion for the command if i want to handle permission by myself (custom permission message)?

remote swallow
#

tab complete event id guess

mortal hare
#

tab complete only handles the tab completion of the args

#

PlayerSendCommandEvent seems to work in this case

#

but what if i add permission to the player

#

it gets desynced

#

ant it wont show up on tab completion

remote swallow
#

player.updateCommands

mortal hare
#

and how can i hook this?

remote swallow
#

just a player instance

mortal hare
#

ik its just when i should invoke this

remote swallow
#

after changing permissions

quaint mantle
# mortal hare and how can i hook this?
try {
            Method m = Bukkit.getServer().getClass().getDeclaredMethod("syncCommands");
            m.invoke(Bukkit.getServer());
        } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) {
            e.printStackTrace();
        }

?

young knoll
#

What's wrong with the api method

#

Too mainstream for you?

river oracle
#

yeah

#

that'd be too convient

buoyant viper
#

xd

mental moon
#

I have this function running every 5 ticks as a part of my main thread.

        String listingString;
        String playerName = player.getDisplayName();
        if (mobHead != null){
            String headTypeName = Util.friendlyEntityTypeName(mobHead.getEntityType());
            listingString = playerName + " (" + headTypeName + ")";
        }else listingString = playerName;
        player.setPlayerListName(listingString);
    }

It adds a cleaned up version of "(EntityType.toString())" to the end of the player's name, or if MobHead == null, sets it back to the player's name with no extra.
This doesn't affect the player's namebar over their head

ocean hollow
#

Why does it give me this? I want to migrate a plugin from 1.18 to 1.19.

As I understand it, this plugin is needed for compatibility, that is, it is not required.

The plugin wiki only wrote about ProtocolLib.

https://gitlab.com/BlockStack/ArtMap

remote swallow
#

it has it as a depend not softdepend

young knoll
#

It's listed under depend:

#

So it is required

remote swallow
#

i beat you

#

get fuckin shat on

#

nerd

eternal night
#

?whereami

mortal hare
#

what im asking how can i sync this method to the rest of the server's operations

civic apex
#

they are not seeing the getName()

zealous osprey
civic apex
# civic apex my clients are seeing changed versions on the overhead name

oh apparently UPDATE_DISPLAY_NAME only affects tablist
edit: it seems to not be the case, but ServerPlayer.listName is a thing so thats good
edit2: after looking more into it, UPDATE_DISPLAY_NAME just takes values from the displayName field (which is only used for tablist) and when creating new packets from a serverplayer, that value gets taken from ServerPlayer.getTablistName(), so essentially my first statement was right,

#

thats handy

#

thanks for the tip

mental moon
civic apex
mental moon
#

Awesome 👍

stiff zinc
ocean hollow
atomic swift
#

could it be if the file is in use?

stiff zinc
chilly hearth
#

lol

rain cypress
#

Class = async thread.

You can accomplish the same thing by wrapping code in the async scheduler… (BukkitRunnable is an abstract implementation of Runnable)

CoreProtect codebase dates back to 2010/hMod days though, before Bukkit even existed.

dull goblet
remote swallow
#

Essentials ess = (Essentials) JavaPlugin.getPlugin(Essentials.class);

ocean hollow
#

if I download plugin there it works. but if I downloading zip, and build artifacts it gives me error. why?

remote swallow
#

they changed something since the release

rare sedge
#

This has been fixed today

livid dove
austere cove
livid dove
#

Could be fun to do plugin jams just in general tbh

austere cove
#

cheers

rare sedge
#

Yeah, I'm happy because this custom generator is critical to my server idea, was so sad when it didn't work haha

rain cypress
austere cove
livid dove
brisk estuary
edgy crystal
rare rover
#

how is this possible?:

[13:01:34 WARN]: java.lang.ClassNotFoundException: net.minecraft.server.level.ServerPlayer```
#

isn't it built into paper? lol

#

or do i need to use spigot mappings

#

yep

#

need to use spigot mappings

#

nvm

umbral ridge
#

hola

rare rover
#

how would i make the player an EntityPlayer?

@EventHandler
    public void onBlockBreak(BlockBreakEvent e) {
        Player player = e.getPlayer();
        try {
            Class<?> entityPlayer = Class.forName("net.minecraft.server.level.EntityPlayer");
            Method tabListMethod = entityPlayer.getDeclaredMethod("J");
            tabListMethod.setAccessible(true);
            Object tabList = tabListMethod.invoke(entityPlayer);
            Bukkit.broadcastMessage(tabList.toString());
        } catch (Exception exception) {
            exception.printStackTrace();
        }
    }```
#

im doing this to learn this type of stuff

umbral ridge
#

Imagine that you have a region, and you want to deny/allow placing/destroying of all/specific blocks for a certain player. How would you save such data to the config?

  • I can't save over 10k materials to the config for every single player to their allowed-list,
  • I could represent all materials with a special string, eg. @everything BUT, what if player wants to deny 1 block and allow everything else?

Any ideas?

#

Eg. how does worldguard handle this

mortal hare
#

so basically i have permission agnostic access handler

#

which works with permissions too, but can exclude tab completion if the permission is set or not

remote swallow
rare rover
#

since im doing Class<?>

remote swallow
#

class.cast

#

player.cast something

rare rover
#

ohh

#

ty

eternal oxide
#

EntityPlayer no longer exists in current nms

rare rover
#

wrong way around

remote swallow
silent steeple
#

jni is so cool

rare rover
#

player.getClass().cast(entityPlayer);?

remote swallow
#

player has to before a craft player then you can get entity player from get handle

rare rover
#

oh right

#

🤦‍♂️

#

wth is this 💀

#

theres no results

remote swallow
#

the different mapping results

#

craft player is a spigot class

#

not a mojank class

rare rover
#

ah

#

do you got a spigot mapping viewer?

remote swallow
#

classes dont really change other than their package

rare rover
#

oh spigot has their own thing

#

nice

remote swallow
#

org.bukkit.craftbukkit.nmsver.package.class

rare rover
remote swallow
#

its versioned

#

eg in 1.18 and .1 its org.bukkit.craftbukkit.v1_18_R1.entitiy.CraftPlayer

rare rover
#

oh bruh

remote swallow
#

yeah its fun

#

thats why i just make modules

rare rover
#

one more question

#

for this

#

would i do Mojang?

#

ima say no

#

because it says that method doesn't exist

chrome beacon
rare rover
#

alr

#

returns false

#

thanks

chrome beacon
rare rover
#

ye

#

this is just testing this

#

i'll make it better

#

:>

#

this a good way of doing this?:

public class NMSHandler {

    private static final String BUKKIT_NMSPATH;

    static {
        StringBuilder path = new StringBuilder("org.bukkit.craftbukkit.");
        switch (Bukkit.getVersion()) {
            case "1.17", "1.17.1" -> path.append("v1_17_R1.");
            case "1.18", "1.18.1" -> path.append("v1_18_R1.");
            case "1.18.2" -> path.append("v1_18_R2.");
            case "1.19", "1.19.1", "1.19.2" -> path.append("v1_19_R1.");
            case "1.19.3", "1.19.4" -> path.append("v1_19_R2.");
            case "1.20", "1.20.1" -> path.append("v1_20_R1.");
        }
        BUKKIT_NMSPATH = path.toString();
    }
}```
quasi raptor
#

any thoughts why am i having this issue? (img1)

public static String prefix = "§7[§x§1§0§f§b§e§a§lꜱ§x§1§d§f§4§e§d§lᴇ§x§2§9§e§d§f§0§lᴀ§x§3§6§e§6§f§3§lꜱ§x§4§3§e§0§f§6§lʜ§x§5§0§d§9§f§9§lɪ§x§5§c§d§2§f§c§lɴ§x§6§9§c§b§f§f§lᴇ§7] ";

Note, that i already tried translating color codes etc...

Info: java 17, 1.20.1 api, Player.sendMessage() method

How it should look like (img 2)

rare rover
#

what should i do then?

eternal oxide
#

sec

rare rover
#

ohh

#

regex?

eternal oxide
#
    public static final String NMS_VERSION = Bukkit.getServer().getClass().getPackage().getName().substring(23);
    private static final Method DEDICATED_SERVER = getMethod("org.bukkit.craftbukkit." + NMS_VERSION + ".CraftServer", "getServer");
    private static final Method SERVER_LEVEL = getMethod("org.bukkit.craftbukkit." + NMS_VERSION + ".CraftWorld", "getHandle");
    private static final Method SERVER_PLAYER = getMethod("org.bukkit.craftbukkit." + NMS_VERSION + ".entity.CraftPlayer", "getHandle");```
rare rover
#

ty

eternal oxide
#

getMethod is ```java
private static Method getMethod(@NotNull String clazz, @NotNull String method) {

    try {
        return Class.forName(clazz).getMethod(method);

    } catch (NoSuchMethodException | SecurityException | ClassNotFoundException e) {
        e.printStackTrace();
    }
    return null;
}```
rare rover
#

👍

hushed spindle
#

how can this value be null if im hard coding it to be present

quasi raptor
rare rover
#

in build.gradle or pom.xml

quasi raptor
#

already did

#

even here

quasi raptor
#

just pure java

rare rover
#

their your compilers

#

basically

#

you need one

quasi raptor
#

where is that tho

rare rover
quasi raptor
rare rover
#

send project paths

#

you cant compile without one of them

quasi raptor
quasi raptor
buoyant viper
#

F

rare rover
#

make a project with them

#

one or the other

quasi raptor
#

ALREADY DID, BUT DIDNT WORK

rare rover
#

you cant fix that without setting UTF-8

quasi raptor
#

maven, gradle and java 💀

rare rover
#

no

#

you dont need both

#

just maven or gradle and java

quasi raptor
#

you see there are 3 projects right 💀

rare rover
#

🤦‍♂️

#

you only need 1 buddy

#

my whole project:

quasi raptor
chilly hearth
#

Btw

hushed spindle
#

unless im missing something obvious

chilly hearth
#

If we want to sell a plugin for money we can upload a link to spigot to the website where they have to buy it this is allowed right

hushed spindle
#

thats how plenty of premium plugins do it yeah

chilly hearth
#

Like even if Ur account is new to spigot

hushed spindle
#

oh, no

#

you cant make premium plugins until you meet certain requirements

chilly hearth
#

Can't we upload the link to another website where 5hey buy it ?

hushed spindle
#

if you mean you make a regular post with a link to your premium plugin then i think it would get deleted

chilly hearth
#

Oh 😐

hushed spindle
#

thats essentially advertising and avoiding the system spigot set in place

#

just get the requirements, its not hard

chilly hearth
#

I see

#

After I reach the requirements then what

hushed spindle
#

then you can upload premium plugins, or you can make a resource where the plugin is purchased from an external site

#

both work

chilly hearth
#

Oh

chilly hearth
hushed spindle
#

that gives you time to get the other requirements

#

uploading at least a couple free resources and getting 80 likes

chilly hearth
#

80 likes isn't it 80 post

hushed spindle
#

i might have misremembered but i thought it was 20 posts and 80 likes

chilly hearth
#

Nop 80 posts

#

And 80 posts means 80 plugins?

hushed spindle
#

replies also count as posts though so helping people out with dev stuff or answering questions is included

#

no

#

any forum post is counted

#

and since plugin updates are also posts, they are also included

#

so 80 posts isnt hard

chilly hearth
#

Oh

#

And 20 positive ratings

hushed spindle
#

ah so i switched those around

chilly hearth
#

Meaning 20 ppl has to rate us 5 stars?

hushed spindle
#

3 free resources

#

no

chilly hearth
#

Then?

hushed spindle
#

positive ratings are like the stars or hearts or informationals people give you

chilly hearth
#

So even if they give 3 starts it wil counted as postive?

hushed spindle
#

plugin reviews are not ratings

#

they mean post ratings like the ones in that image

chilly hearth
#

Oh

hushed spindle
#

and you're also fine to ask for a rating if you've helped someone out

#

some people do that in their signature but anything works

chilly hearth
#

I see

#

Btw u reached Ur requirements

hushed spindle
#

yeah

chilly hearth
#

What they ask u when I try to upload a premium source other than the plugin info

hushed spindle
#

really the only difference is that premium resources need to be accepted before they're available, and that has some rules on its own

chilly hearth
#

Oh

hushed spindle
#

like premium plugins arent allowed to be too simple, you cant use any type of advertising in your plugin description either

#

needs to look like you put some effort into it, code quality cant be garbage

#

but honestly keep your expectations low

#

premium plugins download about 100x less than free ones

#

depends on the plugin of course though

#

and it takes a lot of time to build up some popularity, but that goes with any plugin

chilly hearth
#

Ah

#

I seee

#

Btw polymart is good but they only offers paypal

hushed spindle
#

i prefer to have many people use my plugin than a handful and get a couple bucks out of it

#

but maybe thats just me

chilly hearth
#

Btw what withdraw options spigot offers

hushed spindle
#

im developing something that i hope will be impressive and im releasing it for free, with a premium version that has a couple extra perks, and ill see if that works

#

im not sure actually let me check, think it was just paypal also

hushed spindle
#

yeah just paypal by the looks of it

#

paypal is pretty convenient though so i'd just make one real quick

chilly hearth
#

My country doesn't have PayPal 😦

#

Doesn't it offers payoneer

hushed spindle
#

doesnt have paypal? like its forbidden?

chilly hearth
#

It's not avalible I Pakistan

#

In*

#

If I will use external link option after I reach the requirements

#

Ig*

remote swallow
#

its between you and the seller

hard socket
#

how do I check when a player closes the sign and gets the input

twin venture
#

hi , anyone know how i can make this work ?

when i try to change it , its changed to :
color: color

#

the color

rare rover
#

use json for storing data if you want a file

#

or SQLite

remote swallow
#

show how you save ur config

chilly hearth
twin venture
#

its multiple way's of saving data , i have mysql , sqlite , and yml ,

remote swallow
hushed spindle
#

cant you use an external website to make a plugin available

#

i know mcmmo does that

chilly hearth
#

Not even by using an external website

hushed spindle
#

and use a payment method of your own

remote swallow
#

choco said before you cant have external download links on prem resources

twin venture
remote swallow
#

bc someone would use that for drm

chilly hearth
#

DRM?

remote swallow
#

like piracy protection, or selling the plugin on spigot then selling licenses to use that plugin

chilly hearth
#

What if I use external website with free resources and then they have to pay for it after reaching requirements

remote swallow
#

pretty sure that would be against

#

@worldly ingot can confirm

ocean hollow
#

is there any way in minecraft that renders the map in the player's hands? can i intercept this and load another map?

high pewter
#

I'm making a random events plugin and one event I would like is a random structure (template) event. To get all available templates, I am using NMS like sojava ((CraftWorld) player.getWorld()).getHandle().getStructureManager().listTemplates()And this gives each template as a ResourceLocation. To get this as a Structure, I'll need to convert this ResourceLocation to a NamespacedKey, however ResourceLocation stores a namespace and a path, whereas a NamespacedKey uses a namespace and a key. I assumed a path and a key must just be synonymous, but I'm guessing not becausejava StructureManager.getStructure(new NamespacedKey(resourceLocation.getNamespace(), resourceLocation.getPath()))is always null. How do I correctly convert it?

crystal flax
#

hello i need help java: cannot find symbol symbol: class var location: class de.schlumpfkopf.bungeesystem.utils.OnlineTimeManager

chilly hearth
# remote swallow

Well ig I can't sell it through any websites not even polymart or any other 😦

young knoll
#

Does polywhatever not offer anything other than paypal?

#

lul

chilly hearth
#

Not smth that would work in Pakistan 😦

remote swallow
high pewter
#

Ah, thank you! 😄

chilly hearth
#

Epicebic do you a website that offers anything other than PayPal

remote swallow
#

i know of a load of sites, no idea what payment methods they have

chilly hearth
#

Can u list some

remote swallow
#

built by bit, spigot, hangar (idk about paid plugins at all), modrinth

#

mc plugins

chilly hearth
#

Alr ty

high pewter
# remote swallow CraftNamespacedKey.fromMinecraft accepts a resource loc

Hm I'm still getting null which is strange. No errors, just can't seem to find the structure by the given key. Though, have just thought, not sure if StructureManager works with structure templates, so that might be a different thing

Edit: nvm docs literally refer to Structure as a template so I'm guessing they're synonymous in this context

remote swallow
#

are structures keyed

crystal flax
#

hello i need help java: cannot find symbol symbol: class var location: class de.schlumpfkopf.bungeesystem.utils.OnlineTimeManager can someone help me please

chilly hearth
#

Btw I can upload spigot plugins on hanger assuming it's papermc?

remote swallow
#

probably

young knoll
#

Hanger does not have premium plugins

#

Neither does modrinth

chilly hearth
#

😦

chilly hearth
high pewter
#

An example of a key I'm getting is minecraft:village/taiga/streets/straight_05

vast ledge
#

Json be like

"{\"PREFIX\":\"&7[&fF&eI&cL&7]\"}": "UTIL",
    "{\"LOBBY_LEAVE\":\"%PREFIX% &aYou left the Lobby!\",\"PLAYER_NO_PERMISSION\":\"&cYou do not have the Permissions required to execute this command!\",\"CREATE_LOBBY_SUCCESS\":\"yeet\",\"LOBBY_NOT_ENOUGH\":\"%PREFIX% &cYour lobby must have at least %MIN_PLAYER% players to begin a game!\"}": "LOBBY",
    "{\"PLAYER_ALREADY_INGAME\":\"%PREFIX% &cYou're already in a game!\",\"PLAYER_ALREADY_INLOBBY\":\"%PREFIX% &cYou're already in a lobby!\",\"PLAYER_REMOVE_UNKNOWN\":\"%PREFIX% %REMOVE_NAME% &cEither doesn't exist, or is offline!\",\"PLAYER_NOT_LOBBY_OWNER\":\"%PREFIX% &cYou're not the owner of this lobby!\",\"PLAYER_NO_LOBBY\":\"%PREFIX% &cYou're not in a lobby!\"}": "PLAYER",
    "{\"GAME_LEAVE\":\"%PREFIX% &aYou left the Game!\"}": "GAME",
    "{\"ACCEPT_SENDER_NOLOBBY\":\"%PREFIX% %SENDER_NAME% &cisn't in a lobby!\",\"ACCEPT_RECEIVER\":\"%PREFIX% &aYou accepted %SENDER_NAME%'s &aInvite to a game of &cThe floor is Lava&a!\",\"ACCEPT_UNKNOWN_PLAYER\":\"%PREFIX% %SENDER_NAME% &cEither doesn't exist, or is offline!\",\"ACCEPT_NO_ARGS\":\"%PREFIX% &cName of sender needed. Usage: &f\\/fil game accept <playername>\",\"ACCEPT_NO_INVITE\":\"%PREFIX% %SENDER_NAME% &cdidn't invite you!\",\"ACCEPT_SENDER\":\"%PREFIX% %RECEIVER_NAME% &aaccepted your invite to a game of &cThe floor is Lave&a!\"}": "ACCEPT",
    "{\"INVITE_SENDER\":\"%PREFIX% &aYou have invited %RECEIVER_NAME% &ato a game of %cThe floor is Lava&a!\",\"INVITE_FAIL_INLOBBY\":\"%PREFIX% %RECEIVER_NAME% &cis already in a lobby!\",\"INVITE_RECEIVER\":\"%PREFIX% &aYou have been invited by %SENDER_NAME% &ato a game of %cThe floor is Lava&a!\",\"INVITE_UNKNOWN_PLAYER\":\"%PREFIX% %RECEIVER_NAME% &cEither doesn't exist, or is offline!\",\"INVITE_USAGE\":\"%PREFIX% &cPlease enter the name(s) of the player(s) you would like to invite. Usage: &f\\/fil invite <playername(s)>\",\"INVITE_NONE\":\"%PREFIX% &cNo player(s) were invited!\"}": "INVITE"
remote swallow
vast ledge
#

Why does my Json create ""

#

\

#

When i print it out raw to console, it works fine

remote swallow
#

quote escaping

high pewter
#

That's what I was meaning when I said maybe structures and templates are different (in-game structures are the combination of several templates combines as a jigsaw), but the docs refer to a Structure as a "mutable template" so idk

vast ledge
remote swallow
#

gson?

vast ledge
#

yea

#

i have disableHtmlEscaping

remote swallow
#

that should do it

vast ledge
#

Its doing that tho

remote swallow
#

no idea then

chilly hearth
#

Btw

#

Just curious

#

What if someone account gets banned

#

Where he can appeall

remote swallow
crystal flax
#

hello i need help ```[23:08:34] [Application-Thread/WARN]: Exception encountered when loading plugin: BungeeSystem
java.lang.NoClassDefFoundError: org/json/simple/parser/ParseException
at de.schlumpfkopf.bungeesystem.BungeeSystem.initBungeeSystem(BungeeSystem.java:325) ~[?:?]
at de.schlumpfkopf.bungeesystem.BungeeSystem.onEnable(BungeeSystem.java:59) ~[?:?]
at net.md_5.bungee.api.plugin.PluginManager.enablePlugins(PluginManager.java:316) ~[waterfall.jar:git:Waterfall-Bootstrap:1.20-R0.1-SNAPSHOT:ec41547:536]
at net.md_5.bungee.BungeeCord.start(BungeeCord.java:299) ~[waterfall.jar:git:Waterfall-Bootstrap:1.20-R0.1-SNAPSHOT:ec41547:536]
at net.md_5.bungee.BungeeCordLauncher.main(BungeeCordLauncher.java:67) ~[waterfall.jar:git:Waterfall-Bootstrap:1.20-R0.1-SNAPSHOT:ec41547:536]
at net.md_5.bungee.Bootstrap.main(Bootstrap.java:15) ~[waterfall.jar:git:Waterfall-Bootstrap:1.20-R0.1-SNAPSHOT:ec41547:536]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
at de.dytanic.cloudnet.wrapper.Wrapper.lambda$startApplication$5(Wrapper.java:487) ~[wrapper.jar:3.4.5-RELEASE-0f8f0d7]
at java.lang.Thread.run(Thread.java:833) [?:?]
Caused by: java.lang.ClassNotFoundException: org.json.simple.parser.ParseException
at net.md_5.bungee.api.plugin.PluginClassloader.loadClass0(PluginClassloader.java:103) ~[waterfall.jar:git:Waterfall-Bootstrap:1.20-R0.1-SNAPSHOT:ec41547:536]
at net.md_5.bungee.api.plugin.PluginClassloader.loadClass(PluginClassloader.java:59) ~[waterfall.jar:git:Waterfall-Bootstrap:1.20-R0.1-SNAPSHOT:ec41547:536]
at java.lang.ClassLoader.loadClass(ClassLoader.java:520) ~[?:?]
... 12 more

chrome beacon
crystal flax
#

What can I do now?

nimble oxide
#

Im sorry, Im using 1.8, buts its not for me.

The scoreboard doesnt show up, no errors or anything, even put a sout, to check if the event runs, and it does.

package com.marqus.junglensb.Listeners;

import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.scoreboard.DisplaySlot;
import org.bukkit.scoreboard.Objective;
import org.bukkit.scoreboard.Score;
import org.bukkit.scoreboard.Scoreboard;

public class BareScoreboard implements Listener {

    @EventHandler
    public void onJoin(PlayerJoinEvent e) {


        Player player = e.getPlayer();


        /*
        ###################################################

                        FANGE SCOREBOARD

        ###################################################
         */

        Scoreboard fangeboard = Bukkit.getScoreboardManager().getNewScoreboard();

        Objective fboard = fangeboard.registerNewObjective("fangescoreboard", "dummy");
        fboard.setDisplaySlot(DisplaySlot.SIDEBAR);
        fboard.setDisplayName(ChatColor.translateAlternateColorCodes('&', "&2&lJunglen.net"));

        Score website = fboard.getScore("teeeeeeeest");
        website.setScore(1);






        player.setScoreboard(fangeboard);

    }

}
wary harness
#
[23:19:41] [Server thread/WARN]:        at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)
[23:19:41] [Server thread/WARN]:        at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
[23:19:41] [Server thread/WARN]:        at java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:199)
[23:19:41] [Server thread/WARN]:        at java.base/java.lang.reflect.Method.setAccessible(Method.java:193)
[23:19:41] [Server thread/WARN]:        at me.mraxetv.beastcore.utils.LibsManager.<init>(LibsManager.java:47)```
#

anyone can help with this

eternal oxide
#

that lib doesn;t support the java version by the looks

wary harness
#

for external jars

#

but because of java 16 reflections

#

got changed

#

so I am looking for work around

eternal oxide
#

avoid reflection if you can as it's so locked up in java above 11

wary harness
opaque scarab
#

What seems like a good way to make a player sleep in bed for a longer duration?

hard socket
wet mesa
#

im just starting learning plugin development and i wanna know, if i just put this: ```import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.*;
import org.bukkit.event.Listener;

public class Test extends JavaPlugin implements Listener {
@EventHandler
public void onEntityDamageByEntity(EntityDamageByEntityEvent event) {
Damager p = event.getDamager();
p.setHealth(0);
}

public void onPlayerBedEnter(PlayerBedEnterEvent event) {
    e.setCancelled(true);
}

}``` into a jar file and put it on my server... will it work?

hazy parrot
#

it won't

#

onPlayerBedEnter have no @EventHandler annotation and you also haven't registered your event listener

gilded orchid
#

I got scammed by a famous author on spigot. I trusted him because he had a big resource. Am I able to report him somewhere to get him banned?

wet mesa
#

oh ok, but forget the code, if i just put a code like that on my server will it work or do i need a whole settup for it to work?

nimble oxide
#

Im sorry, Im using 1.8, buts its not for me.

The scoreboard doesnt show up, no errors or anything, even put a sout, to check if the event runs, and it does.

package com.marqus.junglensb.Listeners;

import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.scoreboard.DisplaySlot;
import org.bukkit.scoreboard.Objective;
import org.bukkit.scoreboard.Score;
import org.bukkit.scoreboard.Scoreboard;

public class BareScoreboard implements Listener {

    @EventHandler
    public void onJoin(PlayerJoinEvent e) {


        Player player = e.getPlayer();


        /*
        ###################################################

                        FANGE SCOREBOARD

        ###################################################
         */

        Scoreboard fangeboard = Bukkit.getScoreboardManager().getNewScoreboard();

        Objective fboard = fangeboard.registerNewObjective("fangescoreboard", "dummy");
        fboard.setDisplaySlot(DisplaySlot.SIDEBAR);
        fboard.setDisplayName(ChatColor.translateAlternateColorCodes('&', "&2&lJunglen.net"));

        Score website = fboard.getScore("teeeeeeeest");
        website.setScore(1);






        player.setScoreboard(fangeboard);

    }

}
hazy parrot
wet mesa
#

like, when you use an ide, it creates a whole workshop, but rn im not using one, im just using a single file with that code

#

and i know this will sound stupid, but how do i compile it lol

remote swallow
#

With maven or gradle, included with most ides

eternal oxide
#

you can compile with the java command line

#

but use an IDE

wet mesa
#

alright thx, im using VSC rn because i was coding in skript bruh

gilded orchid
#

I got scammed by a famous author on spigot. I trusted him because he had a big resource. Am I able to report him somewhere to get him banned?

young knoll
#

?support

undone axleBOT
young knoll
#

Granted you obviously need proof

#

And even then idk if spigot will act on stuff that happens outside the platform

umbral ridge
#

hey

#

what's the difference between BlockPlaceEvent#getBlockPlaced and getBlock ?

young knoll
#

“Clarity method for getting the placed block. Not really needed except for reasons of clarity.”

ivory sleet
#

clarity method

umbral ridge
#

So no difference

young knoll
#

Correct

umbral ridge
#

Thanks xD

nimble oxide
#

Im sorry, Im using 1.8, buts its not for me.

The scoreboard doesnt show up, no errors or anything, even put a sout, to check if the event runs, and it does.

package com.marqus.junglensb.Listeners;

import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.scoreboard.DisplaySlot;
import org.bukkit.scoreboard.Objective;
import org.bukkit.scoreboard.Score;
import org.bukkit.scoreboard.Scoreboard;

public class BareScoreboard implements Listener {

    @EventHandler
    public void onJoin(PlayerJoinEvent e) {


        Player player = e.getPlayer();


        /*
        ###################################################

                        FANGE SCOREBOARD

        ###################################################
         */

        Scoreboard fangeboard = Bukkit.getScoreboardManager().getNewScoreboard();

        Objective fboard = fangeboard.registerNewObjective("fangescoreboard", "dummy");
        fboard.setDisplaySlot(DisplaySlot.SIDEBAR);
        fboard.setDisplayName(ChatColor.translateAlternateColorCodes('&', "&2&lJunglen.net"));

        Score website = fboard.getScore("teeeeeeeest");
        website.setScore(1);






        player.setScoreboard(fangeboard);

    }

}
rare sedge
#

How involved would it be to add a generateStructures method in the process? What I'm doing during generateCaves is causing issues with some of the vanilla generation. When I attempt to modify the data using the onChunkPopulate method, it causes enormous lag that I just can't accept.

#

I just need a call after chunk generation is finished, but before it is passed off from the chunk generator

young knoll
#

Isn’t that what block populators are for

rare sedge
#

I'm not super familiar with how everything works tbh

#

If there's a way I'm just not seeing, I'd use that

young knoll
#

Generally structure generation is done by populators

rare sedge
#

This actually looks like exactly what I'm looking for

#

Thank you

buoyant viper
rare sedge
#

My structure is 1,024 blocks

young knoll
#

Is it jigsaw based?

rare sedge
#

Jigsaw?

young knoll
#

Jigsaw blocks

rare sedge
#
public class HeightLimitCapper extends BlockPopulator {
    @Override
    public void populate(World world, Random random, Chunk source) {
        int top = world.getMaxHeight() - 1;
        for (int x = 0; x < 16; x++) {
            for (int z = 0; z < 16; z++) {
                for (int y = top; y > top - 4; y--) {
                    source.getBlock(x, y, z).setType(Material.BARRIER);
                }
            }
        }
    }
}
#

Self explanatory

young knoll
#

Looks fine I guess

#

But why not do that in one of the early generation stages

rare sedge
#

It's faster, but then it screws up the decoration phase

#

The world is basically blank

young knoll
#

I see

rare sedge
#

Thus my question about a phase after structures

young knoll
#

Doing that in the populate event shouldn’t be causing lag

#

Unless it’s for some reason forcing lighting to recalculate

rare sedge
#

I get a lot of these:

[16:51:49] [Server thread/ERROR]: Too many chained neighbor updates. Skipping the rest. First skipped position: -93, 319, 176
#

Well, then the whole server crashed

#

Doesn't like the populator method

neon nymph
#

Hello! Could anyone tell me why this happens?

        Sign signData = (Sign) block.getState();
        signData.getPersistentDataContainer().set(gsKey, PersistentDataType.BOOLEAN, true);

        System.out.println(((Sign) block.getState()).getPersistentDataContainer().has(gsKey, PersistentDataType.BOOLEAN) + " 1");

        System.out.println(signData.getPersistentDataContainer().has(gsKey, PersistentDataType.BOOLEAN) + " 2");

The first print returns false, but the second one returns true

rare sedge
# neon nymph Hello! Could anyone tell me why this happens? ```java Sign signData = (...

This discrepancy is happening because of how and when the Bukkit/Spigot Minecraft server handles data changes to a Block.

When you call block.getState(), you get a snapshot of the block's data at that moment. If you modify that data, such as with signData.getPersistentDataContainer().set(gsKey, PersistentDataType.BOOLEAN, true), it doesn't immediately reflect in the actual block in the world; you need to explicitly update the block state for the changes to take effect.

However, the signData object you have is a local instance, and you've directly modified it. Therefore, when you check the PersistentDataContainer of signData, it does reflect the changes because you're checking the local instance that you've modified.

But in the first print statement, you're effectively getting a new snapshot of the block with block.getState() before you've updated the actual block, so it doesn't reflect the changes.

To get both print statements to return true, you would need to call signData.update() after setting the persistent data:

Sign signData = (Sign) block.getState();
signData.getPersistentDataContainer().set(gsKey, PersistentDataType.BOOLEAN, true);
signData.update(); // Update the actual block in the world

System.out.println(((Sign) block.getState()).getPersistentDataContainer().has(gsKey, PersistentDataType.BOOLEAN) + " 1");

System.out.println(signData.getPersistentDataContainer().has(gsKey, PersistentDataType.BOOLEAN) + " 2");

With this change, both print statements should return true.

umbral ridge
#

hey

neon nymph
#

Ohh I see, I thought the update() method only applies changes visually, like the sign text

rare sedge
#

boolean update()
Attempts to update the block represented by this state, setting it to the new values as defined by this state.
This has the same effect as calling update(false). That is to say, this will not modify the state of a block if it is no longer the same type as it was when this state was taken. It will return false in this eventuality.

Returns:
true if the update was successful, otherwise false

young knoll
umbral ridge
#

so I've cancelled the PlayerMoveEvent and player without any kind of passanger, can't get into the region. But with a horse or a boat they somehow glitch through? without being on the boat?? What is this? Is there a separate event for this?

rare sedge
umbral ridge
rare sedge
#

remote control boat plugin when?

umbral ridge
#

lol

#

fuck xD

young knoll
#

Isn’t there a vehicle move event

umbral ridge
#

Is there

#

?jd-s

undone axleBOT
umbral ridge
#

bruh

#

how about a horse? does it count as a vehicle?

rare sedge
#

we're getting into philosophical territory

young knoll
#

Maybe

#

If not, try dismounting them and canceling the move event

umbral ridge
#

I'd laugh my ass off if there was something like LivingVehicle

#

xd

#

I'll try

rare sedge
#

Well, it takes 52 seconds instead of 30 to generate the world, but the server didn't crash

#

Improvements

#

Well, I'm just going to accept this for what it is. I'll just pre-generate chunks.

umbral ridge
#

Figured it out

bitter rune
#

How would one read a custom config file that's in a custom place based on UUID?

bitter rune
inner mulch
#

can i use an arraylist in an inventoryclickevent on event.getrawslot?

umbral ridge
mild sage
#

how do you set the repair cost when creating an item stack?

inner mulch
inner mulch
#

can i use an arraylist in an inventoryclickevent on event.getrawslot?

mild sage
# inner mulch wdym? xp in anvil?

yeah im trying to hide the "ENchantment Cost: 1" when renaming an item in an anvil. setting the repair cost of the item to -1 will remove it but i cant figure out how to do it.

worldly ingot
#

Although I'm unsure if it actually updates in the client

#

I think the client calculates the same value as the server and shows what it assumes to be true

inner mulch
#

@mild sage may it be that your itemstack displayname doesnt appear as well=?

#

nameTag.setItemMeta(nameTagMeta);

#

im not quite sure how to help otherweise, there isnt much more to be seen, but your itemmeta isnt set up properly if i see it correctly

naive loom
#

Is it possible to make a item pullable like a bow using Spigot?

inner mulch
inner mulch
naive loom
inner mulch
naive loom
inner mulch
#

probably not then

naive loom
inner mulch
#

oh :(

#

sounds cool tho

#

custom items

nova notch
#

how do i stop these guys from spawning with banners?

umbral ridge
#

on EntitySpawnEvent you can check for mob equipment

#

or was it CreatureSpawnEvent

wet breach
#

Lol

umbral ridge
#

I made a plugin awhile back, when randomly zombies would spawn with leather chestplates and stuff, it's kinda cool actually xD

#

For survival, it's perfect

#

Btw which event fires, when a block is blown up by tnt/fireball/creeper?

#

BlockBreakEvent I'm guessing it isn't because there's only a method getPlayer?

nova notch
rare rover
rare rover
#

then just check the instance of the entity

#

np 🙂

umbral ridge
#

yeah schnitzel

clear panther
#

Hello im trying to make an npc but i cant slove the errors on pom

rare rover
remote swallow
#

Are you a cria

clear panther
#

it says Plugin net.md-5 not found smh

clear panther
wet breach
rare rover
clear panther
#

i mean i cant

remote swallow
#

Alpaca are you a cria

quaint mantle
#

how to convert handler "java" file to "class" file?

remote swallow
#

With a compiler

clear panther
#

im not a cria

#

smh

wet breach
#

And then for fireballs i dont remember if they cause blocks to get damaged but there is a blockignite event with cause of fireball

remote swallow
#

U look like one, very smol

quaint mantle
#

who can help? I just already deleted the program... I can throw the file in pm.

rare rover
mortal hare
#

guys is the time complexity of array deque is the same for push vs pushLast operation?

#

i believe that it should move the elements by one by using push()

#

but im not sure if java makes some trickery internally

rare rover
#

they're probably the same

#

i have an idea on what both do

rough ibex
#

by definition of what a deque is, they should be the same

civic apex
#

im trying to create a ClientboundPlayerInfoUpdatePacket through the FriendlyByteBuf constructor, but I don't know how exactly im supposed to do it.
writing the enumset, then using writecollection and inside writing uuid and looping through all actions to use their writer to write seemed to have worked, but that generated a packet that always had as many entries as it had actions. When inspecting packets generated by the server itself and not my plugin i noticed they had 6 actions (all the distinct possible actions) but only one entry, and the packet im trying to send really only requires one entry (it essentially had a List of repeat entries), but when trying to not be redundant and either just writecollection without a for loop or using a for loop and not writecollection gets the client disconnected by an internal exception (ArrayIndexOutOfBoundsException, StringIndexOutOfBoundsException, DecoderException, depending on how I tried writing it) and I essentially get no debug info neither in console or the mc client log about the exception.

nova notch
#

how do i make an itemstack with a skull like this that uses the textures property thing?

rough ibex
#

do you mean what to write for the functions, or what to write for the parameters?

#

how to make the textures property or how to use it

nova notch
#

idk im just trying to remake what this tutorial from 5 years ago has cus it doesnt work anymore

#

i need to figure out how to set the texture of a player profile

#

whenever i try this it wants me to implement all the methods but the methods it implements gives me 3 errors

civic apex
rough ibex
#

use google to find out how people do it today

civic apex
#

now idk what wizardry writeCollection does to make it different from iterating over actions and just using writers, or the other like 4 "equivalent looking" solutions i tried

nova notch
buoyant viper
#

that

#

is Mad

civic apex
rough ibex
#

yes

nova notch
#

my bad

civic apex
# rough ibex yes

idk how it all started but i still havent figured out how to do the cem or whatever thing

rough ibex
civic apex
#

yeah i know but, i think it was unsupported in 1.8.9

rough ibex
#

it's not unsupported

civic apex
#

no, the thing i was trying to do, not cem itself

rough ibex
#

well then I can't tell you what it was

civic apex
#

kinda getting off topic but i was trying to get a dragon head model to appear while someone wore it in 1.8.9

rough ibex
#

oh that you can't do

civic apex
rough ibex
#

items don't store NBT of that they're worn

edgy crystal
#

if i drop an item in version 1.16.5, it automatically hits & calls the PlayerInteractEvent -> Action.LEFT_CLICK_AIR (Action.LEFT_CLICK_BLOCK is not getting triggered). If i cancel the itemdrop event, it wont cancel the call to PlayerInteractEvent, how i can disable the hitting

#

sorry for this weird question

#

& also its hitting while clicking custom inventory's

rare rover
#

🫡

warm light
worldly ingot
#
OfflinePlayer player = Bukkit.getOfflinePlayer(UUID.fromString("blah"));
player.getPlayerProfile().update().thenApply(PlayerProfile::getTextures).thenAccept(textures -> {
    URL texturesURL = textures.getSkin();
    // Do with this what you will
});```
warm light
#

thanks a lot :)

#

it return full skin. but is it possible to get only head texture?

worldly ingot
#

Not really. That'd be up to you to parse out of the image

#

If you're doing this for skulls you can set SkullMeta#setOwningProfile()

remote swallow
#

choco go to bed

prisma sedge
#
        List<Location> locations = new ArrayList<>();
        List<Location> finallocations = new ArrayList<>();
        int V1 = 180 * (corners-2);
        int V2 = V1/corners;
        for (int i = 0; i < V1; i += V2) {
            double x = radius * Math.cos(Math.toRadians(V2));
            double y = center.getY();
            double z = radius * Math.sin(Math.toRadians(V2));

            // Rotate the circle around the center based on yaw and pitch
            Vector rotated = new Vector(x, y, z).rotateAroundY(-yaw).rotateAroundX(pitch);
            Location location = center.clone().add(rotated);
            locations.add(location);
        }
        for (int i = 0; i < corners; i++) {
            if (!(locations.get(i + 1) == null)) {
                finallocations.addAll(drawLine(locations.get(i), locations.get(i + 1), 50));
            }
        }
        return finallocations;```

```Caused by: java.lang.IndexOutOfBoundsException: Index 4 out of bounds for length 4
    at jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64) ~[?:?]
    at jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70) ~[?:?]
    at jdk.internal.util.Preconditions.checkIndex(Preconditions.java:266) ~[?:?]
    at java.util.Objects.checkIndex(Objects.java:361) ~[?:?]
    at java.util.ArrayList.get(ArrayList.java:427) ~[?:?]
    at austxnsheep.bosscore.Particles.ShapeCreator.drawPolygon(ShapeCreator.java:36) ~[austxnsheep-1.7.jar:?]
    at austxnsheep.bosscore.CustomMoves.PiglinMoves.test(PiglinMoves.java:122) ~[austxnsheep-1.7.jar:?]
    at austxnsheep.bosscore.Commands.Boss.onCommand(Boss.java:52) ~[austxnsheep-1.7.jar:?]
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[paper-api-1.20.1-R0.1-SNAPSHOT.jar:?]```

I'm not too sure how to fix this, anybody up to help?
#

OutOfBounds exception.

#

Oh let me add in the drawLine function

#

nvm I'll just explain it.

#

it returns a list of locations. I know it works, and I have tested it out.

warm light
#

what is the key in SkullMeta#setNoteBlockSound?

#

I mean how to set the sound?

chilly hearth
#

?jd-s

undone axleBOT
chilly hearth
#

Just look up there

#

It will mean tell you all parameters

chilly hearth
#

umm can someone help me i just created a new project and its like red ;-;

grave lagoon
hazy parrot
#

Red means file is not committed yet

grave lagoon
#

mb i use vscode most of the time

#

only dipped in intellij like 2 times

chilly hearth
#
  @Override
    public boolean onCommand(CommandSender commandSender, Command command, String s, String[] args) {

        if(commandSender instanceof Player){
          Player player =(Player) commandSender;

            ItemStack reward = player.getItemInHand();

            if(reward == null){

                player.sendMessage(ChatColor.RED + "You dont have anything in your Slot");

            }else{

                

            }```how can i so when they run the command the crurenc item in their slot set as the reward
grave lagoon
#

no idea what ur saying

#

can u explain further

#

im confused

chilly hearth
#

so

#

iam basically making an killreward

#

plugin

#

when ever a player types the command it makes the current item in his slot the reward and when someone kils an palyer it drops that reward

#

iam stuck on how to set the reward and use it on otther class playerdeathevent

grave lagoon
#

okay so whats the issue

#

are u having trouble with what

grave lagoon
chilly hearth
#

iam was thinking the same

#

reward: Apple

grave lagoon
#

okay

#

okay

#

so

#

in ur main class

#

add this:

#
public static <name of plugin> getPlugin() { return plugin; }```
#

public static <name of plugin> plugin;

#

add that above it

#

in the onenable and on disable add this: this.saveConfig();

#

back in ur commands

grave lagoon
#
  @Override
    public boolean onCommand(CommandSender commandSender, Command command, String s, String[] args) {

        if(commandSender instanceof Player){
          Player player = (Player) commandSender;

            ItemStack reward = player.getItemInHand();

            if (reward == null) {
                player.sendMessage(ChatColor.RED + "You dont have anything in your Slot");
            } else {
                FileConfiguration config = <name of plugin>.getPlugin().getConfig();
      
            }```
#

now

smoky anchor
grave lagoon
#

save the reward in the config

prisma sedge
#

finallocations.addAll(drawLine(locations.get(i), locations.get(i + 1), 50));

#

this one

grave lagoon
#

and from there use the death event to get the killer and target and figure it out from there it should be insanely simple

chilly hearth
#
   }else{
                FileConfiguration config = KillReward.getPlugin().getConfig();



            }


        }

        return true;
    }
}``` ?
grave lagoon
#

wdym

chilly hearth
#

is that correct ?

grave lagoon
#

just use the config to save the details of the reward

#

and make an event

#

and do the rest

smoky anchor
chilly hearth
#

and in main class

grave lagoon
#

should be super simple

chilly hearth
#
  public static KillReward plugin; public static KillReward getPlugin() {
        return plugin; }````
prisma sedge
#

It Should atleast, stop it once it reaches the end of the list

grave lagoon
#

get the details u need from the reward item and save it to config with config.set

grave lagoon
#

use the playeruuid in the name

grave lagoon
smoky anchor
chilly hearth
#

reward.setType(config);?

smoky anchor
#

also, testing it like this seems wrong
The element should never be null, if it does not exist then it throws exception as I said

prisma sedge
upper hazel
#

hey, is it advisable to create a click event separately for each inventory GUI slot?

prisma sedge
grave lagoon
#

i need to leave now

upper hazel
#

and is it still advisable to create separate events for each inventory

#

?

smoky anchor
upper hazel
#

this is why i want know

#

this good or bad?

#

in terms of optimization

smoky anchor
#

I would advise against making multiple event listeners when you don't have to...

upper hazel
smoky anchor
#

I don't think I understand

upper hazel
#

does that count as 1 source?

smoky anchor
#

only the GUIListener handles the events
It then distributes them as it needs to.
It is less work then to register them per gui and then having to unregister it.

umbral ridge
#

ok I dont understand. BlockExplodeEvent should handle all explosions to prevent block damage right?

#

I can just cancel the damage to all blocks, the explosion has done, with cancelling the event

flint coyote
#

No it is called when a block (e.g. bed or respawn anchor) explodes

umbral ridge
#

What event can I use for my problem

flint coyote
#

There's also EntityExplodeEvent for creepers and tnt

umbral ridge
#

What if I want to enable explosions and just cancel the damage to blocks

flint coyote
#

You take both events and clear the affected blocks

umbral ridge
#

so in both events?

#

and go through the affected blocks and do what?

flint coyote
#

just do event.blockList().clear()

umbral ridge
#

Thanks that worked perfectly xD

#

can I modify the blockList?

#

specific blocks..

flint coyote
#

of course. Clearing also modifies it

echo basalt
#

It's a mutable collection

umbral ridge
#

should have worked right?

flint coyote
#

if your if statements all result in true, yes

#

and obviously you have to do it on both events

warm mica
#

Use iterators instead

umbral ridge
warm mica
#

Nice👍

chilly hearth
#

how

#

to

#

how to use getconfig on differcent classes

hazy parrot
#

You already been told to learn java at least 25 times, and you still refuse to try and find something yourself

buoyant viper
#

pass ur Config instance (or what i do, ur plugin instance) with dependency injection

buoyant viper
#

new username too :p

nimble oxide
#

Im running Paper 1.8.8, its for my client.
No errors, the event runs cause I used sout, but the scoreboard doesnt show up

package com.marqus.junglensb.Listeners;

import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.scoreboard.DisplaySlot;
import org.bukkit.scoreboard.Objective;
import org.bukkit.scoreboard.Score;
import org.bukkit.scoreboard.Scoreboard;

public class BareScoreboard implements Listener {

    @EventHandler
    public void onJoin(PlayerJoinEvent e) {


        Player player = e.getPlayer();


        /*
        ###################################################

                        FANGE SCOREBOARD

        ###################################################
         */

        Scoreboard fangeboard = Bukkit.getScoreboardManager().getNewScoreboard();

        Objective fboard = fangeboard.registerNewObjective("fangescoreboard", "dummy");
        fboard.setDisplaySlot(DisplaySlot.SIDEBAR);
        fboard.setDisplayName(ChatColor.translateAlternateColorCodes('&', "&2&lJunglen.net"));

        Score website = fboard.getScore("teeeeeeeest");
        website.setScore(1);






        player.setScoreboard(fangeboard);

    }

}
buoyant viper
#

n set a banner lol

umbral ridge
frail gazelle
#

help using async runnables and CompletableFuture

nimble oxide
umbral ridge
nimble oxide
#

Yes

nimble oxide
umbral ridge
#

I'm not too sure about scoreboards, sorry

nimble oxide
#

its okay

chilly hearth
hazy parrot
buoyant viper
#

example:

// config.yml
motd: "Hello, %PLAYER_NAME%!"

// YourPlugin.java
public class YourPlugin extends JavaPlugin {
  @Override
  public void onEnable() {
    saveDefaultConfig();

    getServer().getPluginManager().registerEvents(new PlayerJoinListener(this), this);
  }
}

// PlayerJoinListener.java
public class PlayerJoinListener implements Listener {
  private final YourPlugin plugin;

  public PlayerJoinListener(YourPlugin plugin) {
    this.plugin = plugin;
  }

  @EventHandler
  private void onPlayerJoin(PlayerJoinEvent event) {
    Player player = event.getPlayer();
    player.sendMessage(plugin.getConfig().getString("motd").replace("%PLAYER_NAME%", player.getName()));
  }
}``` @chilly hearth
#

and judging by @hazy parrot

#

?learnjava!

undone axleBOT
buoyant viper
#

disclaimer: ive never worked with scoreboards yet, so give me a bit

charred blaze
#

if i do save config of bansconfig after that code below, will it save list with removed ban entry?

buoyant viper
#

huh, weird @nimble oxide

#

are u sure ur registering ur listener?

charred blaze
#

k

#

thanks

chilly hearth
hazy parrot
#

That is good to hear 👍

chilly hearth
#

;-;

cinder abyss
#

Hello, how can I get the grass block data ?

#

(by creating it)

chilly hearth
#

by itemstack ?

buoyant viper
cinder abyss
#

thanks 😄

echo basalt
#

Material.GRASS_BLOCK.createBlockData

buoyant viper
#

or that :P

chilly hearth
cinder abyss
#

👍

nimble oxide
buoyant viper
#

nice, i ported my scoreboard test to 1.20.1 and now I cant see the scoreboard, dafuq?

#

oh, its in my tablist, what the fuck

smoky anchor
#

what the heck did you do to get it to display 1 / 20

buoyant viper
smoky anchor
#

oh you did do a prefix ok

buoyant viper
#

oh i see what im doing wrong i think

smoky anchor
#

oh you set the prefix of the team and you have the player in that team
ofc the player would have the prefix

buoyant viper
#

im also not getting the score properly it looks like

#

lol

#

i only setPrefix, not getScore()

#

also woops i guess i see why they use ChatColors lol

#

alternatively i can use it to my advantage, woo

#

is formatting not retained between prefix/text/suffix

smoky anchor
#

I don't think it is

buoyant viper
#

i think they might be components internally so it makes sense if they dont actually

#

solved by just setting color and using some formatting in the prefix n suffix :P

smoky anchor
#

Well everything should be components on 1.20, besides splashes.txt and something else I think
Legacy formating will be removed in the future if I remember correctly

buoyant viper
#

everythings been components for a while :P

#

internally at least, not so much on spigot side

smoky anchor
#

yeah~
Still waiting for that PR Choco <3

buoyant viper
#

except splashes yeah bc theyre just a string drawn on the main menu

#

true

smoky anchor
#

Maybe the end poem is still not components as well
Will be changed in the future tho for sure

wet breach
#

Maybe. Depends if there is a need to do that

smoky anchor
#

Well if they want to scrap the whole legacy § formatting, then there would be I assume

silent steeple
#

who got plugin ideas

wet breach
#

Everyone

silent steeple
#

lmk!!!

wet breach
#

Better question is. Who has good plugin ideas

silent steeple
#

do u?

wet breach
#

Probably

silent steeple
#

let me know some

#

thx

wet breach
#

Could always make some use of the demo components

#

Pretty nifty you can use those as a form of title screen for your server

smoky anchor
silent steeple
#

u cant even mine diamonds

smoky anchor
#

exactly 😈

silent steeple
wet breach
#

It has always existed in mc part of the demo game but you can use its stuff in survival

silent steeple
#

give me an example

#

of a demo component

wet breach
#

Well there is no api for it

silent steeple
#

...

wet breach
#

But its all the little window stuff that pops up when playing demo

buoyant viper
#

advice on how to make a.... solid line?

wet breach
#

Including the demo over screen

silent steeple
#

minecraft demo?

smoky anchor
silent steeple
buoyant viper
#

the thing is theyd have no width wouldnt they

silent steeple
#

who knows

wet breach
#

Its off center

silent steeple
#

yeah lol

buoyant viper
#

its the numbers on the sidebar

#

:v

smoky anchor
#

yeah... centering text in MC is "impossible" sadly
Unless you force the players to use a resourcepack

wet breach
smoky anchor
#

yeah... you need a resourcepack for that lol

wet breach
#

Can fix the spacing by making some fonts two spaced or one

smoky anchor
#

the thing is: even if you center the text perfectly, some players might have a resourcepack that completely fucks the default font

#

So I say: don't worry about centering that much

wet breach
#

No one cares if they use unsupported textures

buoyant viper
#

i can live with this ig, wish i could get rid of the #'s

silent steeple
buoyant viper
wet breach
#

Welp time for me to clock out from work and head home uwu

buoyant viper
umbral ridge
#

123456 but 1 online

silent steeple
#

im making a plugin that should work from 1.8 to 1.20 how do i check the mc version

#

so i can disable some stuff

silent steeple
umbral ridge
silent steeple
#

i think u can see saturation in then ews versions anyway

buoyant viper
buoyant viper
silent steeple
#

maybe but the irl time so people can know when its time to touch grass

silent steeple
#

what do the server strings look like

#

im guessing 1_16_5 ?

#

for example

umbral ridge
#

I don't know for sure.. they are all in the same format

#

Play around with it

#

Or maybe winnpixie knows? xD

buoyant viper
#

its just for my SMP so it doesnt particularly matter what i add 2 it

buoyant viper
umbral ridge
buoyant viper
#

it probably looks something like this?

#

will do sysout in a sec

umbral ridge
smoky anchor
#

should be the same as /version

silent steeple
#

making it a string is kind of a stupid implementation

smoky anchor
#

based on the doc

Gets the version string of this server implementation.

umbral ridge
#

Unless if you write your own wrapper

#

and handle it

silent steeple
#

no you could have a ServerVersion object

hazy parrot
#

and what attributes would it have

umbral ridge
#

Then why did you ask a question here if you already know the answer?

#

XD

buoyant viper
#

getVersion and getBukkitVersion

dire marsh
silent steeple
buoyant viper
silent steeple
#

cuz this way you have to check more then once

dire marsh
#

ah ok

buoyant viper
#

if u want server version u could substring to indexOf("MC: ") + 1 probably

hazy parrot
buoyant viper
#

and remove the trailing )

umbral ridge
#

It's best if you write your own wrapper for this. you can use it in every plugin

silent steeple
#

yeah'

buoyant viper
#

but if u believe spigot needs one, submit a feature request or a PR

umbral ridge
#

does java support operator overloading?

buoyant viper
#

dont think so

umbral ridge
#

that sucks.. :(

buoyant viper
umbral ridge
silent steeple
#

string concatenation?

hazy parrot
#

you can't overload operators yourself

buoyant viper
#

^, i was assuming spexx was asking if u could add ur own :P

umbral ridge
#

Like in c++ 🙂

umbral ridge
#

prrrrrrrrr

smoky anchor
hazy parrot
umbral ridge
smoky anchor
umbral ridge
#

come on

buoyant viper
smoky anchor
umbral ridge
#

schnitzel shouldn't be questioned

buoyant viper
#

#general message it all starts here @smoky anchor

silent steeple
#

my ide just crashed for the first time in ages

warm mica
smoky anchor
#

Did you open Material.class ?

dull goblet
#

How to find out what blockface a player is looking at?

silent steeple
#

dude it keeps crashing wtf

hazy parrot
#

read again what i said, u seem to be misunderstanding

nimble oxide
#

Whats the problem here?

silent steeple
#

probably old api

nimble oxide
chrome beacon
#

so that code can just be removed

chilly hearth
#

e

dull goblet
#

Guys, i have a question. What would be the best way to get all the green wool, while looking at the blue wool? I put a max size of 9

#

The wool is just a representation of the funcionality, it isnt what i really need

#

Just need the blocks

echo basalt
#

it's uhh

#

3x3x3 or you want like a weird intersecting plane thing?

dull goblet
#

well, 3x3 if possible, but imagine if the wall is 2x3 it should only get 2x3, but if the wall is 1x9, it should select all 9

echo basalt
#

oh that's weird

dull goblet
#

Do you get what i mean?

echo basalt
#

You want like a flood-fill with a distance limit

dull goblet
#

i'm trying to make a build tool

vast ledge
#

You could chek around the block

dull goblet
#

I already have like the initial block

vast ledge
#

if there is a valid blokc at -x

#

or at -y

#

if so

#

then you continue

#

until either youve reached max

#

or theres no more valid blocks

dull goblet
#

yeah, but i'm not sure how to do it for when i get past the blocks next to the center. I want to prevent something like this:

vast ledge
#

wdym prevent?

#

You want all the green blocks + blue to be pasted again right?

dull goblet
#

yeah, but i'm not sure how to do the selection, in this image all blocks are next to eachother, but not all are closest to center. this one should be like this:

#

The green and blue isn't real, its just a representation of what i want to select

#

And the blue is the point im looking

vast ledge
#

Then you can check around the center with a radius

#

and not follow the single block

#

but id only do that until a certain size

#

further then the 2 distance from center id just follow one

hallow jackal
#

How can I convert a org.bukkit.ChatColor object into a org.bukkit.Color one?

vast ledge
#

wat

#

why would you want to convert

hallow jackal
#

Need to use Firework.withColor(Color)

vast ledge
#

ok

#

then just use Color.urColor

#

All of the ChatColor Presets are also there

hallow jackal
#

wouldn't that just be hardcoding the values?

#

the chatcolor won't be always the same

young knoll
#

Where is the ChatColor coming from

vast ledge
#

What correlation does chatcolor have with color

vast ledge
hallow jackal
#

I'm doing some changes to an already existing plugin that uses ChatColor to define a team's representing color

vast ledge
#

ok

young knoll
#

I see

vast ledge
#

Idk use a switch statment

hallow jackal
young knoll
#

Or a map

hallow jackal
#

true

#

thanks for your time

nimble oxide
#

why isnt this working?? O.o

vast ledge
#

nope

#

you dont have to

#

@hallow jackal

#

take given color

#

.asBungee()

#

then .getColor()

#

will return the color tpye ur looking for

vast ledge
nimble oxide
vast ledge
#

You can

nimble oxide
#

with instance of main right?

vast ledge
#

but then oyu need MainClassName.getInstance().getConfig()

hallow jackal
#

wait

vast ledge
#

Yes

#

you can get

#

the blue

#

alpha

#

usw

#

and reconstruct the color

hallow jackal
#

alright, i see

#

tysm

vast ledge
#

Ah

#

you dont even have to reconstruct

#

you can just do