#help-development

1 messages · Page 1415 of 1

torn oyster
#

when it is clicked

drowsy helm
#

have an array of consumers

torn oyster
#

what is a consumer

drowsy helm
#

could be for each slot, or for item id or something

#

variable that executes code

#
Consumer<int> myconsumer = (i) -> {
System.out.println(i);
}```
#

takes a lambda expression

#

doesn't have to be an int, can be any generic

torn oyster
#

could you show what it would look like

#

with my current constructor

drowsy helm
#

so is guiObject an item in the gui?

torn oyster
#

yup

drowsy helm
#

alr just a misleading name

#

so you can pass it like this

torn oyster
#

i have a GuiObject object and a Gui object

#

gui being the inventory

drowsy helm
#
    public GuiObject(Material material, int amount, Gui gui, Consumer<InventoryClickEvent> consumer) {
        this.setType(material);
        this.setAmount(amount);
        this.owningGui = gui;
        this.consumer = consumer;
    }

GuiObject obj = new GuiObject(x, x, x, (event) -> {
  //do stuff
});
#

Gui object is just ambiguous, could be the holder, could be the item

#

then when you want to actually call it

#

call consumer.accept(event)

#

on your listener

#

but you would have to figure which object is being clicked

torn oyster
#

would i be able to have a listener

#

in each guiobject

#

or is that a lot

drowsy helm
#

i mean you could

#

but you would have to do the same if statements in all of them

#

which is the same as having just one

quaint mantle
#

Is it possible to create a packet and send it to a player with a shield blocking to simulate the shield getting hit by an axe?

torn oyster
#

why is event null

#

oh

#

wait

quaint mantle
#

I want to force players to lower their shields

torn oyster
#

how would i create a new instance of an InventoryClickEvent

drowsy helm
#

you dont

sage swift
#

new InventoryClickEvent(args)

drowsy helm
#

you are just passing it to the consumer when it gets called

torn oyster
#

oh wait

#

yea

#

i forgot a comma thats why

sage swift
#

but you can do that to check if it's cancelled

#

by another plugin

#

before you do something yourself

#

dangerous territory though

torn oyster
#

Target type of a lambda conversion must be an interface

#

wut

drowsy helm
#

show your code

torn oyster
#

nvm

#

lmao

quaint mantle
#

Tried that and it sets the cooldown correctly and you see the items cooldown in your hotbar but doesn’t lower the shield

#

So it defeats the purpose of the cooldown because you can just continue to hold down right click

#

Shields also have a unique cooldown animation

#

Which doesn’t work when you set it that way that just doesn’t allow u to block

#

Whereas a normal shield cooldown drops the shield down and then slowly comes back up

#

There has to be some sort of way to spoof hitting the players shield with a packet

young knoll
#

Is there an easy way to check if an entity is in render distance of a player

drowsy helm
#

you can listen for the Settings packet and get render distance from that, then just do a sqrt function. That's the best method ic an think of really

young knoll
#

I guess a better question is, is there a reasonable and performant way to check if an entity is close the the player or should I just be sending my packet for all entities in the world

drowsy helm
#

there is the getEntitiesInRadius (or whatever the method is called), can just iterate over that

#

I'd assume a few math calcs would be more performant than iterating over every entity in the world

young knoll
#

Does that method have to check all entities in world anyway

#

Or does it do it by chunk

drowsy helm
#

Good question, I'm not actually sure on that

#

would have to look at source

#

I'd assume it would just get neighbouring chunks and check

near crypt
#

can i check the DisplayName in the PlayerInteractEvent to check if the block clicked is a custom skull?

torn oyster
#
    @EventHandler
    public void onClick(InventoryClickEvent e) {
        Player p = (Player) e.getWhoClicked();
        
        if (e.getClickedInventory() == owningGui.getInventory()) {
            if (e.getCurrentItem() == null) {
                return;
            }
            
            if (e.getCurrentItem().isSimilar(this)) {
                consumer.accept(e);
                e.setCancelled(true);
            }
        }
    }```
#

why isnt this working

#

it just does nothing

#

and doesnt cancel

#

this is a class that extends itemstack

young knoll
#

You aren’t supposed to extend itemstack

near crypt
#

@young knoll true

young knoll
#

Or most API classes

ivory sleet
torn oyster
#

well anyway

#

the listener isnt working

#

its registered

#

just nothing

ivory sleet
#

You shouldn’t compare inventories with == use InventoryHolder (discouraged) or InventoryView

torn oyster
#

okay well

#

fixed that

#

but it gets past that

#

i've tested

ivory sleet
#

So what? Then it works lol

torn oyster
#

no

#

its this part

#
            if (e.getCurrentItem().isSimilar(this)) {
                consumer.accept(e);
                e.setCancelled(true);
            }```
near crypt
#

use .equals

#

and then the material

torn oyster
#

no

drowsy helm
#

why

#

isSimilar is better

ivory sleet
#

Yeah idk send ur entire class lach also how do u register it

torn oyster
#

i did this thing so i dont have to use material

near crypt
#

oh okay

ivory sleet
torn oyster
#

?paste

queen dragonBOT
torn oyster
ivory sleet
#

Or well they’re not exactly the same

torn oyster
#

this is 1.8 api

ivory sleet
#

Can you stop implementing the api interfaces lmao

near crypt
#

1.8 xD

ivory sleet
#

ItemStack and MetadataValue wth

torn oyster
#

metadatable has to be implemented so i can add metadata yea

ivory sleet
#

Wat

torn oyster
#

itemstack doesnt have setmetadata

young knoll
#

Update and use pdc

#

Or find an NBT API

ivory sleet
#

That doesn’t mean you should implement the api interface

#

Unless it’s explicitly mentioned don’t because it most likely will lead to unwanted bi effects

torn oyster
#

setmetadata works fine

#

i just wanna know why the listener isnt getting to that point

#

it sysouts "yes"

drowsy helm
#

does the event get called at all

torn oyster
#

omg

#

of course it does

#

it prints "yes"

ivory sleet
#

Maybe cuz you extend ItemStack dummy

torn oyster
#

how would that affect anything

ivory sleet
#

Idk check the CraftItemStack isSimilar and the normal ItemStack ones

#

Maybe it disallows your extension of it

torn oyster
#

maybe its cuz im running a 1.8 plugin on a 1.16 server

ivory sleet
#

That too isn’t a great idea

#

But for the fifth time dont extend api classes and interfaces unless mentioned jesus dude

torn oyster
#

what do i do instead

#

a wrapper class?

ivory sleet
#

Yes

#

Create a wrapper or an adapter

sage swift
#

like a candy wrapper???

#

omg

#

i love candy

coral sparrow
#

Is nms removed in 1.12?

#

i mean does it exist lol

chrome beacon
#

ofc it exists

coral sparrow
#

lmao

chrome beacon
#

Yeah you don't have the nms dependency

#

Also why pre5

coral sparrow
#

oh there is a nms dependancy;-;

coral sparrow
chrome beacon
#

Start by at least using 1.12.2

#

Yeah that's what you need for nms

coral sparrow
#

oh

chrome beacon
#

also make sure to run BuildTools and build 1.12.2

coral sparrow
#

IChatBaseComponent cannot be resolved to a type

torn oyster
#

hello hazim

coral sparrow
wet breach
wet breach
#

I am just stating what it means, shouldn't be hard to check if its still present 😛

coral sparrow
#

oh okay

#

PacketPlayOutTitle cannot be resolved to a type

#

1.12 buildtools was run

wet breach
#

need to target the server jar instead of the api

coral sparrow
#
           <groupId>org.spigotmc</groupId>
           <artifactId>spigot</artifactId>
           <version>1.12.2-R0.1-SNAPSHOT</version><!--change this value depending on the version or use LATEST-->
           <type>jar</type>
           <scope>provided</scope>
       </dependency>``` isnt this how
sage swift
#

oh is that what it usually means

#

interesting

coral sparrow
#

wot

wet breach
#

do you have the server jar installed in your local maven repo @coral sparrow ?

wet breach
#

that would be why then, install it to the local maven repo and it should pick it up 🙂

coral sparrow
#

how do i..

#

i am new to maven

#

sry

wet breach
#

normally buildtools would do it for you

coral sparrow
#

1.8 buildtools would?

wet breach
#

any of them

coral sparrow
#

imma install it again

wet breach
#

run java -jar BuildTools.jar --rev 1.12

coral sparrow
#

yea i did

#

1.8.8 btw

wet breach
#

in your pom you are targeting 1.12

#

for version

coral sparrow
#

ye

#

ill show my pom again

wet breach
#

if you want 1.8 spigot then you need to change that

coral sparrow
#

yea i did

wet breach
#

I meant in the pom

#

<version>1.12.2-R0.1-SNAPSHOT</version> this is what you showed you had, this means 1.12 spigot version, not 1.8

coral sparrow
#

yes

#

ik

coral sparrow
wet breach
#

looks right

#

will have to research the revision number

#

not sure if it was only r0.1

#

or if there was a r0.2

coral sparrow
wet breach
#

anyways after fixing all that, and buildtools installs 1.8 to the maven repo

#

you should be able to compile

#

if buildtools still doesn't move it to the maven repo, I can show you how to manually do it

coral sparrow
#

yes it did, GG

#

ty for help

wet breach
#

np

coral sparrow
#

player.sendTitle("e", "e", 1, 20, 1); btw does this works

sullen marlin
#

sure

coral sparrow
quaint mantle
#

how can i make a communication between spigot and bungeecord without plugin messages bcz i want to communicate even if players arent on server

wraith rapids
#

throw some sockets at it

wet breach
#

@quaint mantle basically what is being stated is have your plugins communicate directly with each other 😉

quaint mantle
coral sparrow
#
                event.setCancelled(true);
   }
        }```
#

How do i allow them to use only some commands such as /msg /r

quaint mantle
#

show the full event

coral sparrow
#

ok

coral sparrow
#

u cant /msg or /r but u can use other commands xD

quaint mantle
#

w8 what xd

#

ill try

#

you want to block all commands and enable only /msg and /r?

hidden delta
coral sparrow
quaint mantle
quaint mantle
#

okay

#

forgot to cancel the event

coral sparrow
#

yea np

#

btw ty

quaint mantle
#

yw

coral sparrow
#

does the code mean

#

you cant use msg and r

#

but u can with other msg

#

@quaint mantle

hidden delta
#

First you need to get the message and split them to arguments
and make an array that contains the allowed commands that they can process
after that check the array if contains args[0]

coral sparrow
quaint mantle
#

this means that if the command isnt msg or r then it will be disabled

coral sparrow
#

nvm yea

#

ur right ig

quiet ice
#

does this actually work?

coral sparrow
#

this server works fine

hidden delta
#

try msg without /

quiet ice
#

The code, because by all accounts it should not

coral sparrow
hidden delta
#

yup

coral sparrow
#

i didnt add "/"

#

;-;

quiet ice
#

nvm, you are using pretty interesting logic

coral sparrow
#

ikr

hidden delta
#

If I remember PlayerCommandPreprocessEvent works even if the player didn't process the comamnd

quiet ice
#

Beware of the commands.yml and command aliases

coral sparrow
#

i use some command aliases btw

hidden delta
#

uh nvm

coral sparrow
#

heh

quaint mantle
#

small question, currently im able to get "tickets" when player is online , someone knows a way to return all players "online & offline ? public static List<Player> convert(ArrayList<String> list) { return list.stream().map(Bukkit::getPlayer).filter(Objects::nonNull).collect(Collectors.toList()); } https://pastebin.com/0FEwbpBe

near crypt
#

how can i send a player a Title in Spigot in 1.16.5?

quiet ice
#

for them, everything is a player

stone sinew
near crypt
#

how can i send a player a Title in Spigot in 1.16.5?
@quiet ice

stone sinew
#

Player.sendTitle()

near crypt
#

but i cant just put the string in right?

stone sinew
#

Follow the variables provided

near crypt
#

can you send me a example with the text: hello world?

#

player.sendTitle("hello world") wont work i guess

stone sinew
#

?jd Player.sendTitle

#

That didn't work lol

#

?jd sendTitle

eternal oxide
#

use the second one not the deprecated one

near crypt
#

whaaaat is it really that easy

#

lol

#

in 1.8 it is way harder right?

#

@eternal oxide

tribal holly
#

why when i click inside an anvil inventory the method getClickedInventory.getType return CRAFTING inventory and not anvil ?

quaint mantle
#

i would try getView instead

tribal holly
#

very weird

near crypt
#

getView is better for this

tribal holly
#

it never return ANVIL

#

even with getView

near crypt
#

is there even a anvil type xD?

#

an*

tribal holly
near crypt
#

thats weird

eternal oxide
#

testing it now

tribal holly
#

no sens

near crypt
#

rl the server xD

#

and then try it

#

again

tribal holly
#

haha funny of course i reload it

near crypt
#

or stop the server and start it idk

tribal holly
#

and i put my computer in rice ?

near crypt
#

what is the best time for fade out and fad in for a title?

quiet ice
#

Default likely, it's documented

near crypt
#

okay

quiet ice
#

But you can always test for yourself with some try and error

near crypt
#

yes i see

wet breach
tribal holly
wet breach
#

I don't see a problem

#

o.O

tribal holly
#

...

wet breach
#

it would just be easier if you investigated the NMS code involved with it 😉

eternal oxide
#
[10:36:08] [Server thread/INFO]: View: ANVIL```
tribal holly
#

your doing it on InventoryClickEvent ?

eternal oxide
#
System.out.println("Type: " + event.getClickedInventory().getType().name());
System.out.println("View: " + event.getView().getType().name());```
tribal holly
#

.name() hmmm

quaint mantle
#

how can i remove all particles using /kill or smth like that?

tribal holly
#

that's the only difference between us

eternal oxide
#
    @EventHandler
    public void InventoryClick(InventoryClickEvent event) {```
tribal holly
#

still the problem

#

still return CRAFTING

eternal oxide
#

on 1.16 my full method ```java
@EventHandler
public void InventoryClick(InventoryClickEvent event) {

    if (event.getClickedInventory() == null) return;
    
    HumanEntity whoClicked = event.getWhoClicked();
    SlotType type = event.getSlotType();

    whoClicked.sendMessage("Click - Top = " + event.getClickedInventory().equals(gui) + " : Type = " + type.name());

    System.out.println("Type: " + event.getClickedInventory().getType().name());
    System.out.println("View: " + event.getView().getType().name());
}```
#

works perfectly

tribal holly
#

i can't understand what i'm doing wrong

eternal oxide
#

What spigot are you using?

tribal holly
#

1.16.5

#

latest version

eternal oxide
#

let me just build current. There was an update yesterday

tribal holly
#

i've copy past your code

eternal oxide
#

Silly question, but you are definitely clicking in an Anvil?

tribal holly
#

i open an anvil and click in it yep

eternal oxide
#

I was in creative. I'll test in survival

tribal holly
sullen marlin
#

I guarantee it

tribal holly
#

okay i'm updating right now so

sullen marlin
#

What does /version say

tribal holly
#

heuu 9 version behind sry

eternal oxide
#

Yep, shows ANVIL in both creative and survival

tribal holly
#

i'm using maven did i need to change something in it to update it inside intellij ? or just run the build tool ?

eternal oxide
#

You need to run BT to get the latest build for your test server

tribal holly
#

yep it work

#

thx

orchid zinc
#

Hi, I would like help with ProtocolLib. I am trying to send a fake advancement, to show the popup on the top-right corner. But the packet is a little bit complicated 😅

#

Someone can help me please 😄

chrome beacon
#

Use PacketWapper

#

It will take care of the hard parts for you

wet breach
#

couldn't you just use t he api?

coral sparrow
#

Can we add like lol list commandfs in config.yml lol

#

nvm yes

wise blaze
#

Is there anyway someone could help me? I'm trying to edit the code for a plugin I have and I'm terribly new and don't know what I need to even do that. I'm not trying to redistribute it afterwards or anything shady.

coral sparrow
wise blaze
#

Well the plugin itself is a gui. which has already been made and preset with things. the config that i can edit from my ftp doesn't let me do anything but change the placeholder items on the gui menu itself. I'm trying to make it so when you click the items in it, it not only runs the command it currently does, but also a second command which I need. Which can't be done from the config

opal juniper
wise blaze
#

And that's where you lost me lol. I don't even know that. I have the file version of the jar file

opal juniper
#

😫

eternal oxide
#

There is a way around it without modifying the plugin at all

opal juniper
#

and what would that be?

wise blaze
#

curiosity peaks

eternal oxide
#

add a plugin I wrote called PermTrigger. That allows you to define a set of command to run when a player is given a specific permission.

#

then you just configure your GUI to assign a permission to trigger all the commands

tribal holly
#

is this normal that the PrepareAnvilEvent is fired infinit times until there's item inside it ?

wise blaze
#

It's not giving them permissions tho. It's running commands for them. I'm trying to make it so when it runs that first command for them, the console will run a command at the same time for something else

eternal oxide
#

if you assign a timed permission it can even be removed after you are finished

opal juniper
#

I think you have mis understood

#

Yeah

quaint mantle
#

Hey, I need help with ProtocolLib, I am listening to the Block Change Packet and want to get the type of the block before it was changed, using the packetwrapper i could only get the type of the new, changed block

opal juniper
eternal oxide
#

Click GUI, it runs a single command to add a permission

#

by adding that permission it triggers teh command sequence

tribal holly
opal juniper
tribal holly
#

and 3 trigger by move inside the anvil inventory

stark portal
#

I am trying to make it so that only arrows drop but they still dont drop and no item drops
`@EventHandler
public void onpDropItem(PlayerDropItemEvent e){

// Player p = e.getPlayer();
if(e.getItemDrop().getItemStack().getType() != Material.ARROW) {
e.setCancelled(true);

       }
       
   }`
quaint mantle
eternal oxide
#

Seems odd, why would you want to avoid Spigot events?

opal juniper
#

i would say they are better cause the packets get kinda spammed

opal juniper
quaint mantle
#

well i have an area where all placed/broken blocks should be reset, i just thought there would be a better way than listening to all of spigots block and bucket events

stark portal
opal juniper
opal juniper
quaint mantle
fresh glade
#

is it possible to redirect a player to another server (e.g. to hypixel.net) when he enters a command?

hidden delta
#

and only arrow drops

stark portal
opal juniper
stark portal
#

only arrows

hidden delta
#

okay

stark portal
#

but nothing drops

hidden delta
#

?

opal juniper
#

nothing at all?

stark portal
#

arrows should drop but nothing drops

hidden delta
#

your code is working

opal juniper
#

Have you registered the listener

stark portal
#

oh maybe i have something stopping them

#

ye i did

fresh glade
hidden delta
#

check other events

stark portal
#

`@EventHandler
public void onItemSpawn(ItemSpawnEvent e) {
if(e.getEntityType() != EntityType.ARROW) {
e.setCancelled(true);
}

   }`
#

the same for this 1 as well

#

no items spawn

#

not even arrows

opal juniper
#

an EntityType.ARROW is the entity that gets fired from a bow

quaint mantle
eternal oxide
#

are you running this code sync?

quaint mantle
#

yes

eternal oxide
#

your ServerSocketThread?

quaint mantle
#

yes i am

eternal oxide
#

you are locking up yoru server

quaint mantle
#

no i am not it works

eternal oxide
#

while (true) {

#

you are literally running that constantly and never stopping

#

It never exits so the server can do nothing else

quaint mantle
chrome beacon
#

And?

quaint mantle
#

idk i want to keep it aliv

#

e

eternal oxide
#

You can't run sync code in a permanent loop and not crash the server.

quaint mantle
#

im like having command "/serverstatus" where i wanna get like cpu usage ram free/max/used and i use socket

eternal oxide
#

How are you starting your runnable?

quaint mantle
#
public void startServer() throws IOException {
        serverSocket = new ServerSocket(instance.getConfigHandler().SERVER_PORT);
        serverThread = new Thread(new ServerSocketThread(serverSocket));
        serverThread.start();
    }
dusk flicker
#

That's a shit tutorial

quaint mantle
#

and i am a newbie with sockets

eternal oxide
#

So you are wrong, its not sync

quaint mantle
#

bcz i need to use something that will work even without players online bcz console too

eternal oxide
#

That is a terrible tutorial

dusk flicker
#

Yea

quaint mantle
#

and what should i use

dusk flicker
#

Read like the last post in it it has a link to an official java 1 if I recall

quaint mantle
eternal oxide
#

Yes

quaint mantle
#

okaay

stark portal
#

doesnt appear to work

opal juniper
#

idk then 🤷‍♂️

#

seems something is wrong on ur end

stark portal
#

thanks

opal juniper
#

👍

near crypt
#

how can i wait 3 seconds in my java code?

quaint mantle
#

Thread.sleep(3000);

cold field
near crypt
#

okay

#

but then i have to throw a exeption

#

exception*

#

@quaint mantle

quaint mantle
#

well yea

cold field
near crypt
#

no...

#

xD

timber crescent
#

For some reason im still not executing the command kit ```java
@EventHandler
public void onInteract(PlayerInteractEvent e) {
Player p = e.getPlayer();
if (!SolarKitPvP.hasKit.contains(p)) {
if (SolarKitPvP.noKit.contains(p) && (e.getAction().equals(Action.RIGHT_CLICK_AIR) || e.getAction().equals(Action.RIGHT_CLICK_BLOCK)) && e.getItem().equals(Material.NETHER_STAR)) {
if (!e.getItem().getItemMeta().getDisplayName().equalsIgnoreCase(ChatColor.GOLD + "Kit Selector")) {
return;
}

            p.performCommand("kit");
        }

    }
}```
quaint mantle
cold field
#

I think he is working on the main thread

#

@quaint mantle

quaint mantle
quaint mantle
glossy scroll
cold field
#

yeah, proprities of the entities the datawatcher

#

is what i mean

glossy scroll
#

Depending on the entities, different indexes will change the visual appearences for entities

#

Thats it

#

Like at index 0, a byte value of 0x20 will make them invisible

cold field
#

Do you know what the packet is used for?

glossy scroll
#

I just told you

cold field
#

does it just ignore the gameprofile?

glossy scroll
#

Gameprofile and data watchers are different things

#

They control different things

cold field
#

ok. What i want to do is create an npc with a skin.

glossy scroll
#

EntityMetadata is not the right packet

cold field
#

Hu

glossy scroll
#

You need to send a player info packet

#

Then send the spawn named entity packet

cold field
#

I modified the gameprofile

#

and added the property textures

#

with the value of the texture

#

is it enough?

glossy scroll
#

I told you what you need to do

#

There are places for the gameprofile in the player info packet

cold field
#

ok, when i send the packet with the gameprofile nothing happens

#

the player appears

#

without the skin

near crypt
#

how can i lock a location so i created a Location of a player and added 33 blocks to the x, the Location is different for everyone but i want to lock it

glossy scroll
#

Which packet are you using

cold field
#

PlayerInfo

glossy scroll
#

Is the texture signed?

cold field
#

no

glossy scroll
#

I believe it needs to be

cold field
#

...

#

thanks, i give it a try

crude charm
#
    public void openConnection() {
        try {
            this.connection = DriverManager.getConnection("jdbc:mysql://" + this.address + ":" + this.port + "/" + this.database + "?autoReconnect=true", this.username, this.password);
            this.loaded = true;
            Prison.getInstance().getLogger().info("[Database] Connection to the database was successful.");
        } catch (SQLException ex) {
            this.loaded = false;
            Prison.getInstance().getLogger().info("[Database] Could not establish a connection to a database... Shutting down");
            Prison.getInstance().getLogger().info("[Database] Reason=" + ex.getMessage());

            Bukkit.getPluginManager().disablePlugin(Prison.getInstance());
            Bukkit.getServer().shutdown();
        }
    }

why is this not connecting? all my info is 100000000000% correct im using it on another plugin and it works but not here

#

ye

#

cos the server shuts downm

quaint mantle
#

do you have error?

crude charm
#

the server shutting down and it saying it cant connect

proven sierra
#

send the error message

quaint mantle
#

could you try ex.printStackTrace instead?

crude charm
# proven sierra send the error message

Prison.getInstance().getLogger().info("[Database] Could not establish a connection to a database... Shutting down");
Prison.getInstance().getLogger().info("[Database] Reason=" + ex.getMessage());

glossy scroll
#

Dont you need to hook into the sql thing?

#

Sorry

crude charm
proven sierra
#

🤦‍♀️

glossy scroll
#

I cant remember

quaint mantle
glossy scroll
#

Load the right classes

crude charm
glossy scroll
#

Yea an exception would probably help lol

crude charm
#

hmm

#

it cant read from the config

#

10 mins

quaint mantle
#

okay

crude charm
#

oh

#

I know

quaint mantle
crude charm
#

fixed it

quaint mantle
#

ig npe

glossy scroll
#

User of your plugin “hey my server wont start”

#

Plugin gives no info

quaint mantle
#

he didnt silent it

#

he just used getMessage instead of printStackTrace

glossy scroll
#

ig

crude charm
#

?PASTE

queen dragonBOT
crude charm
#

I was correctr

#

I had the config wrong

#

but its still not working

#

OH

#

IOM DUMB

quaint mantle
#

How would i serialize a collection of byte arrays to byte array?

crude charm
#

ITS STILL THE OCNFIOG

#

sduigfhsdgushgs

#

LMFAO

fluid nacelle
#

What do you think the best way to listen for when a villager levels up? Just listen for VillagerAcquireTradeEvent and compare the villager's exp to the traded recipe's exp?

quaint mantle
#

It will return 2d byte array

#

I wanna do Collection<byte[]> -> byte[]

eternal oxide
#

yes, you asked "a collection of byte arrays to byte array"
If you want it all in a single array you will have to packetize it. with a size byte preceding each section.

quiet ice
#

Though you might want to put this information before everything else for easy jumping without having to read a few bytes before jumping to the right position.
But I would advise against such principles for anything that is stored in memory, unless memory becomes a concern

near crypt
#

can i write 2 Events who are the same in one class?

#

with different names

eternal oxide
#

yes

near crypt
#

okay

eternal oxide
#

pointless unless you are using different priorities

near crypt
#

oh okay

glossy scroll
#

Do you mean create two events

#

Or listen to two events

near crypt
#

listen

eternal oxide
#

He means two event listeners that are identical, just different method names

glossy scroll
near crypt
#

what is this? xD

glossy scroll
#

Or you may have a sequence of implicit else and dont want to rewrite the whole thing with if/else

eternal oxide
glossy scroll
quaint mantle
timber crescent
#

This code doesnt work doesnt even print anything ```java
@EventHandler
public void onInteract(PlayerInteractEvent e) {
Player p = e.getPlayer();
if (!SolarKitPvP.hasKit.contains(p)) {
if (SolarKitPvP.noKit.contains(p) && (e.getAction().equals(Action.RIGHT_CLICK_AIR) || e.getAction().equals(Action.RIGHT_CLICK_BLOCK)) && e.getItem().equals(Material.NETHER_STAR)) {
System.out.println("Stage 1");

            if (e.getItem().getItemMeta().getDisplayName().equalsIgnoreCase(ChatColor.GOLD + "Kit Selector")) {
                System.out.println("Stage 2");
                p.performCommand("kit");
                return;

            }
        }

    }
}```
eternal oxide
#

did you register the event?

timber crescent
#

Yea its registtereed

eternal oxide
#

add a Stage 0 after if (!SolarKitPvP.hasKit.contains(p)) {

timber crescent
#

it prints

rotund pond
#

Hello everyone !

I'm trying to do a plugin which will be usable for any version.
There are certain classes that I will have to do several times depending on the version of the game
I run into a problem: For version 1.13 and above, I have to put "api-version: 1.13" in the plugin.yml file ...
If I do that, my plugin is no longer compatible with 1.8 ...

How can I solve this problem please?

eternal oxide
#

are you right clicking a block with a nether star in hand?

#

if so e.getItem().equals(Material.NETHER_STAR) should be e.getItem().getType() == Material.NETHER_STAR

rotund pond
eternal oxide
#

== is for comparing primities, enums and other Singletons

glossy scroll
#

Well if you look at what .equals does

#

(In an enum specifically)

#

It just does this == that

eternal oxide
#

it does teh same however == is null safe

wraith rapids
#

there is no practical difference

glossy scroll
#

So no different, but you should use ==

wraith rapids
#

but the convention is to use ==

rotund pond
#

Okay thank you !

wraith rapids
#

enums should never be null anyway

#

multi-module project

#

each module would depend against a particular version of nms or api or whatever you're writing against

glossy scroll
#

Thank you

wraith rapids
#

and each module would implement functionality as defined in the contract of your internal api

#

and you'd load the correct module in depending on the server environment

rotund pond
#

Mh I see I see ...
I'm looking how it works and I guess I have to learn to use Maven so :/

wraith rapids
#

myes

rotund pond
#

WELL !
Let's go so.
Thank you 🙂

quaint mantle
#

Whats the simplest way to add an item to a dispenser, but override an item thats already inside the dispenser (the dispenser may be full)

eternal oxide
#

if you don;t care about its contents, always add to slot 0

quaint mantle
#

and what if I want to add X itemstack indefinitely

#

as in maybe 3 slots worth

eternal oxide
#

use addItem(ItemStack) and check its return value

quaint mantle
#

I expect its iteration, which I am doing now, was just curious if there was a cleaner method

void flume
#

can you help me ? at net.minecraft.server.v1_16_R3.WorldGenFeatureFlower.b(SourceFile:33)

eternal oxide
#

it returns a HashMap of anything that did not fit in the Inventory

quaint mantle
#

thanks

torn shuttle
#

this is a bit of a weird question but is javafx still worth working with in 2021?

quaint mantle
#

@void flume Swoa are there more lines of errors?

torn shuttle
#

and if not what's a good replacement for it

eternal oxide
quaint mantle
#

oh cool, didnt know you could comment on messages

eternal oxide
#

?paste

queen dragonBOT
eternal oxide
#

Yay Not CafeBabe now using <> around that link. Seems new.

#

I wonder if...

#

?jd

void flume
#

@quaint mantle yes

eternal oxide
#

😦

quaint mantle
#

paste the whole thing @void flume

void flume
#

it is the crash report

quaint mantle
#

what are you trying to do

void flume
#

nothing

eternal oxide
#

You are modifying the list you are iterating over whilst iterating

quaint mantle
#

that sounds fancy so I agree

wraith rapids
#

use an iterator

eternal oxide
#

He's doing it in a .forEach

#

of a stream 😦

wraith rapids
#

sucks to use streams i guess

eternal oxide
#

um, this is happening in a chunk gen world populator?

#

oh Mohist 😦

#

@void flume You may get help in #help-server but as this is a Mohist server, good luck

void flume
#

this is not serveur mohist

#

it is spigot serveur

#

@eternal oxide

eternal oxide
#

Known server brands: Spigot, Mohist ?

void flume
#

spigot

eternal oxide
#

I'd suggest you remove Chunky and see if it still ahppens

void flume
#

okay

wraith rapids
#

chunky is just a pregenerator plugin though

eternal oxide
#

yep, its teh only plugin I see in there that has any effect on chunks

wraith rapids
#

by effect, you mean loading them?

eternal oxide
#

perhaps he had a chunk gen running

wraith rapids
#

players do that too

#

point is that chunky just tells the server to generate stuff, if the server blows up on that, there's something wrong somewhere and just removing chunky only hides the issue

near crypt
#

?paste

queen dragonBOT
eternal oxide
#

Location: 447,773 is the chunk that threw the error

#

Since when has MC/Spigot chunk generation been threaded?

near crypt
#

i built two containers in my minecraft map on the server and this event asks if a player clicks on a red or a green glas pane. If they click on the green they will be teleported 33 blocks + on the x and if they click the red - 33. everything works but the player can click multiple times on the red/ green pane wich means they can teleport as long as they want, i want that they only can click the red if they are on the side of the green pane. Here is the code of the Event: https://paste.md-5.net/exuyedixax.cs

#

the language is german btw 😄

eternal oxide
#

I Missed that

earnest junco
#

yea chunk gen and lighting has its own thread

eternal oxide
near crypt
#

and how can i check if they are in an Area?

#

not on a single point?

earnest junco
#

Every time I see Objects.requireNonNull a small part in me dies

near crypt
#

oh wait let me test something

#

@earnest junco why? xD

earnest junco
wraith rapids
#

reqnonnull doesn't make your code work better or make it more robust or make it able to handle nulls

earnest junco
wraith rapids
#

it just makes it blow up more reliably when encountering nulls

#

which makes issues easier to diagnose

#

it's not a solution, it's a failsafe

eternal oxide
#

Yeah, a failsafe is not why most are using it though. Its a false idea it will prevent an npe

minor garnet
wraith rapids
#

most people use it just to hide ide warnings yeah

near crypt
#

@earnest junco oh okay :DDDD

#

thx for the tipp 😄

minor garnet
#
    public static void connection(String s, boolean b) {
        try {
            if (!b && !connection.isClosed()) {
                connection.close(); return;    
            }
            String url = "jdbc:sqlite:" + s + ".db";
            connection = DriverManager.getConnection(url);
            stmt = connection.createStatement();            
        } catch(SQLException e) {
            e.printStackTrace(); return; 
        }
    }```  why is dont creating a file ?
sleek pond
#

oooh, haven't been back here for a while, time to see what noobs that don't know java have managed to do

eternal oxide
#

SQLException: No suitable driver found for jdbc:sqlite:plugins\GroundLoot/database.db

wraith rapids
#

show me what you've gooot

#

epic rick and morty reference

#

top kek am i rite

sleek pond
#

kek

minor garnet
minor garnet
#

no thanks

sleek pond
#

?

#

you do tho

minor garnet
#

im using sqlite :p

sleek pond
#

install sqlite then

minor garnet
#

changed a message

#

but is it not already installed?

sleek pond
#

i don't think so

minor garnet
sleek pond
#

unless you installed it it's not going to be installed

#

on the computer

eternal oxide
sleek pond
#

oh yea

#

that too

minor garnet
#

but I had done a test on other versions, after I changed the version that started giving this error

wraith rapids
#

you have been here for like days

#

you should know to use a paste site by now

minor garnet
#

what do you mean by that?

#

I think that paste would be to put codes and not errors

wraith rapids
#

the paste site exists so I don't need to download 30 million message.txt's from 4000 people sending them daily

minor garnet
#

well exist that class

minor garnet
#

you can just .. read ?

#

i dont know if if the author who sent the message only can see

young knoll
#

Everyone can

#

Only on desktop though

minor garnet
#

so i dont know why he need download it =/

eternal oxide
#

depending on size it can be too wide/long to read easily in discord

near crypt
#

?paste

queen dragonBOT
near crypt
eternal oxide
#

I'd suggest you look at that logic and simplify it if(!(someone.getLocation().getX() > -211))

#

if not greater than -211. So in other words if less than -211

near crypt
#

yes less than -211 is for example -212

eternal oxide
#

what is the current players x coord?

near crypt
#

wdym with yurrent?

#

current

eternal oxide
#

and line 3 no need to cast

near crypt
#

i need to...

eternal oxide
#

no its already a Collection<Player>

near crypt
#

intellij says i need to because otherwise it is red underlined

#

anyways...

eternal oxide
#

its easier to just for(Player someone : Bukkit.getOnlinePlayers()) {

#

But IJ is wrong if it says you have to cast

near crypt
#

oh i think i know the prob

#

this is my code now

#

is it right?

eternal oxide
#

that code will teleport anyone who's x is less than -211

quaint mantle
#

Hello spigt! I was removing all the mob AI and adding AI. Other AIs work, but 'PathfinderGoalNearestAttackableTarget' did not work. Do you know why? The other AI worked fine. my code:

@Override
    public void initPathfinder() {
        this.targetSelector.a(0, new PathfinderGoalNearestAttackableTarget<EntityHuman>
                (this, EntityHuman.class, true));
        this.goalSelector.a(1, new PathfinderGoalAvoidTarget<EntityGolem>(this, EntityGolem.class, 15, 1.0D, 1.0D));
    }

Working part:
this.goalSelector.a(1, new PathfinderGoalAvoidTarget<EntityGolem>(this, EntityGolem.class, 15, 1.0D, 1.0D));

Not working part:

                (this, EntityHuman.class, true));``` (It doesn't attack player)
near crypt
#

@eternal oxide right

patent spoke
#

I have this little funktion witch should update the money value in a table, but it returns "null", can someone help me? (the name i use exist in the database)
public void insertgetter(String name, int betrag){ try { PreparedStatement ps = MainSQL.getConnection().prepareStatement("UPDATE money_survival1 SET money=? WHERE name="); ps.setInt(1, betrag); ps.setString(2, name); ps.executeUpdate(); } catch (SQLException e) { System.err.println(e); } }

earnest junco
#

goal = movement, target = attacking

patent spoke
#

ok, thanks

quaint mantle
#

also, entitypig not working

#

and EntityCow

#

is it possible to get an array with online and offline players in the same Player obj ? still having problems to get offline players

quaint mantle
minor garnet
#

is it possible to make a spider go up the wall faster?

quaint mantle
#

why not

young knoll
eternal oxide
#

Offline will include online you just have to if (offline.isOnline()) player = offline.getPlayer()

eternal oxide
cold field
#

Hem guys, have anyone an idea why when i send the playerinfo packet with a skin property the skin isn't always applied?

quaint mantle
sleek pond
#

oh

#

lol

#

it's the notepad++ lizard

quaint mantle
#

im not sure if that can work with what i need. i query database to get all uuid's " report system" i get all uuids to array, then put the uuid's into player object to puth them on an item "Paper" and loop it. since Player = online it only shows online players tickets would like to get all tickets online and offline ``` for (Player value : convert(list)) {
PreparedStatement statement = DatabaseSetup.getConnection()
.prepareStatement("SELECT * FROM " + DatabaseSetup.Reporttable + " WHERE UUID=?");
statement.setString(1, value.getUniqueId().toString());
ResultSet rst = statement.executeQuery();

                    if (rst.next()) {
                        String report = rst.getString("REPORT");
                        String reporter = rst.getString("REPORTING");
                        Player reportingP = Gat.plugin.getServer().getPlayer(reporter);
                        ItemStack ticket = new ItemStack(Material.PAPER, 1);
                        ItemMeta meta = ticket.getItemMeta();
                        assert meta != null;
                        meta.setDisplayName(value.getName());
                        ArrayList<String> lore = new ArrayList<>();
                        assert reportingP != null;
                        lore.add(ChatColor.DARK_AQUA + "Submitted by: " + ChatColor.AQUA + reportingP.getName());
                        lore.add(ChatColor.DARK_AQUA + "Reported: " + ChatColor.AQUA + value.getName());
                        lore.add(ChatColor.DARK_AQUA + "Reason: " + ChatColor.AQUA + report);
                        meta.setLore(lore);
                        ticket.setItemMeta(meta);
                        inventory.addItem(ticket);
                    }
                }
            }
        }```
#

"Value" is the array list with online and offline players

eternal oxide
#

If you are getting the UUID as a String, no that will not work. You have to convert it to a UUID first

#

UUID.fromString(String)

#

and you should Gat.plugin.getServer().getOfflinePlayer(UUID.fromString(reporter))

quaint mantle
#

dang i totally missed that, got lost on my own code actually xd

eternal oxide
#

just note that an OfflinePlayer will never be null.

#

If they are not truly a player they will have a null name

quaint mantle
#

yea ive noticed that a while back thanks !

vast quest
#

my plugin loads twice?

quaint mantle
#

share main class ?

vast quest
#

k

#

so dont judge me

eternal oxide
#

you can;t use new Generator()

#

you are in your main class so use this

vast quest
#

o

vocal shuttle
#

?paste

queen dragonBOT
vocal shuttle
vast quest
#

uh

vast quest
grim wind
#

Hey guys, getting net.md_5.bungee.util.QuietException: Unexpected packet received during server login process! 0d0100 Anyone got an idea? Trying to work with JoinGame packet on bungeecord

eternal oxide
vast quest
#

ok

eternal oxide
#

lastly if you are in teh BlockFormEvent and you are setting a type you have to cancel teh event

#

if you don;t cancel the event your changes will be overwritten

vast quest
#

o

proper plover
#

public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello World!");
}
}

#

pog

#

now time to make it in minecraft

sleek pond
#

lol

#

ok then

vast quest
#

Am I missing smth?

vast quest
#

@EventHandler
public void generation(BlockFormEvent event){

#

it does not give errors

#

it just does not go thru the if statement

#

even when its cobblestone

quaint mantle
#

Use BlockSpreadEvent to catch blocks that actually spread and don't just "randomly" form.

eternal oxide
#

sysout the type

vast quest
#

ight

quaint mantle
#

You made cobblestone spread correct?

eternal oxide
#

also sysout in the top of the event to be certain you are in the correct event.

vast quest
#

im just trying to check if the cobblestone is generated by water contact

quaint mantle
#

ah I see now

vast quest
#

it seems like type is lava?

#

how can I check if its cobblestone

proper plover
eternal oxide
#

its not always going to be lava

vast quest
#

it is

#
[18:09:31 INFO]: LAVA
[18:10:00 INFO]: Event triggered
[18:10:00 INFO]: LAVA
[18:11:04 INFO]: Event triggered
[18:11:04 INFO]: LAVA
[18:11:05 INFO]: Event triggered
[18:11:05 INFO]: LAVA
[18:11:07 INFO]: Event triggered
[18:11:07 INFO]: LAVA
[18:11:08 INFO]: Event triggered
[18:11:08 INFO]: LAVA
[18:11:10 INFO]: Event triggered
[18:11:10 INFO]: LAVA``` tried sum
mystic tartan
#

How can you replicate a piece of armour breaking through code? As far as I can tell, setting the damage/durability to 0 or lower doesn't actually break it (also to cause the sound of it breaking)

vast quest
glass sparrow
mystic tartan
#

ah, no easier way?

vast quest
#

its not rly hard

glass sparrow
#

it's only like 2 lines but ig what you mean it seems wrong

vast quest
#

So uh how can I check if the generated block is cobbleston

eternal oxide
#

Are you actually creating any cobblestone?

vast quest
eternal oxide
#

then check getNewState instead of getBlock

vast quest
quaint mantle
#

Best free sevrer hosting

eternal oxide
vast quest
#

this is what I have ```java
public boolean getChance(int minimalChance) {
Random random = new Random();
return random.nextInt(999) + 1 >= minimalChance;
}
}

eternal oxide
#

so 1-1000

vast quest
#

yeah

eternal oxide
#

what minimal chance are you passing?

vast quest
#

1, 5, 30, 100, 500

eternal oxide
#

so yoru first call is getChance(1). That has a 999 chance of being greater

vast quest
#

yes

eternal oxide
#

it going to pass almost every time

vast quest
#

Yep

#

thats whats happening

#

how did you guess

eternal oxide
#

so every time its called you are going to replace it with a diamond ore

vast quest
#

Yeah but I dont want that

eternal oxide
#

you actually want it reversed? so 1 in 1000 chance to spawn diamond ore?

vast quest
#

Yeah

eternal oxide
#

then reverse your >= to <=

vast quest
#

o ok

glossy scroll
#

nextInt(1000) == 0

#

0.001% chance

#

Wait no

#

0.1% chance mb

vast quest
#

thats 0% chance

#

wait no

#

im dumb

eternal oxide
#

you shoudl also have it fall through and make cobble as it is possible for all of yoru tests to fail

vast quest
#

I only cancel it if the test is met

eternal oxide
#

ok

vast quest
#

and if its not cancelled it will be cobble

#

:o

#

it works

quaint mantle
#

how do I get the display name or somenoe?

if (cmd.getName().equalsIgnoreCase("afk")) {
            Bukkit.broadcast(p.getDisplayName() + "is AFK!")
        }
#

ah wait nvm

torn shuttle
#

.paste

#

?paste

queen dragonBOT
torn shuttle
#

can someone familiar with java abstraction tell me if I got the implementation of this abstraction correctly? just at a conceptual level, don't worry too much about the literal logic of the code
https://paste.md-5.net/keqotofuga.java

cold field
#

does anyone have any idea why when I send a playerinfopacket with inside an entity with a skin to a target player if the target is still joining it spawns the npc without rendering the skin?

eternal oxide
#

oh you sub classed

summer scroll
#

Is this thing this.getConfig().options().copyDefaults(true); gonna force the config to have the default value?

torn shuttle
#

though I was rereading it and I might be able to get away with implementing the listener as a subclass of the abstracted class instead

vernal basalt
#

i wanna log what armor a player is wearing in a config

glossy scroll
#

i’m not sure. I dont do a lot of stuff with player skins. Probably best to look at other code

cold field
#

thanks anyway

quaint mantle
#

does anyone know how to write textures for skulls and use those skulls ?

hidden delta
#

I have a method that transform the texture to skull

#
 public static ItemStack createSkull(String texture, String displayName, String... loreArray) {
        {
            ItemStack head = new ItemStack(Material.SKULL_ITEM, 1, (short) 3);
            if (url.isEmpty()) {
                return head;
            }
            SkullMeta headMeta = (SkullMeta) head.getItemMeta();


            headMeta.setDisplayName(ChatColor.translateAlternateColorCodes('&', displayName));
            List<String> loreList = new ArrayList<>();
            for (String lore : loreArray) {
                loreList.add(ChatColor.translateAlternateColorCodes('&', lore));
            }
            headMeta.setLore(loreList);
            
            GameProfile profile = new GameProfile(UUID.randomUUID(), null);

            profile.getProperties().put("textures", new Property("textures", url));
            try {
                Field profileField = headMeta.getClass().getDeclaredField("profile");
                profileField.setAccessible(true);
                profileField.set(headMeta, profile);
            } catch (IllegalArgumentException | NoSuchFieldException | SecurityException
                    | IllegalAccessException ignored) {
            }
            head.setItemMeta(headMeta);
            return head;
        }
    }
#

@quaint mantle ^^

quaint mantle
#

ty, but that's not wat I exactly wanted, I wanted to create a code that write's textures

amber hill
#

Any minecraft reach presents plugin for server

hidden delta
#

so you want to get textures from the skull?

quaint mantle
#

get a texture from a skull and edit that texture

ivory sleet
#

the reflection sent kinda tells u how you'd do that

hidden delta
quaint mantle
#

hell no

#

I don't wanna be spoonfeed

hidden delta
#

you want the idea?

quaint mantle
#

yes?

main dew
#

How I can translate spigot slots to NMS slots?

quaint mantle
ivory sleet
#

instead of Field#set use Field#get and cast

quaint mantle
#

ah

#

and I assume I have to use GameProfile ?

ivory sleet
#

yeah cast it to GameProfile

#

then getProperties()#get("textures") or smtng

quaint mantle
quaint mantle
#

wdym ?

main dew
#

How I can set Item in inventory use this numbers slots?

ivory sleet
#

oh recar the base 64?

quaint mantle
#

🤦‍♂️ base64 ofc,
I m dumb

#

sorry for u wasting ur time

quaint mantle
ivory sleet
#

lol its fine recar 🙂

main dew
#

minecraft use this slots ;/

#

but I have slots with nms

#

and Idk how convert this

rotund ravine
#

Just make a lookup table or something

#

Map<Integer, Integer>

main dew
#

intresting idea but I think isn't perfect metod

maiden thicket
#

?

main dew
maiden thicket
#

wdym

#

what are u tryna do

rotund ravine
main dew
ivory sleet
main dew
#

I think there is a method for that in spigot

ivory sleet
#

No one’s hindering you from using it if one exists

maiden thicket
#

what is that packt for

#

lol

cinder thistle
main dew
#

I think I will use it although I would prefer something NMS

wispy fossil
#

hy ray
not everyday i hear "prefer nms" 😄
have fun

eternal oxide
#

wait till he's been programming a while and a few versions are relased.

ivory sleet
#

Lmao

maiden thicket
#

api is always

#

a better solution than nms

ivory sleet
maiden thicket
#

nms just complicates everything more

#

and along with that this server iirc won't provide a lot of nms support but idk

vast quest
#

how can I make varuables that carry over restart

#

Ik I can make a yaml but dunno how to do it

eternal oxide
#

do you mean a restart or a reload?

vast quest
#

restart

eternal oxide
#

nothing stays in memory when you restart

#

so save to file or db

vast quest
#

how

eternal oxide
#

or store in a PDC

#

what do you want to save?

vast quest
#

uh I do not know what PDC mean and I sure dont have a db

vast quest
#

a boolean for every player

#

or just a arraylist ig

eternal oxide
#

then store it in teh players PDC. It saves with the player

vast quest
#

How can I save the players PDC

#

and what does PDC mean

vast quest
#

uh

#

how can I use that on a BlockBreakEvent

#

o

eternal oxide
#

eh?

#

have you got all your auto pickup code working?

vast quest
#

idk how to use it

vast quest
eternal oxide
#

get that all written and working, then ask about storing a boolean in the PDC

vast quest
#

Ok

river spear
#

Why is the DisplayName not set?
player.setDisplayName(ChatColour.RED+player.getName());

eternal oxide
#

what makes you think its not set?

river spear
#

is white

eternal oxide
#

what plugin are you using to modify chat?

river spear
#

my plugins : Plugins (17): ArmorStandEditor*, ArmorStandTools, BKCommonLib, Citizens, Essentials, (WorldEdit)FastAsyncWorldEdit, HeadDatabase*, HolographicDisplays, LagMonitor, LuckPerms, Multiverse-Core, PacketWrapper*, PlaceholderAPI, PlugMan, ProtocolLib, Vault, WorldGuard

eternal oxide
#

Nothing that affects chat

river spear
#

I mean the player name above the head is just white

eternal oxide
#

thats not affected by setDisplayName

river spear
#

What then changes the head name

vast quest
#

Is there a thing to give the blocks mined form

#

like if its stone and the player does not have silk touch

eternal oxide
river spear
#

with code

coral sparrow
#

How do you execute a command when you click a player with a material

coral sparrow
vast quest
#

Is there a thing to give the blocks mined form
like if its stone and the player does not have silk touch

wispy fossil
#

i was gonna type a solution but elgar got this 😎

viscid dune
#

someone can help me with skript ?

wispy fossil
#

where did elgar go 😭

wispy fossil
eternal oxide
river spear
#

ok

viscid dune
#
    if block is stone:
        give 10 tokens to player
        
on mine:
    if block is coal ore:
        give 10 tokens to player
        
        ```bye the first one it only works on cobblestone and not on stone and the second one doesnt work at all i dont get the toekns
eternal oxide
vast quest
#

mm

#

so I would need to check if the player has silktouch as well

viscid dune
#

how to check ?

#

what do i type

viscid dune
#

if player hold pickaxe with silktouch ?

#

``on mine:
if block is stone
give 10 tokens to player

on mine:
if block is coal ore:
give 10 tokens to player

#

whoops

#
    if block is stone
    if player hold a diamondpickaxe with silktouch
        give 10 tokens to player
        
on mine:
    if block is coal ore:
        give 10 tokens to player
``` like that
eternal oxide
rotund ravine
#

Skript ahahah

coral sparrow
eternal oxide
#

I'm not touching Skript with JanTucks