#help-development

1 messages · Page 1448 of 1

tribal holly
#

spigot is not good ?

wraith rapids
#

spigot performs like shit

#

most servers use paper

#

which has expanded api that lets you do things like chunk loading more efficiently

granite stirrup
#

wait i wouldnt think that java threading would work with stuff in spigot and bukkit and stuff

wraith rapids
#

chunks in particular are one thing you need to specifically design for

tribal holly
#

yep i heard about it but is it realye better than spigot on other aspect ?

wraith rapids
#

in basically every aspect yes

#

more than 60% of servers use paper or its derivatives

tribal holly
#

but in my plugin i don't realy need fast load chunk

wraith rapids
#

well yeah but if someone wants to run your plugin on a server, they want it to perform well

#

doing sync chunk loads will have severe repercussions on paper

tribal holly
#

well okay maybe in the future to look to adapte it to paper

wraith rapids
#

as all of their chunk loads are asynchronous

#

and even a single synchronous one bogs down everything else

#

someone sees your plugin loading chunks synchronously, it'll be flying out of the window and they'll look for a paper specific replacement

tribal holly
#

haha ok get it thanks for the advises

wraith rapids
#

paperlib allows you to use the most important features of paper like the async chunk api while maintaining compatibility with spigot

tribal holly
#

so if i code on paper it work without problem on spigot ?

wraith rapids
#

if you build against paper-api, and you use methods that don't exist in spigot-api, the plugin will explode on spigot

#

you should build against spigot-api and add paperlib as a dependency, and then shade it in

#

that way the plugin will still run on spigot

#

but you can use the lib to take advantage of paper api

#

if the server is spigot, the library will default to spigot-api methods

#

if the server is paper, the library will take advantage of paper-api methods

tribal holly
#

hooo so i don't need to rewrite completly my plugin to paper

wraith rapids
#

you'll just need to change some method calls related to chunk loads

#

overall, paper is api-compatible with spigot

#

meaning that you don't need to change anything

granite stirrup
#

yeah most shit in paper is supported but some stuff in paper isnt supported tho

#

lmao

wraith rapids
#

but that of course won't net you any good

tribal holly
#

okay nice

young knoll
#

I'm surprised MD hasn't turned up yet

#

Maybe his spidey senses are taking a day off

vast quest
#

Can I ask the reason people use # instead of .

wraith rapids
#

hanging onto every last user with tooth and nail

#

the death throes of a dying platform

#

people use # because javadoc links use # to anchor the browser to a specific line

vast quest
#

Oh Oki

spice juniper
#

Is there a way to add custom colors to messages?

granite stirrup
#

of course u can

#

;-;

spice juniper
#

Is there a simple way I mean

granite stirrup
#

like to use &3?

#

or something

young knoll
#

Custom as in the old 16 color system

#

Or color as in hex colors

spice juniper
#

no like rgb and hex

granite stirrup
#

i think u use hashtag?

quaint mantle
#
                punchBow.addEnchantment(Enchantment.VANISHING_CURSE, 1);

                event.getEntity().getEquipment().setItemInMainHand(punchBow);
young knoll
#

It bothers me

quaint mantle
young knoll
#

LivingEntity.getEquipment.setItemInMainHandDropChance iirc

young knoll
quaint mantle
#

ok thanks ill change the variable name too

granite stirrup
quaint mantle
#

getEquipment is invalid

young knoll
#

Bungee can use colored chat too

granite stirrup
#

why not put it in like a different directory tho

quaint mantle
#

it says it can't be resolved

#
    public void doorLol(CreatureSpawnEvent event) {
        if (event.getEntityType() == EntityType.SKELETON) {
            double num = Math.random();

            if (num < .03) {
                ItemStack punchBow = new ItemStack(Material.DIAMOND_AXE);
                punchBow.addEnchantment(Enchantment.VANISHING_CURSE, 1);

                event.getEntity().getEquipment().setItemInMainHand(punchBow);
                LivingEntity.getEquipment.setItemInMainHandDropChance;
                // 40% chance
            } else if (num < .17) {
                event.getEntity().getEquipment().setItemInMainHand(new ItemStack(Material.IRON_AXE, 1));
                // 10% chance
            } else if (num < .31) {
                event.getEntity().getEquipment().setItemInMainHand(new ItemStack(Material.STONE_AXE, 1));
            } else if (num < .42) {
                event.getEntity().getEquipment().setItemInMainHand(new ItemStack(Material.STONE_SWORD, 1));
            } else if (num < .5) {
                event.getEntity().getEquipment().setItemInMainHand(new ItemStack(Material.IRON_SWORD, 1));
            } else {```
#

thats more of my code

young knoll
#

🤦‍♂️

#

Obviously you need the () and whatnot

#

You literally use it the line right above that

quaint mantle
#

omg you're right im so dumb lol

young knoll
#

Method takes a float 0-1 I believe

wraith rapids
#

use a treemap

quaint mantle
#

its code that i did back when i was more nooby

#

and now my poor naming and coding choices is dawning on me

wraith rapids
#

map.put(total += <chance here>, <value here>)

#

map.getCeilingEntry(random.nextDouble(total))

quaint mantle
#

ah thank you

young knoll
#

WeightedRandom is nice

#

Don't think it has an API though

spice juniper
#

Does anyone know why this is giving an error?

TextComponent test = new TextComponent("Test");            
test.setColor(ChatColor.of("#1565C0"));
wraith rapids
#

not without the error

spice juniper
#
The method of(String) is undefined for the type ChatColor
#

Sorry forgot

wraith rapids
#

make sure you import bungee chatcolor

#

there's a chatcolor in bukkit and another one in bungee

#

the bukkit one is an enum and doesn't support hex

#

the bungee one is the one you're looking for

young knoll
#

And the bungee one doesn't support getLastColors

#

Because reasons

quaint mantle
#

is equipment the correct type?

wraith rapids
#

the whole chat component api is batshit

quaint mantle
#

im typing it in and nothing comes up for it

young knoll
#

It's EntityEquipment IIRC

quaint mantle
#

ty

spice juniper
#
Bukkit.getConsoleSender().sendMessage("passed");
if(sender instanceof Player) {
    Player player = (Player) sender;
    TextComponent test = new TextComponent("Test");
    test.setColor(ChatColor.of("#1565C0"));
    player.spigot().sendMessage(test);
} else {
    sender.sendMessage("You're not a player");
}

I have a subcommand but I dont receive the message when I execute it

#

No errors and warnings

#

wait actually one error in the console

[ERROR] java.lang.IllegalStateException: zip file closed
sage swift
#

did you /reload

#

but also you know the best part about errors

#

everything after the first line tells you where the error is

wraith rapids
#

your zipperoni went pepperoni

spice juniper
#

the error only tells me this

[ERROR] java.lang.IllegalStateException: zip file closed
#

No further information

wraith rapids
#

🌶

sage swift
#

look at the first time it happened

spice juniper
#

First time the same

sage swift
#
    @EventHandler
    public void onGeneralDeath(EntityDeathEvent evt) {
        evt.getDrops().removeIf(item -> item != null && item.getType() == Material.WITHER_ROSE);
    }``` any idea why this doesn't remove wither roses from the drops?
onyx shale
#

also a item wont be null if its inside

#

the list

sage swift
#

pretty sure it'll cause ConcurrentMod shit

onyx shale
#

adding add/remove

#

should work

granite stirrup
#

¯_(ツ)_/¯

eternal oxide
sage swift
#

so then why does removeIf not work but java evt.getDrops().stream() .filter(i -> i.getType() == Material.WITHER_ROSE) .forEach(evt.getDrops()::remove); does

granite stirrup
wraith rapids
#

the list will never include wither rose

#

it's added to the drops separately from the death event

#

so basically you're fucked

sage swift
#

the latter solution works though

#

wait no never mind

wraith rapids
#

i remember fucking with wither roses at one point and it was a total pain in the ass

#

it was for this drop multiplication thing for my spawner plugin

#

that reduces the # of mobs for inactive spawners, but increases their drop yield

#

wither roses were the one thing that the multiplication didn't work for

#

and it's because they're not in the fucking drop list

sage swift
#

guess just put the location in a set and then compare to spawn locations?

#

:/

wraith rapids
#

and pray that the locations are exact and don't have a random deviation like most natural drops

granite stirrup
#

what tf are you trying to do ?

wraith rapids
#

prevent shit from dropping wither roses presumably

sage swift
#

yea

granite stirrup
#

you could try and make it so if u pick it up it gets deleted maybe?

#

¯_(ツ)_/¯

sage swift
#

well i want to stop mobs from dropping it and implement it in a different way

granite stirrup
#

create ur own droplist

onyx shale
#

so...

sage swift
#

overengineering

onyx shale
#

you know.. there is a event called

#

for when a item spawns in the world

wraith rapids
#

i also vaguely remember nether stars having the same issue

sage swift
#

EntityDropItemEvent is not called for mob drops but im testing it for wither roses

wraith rapids
#

but i'm not totally sure about that

onyx shale
#

its not that

wraith rapids
#

not many wither spawners on my serbur

onyx shale
sage swift
#

i know

onyx shale
#

this gets called no matter what happens

#

as long as its a item

wraith rapids
#

yeah that's the issue

sage swift
#

but EntityDropItemEvent is called for wither roses

#

lol

wraith rapids
#

you don't want to cancel it if the player breaks a wither rose block

#

or a chest containing one

#

interesting, I guess I could add that to the list of shit I listen to for drops to multiply

sage swift
#

yep, cancels all wither rose drops

#

evt.setCancelled(evt.isCancelled() || evt.getItemDrop().getItemStack().getType() == Material.WITHER_ROSE); ez

onyx shale
#

alter drop table in nmsduke

sage swift
#

ent.a(null)

onyx shale
#

jk

#

ur cancelling it but i guess you should give some compensation

#

like throw a casual drop

#

give the fker a piece of coal

spice juniper
#
Player p = (Player) sender;
TextComponent test = new TextComponent("TEST");
p.spigot().sendMessage(test);

When I try to send a message using a TextComponent it says

[ERROR] java.lang.IllegalStateException: zip file closed

In the server console.
I imported TextComponent from import net.md_5.bungee.api.chat.TextComponent

granite stirrup
#

XD

granite stirrup
#

also why not just send a string

#
p.sendMessage("TEST");```
spice juniper
#

I want to use hex colors later on

granite stirrup
#

u can use it without that

#

u Just have to use ChatColor

#

lmao

sullen marlin
#

you probably replaced a jar while the server was running

#

stop your server and restart it

spice juniper
#

Okay

granite stirrup
#

;-;

spice juniper
#

I want to use hex

granite stirrup
#

yeah that allows u to use hex

spice juniper
#

can you give me an example

#

I tried it already

onyx shale
#

ChatColor.of("#123456")

#

seems this is also a thing

sullen marlin
#

yes your code is fine

#

your error is from something else

#

see what I said about the jar above

granite stirrup
onyx shale
#

is hex not implemented in normal messages yet? or its only component based

granite stirrup
#

i think

spice juniper
granite stirrup
#

yes u can?

dusty herald
#

yes you can?

spice juniper
#

really

granite stirrup
#

yes

#

WTF would they have it if u cant

#

lmao

sage swift
#
    private void doFirework(Location location, int level) {
        Firework firework = (Firework) location.getWorld().spawnEntity(location, EntityType.FIREWORK);
        FireworkMeta meta = firework.getFireworkMeta();
        meta.setPower(0);
        for (int i = 0; i < level; i++) {
            FireworkEffect.Builder effect = FireworkEffect.builder()
                .with(types[Utils.random.nextInt(types.length)])
                .withColor(
                    Color.LIME,
                    Color.AQUA,
                    Color.RED,
                    Color.YELLOW,
                    Color.fromRGB(0x00CC8F),
                    Color.fromRGB(0xFF00FF)
                );
            meta.addEffect(effect.build());
        }
        firework.setFireworkMeta(meta);
        firework.detonate();
    }``` any idea why the firework is still doing damage despite having a power of 0?
granite stirrup
sage swift
#

the power of the firework, from 0-128

wraith rapids
#

depends on what parses that string

spice juniper
#
p.sendMessage(ChatColor.of("1565C0") + "test");

Like this?

granite stirrup
young knoll
#

Power affects how high it goes

#

Not the damage

wraith rapids
#

appending ChatColors into Strings involves serializing the chatcolors into a string format

#

which then relies on the method that takes that string to deserialize them back into proper colors

sage swift
#

how can i affect the damage?

wraith rapids
#

and not every method does this

granite stirrup
dusty herald
#

I think it might be best to disable damage with EntityDamageEvent

wraith rapids
#

especially for the hex colors

granite stirrup
spice juniper
#

And the ChatColor is the bungee import right?

spice juniper
granite stirrup
#

if u dont u wont have the .of method

granite stirrup
dusty herald
#

that's what I did

ebon crescent
#

Hey, I’m new to Spigot and had a question. Is there a standard way to ask a command sender for further info? As in, do you want to override a save file (y/n)

spice juniper
#
p.sendMessage(net.md_5.bungee.api.ChatColor.BOLD + "" + net.md_5.bungee.api.ChatColor.of("#1565C0") + "test");

Why is this not giving me a bold text?

spice juniper
#

oh really

#

thanks

warm galleon
#

;-;; what does getconsole sender do

granite stirrup
#

get the console's sender?

#

idk

sage swift
#

get the console so you can run commands from it

#

i feel like i've seen this before, but is there a way to make a table of contents in a book so if you click, it opens a certain page?

sage swift
#

exactly

#

ive seen it on some servers

spice juniper
#

How to call a method from another java class within the same package?

granite stirrup
spice juniper
#

I think thats not my problem, I have moved my command from the main class to another class and know the methods reloadConfig and checkRecipes are undefined

granite stirrup
#

then send a instance of Main to the other class

#

and then you do main.reloadConfig()

#

in the method

spice juniper
granite stirrup
#

constructor ._.

granite stirrup
#

which means u will have to instance the Command

#

unless u make a setPlugin() thing that sets a variable in there

#

¯_(ツ)_/¯

#

idfk

#

XD

sage swift
#

dependency injection

#

say your main class (that extends JavaPlugin) is called MyAwesomePlugin

#

in your onEnable, you would do something like new AwesomeCommand(this), which is where you pass the main class along to the command class

#

in the AwesomeCommand class, you can have a private final variable such as private final MyAwesomePlugin plugin;

#

when you create the object (in the constructor), you will set the incoming instance of the plugin to the variable defined in that class ```java
private final MyAwesomePlugin plugin;

public AwesomeCommand(MyAwesomePlugin plugin) {
this.plugin = plugin;
}```

#

and then you can use the plugin variable to essentially access the class that extends JavaPlugin and all its functionality

granite stirrup
#

thats what i said but i didnt really give any info on how XD

#

well i said constructor

#

i didnt know what it was called

#

;-;

sage swift
#

there is a skill that many seek to master, called not sending 5 messages per sentence

granite stirrup
granite stirrup
#

its a habit

#

:(

sage swift
#

too*, habit*, and again, i said per sentence, which is what i was doing: sending one message per sentence.

granite stirrup
spice juniper
#
p.sendMessage(                            net.md_5.bungee.api.ChatColor.of("#8596ab") +
"[" + 
net.md_5.bungee.api.ChatColor.of("#486d9c") +
"TEST" + 
net.md_5.bungee.api.ChatColor.of("#8596ab") + "]" +        net.md_5.bungee.api.ChatColor.BOLD
);

Why is this not giving me a bold text?

cold pawn
#

Dose anyonw know how id be able to get a score from ingame an display it in a gui? I already did the gui I just need the score?

granite stirrup
ivory sleet
livid tundra
#

is there a way to see when an enderman places a block?

granite stirrup
#

I think the place block event handles that too I think

livid tundra
#

it says it is Called when a block is placed by a player.

sullen marlin
#

EntityChangeBlockEvent I think

livid tundra
#

thanks!

granite stirrup
livid tundra
#

destroy and place?

granite stirrup
#

And I don't think it's just for enderman

granite stirrup
#

U probs need to add a check

livid tundra
#

thats great! now I don't need a seperate class for destroying events

granite stirrup
#

Oh lol

livid tundra
#

and I'm using the event for players, creepers, and endermen

#

thanks!

granite stirrup
#

I think for creepers its different

#

Idk

#

¯\_(ツ)_/¯

#

I suck at coding MC plugins

#

Idk what I'm talking about really XD

ivory sleet
#

Yeah tho you want to return the score?

#

Also believe getScore(String) isn’t deprecated so might wanna use that instead

cold pawn
#

ok

livid tundra
#

do creepers trigger an entitychangeblockevent when they explode?

granite stirrup
#

I don't think so

#

I think they trigger a different event

#

Since they explode other than change blocks

#

I gtg tho

young knoll
#

They trigger an EntityExplodeEvent

clever sequoia
#

guys why is not recognizing the getConnection() method?

candid galleon
#

what's the compilation error when you hover over it?

clever sequoia
#

oh lol

#

thx bruh

desert loom
young knoll
#

You get a container from the pdc

#

Modify it

#

But never set it back

desert loom
#

on the ItemMeta?

young knoll
#

If you don’t specifically need your own container you should just store it in the main one

desert loom
#

also, I'm using my own container to identify a custom item no need to bother with that. Maybe I'll change it later.

fierce salmon
#

so i made a gui but i want to make it so when you left click an item in the gui it sends a command

#

how do i do that?

young knoll
#

You need to call ItemMeta.getPersistantDatContainer.set(key, yourcontainer)

desert loom
#

that's what I'm doing. I don't create the container in that class

young knoll
#

You need to call it again after modifying it

quaint mantle
#

How can I remove a plugin from the SpigotMC website?

sullen marlin
#

report it

young knoll
#

Report it and ask for it to be removed

quaint mantle
#

and my own plugin not from a third party!

sullen marlin
#

same thing, report it

quaint mantle
#

Do you have to report too?

#

ok

dry beacon
#

I've got this piece of code in my onEnable method in KeepInventory.java java getServer().getPluginManager().registerEvents(new DeathEvent(this), this);
And this piece of code to access the class from my DeathEvent.java class ```java
private final KeepInventory plugin;
public DeathEvent(KeepInventory plugin) {

    this.plugin = plugin;
}```

The plugin is throwing an exception "plugin already initialized", could someone explain why this is happening?

young knoll
#

You are doing new MainClass somewhere

#

Or you have two jars in the plugins folder

dry beacon
#

This is the DeathEvent class ```java
package dev.stan.mc.listeners;

import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.plugin.java.JavaPlugin;

import dev.stan.mc.KeepInventory;

public class DeathEvent extends JavaPlugin implements Listener{

private final KeepInventory plugin;
public DeathEvent(KeepInventory plugin) {
    
    this.plugin = plugin;
}

@EventHandler
public void onDeath(PlayerDeathEvent event) {
    
    Player player = event.getEntity();
    
    if (player.hasPermission(plugin.getCustomConfig().getString("permissions.keepinventory"))) {
        
        event.setKeepInventory(true);
    } else {
        
        event.setKeepInventory(false);
    }
}

}

summer scroll
#

You have two class that extends JavaPlugin.

dry beacon
#

Oh wow, thank you!

#

not sure how I didn't notice that haha

desert loom
dusk flicker
# dry beacon Oh wow, thank you!

also just a note I believe you could just do
event.setKeepInventory(player.hasPermission(plugin.getCustomConfig().getString("permissions.keepinventory")));

#

rather then use the if statement

quartz goblet
#

anyone know why this doesnt work? I either get this to never work or it cancels all inventory clicks regardless of slot https://prnt.sc/135d092

#

event is registered properly and all

sage swift
#

are you in creative

somber hull
#

?paste

queen dragonBOT
somber hull
#

wat

summer scroll
# somber hull

looks like the spacing on the description and the aliases.

somber hull
#

thank you good sir 🙂

summer scroll
#

youre welcome

sage swift
#

lol what

#

his problem is that the jar doesn't contain the files

quartz goblet
somber hull
young knoll
#

“Jar does not contain a plugin.yml”

#

Hmm

somber hull
#

this gives me a error here

sage swift
#

i wonder i wonder

somber hull
#

getPluginLoader().disablePlugin(this);

somber hull
summer scroll
#

ah, didnt see the error lmao

somber hull
#

Maybe a bug with the wrong error then

#

anyway

#

this just sends a large error message to the console

#

getPluginLoader().disablePlugin(this);

#

it disables the plugin

#

but also spams console with smthng about a zip file

young knoll
#

I don’t think I’ve ever had an issue

#

But I remember doing Bukkit.getPluginManager.disablePlugin

sage swift
#

put it in a runnable

somber hull
sage swift
#

although that might act weirdly as well since there has to be an owning plugin for runnables

#

¯_(ツ)_/¯

desert loom
#

When I open a double chest through code like so:

    Player player = (Player) sender;

    final Block target = player.getTargetBlock(null, 5);
    final Chest chest = (Chest) target.getState();

    player.openInventory(chest.getInventory());

It remains open even after I close the double chest. This doesn't happen for single chests. I'm running 1.16.5

Does anyone know how I can fix this?

sage swift
#

when the player closes, check that it has no viewers, and close it

desert loom
#

can't get that to work.

        if (closing.getViewers().isEmpty() && closing.getHolder() instanceof DoubleChest) {

        DoubleChest chest = (DoubleChest) closing.getHolder();

        // ((Chest) chest.getRightSide()).close();
        ((Chest) chest.getLeftSide()).close();

        System.out.println("Closed");
        }

the print statement is ran but the chest won't close. I've tried running it a tick later as well and that doesn't change anything.

#

I'm probably doing it wrong

sage swift
#

seems like a spigot bug

desert loom
#

oh I see thanks.

subtle kite
#

now hear me out what is someone changes the name of the chest.

quaint mantle
#

How do I make a percentage plugin? For example, I want to hit a command with a percentage message between 1 and 100, and each time it gives a message, for example, at 87%, say hello. Pls make a class for me because I am a newbie
Thx

eternal oxide
#

No, learn how to use Random in java

sage swift
#

Pls make a class for me because I am a newbie

quaint mantle
sage swift
#

so now do different things based on the output of nextInt(100)

rocky pond
#

you can also add nextInt(100) + <number> to make it start from that number

#

so nextInt(100) + 50 will make it 50-100 instead of 0-100

sage swift
#

no it wont

#

50-150, yes

#

well, 50-149 inclusive

rocky pond
#

xD

#

well then I guess u can remove the 50 from that

#

dude that foncused guy is from my country

spice juniper
#

Wait what do you mean?

sullen dome
#

because #help-server seems to be a meme channel rn, i'll ask here
why do i get this? ports and ip's in config.yml are definitely right

07:05:05 [INFO] [RealRivex] -> UpstreamBridge has disconnected```
dusty herald
#

is the server online

sullen dome
#

yeah

dusty herald
#

show config

sullen dome
#

bungee?

dusty herald
#

nooo

#

yes show the bungee config

sullen dome
#
connection_throttle: 4000
connection_throttle_limit: 3
timeout: 30000
stats: 806fb514-505c-4fc3-a4d1-0ef8ddbcde82
permissions:
  default:
  - bungeecord.command.server
  - bungeecord.command.list
  admin:
  - bungeecord.command.alert
  - bungeecord.command.end
  - bungeecord.command.ip
  - bungeecord.command.reload
network_compression_threshold: 256
servers:
  lobby:
    motd: '&1Just another BungeeCord - Forced Host'
    address: localhost:25566
    restricted: false
  survival:
    motd: '&1Just another BungeeCord - Forced Host'
    address: localhost:25565
    restricted: false
player_limit: -1
prevent_proxy_connections: false
server_connect_timeout: 5000
remote_ping_timeout: 5000
forge_support: false
remote_ping_cache: -1
log_commands: false
log_pings: true
ip_forward: false
disabled_commands:
- disabledcommandhere
groups:
  md_5:
  - admin
listeners:
- host: 0.0.0.0:25567
  motd: '&1Another Bungee server'
  max_players: 1
  force_default_server: false
  tab_size: 60
  forced_hosts:
    pvp.md-5.net: pvp
  tab_list: GLOBAL_PING
  bind_local_address: true
  ping_passthrough: false
  query_enabled: false
  query_port: 25577
  proxy_protocol: false
  priorities:
  - lobby
online_mode: true
#

god, longer than i'd expected lol

dusty herald
#

not sure

#

try making sure lobby is accept connection 🤷‍♂️

sullen dome
#

means what? lol

#

i mean, the lobby is online tho

dusty herald
#

try using the full IP and port

sage swift
#

change ip_forward to true first off

dusty herald
#

that wouldn't stop the server from connecting gecko

sage swift
#

i know

sullen dome
#

i mean it's connected tho

sage swift
#

hmmmm

sullen dome
#

so idk why it doesnt work

#

tying to connect to survival as prio gives the same issue.

#

i even tried using waterfall because maybe that works better with paper, but nah

lean trench
#

Ah it's a panel?

sullen dome
#

yea

sage swift
#

enable it in your BungeeCord config as well!

lean trench
#

the bungee is using an extern ip connection right?

sullen dome
lean trench
#

I've had this guy's problem before

quaint mantle
#

ptero?

lean trench
#

I know exactly how to solve it

eternal oxide
#

Why is yoru lobby on 66 and your server is on 65?

sullen dome
#

i just tried to connect to the lobby directly to see if it's connected to the bungee

quaint mantle
#

I couldn't run bungee on my ptero servers, had to put the servers on the actual root.

sullen dome
#

and yeah, it is

#

so the ip is right

lean trench
#

as in the bungee being set to an extern ip (like 43.236.43.234)

#

and the server being set to 0.0.0.0 or 127.0.0.1 or something like that

sullen dome
#

and survival before was on 25565

eternal oxide
#

the lobby should really be the default port of 65

sullen dome
#

why tho. don't think that makes an issue

eternal oxide
#

as thats what you want them to connect to when default

lean trench
#

25565 is just best practice

#

as a port for bungee

sullen dome
#

well, so lobby on 25565, survival on 25566 and bungee on 25567

#

or what

lean trench
#

bungee on 25565

sullen dome
#

k, i'll try tho

eternal oxide
#

this is my test bungee config for two servers ```yaml
prevent_proxy_connections: false
listeners:

  • query_port: 25565
    motd: '&1Another Bungee server'
    tab_list: GLOBAL_PING
    query_enabled: false
    proxy_protocol: false
    forced_hosts:
    pvp.md-5.net: pvp
    ping_passthrough: false
    priorities:
    • lobby
      bind_local_address: true
      host: 0.0.0.0:25565
      max_players: 1
      tab_size: 60
      force_default_server: false
      remote_ping_cache: -1
      network_compression_threshold: 256
      permissions:
      default:
    • bungeecord.command.server
    • bungeecord.command.list
      admin:
    • bungeecord.command.alert
    • bungeecord.command.end
    • bungeecord.command.ip
    • bungeecord.command.reload
      log_pings: true
      connection_throttle_limit: 3
      server_connect_timeout: 5000
      timeout: 30000
      player_limit: -1
      ip_forward: true
      groups:
      md_5:
    • admin
      remote_ping_timeout: 5000
      connection_throttle: 4000
      log_commands: false
      stats: fc7ce220-2bdc-4548-a441-05aed7a01159
      online_mode: true
      forge_support: false
      disabled_commands:
  • disabledcommandhere
    servers:
    lobby:
    motd: '&1ElgarLs BungeeCord1'
    address: localhost:1
    restricted: false
    test2:
    motd: '&1ElgarLs BungeeCord2'
    address: localhost:2
    restricted: false```
lean trench
#

Yeah, that should work, just why is the port of the server's 1 and 2

#

just a placeholder or actually your config?

eternal oxide
#

my actual config

lean trench
#

Ah

dusty herald
#

I mean why not roflmao

lean trench
#

Well, isnt port 1 for TCP?

eternal oxide
#

neither is used

#

they are reserved but never actually used

lean trench
#

Aah

#

I personally prefer to do 25565 for bungee, and incrementing ports for the servers attached to it

eternal oxide
#

yep, thats the normal way to do it

sullen dome
#

with bungee on 65 and lobby on 66

#

no change

eternal oxide
#

bungee and lobby should both be on 65. your other server should be on 66

sullen dome
#

tf

#

hosting both on the same port? wtf

chrome beacon
#

Only bungee should be on 65

#

Don't let two servers be on the same port

eternal oxide
#

sorry I thought you ment in yoru config

sullen dome
#

yeah obv

#

nah

eternal oxide
#

query_port: 25565 and host: 0.0.0.0:25565

lean trench
#

bungee on 65, his lobby server on 66, and the other on 67 and so on

lean trench
#

not lobby

eternal oxide
#

yep

#

is your lobby server actually bound to localhost?

#

server-ip=127.0.0.1

#

in server.properties

velvet steeple
#

`package noobsanj.bestsanjesh.ir;

import java.util.Random;

import org.bukkit.ChatColor;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.AsyncPlayerChatEvent;

public class noobsanj implements Listener {


    
    
    
@EventHandler
public void onMessage( AsyncPlayerChatEvent e) {
Random rand = new Random();
int index = rand.nextInt(100);
e.getPlayer().sendMessage(ChatColor.AQUA + "NOOBSANJ " + ChatColor.DARK_GRAY + ">>" + ChatColor.YELLOW + "You are" + ChatColor.GREEN + index + ChatColor.YELLOW + "noob");
    






}

}`

sullen dome
#

well i fixed it

velvet steeple
#

hello how can i create a command for this ?

sullen dome
#

by changing query port in bungee config to 25565

#

why tf is it 25577 on default if it doesnt work lol

dusty herald
#

it's not

sullen dome
#

it was

#

in my config

velvet steeple
sullen dome
#

and i definitely didnt changed it

sullen dome
velvet steeple
sullen dome
#

isnt the docs tho, thats the wiki
my bad

velvet steeple
#

i am using translator

sullen dome
#

dude

velvet steeple
#

?

sullen dome
#

this explains how to create commands

velvet steeple
#

i am say i cant fix

#

find

sullen dome
#

what can't you find

velvet steeple
#

i say how to create command for events :\

#

and this is for just create a example command not for events

#

:\

sullen dome
#

wdym with commands for events

#

commands are completely different than events

velvet steeple
#

I want to create a plugin that will give me a random message if I use it

#

and i need events for this :

sullen dome
#

why do you need an event for a command?

#

tf

velvet steeple
#

:\

eternal oxide
#

you don;t need events for a random message from a command

sullen dome
#

yeah

velvet steeple
#

Because I want to make a percentage command

#

ok how to create it

#

package noobsanj.bestsanjesh.ir;

import java.util.Random;

import org.bukkit.ChatColor;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.AsyncPlayerChatEvent;

public class noobsanj implements Listener {


    
    
    
@EventHandler
public void onMessage( AsyncPlayerChatEvent e) {
Random rand = new Random();
int index = rand.nextInt(100);
e.getPlayer().sendMessage(ChatColor.AQUA + "NOOBSANJ " + ChatColor.DARK_GRAY + ">>" + ChatColor.YELLOW + "You are" + ChatColor.GREEN + index + ChatColor.YELLOW + "noob");
    






}

}

This is my class

#

and this is my main class
package noobsanj.bestsanjesh.ir;

import org.bukkit.ChatColor;
import org.bukkit.plugin.java.JavaPlugin;

public class onEnableDisable extends JavaPlugin {

@Override
public void onEnable() {
    
    getServer().getConsoleSender().sendMessage(ChatColor.DARK_GRAY + "[=-------------------=]");
    getServer().getConsoleSender().sendMessage(ChatColor.YELLOW + "Noobsanj by " + ChatColor.GRAY + ">>" + ChatColor.AQUA + "ATLANTISMC");
    getServer().getConsoleSender().sendMessage(ChatColor.YELLOW + "Discord Server" + ChatColor.GRAY + ">>" + ChatColor.AQUA + "");
    getServer().getConsoleSender().sendMessage(ChatColor.DARK_GRAY + "[=-------------------=]");
}

@Override
public void onDisable() {
    getServer().getConsoleSender().sendMessage(ChatColor.RED + "Noobsanj plugin has been disabled :(");
    
}

}

#

and this is my main class

sullen dome
#

    @Override
    public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
      int randomInt = ThreadLocalRandom.current().nextInt(100);
      sender.sendMessage(whatever your message is);
      return false
    }
#

thats basic

velvet steeple
#

ok wait

sullen dome
#

but really, just read how commands work.

#

public class onEnableDisable extends JavaPlugin {

i'll better say nothing

eternal oxide
sullen dome
coral sparrow
#

Not cmd

#

Register events too

#
    public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
      if(cmd.getName().eqaulIgnoresCase("test")) {
        sender.sendmessage("Test");
}
    }```

Then Register on plugin.yml
#

I mean just

commands:
  test:
tacit drift
#

can i get the chest location on inventorycloseevent if the inventory type is chest?

sullen dome
#

how can i make bungeecord now using real uuid's

tacit drift
#

i have a hashmap of all the chests with their location and a "id"

#

and i need to check the location of the chest they close out of (InventoryCloseEvent)

sullen dome
#

InventoryCloseEvent

#

fuck

coral sparrow
#

lmao

tacit drift
#

kek

sullen dome
#

:(

coral sparrow
sullen dome
#

yeah, just enabling ip forwarding lol, readed that like 1 minute ago, but ty

tacit drift
#

the player is not the chest

#

i would need to scan around him for chests

coral sparrow
#

um i*

#

When player Clos3s chest, Get Player loc

#

Check if Plyer Closed Chest and do i t

sullen dome
#

chests are entities right?

coral sparrow
#

idk

tacit drift
#

tile entities

tacit drift
#

oh

eternal oxide
#

On the inventory thats being closed

tacit drift
#

thanks

#

actually

#

i think i can use this

coral sparrow
#

yeh

eternal oxide
#

javadocs are your friend

coral sparrow
coral sparrow
minor garnet
#

does anyone know how to detect if a living entity has hit a block?

eternal oxide
#

what entity?

#

I don't know of any mob that hits blocks

minor garnet
#

armor stand

#

he is flying

eternal oxide
#

armorstands have no AI and won;t hit blocks

minor garnet
#

so how i detect if has next a block

eternal oxide
#

next block?

minor garnet
#

near**

eternal oxide
#

you are fully controlling the stand

minor garnet
#

is that a question?

eternal oxide
#

no, its a statement

minor garnet
#

tf

eternal oxide
#

You are controlling the stand, its upto you to decide what it does

minor garnet
#

eeh but i don't know how to detect if it is close to a block, so i know i will make a runnable

#

i think i can detect if velocity == 0

eternal oxide
#

you'd need to check its surrounding locations

#

if its moving you could raytrace to see if it collides with a block

minor garnet
#

I will see what I can

coral sparrow
summer scroll
#

How can I get a list of serialized locations from config?

quaint mantle
#

show how they are stored in config

wraith rapids
#

Location is ConfigurationSerializable so you can probably just give it a List<Location> and it should probably serialize it properly

#

you'll have to get it with getList or something and then cast it to List<Location>

eternal oxide
#

getLocation to get it back out

wraith rapids
#

it's a list

summer scroll
#

I have List<Location> and then just set it on the config.

wraith rapids
#

there's no getLocationList

eternal oxide
#

yep, as a List you'd have to use getList

quaint mantle
wraith rapids
#

unnecessary

#

locations are already serialized properly by default

eternal oxide
summer scroll
#
List<Location> spawnLocations = (List<Location>) data.getList(key + "spawnLocations");
``` like this?
wraith rapids
#

yeah

#

throw a @SuppressWarnings("unchecked") at it

summer scroll
#

okay, thank you very much

quaint mantle
#

Is there no method that replaces the watch method in DataWatcher? I dug, but I couldn't find it.

#

I want to do thisDataWatcher#watch(10, (byte)127);

eternal oxide
#

isn;t that second value supposed to be a boolean?

quaint mantle
#

hmm,

eternal oxide
#

not in there, thats out of date I expect

quaint mantle
#

Hmm

#

okay

#

but what method should I use instead of datawatcher#watch?

eternal oxide
#

what signature is on the watch method?

quaint mantle
#

connection.sendPacket(new PacketPlayOutEntityMetadata(npc.getId(), watcher, true)); i'm trying to do this 😉

#

MetaData packet

eternal oxide
#

yes, and when you type watcher.watch what does auto complete offer you?

quaint mantle
#

not offer me

#

watch

#

He doesn't offer me a DataWatch.

eternal oxide
#

Index 10 says its a boolean

lost matrix
#

In order to change the skin you need to respawn the npc or send packets that respawn the npc. The Metadata doesnt contain the skin.

quaint mantle
#

my npc already have skin

#

hmmmm okay

#

so what method should I use instead of DataWatcher#watch?

eternal oxide
#

oh you are trying to enable all the skin parts?

quaint mantle
#

yaaaa

#

bro

#

I already have skin xD

#

so I needed watch method

eternal oxide
#

then surely it shoudl be DataWatcher#watch(16, (byte)127);

#

not 10

quaint mantle
#

in 1.15.2 not working

#

watch method doesn't exists

#
            watcher.watch(It doesn't exists)(10, (byte) 127);```
eternal oxide
#

I have no spigot up so can;t test

quaint mantle
#

it doesn't exsits

eternal oxide
#

whatever it wouldn;t be 10 anyway

quaint mantle
#

ok

#

lettttts find method instead of DataWatcher#watch

#

thanks you but I can't access 😦

#

protected static final DataWatcherObject<Byte> bq;

#

okay i'll learn it@

#

can we create custom blocks using NMS ?

eternal oxide
#

eff you GitHub, they just changed the format for all personal access tokens, forcing everyone to update

quaint mantle
#

thanks you! I'll analyze and study the code you gave me.

#

awww wait

#

now I can access EntitySlime method!

#

so i can use entityslime's pathfinder yay

tribal holly
#
switch (container.getType()) {
                                    case CHEST:
                                        Chest chest = (Chest) container.getState();
                                        content = chest.getInventory().getContents();
                                        chest.getInventory().setContents(randomLoot(content, lootTable));
                                        chest.update();
                                        break;
                                    case BARREL:
                                        Barrel barrel = (Barrel) container.getState();
                                        content = barrel.getInventory().getContents();
                                        barrel.getInventory().setContents(randomLoot(content, lootTable));
                                        barrel.update();
                                        break;
                                    default:
                                        throw new IllegalStateException("Unexpected value: " + container.getType());
                                }```
Someone know why the barrel content are not set but for chest they are set ? (the methode randomLoot return a content and work for the chest)
#

and the case BARREL is trigger i checked

dry beacon
#

I'm trying to check if the player is holding a material which is in the yml file, for some reason the if statement doesn't work. Could someone help me out?

itemList = this.getCustomConfig().getList("repair.items");
Material mat = player.getInventory().getItemInMainHand().getType();
if(itemList.contains(mat)) {
// Do stuff
}
repair:
  items:
    - IRON_BLOCK
    - IRON_INGOT
tribal holly
#

you cannot test a string with a Material

coral sparrow
#

nah my bad

eternal oxide
#

.name()

dry beacon
spring hawk
#

holy formatting

spice juniper
#

ILikeToCode

#

What do you mean here?

minor garnet
#
    public void onPlayerDropItem(final PlayerDropItemEvent event) {
        final Item dropped = event.getItemDrop();
        final Player dropper = event.getPlayer();
        event.setCancelled(true)```
how i remove the item dropped of player inventory ? in the same slot he dropped from
quaint mantle
#

One way to do it, all be it not the best: Summon a bolt of lightning on the location of the dropped item

dry beacon
quaint mantle
minor garnet
#

for if i am going to compare a slot and not have the error of defining a variable instead of another

#

and don't change the variable for another one anyway

quaint mantle
#

But your method is subject to change? you are cancelling it, aren't ya?
I might be completely wrong but I dunno

#

looks weird

minor garnet
#

no

spice juniper
#

But after putting an empty string after the ChatColor.BOLD it still not gives me a bold text

minor garnet
tribal holly
#

what do you mean by allow settings ?

#

so i don't need to update ?

#

so why it work with chest and not for barrel ?

#

and if i remember correctly the state of a block need an update to apply changes done on it

spice juniper
#
p.sendMessage(
net.md_5.bungee.api.ChatColor.of("#8596ab") +
"[" + net.md_5.bungee.api.ChatColor.of("#486d9c") +
"TEST" + net.md_5.bungee.api.ChatColor.of("#8596ab") + "]" +
net.md_5.bungee.api.ChatColor.BOLD + ""
);
tribal holly
#

seems like you don't know what your saying

#

remove update never change the state of the block

spice juniper
#

But I dont want any text after it

tribal holly
#

even for barrel ?

#

well

quaint mantle
#

Hi, I'm trying to find a way that when I die I lose all items except a diamond pickaxe, can anyone help me?

#

Basically I want only the pickaxe to remain in my inventory after death!

ivory sleet
#

I think you can modify PlayerDeathEvent#getDrops but if not just set keep inventory and remove all ItemStacks which aren’t a pickaxe

quaint mantle
#

How?

#

ty

#

Where can I learn spigot api, I would like to deepen my knowledge!

#

Not work

vague oracle
#

Im pretty sure you can just set the itemstack type to air, in the early versions.

quaint mantle
#

An

#

Ty

#

Where can I learn spigot api, I would like to deepen my knowledge!

slim magnet
#

Hello, when I make a slime have no AI, and setGravity(true), gravity doesn't work. How do I fix this and is there an easy workaround?

slim magnet
#

you cant really learn from just the docs, loom up a tutorial

#

look

#

Nah

#

java docs is for references when you already know what you're doing

#

if you're just starting out, a tutorial would be more useful

woeful crescent
# quaint mantle Where can I learn spigot api, I would like to deepen my knowledge!

Love the video or need more help...or maybe both?
💬Join us on Discord: http://discord.gg/invite/fw5cKM3
Thank you for tuning in to this episode of TheSourceCode! ❤️

If you enjoyed this video make sure to show your support by liking , commenting your thoughts, and sharing for all your friends to see and learn!

All code is available on Github:
...

▶ Play video
#

He has a nice playlist, and you can skip through the ones that you don't need.

ivory sleet
#

Navigating should be trivial, we have a searchbar and features like showing all classes in a package etc. Then spigot forums is a thing and a wiki site also exists nonetheless.

split panther
#

we have javadoc

ivory sleet
#

Did you even take the time to scroll up?

kind coral
#

if i try adding an item to a inventory and the inventory is full will it break? ( like give errors )

proper notch
#
Returns:
A HashMap containing items that didn't fit.```
summer scroll
crude hound
#

Hi, can you say me what is the name of an {} to set it in an nbt?

#

something like that

ivory sleet
#

What library is that

crude hound
#

actually my code is like that :

ivory sleet
#

Oh if you wanna set an array you’d have to use NBTTagArray

#

And create one of those

quaint mantle
#

new NBTTagArray

ivory sleet
#

I think at least

crude hound
#

thanks

sharp bough
#

so i have this commands, but i want to have like /command args args1 args2 args3, if they only do command then a gui opens, and thats done, but,
i also want to make like shorcuts, for example command args args1 args2 opens the args2 gui, so i would normally set if command.args[..2] == X then open gui, but if i do that with every arg then im gonna have a lot of code

crude hound
wraith rapids
#

you don't

#

you update to 1.16

crude hound
#

no because I need to setup it on a server with multiple version from 1.8 to 1.16 so I need it in 1.8

wraith rapids
#

then install viabackwards

#

let's you play on old ass clients on newer servers

crude hound
#

I don't want re-create my code on all version when there is a new one

solemn shoal
#

can one send block update packets async?

#

excuses excuses

wraith rapids
#

iirc most packets are synced to main anyway before being sent but yeah, you can enqueue them on any thread you like

solemn shoal
crude hound
#

yes but when I use net.minecraft.server.v1_8_R3 I got a problem

wraith rapids
#

and no you do not need to fucking "re-create your code" every time there's an update

solemn shoal
#

lol just replace all lol

wraith rapids
#

maybe if you used a version that isn't half a fucking decade old you could use the API instead of nms

crude hound
#

It work with the api?

solemn shoal
#

i mean

wraith rapids
#

the api is very forwards compatible yes

solemn shoal
#

i have a 1.16.5 server that allows you to join with 1.4

wraith rapids
#

i don't remember the last time i've had to go back and change something because of an update

topaz seal
#

How to manage/balance load or high amount of traffic from crashing the server ie. the member more than 400+ are not able to join and the error is showing "Server is Offline" but server isn't offline from host side?

solemn shoal
#

@crude hound

crude hound
#

yes?

solemn shoal
#

look at that link

crude hound
#

yes

#

but this version is used because I use it for pvp so it's better to dev in 1.8.9

digital rain
#

ok so hello again

#

i have a question as always... any ways to display another item in hand while on hotbar a different item is selected

wraith rapids
#

no

digital rain
#

:(

ivory sleet
#

Maybe by modifying the minecraft client

digital rain
#

and any ideas so that when the map is my hand it doesnt actually show it up, since thats a problem im still facing

wraith rapids
#

why does it have to be a map

digital rain
#

too complicated idk

wraith rapids
#

you want a map but you are literally removing everything from it that makes it a map

#

you might as well use a stick

sharp bough
#

is the args.lenght == 2 necessary? can i do
if(args[0].equals(something) && args[1].eqauls(somethingelse)) without checking if the args.length is 3?

ivory sleet
#

Yes

digital rain
wraith rapids
#

if you try to access an index that doesn't exist, you explode

#

if args.length == 1 and you try to get args[1] you explode

civic tapir
#

How do I set a custom items durability? I want to have a hoe with a custom properties, but only has the properties at a specific durability

civic tapir
#

yea what would I put in

sharp bough
#

itemMeta.setdurability

civic tapir
#

when I do meta.setDurability there isnt any

sharp bough
#

its not the meta

#

the itemstack

maiden thicket
#

it deprecated

civic tapir
#

yea

crude hound
#

So how I spawn a nitwit in 1.8.9? (without glitched villager gui)

sharp bough
#

so

maiden thicket
#

use this instead

#

i think

civic tapir
#

then what would I put

sharp bough
#

wdym

#

follow the docs

#

we cant tell you exactly what to type

maiden thicket
#

i think

sharp bough
#

yea no not that

#

how to execute a class based on the args

sage swift
#

make sure you return after checking length 0

sharp bough
#

i wwas thinking, can you call a class based on a variable?

#

like

#

/command test test1
new AllClasses.test

#

or

sage swift
#

(CommandSender, String[] args)

sharp bough
#

ne AllClasses.test.test1

#

lol

#

if theres a doc explaining this

#

share the link

#

i cant find it myself

#

i dont even know how to call it

#

"replace args with classes name" is not a thing lol

quaint mantle
#

just a question so i have bungee.yml and plugin.yml in my plugin which one does bungee take first the plugin.yml or bungee.yml?

#

`package plugins.romeo.healsucide;

import org.bukkit.plugin.java.JavaPlugin;
import plugins.romeo.healsucide.commands.Die;

public final class HealSucide extends JavaPlugin {

@Override
public void onEnable() {
    System.out.println("Your Plugin has started successfully");
    getCommand("die").getExecutor(new Die());
}

}
`

#

am i doing smthing wrong here

#

i dont think so why

#

it says 'getExecutor()' in 'org.bukkit.command.PluginCommand' cannot be applied to '(plugins.romeo.healsucide.commands.Die)'

#

ty

quaint mantle
#

didnt notice that

pulsar zenith
quaint mantle
#

Ohhh

#

Lmao small

#

yea u cant get something that doesnt exist xd

#

Sorry for disturbance, Thnx mates

#

its okay

solemn shoal
#

whats the cheapest way to check if a block is of a certain type?

weary geyser
#

if(block.getType() == Material.BLAH)?

solemn shoal
#

can i just do <Block> instanceof BLAH?

#

wait no that wouldnt make sense

weary geyser
#

Like what are you trying to do?

ivory sleet
#

lol spacedash

solemn shoal
#

trying to check if a block has surrounding transparent blocks

sharp bough
ivory sleet
#

why in the main class

weary geyser
#

^

sharp bough
#

you could even do check(stone) and replace everything to upper case and add _ and material etc

weary geyser
#

And why is what i sent not efficient

sharp bough
sharp bough
#

like i think you can place it anywhere

sharp bough
weary geyser
#

That is still not more efficient speed wise

sharp bough
#

yea no it would brake

#

just check(Material.STONE)

solemn shoal
#

hm

#

what is Material#isSolid()?

sharp bough
solemn shoal
#

i mean performance

weary geyser
sharp bough
#

ooooh

#

yea on idea about performance lol

solemn shoal
#

ah

#

so glass isnt solid

weary geyser
#

No

solemn shoal
#

aight

weary geyser
#

What

sharp bough
#

nvm

quaint mantle
#

Hello. I am trying to fix plugin with no success. The plugin is abandoned so I can't contact the creator so I am kinda on my own in this. This plugins is MoreFish. It allows to modify fishes so you can have more types and stuff

#

Now I can set a biome condition to each fish so they can be catched in certain biome

#

The problem is that this one condition does not work

#

I found the piece of code that is faulty tho

#
    override fun loadFrom(section: ConfigurationValueAccessor, path: String): Set<FishCondition> {
        return if (section.contains(path)) {
            section.strings(path).map {
                it.split(DELIMITER).let { tokens ->
                    fishConditionFrom(
                        id = tokens[0],
                        args = tokens.subList(1, tokens.size)
                    )
                }
            }.toSet()
        } else {
            emptySet()
        }
    }

    private fun fishConditionFrom(id: String, args: List<String>): FishCondition {
        return when (id) {
            "biome" ->
                BiomeCondition(args.map { Biome.valueOf(it.toUpperCase()) })
            else ->
                throw IllegalStateException("There's no fish condition whose id is '$id'")
        }

    }

    companion object {
        private const val DELIMITER = '|'
    }
}
#

The problem is that it is empty

#

In the config I can set the condition like this

condition:
  - "biome|ocean|warm_ocean|deep_ocean|"
#

This is the only broken thing in the whole plugin so it would be nice if someone could help

#

For some reason the if statement where it splits using | throws empty string

#

Which ends up with error when trying to set biome condition in config

pulsar path
#

how can I set the rotation of a minecart?

quaint mantle
#

You can just teleport it /tp x y z pitch yaw, the yaw will be ignored for minecart

pulsar path
#

thx

quaint mantle
#

Oh wait is yaw the rotation?

#

I thought yaw is vertical rotation

#

Okay yaw is the left right rotation actually

#

I am not native english speaker sorry

maiden cape
#

Does this method include the entity the function is used on?

severe night
#

why it is deprecated ?

maiden cape
#

thank yoou

severe night
#

thanks ❤️

kind coral
#

any code examples for iterator?

#

what should i use???

#

no since i also need Generator to store

#

and GenPlayer is the owner of the Generator, so i can't

#

yes?

#

i need to create new ones

#

since players can have multiple ones

#

what if i merge GenPlayer and Generator into one class and use a List instead?

#

how much are you typing man xd

slim magnet
#

Hey how do I remove pathfinder goals from a slime to make it not attac or move

#

Attack

livid tundra
#

how do you make a mob walk to a place

kind coral
#

like setAI(true/false) idk

slim magnet
#

@livid tundra That makes it not be affected by gravity

#

No I cant use setAI

livid tundra
#

setAware

kind coral
#

@quaint mantle wtf are u writing man

livid tundra
#

how do you make a mob walk to a place

#

would summoning an invisible, invurnerable armor stand above that place and setting the mob's target there work?

opal juniper
#

Is there a way to make custom monument type things?

livid tundra
#

how do you make a mob walk to a place
would summoning an invisible, invurnerable armor stand above that place and setting the mob's target there work?

karmic sapphire
#

Greatings everyone

sage swift
#

Hello.

karmic sapphire
#

cant any one tell me how to resolve this error

#

(CreepyCoder.AdventurePack.Core.Main.Plugin is in unnamed module of loader org.bukkit.plugin.java.PluginClassLoader @f2ce57b;

queen dragonBOT
karmic sapphire
sage swift
#

probably wrong plugin.yml main class

karmic sapphire
#

package CreepyCoder.AdventurePack.Flowers.Main;

import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

import CreepyCoder.AdventurePack.Core.YAMLManager.YAMLManager;
import CreepyCoder.AdventurePack.Core.YAMLManager.YAMLSettings;

public class Plugin extends JavaPlugin {

public YAMLManager YAMLManager = new YAMLManager(this);
public YAMLSettings YAMLSettings = new YAMLSettings();

private Plugin YAMLManager2 = (Plugin) Bukkit.getServer().getPluginManager().getPlugin("CreepyCoder.AdventurePack.Core"); 

@Override
public void onEnable() {
    
    //YAMLManager.getSettings();
    
}

@Override
public void onDisable() {

}

}

opal juniper
#

Like, lets say custom structures in order to make a custom boss battle

young knoll
#

Sure

#

Bukkit has a BlockPopulator API but last I checked it was a bit broken

livid tundra
#

how do you make a mob walk to a place
would summoning an invisible, invurnerable armor stand above that place and setting the mob's target to the armor stand work?

young knoll
#

Other options include the ChunkLoadEvent, ChunkPopulateEvent, or NMS

slim magnet
#

How do I get an instance of EntitySlime?

kind coral
#

HOOOLY cow thanks. but i really didn't want to get spoonfeeded ahah

opal juniper
#

NMS ><

#

but yeah

slim magnet
#

What do I do

sharp bough
young knoll
#

Kotlin

young knoll
opal juniper
young knoll
kind coral
#

for this tho i would need to make my checks for item right?

livid tundra
#

is there a method or something?

young knoll
#

You could write a custom Pathfinder with NMS

#

Or a certain forks pathfinder API

livid tundra
opal juniper
#

oh no

young knoll
#

net.minecraft.server

opal juniper
#

if you don't know what it is don't use it

#

<

livid tundra
#

how do you even move a mob, such as make it walk forward one block

young knoll
#

You can teleport it or mess with velocity

livid tundra
#

hmm

young knoll
#

But the proper way is a pathfinder

snow nova
#

Hi, noob question here so sorry for that i just started today.
I want to make a plugin that constantly shows u how close are you to the world border above the hotbar. I made a command that does that but im not sure how to make it work without a command. like that it constantly runs all the time for everyone and displays above the hotbar

livid tundra
#

so the armor stand thing?

sharp bough
#

cant you teleport an entity like 0.1block north?

young knoll
#

Sure?

sharp bough
#

so it "moves"

opal juniper
snow nova
#

thanks I will look into it

livid tundra
young knoll
#

I don't actually know what's called internally for that

#

CBA to look

livid tundra
sharp bough
young knoll
#

A simple move to location pathfinder would be handy tbh

livid tundra
#

could you explain what the solution was? I'm new to spigot, and I didn't really understand

sharp bough
#

this one seems to be marked as solved

tardy delta
#

how can i get the persistent data container of a block that have been placed down before?

sharp bough
#

tbh i have no idea what that is

#

lol

young knoll
#

A block or a tile entity?

tardy delta
#

block

#

chest

young knoll
#

So a tile entity

sharp bough
young knoll
#

block.getState.getPersistantDataContainer iirc

sharp bough
#

if thats your question

tardy delta
#

someone said that I could save it in an eventhandler or something

quaint mantle
#

Not work

livid tundra
quaint mantle
#

When i death I don't have pick

young knoll
#

Blocks don't store extra data

#

Tile entities do

quaint mantle
#

Oh now work

#

sorry

livid tundra
#

does EntityChangeBlockEvent happen for tile entitys?

young knoll
#

Doubt it

#

I don't think any entities can change them

tardy delta
#

well but it's for my command to lock a block again, when a player executes /protect and rightclicks a container his uuis is placed inside a hashset and an eventlistener continue checks if a player if in that hashset and then applies a lock if that's true

young knoll
#

I've told you how to do it

livid tundra
young knoll
#

Players generally don't fire that event

#

Because they have their own events

livid tundra
#

there isn't a PlayerChangeBlockEvent

young knoll
#

BlockPlaceEvent