#help-archived

1 messages · Page 199 of 1

subtle blade
#

The isNewChunk() ensures it's a chunk just being generated so it will remove them from zombie villages

neon epoch
#

how much lag does this produce? (not very much im assuming)

subtle blade
#

No not really

#

The events are going to get called regardless of whether or not someone is listening to them

neon epoch
#

That's true, thanks for your help!

edgy cove
#

Hey
Do anyone know
how to commit a ECLIPSE project in GITHUB without making it inside the folder of the project in github?
hahhaa
Its a Maven Project btw

stable roost
#

does anyone know if there is an issue with creepers not being scared of cats in spigot 1.16.1? i've built a farm that isn't producing 6x the amount as its vanilla counterpart. mob spawning in spigot, in general, is fine. the creepers are just not running to their doom and despawn instead. thoughts?

#

what do you mean that there should be an issue? are you saying, based on the screenshot (i don't understand the code), that the code alludes to there being a problem?

#

ok, so based on the pathfinding code, there isn't an issue?

neon epoch
#

I think so, I'm currently trying to cancel EntityItemPickupEvent on villagers, to prevent them from being willing to breed in the first place.

bold anchor
#

mobGriefing can be turned off.

neon epoch
#

trying to avoid it, because i still want mob griefing otherwise

timber thorn
#

So, another question regarding best practices:

wise flame
#

if the entity associated with picking up the item is a villager, set cancelled to true.
Do note that villagers that already picked up food will still breed.

timber thorn
#

If I want a user to enter a color/format code in the config and I am parsing that string, what should I do if somebody enters something other than colors?

#

Extract the color information from what the user entered? Discard the input and use a default?

wise flame
#
public void onEntityPickupItem(EntityPickupItemEvent event){
  if(event.getEntity() instanceof Villager) event.setCancelled(true);
}
neon epoch
#

You can do

ChatColor.translateAlternateColorCodes('&', StringToTranslate);
timber thorn
#

You can do

ChatColor.translateAlternateColorCodes('&', StringToTranslate);

@neon epoch I know I can translate it, that's not what I am after.

bold anchor
#

Translate, strip check length

wise flame
#

They want to know what to do if an invalid color is entered

#

I think?

timber thorn
#

Well no

#

Let me try to explain better

neon epoch
#

whats the difference between
getEntityType() == EntityType.VILLAGER

AND

event.getEntity() instanceof Villager

bold anchor
#

Not terrible much

timber thorn
#

So I want the user to enter a color that gets used frequently in messages and gui and stuff, basically a way to customize the gui.

#

Which means that string they entered will get copied often

#

So if they enter "&6", that should not be an issue to copy. If they enter "&6sometext&lblabla", that should not work. I know how to strip the color, I want to use a regex to detect if the input is valid. The question is what should I do if the input is invalid like above. Should I just shorten it to "&6&l", should I use a default, should I discard the input entirely and use no color at all? (of course I'd inform the user)

wise flame
#

Discard and tell the user

#

Honestly

neon epoch
#

@rich quest go into your server files and delete the world's name, probably called "world", and it is in a folder in the main directory of your server

opal marsh
#

@frigid ember just out of curiosity, why is instanceof faster? Isn't the property check with an emum just an integer comparison?

subtle blade
#

wat

#

it returns a constant

neon epoch
#

How can i change villager breed willingness?

subtle blade
#

Entity#getType() and an instanceof check do two very different things

opal marsh
#

Right, that's why I was a bit confused lol

subtle blade
#

EntityType == vs Entity instanceof serve two separate purposes. While entity instanceof Zombie will encompass villager zombies and husks, entity.getType() == EntityType.ZOMBIE will not

#

instanceof ensures that a type is or is a subtype of the type on the receiving end of the instanceof

wise flame
#

@neon epoch You might be better off trying to cancel their breeding attempts

wraith thicket
#

Zombie is extended by Drowned, Husk, PigZombie, ZombieVillager.
So checking for instance if Zombie can be any of those.
However, EntityType.ZOMBIE is just the actual zombie
Well, covered by Choco already, RIP

opal marsh
#
  ...
  public EntityType getType() {
    return EntityType.CHICKEN;
  }
}```
@frigid ember
wise flame
#

A quick search shows that there's no easy way to do it. You'd probably have to deal with NMS unless I missed something.

opal marsh
#

doesn't seem like there's anything much going on

#

pretty sure it really is just an int comparison

neon epoch
#

@wise flame i did that, successfully for that matter, but they are still willing to breed, and still giving off particles showing such

wise flame
#

the hearts don't mean they're breeding

#

sometimes they mean they're gossiping

neon epoch
#

correct

wise flame
#

Whenever a villager tries to breed, try calling villager.setBreed(false);

neon epoch
#

but theyre constantly giving off particles because theyre willing to breed, but their EnterLoveModeEvent is being cancelled, so they just try again

#

ok

#

ill give it a shot

wise flame
#

should work

#

We don't see baby villagers trying to have children and they have that flag set

#

lol

#

be sure you want this though

#

you probably can't reverse this easily

stable roost
#

@frigid ember when i place a cat and creeper in that way, i get that behaviour too so no issue with that. however, when i build a creeper farm, that works as intended in vanilla, it doesn't in spigot. some creepers happen to wander off to their doom but most don't. it's as though they don't register the cats.

wise flame
#

@neon epoch above warning

neon epoch
#

wdym you cant reverse it easily

opal marsh
#

@neon epoch a shenanigan you could try is emptying the inventory of the villager because iirc they need a certain amount of food to breed

wise flame
#

I'm pretty sure canBreed() is saved

#

or whatever the thing is called

#

lol

neon epoch
#

Ok, here's where I'm at, I want to clear the villager's inventory whenever they pick up anything, or try to breed, but I can only get their inventory if it is an AbstractVillager object, how do I take e.getEntity(), and change that to an AbstractVillager?

subtle blade
#

If it's of that type, you can cast it as such, schmiffy

#

AbstractVillager villager = (AbstractVillager) entity;

neon epoch
#

Eclipse is telling me that AbstractVillager cannot be resolved to a variable, I have it imported, and everything.

subtle blade
#

on what version?

#

Villagers were abstracted out like that in like 1.13. Whenever the wandering trader was introduced

neon epoch
#

1.16

grim halo
#

Why would you want to downcast?

neon epoch
#

?

grim halo
#

Villager extends AbstractVillager

neon epoch
#

Oh, because I cannot access its inventory unless it is abstractvillager

grim halo
#

So if you check if its of type Village you should just cast to Villager

#

Wait that doesnt make sense. Villager extends AbstractVillager that means it inherits every method

frigid ember
#

i was trying to make a spigot server but it says there is another program trying to open the files at the same time

neon epoch
#

So do i need to make a villager object that is the event entity casted to villager, then go from there?

grim halo
#

@frigid ember Whats the exact message?

#

@neon epoch Yes i would try just using the Villager interface. Although i find your bug weird.

frigid ember
#

java.lang.RuntimeException: java.io.IOException: The process cannot access the file because another process has locked a portion of the file
at net.minecraft.server.v1_16_R1.MinecraftServer.loadWorld(MinecraftServer.java:345)
at net.minecraft.server.v1_16_R1.DedicatedServer.init(DedicatedServer.java:219)
at net.minecraft.server.v1_16_R1.MinecraftServer.v(MinecraftServer.java:810)
at net.minecraft.server.v1_16_R1.MinecraftServer.lambda$0(MinecraftServer.java:164)
at java.lang.Thread.run(Unknown Source)

neon epoch
#

So why can I not cast e.getEntity() to villager

lofty meadow
#

Hello!

void sendTitle(@Nullable String var1, @Nullable String var2, int var3, int var4, int var5);```
What do `var3`, `var4` and `var5` for? Which delay, which ...?
#

Ok, thanks!

grim halo
#

@frigid ember Weird. Did you try to start the server before? Try restarting your pc

lofty meadow
#

But why did you respond extremely fast like you know I will ask about it? 😄

grim halo
#

@neon epoch You can cast Entity to Villager if you have checked it before

neon epoch
grim halo
#

That is not a valid java statement

neon epoch
#

whats wrong about it?

#

if you want me to assign that value to a villager object, i can, the error will still be the same

grim halo
#

You need to define a new variable that stores the casted object

#

Why cant you just access the inventory with Villager#getInventory

neon epoch
#

Im not sure why, but eclipse isnt importing villager.

#

thats why these issues are happening

grim halo
#

Does Villager override the getInventory method?

wraith thicket
#

He suggested that because that's what was asked for ...

wise flame
#

So. I'm working on figuring out how to delete a world without multiverse.
I know that I need to unload the world and make sure to remove my references to it so garbage collection eats it, then delete the world file, then make a WorldCreator to make a fresh overworld
What happens to players in the world?
How do I make sure players will spawn in a newly created overworld by default?

grim halo
#

@neon epoch define a new variable and post the eclipse warning pls

neon epoch
#

I had things double imported, and i had imported both abstractvillager and villager, for whatever reason its fixed

grim halo
#

@wise flame If you unload a world then it would make sense that every player in this world gets thrown to the server spawn. If not they get probably just kicked

#

@neon epoch Let your IDE handle the imports. I have not imported packets by hand for ages (last time when i worked with OpenGL srtatic wrapper)

frigid ember
#

How would I get the location to the right of a player

neon epoch
#

ok thanks

grim halo
#

You first have to define "right".
So you can get the direction the player is looking at -> convert to BlockFace -> get next 90° BlockFace (rightFace)
-> get Block of players feet -> Block#getRelative(rightFace)

frigid ember
#

Ok ty

timber pike
#

Is it bad practice to use commandblocks to store literal strings?

#

I don't see any drawbacks but im not sure

neat orbit
#

is anybody experienced with votingplugin and know how to do cummulative rewards ?

#

u don't have to be experienced lol just do u know how to do cummulative rewards

neon epoch
#

I have no idea why this isn't working, to preface, I'm trying to prevent my players from breeding villagers. When I cancel EntityEnterLoveModeEvent, villagers should stop looking at each other, and giving off heart particles, correct?

neat orbit
#

mrschmiffy idk about that but have you tried setting the chunk limit of villagers?

#

or maybe try disabling the baby villager mob

neon epoch
#

or i just kill the baby villager as soon as its spawned. ill give it a shot, thanks.

neat orbit
#

sounds time consuming to me

grim halo
#

@timber pike What do you mean by that... If you program a plugin you should never have to save Strings in command blocks. That would be a very bad practice.

silent pulsar
#

Hello, quick question, is it possible to have a method executed rather than a command that executes our method, because it's really not clean to do like that. If this is not possible, is it possible to add this feature to the bungee api? (I can make an issue on github if needed)

timber pike
#

oh

#

ok lol

#

What do you recommend I do?

#

I'd rather not read from a local file unless that's my only option

grim halo
#

@silent pulsar Pls elaborate. A command is literally a method.

silent pulsar
#

Yes, but we have to register it in the .yml plugin.

grim halo
#

@timber pike What do you want to achieve?

silent pulsar
#

and create an class witch implement CommandExecutor
it's not clean to do that :/

timber pike
#

Im storing item meta in a command block then giving the item to the player based on what it is in the command block so a command block might contain
crossbow true true false BINDING_CURSE 1

silent pulsar
#

it's not clean to do that :/

grim halo
#

@silent pulsar There are a lot of frameworks that let you register commands wihtout the plugin.yml
I for example use aikars ACF (Annotation Command Framework) its a bit hard because you need to have more
java experience but that would be a "clean" way. (Although i dont understand why the default method is not "clean")

#

@timber pike And you want to do that per chunk or why do you need to store it in a command block?

timber pike
#

well its just easily editable in game, and its easy to link up with a button since right now the command block is just ~ ~-10 ~ away

#

i just dont know if its bad to do

grim halo
#

I have never ever seen anyone do that and you should def avoid command blocks on a production server...

timber pike
#

lol ok

#

thank you

grim halo
#

You can however use signs or a book if you want to edit stuff ingame... Also the normal way would be writing commands to interact with your plugin

neon epoch
#

I've seen anvils too, then you just get the itemmeta of the object, and get the name

grim halo
#

You cant store data in anvils

neon epoch
#

Oh I was thinking of a temporary way to have the user enter a string not through a command, sorry

timber pike
#

signs would work i guess

grim halo
#

Oh yes. Thats possible. But a bit complicated

timber pike
#

im just implementing a kit sort of system im not sure how to link one button to another command

#

but if i know that the sign is going to be ten blocks below the button or one block above its easy to link them together

grim halo
#

You coudl just use the PlayerInteractEvent and check if he clicked a button. This way you can add functionality to every button you like

timber pike
#

yeah i am

#

but how do i know what button goes to what

#

does that make sense?

#

all i know is that its a stone button

grim halo
#

Or even better you just place a chest below the button and then copy the chest content into the player inventory

timber pike
#

:o

#

very smart

grim halo
#

:p

timber pike
#

also while you're here

#

is there a reason the spigot community uses yml instead of json?

#

or is that a java thing

grim halo
#

Spigot has a build in FileConfiguration api that uses yml
I for my part only use json and the provided Gson from google that is also build in

timber pike
#

👍

grim halo
timber pike
#

any reason why it wouldn't be for production?

#

though yeah this is only going on a private server

grim halo
#

So you place a sign on top of your chest with a secret code on it.
This way you can just click a button and check 4 blocks below for a sign and check the code
If it is right you go on block lower and get the chest content.

This way you prevent random ppl from placing a chest 5 blocks below to just copy every content

timber pike
#

mk

grim halo
#

But that is still NOT safe. Someone with a wallhack can just read the sign

timber pike
#

yeah its fine the risk is tolerable to the project

grim halo
#

Ok

timber pike
#

thanks a lot lol

grim halo
#

np

subtle blade
#

Shouldn't cater to hacked clients

#

They're cheating. That's not something you can predict

#

If they can cheat in the vanilla game, expect them to cheat your plugins too

grim halo
#

Ah you can use §e§a§e§a§e CODE etc as the color codes are all hidden i think.
The player would only see the yellow CODE and would not be able to reproduce the full String

subtle blade
#

Not post-1.16

#

it's not really supported encouraged pre-1.16 either tbh

grim halo
#

I mean the proper way would setting a persistentDataTag on the chest anyway but if he wants a quick simple solution this is fine

#

ish

neon matrix
#

He is just making a button that give the items in a chest?

gusty comet
#

How can i Log an Error in Bungeecord?

#

oh i figured it out lol

hollow thorn
#

But that is still NOT safe. Someone with a wallhack can just read the sign
@grim halo cant you just lock the chest

sturdy oar
#

If i have a TNT block, is setting it to air and spawning a primed tnt the only way to "activate" it?

hollow thorn
#

you could set the block above it to fire

#

or a redstone block

sturdy oar
#

...

#

that's even more stupid

hollow thorn
#
                                               @Override
                                               public void run(){
                                                   loc.add(loc.getDirection());
                                                   DustOptions eee = new DustOptions(Color.fromRGB(0,255,0),1);
                                                   world.spawnParticle(Particle.REDSTONE, loc, 0,eee);
                                                   if(loc.getBlock().getType()!= Material.AIR)
                                                     cancel();
                                                   
                                                     for(Entity ent : getEntitiesByLocation(loc, 0.545f)) {
                        if(ent instanceof LivingEntity) {
                            if(!(ent.equals(me)))
                            ((LivingEntity) ent).damage(10, me);
                            ((LivingEntity) ent).setFireTicks(10);
                            
                        }
                        
                    }
                                               }
                                           }.runTaskTimer(Bukkit.getPluginManager().getPlugin("StaffWeapon"), 0L, 20L);``` when i do this instead of the loc going forward it either stays in the same space ofr has a wierd extended spasm
#

...
@sturdy oar there might be a tag for ignited?

sturdy oar
#

there is TNTPrimed class

#

but that is for entities

#

not for blocks

crimson sandal
#

Here's a (potentially dumb) question, what does PAIL actually stand for when renaming fields/methods? 😄

subtle blade
#

This is what vanilla does

            a(world, blockposition, (EntityLiving) entityhuman);
            world.setTypeAndData(blockposition, Blocks.AIR.getBlockData(), 11);```
#

(a being a method to summon a primed tnt entity and play the sound)

sturdy oar
#

so first it summons it, then it sets block to air?

subtle blade
#

So, yes...

sturdy oar
#

oh ok cool

subtle blade
#

Yes, though order of operations doesn't really matter

hollow thorn
#

loc.add(loc.getDirection()); is this how to raycast

#

because it isnt working

subtle blade
#

There are various ray-casting methods

#

@crimson sandal I don't think there's really an official definition. I've always believed it to be "Please Add In Later"

hollow thorn
#

loc = loc.add(loc.getDirection()); works but loc.add(loc.getDirection()); doesnt

limber forge
#

where can i see how many posts on spigotmc i have?

#

i dont see th like post on my profile

subtle blade
#

On your profile, left hand side under your profile picture, "Messages"

limber forge
#

only messages

#

ahhh

#

and how can i get more messages?

subtle blade
#

forum posts. Though don't go around posting random nonsense, that's post farming ;P

#

Try to actually be contributory to threads. Help others in Spigot Plugin Development or Spigot Help, etc.

limber forge
#

okay thx

crimson sandal
#

@subtle blade That makes sense I guess 😄

subtle blade
#

Was my best estimate as to what it meant but I'm sure md would know

#

I've just not cared enough to ask lol. Please Add In Later at least made sense to me in my mind

#

It could be that he wanted some synonym to "Bukkit" and figured "PAILS!"

crimson sandal
#

Lmaooo I think I prefer that 😄 😄

sturdy oar
subtle blade
#

Yeah, you have a runtime exception

sturdy oar
#

cool to know

#

i was running 1.8.8 on java 11

#

🤣

#

1.9+ i think

#

but im not sure

hollow thorn
#

how do i get the weather of a location

timber pike
#

i think the entire server has the same weather

sturdy oar
#

no

#

i mean

#

yes but no

timber pike
#

wdym

#

i mean in a snowy biome it'll snow

sturdy oar
#

if it's on a mountain it could be snowing

timber pike
#

but its technically "raining"

sturdy oar
#

how do i get the weather of a location
@hollow thorn world.isThundering()

#

something like that

#

or isRaining

subtle blade
#

right. if it's raining, the entire world rains

timber pike
#

^^

violet aspen
#

hey how do i register an event in the onEnable () method if it is in the same class?

hollow thorn
#

for some reason i cant get the ifRaining thingy i can only get the duration of the weather

#

hey how do i register an event in the onEnable () method if it is in the same class?
@violet aspen this

sturdy oar
#

hey how do i register an event in the onEnable () method if it is in the same class?
@violet aspen this

violet aspen
#

i have

sturdy oar
#

show code

hollow thorn
#

or isRaining
@sturdy oar isRaining doesnt exist

#

i cant find anything to check if it is raining

timber pike
#

getServer().getPluginManager().registerEvents(this, this);
@violet aspen i think like this

violet aspen
#

i have

hollow thorn
#

PluginManager pm = Bukkit.getPluginManager();
pm.registerEvents(this, this);

timber pike
#

hrm does your class implement Listener?

violet aspen
#

yes

timber pike
#

it should implement both Plugin and Listener?

#

^^ decorator?

hollow thorn
#

before them

#

sory ev

violet aspen
#

but it still doesn‘t work

timber pike
#

public and void?

hollow thorn
#

do you recieve an error

violet aspen
#

yes

timber pike
#
@EventHandler
public void onBlockDestroy(BlockBreakEvent event) {}```
violet aspen
#

no

timber pike
#

they look like that?

violet aspen
#

yes

timber pike
#

can i have a pastebin lol

violet aspen
#

wait

sturdy oar
#

i think this is "rain"

#

but they call it storm

timber pike
#

dont you just love the mc codebase lol

#

why do they do that stuff

#

snowing == raining

#

just in snow biome

#

and y value

violet aspen
sturdy oar
#

raining + snowy biome == snow

violet aspen
sturdy oar
#

btw is It normal that if i get a block location, and spawn a primed TNT at that block location, the Primed tnt will actually not spawn there?

timber pike
#

i dont see an onEnable method?

#

also the class should be called Settings not settings

subtle blade
#

depends on where you're spawning it, Viper

timber pike
#

class names always start with an uppercase

subtle blade
#

keep in mind that a block's position is 0, 0, 0 relative to that block. The bottom left most corner

sturdy oar
subtle blade
#

yep

#

block.getLocation().add(0.5, 0.5, 0.5)

violet aspen
#

oh ok sry im a Beginner

timber pike
#

its ok

#

it doesnt effect how it runs

#

just how things are

violet aspen
#

Everything works except for the event

subtle blade
#

I'd blame that likely on the condition instead. That event should be called and it likely is, though that condition is most likely false

#

oh, wait, yeah it is lol

#

player.getInventory().getName().equalsIgnoreCase("Settings")

#

player.getInventory() is the player's inventory, not the one it has open

timber pike
#

^^^ check that its not with the event code

frigid ember
#

how do i make it so if i click an item it runs a command

timber pike
#

also if it still doesn't work then it might be CommandExecuter and EventListener conflicting for some reason

violet aspen
#

ok

timber pike
#

you can just test whether its firing by putting a line of code that says in chat like "I work" or smth

subtle blade
#

It's working fine

#

The condition is always false

timber pike
#

oh yeah lol

subtle blade
#

You want to check the clicked inventory's name. event.getClickedInventory() (which can be null if clicking outside of it)

timber pike
#

Also, does creating a new thread cause commands to run twice?

subtle blade
#

that's a very vague question lol

timber pike
#

lol sorry

#

if I create a synchronized runnable to do a countdown does that cause a command like /give to execute twice?

#

because that's what im observing

#

i don't know if its something else though

violet aspen
#

ah lol now it works thanks

hollow thorn
#

whats the difference inbetween isThundering and hasStorm

gusty comet
hollow thorn
#

but surely when you have a storm you have a thunder

subtle blade
#

not always

limber forge
#

where can i create posts where other can write sth

subtle blade
#

it can rain without there being lightning

#

?forums

#

fuck, thought there was a command for that

#

?spd

worldly heathBOT
timber pike
#

i think he means vice versa

subtle blade
#

Aye

timber pike
#

if there's lightning there's a storm

gusty comet
#

How can i get the latest maven bungeecord build?

#

Because directory listing is forbidden with the repo url

#

well yeah but i don't think this is always gonna be up to date

sturdy oar
#

@frigid ember do you know kotlin?

gusty comet
frigid ember
#

My bungeecord server‘s icon is glitching only on 1.16+, anyone have any ideas on what the problem could be? Btw I did update my bungeecord to support 1.16

#

it turns white or into the default icon, sometimes even has the original icon really small in the top right

limber forge
#

can someone help me

#

i need ideas

gusty comet
#

Yes i noticed

#

Still need that ConsoleCommandSender and can't find it 😦

tall cedar
#

I feel like I'm missing something with the bungeecord config for MOTD's. The MOTD in the listener is overriding the MOTD for the specific servers.

#

Is there a flag or something that is doing this?

gusty comet
#

Am i dumb or is there no way to get the ConsoleCommandSender Object in the Bungeecord maven repo

frigid ember
#

do server icons have to be jpg or can they be png?

gusty comet
#

png

hollow thorn
#

how do i capatalise each word of a string

frigid ember
#

well mine is png

#

only does this in 1.16

hollow thorn
#

and remove certain charcaters

frigid ember
#

other versions are completely fine

#

its the top server

hollow thorn
#

also the icon is ment to be called icon

#

so it would jsut be

#

icon.png

frigid ember
#

its called server-icon.png

grim halo
#

.toUpperCase() and .replace(str1, str2)

gusty comet
hollow thorn
#

.toUpperCase() and .replace(str1, str2)
@grim halo wont that make the hole string capital letters

grim halo
#

Yes

wise flame
hollow thorn
#

how do i remove a character from a string

wraith thicket
#

@hollow thorn String#replace to replace something, String#subString to get a a substring

gusty comet
#

@gusty comet Just use if (sender instanceof getProxy().getConsole()).
@frigid ember Main.getConsole() is just the normal CommandSender

#

Also that does not work with Java syntax

frigid ember
#

How would I get the blocks in between two locations? For example in the picture, the two black concrete blocks are the two locations and the red stained glass blocks are the blocks I want to get

gusty comet
#

i want to check if the sender is the console

#

You don't get it

tiny dagger
#

@frigid ember substract 1 block loc from the another then normalize it and raytrace it back to the other block

soft grove
#

I need help

frigid ember
#

time to look up how to use raytracing

worldly heathBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply.

frigid ember
#

pog

copper star
#

hi PulleQ

frigid ember
#

thank you @tiny dagger

tiny dagger
#

ray tracing

frigid ember
#

tracing rays

tiny dagger
#

is exactly what it sounds like

frigid ember
#

yeah

#

ik

tiny dagger
#

tracing a line

#

aka getting your blocks

soft grove
#

Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask doesn't work

frigid ember
#

yes

tiny dagger
#

you probabily wanna look into how vector normalise stuff

frigid ember
#

Ik how to do everything else

soft grove
#

it just spams like it was normal while (true) loop

frigid ember
#

I've just never used raytracing

lone fog
#

Then you gave it an interval of 0

soft grove
#

}, 0L, sec * (this.getConfig().getLong("Interval"))); these are numbers on the bottom

#

sec is 20

lone fog
#

Interval config value is probably not set correctly

#

So it’s 20 * 0

soft grove
#

it looks liek this in config

#this is example
Interval: 60
wraith thicket
#

It's possible you're simply using it incorrectly. Posting your code would be a good start

#

?paste

worldly heathBOT
soft grove
#

of the method

wraith thicket
#

And what do you expect it to do exactly?

soft grove
#

that's how the friend sent me it

#

I kept it cause changing it did nothing

#

ok I changed it to long and removed the cast

wraith thicket
#

That's unlikely to change much.
What you can do is calculate the period beforehand and output to make sure you have the same number you expect.

#

But I'd like to ask again:

And what do you expect it to do exactly?

soft grove
#

to execute the list of commands every period of time that the user specified in the config

wraith thicket
#

But that's not what you're talling it to do

#

You're telling to execute every command every time the task gets run

soft grove
#

I want to execute the list of commands in config (I will move them to the seperate yaml file when it will work) every time it waits a delay set by the user

#

but it just ends up executing a list of commands I think every tick or sth

frigid ember
#

it was cleanmotd that was messing with my server's icon

soft grove
#

but it just ends up executing a list of commands I think every tick or sth
yeah every tick

hollow thorn
#

how do i create a scoreboard

frigid ember
#

get a plugin that has a scoreboard, maybe quickboard

#

ah

#

does anyone know how to make it so players cant push each other?

#

im assuming its with the scoreboard but im not sure on how to do this

lone fog
#

Turn the delay value into a variable and then print it to check its right

soft grove
#

ok

wraith thicket
#

@soft grove You want to
a) store your list of commands outside the scope of the scheduled task
b) run one command within each
In order to do so you'd need to keep track of your position in the list and reset it to 0 when you reach its end (or you could probably use some pre existing collection that does the roll for you)

soft grove
#

there is something wrong with the value ig cuz it returns zero

wraith thicket
#

Are you sure the config.yml in your plugin's folder contains the "Interval" key?

scenic crater
#

Hello i need help or advice.

soft grove
#

yeah

worldly heathBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply.

scenic crater
#

i install GroupManager and have only one world my original but no nether and end world... to config what do to..

soft grove
#

config.yml

Interval: 60

getLong

plugin.getConfig().getLong("Interval")
scenic crater
copper star
#

replace getLong with getInt

soft grove
#

it still returns 0

hollow thorn
#

how do i make a normal scoreboard objective

#

how do i get back the score i stored in there

#

because thats for mking the display

copper star
#

int sec = (int) 20L

#

Put that

#

and then replace getLong with getInt

soft grove
#

ok I fixed it

hollow thorn
#

how do i create a normal vannila player scoreboard which works

soft grove
#

I got String and parsed it into Int

hollow thorn
#

the way it does in vannila

soft grove
#

thanks for help

#

and directing me into right path

copper star
#

My Servers bStats is not working
It is not tracking on anyones plugin

#

No

#

It only tracks data when I first start my server

#

and then it stops

#

This is how its like

#

bStats is enabled

#

It does this on all graphs

#

and Pie charts dont show it

#

It is doing it on Server chart

#

This is happening on all plugins that have bStats

#

once a day

#

at 16:30 I restarted to add a plugin

#

It does this on every bStats plugin

#
} catch (ClassNotFoundException e) {
                                // minecraft version 1.14+
                                if (logFailedRequests) {
                                    this.plugin.getLogger().log(Level.SEVERE, "Encountered unexpected exception ", e);
                                }

I see this in the bStats metrics java file

ripe oasis
#

Hello! Why does this not work for me? I am trying to tell the player another player's location


import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;

public class Main extends JavaPlugin{

    @Override
    public void onEnable() {

    }

    @Override
    public void onDisable() {

    }

    public boolean onCommand(CommandSender sender, Command cmd, String label, Player[] args) {
        if (label.equalsIgnoreCase("location")) {
            if (sender instanceof Player) {
                Player player = (Player) sender;
                Player getLocPlayer = (Player) args[0];
                if (player.hasPermission("location.use")) {
                    if(args.length == 0) {
                        player.sendMessage("Usage: /location <player>");
                        return true;
                    }
                    player.sendMessage(ChatColor.GREEN + "" + getLocPlayer + "'s location is:" + getLocPlayer.getLocation().toString);
                    return true;

                }
                player.sendMessage(ChatColor.RED + "You do not have permission!");
                return true;
            }
            else {
                Player getLocPlayer = (Player) args[0];
                sender.sendMessage(ChatColor.GREEN + "" + getLocPlayer + "'s location is:" + getLocPlayer.getLocation().toString);
                return true;
            }
        }
        return false;
    }
}```
hollow thorn
#

how do i create normal scoreboards for storing information

grim halo
#

@ripe oasis You can not cast a String to a Player

odd knoll
#

You also haven't registered the command.

ripe oasis
#

ok

copper star
#

Just got new data to bStats and Still no new data

#

not Tracking still

odd knoll
#

bStats doesn't update immediately.

ripe oasis
#

ok

copper star
#

I have had no data for 5 hours and 30 mins

ripe oasis
#

It is confusing

copper star
#

and Its the same for all plugins

grim halo
#

JavaPlugin is instance of commandExecutor. You dont need to implement it anymore

#

bukkit 1.2.5

odd knoll
#

🤔

median dock
#

is it possible to detect wether a chunk was unloaded clientside by a player meaning if a player unloaded a chunk on his screen but another one is still in it

grim halo
#

You can detect the chunk packets that get sent to a player. There is one that sends the chunk and one that "unloads" it for the player.

#

You cant actually check what player triggered a chunk unload as the chunk only gets unloaded if the server feels like it.

#

But you can keep track of what player sees which chunk.

half marsh
#

quick question, is there an event that occurs when a entity gets scared of something?

#

Like a villager getting scared of a monster or something like that

#

i can't find anything

#

Damn, that's too bad

#

and yeah i'd already tested EntityTargetEvent but it requires the entity to target another entity

copper star
#

I opened my testing server to check for errors

#

for bStats

worldly heathBOT
violet aspen
#

how can you best query whether an inventory is full

hollow thorn
#

how do i create normal scoreboards for storing information
@hollow thorn

violet aspen
#

i dont understand this

#

what is Inventory#firstEmpty

graceful vigil
#

Read the javadocs

tacit trellis
#

Is it allowed to create a directory outside of plugins folder with spigot?

copper star
#

My Testing server tracks bStats and doesnt stop

#

My main server stops

subtle blade
#

I mean, it's not not allowed

#

You can do that if you'd like though it's generally discouraged

lapis kestrel
#

Hi, I am trying to create custom items by creating a class that extends ItemStack. When I add that item to an inventory and get it again using PlayerInventory#getItemInMainHand, any instanceof checks to see if it is the class returns false. Is there any way I can fix that?

lone fog
#

And most people won't be happy with 13GB of memes suddenly in a folder on their desktop

#

Hi, I am trying to create custom items by creating a class that extends ItemStack. When I add that item to an inventory and get it again using PlayerInventory#getItemInMainHand, any instanceof checks to see if it is the class returns false. Is there any way I can fix that?
Probably not possible, use persistantDataContainer

lapis kestrel
#

How would I use it?

odd knoll
#

Been out of the loop on 1.16, is there an API for making full RGB chat messages (or a Spigot guide)?

lone fog
#

yes

#

Use the bungee chatcolor class and ChatColor.of

unkempt ridge
#

Three questions. 1) what event is the best to turn on/off game rules (like fire tick, fall damage, etc)? 2) How would I be able to stop player's from burning in lava (I thought fire damage would do it, but it doesn't? 3) I want to check if a player is standing on a beacon and only a beacon, and if they are do something. What would be the best event for that?

odd knoll
#

Thx. And is there a agreed upon standard of how it's written in configs?

lone fog
#

&x&r&r&g&g&b&b

odd knoll
#

Kk.

lone fog
#

And yes it is pain

odd knoll
#

That seems horrible

lone fog
#

A lot of plugins just do &#rrggbb

odd knoll
#

Yh, I think ima do that.

tiny dagger
#

how does it know when it ends? 😂

lone fog
#

6 values

odd knoll
#

^^ hex is always the same length

tiny dagger
#

oh

#

das nice

#

and it always has the sharp?

odd knoll
#

That's general hex notation.

#

So whenever you're saying the hex of something, you'd put it like #xxxxxx. That's a general thing not an MC thing as well.

unkempt ridge
#

What about the game rule's not damage related (i.e. ANNOUNCE_ADVANCEMENTS, DO_DAYLIGHT_CYCLE, etc.)?

lone fog
#

What do you mean event?

subtle blade
#

Game rules?

lone fog
#

I don't think there is an event for when they are toggled, but you can use PlayerCommandPreprocessEvent to listen for them I guess

unkempt ridge
#

yes sorry typed that too fast @subtle blade

subtle blade
#

No event necessary. See World#setGameRuleValue() (or setGameRule(), can't quite remember)

lone fog
#

But that doesn't tell you when they are changed

#

Unless you use a repeating task to check them

subtle blade
#

Oh is that what he wants?

unkempt ridge
#

I just want to turn like daylight cycle, weather, advancements, all off

subtle blade
#

Yeah you can do that with World#setGameRuleValue()

unkempt ridge
#

Should I do that in onEnable()? When I looked quickly on JavaDocs I found WorldEvent

subtle blade
#

Sure. You could definitely do it onEnable() if you'd like

#

Iterate over all the available game rules and loaded worlds

unkempt ridge
#

okay thanks!

lapis kestrel
#

Hi, I am trying to create custom items by creating a class that extends ItemStack. When I add that item to an inventory and get it again using PlayerInventory#getItemInMainHand, any instanceof checks to see if it is the class returns false. Is there any way I can fix that?
And why wouldn’t it work?

hollow thorn
#

how do i create normal scoreboards for storing information
@hollow thorn

subtle blade
#

You can't extend ItemStack

#

Well, you can, but it won't work as you expect

#

Bukkit makes copies or mirrors of NMS item stacks

lapis kestrel
#

Oh

#

What other ways would there be of creating custom items?

subtle blade
#

PersistentDataContainers on its ItemMeta

hollow thorn
#

how do i create normal scoreboards for storing information

subtle blade
#

Modifying its NBT to your desire

lone fog
#

What I do is store a string in persistantDataContainer and then use that string to get a CustomItem from a map

lapis kestrel
#

Ok

bold anchor
#

Store a byte array

lone fog
#

of what

hollow thorn
#

how do i create normal scoreboards for storing information

balmy sentinel
hollow thorn
#

thats for qui

balmy sentinel
#

also please don't spam your question

hollow thorn
#

not for storage of information

#

how do i store a number in a player

lone fog
#

What do you mean "Storing information"

tiny dagger
#

like normal usecase?

lone fog
#

You can use a per player yml file, database or the PersistantDataContainer on a player

hollow thorn
#

storing information as in the way people use scorboards in vannila

#

literally a score

balmy sentinel
#

what are you trying to store @hollow thorn ?

hollow thorn
#

a number

lone fog
#

I mean yeah I guess you can use a scoreboard

balmy sentinel
#

like how many blocks they've broken?

lone fog
#

Make an objective, then use objective.setScore

hollow thorn
#

.setscore doesnt exist

balmy sentinel
#

you need to create a scoreboard and then create an objective

lone fog
#

Ah sorry

#

objective.getScore.setScore

hollow thorn
#

i did this Scoreboard Defcon = Bukkit.getScoreboardManager().getNewScoreboard(); Objective objective = Defcon.registerNewObjective("Defcon", "dummy", "e");

lone fog
#

Which is a bit confusing

hollow thorn
#

i read it it doesnt help

balmy sentinel
#

I already sent a tutorial on making scoreboards and how to update them

lapis kestrel
#

Does a PersistentDataContainer persist after the item has been placed down?

balmy sentinel
#

nice.

lone fog
#

Placed down as a block? no

lapis kestrel
#

Oh

lone fog
#

In an itemframe, chest, etc, yes

lapis kestrel
#

Ok

lone fog
#

You would have to transfer the data to the block

balmy sentinel
#

tbh that tutorial is really good for beginners to understand lmao it's what I used to learn

lone fog
#

If it's a tile entity they also have a persistentDataContainer

#

If it's a normal block you will need something else

lapis kestrel
#

Oh

#

Alright

frigid ember
#
                Entity vehicle = world.spawnEntity(loc, EntityType.BOAT);
                ((CraftEntity) vehicle).getHandle().setInvisible(true);```
Doesn't make the vehicle invis
#

😕

lone fog
#

You'll need packets

undone narwhal
#

Boat can't be invisible

frigid ember
#

but they do have to sit in it at the same time

#

so they can move the way they want

#

and take the mob with them

#

the mob will have to follow the location of the boat

#
    @EventHandler
    public void onPlayerMobInteract(PlayerInteractEntityEvent e) {
        if (e.getRightClicked() instanceof (anymob)) {
            Player pl = e.getPlayer();
            Entity ent = e.getRightClicked();
            World world = e.getPlayer().getWorld();
            Location loc = e.getRightClicked().getLocation();

                Entity vehicle = world.spawnEntity(loc, EntityType.BOAT);
                ((CraftEntity) vehicle).getHandle().setInvisible(true);
                ent.setPassenger(vehicle);
                vehicle.setPassenger(pl);
        }
    }```
#

the mob

#

yes.

#

but thats not possible without protocollib

#

at least thats what people said

#

so they told me that I should try this

#

now its 'ent.setPassenger(vehicle)'

#

but it should stay there(stick there) and the mob should follow the location of the boat

lone fog
#

You will 100% need protocollib or nms to make it look half decent

#

Best you can do without it is teleporting the mob to an invisible horse the player is riding

frigid ember
#

but that'll have a difference in height with most things I believe

lone fog
#

That's why I recommend making NMS extensions of each entity and modifying them to be controllable

frigid ember
#

NMS would be only one version right?

lone fog
#

You can make it multi version with a bit extra work

frigid ember
#

ok

#

than I'll do that

#

smartest thing would be to make it which the latest version than right?

#

not 1.8

#

on which I currently am xd

ripe token
#

i edit my score board how i do bal?
{player's balance} not working for me
i use with kiteboard

#

kk ty

#

iliketocode
after i dowload Placeholderapi
all time i do /pl i got kicked

#

please help

#

no

#

but when i do /pl

#

is just kick me

#

oh is show me error

#

intenral....

#

wait i copy paste the error

worldly heathBOT
ripe token
#

oh

#

i want send picture

#

can you unblock me please

#

is what is show me when i do /pl

#

i mean first is kick me to minehut lobby

balmy sentinel
#

that might be a feature of Minehut

#

it's not your server they're probably blocking you from executing the command

ripe token
#

```[22:38:05] [Craft Scheduler Thread - 32/WARN]: [PlayerServer] Loaded class org.apache.commons.io.FileUtils from AdvancedBan v2.1.9 which is not a depend, softdepend or loadbefore of this plugin.````

#

is ?

balmy sentinel
#

I think it's a great place to start a community, however, definitely not the route you want to go to open a real server. One thing I really hate is they don't allow you to download files from your sever.

#

@ripe token thats an issue you have to bring up with Minehut there is little we can do about how they configure their servers.

ripe token
#

but the bug with placeholderapi

#

bcf berof i dowload that

rotund orbit
#

Hey everyone. I want to make a Time Manager plugin that essentially schedules a method to run every x seconds to add to the time. My question is how does minecraft do this normally? Does it add a second to the time every 20 ticks?

ripe token
#

the pl workds

#

now they not works

rotund orbit
#

Thank you 🙂 What would I use to add to the time of a world?

#

oh thank you

buoyant path
#

could someone good with Maven help me find the dependency for MongoCrypts

#

org.mongodb.crypts

sturdy oar
#

The f is this tho

#

Is it cryptography for MongoDB database

rotund orbit
#

How would I save a list of worldnames to the config.yml dynamically? Something like this:

worlds:
worldone:
speed: 1
worldtwo:
speed: 2

sturdy oar
#

Well eZ

rotund orbit
#

thank you

subtle wedge
graceful vigil
#

Shouldn't really be using plugman anyways imo

subtle wedge
#

I just wanted to find out if it was a corrupted world, plugin, or what

#

Yeah

#

I've tried removing 20+ Anything like Featherboard, ProtoclLib, ViaVersion, I've removed but still not letting (only me) join

sturdy oar
#

Server version?

subtle wedge
#

4r8, 1.8.8 PaperMC

#

I've tried a bunch of clients

#

Because I need both

sturdy oar
#

Ok

#

Some time viaversion + protocol lib messes stuff up u never know

subtle wedge
#

For some reason, ViaVersion is back but I deleted it via FTP on FileZilla a few hours ago ???

#

I've also tried deleting my playerdata but no luck

#

I've been trying to look for solutions for hours to learn from this but I'm just going to try to backup plugins.

wheat mirage
#

Hey! Gravel and sand clay aren't spawning near rivers

#

on my spigot server

frigid ember
#

Could I make a toggle ableoption of the viewing of banners through a plugin

sturdy oar
#

Banners?

frigid ember
#

Yea

sturdy oar
#

Technically yes

frigid ember
#

The server I play on uses a lot of banners and players lag from tile entities

#

So I was thinking I could add an option for viewing banners

sturdy oar
#

You can technically filter packets and remove banner blocks although it's kinda of a mess

frigid ember
#

Although i’m not entirely sure how how to get started

#

Yeah I was thinking of using ProtocolLib’s api to do that

#

But I don’t know how to remove the actual banner blocks

#

But I guess if I get the plugin to stop sending the packet that might fix lag. Just might be ugly lol

subtle wedge
#

Server is online, I'm getting spammed thishttps://hatebin.com/dkzbjemcrs

sturdy oar
#

I think one solution is to filter the chunk data clientbound packet

#

But there may be others

frigid ember
#

I’ll look into that

#

Any solution that requires me not hooking into another plugin is good lol

lone fog
#

Since when are banners tile entities

#

Oh wait duh

#

The pattern

sage summit
#

How do you I check when a player is banned?

frigid ember
#

@sage summit do you have essentials or any ban plugin

#

Or are you referring to code

sage summit
#

Code, I want to check when a player is banned and do a specific thing, example, broadcast that the player was banned

lone fog
#

player.isBanned

frigid ember
#

^

lone fog
#

or offlineplayer.isBanned

sturdy oar
#

No?

#

Does that really exists

frigid ember
#

Yeah

#

Player method

buoyant path
#

[18:31:20 ERROR]: Error occurred while enabling VulcanCore v3.0-SNAPSHOT (Is it up to date?)
java.lang.NoSuchMethodError: com.mongodb.client.internal.MongoClientDelegate.<init>(Lcom/mongodb/internal/connection/Cluster;Lorg/bson/codecs/configuration/CodecRegistry;Ljava/lang/Object;Lcom/mongodb/client/internal/Crypt;)V
at com.mongodb.MongoClient.<init>(MongoClient.java:346) ~[?:?]
at com.mongodb.MongoClient.<init>(MongoClient.java:205) ~[?:?]
at com.mongodb.MongoClient.<init>(MongoClient.java:194) ~[?:?]
at com.mongodb.MongoClient.<init>(MongoClient.java:155) ~[?:?]
at vulcanprisons.iron.vulcancore.mongo.MongoManager.<clinit>(MongoManager.java:10) ~[?:?]

#

I fucking hate mongo lol

frigid ember
#

Stop using it if you don’t know how to use it

subtle blade
#

Is it not deprecated?

#

Oh, it's not. Just checks the ban list. Nevermind ;P

sage summit
#

Ok thanks!

subtle blade
#

probably but generally support is best directed towards authors and their means of support

frigid ember
#

Nice..

ancient ridge
#

so what plugin are you looking for

sage summit
#

Thanks

sturdy oar
#
return server.getBannedPlayers().stream.filter(o -> o.getUuid().equals(p.getUuid())).orElse(false);
#

Smh

subtle blade
#

oh dear

#

just OfflinePlayer#isBanned() will suffice lol

sturdy oar
#

Xd bruh I had used streams on purpose

#

I know

subtle blade
#

Here is where punctuation matters. There's a difference between
"Check when a player is banned and do a specific thing"
and
"Check, when a player is banned, do a specific thing"

lone fog
#

Would player.isBanned return true by the time the PlayerQuitEvent is fired?

subtle blade
#

I'd imagine so, yes

subtle wedge
#

It's only me and on this account as well

#

I'm on a VPN anyways

sage summit
#

nice, how is pebblehost going, heard it was good

subtle wedge
#

Also, I've already done that countless times and I've removed a lot of plugins

#

Pebblehost is fine so far, dosen't let you store your backups on their servers though

sage summit
#

oof

quick arch
#

it's probably a ProtocolLib error

#

Got useless NPEs while having ProtocolLib on 1.16

subtle wedge
#

It's only me though ?

quick arch
#

Could use Java 14 and enable it's informational null pointers 👀

subtle wedge
#

I'm on 1.8

quick arch
#

oh

#

¯_(ツ)_/¯

subtle wedge
#

It pops with this now [Disconnect] User 4r8 has disconnected, reason: Internal Exception: java.io.IOException: Error while write(...): Broken pipe

#

I've looked up this issue and found a bunch of posts about it but I haven't found a fix for me

#

It dosen't make sense because I backed up all plugins to when It was working fine as well

#

Could it be client side? My other acc works though

#

Nope

#

I used Plugman to disable them though

sage summit
#

need help with world edit patterns

spark phoenix
#

Hey! Is there a way I can check why my animals can't procreate? I mean, you can feed them to have the baby, but the baby never spawns

#

How do I log that event?

#

oh, I have to do a plugin for that purpose

lone fog
#

If you are monitoring, use MONITOR

spark phoenix
#

tbh I have 0 idea about Java

#

Thanks for the tip tho, maybe I'll take a general look to Spigot's plugin development

#

Yes, I do

#

Didn't change any __global__flag tho

#

let me check

#

is it possible to be limited by my entity limit settings?

lone fog
#

Could be

spark phoenix
#

Well nope, I don't see any flag that could be restricting it

rapid willow
#

sup

#

im running a 1.16.1 beta server, im looking at the console and see the memory usage is doing a weird pattern

#

is this a problem with the beta?

subtle blade
#

(1) 1.16.1 beta? (2) That's the garbage collector doing its thing

rapid willow
#

cool, nothing to worry about?

frigid ember
#

wdym by beta

rapid willow
#

manualy set the 1.16.1 release in buildtools so I got newer than the latest flag

subtle blade
#

oh, sure, though I wouldn't really consider that beta

#

but yeah, that's just normal PES_SadShrug nothing to worry about

#

The GC periodically cleans up memory that isn't being used anymore

rapid willow
#

yeah I just noticed it was only going when the memory got full usage

#

and then diped to 0

pastel condor
#

should I switch from java 8 to java 14?

quick arch
#

yes

#

enable the informational NPE flag too

lone fog
#

If everything works yes

lapis kestrel
#

Why is this error occuring?
com.destroystokyo.paper.exception.ServerInternalException: Attempted to place a tile entity (net.minecraft.server.v1_15_R1.TileEntitySkull@439e39f4) at 109,70,4 (Block{minecraft:air}) where there was no entity tile!
Source line: e.getBlock().setType(Material.AIR);

subtle blade
#

com.destroystokyo.paper

#

SpigotMC Discord

lapis kestrel
#

oh

subtle blade
#

You seeing the issue here? Cause I am

lapis kestrel
#

oops

#

:/

#

is there a paper-spigot discord

subtle blade
#

Yes. Google is your friend

lapis kestrel
#

it still shows an exception in spigot

frigid ember
#

How would I get every stone block in a specific area

craggy jolt
#

How do I hide the skeleton's bow?

quick arch
#

That's not Spigot Development

unborn jewel
#

shit...

#

dw about it then

#

fixed it

craggy jolt
#

I'm trying to make a skeleton completely invisible but I do not know how to hide its bow

#

Does someone know how to do it?

balmy sentinel
#

@craggy jolt it's old, but the way to do it is most likely the same https://www.spigotmc.org/threads/how-do-i-remove-the-bow-from-a-skeleton.44002/. Please do some basic research before asking your question. Literally copied and pasted your question and it was the first link.

craggy jolt
#

no way I've literally been searching for an hour. I tried typing everything except that lol

#

Thank you bro

balmy sentinel
#

"spigotmc how to hide a skeleton's bow"

craggy jolt
#

I checked it out but its not what im looking for

#

I want the skeleton's bow to still be there but just invisible

#

ya know

quick arch
#

Packets 🤔

balmy sentinel
#

either that or making a custom entity might work (you might run into the same issue tho if you create a custom skeleton)?

craggy jolt
#

hmmm how do packets work. I looked it up and I still don't have a clue

balmy sentinel
#

Other than that if you prefer visual learning, I first learned how to create packets and send them with CodeRed's NPC tutorial. If you search "spigot coding with packets" on Youtube you're sure to find something

celest current
#

How can I make it where is someone is holding an item they get an effect? Like if someone is holding a special sword they get regen?

frigid ember
#

try listening for the event where u swap items

#

and then check if item issimilar to special sword

#

then add potion effect

#

and then maybe when they switch off of it u clear it?

celest current
#

That sounds good! Imma take a shower than learn how to do that lol

frigid ember
#

ah found the name of the event

#

it was PlayerItemHeldEvent

#

although if they pick up the sword without swapping items, or get it from a chest then it wont trigger

#

it might be better to go with a runnable? but idk how performance intensive that is

quick arch
#

Pretty sure that is far better than runnables

wise flame
#

I'm trying to get Minecraft's server.properties manager so I can modify a thing, but all the documentation talking about it is referencing old stuff.

wise flame
#

No I didn't.

#

I don't want this to be version-dependent

#

so this is complicated and slightly annoying

#

I'm trying to set the default world btw. Afaik, the only way to do that is by modifying levelName

subtle wedge
lone fog
#

Narrow it down to a certain plugin?

subtle wedge
#

I've tried that

#

When I log off on any other world, It works fine with or without the plugins

lofty meadow
#

Hi! How much UUID length long?

#

How many characters?

balmy sentinel
#

64 I think

lofty meadow
#

Ok, thanks!

balmy sentinel
#

I use VARCHAR(64) when I store them in a database and I’ve never had a problem

lofty meadow
#

Ok, thank you!

opal marsh
#

UUIDs in string form are 36 characters - 32 hexadecimal and 4 hyphens

lofty meadow
#

Ohh ok thanks!

subtle wedge
#

Why does the world look like this every time I join? I'm pretty sure this only happens in this world too

subtle wedge
#

Why do mobs pause for a bit every so often after you hit them?

#

Maybe it's just my shit ping lol

#

Is there a plugin or a way to make it so that hostile mobs are passive until you hit them?

dense tartan
#

I have a world which according to essentials GC, has 26k entities in it and was causing lag. I have attempted to run a ,/kill @e and that only removed 4k. Is it possible to find and remove the remaining 26k entities?

frigid ember
#

is difficulty per world?

#

is difficulty per world when im using multiverse

dense tartan
#

should be

#

since MV does handle that

cinder kindle
#

Okay maybe this is some kind of 1:30 AM mistake, but I cant figure out why this code inevitably causes an internal server error when I attempt to access the memory down the line in the plugin

I have an array of Objects called drugs[]
This is where I initialize it:

    Drug drugs[] = new Drug[18];
 
    @Override
    public void onEnable() {
        config.addDefault("joinMessageEnabled", true);
        config.options().copyDefaults(true);
        saveConfig();
 
        for(int i = 0; i < 9; i++) {
            drugs[i].name = config.getString(Integer.toString(i) + ".name");
            drugs[i].nameFormatted = config.getString(Integer.toString(i) + ".nameFormatted");
            drugs[i].effectLineOne = config.getString(Integer.toString(i) + ".effectLineOne");
            drugs[i].effectLineTwo = config.getString(Integer.toString(i) + ".effectLineTwo");
            drugs[i].sellPrice = config.getInt(Integer.toString(i) + ".sellPrice");
            drugs[i].buyPrice = config.getInt(Integer.toString(i) + ".buyPrice");
        }
 
        getServer().getPluginManager().registerEvents(this, this);
    }
#

This is my config.yml:

#
joinMessageEnabled: true
'1':
  name: Coca
  nameFormatted: Coca
  buyPrice: 0
  sellPrice: 0
  effectLineOne: ''
  effectLineTwo: ''
'2':
  name: Meth
  nameFormatted: Meth
  buyPrice: 0
  sellPrice: 0
  effectLineOne: ''
  effectLineTwo: ''
'3':
  name: Cocaine
  nameFormatted: Cocaine
  buyPrice: 0
  sellPrice: 0
  effectLineOne: ''
  effectLineTwo: ''
'4':
  name: Shrooms
  nameFormatted: Shrooms
  buyPrice: 0
  sellPrice: 0
  effectLineOne: ''
  effectLineTwo: ''
'5':
  name: Heroin
  nameFormatted: Heroin
  buyPrice: 0
  sellPrice: 0
  effectLineOne: ''
  effectLineTwo: ''
'6':
  name: LSD
  nameFormatted: LSD
  buyPrice: 0
  sellPrice: 0
  effectLineOne: ''
  effectLineTwo: ''
'7':
  name: Weed
  nameFormatted: Weed
  buyPrice: 0
  sellPrice: 0
  effectLineOne: ''
  effectLineTwo: ''
'8':
  name: Opium
  nameFormatted: Opium
  buyPrice: 0
  sellPrice: 0
  effectLineOne: ''
  effectLineTwo: ''```
#

is there something I'm doing wrong as far as how I parse this file?

halcyon snow
#

you aren't initializing drugs[i] to a new instance of Drug.

cinder kindle
#

oh

sage summit
#

Why do you have a list called drugs?

cinder kindle
#

its a drugs factions server

sage summit
#

Ok then

daring oracle
#

Does anyone know a plugin or how to give a mob another name row (like a hologram), here is an example:

#

I don't know if they use an armor stand, a scoreboard etc... and it looks hella cool.

cinder kindle
#

same code as just above, did that fix, now everything is null

#

is there something else wrong with it?

high mantle
#

check your console, it should point towards the line triggering this error

wheat mirage
#

@daring oracle Size 1 or negative size slime riding the entity

#

and an armorstand riding that

#

To show name

daring oracle
#

Is there maybe a plugin for that?

high mantle
#

probably, just use the power of searching

wheat mirage
#

Chunk loading / unloading is absolutely horrible in 1.16+, does anyone know anything that can be done to help fix this issue? Spigot wants everyone to run latest but how can servers be asked to run 1.16 if the server is just too badly optimised

cinder kindle
#

my error

high mantle
#
dev.barone.RetroDrugs.Gui.initializeItems(Gui.java:33) ~[?:?]
dev.barone.RetroDrugs.Gui.<init>(Gui.java:26) ~[?:?]
dev.barone.RetroDrugs.Main.onCommand(Main.java:54) ~[?:?]
#

those are the lines you are interested in

#

look them up on your code

#

some value you are passing, or object you are using, is null

cinder kindle
#

yeah

#

ik its the values in drugs array

#

I already knew that

#

same code as just above, did that fix, now everything is null

halcyon snow
#

what's line 33 of initializeItems and show your updated code?

high mantle
#

^

cinder kindle
#

one sec

#
    public void initializeItems(Drug drugs[]) {
        System.out.println("[RetroDrugs Debug]" + drugs[0].nameFormatted);
        for(Drug drug : drugs) {
            inv.addItem(createGuiItem(Material.DIAMOND, drug.nameFormatted, drug.effectLineOne, drug.effectLineTwo)); //Line 33
        }
        //inv.addItem(createGuiItem(Material.DIAMOND_SWORD, "Example Sword", "§aFirst line of the lore", "§bSecond line of the lore"));
        //inv.addItem(createGuiItem(Material.IRON_HELMET, "§bExample Helmet", "§aFirst line of the lore", "§bSecond line of the lore"));
    }```
#

the println() prints null

high mantle
#

Alright, next check line 26 of your gui class

cinder kindle
#
public class Gui implements Listener {
    private final Inventory inv;

    public Gui(int rows, String name, Drug drugs[]) {
        // Create a new inventory, with no owner (as this isn't a real inventory), a size of nine, called example
        int size = 9 * rows;
        inv = Bukkit.createInventory(null, size, name);

        // Put the items into the inventory
        initializeItems(drugs); //Line 26
    }
high mantle
#

lastly, line 54 of your Main class

#

whatever you passed there is null

#

thats the root problem

cinder kindle
#
 public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if(command.getName().equalsIgnoreCase("drugs") || command.getName().equalsIgnoreCase("d")) {
            Player p;

            if(sender instanceof Player) {
                p = (Player)sender;
                sender.sendMessage("[RetroDrugs] Opening drugs menu.");
                Gui gui = new Gui(2, "Drugs List", drugs); //Line 54
                gui.openInventory(p);
            } else {
                sender.sendMessage("This command can only be run by a player.");
            }
            return true;
        }

        return false;
    }```
high mantle
#

i don't see the drugs array being intialized anywhere within your method

cinder kindle
#

one sec

high mantle
#

is it a field?

cinder kindle
#
public class Main extends JavaPlugin implements Listener {

    FileConfiguration config = getConfig();

    Drug drugs[] = new Drug[18];

    @Override
    public void onEnable() {
        config.addDefault("joinMessageEnabled", true);
        config.options().copyDefaults(true);
        saveConfig();

        for(int i = 0; i < 9; i++) {
            drugs[i] = new Drug();
            drugs[i].name = config.getString(Integer.toString(i) + ".name");
            drugs[i].nameFormatted = config.getString(Integer.toString(i) + ".nameFormatted");
            drugs[i].effectLineOne = config.getString(Integer.toString(i) + ".effectLineOne");
            drugs[i].effectLineTwo = config.getString(Integer.toString(i) + ".effectLineTwo");
            drugs[i].sellPrice = config.getInt(Integer.toString(i) + ".sellPrice");
            drugs[i].buyPrice = config.getInt(Integer.toString(i) + ".buyPrice");
        }

        getServer().getPluginManager().registerEvents(this, this);
    }```
high mantle
#

why are you using brackets for here Drug drugs[] = new Drug[18];

cinder kindle
#

i want to make an array

#

of Drug Objects

high mantle
#

right

#

but here new Drug[18];

cinder kindle
#

well i could just do Drug drugs[18] I suppose.

#

that didnt work either

#

well actually that wont even compile lol

high mantle
#

your initilaiizing the Drugs class, so you need to be using parentheses

#

not brackets

#

And unless you have a constructor that contains an int parameter you cannot pass anything to that class

cinder kindle
#

imma dm you a screenshot of my error

#

when i do ()

#

cant post here

halcyon snow
#

that's an array initializer @high mantle

cinder kindle
#

^

#

okay im not crazy

high mantle
#

funnily enough i've done java for like 3 years and i've never seen that until now

cinder kindle
#

im a c/c++ person mostly lol

high mantle
#

ah

#

yeah i usually just use lists

#

much easier to work with

cinder kindle
#

we dont have lists in c, unless you make them

#

Optimization wise, am I better off with an Array or a List? If it's fixed size I'd imagine an array right?

halcyon snow
#

you can use either

Object[] array = new Object[16];

or

Object array[] = new Object[16];

there's no difference

#

I believe the bottom one is called a c style array initializer.

cinder kindle
#

the bottom one is what I'm familiar with so probably

high mantle
#

like I said i rarely use arrays aside from varargs and even then I usually convert them to Lists

#

its just so much easier to work with

cinder kindle
#

how would you go about this with a list

spark phoenix
#

Dudes, I'm new to Java programming, I have a fast question... I'm using IntelliJ, when I build my project, it's a 32mb jar

#

and it's just a print test lmao

grim halo
#

You are shading the whole spigot server in then...

tough kraken
#

okay got a question... 1.8 help isnt supportet i know... i am creating a scoreboard with bungeecord. If i use it on 1.16, on create it shows this error:

On 1.8 it works perfectly. so how should i format my scoreboard? idk anything about json tbh

high mantle
#

whoops

spark phoenix
high mantle
#

oh

#

i think i know the problem

grim halo
#

Do you use the mcdev plugin or maven?

spark phoenix
#

maven

#

didn't know a mcdev plugin exists tho

grim halo
high mantle
#

if im correct you're not creating any new instances of the class, you're just making an amount of indexes

#

maybe that's it?

#

if not then i seriously don't know. there are lot smarter people than me

#

i just came on to ask a question lol

spark phoenix
#

Where can I see that dependency file? Can't see it

grim halo
#

Its your pom.xml

#

And with maven you dont use jar files from your system and you dont export the project by hand

high mantle
#

I am attempting to generate a world the moment a player places a metadata sign, then paste a schematic inside it using the ConsoleCommandSender and WorldEdit to create the lobby. It is an empty world, the class used for chunkdata is as follows.

public class VoidWorld extends ChunkGenerator {    
    @Override
    public ChunkData generateChunkData(World world, Random random, int chunkX, int chunkZ, BiomeGrid biome) {   
        return createChunkData(world);
    }
}

This generates like normal, but whenever the consolecommandsender attempts to load and paste the schematic at the specified coordinates, it comes up with the error "the world was unloaded and the reference was unavailable" (error log at the bottom of message) that points towards these lines:

Bukkit.dispatchCommand(console, "/schematic load bedwarslobby");
Bukkit.dispatchCommand(console, "/world bedwars" + i);
Bukkit.dispatchCommand(console, "/pos1 " + spawnCoords);
Bukkit.dispatchCommand(console, "/pos2 " + spawnCoords);
Bukkit.dispatchCommand(console, "/paste");

all variables used for the dispatch command are here:

World world = Bukkit.createWorld(new WorldCreator("bedwars" + i).generator(new VoidWorld()));
Location spawn = world.getSpawnLocation();
String spawnCoords = spawn.getBlockX() + "," + spawn.getBlockY() + "," + spawn.getBlockZ();

ConsoleCommandSender console = Bukkit.getServer().getConsoleSender();

I assumed the world was loaded upon creation, but I guess not. How would I get this to occur?
https://media.discordapp.net/attachments/690470011382267904/736266595130933298/unknown.png?width=789&height=677

tough kraken
#

holy

high mantle
#

this is a repost because no one answered it a couple nights ago

spark phoenix
#

Ok I'll take a look, thanks 7smile7

tough kraken
#

a massive block of a message...

high mantle
#

its only because its a bunch of references

tough kraken
#

ah

high mantle
#

so i looked into it myself, and it works fine until i unload and delete a world

#

im pretty sure its the unloading that causes the issue

tough kraken
#

man 1.16 is so weird sometimes

high mantle
#

ye

grim halo
#

createWorld creates/loads the world

spark phoenix
#

Now that I'm thinking, nevermind I' not using Maven, I just used it to generate a offline javadoc

#

I manually imported the API

#

(I don't have a pom.xml)

grim halo
#

Ok then you build an artifact right?

spark phoenix
#

yes

grim halo
#

Then remove Extracted Spigot something from your output layout

spark phoenix
#

Hell yes, that did the trick

#

thanks a lot!

grim halo
#

np

high mantle
#

well thats weird then. WorldEdit doesn't seem to think so even though I just made it

#

if I were to unload then delete a world, then soon after create a new world with the same name, would that cause worldedit to trip up?

#

maybe it looks at it via name, and when i unload the world it remembers that unloaded world name

#

regardless of if its actually a new world or not

grim halo
#

Referencing a world by its name and then re creating it completely on runtime just begs for problems.

#

Also why dont you use the worldedit api?

high mantle
#

because all i can find is their project managers and i don't use that

lilac gorge
#

does anyone know a flag or plugin that disables certain armor types, and items with enchants inside a world guard region?

grim halo
#

What do you mean by project managers...

high mantle
#

maven, gradle, etc

grim halo
#

Oh... i mean you can always just download the jar by hand and add it...

#

Wait...

high mantle
#

its also easier just to make the console run the command

grim halo
#

Might not work with WE

#

Yes but then you run into problems like that. With the api you could reference worlds by their uuids

high mantle
#

true

grim halo
#

Your problem could be the cache that is used for something like /undo yields a world reference or name -> world link

#

No idea... just increment i every time a world gets created

#

I have no idea why you would want to create/delete so many worlds at runtime anyways...

high mantle
#

the idea is to have a world per lobby, since the game mechanics can get a bit intensive

grim halo
#

A world per lobby of a minigame?

high mantle
#

the game lobby

grim halo
#

"the game" lobby?

high mantle
#

ok

#

so there are hub lobbies in other servers - the one im in doesn't have that since we're not big enough for it to matter, but it does matter when it comes to fps/performance, so its important that all game sessions are in their own world

#

for there are multiple signs, each one intrinsically linked to their specified world, and when right click it sends the player their to the game lobby, where they wait until they have enough players to start

#

therefore i need to create a way that's easy enough for them to create these lobbies and allow players relatively easy passage to these lobbies.

#

when the sign is broken that world is unloaded to prevent a session lock error happening, then the world folder is deleted

grim halo
#

Then your plugin is for personal use only?

high mantle
#

it is private yes

grim halo
#

Then just create 3 worlds per game at the start and link the signs to them.

tiny dagger
#

but how badly can a world be damaged?

#

🤔

#

I recommend only storing the damaged blocks in a deque

grim halo
#

I mean it is possible to create worlds when the sign is placed and remove the worlds when the sign is destroyed but if you need to use to dispatch commands to use worldedit you should not try to tinker with worlds like that.

tiny dagger
#

not sure but wasn't world unloading making leaks?

#

i'm sure for example i store location

#

a plugin unloading that map

grim halo
#

Depends. If you are carefull then not.

tiny dagger
#

could still be kept by a plugin

#

just for having that location reference

#

tho

#

locations are weakreferences now

grim halo
#

Does a location hold a strong reference to a World? let me check.

tiny dagger
#

it does not

#

but that doesn't mean other plugins don't use worlds

#

in different ways

high mantle
#

thats how i link my signs to their worlds

grim halo
#

Depends. If you are carefull then not.

#

If you write everything yourself and know what you are doing you can unload/load worlds if you want. Else you should not.