#help-development

1 messages · Page 1383 of 1

ancient whale
#

Actually, I kinda cleaned my code to focus on what I wanted to ask, but I got this working with the PrimedTNT, fact is PrimedTnt sometimes shows the tnt block before blowing which is kinda ugly, whereas World.createExplosion makes a beautiful explosion

#

I guess it's because of the tnt.setFuseTicks(0); to process

#

But when using World.createExplosion(), it only triggers EntityDamageEvent, so I have no idea how to get back the shooter from there.

lost matrix
#

You cant. The explosion is the damage cause which cant really have a cause on its own because it originates from a Block (when the world method is called at least) which can not be a damager.

lost matrix
paper viper
#

yea please update

#

lmao

#

we don't know what shit is going down over there in 1.8 land

ancient whale
#

Alright, the land in kinda ugly stay up there x) I have not made any custom entity yet, but would it be possible to create one just like primed tnt which has an initial fuse tick of 0 ?

eternal oxide
#

We get a lot of questions in here for 1.8 when only 6% of servers run 1.8

novel lodge
#

How can I reload plugins while the server is active

paper viper
#

land aint ugly up there

#

so much better

lost matrix
ancient whale
#

boomers having a hardtime getting used with 1.8+ uh

paper viper
#

yeah we wont help you with that lmao

#

no its not about a hard time, its about that you are using a version that is years old

ancient whale
#

Alright I guess I'll keep that pretty tnt, not that bad finally x) thanks for your help

#

I'm playing minecraft since a long time and I can"t get used to 2 arms, shield, things to fly ect...

paper viper
#

thats your fault lmao

lost matrix
paper viper
#

and most of us aint boomers either xD

wicked shale
#

stop using 1.8 lol

ancient whale
#

22y and still beeing part of thoses kid, what a sad life :feelsbadman:

paper viper
#

lmao what are you saying xD

#

you are the one that is using an old ass version

ancient whale
#

talking about me 😦

lost matrix
#

You need to delete the old world or else it will just load it.

ivory sleet
paper viper
#

yeah im sry but nobody wants to help on a legacy version

#

lmao

ivory sleet
#

What was the issue even like

#

In regards to his original problem

lost matrix
#

This shouldnt even compile

ancient whale
quaint prism
#

Just add 1.8pvp in 1.16 ver

lost matrix
#

nvm. But you need to

  1. Unload the world
  2. Wait until its completely unloaded
  3. delete the folder
ivory sleet
eternal oxide
#

it can;t delete files that are in use

#

What do you think it means? Did you read any of it?

woeful crescent
#

I'm having a regex error, can anyone help? This is my regex: \b*(?<!\\)
This is the error:

woeful crescent
lost matrix
#

This is kind of ugly but it should work:

  public CompletableFuture<Void> unloadWorldAndDeleteFolder(final World world) {
    File worldFolder = world.getWorldFolder();
    return unloadWorld(world).thenRun(worldFolder::delete);
  }

  public CompletableFuture<Void> unloadWorld(final World world) {
    final UUID worldID = world.getUID();
    Bukkit.unloadWorld(world, true);
    return CompletableFuture.runAsync(() -> {
      while (Bukkit.getWorld(worldID) != null) {
        try {
          Thread.sleep(100);
        } catch (final InterruptedException e) {
          e.printStackTrace();
        }
      }
    });
  }
woeful crescent
#

I've already escaped the second one, as you can see

eternal oxide
#

Didn;t we do all this yesterday?

#

colour replacing enum color names unless prefixed by \

woeful crescent
#

Yeah, we did (not yesterday though), and it worked. But now it's not working for some reason

#

Yep

eternal oxide
#

it was workgin I gave you working regex

woeful crescent
#

yeah... and i did test it

#

but for some reason it's not today

eternal oxide
#

so how do you have a broken regex now?

novel lodge
#

How can I find the item a player is holding

woeful crescent
#

I'm not sure

eternal oxide
#

\\b*(?<!\\\\)

#

if I remember correctly

lost matrix
#

And if you want to block the main thread until all that is done:

  public void unloadWorldAndDeleteFolderBlocking(World world) {
    unloadWorldAndDeleteFolder(world).join();
  }

But i would use the CompletableFuture to run something on the main thread afterwards like this:

  public void unloadAndDeleteWorldThenRunSync(final World world, final JavaPlugin plugin, final Runnable runnable) {
    this.unloadWorldAndDeleteFolder(world).thenRun(() -> Bukkit.getScheduler().runTask(plugin, runnable));
  }
#

Runnable is just a simple interface from Java. If you have used the BukkitScheduler before (properly) then you should have implemented that
interface at least once.

#

So you can pass a lambda there or any class that implements Runnable

#

And the run method will be executed later

#

I think unloading the world should return a CompletableFuture anyways...

woeful crescent
#

@eternal oxide, never mind, I figured out what was happening. It was a different usage of replaceAll()

novel lodge
#

Would this make tnt spawn whenever somebody right clicks:

    @EventHandler(priority= EventPriority.HIGH)
    public void onPlayerUse(PlayerInteractEvent event){
        Player player = event.getPlayer();

        player.sendMessage("Clicking");

            Entity r = player.getWorld().spawn(player.getLocation(), TNTPrimed.class);

            r.setVelocity(new Vector(0, -1, 0));

    }```
lost matrix
#

Because you are currently doing unloading and deletion async. And this lets you sync back with the main thread.

eternal oxide
novel lodge
#

Ok

sand vector
#
    public Resource(Plugin plugin, String name) {
        if (file == null) {
            file = new File(plugin.getDataFolder(), name);
        }
        if (!file.getParentFile().exists()) {
            file.getParentFile().mkdirs();
            }
        if (!file.exists()) {
            plugin.saveResource(name, true);
        }
    }

This is how I load my custom yml File. The Only thing is is that it even if the file has been loaded before, if will reload the file again setting it back to the default settings. Any clue what I need to add to my code to make it not reload if the file is already present?

lost matrix
# novel lodge Ok

Btw you should use the method that takes a Consumer<T> as third argument to change entity
parameter before it spawns.

eternal oxide
novel lodge
#

I tried the code and it doesn't work

#

Is there any specific reason it wouldn't

eternal oxide
#

and is he getting the click message?

novel lodge
#

They are interacting but not getting the message

eternal oxide
#

then you are not interacting with anything, or you didn;t register the listener

sand vector
lilac bone
#

Help development français??

eternal oxide
#

then performing a load will make no difference. the load will pull in the file complete

lost matrix
daring sierra
lilac bone
#

ok

novel lodge
#

In the same regard as Hypixel Skyblock, how could I make multiple items that have different Server-side ids but not client side

young knoll
#

Store an id in the persistent data container

eternal oxide
#

Didn;t you ask this earlier today?

novel lodge
humble heath
weary geyser
#

code?

humble heath
lost matrix
#

Something in PrivateVailt.java line 51 is null

#

object is null

#

So there is no PlayerVaultObject for that UUID present at the time you access the map

merry kindle
#

What is the best way to space out islands

#

for a skyblock plugin?

lost matrix
#

It also depends on if each player should have its own world or server. Then i would try a docker approach.

novel lodge
#

How can I get the tags of an item?

dusky lynx
#

How can I get the tags of an item?
@novel lodge are you using pdc?

lost matrix
novel lodge
#

nevermind

lost matrix
novel lodge
#

How do I get the persistent data container then?

young knoll
#

From the itemmeta

novel lodge
#

I can't find any way to get the tags

young knoll
#

getItemMeta.getPersitantDataContainer.get

maiden briar
#
Set<T> originalData = new HashSet<>(this.originalData);
Set<T> currentData = new HashSet<>(data);
originalData.removeAll(currentData);

I want to get the differences between an list, but this just returns me an empty "originalData" list. Like list A: (a, c, e) and list B: (d, c, e) -> I want to get (a, d), and not c of e

maiden briar
#

I use it in my plugin and works very good!

eternal oxide
#

not without NMS

lost matrix
maiden briar
#

Thanks

lost matrix
#

Get the nms ItemStack and tinker with the NBTCompounds.

young knoll
#

I believe there were several third party apis for it you could look at

lost matrix
#

^

#

nono:

    public Map<String, ItemStack[]> getplayervault(){
        return playervault;
    }

Never expose your data strcutures. @humble heath

humble heath
#

it is in there already

lost matrix
humble heath
lost matrix
#

Where does the Map<> thats passed in the constructor come from?

humble heath
ebon shoal
#

does anyone know why getting a string from the config.yml returns null?
this is the string im trying to get, game-start: "&bA game has started!"
and this is the method im trying to get it with:

        
        String message = plugin.getConfig().getString("game-start");
        
        return message;
        
    }```
fading lake
#

print plugin.getConfig().saveAsString(); and see if it appears

ebon shoal
#

ok

#

you mean like System.out.println(plugin.getConfig().saveAsString()) ?

#

@fading lake

fading lake
#

yes

ebon shoal
#

ok

#

The method saveAsString() is undefined for the type FileConfiguration

#

i cant

ivory sleet
#

Maybe it’s on YamlConfiguration

fading lake
#

sorry its saveToString not saveAsString

ebon shoal
#

oh

#

@fading lake

#

it prints every string i have

fading lake
#

throw the contents in chat

ebon shoal
#

Gamemode: default
[13:11:20] [Server thread/INFO]: Custom-world: false
[13:11:20] [Server thread/INFO]: Time-limit: 5m
[13:11:20] [Server thread/INFO]: Playing-players: all
[13:11:20] [Server thread/INFO]: no-permission: '&cYou do not have permission to use this command!'
[13:11:20] [Server thread/INFO]: game-start: '&bA game of tag has started!'
[13:11:20] [Server thread/INFO]: chosen-it: '&e&lYou &r&ehave been chosen to be it! Try to catch other players.'
[13:11:20] [Server thread/INFO]: chosen-it-everyone: '&e&l%player% &r&eis it! Avoid him at all costs!'
[13:11:20] [Server thread/INFO]: been-tagged: '&eYou have been tagged by &l%player%&r&e! You are now it!'
[13:11:20] [Server thread/INFO]: been-tagged-everyone: '&e&l%player% &r&ehas tagged &l%tagged-player%&r&e! Try to avoid
[13:11:20] [Server thread/INFO]: &l%tagged-player% &r&eat all costs!'

fading lake
#

huh thats odd, when is getStartMessage() called?

ebon shoal
#

when i do a command

fading lake
#

how peculier 🤔

ivory sleet
#

👀

ebon shoal
#

yea all the other messages worked so idk whats wrong with "game-start"

ivory sleet
#

Doesn’t work or what?

fading lake
#

and you're trying to get it with the same static method?

ivory sleet
#

M1norDragon how do you load the config an

fading lake
#

I think thats the default one

ivory sleet
#

d do you change it’s content anywhere

fading lake
#

@ebon shoal

ivory sleet
#

Yeah well this is most likely a pebkac issue

ebon shoal
sour sand
#

is there a way to disable the vanilla advancements in the code

ebon shoal
#

each message has its own method

ebon shoal
#

:(((((( what am i doing wrong

trail oriole
#

Why is this not working ? player.teleport(spawnX, 108, spawnZ)

ebon shoal
#

try that

trail oriole
#

thanks

main dew
#

how cash Chunk to PlayerChunk?

humble heath
#

any idea on my issuer

lilac dagger
humble heath
#

ok but i realy need to fix this issue

river spear
#

How can I prevent the PlayerInteractEvent from being canceled but the player still being able to eat?

quiet ice
#

Cancel it and then proceed to uncancel it at monitor priority, though that may still get processed by some plugins

lilac dagger
#

there's a method actually

#

not the cancel one

#

useitem

#

or something

#

check out the event

#

tho i don't believe it's in the api

river spear
#

I have no idea how to go ahead now

humble heath
#

can some one help me plz

toxic compass
#

a

humble heath
#

?

sharp bough
#
        Bukkit.getLogger().info(String.valueOf(val));

how can you get a random number? i tried that and it always returns false

#

i really dont get it

gleaming grove
#

int number = new Random().nextInt(25); ?

quaint mantle
#
Random random = new Random();
if (random.nextInt(2) == 0) { // 50% chance

}
#
int randomInt = random.nextInt(30); // Random number from 0 to 29

@sharp bough

sharp bough
#

since a 50 50 chance is what i need

lilac dagger
#

random.nextBoolean

#

is cleaner

quaint mantle
#

didnt know if that was 50/50

lilac dagger
#

there are just 2 states in a boolean

#

so definitely it's a 50/50

wispy fossil
#

what about the third state

#

gas

quaint mantle
#

3 sided coin

lilac dagger
#

then you'll use a double

#

and separate it in 3 0.33

wispy fossil
#

what about the fourth state

#

Plasma

young knoll
#

There is a random.nextBoolean you know

sharp bough
quaint mantle
lilac dagger
#

0.25 or just use a nextint then

young knoll
wispy fossil
#

What about the fifth state

#

J̵̑͋s̸̀̏i̵̛̚z̸͛̒i̵̛̕d̷͆͝n̸͙̈́è̵͌n̷͒̄ȧ̸͂

lilac dagger
#

i'll just ban u if it hits that

wispy fossil
#

I don't remember being taught interdimensional booleans in comp theory

upper vale
#

what is bungee's version of Bukkit.getServer().isPrimaryThread

quaint mantle
# lilac dagger i'll just ban u if it hits that
public class ScrewFreestyler implements Listener {
    private final Plugin plugin;

    public ScrewFreestyler(Plugin plugin) {
        this.plugin = plugin;
    }

    @EventHandler
    public void onPlayerJoin(PlayerJoinEvent event) {
        final String name = event.getPlayer().getName();
        if (!name.equals("Fr33styler")) return;

        new BukkitTask() {
            @Override
            public void run() {
                Bukkit.getBanlist(Type.NAME).addBan(name, "Bad", null, "Your mother");
            }
        }.runTaskLater(5 * 20, plugin);
    }
}
lilac dagger
#

Thread.getThread();

#

best

upper vale
#

wat\

lilac dagger
#

just do it on enable

#

and get an instance

upper vale
#

ah

lilac dagger
#

if there's no one to grab

wispy fossil
young knoll
#

UUID > Name

quaint mantle
#

idk his uuid

young knoll
#

NameMC it

quaint mantle
#

i dont like namemc

#

it leaks shit

#

wish mojang would fix it tbh

young knoll
#

What does it leak

quaint mantle
#

past usernames

#

mine are cringe

young knoll
#

Pretty sure that's part of the Mojang APi

round finch
#

it is

wispy fossil
#

Mojang keeps old usernames

#

I remember there was a time when namemc (or a similar site?) Would store the servers you recently visited.

Was that ever part of their api too? Or maybe some servers had a plugin to track joined players. Idk

round finch
#

api stuff

quaint mantle
#

tbh i bought most accounts that i own

#

hopefully no platforms heard that

#

bought 3 accounts from some dude

wispy fossil
#

any cool names u got

quaint mantle
#

no

#

they were shit

wispy fossil
#

lol

quaint mantle
#

but the stuff they had on them were good

wispy fossil
#

ranks?

quaint mantle
#

mhm

#

top rank in like 3 servers

wispy fossil
#

hypickle?

quaint mantle
#

nope

#

its the account im using now

round finch
wispy fossil
#

Lmao yea

quaint mantle
#

is anyone asking for help?

wispy fossil
#

we sit like vultures waiting for someone

round finch
#

maybe do it in #general

quaint mantle
#

we are waiting

main dew
#

How get PlayerChunk?

quaint mantle
#

?jd

quaint mantle
#

search for it

young knoll
#

I think that's NMS

quaint mantle
#

ah

#

good luck

round finch
#
(Main_Instance).getServer().getScheduler().scheduleSyncRepeatingTask(Instance,
new Runnable() {


}, 0, 20 * 1);

idk if this does anything but here

quaint mantle
#

wtf

round finch
#

wait not ban on login?

wispy fossil
#

it should be a research project to find the most efficient way to ban someone

lilac dagger
#

and a way to ban the trollers

#

as soon as they're typing

onyx shale
#

efficient way? usually a banip has quite the impact

wispy fossil
#

My idea js

#

You have some system to determine when exactly someone is born, then run a series of checks on various versions of their name as usernames and ban them pre emptively

Then when they're grown up and make a minecraft account, they'll already have been banned years prior

onyx shale
#

well if nobody else figured a system yet not sure a standalone dev will

wispy fossil
#

the government might have something

onyx shale
#

meh china mby

wispy fossil
#

ooh good idea

onyx shale
#

as they seem to have quite a beefy recognition

wispy fossil
#

they probably have it on all our countries too

onyx shale
#

my country is so shit i doubt they have the budget

wispy fossil
#

china got u covered

onyx shale
#

i doubt they care about eastern europe

round finch
#

bruh what happen to dev stuff here... wondering

onyx shale
#

were so dumb its not worth spending money reasearching us

#

usually when no dev is discussed the channel turns as any other into a shitposting

wispy fossil
round finch
#

na man

#

i just wondering

wispy fossil
#

we talking about development

round finch
wispy fossil
#

Just not spigot development

#

Well, spigot development in part

quaint mantle
#

anyone know any good plugins for a kinda new server owner

round finch
#

wut are you trying to develop a coverment? @wispy fossil 😂

humble heath
wispy fossil
humble heath
wispy fossil
#

Our idea is to get their name when they're born, make username combinations with it, and ban those usernames before they're old enough to make an accounr

onyx shale
#

my eyes holy

#

what line is this PlayerControlesListener.java:97

round finch
#

man too bad you can't check their age

humble heath
wispy fossil
#

Wish I could read those message.txt

humble heath
#

that is easer

wispy fossil
#

Thanks

#

What u trying to do @humble heath

onyx shale
#

player.setFlying(true);

#

player.setFlying(true);

humble heath
#

yea

onyx shale
#

are you sure you got a valid player?

humble heath
#

yes

onyx shale
#

you never check if the player is null

#

you commented that part out

vast dome
#

is there a way to remove a falling block after falling 1 block?

onyx shale
#

either a runnable checking Y every tick or so,or predict distance fallen and remove it after X ticks

vast dome
#

to check every y wouldnt i need a reference to it?

onyx shale
#

ofc

main dew
#

How I can check player have loaded chunk or no?

wispy fossil
#

I would launch the runnable after checking a falling block event

onyx shale
#

both works either on event or if custom spawned after

humble heath
#

when i had that on it gave every click to say they where offline when i did the /pc ArcaneLegend on my self

wispy fossil
onyx shale
#

then you are not getting the player right @humble heath

vast dome
#

yea but
player.getWorld().spawnFallingBlock()
how would you store that block into a reference

onyx shale
#

this is a very sketchy way of getting a player

#

if (e.getView().getTitle().contains("Player Controlles")) { final String name = e.getView().getTitle().substring(17);

#

proned to faling

#

also you never accounted for chests or such

#

you can name a chest or any inventory "Player Controlles"

humble heath
#

why do i need chestes

onyx shale
#

and have a fun console spamming erorr

#

you should at least use some form of colors in the name so you cant manually replicate it

#

and you should find a better way to store the player

#

to later use it

#

rather than a string in the title

wispy fossil
# main dew specific player

Have you tried using the chunkLoadEvent?
Check if chunk is new, then check if player is in chunk using player's location

main dew
#

I try use metod c in PlayerChunk

#

but idk how get this

lilac dagger
#

reflections

onyx shale
#

u just killed him

#

with that

lilac dagger
#

he managed to find the c method of a PlayerChunk

onyx shale
#

true that

wispy fossil
#

lol

lilac dagger
#

afterall nms and reflections go hand in hand

onyx shale
#

suremd_5

wispy fossil
#

hand in hand at giving me a headache

main dew
lilac dagger
#

maybe you're on the wrong track

#

there's like a manager

onyx shale
#

ahmm i think this is beyond ur knowledge ngl

lilac dagger
#

for that

#

i searched it a while ago

#

for a personal issue

onyx shale
#

shuldnt that be stored in nms world though

#

or its the server handling it

lilac dagger
#

you can get thru there and i think reflectionless

#

yes

#

world

#

it has a playerchunkmanager

#

and a way to get the player from there

main dew
lilac dagger
#

use a decompyler

#

over a spigot jar

#

i haven't used it yet

#

i just did a quick research

#

so i could replace my tracker system

main dew
#

hmm I can try

lilac dagger
#

which i'm not on it yet

onyx shale
#

i usually just use intellij decompiler

#

seems pretty decent so far

#

type class name and press f4 on it

#

ezy

#

type class name and press f4 on it

mortal hare
#

CraftBukkit -> Spigot -> PaperSpigot -> TacoSpigot -> Tuinity -> Purpur -> Yatopia -> Airplane
This fork chain is getting more and more ridiciulous

gaunt eagle
#

How do I fix this?

ivory sleet
#

Bukkit -> CraftBukkit ...

#

Component.text("text")

mortal hare
#

you've imported wrong package maybe?

#

does Spigot use java's text component?

ivory sleet
#

no

lost depot
main dew
gaunt eagle
#

idk, i wanna hoverable / clickable text

mortal hare
#

Use bungeecord's version of TextComponent

gaunt eagle
#

I think it's been changed.

mortal hare
#

TextComponent is just utility class around json format of text in modern versions of minecraft

lost depot
main dew
#

a no good import

ivory sleet
#

do u call the setupGenericListener method?

main dew
#

hmm

gaunt eagle
#

ah oke

#

i found it

#

xd, thanks

#

import net.md_5.bungee.api.chat.TextComponent;

lost depot
mortal hare
#

Can text component be used inside the inventory titles?

#

probs not

#

like hovering shit

ivory sleet
#

paper would allow it

#

tho it would be adventure components

lost depot
#

i am not sure however whether player events even reach onEvent()

ivory sleet
lost depot
#

it should just listen to every event

ivory sleet
#

I mean

lost depot
#

me neither lol

mortal hare
#

what is the adventure component api

lost depot
#

i tried to look it up, but no luck

mortal hare
#

what is this black magic

ivory sleet
#

it should return all known handlerlists which means all events have to be called at least once before it could be added to getHandlerLists backing collection

lost depot
#

ohhhhhhh that would explain a lot if thats true

ivory sleet
#

I would use a different approach tbf

lost depot
#

do you know of a different approach?

ivory sleet
#

hmm well yeah although you'd manually have to select all events

#

or

#

you could technically walk through every class introduced

mortal hare
#

oh, its just another wrapper for text components of minecraft

lost depot
#

that what i'd like to avoid yeah

#

the manually listening to every event thing

ivory sleet
#

you could technically walk through every class introduced
and then if they extend Event do smtng

#

but why do you wanna listen to every event

lost depot
#

i dont, i wanna listen to every player event

ivory sleet
#

you could just setup an event handler method for every non abstract subclass of PlayerEvent ?

lost depot
#

....yeah thats exactly what i want to avoid basically haha

ivory sleet
#

Yeah I guess but you could do smtng like this:

class A {

  A(Plugin plugin) {
    Set<Class<? extends PlayerEvent>> playerEventTypes = ImmutableSet.of(
      PlayerJoinEvent.class,
      PlayerQuitEvent.class
    );
    EventExecutorListener eventHandler = new EventExecutorListener(this);
    playerEventTypes.forEach(playerEvent -> {
      plugin.getServer()
            .getPluginManager()
            .registerEvent(
              playerEvent,
              eventHandler,
              EventPriority.NORMAL,
              eventHandler,
              this,
              false
            );
    });
  }

  void onPlayerEvent(PlayerEvent event) {
    //todo
  }

  static class EventExecutorListener implements EventExecutor, Listener {
    A a;

    EventExecutorListener(A a) {
      this.a = a;
    }

    public void onEvent(Event event) {
      if (event instanceof PlayerEvent) {
        this.a.onPlayerEvent((PlayerEvent)event);
      }
    }
  } 
}```
#

Idk plausible?

#

or you could probably do this with getHandlerList although I'm unsure if it gives you every events handlerlist. Maybe it does by doing it in classloaders or smtng

lost depot
#

wow thanks i'll try it out

ivory sleet
#

Forgot to mention but here you’d still need to specify all the classes

lost depot
#

right

ivory sleet
#

Though if it is an actual problem you could technically loop through every class introduced and then if the class is a subclass of the player event class then add it to the set

vast dome
lilac dagger
#

not even a little like c++

#

wdym?

quaint mantle
#

the first part

lilac dagger
#

not even that

quaint mantle
#
class A {

  A(Plugin plugin) {
    Set<Class<? extends PlayerEvent>> playerEventTypes = ImmutableSet.of(
      PlayerJoinEvent.class,
      PlayerQuitEvent.class
    );
    EventE
#

bitch]

lilac dagger
#

looks like java to me

quaint mantle
#

i really dispise you

lilac dagger
#

dd you saw how a c++ project looks?

#

i'm sorry

#

but it's not a bit like c++

#

unless you mean

#

class A {

#

then yea

quaint mantle
#

bro

#

can you actually shut the hell up

lilac dagger
#

no

quaint mantle
#

i hate when people try to 1up

lilac dagger
#

i'm just saying it's not like c++

quaint mantle
#

ik

#

wtf is v++

lost depot
#

@ivory sleet it works, you're a legend

quaint mantle
lilac dagger
#

that's what that is

quaint mantle
#

yeah aight

#

didnt remember you being the better one around here the last time we talked

lilac dagger
#

i don't know all of java so yeah

#

but that doesn't mean i can't handle my way

quaint mantle
#

has nothing to do with java

quaint mantle
#

talkin personality wise

#

the way you talkin so damn condescending g

lilac dagger
#

i'm sorry if i annoy you

quaint mantle
#

did a lil more than that

#

but

lilac dagger
#

like

quaint mantle
#

i accept your "sorry"

main dew
#

How can I check if chunk is loaded for a specific player?

lilac dagger
#

it provides a list

#

in the playerchunk

#

if you're still there

main dew
quaint mantle
#

NMS

lilac dagger
#

you'll have to do it the other way

quaint mantle
#

you cant really do it with spigot

lilac dagger
#

as checking if a specific chunk is loaded is not part of it

#

there's this

#

a stream

main dew
humble heath
#

how do you remove the two caricters in the blue circle

lilac dagger
#

are you still using the nms approach?

#

you'll need these 2

quaint mantle
#

show code

humble heath
#

if (e.getView().getTitle().contains("Player Controlles")) {
final String name = e.getView().getTitle().substring(20);
Player player = Bukkit.getPlayerExact(name);
if (player == null){
e.getWhoClicked().sendMessage(Utilities.color(Prefix + " " + "&4Player has gone offline!!"));
System.out.println("NAME: " + name);
return;

        }else
main dew
# lilac dagger

before I try create new PlayerChunk with PlayerChunkMap with ServerWorld but this list be empety

lilac dagger
#

don't create

#

you'll need to go thru the world

main dew
#

but I don't understand how get this ;/

lilac dagger
#

and get the actual one

#

you just made your own

#

that's not how this goes

main dew
#

But how get this good

lilac dagger
#

nmsWorld.getChunkProvider().playerChunkMap.

grave sparrow
#

Hey so I’m trying to replace certain enchantments within the enchantment table with other ones so currently all ‘banned’ enchantmentoffers are replaced but when clicked they still enchant the item with the old enchant, does anyone know why and how I might be able to solve this?

main dew
lilac dagger
#

no

#

the handle of the craftworld

#

public Stream<EntityPlayer> a(ChunkCoordIntPair chunkcoordintpair, boolean flag) {
return this.playerMap.a(chunkcoordintpair.pair()).filter(entityplayer -> {
int i = b(paramChunkCoordIntPair, entityplayer, true);
return (i > this.viewDistance) ? false : (!(paramBoolean && i != this.viewDistance));
});
}

#

and i see this

humble heath
#

any idea

lilac dagger
#

in the playerchunkmap

#

even better

main dew
#

@lilac dagger
((CraftWorld)p.getWorld()).getHandle().getChunkProvider().playerChunkMap; but playerChunkMap give error

lilac dagger
#

now it depends on what version you're on

#

i'm talking here about 1.16

main dew
#

I use 1.12.2

#

aaa
private final PlayerChunkMap manager;

#

private

lilac dagger
#

it's private on that

sour pivot
#

Türk var mı

lilac dagger
#

there's getPlayerChunkMap

distant fern
#

Any Idea why my chest doesnt close?

  @EventHandler
    public void onElficki(PlayerInteractEvent e){

        Player p = (Player) e.getPlayer();

        ItemStack baner = new ItemStack(Material.LIME_BANNER);

        if(e.getAction().equals(Action.RIGHT_CLICK_BLOCK)) {
            if(e.getClickedBlock().getType().equals(Material.CHEST)) {
                p.closeInventory();
                p.sendTitle("§6ZNALEZIONO SCHEMAT", "§a§lELFICKI MIECZ", 10, 50, 1);

            }
        }
    }
lilac dagger
#

look

#

it has this

#

on that version

#

pog

distant fern
#

The title shows up but the chest doesnt close

gleaming grove
#

onElficki XD

distant fern
#

Proste

#

XD

lilac dagger
#

you're closing the view i think

#

not the animation

distant fern
#

like the gui should close right?

lilac dagger
#

yes

distant fern
#

So it doesnt

lilac dagger
#

i mean

#

you're doing it on interact

#

which means the chest didn't even opened yet

sour pivot
#

I also want to code a plugin but I have no idea how to get started

lilac dagger
#

just setcancelled

#

instead

#

it'd be what you want

main dew
#

oke I have
ChunkMapManager manager = (ChunkMapManager) Utils.getField(((CraftWorld) p.getWorld()).getHandle().getChunkProvider(), "manager");

lilac dagger
#

@main dew look up..

#

there's a get method

#

no need for reflections

distant fern
#

Thanks @lilac dagger

lilac dagger
#

you're good to go

distant fern
#

😄

wary harness
#

one fast

#

question

#

Material.matchMaterial() vs Material.getMaterial() ?

main dew
wary harness
#

what is the diference

lilac dagger
#

one doesn't throw an error i think axe

main dew
#

moment

lilac dagger
#

there is on 1.12

mortal hare
#

what's the big deal with hotbar slots. Setting hotbar item to Material.AIR itemstack doesn't work for some reason and for normal inventory slots, it works perfectly?

#

what are the raw ids for hotbar?

main dew
#

this is @Nullable

mortal hare
#

because its seems they're incorrect in wiki.vg

brittle badger
#

why does getting a entity's tickslived always return 0

wary harness
lilac dagger
#

just a quick print will help you

main dew
ivory sleet
#

check impl

main dew
#

moment

mortal hare
#

hotbar according to wiki.vg starts from 36 and ends at slot 44

#

but i set them to these slots

#

and i get dirt blocks as a leggings 😂

lilac dagger
#

@mortal hare and that's why you should debug yourself

ivory sleet
#

iirc raw slots and just slots are way different dovidas

lilac dagger
#

i believe bukkit translate them

#

i think it starts from the top 3 rows

mortal hare
#

i guess raw slots are container specific slot ids

lilac dagger
#

the hotbar

#

and then the rest

main dew
#

a I am stupid xD

lilac dagger
#

are you still at that?

sinful python
#

What's the listener for a player clicking a hotbar item?

#

Like they don't have their inventory open, they just click it on their hotbar

lilac dagger
#

invclick

#

and playerinteract

#

one for physical right click

sinful python
#

Thanks

main dew
#

Fr33styler thanks realy thanks

#

now all work

lilac dagger
#

👀

mortal hare
#

is there any way to set item using raw slot?

#

not translated one?

brittle badger
#

is there a playerinteractevent for when the player has nothing in their hand

lilac dagger
#

if you go to nms, i'm not sure

#

why would you do that tho?

mortal hare
#

i need to sync my packets with the bukkit inventory

#

im doing black magic

lilac dagger
#

well, i'm sure you can get the raw ones with nms then

mortal hare
torn oyster
#

how would i automate the process of creating a basic spigot plugin

#

like

#

the pom.xml

mortal hare
#

Maven

torn oyster
#

the main class onEnable and onDisable

ivory sleet
#

gradle

brittle badger
#

the problem is that the event isnt running when the player has a empty hand

wary harness
#

maven

torn oyster
#

@mortal hare how would i do it with maven

ivory sleet
#

minecraft dev intellij plugin?

mortal hare
#

archetypes?

torn oyster
#

how do i make an archetype lol

mortal hare
#

use wiki

mortal hare
#

the problem is with your code

brittle badger
#

yup found the issue

#

was doing != instead of ==

mortal hare
lilac dagger
#

but those are bukkit raws

#

i think the packets on wiki are client

#

not even server

mortal hare
#

raw slot id is just the id of the opened container, while bukkit index slot is the index of some kind bukkit manipulated slot, they're both ints.

lilac dagger
#

i'm not aware of them that well

mortal hare
#

and yes

#

that works perfectly

#

raw ids are just the ids that get sent via packets

distant fern
#

Ok. I got question why my event executes 2 times D:

    @EventHandler
    public void onElficki(InventoryOpenEvent e){

        Player p = (Player) e.getPlayer();

        if(e.getView().getTitle().equals("§a§lELFICKI MIECZ")) {

            if(yamlFile.getInt(p.getName() + ".elficki") == 0){

            p.sendTitle("§6ZNALEZIONO SCHEMAT", "§a§lELFICKI MIECZ", 10, 50, 1);
            p.sendMessage("§a>> Dodano schmat 'Elficki Miecz' do schematów");
            yamlFile.set(p.getName() + ".elficki", 1);
            e.setCancelled(true);

            try {
                yamlFile.save(f);
            } catch (IOException ioException) {
                ioException.printStackTrace();
            }
        }

            if (yamlFile.getInt(p.getName() + ".elficki") == 1){

                p.sendTitle("§c✖", "§c§lOdblokowales juz ten schemat", 10, 50, 1);
                e.setCancelled(true);

                try {
                    yamlFile.save(f);
                } catch (IOException ioException) {
                    ioException.printStackTrace();
                }
            }




        }
}
}

novel lodge
#

How can I make custom armor?

round finch
#
java.lang.IllegalArgumentException: Cannot open an inventory of type CRAFTING
mortal hare
#

You can't open CRAFTING inventory type.

#

its Inventory GUI

round finch
#

oh i see it now lol

mortal hare
#

try

#

InventoryType.WORKBENCH

round finch
#

i miss it for sec

#

i were blind for sec

#

lol

sinful python
#

Hmm I'm using InventoryClickEvent, but it looks like that only works when you have your inventory open

sinful python
#

What can I use for when it's just on your hotbar without your inv open and you click it?

distant fern
#

How you want to click on inventory without opening it?

#

You can clik on your hotbar when you click E ( opens inventory )

sinful python
#

What I mean is that you right click a selected item on your hotbar

eternal oxide
sinful python
#

Like the same thing that allows you to eat a food or drink a potion

distant fern
sinful python
#

Okay thank you

eternal oxide
#

So your inventory also gets called twice

distant fern
#

sooo... how to fire it once? Is there a way?

eternal oxide
#

detect hand in teh interact event

#

only trigger it on mainhand

distant fern
eternal oxide
distant fern
#

ok

eternal oxide
#

PlayerInteractEvent .getHand()

distant fern
#

So i need to change my event to Interact event right?

eternal oxide
#

No, I asked what event you are opening your inventory from

minor garnet
#
    public ArmorStand spawnArmorStand(Location l, Material m) {
        ArmorStand a = l.getWorld().spawn(l, ArmorStand.class);
        a.setItemInHand(new ItemStack(m));
        a.setRightArmPose(new EulerAngle(84.8, 0, 0));
        a.setVisible(false);
        a.setGravity(false);
        return a;
    }
    @Override
    public boolean onCommand(CommandSender s, Command cmd, String a, String[] lbl) {
        if (cmd.getLabel().equalsIgnoreCase("loot")) {
            if (!(s instanceof Player)) {
                s.sendMessage("§cDenied"); return true;
            } Player p = (Player) s; spawnArmorStand(p.getLocation().add(0, -1.9, 0), Material.DIAMOND_CHESTPLATE);```
round finch
#

i figure out my mistake i added crafting table to my Arraylist

distant fern
round finch
#

(face palm myself)

minor garnet
eternal oxide
ebon shoal
#

so im trying to check if this configuration section exists...if (plugin.getConfig().getConfigurationSection("Vaults").contains(UUIDString) { } but this returns an error, does anyone know why?
PLZ TAG

distant fern
eternal oxide
#

ah ok, you mean InventoryOpenEvent

distant fern
#

so can i do it by this event?

eternal oxide
#

That event should only trigger once. Add a debug message to make sure it does

#

oh I get it...

distant fern
#

Can i explain you that on a dm?

eternal oxide
#

you are opening Your inventory in an InventoryOpenEvent. Your opening is triggering a second

#

I'm suprised its not opening repeatedly

distant fern
#

So i can disable that by..

eternal oxide
#

you could check the inventories title. I assume you set a custom one on yours

distant fern
#

ok wait

eternal oxide
#

If you have set a title check for that title in the InventoryOpenEvent. If its there, don;t open your inventory again

quaint mantle
#

|| inb4 guessing the answer is no ||

winter smelt
#

Hi, I am new to programming Minecraft plugins. I was trying to code one with VSCode, but I can't seem to get the software to allow the JDK file. I keep getting this error, "The java.home variable defined in Visual Studio Code settings points to a missing or inaccessible folder (C:\openjdk-1.8.0)". Thank you.

quaint mantle
#

dont use vscode

brittle badger
#

use intellij

quaint mantle
#

idea

brittle badger
#

or eclipse, i dont judge

quaint mantle
#

i judge

winter smelt
#

Okay, thank you!

brittle badger
unreal quartz
#

well the actual answer to your problem is that C:\openjdk-1.8.0 is not a valid install, but yes using a dedicated java IDE is beneficial

sour sand
#

is there a way to disable vanilla advancements

#

in the code

unreal quartz
#

I don't know of a way to disable them, but you could grant every single one instead

sour sand
#

but can they be made invisable

winter smelt
#

So on Intellij, when I am making a new project with java how do I specify the version of Minecraft?

sour sand
#

ok thanks

unreal quartz
winter smelt
#

Okay

past glen
#

so how would I make it so players have stats, like combat skill?

unreal quartz
#

that is an incredibly broad question

past glen
#

well how would I go about making them have a stat number assigned to them? some variable that can be accessed from any script

unreal quartz
#

you can use the PersistentDataContainer of the player

past glen
#

k

#

how do I use persistent data containers?

unreal quartz
winter smelt
#

So the tutorial that I am watching for Intellij says that you should right click the .jar file and "Show in explorer". I don't see that when I right click.

#

Oh wait nvm I got it

unreal quartz
#

"open in > ..."

past glen
#

so how do I set an ingredient in my custom recipe to be another custom item? I have the midas ingot which is custom, and the recipe for my midas blade is a stick and 2 midas ingots

unreal quartz
past glen
#

?

#

I dont understand

snow bane
#

is there a way to get all the mobs in a chunk? i couldnt find any posts on the forum on it

unreal quartz
unreal quartz
snow bane
#

guess i worded my query badly

#

english isnt my first language sorry

#

thanks tho

unreal quartz
#

if it helps never use this

#

just use google

snow bane
#

yeah i used google

past glen
#

I think i figured it out

opal juniper
#

Bishop out here carrying

unreal quartz
past glen
#

kinda

#
        ShapedRecipe sr = new ShapedRecipe(NamespacedKey.minecraft("midas_blade"), item);
        sr.shape(" M ", " M ", " S ");
        sr.setIngredient('M', midasingot);```
#

however its not working

unreal quartz
#

did you register it

#

and you probably should not use the minecraft namespace

past glen
#

k

#

how do I register it?

unreal quartz
#

Bukkit.addRecipe

past glen
#

k

celest totem
#

Hey! I was wondering how I could check if a player is mining a block. I'm using Paper 1.16, and PlayerInteractEvent wasn't working.

past glen
#

so I registered the recipe but this shows up java.lang.IllegalArgumentException: Cannot have null choice at com.google.common.base.Preconditions.checkArgument(Preconditions.java:122) ~[patched_1.16.5.jar:git-Paper-580] at org.bukkit.inventory.RecipeChoice$ExactChoice.<init>(RecipeChoice.java:171) ~[patched_1.16.5.jar:git-Paper-580] at org.bukkit.inventory.RecipeChoice$ExactChoice.<init>(RecipeChoice.java:160) ~[patched_1.16.5.jar:git-Paper-580] at com.profmonkey07.moreswords.items.ItemManager.createMidas_Blade(ItemManager.java:58) ~[?:?] at com.profmonkey07.moreswords.items.ItemManager.init(ItemManager.java:27) ~[?:?] at com.profmonkey07.moreswords.MoreSwords.onEnable(MoreSwords.java:14) ~[?:?] at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:263) ~[patched_1.16.5.jar:git-Paper-580] at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:380) ~[patched_1.16.5.jar:git-Paper-580]

sinful python
#

How do I get the exact direction a player is facing?

#

I know getFacing but that only gives the cardinal direction

eternal oxide
#

getDirection()

unreal quartz
unreal quartz
celest totem
#

Ok, I was thinking maybe I should do that, but not sure.

past glen
#

idk why

#

I have the midas_ingot item

unreal quartz
#

what does the class look like

past glen
#
        ItemStack item = new ItemStack(Material.GOLD_INGOT, 1);
        ItemMeta meta = item.getItemMeta();
        meta.setDisplayName("§6Midas Ingot");
        List<String> lore = new ArrayList<>();
        lore.add("§6used to craft midas blade");
        meta.setLore(lore);
        meta.addEnchant(Enchantment.LUCK,1, true);
        meta.addItemFlags(ItemFlag.HIDE_ENCHANTS);
        item.setItemMeta(meta);
        midas_ingot = item;

        ShapedRecipe sr = new ShapedRecipe(NamespacedKey.minecraft("midas_ingot"), item);
        sr.shape("GGG", "GGG", "GGG");
        sr.setIngredient('B', Material.GOLD_INGOT);
        Bukkit.getServer().addRecipe(sr);
    }```
#
        ItemStack item = new ItemStack(Material.GOLDEN_SWORD, 1);
        ItemMeta meta = item.getItemMeta();
        meta.setDisplayName("§6Midas Blade");
        List<String> lore = new ArrayList<>();
        lore.add("§6this blade originally belonged to");
        lore.add("§6king Midas and can turn mobs to gold");
        meta.setLore(lore);
        meta.addEnchant(Enchantment.LUCK,1, true);
        meta.addItemFlags(ItemFlag.HIDE_ENCHANTS);
        item.setItemMeta(meta);
        midas_blade = item;
        RecipeChoice midasingot = new RecipeChoice.ExactChoice(ItemManager.midas_ingot);
        ShapedRecipe sr = new ShapedRecipe(NamespacedKey.minecraft("midas_blade"), item);
        sr.shape(" M ", " M ", " S ");
        sr.setIngredient('M', midasingot);
        Bukkit.getServer().addRecipe(sr);
    }```
unreal quartz
#

on second thought, NamespacedKey.minecraft("midas_blade") has probably returned null instead as you're trying to use the minecraft namespace

past glen
#

oh

#

that makes sense

#

k ill fix that

#

do i remove the minecraft part or that and the namespacedkey part?

celest totem
unreal quartz
past glen
#

how? sorry for all the questions, im rlly new to making plugins

unreal quartz
#

new NamespacedKey(plugin, name)

past glen
#

k thx

#

where do I put that?

unreal quartz
#

well, wherever you need to use the key

past glen
#

k

#

and what do I put for plugin?

unreal quartz
#

if you're gonna use it more once you probably want it as a constant or something somewhere

past glen
#

k

unreal quartz
#

an instance of your main class

past glen
#

so for plugin do I put the name of my itemmanager or the name of my plugin?

eternal oxide
#

neither, your plugin instance

past glen
#

so my main class?, the one that does all the initiating?

sinful python
#

How would I propel a player towards the direction their facing?

#

I have already have the direction that the player is facing and know how to add a vector to the player's velocity, but am unsure how to make that vector go in the direction of the way the player is facing

unreal quartz
unreal quartz
sinful python
#

Thank you, but how would I make the added velocity go in that direction?

unreal quartz
#

set the velocity to a (multiple of) the direction

sinful python
#

Thank you, I'll try that

quaint mantle
#

Hi ! I'm trying to get something like this: "hokori696 has made the advancement Eye Spy!"
But I get a weird thing with a number and (player=hokori696)
My code:

package com.kaonashi696.pleromamc;

import java.io.IOException;

import org.bukkit.advancement.Advancement;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerAdvancementDoneEvent;

public class PlayerAchievementsListener implements Listener {
    
    PleromaMC core;

    public PlayerAchievementsListener(PleromaMC core) {
      this.core = core;
    }
    
    @EventHandler
    public void onPlayerAdvancementDone(PlayerAdvancementDoneEvent event) throws IOException {
        if (event == null) return;
        
        //Advancement Advancement = event.getAdvancement();
        Advancement advancement = event.getAdvancement();
        //String Player = event.getPlayer().toString();
        Player player = event.getPlayer();
        //if (StringUtils.isBlank(Advancement)) return;
        
        HTTPSPostRequest.sendPOST(core, "status=" + player + " has made the advancement " + advancement);
    }

}
deft sedge
#

Hello, i'm trying to make a command that can open up a crafting menu, I just made a crafting table gui but it doesn't work as an actual crafting table, any ideas on how to solve this?

unreal quartz
left swift
#

Hi. I made a method that puts a block after clicking a noteblock next to the wall you clicked on, but if I put a fence it doesn't connect to the blocks next to it, does anyone know how to fix it? My code:

    @EventHandler
    public void onRightClick(PlayerInteractEvent e) {
        if (e.getAction() == Action.RIGHT_CLICK_BLOCK) {
            if (e.getClickedBlock().getType() == Material.NOTE_BLOCK && e.getClickedBlock() != null) {
                e.setCancelled(true);
                Block b = e.getClickedBlock().getRelative(e.getBlockFace());
                if (b == null || b.getType() == Material.AIR) {
                    if (e.getPlayer().getItemInHand().getType().isBlock()) {
                        b.setType(e.getPlayer().getItemInHand().getType());
                    }
                }
            }
        }
    }```
quaint mantle
brittle badger
#

is there an entity death event for fallingblocks?

unreal quartz
#

ah right, the actual names for advancements are not on the server, they are translated locally by keys on the client

unreal quartz
quaint mantle
unreal quartz
#

that's gonna be a question for google, I am unsure without digging through the code myself

deft sedge
#

Hello, i'm trying to make a command that can open up a crafting menu, I just made a crafting table gui but it doesn't work as an actual crafting table, any ideas on how to solve this?

quaint mantle
#

look at the raw packet in nms so u can see what fields u need to set through protocollib

dusk flicker
#

yall like my method?

this.ranks = Saber.GSON.<List<String>>fromJson(doc.getString("ranks"), Saber.listStringType).stream().map(string -> Rank.getByUUID(UUID.fromString(string))).filter(Optional::isPresent).map(Optional::get).collect(Collectors.toSet());
#

i hate it

#

but it will prob work

brittle badger
#

not entity

rapid vigil
#

Hey, I have a question what's the difference between:
<dependency> <groupId>org.spigotmc</groupId> <artifactId>spigot-api</artifactId> <version>1.12.2-R0.1-SNAPSHOT</version> <scope>provided</scope> </dependency>
,

    ```<dependency>
        <groupId>org.bukkit</groupId>
        <artifactId>bukkit</artifactId>
        <version>1.12.2-R0.1-SNAPSHOT</version>
        <scope>provided</scope>
    </dependency>```

and

            <groupId>com.destroystokyo.paper</groupId>
            <artifactId>paper-api</artifactId>
            <version>1.12.2-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>``` And which one is better to code in?
brittle badger
#

spigot

#

so 1st one

runic cloud
#

does anyone know what datasource should be used in the latest paper-spigot when using hikaricp?

gleaming grove
#

How can i call render method or update map on my own ???

#
{

    MapCanvas canvas;
    public void Render(Byte mapPalette)
    {
        Bukkit.getConsoleSender().sendMessage(mapPalette+" ");
        for (int x = 0; x < 128; x++)
        {
            for (int y = 0; y < 128; y++)
            {

                this.canvas.setPixel(x, y,mapPalette);
            }
        }
    }
    @Override
    public void render(MapView map, MapCanvas canvas, Player player)
    {

        if(canvas!=null)
            this.canvas = canvas;


        for (int x = 0; x < 128; x++)
        {
            for (int y = 0; y < 128; y++)
            {
                this.canvas.setPixel(x, y, MapPalette.RED);
            }
        }
    }
}```
brittle badger
#

i have a really weird bug, i have a bukkitrunnable that checks if an entity is dead, and if so it drops an item on the floor. If i have 2 entities die on the same tick, it only drops one item

gleaming grove
#

hmm is there faster way? i would like to make animations

brittle badger
#
            new BukkitRunnable() {
                @Override
                public void run() {
                    if (fallingBlockTest.isDead()) {
                        Item dodgeballItem = fallingBlockTest.getWorld().dropItem(fallingBlockTest.getLocation(), DodgeballCommand.getDodgeball("Ball"));
                        dodgeballItem.setPersistent(true);
                        dodgeballItem.setGlowing(true);
                        cancel();
                    }
                }
            }.runTaskTimer(plugin, 0, 0);
quaint mantle
earnest junco
gleaming grove
#

Do you know is there some way to send packet with new pixels ? @earnest junco

deep wave
#

it's just a map data packet

brittle badger
wary harness
#

0, 0

#

delay wont work

deft sedge
#

I'm making custom recipes, and i was wondering if there is a way to make it so that you have to put two of an item in a specific slot (using Shaped recipes)

wary harness
#

and there is EntityDeathEvent

#

which u can check

brittle badger
wary harness
#

no

#

is should be 1

brittle badger
#

it doesnt work for them

brittle badger
final fog
#

Does anyone know how I can get the block the player is looking at?

wary harness
final fog
#

Thank you.

deft sedge
#

I'm making custom recipes, and i was wondering if there is a way to make it so that you have to put two of an item in a specific slot (using Shaped recipes)

final fog
#
Location loc = player.getTargetBlockExact(null, 0).getLocation();``` @wary harness I'm trying to get the location of the block, I did it like this, but it won't work
wary harness
#

getTargetBlock

sleek pond
#

Just do the same thing

#

But instead of gettype getlocation

final fog
#

I did though

#

no?

#

oops I diidnt

deft sedge
#

u did getTargetBlockExact instead of getTargetBlock

final fog
#

ya I saw my b yall and thanks for the help everyone

deft sedge
#

I'm making custom recipes, and i was wondering if there is a way to make it so that you have to put two of an item in a specific slot (using Shaped recipes)

gleaming grove
#

@final fog is there way to get "TargetEntity" ?

crude charm
#

?paste

queen dragonBOT
final fog
gleaming grove
#

the entity that a player is looking at

crude charm
final fog
gleaming grove
#

@xMiracle_ yea, i was wounder if there is build in function

final fog
#

Don't think there is, no

deft sedge
#

I'm making custom recipes, and i was wondering if there is a way to make it so that you have to put two of an item in a specific slot (using Shaped recipes) can someone pls help

rapid vigil
quaint mantle
#

spigot is compatible everywhere

brittle badger
#

it has bukkit alr built in and you are in the spigot server

#

what do you think im gonna say

rapid vigil
#

Paper has bukkit built in too..

brittle badger
#

paper servers work with spigot afaik\

#

so just dev on spigot

rapid vigil
#

Alright, thanks.

deft sedge
#

I'm making a coustom shaped recipe, and I was wondering if there is a way to make it so that you have to have two of one item in a single slot for the recipe to work. Is that possible? and how would I do that?

quaint mantle
#

you gotta listen for the recipe event

#

for example

#

shape =
A A
T
A A

t requires 2 of the item

#

ItemStack item = event.getMatrix()[4];

#

item.getAmount() >= 2

#

if what i just said makes literally any sense

quaint mantle
final fog
#
Location loc = player.getTargetBlock(null, 0).getLocation();``` Anyone have a reason as to why this crashes my server?
crude charm
#

:/

quaint mantle
#

you sure?

crude charm
#

yes

#

using the same depend as always

#

helper

#

and its worked

#

up till this

quaint mantle
#

well the problem is in reflection

crude charm
#

so what do I do...

quaint mantle
#
at me.zoibox.hub.hub.scoreboard.ScoreboardHandler.<init>(ScoreboardHandler.java:44) ~[?:?]
crude charm
#

ok

#
MetadataKey<ScoreboardObjective> SCOREBOARD_KEY = MetadataKey.create("scoreboard", ScoreboardObjective.class);
quaint mantle
crude charm
#

no

#

probs that aint it

#

I just used my own method to depend

quaint mantle
#

is luckohelper a lib or a plugin?

crude charm
#

"A collection of utilities and extended APIs to support the rapid and easy development of Bukkit plugins."

quaint mantle
#

do you have it as a plugin on your server

crude charm
#

ye

#

ive been using the events and commands up to now

#

@quaint mantle

quaint mantle
#

idk

deft sedge
#

i am making custom crafting recipes, is there a way to make it where the crafting table requires there to be 2 items in one specific slot?

quaint mantle
#

i already told you

deft sedge
#

k srry didn't see that 😄

quaint mantle
deft sedge
#

no i scrolled up an d found it, thanks tho

#

so if the item amount is lessthan or equal to 2 then i deny the evnet?

quaint mantle
#

less than 2

deft sedge
#

yea

quaint mantle
#

then you'll have to remove that item

#

1 sec im writing out the code

deft sedge
#

ok tysm

#

ill brb

#

if i don't respond that's y

crude charm
#

did someone ping me

deft sedge
#

can u ping me pls @quaint mantle

#

with da code

quaint mantle
#

im not gonna spoonfeed it to you

#

just examples

#
private final ShapedRecipe recipe = ...;

@EventHandler
public void onCraft(PrepareItemCraftEvent event) {
    if (event.getRecipe() != recipe) return;
        
    ItemStack i = event.getMatrix()[/* slot of item */];
    if (i == null || i.getAmount() > 2) {
        event.setResult(null);
        return;
    }

    i.setAmount(i.getAmount() - 1);
}

well couldnt really think of any examples

#

@deft sedge

#

you get the point tho right?

deft sedge
#

ok

#

yea thanks @quaint mantle

crude charm
#

@quaint mantle added depend in the yml

quaint mantle
#

i dont know

#

idk

cinder thistle
# crude charm

love mac screenshotting but pls use superior viewing like column

cinder thistle
crude charm
#

idk how

cinder thistle
crude charm
#

ok

#

do you know my awnser?

cinder thistle
#

nope

#

just saw an image

crude charm
#

and I sent the NEW error

#

cause I added depend helper

#

and it removed that one

#

and gave another

crude charm
cinder thistle
#

cba tbh

crude charm
#

?paste

queen dragonBOT
crude charm
crude charm
#

🥺

snow bane
#

so i have this if statement that checks if an itemstack in the players inventory has a certain name but for some reason sometimes it does while sometimes it doesnt

crude charm
snow bane
#

i cant send it here ill send in dms

crude charm
#

why not

drowsy helm
#

lmao

#

just send a snippet, not as creenshot

snow bane
#

cuz i dont got image perms

snow bane
drowsy helm
#

paste your actual code

#

not a screenshot of your code

snow bane
#

oh bruh good idea lmao

cinder thistle
#

verify

snow bane
#

i dont have an acc

cinder thistle
#

make one

snow bane
#

        for (ItemStack item: player.getInventory().getContents()) {
            if (item != null && item.hasItemMeta()) {
                if (item.getItemMeta().getDisplayName().contains("Artifact C")) {
                    getLogger().info("yes");
                    glowEntitiesInChunks(player, true);

                }
                else {
                    getLogger().info("no");
                    glowEntitiesInChunks(player, false);

                }
            }

        }
crude charm
#

send "item"

drowsy helm
#

eek

#

use nbt

#

but there should be no reason that only sometimes works

snow bane
#

yea i should start doing that

drowsy helm
#

it should work all the time

snow bane
#
[21:00:04] [Server thread/INFO]: no
[21:00:04] [Server thread/INFO]: no
[21:00:04] [Server thread/INFO]: no
[21:00:04] [Server thread/INFO]: no
[21:00:04] [Server thread/INFO]: yes
[21:00:04] [Server thread/INFO]: no
[21:00:04] [Server thread/INFO]: no
[21:00:04] [Server thread/INFO]: no
[21:00:04] [Server thread/INFO]: no
[21:00:04] [Server thread/INFO]: no
[21:00:04] [Server thread/INFO]: no
[21:00:04] [Server thread/INFO]: no
[21:00:04] [Server thread/INFO]: no
[21:00:04] [Server thread/INFO]: yes
[21:00:04] [Server thread/INFO]: no
[21:00:04] [Server thread/INFO]: no
[21:00:05] [Server thread/INFO]: no
[21:00:05] [Server thread/INFO]: no
[21:00:05] [Server thread/INFO]: no
[21:00:05] [Server thread/INFO]: no
[21:00:05] [Server thread/INFO]: no
[21:00:05] [Server thread/INFO]: no
[21:00:05] [Server thread/INFO]: yes
[21:00:05] [Server thread/INFO]: no
[21:00:05] [Server thread/INFO]: no
#

server returns this

drowsy helm
#

because its iterating over all items

#

?

#

not all items will be that artifact

snow bane
#

bruh u just answered my question why am i stupid

drowsy helm
#

lol

crude charm
deft sedge
#

I cleared all of the crafting recipes in my plugin, is there a way to add back specific ones?

random epoch
deft sedge
#

ok, but is there not a simple way to add back a recipe?

drowsy helm
#

just iterate over all and dont remove it, easier to not remove it than put it back

drowsy helm
#

if no one is responding we dont know the answer

#

bumping it wont help

crude charm
#

just because you dont know it doesent mean someone else wont :/

drowsy helm
#

you literally sent it 3 messages ago

#

they will see it

crude charm
#

not everyone has perfect, 2020 vision :/

crisp gust
#

its 2021

#

:)

wispy fossil
#

yall are so rude lmao

hasty lynx
#

hello! how can I do this throw
throw new NoPermissionException("Not Permissions");
and if the player executes a command and doesn't have the permission! then it sends the message put in the throw new NoPermissionException

drowsy helm
#

use a try catch

#

and print the string that you passed in the constructor

hasty lynx
#

hat happens is that I don't want to use try catch
I want to do it this way
if (!player.hasPermission("dbcr")) {
throw new NoPermissionException("Not Permissions");

drowsy helm
#

why not just print

#

and return

#

whats the use of using an exception

lost matrix
#

How would you guys check if a certain ItemStack yields extra results from a Blocks DropTable. Or if its even a viable tool.
I would like to implement a method
boolean isViableTool(Material/ItemStack tool, Material target)
or
boolean isViableTool(Material/ItemStack tool, Block target)

But im not sure how to properly evaluate if an ItemStack is "meant to be used" on that Block type.
So one example output would be

DIAMON_PICKAXE for STONE -> true
STONE_SHOVEL for OAK_PLANKS -> false

Preferably without reverse engineering the nms block break to calculate the drops with some LootTable magic.
Im at the point where i would generate all Blocks at the spawn chunk in the bedrock and check the results of breaking the Block
with each tool ItemStack once...

shut plaza
#

?paste

queen dragonBOT
drowsy helm
#

unless you want to use CraftMagicNumbers

#

but thats nms