#development

1 messages Ā· Page 137 of 1

lyric gyro
#

not sure how else you would simulate being high on lsd lmao

warped kestrel
#

maybe dead penalties

lyric gyro
#

šŸ’€

warped kestrel
#

add percentage on dead penalties or slowly dying effect

#

Imagine making a smoking server

lyric gyro
#

smoke-yellow stained wool

warped kestrel
#

That's could be an idea

#

Add slow & nausea effect

#

ffs no tenor here

warped kestrel
#

Flexing rank jess

lyric gyro
#

Jess..ie

#

Jessie, we need to cook

#

jesse : Mr white... my gif is not embedding
walter : NO JESSE, you need to have TIER FOUR to post embeds
jesse : But MR WHITE HOW DO I GET SO MUCH EXP
walter: YOUR GITHUB JESSE, YOU NEED TO LINK YOUR GODDAMN GITHUB

#

lmao

#

I'm stealing those

#

Thanks for that emily you have fixed my whole problem witht that small bit of code šŸ™‚

lyric gyro
#

gus or did I

broken elbow
wintry grove
#

lol

lyric gyro
#

Hello so im a bit stumped im trying too update my table in a database and i cant figure why it doesnt actually update ``` public void update(Player player)
{
try (Connection connection = coreDatabase.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("UPDATE Spawn SET X=? AND Y=? AND Z=? AND YAW=? AND PITCH=? AND WorldName=? AND PlayerName=? AND PlayerUUID=? AND Server=? WHERE WorldName=? AND Server=?"))
{
preparedStatement.setDouble(1, player.getLocation().getX());
preparedStatement.setDouble(2, player.getLocation().getY());
preparedStatement.setDouble(3, player.getLocation().getZ());
preparedStatement.setFloat(4, player.getLocation().getYaw());
preparedStatement.setFloat(5, player.getLocation().getPitch());
preparedStatement.setString(6, Objects.requireNonNull(player.getLocation().getWorld()).getName());
preparedStatement.setString(7, player.getDisplayName());
preparedStatement.setString(8, player.getUniqueId().toString());
preparedStatement.setString(9, coreConfig.getConfig().getString("Internal.Name"));
preparedStatement.setString(10, Objects.requireNonNull(player.getLocation().getWorld()).getName());
preparedStatement.setString(11, coreConfig.getConfig().getString("Internal.Name"));
preparedStatement.executeUpdate();

    }
    catch (SQLException e)
    {
        cmf.header(MessageType.WARN);
        Bukkit.getLogger().log(Level.FINE, cm.Colour("&2Table -> Core"));
        Bukkit.getConsoleSender().sendMessage(cm.Colour("&4Failed to Set Spawn Point!!!"));
        e.printStackTrace();
        cmf.footer();
    }
}```
#

Thats the whole update section

dusty frost
#

is there only one row in that database?

#

you'd want to do UPDATE Spawn SET <blah> WHERE id=? to make sure you're editing the right row

lyric gyro
#

Yh there’s only 1 row atm

dense drift
#

I think that Server = ? for the SET statement is not going to do anything. Because you already have a filter for the value of that column and both use the same value ("internal.name")

sharp hemlock
#
   view.setProperty(InventoryView.Property.TICKS_FOR_CURRENT_FUEL, FurnaceGUI.this.totalBurnTime);
                        view.setProperty(InventoryView.Property.TICKS_FOR_CURRENT_SMELTING, 200);
                        view.setProperty(InventoryView.Property.BURN_TIME, FurnaceGUI.this.burnTime);
                        view.setProperty(InventoryView.Property.COOK_TIME, FurnaceGUI.this.cookProgress);

Why is this throwing an index out of bounds exception?

#
java.lang.IndexOutOfBoundsException: Index 1 out of bounds for length 0
        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:359) ~[?:?]
        at java.util.ArrayList.get(ArrayList.java:427) ~[?:?]
        at net.minecraft.world.inventory.AbstractContainerMenu.setData(AbstractContainerMenu.java:744) ~[?:?]
        at org.bukkit.craftbukkit.v1_18_R1.entity.CraftPlayer.setWindowProperty(CraftPlayer.java:1828) ~[paper-1.18.1.jar:git-Paper-121]
        at org.bukkit.inventory.InventoryView.setProperty(InventoryView.java:446) ~[paper-api-1.18.1-R0.1-SNAPSHOT.jar:?]
        at com.olziedev.virtualfurnace.furnace.FurnaceGUI$1.run(FurnaceGUI.java:86) ~[VirtualFurnace 1.0.0.jar:?]
        at org.bukkit.craftbukkit.v1_18_R1.scheduler.CraftTask.run(CraftTask.java:101) ~[paper-1.18.1.jar:git-Paper-121]
        at org.bukkit.craftbukkit.v1_18_R1.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:57) ~[paper-1.18.1.jar:git-Paper-121]
        at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22) ~[paper-1.18.1.jar:git-Paper-121]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
        at java.lang.Thread.run(Thread.java:833) ~[?:?
sharp hemlock
#
UPDATE Spawn SET X=?, Y=?, Z=?, YAW=?, PITCH=?, WorldName=?, PlayerName=?, PlayerUUID=? WHERE WorldName=? AND Server=?```


Also removed the update column for server
lyric gyro
#

ok

#

I’ll try I just thought you couldn’t in an update statement

lyric gyro
#

Hi there, I've got an entity damage by entitiy event.

#

However it keeps getting triggered even though 0 damage is taken:

#
private static HashMap<Player, Long> inCombatTimer = new HashMap<>();
    private static final int MILLISECONDS_PER_SECOND = 1000;



    public CombatLog(Main main) {
        this.main = main;
    }

    @EventHandler(ignoreCancelled=true)
    public static void onPlayerAttackEvent(EntityDamageByEntityEvent e) {
        if (!e.isCancelled()) {
                if (e.getDamager() instanceof Player && e.getEntity() instanceof Player) {
                    if (e.getDamage() > 0) {
                    Player p = (Player) e.getDamager();
                    Player target = (Player) e.getEntity();
                    if (inCombatTimer.get(p) != null) {
                        inCombatTimer.remove(p);
                        inCombatTimer.put(p, System.currentTimeMillis());
                        inCombatTimer.remove(target);
                        inCombatTimer.put(target, System.currentTimeMillis());
                    } else {
                        inCombatTimer.put(p, System.currentTimeMillis());
                        inCombatTimer.put(target, System.currentTimeMillis());
                        String combatMessage = Main.protoTypeMessage + ChatColor.GRAY + "Je bent nu in combat! Je mag "
                                + ChatColor.DARK_RED + ChatColor.BOLD + "NIET" + ChatColor.GRAY + " uitloggen. ";
                        p.sendMessage(combatMessage);

                        target.sendMessage(combatMessage);
                    }
                }
            }
        }
    }
#

Does anyone know what's wrong?

hushed timber
#

did anyones mc server just commit death yesterday?

terse belfry
limber anvil
#
name: Spell Casting
version: 1.0
author: MrSkullis
main: me.mrskullis.spellcasting.Main
description: 3 Sequence LRL spell casting test plugin```
#
package me.mrskullis.spellcasting;

import org.bukkit.plugin.java.JavaPlugin;

import me.mrskullis.spellcasting.listeners.click.WandListener;

public class Main extends JavaPlugin 
{
    @Override
    public void onEnable() {
        new WandListener(this);
    }
}
neat pierBOT
#
FAQ Answer:

Paste Services
When asking for help with a config/menu/code issue please use our paste bin:
(we prefer it over pastebin.com)
• HelpChat Paste - How To Use

limber anvil
#

I'm not getting any compiling errors

night ice
limber anvil
#

oh its just not loading

#

I'm using JavaSE-1.8 with spigot 1.12.2

night ice
limber anvil
#

1 sec

#

error could not load plugins spellcasting.jar in folder plugins

#

invalid description exception

#
20.05 15:39:06 [Server] ERROR Could not load 'plugins/SpellCasting.jar' in folder 'plugins'
20.05 15:39:06 [Server] INFO org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml
20.05 15:39:06 [Server] INFO at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:150) ~[patched_1.12.2.jar:git-Paper-1618]
20.05 15:39:06 [Server] INFO at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:136) ~[patched_1.12.2.jar:git-Paper-1618]
20.05 15:39:06 [Server] INFO at org.bukkit.craftbukkit.v1_12_R1.CraftServer.loadPlugins(CraftServer.java:318) ~[patched_1.12.2.jar:git-Paper-1618]
20.05 15:39:06 [Server] INFO at org.bukkit.craftbukkit.v1_12_R1.CraftServer.reload(CraftServer.java:806) ~[patched_1.12.2.jar:git-Paper-1618]
20.05 15:39:06 [Server] INFO at org.bukkit.Bukkit.reload(Bukkit.java:559) ~[patched_1.12.2.jar:git-Paper-1618]
20.05 15:39:06 [Server] INFO at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:55) ~[patched_1.12.2.jar:git-Paper-1618]
20.05 15:39:06 [Server] INFO at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:152) ~[patched_1.12.2.jar:git-Paper-1618]
20.05 15:39:06 [Server] INFO at org.bukkit.craftbukkit.v1_12_R1.CraftServer.dispatchCommand(CraftServer.java:685) ~[patched_1.12.2.jar:git-Paper-1618]
#
20.05 15:39:06 [Server] INFO at net.minecraft.server.v1_12_R1.PlayerConnection.a(PlayerConnection.java:1297) ~[patched_1.12.2.jar:git-Paper-1618]
20.05 15:39:06 [Server] INFO at net.minecraft.server.v1_12_R1.PacketPlayInChat.a(PacketPlayInChat.java:45) ~[patched_1.12.2.jar:git-Paper-1618]
20.05 15:39:06 [Server] INFO at net.minecraft.server.v1_12_R1.PacketPlayInChat.a(PacketPlayInChat.java:5) ~[patched_1.12.2.jar:git-Paper-1618]
20.05 15:39:06 [Server] INFO at net.minecraft.server.v1_12_R1.PlayerConnectionUtils.lambda$ensureMainThread$0(PlayerConnectionUtils.java:14) ~[patched_1.12.2.jar:git-Paper-1618]
20.05 15:39:06 [Server] INFO at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_312]
20.05 15:39:06 [Server] INFO at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_312]
20.05 15:39:06 [Server] INFO at net.minecraft.server.v1_12_R1.SystemUtils.a(SourceFile:46) ~[patched_1.12.2.jar:git-Paper-1618]
20.05 15:39:06 [Server] INFO at net.minecraft.server.v1_12_R1.MinecraftServer.D(MinecraftServer.java:850) ~[patched_1.12.2.jar:git-Paper-1618]
20.05 15:39:06 [Server] INFO at net.minecraft.server.v1_12_R1.DedicatedServer.D(DedicatedServer.java:423) ~[patched_1.12.2.jar:git-Paper-1618]
20.05 15:39:06 [Server] INFO at net.minecraft.server.v1_12_R1.MinecraftServer.C(MinecraftServer.java:774) ~[patched_1.12.2.jar:git-Paper-1618]
20.05 15:39:06 [Server] INFO at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:666) ~[patched_1.12.2.jar:git-Paper-1618]
20.05 15:39:06 [Server] INFO at java.lang.Thread.run(Thread.java:748) [?:1.8.0_312]
20.05 15:39:06 [Server] INFO Caused by: java.io.FileNotFoundException: Jar does not contain plugin.yml
#

ooooh

#

I think its bc my yml is in a package?

#

would that do it?

#

yup that was it *sigh*

proud pebble
#

ur plugin.yml has to be in resources

plush stirrup
#

Does anyone know how to lock a players inventory, but a specific slot, make sure they can't drop an item, move it with hotkeys, and make sure they can't change with their off hand

torpid raft
#

you can do that with the inventory related event listeners

#

detect and then cancel all the actions you don't want the player perforning

round sail
#

Anyone worked with PlayerItemDamageEvent and had it firing twice? I have one event listener with a log at the top, and when i swing a sword and it takes damage, it logs twice thonking

dense drift
#

What would be a proper way to disable elytra riptide boost? I tried to listen to PlayerRiptideEvent and then set Player#setGliding(false) but that doesn't really work =/

river solstice
#

PlayerMoveEvent
Player#isRiptiding()
cancel?

#

also there's this

lyric gyro
#

that's visual only afaik

#

that bit flag

#

the one time I wanted to prevent elytra + riptide I think I did something with the velocities

#

hold on

river solstice
#

or just disable the enchant itself?

#

remove it from the item if it's used or smt

lyric gyro
#

well we didn't want to remove the enchantment entirely

#

like it was fine without an elytra

river solstice
#

or remove it temporarily if player is in water/it's raining and when the player uses the trident and then re-add it shortly after

#

5Head

lyric gyro
#

too many potential points of failure

#

items are moved and dropped

#

they're cloned all the time

lyric gyro
hoary scarab
dense drift
dense drift
#

d;spigot PlayerEvent

uneven lanternBOT
#
public abstract class PlayerEvent
extends Event```
PlayerEvent has 49 sub classes, 1 fields, 2 methods, and  1 extensions.
Description:

Represents a player related event

tacit belfry
#

I'm having a problem with saving data in config files.
On my localhost server everything saves perfectly fine, but on the actual server (PebbleHost) whenever the server stops it doesnt save any data and the yml file is empty.

#

Is there a known problem with pebble or am I doing something wrong?

night ice
tacit belfry
#

?paste

neat pierBOT
#
FAQ Answer:

Paste Services
When asking for help with a config/menu/code issue please use our paste bin:
(we prefer it over pastebin.com)
• HelpChat Paste - How To Use

tacit belfry
tacit belfry
past ibex
#

and the event is unreliable anyway thanks to some mistakes in netcode

#

Removing the enchantment is the only 100% reliable way

steep bloom
#

Hi! I'm very new to spigot development. I'm making a plugin and would like to be able to use some data as placeholders. Do I need to create a separate project for the expansion and if so then how can I access my plugin's class from within the expansion?

shell moon
#

QUESTION: Havin in my class

private NamespaceKey key;
```it is ofc null, will it throw error if plugin is installed on older versions than 1.12??
**SOLVED:** Doesn't throw errors xdd (Confirmed)
**EDIT:** nvm, doesn't throw error but doesn't register listeners xd
shell moon
#

purpur has deprecated ItemMeta#setDisplayName method, you think it will be removed soon from purpur? (Just wondering)

steep bloom
#

Thanks a lot of for the pointers!

steep bloom
#

I'm getting an error

Cannot invoke "me.clip.placeholderapi.PlaceholderAPIPlugin.getLocalExpansionManager()" because the return value of "me.clip.placeholderapi.expansion.PlaceholderExpansion.getPlaceholderAPI()" is null

which leads to https://www.spigotmc.org/threads/placeholder-api-error.550815/, but OP wasn't nice enough to share the solution

#

any ideas?

#

i'm using java 17 and 1.18 Paper (also Java 17 server)

#

And I have it as

depend: [ PlaceholderAPI ]
softdepend: [ EssentialsX, PlaceholderAPI ]
#

the bug report template tells me not to report issues with expansions and to use the appropriate issue tracker for those. any idea where that may be?

steep bloom
#

it appears i'm "shading" placehodler api classes (which I do not understand what it means). I'm using maven, any way to fix this?

#

I set it as "provided" in pom.xml and that works (got Successfully registered expansion) but I can't get any of the placeholders to work

#

my code is

#
    @Override
    public String onRequest(OfflinePlayer p, String identifier) {
        if (identifier.equals("test")) {
            return "works";
        }
        return "doesn't work";
    }
#

using /papi parse nothing gets replaced

high edge
#

and what's the placeholder you're parsing

steep bloom
#

and parsing

#

%testing_test%

high edge
#

and what are you getting back?

steep bloom
#

i'm very new to plugin development so I might be missing something obvious

steep bloom
high edge
#

Did you register the expansion?

steep bloom
#

i did, it even says Successfully registered expansion with its name and version

#

im using public String onRequest(OfflinePlayer p, String identifier)

high edge
#

Can you try changing the method to onPlaceholderRequest or whatever the other one is called

steep bloom
#

sure

high edge
#

Haven't messed with papi in quite a while so not 100% sure

steep bloom
#

same thing

#

there are no errors or warnings in console

high edge
#

Can you paste the entire placeholder and main class

#

?paste

neat pierBOT
#
FAQ Answer:

Paste Services
When asking for help with a config/menu/code issue please use our paste bin:
(we prefer it over pastebin.com)
• HelpChat Paste - How To Use

steep bloom
#

yeah sure

high edge
#

Can you try overriding canRegister as well, and set it to true

steep bloom
#

Done, no difference

high edge
#

Could be plugman fucking with it

solemn ocean
#

Is it possible to use custom model data for blocks too or only for items?? I would like to create like new blocks with different textures

steep bloom
#

i'll try one rn as well

#

yeah same thing, no difference

steep bloom
high edge
steep bloom
#

lol the _ in the expansion name was messing it up

#

it works now

upper jasper
#

Note blocks have 800 blockstates so there’s like 799 custom blocks you can make with them

solemn ocean
#

I bought oraxen but I wanted to create all by myself except for modelengine, that was too much work hahahahah

solemn ocean
#

So i think Ill try another way

#

Like the itemframes one

solemn ocean
steep bloom
#

this is what i've seen being done for decoration

solemn ocean
#

but you mean on each face of the block a itemframe?

#

I know what you mean ohhh

#

You mean like for a wall thing, but for actual 3d blocks?

upper jasper
#

Itemframe in barrier with a big block model inside the itemframe

solemn ocean
#

I dont understand what's that thing inside with a glow effect

upper jasper
#

With custommodeldata to show the crate model to people with the pack

#

Id use item frames if you’re on 1.16+

upper jasper
solemn ocean
#

im on 1.18.1

#

so yeah

#

I have to try that si

#

so

#

thanks

shy canopy
#

Why not update to 1.18.2?

solemn ocean
#

I was on 1.18.2 I had an issue I thought it was for that .2 so i downgraded and never upgraded

shell moon
#

Event to cancel entity transform in 1.8.8? zombie -> pib zombie creeper -> charged creeper

#

EntityTransformEvent doesnt exist tehre

lyric gyro
#

1.8.8 woeisyou

shell moon
#

Found it: CreatureSpawnEvent

lyric gyro
#

Ahh yeah that makes sense

#

It despawns the entity and just spawns a new one yeah?

shell moon
#

i think so

#

question is

#

i want to strike a lightning to players/entities

#

but i want to cancel transformation into other mobs but just from those lightnings (not natural lightnings)

#

best way to do it?

lyric gyro
#

maybe try cancelling the damage event?

#

I'm not sure how it detects when to transform entities in 1.8.8

shell moon
#

issue is there is no

#

getLightning there (nor in 1.14+)

lyric gyro
#

uhhh let me look

pine flax
#

what about entitydamagebyentity

#

check that damage cause is lightning and cast the damager

lyric gyro
#

That's a good idea too

shell moon
#

only LightningStrikeEvent but that doesn't have a noDamage moethod or sth xd

shell moon
lyric gyro
#

There's a LIGHTNING damage cause

#

You can check that in a damage event listener and see if its a zombie/creeper, then cancel it

lyric gyro
#

Oh I missed that lmao

shell moon
#

i know how to cancel things, issue is to get if that was summoned by the entity

#

or natural

#

maybe metadata

lyric gyro
#

Yeah was gonna say

shell moon
#

but

#

after calling
World#strikeLighting

lyric gyro
#

Add metadata to your lightning as you summon it then check that

shell moon
#

it prob already called the damage event

lyric gyro
iron karma
#

I am making a class plugin, and I wanted to know how I can make certain potioneffects when choosing a class

shell moon
#

pick class, add potion effects

pine flax
iron karma
#

i tried this

shell moon
#

as mentioned

#

pick class, add potion effects

#

if you want, a task

#

and add potion effect every 3 seconds with a duration of 4 secs

#

so if they remove the class, they lose the effects

shell moon
#

or even 1 second timer with a 1.5 or 2 secs effect duration

#

i dont get

#

the issue tbh

iron karma
#

fk

#
@EventHandler
    public void onPlayerJoin(PlayerJoinEvent e) {

        Player player = e.getPlayer();

        if (plugin.storageConfig.contains(String.valueOf(player.getUniqueId()))) {


            for (String key : plugin.guiConfig.getConfigurationSection("items").getKeys(false)) {
                List<String> effects = plugin.classesConfig.getStringList(key + ".effects");
                for (String effect : effects) {
                    player.addPotionEffect(new PotionEffect(PotionEffectType.getByName(effect), 86000, 1, true, true));
                }
            }

            return;
        }
        player.openInventory(selectorGui.getInventory());
    }```
#

i tried that

shell moon
#

and the exact issue is?

lyric gyro
#

Try debugging it!

#

What does your effects key have in the config? Maybe your names are wrong

shell moon
#

first, the issue, what is it

lyric gyro
#

"it doesn't work"

#

lmao

shell moon
#

what doesnt work

iron karma
shell moon
#

imagine join event is not registered

#

thats the thing

lyric gyro
#

šŸ¤·ā€ā™‚ļø could be

shell moon
#

we need to know the exact issue

iron karma
shell moon
#

100% sure?

lyric gyro
#

are you sure its working

shell moon
#

it's called 100%?

iron karma
iron karma
shell moon
#

so it opens the inv

#

right?

iron karma
#

yep

lyric gyro
#

okay well are you sure your storageConfig file has your uuid in it?

iron karma
#

yes

lyric gyro
#

Yeah try adding debug lines after each check to see what's going on

#

its a pretty trivial method but it should work. Something like just 1,2,3,4 etc after each check should tell you where your thing is choking

shell moon
#

nvm, won't work, the lighting still needs to hit the entities

lyric gyro
#

What won't work?

shell moon
#

it just should not convert them, so creature spawn is needed

lyric gyro
#

uhhhh can you add metadata to the entity you striked?

#

actually no that's a bad idea lmao

iron karma
#
@EventHandler
    public void onPlayerJoin(PlayerJoinEvent e) {

        Player player = e.getPlayer();

        if (plugin.storageConfig.contains(String.valueOf(player.getUniqueId()))) {
            player.sendMessage("POINT #1"); /* WORKS */

            for (String key : plugin.guiConfig.getConfigurationSection("items").getKeys(false)) {

                player.sendMessage("POINT #2"); /* WORKS */
                List<String> effects = plugin.classesConfig.getStringList(key + ".effects");
                for (String effect : effects) {

                    player.sendMessage("POINT #3"); /* DONT WORKS! */
                    player.addPotionEffect(new PotionEffect(PotionEffectType.getByName(effect), 86000, 1, true, true));
                }
            }

            return;
        }
        player.openInventory(selectorGui.getInventory());
    }
shell moon
#

thats actually

#

a good idea

iron karma
#

in "for (String effect : effects) {" stop works

shell moon
#

not the best

#

but let me track striked entities

lyric gyro
#

Yeah yeah, then just remove the metadata key a tick or two later

shell moon
#

i can simply add a long with strike time

pine flax
#

does that require nms in 1.8?

shell moon
#

and listen to spawn event and if more than 1 secs passed, then the lightning was not summoned by me

shell moon
#

too many tasks i think

lyric gyro
#

fair

iron karma
#

storage

f383e2c1-eb6a-4321-b786-4076c826821f:
  selected-class: warrior
lyric gyro
#

that one works already, send the classes one

shell moon
#

stroke is the past of strike right?

iron karma
#

classes

Warrior:
  effects:
  - '[ABSORPTION]'
  - '[INCREASE_DAMAGE]'
lyric gyro
shell moon
#

fair

lyric gyro
#

and lowercase your Warrior class so its 'warrior'

iron karma
#

oh

#

its that xd

lyric gyro
#

haha

iron karma
iron karma
shell moon
#

shouldn't

lyric gyro
#

No, just make one task that handles it

shell moon
#

since you add effects, i guess must be sync

#

not async, so cant tell

#

most do that so i dont think there is an issue

lyric gyro
#

It really shouldn't be that big of a deal

shell moon
#

one task only? i rather making more tasks

#

than one task that loops thru players

#

checking class and loads effects from config

#

just my tho

lyric gyro
#

Yeah I mean if he wanted to he can split it up lol

#

idea's the same though it shouldn't be too bad

#

Since its running every 3 seconds. The server does tons more than that every tick

#

so its pretty negligible in the grand scheme of things

iron karma
#
Bukkit.getScheduler().runTaskTimer(plugin, new Runnable() {
                        @Override
                        public void run() {
                            player.addPotionEffect(new PotionEffect(PotionEffectType.getByName(effect), 30, 1, true, true));

                        }
                    }, 20, 30);```
#

this works?

shell moon
#

yes

#

depends on how you implement it

lyric gyro
#

You can probably step up the timer higher tbh

iron karma
#

i changed the duration of the potion to 35

lyric gyro
#

but yea it should work fine

iron karma
#

and works c:

lyric gyro
iron karma
#

what is the best way to send a actionbar?

#

in 1.18

proud pebble
#

theres now an api for it i believe

#

in the spigotapi

#

or atleast last time i checked it exists

iron karma
#

player.spigot().sendMessage(ChatMessageType.ACTION_BAR, new TextComponent("This message will be in the Action Bar"));

#

that?

broken elbow
#

ugh. its been for a while?

iron karma
#

oh okay

shell moon
#

the only one that doesnt have a native method is 1.8.8 xd

iron karma
#

what is the best way to create a command

#

CommandExecutor?

shell moon
#

thats the only way actually

#

as listening to command pre process event doesnt create the command so other plugins cant execute it as player

leaden sinew
shell moon
#

server crash, plugin disable + allow other plugins to add better or longer potion effects

#

but ofc, thats just my tho

leaden sinew
#

I was just wondering, that makes sense

shell moon
molten wagon
#

I try shade a api but it refuse. Try several things, it is Item-NBT-API I try to shade.

https://pastebin.com/yiFfRQV7
Seams it not even find it (is no issue access the methods but can“t shade it).

warm steppe
#

maven is the issue

#

try gradle šŸ˜‰

molten wagon
warm steppe
#

yeah

#

its easier + shorter

#
  • faster
#
  • ratio
molten wagon
#

I not even understand how to set up gradle. is even more confusing how to set up dependency and shade.

warm steppe
#

do you use intellij idea?

#

?help

neat pierBOT
#
FAQ Answer:
Ā» Give the helpers some details
Ā» Ask suitable questions
Ā» Be polite
Ā» Wait

Source

warm steppe
#

wait wrong one

molten wagon
icy shadow
#

I'm having the weirdest issue ever where InventoryClickEvent doesn't get fired sometimes.
Trying to make a GUI that players can take items from, but not add. Most of the time, this works fine, but sometimes it lets me put items back in, and it seems like the InventoryClickEvent just doesn't fire

As you can see, sometimes it lets me put the slot in, and my inv click event seemingly doesn't fire at all. Any ideas / solutions?

#

code isn't too important, but i have added prints to the listener and they don't print sometimes, making me think the listener doesnt get hit

#

1.16.5 for what it's worth

molten wagon
icy shadow
#

I haven't but that's not what I'm doing

#

Just clicking

molten wagon
#

If you add item at same time you move cursor that event get trigged.

icy shadow
#

HELP CHAT

icy shadow
warm steppe
#

dont scream pls

molten wagon
iron karma
#

how i can pass a string from constructor to other class?

icy shadow
#

that makes no sense but

#

ty

broken elbow
#

but spigot*

icy shadow
#

literally

#

spigot always finds a new way to troll people

molten wagon
neat pierBOT
molten wagon
icy shadow
#

😟

#

it seems to be working now so i think we're good

#

but yeah spigot inventory stuff is such a mess

molten wagon
broken elbow
icy shadow
#

i was originally

#

same issue lol

#

but i also realised that i didnt need a full framework for what's a glorified chest

iron karma
#
@EventHandler
    public void onInventoryClick(final InventoryClickEvent e) {

        final Player player = (Player) e.getWhoClicked();
        player.sendMessage("CHECK #1");
        if (!e.getInventory().equals(classCreatorGui.getInventory())) return;

        player.sendMessage("CHECK #2");
        e.setCancelled(true);```

the check #2 dont works, why?
molten wagon
broken elbow
#
    if (!e.getInventory().equals(classCreatorGui.getInventory())) return;

you're checking that those 2 inventories are not the same. the CHECK #2 will only show if they're exactly the same inventories

iron karma
#

it's supposed to be the same inventory

broken elbow
#

well I mean, I guess show the getInventory method and where you open the inventory

iron karma
#

i dont understand xd

#

if u want i can show you the full code

terse violet
#

One time to be a lil lenient with spigot

icy shadow
#

no mercy

#

someone needs to take the blame

#

Or at least it should be documented better

terse violet
#

Like peep the code for the window click

#

Shit is actually

#

Mind fucked

#

And suicide

icy shadow
terse violet
#

Good lol

#

You’ll go into deep depression

molten wagon
dense drift
#

send your build file

molten wagon
dense drift
#

add this under id 'java' and remove buildscript { }
id 'com.github.johnrengelman.shadow' version '6.1.0'

molten wagon
# dense drift add this under `id 'java'` and remove `buildscript { }` `id 'com.github.johnreng...

https://pastebin.com/xcZLTGDW

I solve the issue in maven. I needed to do com.github.broken1arrow.Item-NBT-API:* instead of only have com.github.broken1arrow:* . apparently change the path when fork it (miss that change).

lyric gyro
#

HOW TO enable flying?? MINECRAFT PAPER

shell moon
#

google

lyric gyro
#

server.properties

shell moon
#

java: error reading C:\Users\PCNASA.m2\repository\org\apache\logging\log4j\log4j-api\2.17.1\log4j-api-2.17.1.jar; error in opening zip file

lyric gyro
#

try updating it from maven central?

shell moon
#

i dont use maven xd

#

it was compiling 10 mins ago

lyric gyro
#

Try deleting the file and rebuilding it?

shell moon
#

deleted the whole folder in that path

#

and rebuilt, same thing

lyric gyro
#

restart computer

#

ez

shell moon
#

will it fix that? xd

lyric gyro
#

have you done mvn clean install to reinstall the files?

shell moon
#

i dont even have it maven

#

it's from purpur import (i think)

lyric gyro
shell moon
shell moon
#

didnt fix it

warm steppe
solemn ocean
solemn ocean
#

thanks

forest jay
#

How can I center text on a items lore?

#

I tried to create my own class but that was super wonky, most text was too far left or too far right.

lyric gyro
forest jay
#

I want something that doesnt use a ton of my time manually centering

lyric gyro
#

Well search on google 'spigot center text in lore'

#

You'll find a answer

pine flax
#

You can use StringUtils#center from the included apache commons lang

shell moon
#

is it possible to allow creeper explosions in a WG region

#

but deny the block damage (i mean so blocks are not destroyed)

lyric gyro
#

so you want creepers to explode

#

but you don't want creepers to explode

shell moon
#

but don't break blocks

wintry grove
#

I dont think thats possible?

#

maybe just deny the explosion or something

dusky harness
#

d;spigot EntityExplodeEvenet#setYield

uneven lanternBOT
#
public void setYield(float yield)```
Description:

Sets the percentage of blocks to drop from this explosion

Parameters:

yield - The new yield percentage

dusky harness
#

@shell moon

shell moon
#

true

dusky harness
#

oh so you want only specific blocks

shell moon
dusky harness
#

oh

#

r u coding it

#

or

shell moon
#

was playing around with WG

dusky harness
#

oh

shell moon
#

yes i am

#

but my creepers still didnt explode

#

but damaged players

#

it was WG config

dusky harness
#

well you can use blockList() and manually explode the ones or if it's mutable then just remove the worldguard ones

shell moon
#

yeah, i do that

#

in the options

dusky harness
#

what options?

shell moon
#

From my plugin

#

xD

#

Cancel-block-damage: true

dusky harness
#

like is that a config option in your plugin?

shell moon
#

e.blockList().clear();

#

šŸ˜›

dusky harness
shell moon
#

it was WG config

#

alreadyu filled xd

#

fixed xd

dusky harness
#

alr

#

oh its an hour late

#

🄲

shell moon
#

yeah xd

#

still thanks for replying

worn jasper
#

how can I cancel all async tasks my plugin is executing when I shut down the server?

#

to avoid this

high edge
#

execute them sync

#

So the server waits for them

worn jasper
# high edge execute them sync

that's not the point. I have an async timer task that runs every lets say 20s, and if it's running, the server will spam that error

shell moon
#

Cant you cancel them in onDisable?

high edge
#

Cancel the timer on disable

dense drift
#

there's a cancelAllTasks method I believe

brittle thunder
#

Call the guards on them

topaz elm
#

you can just do BukkitScheduler.getPendingTasks().forEach (BukkitTask::cancel);

#

or something

worn jasper
#

okay thanks

lyric gyro
#

Please help me out :)

lyric gyro
lyric gyro
#

and I checked the damage by doing a e.getDamage <= 0

pine flax
#

sounds like your plugin is receiving the event before that other plugin cancels it. you can try adding priority = EventPriority.MONITOR to your EventHandler annotation

formal crane
#

So i am using this in my code (jdk 18) byte[] bytes = Base64.decode(base64); with import import com.sun.org.apache.xerces.internal.impl.dv.util.Base64;
but when building it gives me this: error: package com.sun.org.apache.xerces.internal.impl.dv.util does not exist import com.sun.org.apache.xerces.internal.impl.dv.util.Base64; anyone that could help?

dense drift
#

Use java.util.Base64

solemn ocean
#

Are blockstates like custom model data so you can choose to give different textures by choise or the variants array is always random?

limber hedge
#

How do I make sure that a world is loaded? When I reload my plugin I can spawn a zombie with a command, but on server start it says world is null

viral moth
#

that is from memory but I believe that js correct

limber hedge
#

I dont wanna make a world

lyric gyro
#

How could i go about putting Item Meta into a Database

dense drift
dense drift
lyric gyro
#

okay

viral moth
inner valley
#
    public void onClick(InventoryClickEvent event)
    {

        Player player = (Player) event.getWhoClicked();
        InventoryView view = event.getView();
        if (view.getTitle().equals("dikke aids"))
            switch(event.getCurrentItem().getType()) {
                case APPLE:
                    
                public void run() {
                    this.time--;
                    if (this.time == -1) {
                        this.time = 9;
                        this.seconds--;
                    }

                    if (this.seconds != -1) {
                        player.sendTitle("kanker", this.seconds + "." + this.time + "s", 0, 60, 0);
                        player.sendMessage("debug1");
                    }

                    if (this.seconds == 0 && this.time == 0) {
                        player.sendTitle("test", this.time + "s", 0, 60, 0);
                        player.sendMessage("debug2");
                    }


                    event.setCancelled(true);
                    return;

                }

            }
    }



}``` Intellij displays an error at the public void run**()** anyone that knows the solution?
#

the error is shown on the () after run

high edge
#

You're missing a bit on that

inner valley
high edge
#

Well I presume what you want to have there is a runnable, so create a new bukkit runnable

#

with your method inside it

inner valley
#

I'm very stupid šŸ˜‚ Thanks for your help.

worn jasper
#

Line 60 of DropManager.java: var allGens = new HashMap<>(cache.getGenerators().getLocations());

topaz elm
broken elbow
#

but anyways, concurrent modification. You're creating the new map from another map while probably looping thru that map

broken elbow
#

yeah. probably since you run it async, you end up modifying the map in another thread.

#

Idk what the best solution here is, but there's ConcurrentHashMap. That's something you could use instead of a HashMap

worn jasper
broken elbow
#

CHM is thread safe

icy shadow
#

using CHM to fix this particular issue is a bit of a crutch

#

@worn jasper show the source for getLocations

lyric gyro
#

or die

icy shadow
#

actually that might just be a classic CME lol

#

nothing to do with modifying while iterating

#

so yeah you need to be careful when you're modifying stuff async

#

ConcurrentHashMap will help to a degree but thread safety is a messy thing

worn jasper
#

wdym to a degree?

#

can you elaborate?

lyric gyro
#

How do i cancel a Bukkit Task when a player moves when they issue /spawn ive attempted too cancel it with this ```
@EventHandler
public void onMove(PlayerMoveEvent e)
{
spawnCommand.getSpawnCountDown().cancel();
cmf.header(e.getPlayer(), MessageType.ERROR);
e.getPlayer().sendMessage(cm.Colour("&cSpawn Teleportation Cancelled due to Movement!!"));
cmf.footer(e.getPlayer());

}```
#

aka how can i check too se if its running to then cancel it

leaden sinew
lyric gyro
#

yes because it hasnt been ran yet

#

so the schdule wont exist at this time

leaden sinew
#

You can use a null check then

lyric gyro
#

okay ill try that

#

im testing now

lyric gyro
viral moth
#

thread safe hash maps only allow one operation to go on at a time, so if 2 threads try to do something at the same time, it will do one, wait for it to complete, then let the other thread access it

#

depends on your use case tbh

lyric gyro
#

well that's not strictly true but it depends on the impl

dense drift
#
    private val gson = GsonBuilder()
        .setPrettyPrinting()
        .disableHtmlEscaping()
        .registerTypeAdapter(Component::class.java, ComponentSerializer())
        .registerTypeAdapter(Voucher::class.java, VoucherSerializer())
        .registerTypeAdapter(Pattern::class.java, PatternSerializer())
        // Messages
        .registerTypeAdapter(TitleMessage::class.java, TitleMessage.TitleMessageSerializer.INSTANCE)
        .create()```

```kt
    internal class ComponentSerializer : JsonSerializer<Component> {

        override fun serialize(src: Component?, typeOfSrc: Type?, context: JsonSerializationContext?): JsonElement {
            return if (src == null) JsonNull.INSTANCE else JsonPrimitive(MiniMessage.miniMessage().serialize(src))
        }

    }```
So I got a gson instance, each type adapter is a `JsonSerializer<>` class. Is possible to somehow have access to this gson instance when serializing objects? For instance, TitleMessage has components, and I made it so components are serialized using MiniMessage, but the available `JsonSerializationContext` acts like a standard gson instance, with no type adapters, or at least not the ones I registered.
high edge
#

get gud?

dense drift
#

smh frosty

solemn ocean
#
        {
            System.out.println(w.getName());
            for(Entity entity : w.getEntities())
            {
                System.out.println(entity.getName());
            }
       }``` Why it doesnt get the entities in the worlds? that's strange, I disabled natural spawning with gamerule but if I spawn them with eggs and I see them when logging back why shouldn't it count those
sterile hinge
#

because it does not load the whole world obviously

solemn ocean
#

i just found out online after one hour it was a common world corruption in level.dat, level.dat_old and stats file so I just had to delete those.

limber hedge
#

How should I count how many people are within a radius of a block?

dense drift
#

@limber hedge use this and filter by entity type, if you want a circle area

#

d;spigot World#getNearbyEntities

uneven lanternBOT
#
@NotNull
Collection<Entity> getNearbyEntities(@NotNull Location location, double x, double y, double z, @Nullable Predicate filter)```
Description:

Returns a list of entities within a bounding box centered around a Location.

This may not consider entities in currently unloaded chunks. Some implementations may impose artificial restrictions on the size of the search bounding box.

Parameters:

location - The center of the bounding box
x - 1/2 the size of the box along x axis
y - 1/2 the size of the box along y axis
z - 1/2 the size of the box along z axis
filter - only entities that fulfill this predicate are considered, or null to consider all entities

Returns:

the collection of entities near location. This will always be a non-null collection.

dense drift
#

Or the second method with BoundingBox for a rectangle

abstract prawn
#

bump

wooden quail
#

How could I get if there is no mob in a certain location and use it with an if statement?

round frost
#

can someone who is good with this plugin pls help me with making something im a owner on a network and im trying to add a gui but it is very advanced and im not sure if its worth making a custom plugin for it
pls dm me

hoary scarab
round frost
#

bet

#

can u help

hoary scarab
# round frost can u help

[service] Custom GUI using DeluxeMenu
[Request] I something like hypixel smp were if u are a vip or abouth then you can create a world using multiverse but i need it so that you can also manage the players smp with like gamerules and stuff

Just use the playername variable (placeholder)

round frost
#

so like [playername] im not good with placeholders

#

lol

buoyant haven
#

Hi, i have a question about MySQL NodeJS and JSON
Currently the result is { user: 298113936840982500, product: 'mtdrugs', ip: '0' }
Code:
``` connection.query('SELECT user, product, ip FROM aankopen WHERE user = ' + req.user.id + ';', function (error, results) {
if (error) console.log(error);
console.log(JSON.parse(JSON.stringify(results))[0]);



But i need to get it into 
```json
    "USERID": {
        products: {
            "mtdrugs": {
                ip: "xxx.xxx.xxx.xxx"
            }
        }
    }

How can i do this?

hoary scarab
round frost
#

ok

hoary scarab
hoary scarab
#

no its java. You need to convert it. (I don't use js lol)

pulsar ferry
#

You can't just "convert it" to js lol

icy shadow
#

if 1 user has multiple products that sounds like you should have multiple tables & do a join

tropic glen
#

Hi guys, I created a plug-in with the use of placeholderapi. I used JAVA 8 in 1.16.5 but unfortunately placeholders are not registered in 1.18 with java 17, what could I do in your opinion to create a multicompatibility?

warm steppe
#

recompile plugin with java 17

broken elbow
#

ugh. pretty sure for the most part, a compiled jar with java 8 will work just fine on java 17. Yeah there's some stuff that has been removed but that's limited and most likely they're not using it

tropic glen
neat pierBOT
#
FAQ Answer:

Startup Log Location
Your latest startup log can be found in the logs folder of your
server directory, labeled as latest.log.
Please copy the contents and paste them to a paste service.
Type ?paste for more information.

flat anchor
dense drift
#

That is not my problem though

#

It is a normal behavior I guess, unless you use your own gson instance instead of the JsonSerializationContext provided by the method

icy shadow
#

just do some lazy injection I guess

#

Not nice but necessary

lyric gyro
#

TypeAdapterFactory pleading face

lyric gyro
abstract prawn
#

Bump

shell moon
#

e.getLocation().getWorld().createExplosion(e.getLocation(),explosionPower);

#

this causes ENTITY_EXPLOSION or BLOCK_EXPLOSION (as damage cause)

#

i guess ENTITY_EXPLOSION?

lyric gyro
#

I mean there is no entity involved

shell moon
#

So whats the damage cause?

lyric gyro
#

well you gave two options

#

if it isn't one, what else could it be?

leaden sinew
#

Probably null

#

And it’s probably annotated as NotNull

lyric gyro
#

Hello How could i create a table with players UUID as the table name ?

solemn ocean
#

Did anyone ever got the world corrupted such that the world.getEntities returns always empty array?
I dont understand why but i have to remake the world each X time… maybe something corrupts it but idk what

pulsar ferry
icy shadow
#

Yeah that's awful wtf

#

$50 says a join table will fix all their problems

high edge
#

You're awful

hushed badge
#

Your'e

icy shadow
#

your*

broken elbow
#

you're are

lyric gyro
#

Hello

#

Can someone pls make me a plugin

pulsar ferry
lyric gyro
#

what

pulsar ferry
#

This is not a channel for that, if you want someone to make you a plugin then request on one of those channels

crystal oak
#

hey šŸ‘‹
is LocalExpansionManager#register & #unregister working fine for you all? šŸ˜„

#

<papi>

broken elbow
#

you're not supposed to use that if you want to register your own expansion. but instead create a new PlaceholderExpansion object and use the register method provided by PLaceholderExpansion on that object

crystal oak
#

of course.

#

Didn't know there is any other way than that, which you wrote above ^

#

The problem is, that #unregister doesn't work and... I think... I can see why, but maybe I am wrong.

#

https://github.com/PlaceholderAPI/PlaceholderAPI/discussions/837

#

Just came to make sure if anyone else has the same problem

#

And if not... maybe I am dumb or something 😬

#

ah

#

If I use low cases in my identifiers, the problem will be 'fixed', I guess

broken elbow
#

yeah. I'm pretty sure that's how identifiers are meant to be.

#

anyways

crystal oak
#

but can be somewhat fixed too, by adding #lowerCase at the end, I guess šŸ˜„ (in #unregister)
whatever... just now I figured out the obvious thing, my bad. 😬

#

brain not working today

dense drift
formal crane
#

i am saving an arraylist of itemstacks to base64 but it looks like this, is that normal (its so long)?

lyric gyro
#

I mean

#

that is indeed base64

dusky harness
formal crane
#

it adds those \r\ chars but i dont know why

dusky harness
#

thats part of newline char

formal crane
#

why does it create a newline?

dusky harness
#

it doesn't exactly, I think it moves the cursor to the left or smth

and I also think its only windows now

formal crane
#

i am using this for converting to base64

        try {
            ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
            BukkitObjectOutputStream dataOutput = new BukkitObjectOutputStream(outputStream);

            // Write the size of the inventory
            dataOutput.writeInt(items.length);

            // Save every element in the list
            for (int i = 0; i < items.length; i++) {
                dataOutput.writeObject(items[i]);
            }

            // Serialize that array
            dataOutput.close();
            return Base64Coder.encodeLines(outputStream.toByteArray());
        } catch (Exception e) {
            throw new IllegalStateException("Unable to save item stacks.", e);
        }
    }```
dusky harness
#

oh you're storing an array of itemstacks

#

then yea it'll be even longer

lyric gyro
#

tf is Base64Coder

dusky harness
#

wait doesn't spigot have a builtin method

#

or is that paper

lyric gyro
#

paper does have a safe method for (de)serializing items

#

why do you ask if you're gonna try your luck with the bot anyway

dusky harness
#

😃

#

since i dont know the exact method

lyric gyro
#

serializeToBytes

formal crane
#

if i log base64 in my console it also creates new lines

dusky harness
#

at least for me its normal

#

u have to remove them

formal crane
#

with .replaceAll("\r", "") ?

lyric gyro
#

is there an actual issue with having those newlines there?

#

if you don't know how the ObjectOutputStream works you should not touch those things

formal crane
#

oh alr

lyric gyro
#

like does that cause some problem or anything?

icy shadow
#

if it aint broke...

dusky harness
#

unless regex has a builtin one

formal crane
#

i amm try hikaricp for the 10th time

dusky harness
#

also use replace not replaceAll if you're not using regex

#

not sure why it's named that way 🤷

formal crane
#

oh

lyric gyro
#

dkim not reading what I said

#

classic

dusky harness
#

I thought you were talking about ObjectOuputStream & RazerStorm

#

wait

#

no I think I use paper method

lyric gyro
#

alter the result, you're altering the data

dusky harness
dusky harness
#

I remember removing newlines

#

and it still working

#

ĀÆ_(惄)_/ĀÆ

#

idk

lyric gyro
#

🄓

#

you do you

dusky harness
#

ok well i cant test rn

#

but

#

šŸ˜–

fiery pollen
#

So i am importing the paper api,

            <groupId>io.papermc.paper</groupId>
            <artifactId>paper-api</artifactId>
            <version>1.18.2-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>```
But when i try to use InventoryCloseEvent#getReason() does not work, it looks like i am just importing the spigot api
broken elbow
#

You need to also add the repository

#
<repository>
    <id>papermc</id>
    <url>https://repo.papermc.io/repository/maven-public/</url>
</repository>```
fiery pollen
#

I did

#

I also tried invalidating Caches, but that didn't work either

#

Nvm its fixed, idk how but it works now

sand arrow
glass bay
#

Hi! Im pretty new to spigot plugin coding. I am wondering how people are making custom plugins that they use all over there whole server network. For example, they have a lobby and a skywars server and there getting information from the lobby into the skywars server. Can someone explain or help me with making this?

hoary scarab
dusty frost
#

or Redis šŸ˜‰

#

been using it recently, very nice for shared state

glass bay
#

So you can connect a database to a plugin to get information from 1 server to another server?

dusty frost
#

Well you have to write it in a certain way right

#

Generally each server that interacts either caches the data and they all update eachother through like Redis or PluginMessaging, or they all just query the DB whenever as the definitive source of truth

#

There's a lot that goes into designing this stuff and that's kinda what I've been grappling with for the past few weeks lol

#

Making a whole network of servers one shared server so to speak

glass bay
#

Ah okay

pine flax
#

i've got an annotation that's supposed to create a resource file at build time but it's failing to do so. i have registered it in META-INF/services and it's included in the jar. i'm also using gradle and this dep is marked as an annotationProcessor on the target project. any ideas?
https://paste.gg/p/anonymous/820f01ef85124efeb7e8d8abd6bfa654

trail burrow
#

I wish I didn't forget so easy, How would one make a local maven

lyric gyro
pine flax
#

Can repost it elsewhere if it’s too much of an issue

lyric gyro
#

You need to "set" the supported annotation types so the compiler can give you the elements that are annotated with the annotation you want to process, either override getSupportedAnnotationTypes or annotate your processor class with @SupportedAnnotationTypes

torn heart
#

i'm tryna make an insta charge bow rn, doing this by having it so no matter how much u charge the bow it shoots as if it's fully charged. for this though i need the max bow charge velocity. anyone know how i can get that?

trail burrow
#

need help making a local maven repo

torn heart
#

i can't help you but i recommend you add more details about your problem

lyric gyro
#

Hey, I want to break a block for only one player and still make sure that player can move through the broken block, what's the easiest way to do this?
I've been looking at using ProtocolLib but I'm a total noob and have no clue how to and no threads online seem to have the perfect answer for me

trail burrow
#

just need a place to read on the command and usage on creating a local repo

pine flax
pine flax
trail burrow
lyric gyro
proud pebble
#

i believe the only way to do what you want without making some possibly heavy changes to the server jar is to delete the block on the server side, then use packets to show the block for the players that you dont want to see it broken

lyric gyro
#

Wait I'm so dumb, I could just make the blocks air by default and send the block change when I want the block to be visible

#

Thank you

proud pebble
#

there are some issues that come with this such as if your using a anticheat, it can be seen as flying

lyric gyro
#

Ok, thank you so much. I was completely clueless šŸ˜…

#

Thankfully I'm just making a door of some kind so it will be mostly 2D. Don't think that should cause problems, or?

proud pebble
#

it shouldnt? tho be careful how you implement, if its just for a door, have 2 server states, open and closed, and then for the animation change the block locations to whichever state their supposed to be in

#

this statement might not make sense

lyric gyro
#

I think I understand, ok thanks!

proud pebble
#

basically, have a client side only change for every door animation frame, but on the server just have 2 frames, fully shut and fully open. then like 90% of the way through the animation change the door state from closed to open vice versa

leaden sinew
icy shadow
#

do enchantments not make player heads glow?

#

or is this some sort of client bug

#

even adding the enchant with an anvil doesnt work

high edge
#

They don't no

hoary scarab
icy shadow
#

ah ok

#

thought my code was broken for ages

molten wagon
icy shadow
#

how odd

hoary scarab
molten wagon
hoary scarab
#

Oh nvm I thought you could add enchant glow.

molten wagon
hoary scarab
#

Spawners can have the enchant glow

night ice
#

Hey...I would like to know if there is a way to check whether any other plugin registered a command...?

hoary scarab
night ice
hoary scarab
#

no

main bear
#

Hello, I'm trying to think about how to make an inventory retrieve all the items in the config.yml and add them to the inventory with a custom slot, a custom name, etc.

#

I know how to set an item in specific slot in an inventory but i don't with multiple items in config.yml

fresh spade
#

So If a tripwire hook is placed on a block and you break that block, the tripwire hook will also break. Is there any way to disable this update?

limber hedge
#

When I do p.getDisplayName() i get their nickname

#

How do I make sure I just get their original name

dense drift
#

getName()

solemn ocean
#

Guys to store like custom enchants on an item (its an example i have to do something near to that) I was thinking about using persistent data container for nbt data and check an array of enchantments when I have to use the effects, but I see I don't know if I can set an array of strings enchantments that contains all, I saw there is the data type TAG_CONTAINER and TAG_CONTAINER_ARRAY, do you know what are those for? Would you suggest me to just add each enchantment as a separate String and just check if he any of the avaiable enchantments with many container.has(....)?

proud pebble
proud pebble
#

even good ones

#

since i assume they listen to packets coming from both sides and make a decision based on that it could think even tho the server sent a packet saying a block is there, the return response can be seen as flying

fresh spade
#
@EventHandler
    public void onBlockUpdate(BlockPhysicsEvent e) {
        if(e.getBlock().getType() == Material.TRIPWIRE_HOOK) {
            e.setCancelled(true);
        }
    }
proud pebble
fresh spade
#

hmm lemme check

proud pebble
#

do like a getLogger#info() message or smth

fresh spade
#

its not printing anything XD

#

when i for example break a block that has a tripwire hook attached to

fresh spade
#

anyone .-.?

stuck hearth
#

I broke him

#

oh

spiral prairie
lyric gyro
#

yeah just get good

spiral prairie
#

okay thank

lyric gyro
#

I think EterNity's optimization guide goes more in-depth but overall both explain the same things

spiral prairie
#

found it, thank you

lyric gyro
#

I know it's kept updated with each build that adds something significant, for example Paper recently added a new way to do redstone

spiral prairie
#

huh?

#

what one

lyric gyro
#

It's called alternate current I think, it's 9utlined there

#

o*

spiral prairie
#

i am using that already, noted in yht's guide

main bear
#

Hello, I'm trying to think about how to make an inventory retrieve all the items in the config.yml and add them to the inventory with a custom slot, a custom name, etc. I know how to set an item in specific slot in an inventory but i don't with multiple items in config.yml

river solstice
#

how heavy is running
Bukkit.getScheduler().runTaskLaterAsynchronously(...) after 1 tick, for, possibly, 10-100 times a second?

lyric gyro
#

And you can always monitor it yourself if you’re having doubts with something like spark

river solstice
#

Well, just setting the players velocity.

#

Nothing complicated at all

icy shadow
#

if it's async there's unlikely to be any performance penalty

#

although can you set velocity asynchronously?

pale swallow
limber hedge
#
    List<Material> warBlocks = Arrays.asList(Material.CHEST,Material.FURNACE,Material.BARREL,Material.BEEHIVE,Material.BLAST_FURNACE,Material.BREWING_STAND,Material.BUNDLE,Material.CAMPFIRE,Material.CAULDRON,Material.DISPENSER,Material.DROPPER,Material.FLOWER_POT,Material.FURNACE,Material.JUKEBOX,Material.LECTERN,Material.SHULKER_BOX,Material.SMOKER,Material.TRAPPED_CHEST);
    
    @EventHandler
    public void onBreak(BlockBreakEvent e){
        if(e.getPlayer().getLocation().getWorld().getName().equals("WAR")) {
            if (e.getBlock().getType().equals(warBlocks)) {
                e.setCancelled(true);
                e.getPlayer().sendMessage("You cannot break storage blocks during a war!");
            }
        }
    }```

The line of getType().equals(warBlocks) isnt working
#

How do I check if a block is inside an array of materials

dusky harness
limber hedge
#

thanks a ton that worked

limber hedge
#
    @EventHandler
    public void onInteractEntity(EntityDamageByEntityEvent  e) {
        if (e.getEntity().getLocation().getWorld().getName().equals("WAR"))
            if (e.getEntity() != null) {
                if (e.getEntity().getType().equals(EntityType.MINECART_CHEST)) {
                    e.setCancelled(true);
                }
            }
    }```

How do I disable minecart breaking and opening (in the cse of minecart chests)?
limber hedge
#

A minecart is an entity though

grim oasis
#

not sure why it'd be null tho

limber hedge
#
    @EventHandler
    public void onInteractEntity(PlayerInteractAtEntityEvent e) {
        if (e.getRightClicked().getLocation().getWorld().getName().equals("WAR"))
            if (e.getRightClicked() != null) {
                if (e.getRightClicked().getType().equals(EntityType.MINECART_CHEST)) {
                    e.setCancelled(true);
                }
            }
    }```
#

I tried that

#

Debugging messages get past null statement

#

It doesnt even get fired unless i hit an armorstand or itemframe

grim oasis
#

what is it saying the type of the entity is?

limber hedge
#

Right clicking does

grim oasis
#

okay, try switching the event

limber hedge
#

minecart_chest is what it returns

grim oasis
#

well it should be in caps

#

weird

#

šŸ˜‚

limber hedge
#

it is in caps but cant type it lol

grim oasis
#

== EntityType.MINECART_CHEST

#

instead of .equals

limber hedge
#

ok

#
    @EventHandler
    public void onInteractEntity(PlayerInteractAtEntityEvent e) {
        if (e.getRightClicked().getLocation().getWorld().getName().equals("WAR"))
            if (e.getRightClicked() != null) {
                Bukkit.getServer().dispatchCommand(Bukkit.getConsoleSender(), "msg Kangaroozy " + e.getRightClicked().getType());
                if (e.getRightClicked().getType()== EntityType.MINECART_CHEST) {
                    e.setCancelled(true);
                }
            }
    }```
#

Messages me but doesnt cancel

#

Only fires on opening it

grim oasis
#

can you put a debug inside

limber hedge
#

ok

grim oasis
#

also, I'd still switch it and remove the At

grim oasis
limber hedge
#

Yup it fires past equals

#

but not cancelling

grim oasis
#

it might be probably is

#

just might be the wrong event

limber hedge
#

At is the same no difference

grim oasis
#

without the At right?

limber hedge
#
    @EventHandler
    public void onInteractEntity(PlayerInteractEntityEvent e) {
        if (e.getRightClicked().getLocation().getWorld().getName().equals("WAR"))
            if (e.getRightClicked() != null) {
                Bukkit.getServer().dispatchCommand(Bukkit.getConsoleSender(), "msg Kangaroozy " + e.getRightClicked().getType());
                if (e.getRightClicked().getType()== EntityType.MINECART_CHEST) {
                    Bukkit.getServer().dispatchCommand(Bukkit.getConsoleSender(), "msg Kangaroozy " + e.getRightClicked().getType());
                    e.setCancelled(true);
                }
            }
    }```
#

Yea with or without doesnt seem to change it

#

I want to make them not open and not break

grim oasis
limber hedge
#

Ok yea the works for the no breaking part ty

limber hedge
limber hedge
#

Unfortunately not

grim oasis
#

is it all minecart chests?

limber hedge
#

for an empty minecart it works

#

Yea all minecart chests

grim oasis
#

maybe you can figure it out with inventoryopenevent

limber hedge
#

That worked

#

but for all inventories

#

ty

#

i can figure it out from here

grim oasis
#

e.getInventory().getName() might return container.minecart or something similar to identify

fiery pollen
#

Whats the best way of looking if a BigInteger value is bigger than a integer value, because you can't use >= operators for bigintegers

icy shadow
#

.compareTo exists iirc

fiery pollen
#

oh yeah, thanks

lyric gyro
#

yw

dark garnet
#

how can i regenerate the main world? ive tried googling but the threads i found just go on a rant about other things

wheat carbon
#

turn server off

#

delete folder called world

#

and world_nether & world_the_end

dark garnet
#

using a plugin :/

high edge
#

World#reset()

proud pebble
#

World#reset() doesnt exist

high edge
#

ofc it doesn't

proud pebble
#

i dont believe you can reset the main overworld while the server is running, ive seen that you can reset it on startup but i dont believe you can while its loaded

#

i believe multiverse has its sourcecode public, look through there

high edge
#

You can't reset the main one no, a trick around it could be to use either WE, or CO to revert it back to it's original state while it's loaded

#

Would probably be a very demanding task tho

proud pebble
#

your better of just stopping the server and manually resetting it

#

since you would have to do that anyways to reset the spigot seeds for structures and such

warm beacon
#

Any mobile app devs pm me

lyric gyro
#

no

broken elbow
#

no x2

high edge
torn heart
#

anyone know how to make it so when you shoot an arrow with a bow, no matter how much you charge it it shoots as if it was fully charged. i'm mainly confused about how to replicate the exact velocity of a fully charged bow shot. in 1.8.9 btw

high edge
#

probably just getting the arrow entity, and setting it to the velocity of a fully charged arrow

torn heart
#

but... what is the velocity of a fully charged arrow?

high edge
#

Easy way to check that would be to shoot an arrow, and print out it's velocity

torn heart
#

velocity is a vector and depends on direction right, so what i need is the multiplier

#

i'm just not sure how to get that

#

nvm i think i got it

#

okay now i have a new problem: when the player faces somewhere around 0 degrees yaw or pitch, it outputs a number like -5 or -3, when it shoud be like -0.01. here is my code:

this.getServer().getScheduler().scheduleSyncRepeatingTask(this, new Runnable() {
            @Override
            public void run() {
                Player player = Bukkit.getPlayerExact("Ruskei");
                if (player != null) {
                    System.out.println(player.getEyeLocation().getDirection());
                }
            }
        }, 0, 5);```
#

example is when i'm facing 0, 0 ( in degrees in the f3 menu) it outputs -6.37, 1.38, 1

#

but if i move my cursor slightly then i move back to reasonable values like

#

-0.2

#

sorry if i'm bad at explaining

#

nvm solved

winged pebble
#

I think you're comparing apples to oranges tbh

#

I don't think those values represent the same thing

fiery pollen
#

Does anyone have a good cost formula for like enchantments on a prison server

restive isle
#
        item.setType(Material.FLOWER_BANNER_PATTERN);
        meta.setDisplayName(ChatColor.RESET + "Pattern");
        List<String> loreList = new ArrayList<>();
        if(pattern == null){
            loreList.add(ChatColor.GRAY + "current Patter = none");
        }else {
            loreList.add(ChatColor.GRAY + "current Patter = " + pattern);
        }
        meta.setLore(loreList);
        item.setItemMeta(meta);
        inventory.setItem(10 , item);  

hello! Im trying to make a system where a player can make there own banner. Im using the banner pattern as itemstack but minecraft already put lore on it. how do i remove this?

item.getItemMeta().getLore() doesnt work

grim oasis
#

@restive isle if you need to send a picture use an image site like imgur, not #showcase

#

please remove it

#

?imgur

neat pierBOT
#
FAQ Answer:

You won't be able to upload images here directly to avoid spam, so please use https://imgur.com/upload to upload images/screenshots.
You can also use a screenshot service like gyazo or jinx and post those links here.

restive isle
#

ye tried

#

but it stays

#

when i do item.getItemMeta().getLore().clear it says item.getItemMeta().getLore() = null

grim oasis
#

send the whole class

#

?paste

neat pierBOT
#
FAQ Answer:

Paste Services
When asking for help with a config/menu/code issue please use our paste bin:
(we prefer it over pastebin.com)
• HelpChat Paste - How To Use

restive isle
grim oasis
#

and just to make sure it's actually setting it

#

can you change none to NONE

#

just check if the lore changes

restive isle
#

its not about that part

#

its about the part that says Flower charge

#

how to remove that

pine flax
#

try removing item flags?

high edge
#

Can you copy an entire dir of files from the resources folder? Tried saveResource with the dir path, however that didn't work

rustic belfry
broken elbow
#

you have to deal with all the initialization in the onEnable method.

rustic belfry
#

you need to put a registerFakeEntityClicker();
run the update task(); in OnEnable?

broken elbow
#

you need to remove the constructor for the main class. If you do not know what a constructor is you should probably start learning some java before diving into making plugins. here are some great courses and other stuff that can help you learn:

neat pierBOT
#
FAQ Answer:

Online Courses:
Online courses are also great for learning java. Some websites that offer them are:

  • Coursera - Free unless you want a certificate
  • PluralSight - Great courses from what I've seen. Mostly Paid
  • Udemy - Never used them myself but they seem to all or at least most be paid.
    My first ever course was one from Coursera. - I can say it was pretty good at introducing me to the programming world as a whole not just java.

Oracle Docs:
Oracle docs can help a lot at learning and understanding java:

  • Start with this,
  • Breeze through this (skipping stuff that doesn't seem relevant like bitwise operators),
  • Hit this.
    They're the first three from this larger thing which you should definitely go through overall. But those three should be enough for slightly better understanding of what is happening here without feeling like a huge time sink.
    That one is a small part of this larger site wherein "Essential Java Classes" and "Collections" also have good useful stuff

Other services:
Some other cool services that will help you learn java are:

As you can see there are plenty of good ways to learn as long as you're willing to invest the time. Have fun learning!

terse violet
#

There are many things you can do in the constructor

#

Some of it is too early tho

#

For a lot/most of the spigot related shit

broken elbow
brittle thunder
#

You can have constructors. It just needs a no-args constructor to create the plugin class

broken elbow
#

I guess maybe you can have an empty constructoir?

broken elbow
#

I've never needed one but I've seen somewhere before someone saying you can't have one at all and it just stuck with me I guess

brittle thunder
#

I see

shell moon
#

Does GriefPrevention and other protection plugins prevents falling blocks (spawned by a plugin) convert into solid blocks on ground?

hoary scarab
shell moon
#

there isnt a block from event or similar?

hoary scarab
#

Thought you wanted specifically from plugins. There is an event for when falling blocks convert to blocks.
Yes it should be EntityChangeBlockEvent i think

rich geyser
#

Is there a sort of recommended or de facto standard way to log messages from a placeholder expansion?

#

Or should I perhaps just not try to log anything? I have placeholders that are "conditionally valid", i.e. they are valid if a certain plugin is installed, but invalid otherwise. I'd like to return null when the plugin isn't installed, to signal that the placeholder is invalid in this context, but perhaps also provide a helpful log message about it.

rich geyser
#

Thanks! I was apparently programming against 2.10.10, which does not have these methods šŸ™‚

dense drift
#

np

tropic glen
#

is there anyone?

warm steppe
#

no

neat pierBOT
#
FAQ Answer:
Ā» Give the helpers some details
Ā» Ask suitable questions
Ā» Be polite
Ā» Wait

Source

dusky harness
#

Barry is

broken elbow
#

its launch break. everyone's outside

lapis pilot
#

does anyone knows how I can optimize this?

    @EventHandler(priority = EventPriority.LOWEST)
    public void Join(final PlayerJoinEvent e1) {
        final Player player = e1.getPlayer();
        if (!player.hasPermission("vote.reminder")) {
            new BukkitRunnable() {

                public void run() {
                    String joinText = "&f\n&7&a&lVOTE &fRemember to vote on /vote for epic rewards!\n&f&l%VotingPlugin_VotePartyVotesNeeded% votes are needed for a party!\n ";
                    joinText = PlaceholderAPI.setPlaceholders(e1.getPlayer(), joinText);
                    player.sendMessage(ClaimVIPPlugin.colourise(joinText));
                }
            }.runTaskLaterAsynchronously(ClaimVIPPlugin.getInstance(), 50L);
        }
    }```
#

ClaimVIP::Event: m.d.c.Join (PlayerJoinEvent)count(96) total(1.24% 0.156s, 2.05% of tick)avg(1.62ms per - 1.02ms/0.63 per tick)

lyric gyro
#

I mean there's nothing there to optimize

warm steppe
#

our

bold dagger
#

whats the point of doing that async

lyric gyro
#

optimization !!!!!!!! !!! !

#

which is pointless but like ok

terse violet
#

Oh how I’ve missed ems

#

And her little comments

dusty frost
#

holy shit 2% of the tick

#

do not do that async is how to optimize that

#

if you really want to do it async, use like AsyncPlayerJoinEvent from Paper or something jesus christ

bold dagger
#

player could be null by the time he runs the task as well

lapis pilot
#

I just

#

lost all my braincells

#

by reading the uneducated chat here

bold dagger
#

}.runTaskLaterAsynchronously(ClaimVIPPlugin.getInstance(), 50L);

#

i assume thats 50 ticks later

#

which is 2 and a half seconds

#

if they leave

#

you have no online check

#

its going to error

lyric gyro
#

err probably not, pretty sure CB checks if the connection reference is valid before sending packets

iron karma
#

I am making a duel plugin, and my question is, what is the best way to save the spawnpoints of the players?

past ibex
lapis pilot
#

šŸ’€

#
Server thread0.65%
me.decepticon.claimvip.Join.Join()0.63%
me.decepticon.claimvip.Join$1.run()0.02%```
#

spark

#

also that's without the task being async ^

past ibex
#

Weird

#

Are you using async sampler?

#

meaning you are profiling on linux

lapis pilot
#

yeah

pine flax
#

can you send the profiler link

bold dagger
#

or you can save it in a database if you have multiple instances of the server

#

you can have it structured like so

arenas:
  arena1:
    spawnpoint-a:
      x: 0
      y: 0
      z: 0
    spawnpoint-b:
      x: 0
      y: 0
      z: 0  
  arena2:
    spawnpoint-a:
      x: 0
      y: 0
      z: 0
    spawnpoint-b:
      x: 0
      y: 0
      z: 0
#

then you would just loop through the keys of "arenas"

terse violet
#

Is it all on one server or what?

median glen
#

I'd like to ask for help with the PaperComponents.legacySectionSerializer().serialize(Ė™) method.
It says it is deprecated and I tried to use the class it recommends instead but that doesn't work this one worked — it shows some weird text.

So when I change the code from

String legacyText = PaperComponents.legacySectionSerializer().serialize(displayName);

to

String legacyText = LegacyComponentSerializer.legacySection().serialize(displayName);

as it recommends, legacyText changes from §f[§9§oTester§f] to §fchat.square_brackets

EDIT: Solved, had to upgrade my paper to latest version

sterile hinge
#

and what's the input?

high edge
#

Can you put everything in a paste file

#

?paste

neat pierBOT
#
FAQ Answer:

Paste Services
When asking for help with a config/menu/code issue please use our paste bin:
(we prefer it over pastebin.com)
• HelpChat Paste - How To Use

high edge
#

Have you debugged your saving process?

#

strange

#

Assuming you're running this on player join?

#

No clue to be honest, must be something with the encryption then if that's where it's happening, but I don't see anything off

mystic gull
#

Hello, i made a plugin when i click on an item it will hide all players. But when i disconnect and reconnect they are no longer hidden. So whats the best way to keep them hidden if he activated the item ? Should i use Ć  config.yml or a database or other methods? Which one is the more efficient if there are alot of players