#help-development

1 messages ยท Page 410 of 1

quaint mantle
#

these are the set of commands

quiet ice
#

And using ./gradlew.bat does somethign similar?

quaint mantle
#

it return as not a command

quiet ice
#

We are attempting to execute one of these files (gradlew.bat) as a command

quaint mantle
#

it dont work

quiet ice
#

But it seems as if we need to chmod' it, which doesn't seem right to me

quaint mantle
#

java makes me cry

quiet ice
quaint mantle
#

error

onyx fjord
#

I doubt windows has chmod

quaint mantle
#

in ever instance

quiet ice
quaint mantle
#

even gradlew.bat has the same error

quiet ice
oak lark
#

I even tried making plugin with the api

tardy delta
#

what is this joke

onyx fjord
#

Isn't chmod from GNU or something

quaint mantle
#

java is making us question rality lmao

tardy delta
#

windows has attrib

icy beacon
oak lark
tardy delta
#

๐Ÿ’€

icy beacon
#

or even open

quiet ice
tardy delta
#

ok file just went away now ๐Ÿ’€

onyx fjord
#

Microsoft should abandon cli

quiet ice
#

I feel like copy con: x.bat isn't the proper command

undone yarrow
#

Why is the yellow stuff an empty body?

quaint mantle
hazy parrot
undone yarrow
tardy delta
quiet ice
#

like I know that con is some funny I/O handle, but why :

tardy delta
#

theres copy x.bat NUL: too or smth related

quaint mantle
#

@quiet ice how should we proceed

onyx fjord
#

echo. > file.txt ๐Ÿ‘ฝ

tardy delta
#

ok i have no clue what im doing

quaint mantle
undone yarrow
tardy delta
onyx fjord
#

It does?

quiet ice
tardy delta
#

ok it is copy NUL: x.bat

#

can we get a touch please

hazy parrot
quiet ice
#

Alternatively we figure out how to run a command under windows. But it will take a while till the linux-centric hivemind figures that one out

quaint mantle
#

the devs at minecraft mod development are more concered with how textures appear lmao

undone yarrow
quaint mantle
#

they our like holy books now

undone yarrow
#

k. I can always just ignore the warning right. It's not like the extra if will break anything

tardy delta
#

better be happy that there are docs

hazy parrot
quiet ice
#

Use Objects#isNull instead

quaint mantle
#

but it does

thorn crypt
#

Yo, is on the spigot api (api.spigotmc.org) a way to get the changelog of the latest version ?

quiet ice
#

๐Ÿ˜ข

quaint mantle
#

but everything we have been trying on my project seems to end with more errors

quiet ice
#

stop messing with poor geolykt

quaint mantle
#

i saw your github

#

it is nice

tardy delta
#

give this man some head pats

onyx fjord
#

I would love to eat some fish

quiet ice
quaint mantle
undone yarrow
#

why does IntelliJ like crashing so much

onyx fjord
#

๐Ÿคจ

quaint mantle
#

ikr

tardy delta
#

looks like a you problem

undone yarrow
#

I literally tried typing item and it froze at ite

onyx fjord
quaint mantle
#

imagine some dev makes messages using commits

#

lmao

onyx fjord
#

What did you smoke today

quaint mantle
hazy parrot
#

tbh i don't see brb err ๐Ÿ˜„

#

i just see first B

quaint mantle
#

who here is good at fixing bugs

lunar otter
#

Hi, I'm pretty new to spigot plugin coding, although I do have some java experience from past projects. I am making a custom weapon plugin.
In this plugin I have a weapon manager, and a custom weapon class to extend it from my new weapons. So i've got this in my CustomWeapon.java class:

public abstract class CustomWeapon {

    String name;
    int dura;
    ItemStack item;

    public ItemStack getItemStack(){
        return item;
    }

    public abstract void useItem(World worldIn, Player player);

    public CustomWeapon(String name, int dura, ItemStack itemStack){
        this.name = name;
        this.dura = dura;
        this.item = itemStack;
    }

}

Therefor, to make a new weapon, I create a new class which would look something like this:

public class FireWand extends CustomWeapon {

    public FireWand() {
        super("FireWand", 12, new ItemStack(Material.BLAZE_ROD));
    }

    @Override
    public void useItem(World worldIn, Player player) {
        player.sendMessage("You used firewand");
    }
}

What I would like to achieve is enchanting my itemstack directly. I've tried making a itemstack function when I would return the item after enchanting it, but it does not accept it inside the super() function.
Any idea how to fix?

tardy delta
#

<insert access modifiers>

quaint mantle
#

tf

onyx fjord
#

I can't believe yall are still trying to help

tardy delta
lunar otter
#

Alright I'm gonna try

hazy parrot
tardy delta
#

id just made json files for each custom item and write a loader

quaint mantle
onyx fjord
#

๐Ÿ˜

quaint mantle
#

`||Task :compileJava FAILED

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.

  • What went wrong:
    Execution failed for task ':compileJava'.
    Changes are not tracked, unable determine incremental changes.

  • Try:
    Run with --stacktrace option to get the stack trace.
    Run with --info or --debug option to get more log output.
    Run with --scan to get full insights.
    ==============================================================================

2: Task failed with an exception.

  • What went wrong:
    java.lang.StackOverflowError (no error message)

  • Try:
    Run with --stacktrace option to get the stack trace.
    Run with --info or --debug option to get more log output.
    Run with --scan to get full insights.
    ==============================================================================

  • Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.5.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 2m 4s
1 actionable task: 1 executed||`

tardy delta
#

i cant help with gradle

quaint mantle
#

and

#

Changes are not tracked, unable determine incremental changes.

hazy parrot
#

gradle trowing stackoverflow lmao

tardy delta
#

always gradle throwing the most weird exceptions

quaint mantle
icy beacon
onyx fjord
#

Minecraft code i guess

quiet ice
icy beacon
onyx fjord
#

?

quiet ice
onyx fjord
#

No that's not how it works @quaint mantle

quiet ice
#

exactly.

quaint mantle
quiet ice
#

The texture of the bat is much smaller than it's hitbox

hazy parrot
icy beacon
#

i need not the hitbox but the height of the visible entity

quaint mantle
quiet ice
tardy delta
#

reminds me i still want to make a custom items plugin

quaint mantle
#

i am doing maven

#

now

quiet ice
#

You cannot.

onyx fjord
#

Haha

#

Now 3 hours fighting maven

quiet ice
#

Maven does not work with modern forge

#

Nor does brachyura or any other build system

quaint mantle
onyx fjord
quaint mantle
#

cause i sure as hell am not going to quilt

quiet ice
#

Oh if you are using fabric you basically have the choice between gradle and (sl-)brachyura. Maven should not work

quaint mantle
#

that shit suck

quiet ice
icy beacon
#

i opened the texture file

quaint mantle
icy beacon
#

so where is the height

quaint mantle
#

make new texture

hazy parrot
quaint mantle
#

make it a block

quiet ice
onyx fjord
#

@icy beacon height isn't related to the texture

#

At all

quiet ice
icy beacon
onyx fjord
#

Decompile server

quaint mantle
lunar otter
icy beacon
#

are you trying to feed me the hitbox size or the height

onyx fjord
#

And look at entity classes I guess

hazy parrot
lunar otter
#

Ooh alright

haughty storm
#

I am trying to make a Team and add the player and an entity to it so they can't attack each other. But when I add both of them, they can still attack each other

        ScoreboardManager manager = Bukkit.getScoreboardManager();
        assert manager != null;
        Scoreboard board = manager.getNewScoreboard();
        team = board.registerNewTeam(p.getUniqueId().toString());
        team.setPrefix(ChatColor.DARK_PURPLE + p.getName());
        team.addEntry(p.getUniqueId().toString());

        team.setCanSeeFriendlyInvisibles(true);
        team.setAllowFriendlyFire(false);
quaint mantle
#

fun fact: if you try to make chatgpt write code to kill a mob it legit does it through commands

onyx fjord
#

Please leave the chat already

#

I'm tired

icy beacon
onyx fjord
#

Or just stop bring annoying

quaint mantle
#

too bad i am on coffee

onyx fjord
#

Being*

icy beacon
#

fyi

onyx fjord
icy beacon
#

everyone who is, will use the sweet button

#

please help yourselves to it

#

feeding attention to a person with nefarious intentions will spark a second breath into them

undone yarrow
#

wtf is going wrong here 'registerEvents(org.bukkit.event.Listener, org.bukkit.plugin.Plugin)' in 'org.bukkit.plugin.PluginManager' cannot be applied to '(me.justins_2006.forcepowers.forcepowers.EnableHotbar, me.justins_2006.forcepowers.forcepowers.ForcePowers)'

#

Should I use implements EventListener or smth? I tried but it didnt work

echo basalt
#

EnableHotbar doesn't implement Listener

#

your IDE's literally warning you about that

icy beacon
#

it's always so fun to wait 39 hours for a gradle project to start working

tardy delta
#

only 3 minutes

chrome forge
#

Hi everybody! Is it possible to add default language to resource pack? I'm using TranslatableComponent with PaperSpigot (but it doesn't matters here), and I need default translation if it was not found for specific language

icy beacon
tardy delta
#

is a TranslatableComponent like Component.translatable("container.crafting") -> Crafting Table?

icy beacon
#

xd

chrome forge
#

lmao

icy beacon
#

it's done

#

thought i'd die

tardy delta
#

i better hope im looking at the right class but it seems to have a fallback

#

dunno how that lombok constructor stuff works tho

icy beacon
#

well NoArgsConstructor means that there's a.. no args.. constructor

tardy delta
#

dont see any code that sets the fallback

chrome forge
# tardy delta

I'm on paperspigot, it's different. But the question about vanilla translations. PaperSpigot classes just use resourcepack for magic

tardy delta
#

ah @Setter

#

dunno what PaperSpigot is

chrome forge
#

It's fork of spigot

icy beacon
#

paperspigot is, well, paper

#

and to answer your question

#

?whereami

tardy delta
#

well isnt that class present then?

haughty storm
#

How could I spawn in an Entity with a custom pathfinding ai using nms? The resources I found didn't work for me, or sometimes I couldn't get the correct class name because I am using spigot-mappings

tawny remnant
#

How do i get the drops of an entity on death? I want to put them in the player's inventory.

quiet ice
#

Using spigot-mappings will become more and more painful

haughty storm
#

Then, sorry to ask this, but how would I change it to mojang-mappings

icy beacon
#

?switchmappings

tardy delta
#

reverse engineering crafting be like

haughty storm
haughty storm
#

I'm sorry to bother you again but I can't find the spawnEntity function in the mojang-mapped class

#

Or is there maybe some sort of nms guide using the mojang-mapping? I've never really used nms

quiet ice
echo basalt
#

Spawning a custom entity is as simple as this (mojmaps)

remote swallow
#

?nms

remote swallow
#

real

echo basalt
remote swallow
#

i didnt read the full message KEKW

echo basalt
#

clown

remote swallow
#

huge

icy beacon
#

anyone knows where to find the critical hit checker in mcp

echo basalt
#

?whereami

icy beacon
#

no shit

quiet ice
#

And is MCP Spigot?

icy beacon
#

so you don't know where to find it?

tawny remnant
#

Hello, I was wondering if there is a way to cast a ray from a player that checks if there are blocks in path. Thank you

quiet ice
#

Why would we?

icy beacon
echo basalt
#

But if you just want to get the target block, Player#getTargetBlock should work

echo basalt
icy beacon
#

i'm calm as hell rn

echo basalt
#

You come to a minecraft plugin related server asking about critical checks for a platform we don't support or care

echo basalt
icy beacon
#

i'm simply asking because i want my critical checker for SPIGOT to be as accurate as possible

quiet ice
#

Isn't it just "if vertical velocity < 0"?

icy beacon
#

nah there's a lot of conditions

echo basalt
#

It isn't just vertical velocity

icy beacon
#
  • A player must be falling.
    
    • A player must not be on the ground.
      
    • A player must not be on a ladder or any type of vine.
      
    • A player must not be in water.
      
    • A player must not be affected by Blindness.
      
    • A player must not be affected by Slow Falling.
      
    • A player must not be riding an entity.
      
    • A player must not be faster than walking (like flying or sprinting.)
      
    • A base attack must not be reduced below 90% damage due to cooldown.
      
#

from minecraft wiki

echo basalt
#

but more like vertical offset compared to next tick

tardy delta
#

damn im able to craft a diamond helmet

#

my crafting kinda works

quaint mantle
#
for (int i = 0; i < text.getText().length(); i++) {
    ChatColor color = ChatColor.values()[(i % ChatColor.values().length)];
    text.setTextComponent(i, new TextComponent(color + "" + text.getText().charAt(i)));
}``` What is wrong with it?
lunar otter
#

Hello, I'd like to run something every tick after a condition is met
So I have a wand that makes you go up in the air and applies levitation
I would like to make it so the levitation goes after reaching the ground, but for performance issues I don't think running every tick would be nice
How would I achieve that in a way smart way (not checking every tick)

tardy delta
#

if you dont know

undone axleBOT
lunar otter
#

Thanks

quaint mantle
# lunar otter Hello, I'd like to run something every tick after a condition is met So I have a...
public void onPlayerMove(PlayerMoveEvent event) {
    Player player = event.getPlayer();
    if (player.isFlying()) {
        Location from = event.getFrom();
        Location to = event.getTo();
        if (from.getY() > to.getY()) {
            Block block = to.getBlock().getRelative(BlockFace.DOWN);
            if (block.getType().isSolid()) {
                player.setFlying(false);
                player.setFallDistance(0);
                player.removePotionEffect(PotionEffectType.LEVITATION);
            }
        }
    }
}```
#

Something like this?

lunar otter
#

I'm gonna try to implement it thanks

quaint mantle
#

No worries man

lunar otter
graceful oak
#

Can anyone tell me what im doing wrong with this spawnParticle?

player.getWorld().spawnParticle(Particle.BLOCK_DUST, blockPosition, 1, blockPosition.getBlock().getBlockData());

no errors but no particle on break? When i swap the particle to something else it works am I not putting in the correct data for the Block_Dust particle

tiny ferry
#
    public void onEDeath(EntityDeathEvent event) {
        if (event.getEntity().getKiller() != null) {
         Player player = event.getEntity().getKiller();
         ItemStack playermeat = new ItemStack( Material.ROTTEN_FLESH, 1, (byte)4 );
         player.getLocation().getWorld().dropItem(player.getLocation(), playermeat);
         player.sendMessage("hi");
        }
        }

Any Idea why this event doesent fire at all?

#

for 1.19.3

tawdry echo
#

is registered?

tiny ferry
#

yeah ofc, its in my listener class

tawdry echo
#

@fresh templetHandler

#

lol

#

annotation

tiny ferry
#

oh my god...

#

thanks

river oracle
tawdry echo
#

:c

river oracle
#

the amount of times i've pinged them smh

zealous osprey
river oracle
#

I wonder how many times they've been pinged then it was deleted lol

#

That'd be an interesting stat

remote swallow
#

wait untill you find out about @urban grotto

river oracle
#

He was just asking foe ir

#

With that name

remote swallow
#

yeah

torn shuttle
#

hey quick sanity check, don't fireworks explode after a set amount of time based on power no matter what?

rough drift
#

they have diff explosion times based on power

#

like power 1 2 and 3

#

they travel further

#

Wait no yeah i am high

#

same tme

undone yarrow
#

Hey I have this right-clickable item in the first slot of my players hotbar, though I want the player to not be able to move it in the inventory, nor be able to drop it. The item should stay there forever. I don't think clearing and giving continuously is the best idea for this though, does anyone have any ideas?

#

What about using InventoryClickEvent and e.setCancelled(true), and do something similar for dropping

#

It works, but whenever I move it I keep the nether star in my movable cursor hand thingy, so it basically duplicates it

twin venture
#

Hello , i have a questions regarding Packets with procotollib , i got it working but i cross-version .
but i have a question about it if anyone good with it .

undone yarrow
#

Ughh whatever I try, it just won't work!!!! It doesn't clear the item in the cursor, and Ive already tried 10 billion things

    @EventHandler
    public void onMoveCrystal(InventoryClickEvent event) {
        // Check if the clicked inventory is the player's inventory
        if (event.getClickedInventory() != null && event.getClickedInventory().equals(event.getWhoClicked().getInventory())) {
            // Check if the clicked item is a nether crystal
            ItemStack clickedItem = event.getCurrentItem();
            if (clickedItem != null && clickedItem.getType() == Material.NETHER_STAR && clickedItem.hasItemMeta()) {
                ItemMeta meta = clickedItem.getItemMeta();
                // Cancel the event to prevent moving the nether crystal
                if (meta.hasCustomModelData() && meta.getCustomModelData() == 1) {
                    event.setCancelled(true);
                    Bukkit.broadcastMessage("Cancelled!");
                    if (event.getCursor() != null) {
                        // Clear the cursor item if the event was a result of a hotkey press
                        event.getClickedInventory().setItem(event.getSlot(), clickedItem);
                        event.getWhoClicked().setItemOnCursor(null);
                    }}}}}```
twin venture
#

iam not sure but maybe you need to do player.updateinventory?

indigo frost
#

hi, what is the way to make your custom item (itemstack) unplacable? For example my ItemStack is a tripwire hook and I want it to be right clickable (which I did) just not able to be placed

torn shuttle
indigo frost
#

pdc?

torn shuttle
#

persistent data container

tardy delta
#

?pdc

indigo frost
#

aight ill look into it, thx

torn shuttle
#

man this sucks

#

I've been working so much my wrist hurts

#

I bought a new vertical mouse, I'm working if I should get a split keyboard as well

eternal oxide
#

angle of hand to arm is the most important

torn shuttle
#

it doesn't really matter, I pulled a 24h work day followed by over a week of 16h work days

#

at some point regardless of your position your body is just going to give up

eternal oxide
#

you'll regret it later in life if you end up with carpal tunnel syndrome

torn shuttle
#

well to be fair I stopped when it started hurting, I'm still waiting it out right now

indigo frost
torn shuttle
#

it's going to take a couple of weeks for my new mouse to get here

#

I sort of like this keyboard, shame it uses brown switches I hate those

eternal oxide
#

I like browns

torn shuttle
#

not for me, I just find them to be hella sticky

eternal oxide
#

but I have found a BIG difference between one manufacturers browns to another

torn shuttle
#

I mean cherry mx brows are just cherry mx browns, isn't it all provided by the same manufacturer at the end of the day?

#

unless you're getting brown-alikes

eternal oxide
#

not these days, Cherry is the brand, but not all keyboards use cherry. They just say brown

torn shuttle
#

huh

#

I mean I've only been buying keyboards that specifically say they're cherry mx switches so I guess I'm just out of the loop

#

I'm using red switches right now, I quite like them

eternal oxide
#

I started with Cherry mx browns so I just stuck with them

#

felt fine to me

torn shuttle
#

I started with cherry mx browns and disliked it so much I switched as soon as i could

#

actually you know what I just went to check and I think I might've had it wrong this whole time, that keyboard might've been using cherry mx black

#

it probably was

torpid blaze
#

Hey,
Is there a way to pass the name a World should have with the WordCreator? Because I get a duplicate error when trying to load/create the same world twice I have copied from a worldfolder I have multiple worlds in.

lost matrix
#

Also: You cant load a world twice ofc

torpid blaze
lost matrix
grizzled oasis
#

how can i check if under the block placed event there's another block like a scaffolding?

torpid blaze
#

oh, is it getting regenerated?

lost matrix
torpid blaze
#

oh, nice

#

the uuid.dat?

lost matrix
tardy delta
#

me needed 2 hours to figure out the formula for (row - rowStart) * width + (col - colStart) - 1 ๐Ÿ’€

#

and lemme guess it wont work in all 100% of the cases

echo basalt
#

Like holy pandas or something

torn shuttle
eternal oxide
#

I went Ducky

torn shuttle
#

I am currently on a ducky v2, my favorite keyboard out of all I bought throughout the years

echo basalt
#

just go with an ISO layout ??

#

you can find keycaps with the fancy รงยบ~ยด keys

#

ยซ

quaint mantle
#

How can I use Brigadier?

#

I've tried Commodore but it's not documented very well

torn shuttle
#

I've been holding back from switching out of a portuguese layout because until recently one of my main activities was as a translator

#

that's sort of not really been the case lately and is unlikely to change so maybe I'll go back to other layouts

#

time to get dvorak

echo basalt
#

I'm fine enough with my keyboard atm

#

logi mx keys

#

ain't even mechanical

#

but costs as much as one

torn shuttle
#

tbf mechanical kbs don't have to break the bank

#

they can, but they don't have to

echo basalt
#

I used to use the shitty 30$ mechanical keyboards

torn shuttle
#

the one I posted earlier costs nearly 400โ‚ฌ

echo basalt
#

from those lovely iberian brands like Mars Gaming

#

or 1life clown_2

torn shuttle
#

1life lmao

#

from the store shelves to the trash heap in .5 steps

echo basalt
#

I bought a 1life mechanical keyboard that lasted a whole 2 days

torn shuttle
#

wow

echo basalt
#

for like 25 bucks

#

but tbf I also bought a HP keyboard for 10$ that lasted about 2 hours

torn shuttle
#

I'm shocked you found a 1life product that costs more than $10

echo basalt
#

or 15$ or whatever

echo basalt
#

they're a weird brand

torn shuttle
#

ah yes of course

echo basalt
#

I used to have a 1life mouse that I bought for about 12โ‚ฌ

#

that lasted me like 2 years

#

the paint on the abs plastic was peeling

quiet ice
#

I used to have a sun microsystems keyboard when I was little

echo basalt
#

I've always lived off cheap peripherals because I sweat tons and it always brokey

quiet ice
#

It was a good keyboard

echo basalt
#

and then I just bought some real good ones that are basically waterproof and haven't had problems since

torn shuttle
#

are you making puddles on your kb? the hell

echo basalt
#

yes

torn shuttle
#

nasty

echo basalt
#

It's a medical condition :(

torn shuttle
#

reminds me of why I want to throw you off a cliff

echo basalt
#

It's also one of the reasons why I hate phones

#

and touch screens in general

#

I only use my phone to check discord and play hay day

torn shuttle
#

meanwhile I had to stop washing my hands as much because they were so dry they just started cracking

echo basalt
#

I get surprised when my hands are dry

#

I once went for about 30 hours dry

#

felt weird

#

I have no grip

torn shuttle
#

even at the gym my hands barely get sweaty

echo basalt
#

I'm the complete opposite

torn shuttle
#

truly the ying and yang experience

#

one must throw the other off a cliff

echo basalt
#

I was thinking of travelling up north

#

maybe firebomb a couple houses around your neighbourhood

#

all fun n games until law enforcement sees this

torn shuttle
#

what a coincidence, I was considering going down south to train my portuguese water dogs for home security training

echo basalt
#

funny enough I got attacked by a dog today

torn shuttle
#

yeah I know

#

one of them got some training

echo basalt
#

damn didn't know you were an old lady

#

walkin her dogs

torn shuttle
#

I am a master of disguise

echo basalt
#

letting em shit on the sidewalk

torn shuttle
#

only when I know it's a sidewalk you'll be using

echo basalt
#

nah bro I levitate

torn shuttle
#

levitate higher and maybe the dogs won't get to you

echo basalt
undone yarrow
#

Can someone please help, my code won't work

#
    @EventHandler
    public void onInventoryClick(InventoryClickEvent event) {
        Player player = (Player) event.getWhoClicked();
        if (event.getSlot() == 0 && event.getClickedInventory() == player.getInventory()) {
            ItemStack clickedItem = event.getCurrentItem();
            if (clickedItem != null && clickedItem.getType() == Material.NETHER_STAR && clickedItem.getItemMeta() != null && clickedItem.getItemMeta().getCustomModelData() == 1) {
                if (event.getAction() == InventoryAction.HOTBAR_SWAP || event.getAction() == InventoryAction.SWAP_WITH_CURSOR || event.getAction() == InventoryAction.PLACE_ALL || event.getAction() == InventoryAction.PLACE_ONE || event.getAction() == InventoryAction.PLACE_SOME) {
                    event.setCancelled(true);
                    player.updateInventory();
                }
            }
        }
    }```
#

As you can see in the video, the item is still replaced by a nether star, or just straight up disappears

#

The last part is me pressing 1 when hovering over the second slot, to swap the items

#

I've literally been trying to figure this one little thing out for 5 hours now and it's still not working

#

I don't get it

#

I've literally tried everything

echo basalt
#

try it in survival

#

creative is funky

undone yarrow
#

wtff is going on

echo basalt
tardy delta
#

do me a favor and use early returns

undone yarrow
# tardy delta do me a favor and use early returns
    @EventHandler
    public void onInventoryClick(InventoryClickEvent event) {
        Player player = (Player) event.getWhoClicked();
        if (event.getSlot() != 0 || event.getClickedInventory() != player.getInventory()) return;
        ItemStack clickedItem = event.getCurrentItem();
        if (clickedItem == null || clickedItem.getType() != Material.NETHER_STAR || clickedItem.getItemMeta() == null || clickedItem.getItemMeta().getCustomModelData() != 1) return;
        if (event.getAction() == InventoryAction.HOTBAR_SWAP || event.getAction() == InventoryAction.SWAP_WITH_CURSOR || event.getAction() == InventoryAction.PLACE_ALL || event.getAction() == InventoryAction.PLACE_ONE || event.getAction() == InventoryAction.PLACE_SOME) {
            event.setCancelled(true);
            player.updateInventory();
        }
    }```
tardy delta
#

and now variables

undone yarrow
# echo basalt

Even like 50 AI enquiries from different chatbots couldn't figure it out

undone yarrow
tardy delta
#

never heard of variables

undone yarrow
#

of course I have lmao

#

But idk what you mean

#

with "and now variables"

tardy delta
#

getItemMeta returns a copy every invocation

warm galleon
#

In my plugin.yml, if I provide commands with permissions, do i need to then register the permissions or can I just leave it like that?
e.g. do I do this

commands:
  test:
    permission: test.test.perm

or do I do that + adding a permissions list with test.test.perm

eternal oxide
#

nothign more

warm galleon
#

so i can just do commands

eternal oxide
#

a permission on a command is automatically registered

undone yarrow
#

what's the problem

eternal oxide
#

I doubt you have to update the inventory if you cancel the event

analog thicket
kind coral
#

question for resource staff, can i sell an addon of a plugin that is not coded by me?

heavy mural
analog thicket
quiet ice
undone yarrow
#

The impact on performance is probably so small it doesn't really matter right

#

oh wait you mean player.updateInventory();

#

Let me remove it and see what happens

#

k it doesnt change anything. Ill keep it removed

eternal needle
#

Is there som way i can get minned blocks from player "Statistics" ? where you have everything from jump to killed mobs

eternal oxide
undone yarrow
#

They cant drop, cant swap, cant select, cant do anything with it

#

But it doesnt work

#

as shown in the vid

eternal oxide
#

then the InventoryAction doesn;t matter. if it's the star slot cancel the event. You also need to listen to drag and swop hands events

undone yarrow
#

I've already tried cancelling the event in 50000 different ways and it never ended up working

#

this is the closest it got to working... kinda

shadow gazelle
#

What would be the best way to save the state of a map before a skywars game?

#

Trying to think of how map resetting would work for something like skywars without nuking memory

#

I guess I could store the map as a schematic and load it then rebuild it when the arena is restarting?

kind coral
vagrant stratus
kind coral
#

no. the original plugin is not paid, the addon is not open source but the original plugin is

undone yarrow
#

Even AI just ruins the code even further when trying to help

eternal oxide
#

I just tested and my code protects hotbar slot 0 for everythign bar pressing Q

#

?paste

undone axleBOT
eternal oxide
#

thats just to test using raw slot

quaint mantle
#

does anyone know how to set entity's equipment enchanted?

tardy delta
#

uh oh what happens again when the client is fully responsive

undone yarrow
eternal oxide
#

Nope doesn;t for me

#

the only way I can remove the block from slot 1 is pressing q

undone yarrow
eternal oxide
#

ah ok, not a difficult fix for that though

mighty pier
#

how do get random number from 1 to 2 (must look clean yes)

undone yarrow
#

Well it took me 7 hours to get one thing working

undone yarrow
mighty pier
#

all i see is Math.random(RANDOM BULLSHIT GO!!)

undone yarrow
#

import java.util.Random;

// ...

Random random = new Random();
int randomNumber = random.nextInt(2) + 1;

mighty pier
#

iw ant clean

remote swallow
mighty pier
#

ok

outer raft
#

does anyone know how to order mob to move to exact position? im trying to create custom mobs without nms, spawn/respawn is ok, but i dont think do pathfinding without nms is possible at all. any advice or arguments why i must use nms

shadow gazelle
#

You need NMS for pathfinding

young knoll
remote swallow
#

too much brain power

smoky oak
undone yarrow
eternal oxide
#
    @EventHandler
    public void onClick(InventoryClickEvent event) {

        Bukkit.broadcastMessage("Slot: " + event.getRawSlot());

        if (event.getRawSlot() == slotToLock || (event.getHotbarButton() != -1 && event.getHotbarButton() + slotToLock == slotToLock))
            event.setCancelled(true);
    }```
undone yarrow
#

Those are some magic words. Let

#

's see if my computer understands them

smoky oak
eternal oxide
#

just remember this code is using raw slots so will only work for teh player inventory

#

so 36 to 45

undone yarrow
#

Wdym with that

eternal oxide
#

raw slots change depending on what inventory is open

smoky oak
undone yarrow
#

Ah I see

#

I tried it out with a chest and if I shift click it goes into the chest

eternal oxide
#

not too difficult to use Slots though

undone yarrow
#

So thats not really good

undone yarrow
smoky oak
#

shiftclickevent or smth like that

#

theres a bunch a events for inventory

#

click, hover, shift, etc

eternal oxide
#

shift click is in teh normal click event

smoky oak
#

oh

tardy delta
undone yarrow
smoky oak
#

nice to know

eternal oxide
#

just drag is not

smoky oak
#

wait

undone yarrow
smoky oak
#

doesnt every container inventory accept shift click

tardy delta
#

int ingredientIndex = (row - recipeStartRow) * getWidth() + col - recipeStartCol;

smoky oak
#

unless its shulker into shulker or a recipe not recognized

tardy delta
#

reverse engineering mojangs crafting

undone yarrow
smoky oak
#

average spigot dev

tardy delta
#

somehow my code is abusing me

#

something is false while it should be true

undone yarrow
#

Sounds normal to me

young knoll
#

Oh wait I have a solution for that let me find it

#
public class EverythingIsTrue {
   static void setFinalStatic(Field field, Object newValue) throws Exception {
      field.setAccessible(true);

      Field modifiersField = Field.class.getDeclaredField("modifiers");
      modifiersField.setAccessible(true);
      modifiersField.setInt(field, field.getModifiers() & ~Modifier.FINAL);

      field.set(null, newValue);
   }

  public static void main(String args[]) throws Exception {      
      setFinalStatic(Boolean.class.getField("FALSE"), true);
   }
tardy delta
#

kinda going well only handling empty columns or rows goes brr

#

im rethinking life choices now

young knoll
#

It doesn't anymore

#

Modern java is killing our fun!!!111

smoky oak
#

when did they fix it lol

tardy delta
#

probably cuz its public and static

smoky oak
#

java 9?

tardy delta
#

ah

#

i tried doing such stuff with Unsafe but i kept getting access violations

outer raft
young knoll
#

Whenever the stopped letting you reflect the Modifiers class

tardy delta
#

so i decided to write a proxy to dynamically change world generation

#

๐Ÿ’€

smoky oak
#

i doubt its a remapping problem per se

#

but its probs remapping causing the error

outer raft
smoky oak
#

i want to make sure it happens for me too

#

are you on 1.19

#

?

outer raft
#

just to mention, i didnt add maven config, only dependency. i didnt get if this is necessary

smoky oak
#

if its on maven you need to have the dependency to 'see' the methods and the plugin to be legally allowed to publish it

smoky oak
#

ye

#

its something how decompiling and publishing deobfuscated code is illegal

outer raft
#

oh, my bad, will try to add this

smoky oak
#

so you reobfuscate it

outer raft
storm stump
#

How can I make a custom entity jump when he gets stuck? I have an entity extending EntityInsentient and I want him to jump when he encounters a block. I'm using MoveController to make him move to a point, but he gets stuck when he has to go up blocks.

I'm essentially looking for autojump for custom entities. How is this done?

smoky oak
#

that path doesnt exist for me

#

i only have these two

#

net.minecraft.world.entity.monster.Zombie
net.minecraft.world.entity.monster.Monster

#

this zombie extends monster

#

you probably meant to use one of those two

outer raft
smoky oak
#

you mightve not reloaded ur maven

#

that sounds like nms paths

#

but without the remap applied

tawny remnant
#

how do i read and insert a boolean into config.yml?

smoky oak
#

?config

#

?cc list

remote swallow
#

?config-api

#

smh

remote swallow
undone yarrow
echo basalt
#

mans so dizzy he saw the word spin away and retyped it again

rough ibex
#

Alright, I have been trying to get this to work for over 5 hours with no luck. I have followed every tutorial I can find to a tee and nothing.
Trying to get 1.19.3 NMS. Yes, I have followed ?nms. Yes, I have looked at the wiki. Yes, I have ran buildtools already.
import net.mine nothing shows up. IntelliJ does not see it. I don't what to do anymore. I'm losing my mind over this

rough ibex
#

Maven.

lost matrix
#

Paste your pom pls

vocal cloud
#

send pom

lost matrix
#

?paste

undone axleBOT
undone yarrow
undone yarrow
#

Im too tired Im out of here

rough ibex
#

God damn magic I tell you

#

โ˜‘๏ธ

outer raft
#

@smoky oak thx) got properly remapped classes and it works fine ๐Ÿ’Œ

rough ibex
#

Thanks so much

storm stump
#

Yo does anyone know how to make movecontroller jump when the entity is stuck on a block

smoky oak
storm stump
smoky oak
storm stump
#

Yea sounds like a good sloppy fix

#

Definitely know there has to be a normal way to do this

#

Guess ill just keep scratching my head at the code because my NPCs might be idle and standing still and stuff

remote swallow
lost matrix
#

What do you mean by stuck on a block=

storm stump
#

Like autojump

#

The same criteria as autojump

#

When you're on a one block high jump and it should jump for him

lost matrix
#

Well... if your pathfinder changes from Y to Y + 1 then you need to jump.

storm stump
#

I'm not using pathfinder for efficiency

#

He'll walk in a straight line to the player and if he gets stuck like that then so be it

#

But there should be a non-pathfinding way to determine whether or not to autojump

#

I know for a fact that there isn't pathfinding code running for the player for autojump, right?

lost matrix
#

That can only be really done by polling the block in front of the entity

storm stump
#

The code should translate across the boundary right

#

I mean I'm fine doing polling since I'm recalculating every tick

#

Should I just check the bounds? Seems like a dirty solution

lost matrix
#

Yeah but its not exactly cheap. You basically ray trace in front of you and jump depending on your current velocity

storm stump
#

Yikes a ray trace per tick per entity isn't exactly efficient so yeah

lost matrix
#

You can just get the block in front and let him jump until he climbs up. Not exact but very cheap.

storm stump
#

Like if there's any block towards the front of him yeah I guess that would work

lost matrix
#

Any full block, yeah

storm stump
#

And entities might get stuck jumping on walls but that is whatever

#

Already happens ๐Ÿ˜…

lost matrix
#

You also need to check if the block above is air

storm stump
#

Could even do a check for two block high to prevent it

#

Yeah

lost matrix
#

Shouldnt add much time

storm stump
#

How should I do this just round the current look direction into one of 4 Vector3s

#

Vector3(1,0,0)
Vector3(-1,0,0)
Vector3(0,0,1)
Vector3(0,0,-1)

#

And then find the relative block with that vector3

lost matrix
#

Get the current block and facing of the entity and then block.getRelative(facing)

#

Or better translate the movement vector to a BlockFace and call that method.
Because then they can also jump over blocks backwards.

undone yarrow
#

Cant you shoot a ray from your players feet and see if there's a block in a very short distance

#

idk if thats possible with spigot

#

and minecraft

storm stump
#

Raycast is expensive for thousands of entities

#

Per tick

undone yarrow
#

oh

#

But why are you doing this, if I may ask

tawdry echo
#

someone have good guide about packets, i want to know how to manage it all

storm stump
#

Could be thousands of mobs

#

Want really basic pathfinding

quaint mantle
#

Hello anyone that can make a plate system like warzone 2.0 or a chest system dm me

storm stump
undone yarrow
quaint mantle
undone yarrow
#

Then ask for help. But you're asking someone to make something for you

quaint mantle
#

?services

undone axleBOT
lost matrix
storm stump
#

True i guess

quaint mantle
#

Can someone Pls show me how to make a plate system like warzone 2.0

lost matrix
#

Just generate a height map of the entire world. That never changes. Then you can use this (immutable) height map
in multiple threads for some really efficient pathfinding. This way you could even create paths over thousands of blocks.

storm stump
#

Pathfinding still doesn't need to be great it can be dumbed down for them

storm stump
#

Then it can be done in multiple threads too

undone yarrow
storm stump
#

Well what if I have caves and shit

storm stump
#

If they get stuck on a wall then they can pound it

lost matrix
#

They get mapped out as well. If they are static like the rest of the world then you just need to map it out once and
every time the world changes

undone yarrow
lost matrix
#

For dynamic dungeons: Generate a height map when the dungeon generates

storm stump
#

Well they would only get stuck temporarily

#

Until the player leaves or kills them or whatever

#

Unless they fell into a hole or something lol

undone yarrow
storm stump
#

Lmfao

eternal oxide
#

Interesting, PlayerDropItemEvent fires after modifying the Players inventory and a cancel throws the item back in, so no way to check where the item came from

hexed falcon
#

how do i make an item invulnerable to any damage

#

like fire explosion etc

#

i tried unbreakable but it didnt work

undone yarrow
eternal oxide
#

yep just been messing around

#

in yoru case this part is easy as you have meta on it

undone yarrow
#

Ahh alright

eternal oxide
#

if you don;t have a way to identify it you can't detect in teh drop where it came from

#

btw I got teh click all cleaned up ```java
@EventHandler
public void onClick(InventoryClickEvent event) {

    if ((event.getSlot() == slotToLock && event.getSlotType() == SlotType.QUICKBAR)
            || (event.getHotbarButton() != -1 && event.getHotbarButton() + slotToLock == slotToLock))
        event.setCancelled(true);
}```
#

that protects a hotbar slot and only that slot no matter what inventory you have open

undone yarrow
#

damn thats looking clean

#

Ill check tomorrow

eternal oxide
#

yep

#

I wanted to block Q too but I can't with general items. You can easily though as you have custom model data to check

dry yacht
analog thicket
#

Altough i wanna add some more visual stuff like particles, its kinda boring atm.

storm stump
#

Thank you brother

vale veldt
#

how can i drop experience orbs in a specific location? i have seen that you can use this:

"world.spawn(location, ExperienceOrb.class).setExperience(experience);"

But for example in the spigot API it doesn't say (?)
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/World.html
Is there a better way to do it?
the player for example has a method to set experience or levels, if I want to drop 2 levels of experience in a particular location are there methods to do so? should I use NMS?

eternal oxide
#

use the spawn method that takes a consumer

vale veldt
eternal oxide
#

you calculate it as it only accepts an int

vale veldt
#

it would be nice if there was a method for levels as the player has for example ๐Ÿง

trim lake
#

How can I wait 1 tick in event listener?

remote swallow
#

BukkitScheduler.runTask()

#

?scheduling

undone axleBOT
trim lake
#

I found soemthing like e.wait() but thanks thats what Im looking for

winged anvil
#

@sterile token werenโ€™t you working on some command api to make handling tab completions and handling arguments easier or something?

#

swore someone was working on that

quaint mantle
#

Check BlobLib

#

It's like a framework for Bukkit/Spigot development

#

It wraps everything in managers. It has builtin stuff like CrudManagers (quickly make CRUDs for SQLite or MySQL, a CrudManager for MongoDB is coming soon)

#

It is oriented to design objects to be serialized and deserialized asynchronously, even Bukkit worlds without any issues.

remote swallow
#

wheres the actual command framework then

quaint mantle
#

It's not a command framework

#

It's just like a wrapper

remote swallow
#

so wheres the command lib they wanted you said it had

quaint mantle
#

I'm first orienting wrappers to work with BlobLib plugins.

winged anvil
quaint mantle
#

I also made an IntelliJ IDEA plugin to quickly generate classes for BlobLib plugins

#

The best thing from BlobLib is that it can share objects between BlobLib plugins and BlobLib, such as BlobInventories, BlobMessages and such

quaint tapir
#

` List<String> loreList = player.getInventory().getItemInMainHand().getItemMeta().getLore();

                    String lore = loreList.get(0).toString();
           
                    int charge = Integer.decode(lore);
                    charge--;
         
         
                    ArrayList<String> NewLore = new ArrayList<>();
                    NewLore.add(ChatColor.GREEN + "" + charge);
              
                    player.getInventory().getItemInMainHand().getItemMeta().setLore(NewLore);`

I'm trying to get the lore of an item
turn it to an integer
minus one
set the new value as the new lore of the item
this doesn't work and I've tried many methods can anyone help

#

the code copy pasted kinda weird

#

but hopefully you can read it

winged anvil
quaint mantle
remote swallow
quaint mantle
#

It's not needed, I did it that way prior to ensure people starting to adopt BlobLib ๐Ÿคก

worldly ice
#

ItemStack#getItemMeta returns a copy of the item's meta

remote swallow
#
ItemMeta meta = player.getInventory().getItemInMainHand().getItemMeta();

//your code minus the first and last line

player.getInventory().getItemInMainHand().setItemMeta(meta);
worldly ice
#

^

torn shuttle
#

this sucks, I can't work on anything because I'm starting to have a repetitive strain injury on my wrist

remote swallow
#

massive L

#

go buy a new dog

quartz basalt
#
        at net.md_5.bungee.api.ChatColor.translateAlternateColorCodes(ChatColor.java:216) ~[bungeecord-chat-1.16-R0.4-deprecated+build.6.jar:?]
        at nesancodev.com.supershows.spotlights.SpotlightCommand.t(SpotlightCommand.java:148) ~[SPM-1.0-SNAPSHOT.jar:?]
        at nesancodev.com.supershows.spotlights.SpotlightCommand.onCommand(SpotlightCommand.java:137) ~[SPM-1.0-SNAPSHOT.jar:?]
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[pufferfish-api-1.19.3-R0.1-SNAPSHOT.jar:?]
        ... 23 more```

why is this error happening

```java
sender.sendMessage(t(MessageUtil.getText("spotlight", "created")));```

```java
    public static String getText(String category, String key) {
        String lang = SuperShows.getInstance().getConfig().getString("lang");

        FileUtil util = new FileUtil(new File(SPM.getInstance().getDataFolder().getAbsolutePath() + File.separator + "languages" + File.separator + "lang_" + lang + ".yml"));
        YamlConfiguration configuration = util.getConfiguration();

        return configuration.getString(category + "." + key);
    } ```

```java
    private String t(String m) {
        return ChatColor.translateAlternateColorCodes('&', m);
    }```
torn shuttle
remote swallow
#

raise the budget then

remote swallow
quartz basalt
#

the bottom method

remote swallow
#

String m is null im guessing

#

text to translate is coming from ChatColour so m is null

quaint tapir
#

say I have the lore as ChatColor.GOLD + "50"
how can I get the "50" as a string without the chatcolor being involved

#

basically how do I remove chat color

remote swallow
#

ChatColor.stripColour(string)

quaint tapir
#

String lore = loreList.get(0).toString();

#

so if I have this

#

where do I put

#

ChatColor.stripColour(string)

#

wait im stupid

#

nvm

remote swallow
#

String lore = ChatColour.stripColour(loreList.get(0));

echo basalt
#

ew

#

colour

quartz basalt
compact haven
#

double check your path after those 10 million concatenations is correct

#

and verify that using File.exists, so extract it from the FileUtil instantiation

#

and then print every key inside of that YamlConfig

#

iirc util.getConfig() or something you have it

warm galleon
#

will an error be thrown if i sendMessage to a command sender that is a console

#

this is a really dumb question but im on my phone and cannot test it xD

dim bronze
#

why should there be

#

sendMessage exists on CommandSender for a reason

warm galleon
#

does it send a message to console?

dim bronze
#

it does

warm galleon
#

oh

#

nvm

sick edge
#

Hi, is there any way to load a world multiple times into the memory at the same time? (They are never going to save anything and the actual world file is supposed to function as a backup file/template)

ruby mesa
#

how would I check if someone starts eating a food? like they're in the process of eating the food?

#

what event is that

storm stump
#

PlayerItemConsumeEvent

#

Potions and shit are included too so make sure to check it's food

ruby mesa
#

doesnt that fire when someone actually eats the item?

#

I wanna check if they player like right clicks it and starts eating it rn

#

if that makes sense

storm stump
#

Yea i'm not sure if an event exists for that

ruby mesa
#

alr

#

ill just use an item that isnt consumable then

storm stump
#

Oh yea cuz I don't think there's any packet to send to cancel the eating animation

#

So cancelling it wouldn't make sense

ruby mesa
#

yeah

storm stump
#

So it doesn't exist :p

ruby mesa
#

np

storm stump
#

ye

#

yw

weak meteor
#

Im making a plugin based on GUIS

#

but when i like, click and open the gui and stuff

#

its ok bc i cant move anything

#

but then i cant put or destroy blocks

#

OH NVM

#

I JUST NEED TO DELETE THE LAT LIKE

#

LAST LINE

storm stump
#

Lmaoo

copper scaffold
#

how can i disable chest open animation?

warm galleon
#

if I want to pardon an account, do I have to unban the account AND the IP? Like how would I check if it is IP or Name banned?

copper scaffold
#

did you used
/ban-ip
or
/ban?

warm galleon
#

what

#

this is plugin development

weak meteor
#

Should i use multiple classes for each gui i wanna listen?

#

like

#

actually i have 4 different guis

#

and im listening to them in the same class

#

my question is: Affect anyway if i do multiple listeners classes?

raw crow
#

hello

#

i am having trouble at build tools installation

#

is someone online to help me pls?

hazy parrot
#

?ask

undone axleBOT
#

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. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!

hazy parrot
#

So not smth to worry about

raw crow
#

can i send images here?

solemn frigate
#

hey, how would I send a plugin message directly to a player's client from bukkit?

raw crow
#
[ERROR] Cannot invoke "java.util.List.stream()" because the return value of "org.apache.maven.project.MavenProject.getCollectedProjects()" is null
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
Exception in thread "main" java.lang.RuntimeException: Error running command, return status !=0: [C:\Windows\system32\cmd.exe, /D, /C, D:\apache-maven-3.9.0/bin/mvn.cmd, -Dbt.name=3669, install:install-file, -Dfile=work\bukkit-c69e3af0-members.csrg, -Dpackaging=csrg, -DgroupId=org.spigotmc, -DartifactId=minecraft-server, -Dversion=1.19.3-R0.1-SNAPSHOT, -Dclassifier=maps-spigot-members, -DgeneratePom=false]
        at org.spigotmc.builder.Builder.runProcess0(Builder.java:1055)
        at org.spigotmc.builder.Builder.runProcess(Builder.java:986)
        at org.spigotmc.builder.Builder.runMaven0(Builder.java:955)
        at org.spigotmc.builder.Builder.runMavenInstall(Builder.java:914)
        at org.spigotmc.builder.Builder.main(Builder.java:523)
        at org.spigotmc.builder.Bootstrap.main(Bootstrap.java:27)

I am having this trouble when run BuildTools

#

the .bat file:

java -jar BuildTools.jar --rev 1.19.3 --remapped
pause
sullen marlin
#

Hmm maven 3.9 jumps out at me, I'm not sure if that version has been tested. Could be worth trying a different version

weak meteor
raw crow
#

oh ok

sullen marlin
#

Im testing 3.9.0 now

#

3.9.0 is broken, don't use it

raw crow
#

ok thanks very much

sullen marlin
#

buildtools will download an appropriate version though, you dont need it unless oyure developing plugins

raw crow
#

thanks again!

quaint mantle
#

Then check if itโ€™s a right click

#

And they are holding it

#

If that triggers add them to a list of players and ignore it if the list contains it

#

Or just cancel the interact

lethal coral
#
    @EventHandler
    public void onPlace(BlockPlaceEvent event) {
        ItemStack placedItem = event.getPlayer().getInventory().getItemInMainHand();
        // ...

For some reason this is returning null if the player places with only one item. What can I do to get the item they're placing? I have tried event.getPlacedItem() or whatever it is but it doesn't work either.

jagged monolith
#

Try getItemInHand() Otherwise getPlacedBlock() should work as that will return the Block then you just get the itemstack from that.

lethal coral
#

I haven't tried the getPlacedBlock() but I need the itemstack specifically for the nbt

young knoll
#

BlockPlaceEvent#getItemInHand

#

Should always return the item before it gets removed/modified

warm galleon
#

to ban someone using IP, is the target the players username or hostString

wary topaz
#

If you want to ban a player using their username (not player module) You will need to use the getPlayer() bukkit funtion, than you will add them to the bukkit banlist.

#

make sure to have null checks

warm galleon
wary topaz
#

One moment while I read through this.

warm galleon
#

oop forgor to set the expiry

wary topaz
#

you dont need .getHostString

#

i dont think

remote swallow
#

the ban list name is actually uuids

#

iirc

wary topaz
#

but what I did for my banning plugin, I actually used a custom banlist with a bans.yml

warm galleon
wary topaz
#

uhh

warm galleon
#

because i do remember reading somewhere they deprecated name bans

warm galleon
wary topaz
#

tye

#

ye

#

I used async player join event

warm galleon
#

i see

#

that makes a lot of sense actually

#

more control

wary topaz
#

ikr

warm galleon
#

im stupid LMAO

wary topaz
#

wait no I think it was player login event

young knoll
#

Thatโ€™s what everything on the internets seems to recommend

wary topaz
#

you're not stupid :C

wary topaz
young knoll
#

I canโ€™t find any actual info on how the Bukkit ban lists work

warm galleon
wary topaz
#

ye

warm galleon
#

i dont think so

#

like as in timing or something

#

idk

wary topaz
#

X__gamer you might not even need a plugin for that, just use a chunk loader

young knoll
#

Use the AsyncPlayerPreLoginEvent

#

If that exists in 1.8

wary topaz
warm galleon
#

not sure

sick edge
wary topaz
#

ohhh

#

just load the world?

delicate lynx
#

it does exist in 1.8

wary topaz
#

World world

world.load

#

pretty sure

#

or use Bukkit.getWorld

sick edge
wary topaz
#

use bukkit.getWorld

young knoll
#

Iirc there is a uuid file in the world folder

#

Just delete it and clone the folder

delicate lynx
#

is that what that dat file is for

sick edge
sick edge
wary topaz
#

try

getServer().getWorlds().add(worldname);

and

if(getServer().getWorlds().add(worldname) == true)
{
System.out.println(worldname + "is loaded")
}

delicate lynx
#

not using logging smh

young knoll
#

Iโ€™m almost positive that list is immutable

wary topaz
#

getServer().createWorld(new WorldCreator("WorldName");

young knoll
#

Iโ€™m not sure if you can load the same world folder several times

#

I guess as long as you prevent any writing it should be possible

wary topaz
#

hes talking about a minigame though

#

so it will be written

sullen marlin
#

Can't load same world multiple times

wary topaz
#

hi md_5!

sick edge
wary topaz
#

World e = Bukkit.getWorld("worldname");
assert e != null;
getServer().getWorlds().add(e);

sullen marlin
#

There's a lock file created which will prevent it

sick edge
sick edge
wary topaz
#

ah

vague oracle
#

How would I go about getting all of the list items from a section in config file with the following format:

    rewards:
      - type: MONEY
        money: 1000
      - type: EXPERIENCE
        money: 1000
      - type: ITEM
        item:
          material: "DIAMOND_SWORD"
          name: "&b&lDefault Sword"
          amount: 1

So I have the section "rewards" Idk if this is how it works but I need a ConfigSection per list item.

young knoll
#

Ah yes the fun format

#

getMapList

vague oracle
#

probaby not going to be able to use this format as I need to get item as a configuration section

young knoll
#

I mean a config section is mostly just a fancy map

#

I think there may even be a method to convert a map to a config section, donโ€™t remember

lethal coral
#
    @EventHandler
    public void onPlace(BlockPlaceEvent event) {
        ItemStack placedItem = event.getItemInHand();
        // ...
    }
rough ibex
#

Can you show more?

#

is there more of the stacktrace?

lethal coral
#

this is the most relevant

#

and it's throwing the error because it's null

#

or air

buoyant viper
#

idk what mc version ur working with but might i recommend

#

?pdc

buoyant viper
#

PDCs are NBT-like (and are actually stored in a (Craft?)Bukkit-managed NBT tag iirc) and have existed since 1.14

young knoll
#

Inb4 1.8

buoyant viper
#

god i hope nyot

lethal coral
#

I know what PDC is but I use the nbt api for block nbt as well so it's more consistent to continue using it across the project

#

and here's the weird part

#

I just restarted with a debug line to output the placed item

#

and it output it normally and no errors

#

it's very inconcistent as to if it's air or not for the event value or the method I tried using before

#

sometimes it works sometimes it doesn't and I don't understand why

young knoll
#

What do you need block NBT for

lethal coral
#

to store owner data of a block at a location

#

see look at this

young knoll
#

?morepdc

undone axleBOT
lethal coral
#

two different instances of the placement of the same item

#

1st time it works

#

2nd time it doesn't

buoyant viper
#

alex also has a PDC lib for blocks iirc

lethal coral
young knoll
#

Yeah itโ€™s on that page

#

Let me get the actual link

lethal coral
#

what you guys are discussing doesn't solve my problem

young knoll
lethal coral
remote swallow
undone axleBOT
young knoll
#

Man too many custom commands

#

Wonder if a bot will ever support custom /commands

sullen marlin
#

?about

#

?version

#

.version

#

Idk

lethal coral
#

update: when I get the item and I right click it on air (not placing it), it refreshes as if I just got the item in my hand and then when I place it it's not air according to the place event

#

happens with any item I'm given with nbt

#

fixed

severe herald
#

can someone help me code a plugin that will give fly for example 10 min a day and will reset back to 10 min of flight after 24hours dm me plz

vernal oasis
#

How do I get API on Mac? I'm used to Windows and haven't used my laptop to code in quite some time...

undone axleBOT
remote swallow
remote swallow
vernal oasis
#

Why are my bukkit imports not working?

hexed falcon
#

i put the unbreakable tag on an item but it still takes explosion / fire damage

#

am i missing something?

vernal oasis
#

unbreakable means the durability doesn't go down

hexed falcon
#

so then what would i do for an item that doesn't have durability?

river oracle
#

items that don't have a durability can't really be unbreakable

#

cuz yk they don't have durability

hexed falcon
#

im trying to make it so they don't burn or get blown up

river oracle
#

hmmm Maybe check out EntityDeathEvent for that

#

I wonder if Items would trigger that

#

?jd-s

undone axleBOT
rough ibex
vernal oasis
#

maven

rough ibex
#

Do you have the repository added

#

and spigot-api dependency

vernal oasis
#

I think so?

rough ibex
#

Look at your pom.xml

#

are those things there?

vernal oasis
#

I'm getting a spinning wheel of death so gimme a minute lol

#

Yeah last I checked?

rough ibex
#

no red lines?

vernal oasis
#

gotta restart my laptop bruh

#

brb in a min