#help-archived

1 messages · Page 158 of 1

sage summit
#

how do I make it so a structure like a house moves 1 block sideways ever second or so?

frigid ember
sturdy oar
#

?paste

worldly heathBOT
frigid ember
#

help?

cobalt yoke
#

Corrupt chunk @frigid ember

#

It seems

frigid ember
#

wdym

#

weher

#

Corrupt chunk @frigid ember
@cobalt yoke what?

#

where is copupt chuck

sturdy oar
#

could you paste it so I check as well

cobalt yoke
#

Did you enable your server wirh 1 Mc version

#

And then changed

#

To another mc version?

frigid ember
#

no?

#

but i have viaverson

#

and viabackward

cobalt yoke
#

Your server was always in that versikn?

frigid ember
#

yes 1.15.2

#

:=(

#

do i remove viaversion adn biavackwards

lost cipher
#

is there a way to password protect a vanilla mc server?

sage summit
#

how do I make it so a structure like a house moves 1 block sideways ever second or so?

subtle blade
#

is there a way to password protect a vanilla mc server?
Vanilla? No. Though this sounds like "I want to run an offline server" 101

#

If you only want friends to join, however, use a whitelist

lost cipher
#

yeah, we thought of that but we allowed different clients to play because some of our friends use it

#

and people could just use our names and join in

deep aurora
#

I'm using 1.16, is there any plugins that allow bypassing of the 32x32x32 limit for structure saving using structure blocks?

torn robin
#

@lost cipher should probably tell your friends to buy the game 😉

sturdy oar
#

imagine buying games when you can give them access with an unsafe option from server.properties!

cobalt yoke
#

I will never understand why SpigotMC mods and most people is against offline-mode, but spigot itself gives an option to enable it

karmic stone
#

        if (event.getItem().getType().name().toLowerCase().contains("raw"));

        event.getPlayer().addPotionEffect(new PotionEffect(PotionEffectType.POISON, 100, 0));
}``` This is a code i wrote, so i player eats raw items he gets poisoned. But when the player eats cooked items even then he gets poisoned. Any solution for this?
lucid wasp
#

Might be better to check if the type equals something like raw chicken or raw porkchop

ember heart
#

You put ; at the end of the if statement

#

You're basically closing it

#

remove ; and your code will work

#

@karmic stone

karmic stone
#

ohh

#

but i get poison when i eat raw food

ember heart
#

Yeah you'll get poison whenever you eat anything with that plugin

#

or consume anything

karmic stone
#

if my code is wrong then i should get poisoned right

#

Yeah you'll get poison whenever you eat anything with that plugin
ohh lol

subtle blade
#

I will never understand why SpigotMC mods and most people is against offline-mode, but spigot itself gives an option to enable it
Because vanilla does

#

Not to mention it's a useful development tool

#

Additionally, Spigot uses it for Bungeecord

ember heart
#

^^^ same as "if /reload is so bad, why doesn't spigot remove the command"

subtle blade
#

We're not against offline mode. We're against offline mode if people are using it to support people pirating the game

karmic stone
#

        if (event.getItem().getType().name().toLowerCase().contains("raw")){

        event.getPlayer().addPotionEffect(new PotionEffect(PotionEffectType.POISON, 100, 0));
}
}```
#

like that?

ember heart
#

Yeah boi

#

That'll work

karmic stone
#

ohh

#

i literraly messed up lol

ember heart
#

Yeah you litteraly did lol

#

Hmm

#

I get this error while running buildtools

#

java.lang.TypeNotPresentException: Type org.apache.maven.plugin.surefire.SurefirePlugin not present

#

Here's my log

#

Any ideas?

tiny pebble
#
        twinMeta.addAttributeModifier(Attribute.GENERIC_ATTACK_SPEED, new
                AttributeModifier("generic.attack_speed", 3, AttributeModifier.Operation.ADD_NUMBER));

Is this the correct way to add an attribute modifier to an item?

I always end up getting:

Tankuu lost connection: Internal Exception: io.netty.handler.codec.EncoderException: java.lang.IllegalArgumentException: Invalid key. Must be [a-z0-9/._-]: minecraft:generic_attack_speed

What is the key it is referring to? I assume the string, but what do I set it to? I've set it to:
generic.attackSpeed, generic_attack_speed, minecraft:generic_attack_speed, and what it is right now.

Confused lol

subtle blade
#

That's the name. The name can be anything.

#

Is your server up to date?

frigid ember
#

ok i think i fixed it

subtle blade
#

@ember heart I see no commits recently that change Spigot, Bukkit nor CraftBukkit's pom.xml. Download latest BuildTools, delete the Spigot, CraftBukkit and Bukkit directories and re-run

tiny pebble
#

As of right now it is 1.16.1 and I believe the BuildTools is up to date unless there was a new 1.16.1 release

#

or unless the problem is that it's 1.16.1 haha

subtle blade
#

There are always new 1.16.1 releases

#

Check your /version

ember heart
#

@subtle blade I'll try again, I've had this error every time I tried builttools from the time since I started doing plugin development

#

Been a year since I tried last

tiny pebble
#

LOL
"You are 81 versions behind"

subtle blade
#

That'd do it

tiny pebble
#

hahaha thanks

ember heart
#

@subtle blade ran it again, same error, completly freshly downloaded Buildtools jar.

subtle blade
ember heart
#

smh im so lost

#

I guess I'll have to stick to semi illegal downloads for the rest of my poor life

subtle blade
#

Please don't lol

#

If you're going to do anything, at least do something legal and get a build from Paper

#

Though I recommend reporting this bug to the JIRA

ember heart
#

I found this dude having the same problem

#

Even though he's having some difficulties reporting it properly he's also never solved it

subtle blade
#

Next suggestion would be to make sure your version of Java is up to date and that you're running using Java 8

#

i.e. J8 b252

#

(or 251, whatever)

ember heart
#

Let me have a go at that

subtle blade
#

I'd advise doing the same with Maven

#

Make sure it too is up to date

ember heart
#

I'm on java build 1.8.0-251-b08

#

should be the newest

#

I'll hava a go with maven then

subtle blade
#

Yeah, Maven updates often get neglected

lofty meadow
#

Hello! I can't create a world, just normal world, by myself plugin. It error, but it say not a Spigot error, but I can't screenshot it, because it so many and so fast text appear.

ripe token
#

please help

#

how i do the plugin DeluxeTags

#

if you click about tag parkour is give you parkour prefix

winged sparrow
#

Tanku, ever have any luck with that thing?

tiny pebble
#

If I were to have an event that triggered something such as: Check for the next 5 seconds for [event], would I use BukkitRunnable? I want like... I click once, then for the next 5 seconds it checks to see if I click again and then says something if I do

#

@winged sparrow Indeed! I got it to work the exact way I wanted to. I was going to message you about it but I ended up working the rest of the day on it haha

subtle blade
#

1 sec, Tanku. Let me send you a snippet

winged sparrow
#

Ah that's awesome.

tiny pebble
#

Yeah, it was much fun working on that. Thank you again Gizmo 😛

fervent bone
#

can't verify my acc since it was verified with my old discord that got deleted what to do now?

subtle blade
#

@ Tanku

tiny pebble
#

Thank you!

subtle blade
#

You can apply the same thing to inventories and whatnot, similar concept

#

If you don't want to send a message after the 5 seconds has expired, you don't need that runnable at all. You can use a Map<UUID, Long> instead where the long is the time they clicked the block

tiny pebble
#

Damn that is hella impressive

subtle blade
#

If current time - the player's mapped value is < the time you want, success. Otherwise, failed

#

In this case, I wanted a message to be sent 😛

tiny pebble
#

Ah okay

gloomy arch
#

/function as:admin/craft_book_toggle

#

Can somme1 help why is this command not working?

cobalt yoke
#

Why your old discord got deleted? lol

surreal trail
#

Rip to WorldPainter it doesnt like 1.16.1 level.dat's had a 512 sphere from worldborder loaded to mess with a map without being ingame and it wont load all the chunks XD

winged sparrow
#

@subtle blade are tile entities able to store persistent data?

subtle blade
#

Yes

winged sparrow
#

OwO

subtle blade
#

Tile entities, players and items

winged sparrow
#

A lock system

subtle blade
#

someone's trying to add it to chunks too

winged sparrow
#

sounds really easy now

#

Who needs files when you have persistent data

subtle blade
#

Still need files

#

Doors aren't tile entities

winged sparrow
#

Yeah I know lol

lone fog
#

Tile entities, entities, and items*

subtle blade
#

Right, sorry. *Entities. Lol

winged sparrow
#

Didn't know players could store persistent data though.

#

Sounds like something I can abuse in some way.

subtle blade
#

The only use of persistent data I have is with the keys

lone fog
#

I use it a lot with items

subtle blade
#

I'm writing actual lock information to a JSON file

lone fog
#

I’ve also used it for spawner stacking

subtle blade
#

Best part is, I have everything wrapped behind a nice little API to do it all for me 🙂

#

Obviously everything there is optional, but you get it

#

Those key flags are handled by a single integer in persistent data too which is pretty awesome. I just use a bitmask

dusk shard
#

Choco is the key thing just a model?

subtle blade
#

Yes! Custom model data and a resource pack

#

It's a tripwire hook in vanilla

dusk shard
#

ah ok

lone fog
#

I like how you can have items look decent without a resource pack and with one now

#

Rather than them all being a tool without the pack

subtle blade
#

Yeah, model data was a great addition in 1.14

#

I can make my keys look however I want with a resource pack

#

Optional, obviously, but I bundle it with the plugin and save it in the plugin directory in case server owners want to use it

#

At least tripwire hooks sort of look like keys in vanilla so it's not a huge deal

lone fog
#

I wish server resource packs were less finicky

tiny pebble
#
    @EventHandler
    public void onRightClick(PlayerInteractEvent event) {
        if (event.getPlayer().getInventory().getItemInMainHand().equals(Items.twinBlade)) {
            if (event.getAction() == Action.RIGHT_CLICK_AIR) {
                event.getPlayer().spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(r));
                
                Runnable checkClick = () -> {
                    if (event.getAction() == Action.RIGHT_CLICK_AIR) {
                        event.getPlayer().spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(rr));
                    }
                    else if (event.getAction() == Action.LEFT_CLICK_AIR) {
                        event.getPlayer().spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(rl));
                    }
                };

                Bukkit.getScheduler().runTaskTimer(plugin, checkClick, 5, 60);
            }
        }
    }

How exactly would I go about having it check for the right-click again, instead of it checking twice for the first right-click?

#

Seeing from the messy code I have I know that it will just say that I right-clicked once, but display both r and rr when specified to, because it checks for the first right-click each time.. if that makes sense lol

subtle blade
#

That's where the Set comes in from earlier

tiny pebble
#

ohhhhh alright

subtle blade
#

Add the player's UUID in a set in that event. In the runnable, if the player is still in the set, send that message

tiny pebble
#

got it

subtle blade
#

The runnable should remove them from that set after x amount of time

winged sparrow
#

tank

subtle blade
#

Take another look at how I did it in my snippet

winged sparrow
#

If this is for a dual wielded weapon

#

Are you gonna make each strike deal damage?

subtle blade
#

I should have clarified, that bigger nested block of code was called before I did any of my unlocking stuff

#

and the removal from the set at the end was done after I unlocked everything

tiny pebble
#

I've already made each strike deal damage :P

We're doing something to present an idea to a community

#

yeah i got your snippet up and i'll go off that as well as everything you've said so far, i think i'll be able to get it

subtle blade
#

I have been meaning to open source everything too. Gotta do that soon. Just kept neglecting to do so

#

Maybe later today if I get bored lol

lofty meadow
#

Hello! ask 1! I use Linux server, every process of the server, like creating file or directory, then why that file or directory always set group to "minecraft"? Is it by default for the server? And can we change them?

sturdy oar
#

Would it be possible for me to provide and relocate my own SQLite driver?
I currently have few reasons to provide my own driver version so i dont't use Spigot's one, would that be possible?
I currently need 3.23.3, but older spigot versions provide very outdated builds

frigid ember
#

@lofty meadow it should never be Minecraft by default, you mustve set it yourself or your host provider

lofty meadow
#

Ohh, how?

frigid ember
#

or are you using minecraft as username?

lofty meadow
#

You mean my host name? Or my user name?

frigid ember
#

anything

lofty meadow
#

My host name is minecraft

frigid ember
#

then change it

lofty meadow
#

Ohh

#

Did you have so, too?

#

Hmm, ok thank you!

crimson sandal
#

Is there a method like isBlock to tell if an item has a 3D model like a block/chest or a 2D texture like a sign/sapling etc.

#

Or am I going to have to manually write a switch statement 😭

sturdy oar
#

maybe Material#isOccluding?

#

I'm not sure tho

#

or Material#isSolid

normal flume
#

is it possible to take a 1.8.x java world and put it in my 1.8.x spigot server?

sturdy oar
#

sometimes

tiny pebble
#

What I'm looking for is when I first right-click, it triggers an event that checks for a second right-click for the next couple seconds. When that second right-click happens, I want it to immediately send a message.

For clarification, is that what you were showing me @subtle blade? If it was, you don't have to re-explain it, I just want a clarification whether or not my brain is working slow today haha. I'm just struggling to understand and want to make sure I'm looking at the right thing

lapis plinth
winged sparrow
#

it's not initialized?

#

You can't just put a for in a class without having it do anything

frigid ember
#

how do i put armor on citizens npcs

winged sparrow
#

Are you trying to make it return those values?

#

if so put it in a return statement

#

@lapis plinth

#
public void listTopPlayers(Player player) {
  for (Player player : Bukkit.getOnlinePlayers()){
    User,getUser(player).getIsland().getOwner();
  }
}

if this is supposed to show a list.

lapis plinth
#

oh

tiny pebble
#
    @EventHandler
    public void onRightClick(PlayerInteractEvent event) {
        if (event.getPlayer().getInventory().getItemInMainHand().equals(Items.twinBlade)) {
            if (event.getAction() == Action.RIGHT_CLICK_AIR) {
                event.getPlayer().spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(r));
                Set<UUID> HAS_CLICKED = new HashSet<>();

                Runnable checkClick = () -> {
                    if (event.getAction() == Action.RIGHT_CLICK_AIR) {
                        event.getPlayer().spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(rr));
                    }
                };

                Bukkit.getScheduler().runTaskTimer(plugin, checkClick, 5, 60);
            }
        }
    }

I mean, shouldn't this technically work? Idk I feel that since there is a 5 tick delay, it checks for another right-click 5 ticks after the initial right-click for a 60 tick duration. I did try it with the UUID Set though I'm struggling to grasp on how I can apply that with this, so I'm trying other ways for the time being

karmic stone
#

        if (event.getItem().getType().name().toLowerCase().contains("raw")) {

            event.getPlayer().addPotionEffect(new PotionEffect(PotionEffectType.POISON, 100, 0));
        }
}``` 
This code should make raw food poisonous as per me, for some reason it doesnt
subtle blade
#

(1) You need an @EventHandler, (2) Have you registered your listener?

karmic stone
#

i have eventhandler

frigid ember
#

on essentials with the kit delay is it in ticks or minutes

karmic stone
#

it works if i write the same for rotten flesh

subtle blade
#

Also, if you're in > 1.13+, there are no "raw" materials

karmic stone
#

wdym

subtle blade
#

It's BEEF, CHICKEN, etc.

#

RAW_BEEF, RAW_CHICKEN was what they were called before 1.13

karmic stone
#

lol so again i cant give poison

subtle blade
#

You should have a Set<Material> of materials that you want to have give poison

karmic stone
#

like what will be the code format

#

i'll actually understand better like that

subtle blade
#
private static final Set<Material> POISONOUS = EnumSet.of(Material.BEEF, Material.CHICKEN, ... so on and so forth ...);

if (POISONOUS.contains(event.getItem().getType())) {
    // give poison
}```
karmic stone
#

so i need to make a new EventHandler?

subtle blade
#

No, you can still use the same one. Just change the condition

karmic stone
#

umm ok

lofty meadow
#

Hello! in Linux there are 3 types of file or directory permission, are u, g and o, I want to know that if the server interact to a file or directory, which permission that the server stand for or play as ? u, g or o?

#

server interact as an 'u' or a 'g' or an 'o'?

tiny pebble
#

Now using the UUID, I think my main problem is I don't know when to remove the UUID from the set?

    @EventHandler
    public void onRightClick(PlayerInteractEvent event) {
        if (event.getPlayer().getInventory().getItemInMainHand().equals(Items.twinBlade)) {
            if (event.getAction() == Action.RIGHT_CLICK_AIR) {
                event.getPlayer().spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(r));
                Set<UUID> HAS_CLICKED = new HashSet<>();
                HAS_CLICKED.add(event.getPlayer().getUniqueId());
                
                Runnable checkClick = () -> {
                    if (HAS_CLICKED.contains(event.getPlayer().getUniqueId())) {
                        event.getPlayer().spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(rr));
                    }
                };

                Bukkit.getScheduler().runTaskTimer(plugin, checkClick, 5, 60);
                HAS_CLICKED.remove(event.getPlayer().getUniqueId());
            }
        }
    }

I'm getting there... slowly but surely.

subtle blade
#

HAS_CLICKED should be a field, not a local var

#

and removal should be done in the runnable

karmic stone
#

hey choco where do i put the event name then?

#
    public static final Set<Material> POISONOUS = EnumSet.of(Material.BEEF,Material.CHICKEN,Material.RABBIT,Material.PORKCHOP,Material.SALMON,Material.COD,Material.MUTTON,Material.TROPICAL_FISH);
      if (POISONOUS.contains(event.getItem().getType())){
          Player player = (Player) event.getEntity();

          player.addPotionEffect(new PotionEffect(PotionEffectType.POISON), 80, 0);
    }``` ik this code is incomplete
subtle blade
#
    private static final Set<UUID> HAS_CLICKED = new HashSet<>();

    @EventHandler
    public void onRightClick(PlayerInteractEvent event) {
        Player player = event.getPlayer();
        if (Items.twinBlade.isSimilar(event.getItem()) && event.getAction() == Action.RIGHT_CLICK_AIR) {
            player.spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(r));
            if (HAS_CLICKED.remove(player.getUniqueId())) {
                // Here, the player has clicked for a second time within 5 seconds
                return;
            }

            HAS_CLICKED.add(player.getUniqueId());
            Bukkit.getScheduler().runTaskTimer(plugin, () -> HAS_CLICKED.remove(player.getUniqueId()), 5, 60);
        }
    }```
#

@tiny pebble

#

@karmic stone make that Set a field. It should be a constant field in your class. Then listen to the event like you had before but instead of
event.getItem().getType().name().toLowerCase().contains("raw")
use instead
POISONOUS.contains(event.getItem().getType())

limber forge
#

how can i sell a mc plugin on spigotmc

subtle blade
#

?premium

worldly heathBOT
karmic stone
#

ohh

limber forge
#

where can i see my posts?

subtle blade
#

On your profile, "messages"

#

Left side under your profile picture

limber forge
#

thank you

#

and when i have all i can do sell plugins instantly or should i go to the support first

fierce briar
#

Who called? Oh... nvm

tiny pebble
#

Would I add the UUID to the set just under where the first message was sent?

subtle blade
#

Yes, sorry. Forgot to include that

#

Right above or below the runnable call, wherever

#

@limber forge when you meet all requirements, the system will automatically allow you to upload premium resources. Though give it an hour or two of the requirements being met as it's not instant

#

You can actually make that a bit nicer by just moving the remove() call upwards

fierce briar
#

😉

subtle blade
#

See edit

karmic stone
subtle blade
#

Yes, then replace your if statement from your method earlier

karmic stone
#

yeah i did that too

subtle blade
#

Make that set private though, not public

#

It doesn't need to be public

karmic stone
#

ohh

#

            event.getPlayer().addPotionEffect(new PotionEffect(PotionEffectType.POISON, 80, 0));```
#

maybe this works

#

😐

subtle blade
tiny pebble
#

only problem i got is that it goes straight to thinking i clicked twice

#

might be the tick delay being 5 tho lol

subtle blade
#

It's because you click with both hands

#

You can ignore one of them if you'd like

#
if (event.getHand() == EquipmentSlot.OFF_HAND) {
    return;
}```
tiny pebble
#

oh interesting

#

thank you so much!

hollow thorn
#

help

karmic stone
#

ohh choco thanks, it worked. 🙂

#

My first plugin is almost ready

#

Also i really miss my idea of the dragon's breath giving u wither effect. If u get any updates or a method to do that pls DM me. Btw i just made the dragon a bit more OP so i could balance it

#

cya

hollow thorn
#

?paste

worldly heathBOT
subtle blade
#

Well I fixed the bug on 1.16.1 and PR'd it into CraftBukkit so it should at least be fixed then, but I can't speak for previous versions. Doubt that would be backported

#

We don't backport fixes unless it's gamebreaking

karmic stone
#

i mean.. u fixed it how? R u kinda staff?

subtle blade
#

Yes and a contributor. It's not in CraftBukkit yet, md has to review it

#

but I made the change that would fix it

karmic stone
#

Ohh nice, thanks

#

cya its night here i gtg

#

bye

subtle blade
#

o/

karmic stone
#

lol

hollow thorn
#

help

tiny pebble
#

I'd like to assume my problem now is just as simple as the if statement being out of place... where should that be if not the 5 places I put it 😂

As now it doesn't recognize the second-click

hollow thorn
wheat mirage
#

Can RGB chat colours be used in the motd?

tiny pebble
#

yes

wheat mirage
#

@hollow thorn format that better, it's unreadable

#

@tiny pebble How will it display to older versions?

tiny pebble
hollow thorn
#

how do i format it better

wheat mirage
#

@tiny pebble Those aren't the rgb chat colours

#

The motd code look like unicode references

#

I don't think they're encoded hex colours

#

@hollow thorn fix your indenting

hollow thorn
#

its the default indent

subtle blade
#

RGB colours are not displayed in the MOTD to clients older than 1.16

wheat mirage
#

What's displayed instead @subtle blade

subtle blade
#

Not certain what the client defaults to. White most likely

wheat mirage
#

I'm hoping the ping packet has a version attached

subtle blade
#

It must

#

Yes, protocol version

wheat mirage
#

Yeah my thoughts are more if the client doesn't know how to parse it, @subtle blade it may display horrible json. And yeah I hope so, there's a small chance it's only in the return payload

#

and nice

#

I suppose I can write some code to choose between 2

#

Thanks

wheat mirage
#

@hollow thorn this is the part where you say what's wrong with it

hollow thorn
#

it is outputting an error whenever i try to use the item

#

wait no thats the wrong link

#

?paste

worldly heathBOT
hollow thorn
#

@wheat mirage

sturdy oar
#

Plugin already initialized!

wheat mirage
#

Yeah that's about the most self descriptive error ever

#

and since you've not posted the full class the line numbers don't mean anything to me

hollow thorn
#

but i dont initialize the plugin

#

again

sturdy oar
#

:doubt:

wheat mirage
#

Uh yeah, you do

#

new StaffWeapon()

#

Store an instance and use it

hollow thorn
#

that initialises it

wheat mirage
#

Okay, before making any more plugins

hollow thorn
#

then how do i make bukkit runnables

wheat mirage
#

go and learn how to code

sturdy oar
#

omg really!?? who would've guessed that new creates another instance???

wheat mirage
#

then learn how to use java

sturdy oar
#

^

hollow thorn
#

how do i make bukkit runnables when the folder is in a different file

#

and i already have learnt how to code

wheat mirage
#

First of all

#

You learn java

sturdy oar
#

what do Bukkit runnables have to do with files?

hollow thorn
#

i just dont know the hole code

tiny pebble
#

aight now my only problem is that it only registers the second click if its basically instant

hollow thorn
#

what do Bukkti runnables have to do with files?
@sturdy oar i intilise the plugin in a different file to the file that im in currently

wheat mirage
#

The problem here is you've no idea how OOP works

sturdy oar
#

I haven't understood but ok

#

are you building a "plugin" module system for your plugin?

wheat mirage
#

@sturdy oar He doesn't know how to transfer the instance that Spigot creates into another file

hollow thorn
#

no i just have the use event

wheat mirage
#

@sturdy oar and if we spoonfeed him, he'll never learn

hollow thorn
#

in a different file to the initializer

sturdy oar
#

Yeah i don't like spoonfeeding either @wheat mirage

tiny pebble
#
    private static final Set<UUID> HAS_CLICKED = new HashSet<>();

    @EventHandler
    public void onRightClick(PlayerInteractEvent event) {
        Player player = event.getPlayer();
        if (Objects.equals(event.getHand(), EquipmentSlot.HAND)) return;
        if (Items.twinBlade.isSimilar(event.getItem()) && event.getAction() == Action.RIGHT_CLICK_AIR) {
            player.spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(r));

            if (HAS_CLICKED.remove(player.getUniqueId())) {
                player.spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(rr));
            }

            HAS_CLICKED.add(player.getUniqueId());
            Bukkit.getScheduler().runTaskTimer(plugin, () -> HAS_CLICKED.remove(player.getUniqueId()), 5, 60);
        }
    }

Anyone know why exactly it only registers my second click if it's like almost instant? Did I mix up the delay and period or..?

hollow thorn
#

@sturdy oar and if we spoonfeed him, he'll never learn
@wheat mirage fixed it

#

replaced new StaffWeapon() with Bukkit.getPluginManager().getPlugin("StaffWeapon"

#

)

sturdy oar
#

don't do that

wheat mirage
#

Not a great solution

sturdy oar
#

use dependency injection or static getter

odd knoll
#

@tiny pebble what you've done is make it remove them every 5 ticks after it's been 60 ticks.

#

Or is it every 60 ticks after 5 ticks.

#

Aghh.

tiny pebble
#

so should i make them both equal 🤔

#

i just want it to check for the second click within those said 60 ticks

odd knoll
#

Are you trying to make a cooldown?

tiny pebble
#

i would like a small cooldown for being able to click again, which is why i got the 5 in there

odd knoll
#

Ahh, kk. Yh.

tiny pebble
#

doin a double click thingy

odd knoll
#

What you've got will currently repeat.

#

If you do runTaskLater(Plugin, Runnable, tick time until it's run)

#

So if you want a 1 second cooldown, that tick time would be 20. P sure you know 🙂

tiny pebble
#

ahha, it has worked! thank you 🙂

odd knoll
#

👍 noice.

tiny pebble
#

how exactly would I go about adding in a third click check though 😅

subtle blade
#

You forgot a return statement, Tanku

#

Take a look at my earlier example

tiny pebble
#

Ah okay

I've also gotten the third click down 😛

#

now just gotta check for a left-click after the right-click 🤔
if i've gotten this far I can get further

floral heart
#

Hmm, I'm trying to make my plugin send a message in the chat, something like "Plugin started" when it starts. Although it doesn't seem to work when I'm using "onEnable", it seems like it just ignores the "broadcastMessage" command?

naive jungle
#

isn't it only broadcast(); ?

#

also, onEnable fires before you can join the server

#

so you can only see it after a /reload

floral heart
#

I tried with a reload

naive jungle
#

from ingame

#

try only broadcast();

floral heart
#

It takes two strings as arguments, I don't really know how I'm supposed to use it though

#

Lmao I'm sorry if I'm really annoying, I'm quite new to this thing xD I've coded a lot in the past but not plugins

naive jungle
#

sure

#

lemme take a look

#

ok

#

so

#

I was wrong, you only need to use Bukkit.broadcastMessage(string);

floral heart
#

Ah, okay

naive jungle
#

make sure you have all the arguments right

floral heart
#

Yep, thanks!

naive jungle
#

happy to help

floral heart
#

:D

#

Hmm, it still doesn't print out anything :/'

#

It does print out stuff when it's disabled and when it's 'supposed to', but not when it enables

#

This is my code:
@Override public void onEnable() { Bukkit.broadcastMessage("PlayerGreeter 2 has been enabled successfully!"); getServer().getPluginManager().registerEvents(this, this); }

subtle blade
#

broadcastMessage() sends a message to online players

#

Of which there are none onEnable() unless you're reloading

floral heart
#

I'm reloading :/

subtle blade
#

As in /reload

floral heart
#

Yea

subtle blade
#

¯_(ツ)_/¯

peak glade
#

hey

#

hello

floral heart
#

This is really driving me crazy xD

peak glade
#

you know serve r ip ?

#

my friend cant why ?

#

i have seerver ip why cant porblem ? i take it my friend say not work ?

#

so why cant server ?

#

i have serve online

hollow thorn
#

try joining and then leaving

#

before telling him to join

#

thats a glitch that happens with my servers for some reason

peak glade
#

no my server ip ?

hollow thorn
#

i had a problem

floral heart
#

Oh wait, I'm stupid, I didn't build the plugin before I tested the solution xDD

hollow thorn
#

where other people couldnt find my server

peak glade
#

i sent pic ok

hollow thorn
#

and it turned out that if i connected before leaving

#

it worked

peak glade
#

soo,,,,

#

my friend say not wrok why ?

#

i have online ip adress why cant my friend not work ?

frigid ember
#

hey

#

fsr there isn't a "server" command now

#

it just

#

disappeared off the face of the earth

hollow thorn
#

: Particle REDSTONE requires data, null provided

#

world.spawnParticle(Particle.REDSTONE, loc, 0);

tiny pebble
#

is there anywhere i can look to replicate the sweep_attack particle that the swords do? i know how to spawn the particle but I mean when it's in front of the player a specific distance that they're looking

hollow thorn
#

loc.getDirection

#

()

peak glade
#

how to port forwar

knotty karma
#

does the PlayerMoveEvent fire only if the player inputs to move, or will it fire whenever they move (specifically, will it continue to fire if the player is falling)

subtle blade
#

Any change in the x, y or z axis, or pitch and yaw

pure widget
#

I have a 1.16.1 server and whenever i enderpearl through the end city portal the server just crashes. idk what to do cuz me and my friend wanna play further on into the game

lone fog
#

Update

pure widget
#

what?

lone fog
#

Update spigot

pure widget
#

how do you do that?

lone fog
#

?bt

pure widget
#

sorry?

lone fog
#

Silly bot

pure widget
#

oh ok thanks 🙂

#

oh ok thanks 🙂

void glacier
#

Is there a simple way to have a block auto-connect to solid faces when setting the material or will I need to do this manually. E.g. Walls, glass panes, iron bars

worldly heathBOT
weak violet
#

my spigot plugin dosen't work

void glacier
#

?ask

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.

void glacier
#

First time I've done that haha

weak violet
#

Caused by: java.lang.NullPointerException
line 117

#

the Object playerConnection = this.fieldPlayerConnection.get(entityPlayer); line

#

i'm basically trying to make a command that makes me take 0 kb without having to use hacks or anything for fun with my friends

subtle blade
#

If it's just for friends, you're likely only running this plugin on your own server on a specific version. There's no real reason to use reflection here

#

((CraftPlayer) damaged).getHandle().playerConnection.sendPacket(new PacketPlayOutVelocity(damaged.getEntityId(), knockback.getX(), knockback.getY(), knockback.getZ()));

#

Though with that being said, that's not going to have the effect that you really want

#

It's sending a velocity packet to your own client but all other clients won't receive it. And even then, what you want to modify is what the server sees.

#

One tick later, zero the velocity using the Bukkit API

frigid ember
#

Hello, Please help me how to glitch mob from spawner. (not to hurt me)? If you write to me tag @frigid ember

subtle blade
#

(I say one tick later because events are called before they actually happen, so your velocity change will be overridden by the server otherwise)

weak violet
#

I got a bit fogged here

strange forge
#

hello, don't wanna interrupt the current conversation, quick question, should i shade/depend on log4j2 dependencies in my plugin or are those provided by default in bukkit?

subtle blade
#

afaik Bukkit supplies you with Log4J

strange forge
#

sweet, thanks

subtle blade
#

Or maybe it's vanilla. Idk. I believe one of 'em does lol

strange forge
pure widget
#

hey so i got build tool and git and did the command to update it all to 1.16.1 but it still crashes the server

lone fog
#

What does /version say

pure widget
#

do i put that into git bash?

#

ok just put it into git bash and it didnt work so what do i put it in?

subtle blade
#

No, on your server. It's a command

pure widget
#

oh ok

#

ill test ot

#

it*

peak glade
#

hello

#

can pic ?

pure widget
#

it says this

#

This server is running CraftBukkit version git-Spigot-758abbe-2b00831 (MC: 1.16.1) (Implementing API version 1.16.1-R0.1-SNAPSHOT) Checking version, please wait... You are 81 version(s) behind

lone fog
#

Then you didn't update

pure widget
#

what do i put into git bash then to update it?

lone fog
#

java -jar BuildTools.jar --rev 1.16

pure widget
#

i think i did do that but ill try again

lone fog
#

Did you replace the old jar with the new one

pure widget
#

the buildtools.jar?

lone fog
#

Your server jar

pure widget
#

how do i replace that one?

#

(sorry im not very good at this)

lone fog
#

Copy the one buildtools made to your server

pure widget
#

am i meant to place the buildtools.jar file into my server folder?

lone fog
#

No

#

The spigot jar it compiles

pure widget
#

how am i meant to tell if it has?

subtle blade
#

--rev 1.16.1

#

Not 1.16

#

After running BuildTools, the compiled jar should be in the root directory - the same place you ran that command

frigid ember
#

hey

subtle blade
#

Copy it over into your server directory

frigid ember
#

my server command

#

disappeared off the face of the earth

#

what happened???

pure widget
#

ohhhhhhhhhhhh i didnt look there so the folder called spigot-1.16.1.jar i put it in the place of my original server.jar file?

peak glade
#

@subtle blade

#

can dm please

lone fog
#

?ask

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.

peak glade
#

oh i want pic

#

sent

lone fog
#

Use imgur or something

peak glade
#

i cant

pure widget
#

coll do i do what i said a min ago?

peak glade
#

that right ?

#

its port fowording

pure widget
#

who is your wifi supplier?

#

like what company?

light orbit
#

can anyone help me

#

so I'm trying to import the java plugin

#

and it won't let me

pure widget
#

what does it say?

light orbit
#

let me show you

#

import java file isn't showing as an option for me

#

I already exported in spigot

pure widget
#

im not sure honestly i dont know loads about java but i thought i should've asked to see whats up incase i knew but sorry

light orbit
#

its fine

#

thanks for trying

pure widget
#

its good

#

does anyone here know about java?

opal bay
peak glade
#

@opal bay

opal bay
#

the pING

light orbit
#

ow do I access a repository whatever

peak glade
light orbit
#

how*

#

like where do I put this code

neat pulsar
#

Hello!

#

Does anyone has a good paid/free plugin for ranked/unranked 1v1 (duels). i'm trying to make a gamemode on my server.

pure widget
#

is there any free shop gui plugins for 1.16.1 yet?

tiny pebble
#

If I want a task to repeat every 40 ticks if a specific requirement is met, what would I use within the BucketScheduler? or Runnable..?

#

For context, I have Runnable regen = () -> player.setFoodLevel(player.getFoodLevel() + 1); which I want to run every 40 ticks when event.getPlayer().getFoodLevel() < 20 is true

weak violet
#
@EventHandler(ignoreCancelled = true)
  public void onDamage(EntityDamageByEntityEvent event) {
      Player entityA = (Player)event.getEntity();
      for (Player playerz : AntiKB.tobesecret) {
          if (playerz == entityA) {
                if (!(event.getDamager() instanceof Player) || !(event.getEntity() instanceof Player))
                      return; 
                    Player entity = (Player)event.getEntity();
                    KnockbackHandler_17.sendKnockbackPacket(entity, 0.0D, 0.0D, 0.0D);
          } else {
              return;
          }
      }
  }
  
  @EventHandler
  public void onKnockback(PlayerVelocityEvent event) {
    Player player = event.getPlayer();
    for (Player playerz : AntiKB.tobesecret) {
        if (playerz == event.getPlayer()) {
            EntityDamageEvent lastDamageCause = player.getLastDamageCause();
            if (lastDamageCause == null || !(lastDamageCause instanceof EntityDamageByEntityEvent))
              return; 
            EntityDamageByEntityEvent lastDamageCauseByEntity = (EntityDamageByEntityEvent)lastDamageCause;
            if (lastDamageCauseByEntity.getDamager() instanceof Player)
              event.setCancelled(true); 
      }
    }
  }
``` why dosen't this work?
peak glade
#

hi

#

guy please help me

#

i have port f

#

why cant offlne ?

#

why problem ?

hexed lodge
#

You have to Port Foward on Router and your PC Firewall

woeful kettle
peak glade
#

laptop

hexed lodge
#

It's the same, you have to have the ports open on the laptop's firewall

peak glade
#

firewall ?

#

yes

#

of course

sturdy oar
#

😕

hexed lodge
#

Follow that

sturdy oar
#

eww Windows firewall

peak glade
#

its woorkk

sturdy oar
#

it hurts my eyes everytime

opal bay
#

what firewall do u use then

pure pasture
#

Guys how can you remove all vanilla lore?

#

Including Enchants

#

cause when I use ItemMeta.getLore().clear() it gives me a Null Pointer Exception

opal bay
#

maybe the lore is null?

sturdy oar
#

what firewall do u use then
@opal bay UFW\Iptables

opal bay
#

I use firewalld

pure pasture
#

ohhh should i do a check before it?

opal bay
#

I'd guess

#

;)

pure pasture
#

Na didn't work sadly

halcyon snow
#

enchants aren't part of the lore I believe.

#

you can use ItemFlags to hide the enchantments among other things.

pure pasture
#

Ok but you no I still can't remove all the other lore

halcyon snow
#

If the lore is null, the item shouldn't have a lore?

pure pasture
#

That's the weird part

#

Or doesn't the "When in main Hand" thingy count as Lore?

pure pasture
#

Oh ok Thanks!

#

Yas it worked tysm!

hollow thorn
#

im trying to use org.bukkit.Color but its getting overriden by javautils

tawdry venture
#

Hello there! How can I convert a simple chat formatted text to json (for NMS)?

sturdy oar
#

i think there are already some text APIs out there

tawdry venture
#

so there are no inbuilt thing for that?

winged sparrow
#

TextComponent

hollow thorn
#

halp

winged sparrow
#

And ComponentBuilder

hollow thorn
#

so there are no inbuilt thing for that?
@tawdry venture ChatColor

naive jungle
#

im trying to use org.bukkit.Color but its getting overriden by javautils
@hollow thorn import the correct library

tawdry venture
#

@winged sparrow so I can use that in ChatSerializer.a(String) for example?

winged sparrow
#

Not certain.

#

Oh, no.

#

So you’re making a chat system with nms right?

tawdry venture
#

tab header and footer, to be certain

winged sparrow
#

Oh. There are in-API methods for that.

tawdry venture
#

||shame on me, but 1.8||

fallen garden
#

Is there currently anyway to check if a player is respawning to a respawn anchor?

winged sparrow
#

1.8 more like heresy

#

Haha kidding, good luck

tawdry venture
#

with or without protocollib, I have to use json

winged sparrow
#

I have zero expertise in that arena

wheat summit
#

Does anyone know how to simply grab a random entity from the EntityType.values() array?

#

Oh nevermind I just found it out

#

I was being stupid

tawdry venture
#

it looks like that ChatSerializer.a("{\"text\":\"" + formattedText + "\"}") works

naive jungle
#

Hello, when I want my plugin to load first of all, is there any way I can set it in plugin.yml? I am thinking something like this: depends: [*all plugins here*] but I can’t type in the names of all the plugins. Tried to search on google and the spigot website, no results

worn fiber
#

Is there a tag or something that I can add to a GUI that isn't the title so I can test for it in another class?

peak glade
#

hi

#

i want plotme 1.8.9.

#

please

worn fiber
#

I can't do getTitle()

peak glade
#

me ?

worn fiber
#

No

peak glade
#

i want plot pls

winged sparrow
#

@worn fiber Are you trying to get the custom name of the GUI?

#

If so, do getInventory().getViewer or something

peak glade
#

/plotme

winged sparrow
#

I know you can test for the name of the ui with a getViewer

peak glade
#

?plotme

undone narwhal
worn fiber
#

@winged sparrow I want to add a market or flag or something to the GUI that I can check for that isn't the GUI name because the name may change

#

getViewer() gets the name of the person who is looking at it

sturdy oar
#

UUID?

winged sparrow
#

I'm certain there's a method or similar one that is either getViewer() or getView() that lets you see the name, but perhaps you can put a specific item in there?

worn fiber
#

I could

#

Can I add a specific tag to an item to check for?

undone narwhal
#

What do you exactly need?

#

Player's name?

worn fiber
#

whether or the not the inventory GUI is a custom one and whether or not I should cancel the click event

undone narwhal
#

I always base this kind of events on the GUI name

worn fiber
#

I can do event.getView().getTitle() but if the GUI name changes I have to edit all instances of it

undone narwhal
#

Checking an item tag could be heavy

#

How do you define the name of your gui?

#

If you really want to be sure, just add invisible color code to the inventory name

worn fiber
#

GUI menu = new GUI(54, "Main Menu");

#

Here

undone narwhal
#

Like §1§2§3§f

#

It will be invisble

#

And you just have to

#

if (event.getInventory().getName().startsWith("§1§2§3§f"))

#

(check for possible NPE also)

worn fiber
#

If I do event.getView().getInventory(1).toString()

#

It outputs org.bukkit.craftbukkit.v1_16_R1.inventory.CraftInventoryCustom@545524a9

undone narwhal
#

Don't you have event.getInventory() ?

worn fiber
undone narwhal
#

This returns a CraftInventoryCustom

#

What's your event?

worn fiber
#

InventoryClickEvent

#

Yeah if the GUI is a custom one

worn fiber
#

It will say CraftInventoryCustom

undone narwhal
#

event#getClickedInventory

#

This is safe and easy

#

Warning: There is a @Nullable annotation

worn fiber
#

That outputs the same thing

#

getClickedInventory() outputs the same thing as getView().getInventory()

#

I'm gonna use getClickedInventory().contains("CraftInventoryCustom");

undone narwhal
#

But

#

How do you really create the inventory ?

#

Is it an overriden class ?

worn fiber
#

No

#
public class GUI implements Listener {
    private final Inventory gui;

    public GUI(int size, String title) {
        gui = Bukkit.createInventory(null, size, title);
    }

    // Defaults quantity to 1 if not specified
    public void addItem(ItemStack item) {
        gui.addItem(item);
    }

    public void show(Player player) {
        player.openInventory(gui);
    }
}```
undone narwhal
#

Cause getClickedInventory() returns an Inventory object

subtle blade
#

👏 When 👏 you 👏 open 👏 the 👏 inventory 👏 ... 👏 save 👏 the 👏 InventoryView 👏

undone narwhal
#

and you're applying .contains(STRING)

worn fiber
#

toString()

#
    @EventHandler
    public void clickEvent(InventoryClickEvent event) {
        if (event.getClickedInventory().toString().contains("CraftInventoryCustom")) {
            event.setCancelled(true);
        }
    }```
undone narwhal
#

🤦‍♂️

worn fiber
#

👏 When 👏 you 👏 open 👏 the 👏 inventory 👏 ... 👏 save 👏 the 👏 InventoryView 👏
What for?

subtle blade
#

So you can confirm whether or not it's your inventory

undone narwhal
#

There are bunch of options

worn fiber
#

This one works

#

Now I just need to prevent the player from dropping items into my GUI

subtle blade
#

CraftInventoryCustom is every single inventory opened by Bukkit

#

It's implementation

#

All Players are CraftPlayers, for instance

#

All Worlds are CraftWorlds

undone narwhal
#

Try to open a chest

worn fiber
#

Works fine

#

Because that's type org.bukkit.craftbukkit.v1_16_R1.inventory.CraftInventory

halcyon snow
#

with your code, you cancel the click event of any bukkit made inventory.

#

not just your own.

wheat summit
#

Do you guys know how to make Zombie Pigmen forced aggresive?

worn fiber
#

I don't know what else to do without hardcoding every single GUI I create

wheat summit
#

Or turn aggressive

undone narwhal
#
  • Set a specific name
  • Save Inventory
  • Save InventoryView
  • Cancel specific items click
  • Check if there is a special item
    .
    .
    .
subtle blade
#

Writing a snippet

worn fiber
#

You mentioned I could check for a character in the title

#

Maybe I could prepend something like Shop : Main Menu

subtle blade
#

I told you exactly how you can do it

worn fiber
#

I don't know how to check for the InventoryView though

#

And I've wasted enough of your time via the power of sheer idiocy

undone narwhal
#

You save you're inventoryview in a variable

#

Then as Attlantiz said: event.getView()

#

And add a .equals(Your saved View)

boreal tiger
#

you'd probably make a map of UUID -> InventoryView

subtle blade
#

Don't even need that

#

That's literally it

undone narwhal
#

That's a perfect shoot

worn fiber
#

Why do you use Bukkit.getPluginManager().registerEvents(this, this);?

subtle blade
#

Because I'm listening for events in that class

#

I have to register them

undone narwhal
#

Just forgot the getCommand().register but that's okay

worn fiber
#

Oh right

undone narwhal
#

I give you a 13/10

subtle blade
#

I didn't forget anything

halcyon snow
#

Is there a problem to using the InventoryHolder way?

subtle blade
#

Yes. Bukkit is not meant to be implemented by plugins

#

Implementing InventoryHolder was never intended

#

It'd be the equivalent of implementing Recipe, passing it anywhere and expecting the server not to blow up

#

In this case, it just happened to have worked

#

Also, RE:

Just forgot the getCommand().register but that's okay
All commands from a plugin have their default executor and tab completer assigned to the JavaPlugin instance. It implements TabExecutor

undone narwhal
#

Just saw it sorry

subtle blade
#

😛

#

But yeah, the custom inventory handling took no more than 2 listeners and ~10 lines of code

undone narwhal
#

I learn so much stuff everyday ! Thanks \o/

subtle blade
#

If you keep track of your inventory views, you have yourself a flawless system

worn fiber
#

what does openInventory() do?

#

Does it return anything?

boreal tiger
#

it opens an inventory, and yes

worn fiber
#

IntelliJ doesn't show anything when I hover

boreal tiger
#

it returns an inventoryview

worn fiber
#
    public InventoryView show(Player player) {
        return player.openInventory(gui);
    }```
#

I made a custom GUI handler

#

This will call and return the function, right?

boreal tiger
#

idk what gui is but that would return what openInventory returns yeah

worn fiber
#

GUI is an Inventory

#

plugin.customGUIs.add(menu.show(player));

#

I modified the code Choco sent to this

subtle blade
#

openInventory() returns an InventoryView, yes. That's what I'm keeping track of in my Set

#

And that's what you can use to compare against InventoryEvent#getView()

worn fiber
#

Ok cool

subtle blade
#

To differentiate between different types of GUIs in your plugin, you would have to keep track of different Sets of InventoryViews

worn fiber
#

Gonna test this now

subtle blade
#

Whether that's doing a Map<Class<? extends GUI>, Set<InventoryView>>, or holding a static Set in each of your GUI's classes, whatever

#

How you want to handle that is up to you

worn fiber
#

It cancels everything. Perfect!

#

Including stuff happening in my actual inventory

#

Meaning they can't drag stuff in there

subtle blade
#

Right and if you want to only do it for a certain inventory, InventoryView has getTopInventory() and getBottomInventory(), and the event has getClickedInventory(). You can compare and cancel accordingly if you'd like

cerulean musk
#

Guys i have a egg wars server. And when the game finished. Server shut down. İs there any code for autostart server ?

boreal tiger
#

the first map you sent choco would be hard to get the gui for a certain inventoryview

worn fiber
#

plugin.customGUIs.add(menu.show(player));
If I don't add this, then it's ignored

#

🎉

#

I don't think there's a scenario where I only need to block one or the other

#

The only scenario I can think of that would require a special case is blocking specific slots

subtle blade
#
if (INVENTORY_MAPPINGS.get(MyCustomInventory.class).contains(event.getView())) {

} else if (INVENTORY_MAPPINGS.get(MyOtherCustomInventory.class).contains(event.getView())) {

}```
@boreal tiger
worn fiber
#

Thanks a lot Choco

subtle blade
#

Or handle it in the GUI itself and delegate

boreal tiger
#

if you have multiple guis how do you know which gui class to use though

subtle blade
#

I literally just showed you

boreal tiger
#

but if I have 4 guis thats gonna look a bit ugly xD

subtle blade
#

Or handle it in the GUI itself and delegate

boreal tiger
#

ah right

subtle blade
#

Hell, if you really want to, Map<InventoryView, GUI>

#

That's probably even cleaner

boreal tiger
#

yeah thats what I meant

light orbit
#

how do I export a plugin from intellij

#

to mc

#

I have the plugin I just don't know how to export to the plugins file

odd knoll
#

You using Maven/Gradle or not (just play old stuff)?

light orbit
#

I don't know

odd knoll
#

I assume probably not then.

peak glade
#

how to hide

odd knoll
#

Go to File -> Project Structure -> Artifacts -> Click the + button -> JAR -> From modules with dependencies -> Specify main class, IDK if it's really required, probably not -> Remove anything that shouldn't be compiled with the JAR, e.g Spigot.

subtle blade
#

Sir that is a chicken

peak glade
#

yes how hide ?

#

anything

#

pigy or cow or horse

odd knoll
#

/gamerule doMobSpawning false?

peak glade
#

not ?

light orbit
#

got it ty

#

ok now I cant get this test server to work

#

like it wont show up

peak glade
#

cant

odd knoll
#

@light orbit what are you using to connect to the server, e.g what IP?

light orbit
#

idk I'm trying to do a spigot test server

#

I have my terminal thing in the background

#

saying it was set up

odd knoll
#

It doesn't just show up in your serverlist.

light orbit
#

how do I get it

odd knoll
#

If you use the IP localhost you should be able to connect to it.

light orbit
#

ok

#

yes!

#

it worked

#

tty

odd knoll
#

👍

#

@peak glade still having your issue?

light orbit
#

ok so the plugin I made isn't working

#

the thing in the plugins folder just says manifest

#

and when I open it its not my plugin

odd knoll
#

You shouldn't need to make a manifest file for a plugin.

#

Did you put it in the plugins folder?

light orbit
#

well I did what you said

#

I hit plugins

#

its right next to the plugins medi thing

odd knoll
#

Huh?

light orbit
#

is there a way to just like get the plugin in a file and manually put it in the folder

#

let me show you what this says when I export

odd knoll
#

That only creates the artifact configuration.

#

Not actually build it.

light orbit
#

how do I build it

odd knoll
#

At the top, hit Build -> Build Artifacts then it'll bring up a small menu in the middle. Click Build under the artifact you created.

desert kraken
#

Hey does anyone have any idea why the NBT of a playerskull is resetting when the user opens their inventory?

light orbit
#

k whats wrong with thishttps://imgur.com/a/nNhEak7

odd knoll
#

No ;

light orbit
#

k

#

it says theres an error

odd knoll
#

Too many brackets.

#

Please, learn Java.

#

You're also still missing two ;s.

light orbit
#

sorry I'm still learning

peak glade
#

hmm

proper cairn
#

im going to post my code cant get my UI to populate when in game

peak glade
#

what isuue

proper cairn
#

how do i make i look like it was copied from an ide

#

IDE

odd knoll
#

Then again at the end ```

frigid ember
#

anyone know how to make a multiple version minecraft server? like kitpvp is 1.8 and towny is 1.15? so the HUB SERVER will have 1.8-1.15 support

odd knoll
#

@frigid ember you just run them on different versions.

If you mean allow other versions to connect, check out the ViaVersion/ViaBackwards plugins.

#

@proper cairn try setting the owner, IDK if it's required but just try (the one you have as null RN).

peak glade
#

stop please i need hide

odd knoll
#

Do as I said before then kill mobs.
You can kill all non player mobs by doing /kill @e[type=!Player]

peak glade
#

say error: player not found ?

odd knoll
#

You running Essentials?

peak glade
#

yes?

crimson sandal
#

What's the easiest way to compare the additions/removals from each api version? Like a javadoc comparison or something?

odd knoll
#

/minecraft:kill @e[type=!Player] run that instead.

peak glade
#

here we go

#

wtf

#

that not hide ?

odd knoll
#

Ok, did you do /gamerule doMobSpawning false?

peak glade
#

here goty

frigid ember
#

Am I allowed to post a zip of a plugin to ask why it's not working?

#

everything compiles properly, but the actual stuff it's supposed to do just doesn't work in-game

#

It's an edited plugin and the only changes I made were updating to the latest Spigot repository

#

(for crafting recipes)

peak glade
#

why cant take ?

odd knoll
#

Wha?

peak glade
#

wait

frigid ember
#

?

peak glade
#

look

#

why i give you cant give ?

odd knoll
#

I have absolutely no idea what you mean.

peak glade
#

wait

#

how cant give you

#

wait look gift ok

#

gif

#

look

#

see ?

#

@odd knoll

odd knoll
#

Are you using some plugin to modify items?

peak glade
#

yes

odd knoll
#

Probably caused by that then. Nothing I can do.

frigid ember
#

Does anybody know why updating a repository would break a plugin? and how I can fix it

#

how do i make an npc (citizens) have an inventory like a shop or be able to speak once clicked

peak glade
#

hmmm

glossy thicket
#

hola alguien que ayude con mi problema

frigid ember
#

hmmm

#

hola alguien que ayude con mi problema
@glossy thicket i dont speak language

glossy thicket
#

spanish

frigid ember
#

no

glossy thicket
#

plis

frigid ember
#

ill go on google translate

glossy thicket
#

Do they help me with my problem

frigid ember
#

le ayudaré

#

no hablo español estoy usando el traductor de google

proper wolf
#

english fam

frigid ember
#

entonces cual es tu problema @glossy thicket

proper wolf
#

yeah i see

frigid ember
#

¿Hola?

#

te ayudaré con tu problema @glossy thicket

#

si me vas a hablar por favor @ me

sleek ivy
#

whats a good quests plugin, something with a gui maybe?

odd knoll
#

Quests is good from what I've heard.

glossy thicket
#

hola @frigid ember excelente servicio te pido una disculpa me equivoque de servidor de discord pero gracias por intentar ayudarme

frigid ember
#

ok

#

qué está mal @glossy thicket

#

hay algo mal con un complemento

#

o algo mal con tu servidor

#

Por qué no chateamos en los mensajes directos @glossy thicket

peak glade
#

hey

#

say multivese cannot create another world named plotworld ??

lapis plinth
#

Quests is good from what I've heard.
@odd knoll luxuryquests is better no cap

odd knoll
#

🤔

lapis plinth
#

😆

lone fog
#

What cap?

median swift
#

Anyone got crate plugins?

#

CratesPlus is not working

odd knoll
#

CrazyCrates.

median swift
#

CrazyCrates has gui set up?

odd knoll
#

¯_(ツ)_/¯

lone fog
#

I use GoldenCrates

#

Which does have a GUI

median swift
#

GoldenCrates doesnt work too

frigid ember
#

:|

lone fog
#

It should

#

It has a 1.16 update

frigid ember
#

how do i get rid of a world on multivers e it says "could NOT delete world"

molten whale
#

hay algo mal con un complemento
@frigid ember He said that he asked on the wrong Discord server, he meant to write on another server xD

frigid ember
#

oh lol

frigid ember
#

I updated a 1.14 plugin to the latest repository and it stopped working. Anyone have any idea why this would happen and how I can fix it?

lofty meadow
#

Hello! in Linux there are 3 types of file or directory permission, are u, g and o, I want to know that if the server interact to a file or directory, which permission that the server stand for or play as ? u, g or o?
@lofty meadow Hello! can anyone help me?

hardy cedar
#

I can't delay on join event

#

:(

lofty meadow
#

I can't delay on join event
@hardy cedar You can try java Bukkit.getScheduler().scheduleSyncDelayedTask(<plugin>, <Runnable>, <timeInTickToDelay>);

torn robin
#

anyone know if it's possible to give a spawner item with a specific type of mob?

lone fog
#

Not without a custom system

torn robin
#

thats dumb

proper wolf
#

How do I get the color of a bed on the PlayerBedEnterEvent

#

And when I get the color

#

cancel it for that bed

torn robin
#

getBed().getType()

#

each bed has its own material

proper wolf
#

getType()?

torn robin
#

yes

proper wolf
#

then what

#

Material.()

torn robin
#

you have the color of the bed

#

do you want to cancel it for all beds?

proper wolf
#

n

subtle blade
#

Not without a custom system
wot

proper wolf
#

just specific types

subtle blade
#

sure you can

torn robin
#

how 👀

torn robin
#

well @proper wolf just check if the block type is/isnt the color you want?

#

@subtle blade how would I use that to give like a creeper spawner?

proper wolf
#

what do I pass in getType @torn robin

torn robin
#

you dont pass anything

proper wolf
#

it doesn't expect a atgument

torn robin
#

yeah you dont pass anything

subtle blade
#

Get ItemMeta, cast it to BlockStateMeta. getBlockState(), cast to CreatureSpawner, modify to your desire, setBlockState()

#

Re-set the meta. You know the item meta system I'm sure lol

neon epoch
#

Ummmmmm i have a big issue

proper wolf
#

@torn robin

            if (event.getBed().getType().equals(Material.RED_BED)){

#

This would be the final code?

neon epoch
#

WHenever a certain player joins my server, the server crashes, is it possible that something in his inventory is causing it to crash or is there something im missing here

torn robin
#

you should use =='s for enums but yeah that'd work

#

it's very possible @neon epoch

#

@subtle blade

        ItemMeta meta = item.getItemMeta();
        if (!(meta instanceof BlockStateMeta))
            return item;
        BlockStateMeta bsm = (BlockStateMeta) meta;
        if (!(bsm instanceof CreatureSpawner))
            return item;
        CreatureSpawner spawner = (CreatureSpawner) bsm;
        spawner.setSpawnedType(EntityType.CREEPER);
        bsm.setBlockState(spawner);
        item.setItemMeta(bsm);

this look about right?

proper wolf
#

@torn robin I am gonna make a item stack to check for multiple colours

subtle blade
#

Sure only BlockStateMeta will never be an instance of CreatureSpawner

torn robin
#

o

subtle blade
#

Though BlockStateMeta#getBlockState() might

torn robin
#

gotcha

#

@proper wolf id probably make an enumset and check if the material is in that set

#

cleaner than making multiple item stacks

proper wolf
#

idk how to do that lel

subtle blade
torn robin
#

tf is a tag

#

looks useful

subtle blade
#

Mojang's way of grouping items and blocks together

#

It's an over-glorified EnumSet

#

(I guess in Mojang's case it would be an over-glorified HashSet lol)

torn robin
#

interesting

#

seems spaghetti-esque

neon epoch
#

Can someone help me plaease

torn robin
#

?ask

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.

subtle blade
#

It is kind of sloppy, yeah, but it allows for data-driven customizability

#

You can create your own tags in data packs

proper wolf
#

But how do I get a specific colour from a tag lets say

#

to exclude a bed

#

I'm limiting bed mining

#

and making it so it can be done with specific beds

#

hence why an item stack (my method) would be better

#

because if i wanted to add more features later

#

i can easily call it

#

I could also make dyes expensive on the "Blackmarket"

subtle blade
#

If you want just specific beds, you would do what MSWS suggested and create an EnumSet of your own

distant silo
#

Droppers don't fire in the end dimension for me in spigot 1.15.2

torn robin
#

@distant silo plugins?

proper wolf
#

How do I do that tho Choco

subtle blade
#
private static final Set<Material> BREAKABLE_BEDS = EnumSet.of(Material.RED_BED, Material.YELLOW_BED);```
#

etc. etc.