#help-development

1 messages ยท Page 109 of 1

hasty prawn
#

Even if you can, using CompleteableFuture's methods is the way to go.

eternal oxide
#

if you thenAccept it runs back on the calling thread

shadow zinc
#

K I'll play around with then methods

#

thx

eternal oxide
#

Yep java CompletableFuture.supplyAsync(() -> { // code to query Bungee. return result; }).thenAccept((result) -> { // use result. });

hasty prawn
#

I love CompletableFutures

eternal oxide
#

yep I used them a lot just recently

hasty prawn
#

I'm using them in my current project right now ๐Ÿ˜›

shadow zinc
#

server didn't crash but I did

#
    public InventoryGUI constructGameSelector() {
        InventoryGUI gameSelectorGUI = InventoryUtil.createInventoryGUI(null, 54, "Game selector");
        for (GameItem gameItem : gameItems) {
            SpecialItem specialItem = new SpecialItem(gameItem.getItemType())
                    .setName(gameItem.getItemName());
            BungeeCordUtils.playerCount(gameItem.getServerName()).thenAccept((result -> {
                ByteArrayDataInput in = ByteStreams.newDataInput(result);
                in.readUTF();
                specialItem.setAnimatedLore(() -> String.valueOf(in.readInt()));
            }));
            gameSelectorGUI.setItem(gameItem.slot(), new InventoryItem.InventoryItemBuilder(specialItem::getAndSet)
                    .setAction((event -> BungeeCordUtils.connect((Player) event.getWhoClicked(), gameItem.getServerName())))
                    .build());
        }
        return gameSelectorGUI;
    }```
shadow zinc
#

?paste

undone axleBOT
shadow zinc
#

^ some errors

sharp flare
#

completablefuture reminds me of doing a lot of async stuffs in javascript, lovely stuffs

sharp flare
#

Thread safety ๐Ÿ˜‰

shadow zinc
#

thanks

worldly ingot
sharp flare
#

Agree

#

If await exist with completables but yeah it can rekt execution

drowsy helm
#

so close to working ๐Ÿ˜ฎ

latent bone
regal lake
#

It exist ๐Ÿค”
LOOT_BONUS_BLOCKS

latent bone
buoyant viper
#

yeah bukkits namings for this stuff is pretty shotty

#

think its bc old naming in MC itself was pretty shitty too

low temple
#

Theres a wiki with all of the converted names

charred blaze
#

why is it printing /toggleblood?

#

it is not in code

visual tide
#

u gotta return true in the command executor

wet breach
#

first do not use label to check command name

#

its unreliable and not for the purpose

#

instead check the command name

#

command.getName()

charred blaze
wet breach
charred blaze
#

i need to return true; instead?

wet breach
#

you are returning false at the end. To fix that, return true in the if statements

#

or change it to return true

#

adding an early return would prevent the end return from running if the conditions are met to run those blocks of code

bright flax
#

To give a little bit of context, I am working on a Chat that has a cost limit to it's traversal and have implemented the A* algorithm (which at base works perfectly).

Now the problem;
When attempting to add costs to the block (aka mapping out a grid of blocks before-hand - so it is only done once for all players in the receiving range) the lag is upwards of 1000ms (1s) for every message within a 30 block radius.
The following is the code which causes that delay by mapping out the blocks within the radius

val blocks = HashMap<String, Int>() // Basic Location and Cost
    for (x in (location.x - radius) until (location.x + radius)) {
        for (y in (location.y - radius) until (location.y + radius)) {
            for (z in (location.z - radius) until (location.z + radius)) {
                blocks[BasicLocation(x, y, z).simpleLocation()] = when (Location(world, x.toDouble(), y.toDouble(), z.toDouble()).block.type) {
                    Material.AIR -> 1
                    else -> 2
                }
            }
        }
    }

Any recommendations on how to either remove the Location calls, or access it in an improved way (either native in Spigot or via an External API)

Side-Note: The call to this method is done asynchronously as to avoid lagging the main thread.

EDIT: The solution would be to calculate relative ChunkSnapshots and retrieve Block Types from that

buoyant viper
#

like proximity chat?

kindred valley
#

Can someone explain

bright flax
midnight patrol
#

is there a way to create a lead from 2 points without using a mob on the end

agile kraken
onyx fjord
#

for example less code repeating

kindred valley
onyx fjord
#

its more clean especially if you lets say get player name a few times

String player = event.getPlayer().getName()

#

sometimes its extremally long

kindred valley
#

@onyx fjord

onyx fjord
#

like i dunno 100 letters

#

idk if he replied to your original question

#

you ask for is why we make variables from stuff right?

kindred valley
kindred valley
onyx fjord
#

i have no idea either

shadow zinc
#

why am I getting this as the player count?

#
                BungeeCordUtils.playerCount(gameItem.getServerName()).thenAccept(result -> {
                    ByteArrayDataInput in = ByteStreams.newDataInput(result);
                    String server = in.readUTF();
                    int playerCount = in.readInt();
                    specialItem.setLore("Player count: "+playerCount);
                    gameSelectorGUI.setItem(gameItem.slot(), new InventoryItem.InventoryItemBuilder(specialItem::getAndSet)
                            .setAction((event -> BungeeCordUtils.connect((Player) event.getWhoClicked(), gameItem.getServerName())))
                            .build());
                });```
wet breach
#

you only need distance

wet breach
wet breach
#

what do you have set for playercount in the configs?

onyx fjord
#

i think IJ having bad time with gradle properties

#

they kinda ignored ngl

#

i added this line org.gradle.daemon=false but daemon still starts

wet breach
#

still need a daemon to start up to actually do things

#

just means with that option it should end as soon as its done with what it is doing

wet breach
# shadow zinc wdym?

Well PlayerCount in regards to message channel, either is the player count of a specific server or the player count of all the servers combined. But also this property can be changed arbitrarily as well by some plugins if you wanted to provide a false player count or whatever else.

shadow zinc
wet breach
shadow zinc
#

its for bungeecord servers

bright flax
shadow zinc
#

I need to use the plugin messaging channel to get the player count of bungee servers right?

spare prism
#

Hello. Why does the event drops the "cancelled" item anyways (it drops my item and the "cancelled" item)?: https://paste.md-5.net/ewofukagon.cs

[11:26:15 INFO]: [CustomEnchantments] 3
[11:26:16 INFO]: [CustomEnchantments] 3
[11:26:18 INFO]: [CustomEnchantments] 3
[11:26:19 INFO]: [CustomEnchantments] 3
[11:26:30 INFO]: [CustomEnchantments] 3
[11:26:31 INFO]: [CustomEnchantments] 3
[11:26:35 INFO]: [CustomEnchantments] 3
[11:26:37 INFO]: [CustomEnchantments] 3
shadow zinc
shadow zinc
#

my feelings

wet breach
wet breach
#

since you specified items should drop, then that means if the code below that doesn't run, items will drop

shadow zinc
wet breach
#

also do again here

#

same thing as before, if the code below it doesn't run, then it remains true

wet breach
#

you said it was for bungee servers

#

usually indicating the bungee server itself

shadow zinc
#

_to get the player count of bungee servers _

#

anyways why is the plugin channel returning a random number?

wet breach
#

you don't only need a player on the server you doing something, but if you want information about the other servers using message channel you also need a player to exist there too

shadow zinc
#

hold up let me get my alt on the server

wet breach
#

not sure why you are insisting on using message channel for this

#

creating a ping packet to obtain server info is going to be the most reliable in this instance as it will still work even if there is no players on that other server

spare prism
#

cause it print "3" to the console

#

as I showed before

#
                                event.setDropItems(false);
                                event.getBlock().getLocation().getWorld().dropItemNaturally(event.getBlock().getLocation(), furnaceRecipe.getResult());
                                Main.getInstance().getLogger().info("3");
shadow zinc
#

I've never heard anything about this Server List Ping thing

smoky oak
#

can you use plugins to require mods to join a server?

#

iirc the client sends a packet to the server telling the mods it contains

#

but im not sure if you can say directly 'connection failed - mismatching mods'

chrome beacon
#

Yes you can do that

wet breach
#

server list ping has been part of MC for a long time now, its part of the protocol

#

the information returned when one is sent to a MC server, is the amount of players currently on it

#

even if its 0

obsidian drift
#

What's the best way to implement a spawning system for entities based on specific spawn points?

wet breach
shadow zinc
#

And this is what you are referring to?

wet breach
#

event is only handy for when one is received, not when you want to send such things

#

so to send such things, you need to implement it yourself which is really easy to do

wet breach
#

send a packet using the appropriate format

#

then listen for a returned packet

shadow zinc
#

no

wet breach
#

not sure why you are saying no

shadow zinc
#

no thats not easy

wet breach
#

Anyways here is an example of how to do it in Java

wet breach
# shadow zinc no thats not easy

keep in mind not everything you want to implement is always going to be doable in a way that is within your current abilities of skill level

#

sometimes you will have to do some research and implement things yourself

fallen anvil
#

Why isn't my gitignore working and why isn't 'git rm -rf build' fixing anything?

visual tide
#

did you add the gitignore after committing the ignored files?

fallen anvil
#

possibly

#

not in every case

visual tide
#

Iโ€™d try removing the gitignore

#

Then delete the files

#

Then readd it

#

In 3 separate commits

buoyant viper
#

its very possible u added files .gitignore got it for some reason

fallen anvil
#

I just blasted the repository

fallen anvil
manic furnace
#

I am having a similar question like yesterday: What block-type represents the underlined font-type the best?

buoyant viper
#

also possible ur IDE added it automatically before gitignore was created

#

if the gitignore existed since the beginning idk tho

grim ice
#

just do a polished andesite slab

manic furnace
#

ok thanks ๐Ÿ‘

tender shard
#

is there any better way to turn a sound name like ENTITY_GENERIC_EXPLODE into a "proper" sound name, like "entity.generic.explode" than this?

        try {
            Sound tmpSound = Sound.valueOf(soundName);
            soundName = tmpSound.getKey().getKey();
        } catch (IllegalArgumentException ignored) {
            //throw new IllegalArgumentException("Unknown sound: " + soundName);
        }
        return new SoundData(soundName.toLowerCase(Locale.ROOT), volume, pitch, pitchVariant, soundCategory);
mellow pebble
#

Hi guys im making sort of punishment plugin and i want to make tempban and i was wondering like could i use asnyc function to sleep the time while player is banned or something like that

#

and then when sleep ends it sends message to main function to unban him maybe ?

#

would that work properly and like is it maybe an overkill ?

eternal night
#

Generally, you don't really "unban" them until they attempt to join after their ban expires

#

you'd store for example the uuid of the banned player as well as the timestamp of when their ban ends

#

when they attempt to join you compare the current time to the end of the ban timestamp

mellow pebble
#

yeah i know that way of making it too

#

i tought to make it store username as key in json and value as timestamp

drowsy helm
#

anyone know what the Moj map packet is to make a player sneak?

chrome beacon
#

It's the entity metadata packet

drowsy helm
#

ah sweet thanks

sacred mountain
#

anyone free to help me wit some testing? i've got no friends (that are willing to help)

#

basically i just need to kill you a few times

chrome beacon
#

There we go Mojmap name

drowsy helm
#

any idea what the DataAccessor is

chrome beacon
#

The DataWatcher I believe

#

It should be available in your entity

drowsy helm
#

got it

#

thanks

hazy parrot
chrome beacon
# drowsy helm thanks

So the exact field is:

protected final SynchedEntityData entityData

In the nms Entity class

drowsy helm
#

yeah i already have the entityData just trying to figure out how to set sneaking to true. Theres either EntityDataAccessor or FriendlyByteBuf

#

for entityData.set()

chrome beacon
#

ah there's a method called setPose use that

#

(on the entity class)

drowsy helm
#

ah awesome

chrome beacon
#

It doesn't look like that's sending a packet but it does set the entity data for you

drowsy helm
#

yeah ill just send the packet after

spare prism
#

?paste

undone axleBOT
spare prism
drowsy helm
#

second link is empty

#

you are doing concurrentmodification somewhere

chrome beacon
#

Yeah you're probably modifying the list you're looping

spare prism
drowsy helm
#

you dont have to ping both of us lol

#

BulldozerEnchantListener line 80

boreal seal
#

i was wondering guys

#

should i make utility for custom configs or just write manually few?

boreal seal
#

what would be better?

#

since output is same at the end

drowsy helm
#

use a Concurrent collection

drowsy helm
spare prism
boreal seal
#

i plan to store some data there (not alot i have use mysql for other propurses..)

#

oh my english

#

dont judge

drowsy helm
#

if it makes your life easier, by all means go for it

drowsy helm
#

finally got my system working, two completely different servers can see other players

spare prism
eternal oxide
#

infinite loop Bukkit.getPluginManager().callEvent(new BlockBreakEvent(b, player));

charred blaze
#

How can I make glow on other colors with packets?

#

without using team colors?

charred blaze
spare prism
eternal oxide
#

you are trigering your own BlockBreakEvent while still IN the BlockBreakEvent

spare prism
eternal oxide
#

and you are triggering your BlockBreakEvent, which triggers another and so on

#

never ending

spare prism
eternal oxide
#

Yes

spare prism
eternal oxide
#

because your blockFace is never null

#

it constantly adds new blocks and triggers new events

#

your blockFace is never null and your blocks is never empty

#

you just fire more and more events, infinite loop and a stack overflow

eternal oxide
#

what are you trying to do?

spare prism
#

I have a pickaxe that breaks blocks 3x3. I want all of these blocks to be passed through the BlockBreakEvent

eternal oxide
#

for what reason? you ignore the result of the event

#

if you just want to break them, break them

spare prism
eternal oxide
#

you don;t do anything with the result though

spare prism
eternal oxide
#

you just fire off an event and ignore it

#

thats not how you handle events

#

all you are doing is breakign blocks and ignoring the event result. so you still break teh block as its a fake event

spare prism
#

?

eternal oxide
#

the very first thing you should do, is as soon as you have finished using the blockFace, reset it to null.

#

so before yoru for loop

#

Then change the order you raise the event and you actually brak the block

#
myEvent = new BlockBreakEvent(b, player);
Bukkit.getPluginManager().callEvent(myEvent);
if (!myEvent.isCancelled()) {
    b.breakNaturally(event.getPlayer().getInventory().getItemInMainHand());
}```
tender shard
#

are dispensers "Directional"?

#

I'm trying to get the location where a dispenser would normally spawn an item

eternal oxide
#

yes

tender shard
#

thanks

shadow zinc
#

I'm using ServerListPing to get the player amount of a server
Image
But I get the error above
If I set the port to 25565 it works
i have port forwarded

shadow zinc
#

?[aste

#

?pasdte

#

?[pasrte

#

?paste

undone axleBOT
spare prism
shadow zinc
eternal oxide
#

I corrected the code

shadow zinc
#

I am using pterodactyl btw

eternal oxide
#

you only break teh block if the event returns not cancelled

#

if the event is cancelled it means some plugin is preventing you from breaking that block

spare prism
#

Is it correct?

                for(Block b : blocks) {
                    BlockBreakEvent blockBreakEvent = new BlockBreakEvent(b, player);
                    if(!blockBreakEvent.isCancelled()) {
                        if(player.getGameMode() != GameMode.CREATIVE) b.breakNaturally(event.getPlayer().getInventory().getItemInMainHand());
                        else b.setType(Material.AIR);
                    }
                }
eternal oxide
#

you only fire the event to notify other plugins to ask if any of them want to protect that block

#

no, you didn;t call the event

spare prism
#

oh, yeah

shadow zinc
eternal oxide
tender shard
#

huh weird

spare prism
tender shard
#

I'm doing this in the BlockDispenseEvent:

        Tasks.nextTick(() -> {
            System.out.println("Adding bucket");
            dispenser.getInventory().addItem(new ItemStack(Material.BUCKET));
            dispenser.update(false, false);
        });

but it just doesnt add the bucket? any ideas why it doesnt do anything?

#

(Tasks.nextTick() just calls the scheduler with runTaskLater(...))

#

it DOES print "Adding bucket"

eternal oxide
#

your update is probably resetting it

rocky basin
#

Using the spigotmc library, how would one check if a provided username has an associated (purchased) minecraft account?

tender shard
#

spigot doesnt have anything builtin for this

#

also you shouldnt be allowing cracked users anyway

rocky basin
#

oh so just ping the api endpoint of player?

rocky basin
#

so its annoying

#

hence i want to check before whitelisting

#

(cant upload an image of said scenario doesn't doesn't let)

shadow zinc
#

?verify

#

idk

eternal oxide
#

!verify

shadow zinc
#

there is a channel

undone axleBOT
#

Usage: !verify <forums username>

shadow zinc
#

why ?paste but not ?verify?

rocky basin
#

gotta create a furums username then yo

shadow zinc
#

?paste

undone axleBOT
eternal oxide
#

quiery ? statement !

spare prism
tender shard
spare prism
#

instead of 3x3

eternal oxide
#

line 94 is pointless

#

oh and move ConcurrentLinkedDeque<Block> blocks = new ConcurrentLinkedDeque<>(); inside the BlockBreakEvent

#

it needs to be a local variable not a field

rocky basin
eternal oxide
#

You would be perfectly fine using a straight Set there

#

no need for any queue or concurrency

spare prism
eternal oxide
#

yes because you were modifying it while looping it

tender shard
#

then use an iterator instead, or a concurrent collection

eternal oxide
#

just a Set is all you need

#

your code is different now

#

so long as you move it inside the event

tender shard
#
for(Item item : myCollection) {
  myCollection.remove(item);
}

NEVER DO THIS ^^ unless you know it's allowed because the collection is concurrent

eternal oxide
#

each event needs its own local collection

spare prism
eternal oxide
#

paste yoru new code

spare prism
eternal oxide
#

code looks fine to me, so long as your getRelative is good

#

add a sysout of the cancelled state to see if its ever cancelled

tender shard
#

you should not force custom enchants to be registered but instead use the meta's PDC instead to identify your custom enchantments

smoky oak
#

how do i change the part before the message in asynchplayerchatevent?

drowsy helm
#

PlayerToggleCrouchEvent is whack

tender shard
eternal oxide
#

setFormat

tender shard
#

first %s is the username, second %s is the message

smoky oak
#

uh how does that work again

#

i recall seeing those symbols everywhere

tender shard
#

what are you trying to do exactly?

#

%s just means "some string"

eternal oxide
#

setFormat("This is modified %s> %s")

tender shard
#

E.g. look at this:

print(String.format("%s is %s years old", "mfnalex", "27"));

this will print "mfnalex is 27 years old

smoky oak
#

broadly to understand how to use setFormat, in this case to change the entire message's color

tender shard
#

then set the format to this:

#

"%s > ยงa%s"

#

(of course you should use ChatColor.translate...... instead)

spare prism
# eternal oxide add a sysout of the cancelled state to see if its ever cancelled

it's not even printed, lol

                for(Block b : blocks) {
                    BlockBreakEvent blockBreakEvent = new BlockBreakEvent(b, player);
                    Bukkit.getPluginManager().callEvent(blockBreakEvent);
                    Main.getInstance().getLogger().info("blockBreakEvent.isCancelled(): " + blockBreakEvent.isCancelled());
                    if(!blockBreakEvent.isCancelled()) {
                        if(player.getGameMode() != GameMode.CREATIVE) b.breakNaturally(event.getPlayer().getInventory().getItemInMainHand());
                        else b.setType(Material.AIR);
                    }
                }
smoky oak
#

iirc theres no such method in asyncchatevent

tender shard
# smoky oak wdym?
event.setFormat(ChatColor.translateAlternateColorCodes('&', "%s > &a%s"));
#

sth like this

#

this would make the message green

eternal oxide
tender shard
smoky oak
eternal oxide
#

wrong item perhaps?

spare prism
tender shard
tender shard
#

happens all the time

spare prism
smoky oak
#

wait wouldnt that allow the player to color their message?

tender shard
#
event.setFormat("%s > " + ChatColor.translateAlternateColorCodes('&', "&a%s") + " %s");
#

oh wait

#

this is wrong

#

yeah anyway, you get the idea

eternal oxide
#

you can translate teh whole format as its before teh %s is inserted

tender shard
#

yeah, and then just add "%s" at the end WITHOUT translating it to alternate color codes

shadow zinc
tender shard
#

what's "UpdatePlayerCounts" line 35?

shadow zinc
#

forgot this ```java
@Override
public String getHostName() {
return "172.18.0.1";
}

@Override
public Integer getPort() {
    return 25569;
}```
spare prism
#

It works perfectly now. Tysm, @tender shard & @eternal oxide ๐Ÿ’™

smoky oak
#

is it even possible to change a message's color without allowing the player to do so ?

tender shard
#

sure

tender shard
#

as I said earlier

shadow zinc
tender shard
#

this will make all texts green

#

but only the message content itself, not the username

#

and it will NOT allow players to insert color codes themselves

#

WAIT

#

setFormat, not setMessage

#

sorry

smoky oak
#

i see

#

is there any reason to use ChatColor.translate over just inserting ChatColor.COLOR ?

tender shard
#

no

#

I only used ChatColor.translate... so you can make it configurable

#

if you always wanna use a specific hardcoded color, you could also just do it like this:

#
    @EventHandler
    public void onChat(AsyncPlayerChatEvent event) {
        event.setFormat("%s > " + ChatColor.GREEN + "%s");
    }
smoky oak
#

i see

#

different question

#

why does this code produce white text instead of green?

tender shard
#

which code?

smoky oak
tender shard
#

oh

#

1 sec

#

it should work fine tbh

#

if it doesn't, then maybe the actual message contains ยงf at the beginning

smoky oak
#

well i just typed text in chat

tender shard
#

print out event.getMessage() to console

#

then check if it contains the ยงf part

#

(it normally shouldnt)

smoky oak
#

wait a sec

#

it erred out

smoky oak
tender shard
#

send the code as text please

smoky oak
#
package io.github.moterius.Shards.EventHooks;

import org.bukkit.ChatColor;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.AsyncPlayerChatEvent;

public class EventHookPlayerChat implements Listener {
    @EventHandler
    public void onPlayerChat(AsyncPlayerChatEvent event){
        //the only reason this is here is a fuck you to microsoft
        //playerChatEvent.setMessage(ChatColor.GRAY+playerChatEvent.getMessage());

        event.setFormat(ChatColor.translateAlternateColorCodes('&', "&a%s")
                + "%s > "
                + ChatColor.translateAlternateColorCodes('&', "&a%s")
                + " %s");
    }
}
tender shard
#

ok gimme a minute pls

eternal oxide
#

um thats an odd translate

smoky oak
#

then it went looooong and i added some newlines

tender shard
#

you got 4 times %s

#

you can only have two

#

first %s is the username

#

second %s is the message

#

any additional %s will fuck it up

smoky oak
#

now it just says Moteriustext in all green

eternal oxide
#
String newFormat = "%s > &a%s";
event.setFormat(ChatColor.translateAlternateColorCodes('&', newFormat));```
#

that will only translate codes YOU put in newFormat

#

its translated before teh %s are replaced so it will not affect teh message

tender shard
#
    @EventHandler
    public void onPlayerChat(AsyncPlayerChatEvent event){
        //the only reason this is here is a fuck you to microsoft
        //playerChatEvent.setMessage(ChatColor.GRAY+playerChatEvent.getMessage());

        char usernameColor = 'a';
        char messageColor = 'c';
        event.setFormat(
                ChatColor.translateAlternateColorCodes('&', "&" + usernameColor) + "%s"
                        + ChatColor.RESET
                        + " > "
                        + ChatColor.translateAlternateColorCodes('&', "&" + messageColor) + "%s");
    }
smoky oak
#

i see

#

though

tender shard
#

do not mind the comment. github copilot wrote it haha

#

no wait

#

you wrote it

#

and I copy pasted it

smoky oak
#

yea i copy pasted it too

tender shard
#

anyway, what I sent above makes the username green, the > white, and the message red

#

so adjust it to your needs

smoky oak
#

k

shadow zinc
#

omfg some idiot on here gave me advice and it was so wrong. Because of them I spent hours on something utterly pointless

shadow zinc
#

but their answers had so much confidence as well

#

smh

tender shard
#

people being overly confident is always a warning sign

smoky oak
#

me

tender shard
#

I am usually not sure about stuff I do since years

eternal oxide
#

or perhaps one side or the other misunderstood the question or answer

#

happens

tender shard
#

yeah, hard to tell without any further details

smoky oak
#

do one character string take up more space than a char?

shadow zinc
#

no they were quite clear

eternal oxide
smoky oak
#

ascii

eternal oxide
#

striaight ascii no

smoky oak
#

k

fallen anvil
#

What am I doing wrong here, why are the keys not what I'm telling them to be

eternal oxide
#

those are not valid BlockFaces

#

why would front be EAST?

#

and if you want to use that crazy naming just create an enum

fallen anvil
#

EAST is a valid blockface

eternal oxide
#

yes but front?

fallen anvil
#

front = east

#

I'm tracking the direction a thing is facing and this helps me test objects in every direction

#

I'm connecting parts of a sectional couch

eternal oxide
#

seems pointless you already have cardinal directions with BlockFaces

fallen anvil
#

but I need to know which direction is the "left" side of the object

eternal oxide
#

left is always relative

fallen anvil
#

exactly... but I need to get the blockface in that direction

#

where am I losing you here?

eternal oxide
#

your plan to use odd names

fallen anvil
#

Why is it odd?

eternal oxide
#

a block can be placed in any orientation so your "front" could be any of the 4 cardinal directions when its placed

fallen anvil
#

yes

civic apex
#

is there an api method to capitalize a string (CamelCase) ignoring formatting codes?

eternal oxide
#

which makes "front" pointless

fallen anvil
#

no.

eternal oxide
#

which gives you a BlockFace in getfacing

#

with that you always know which way a block is facing

fallen anvil
#

Yeah but these aren't directional blocks ^^

#

it's a block + item frame

eternal oxide
#

so fake directional?

fallen anvil
#

yes

eternal oxide
#

then get teh attached face of the ItemFrame

civic apex
#

assume & = the unicode color char

fallen anvil
#

the face is always the top

#

the direction is based on the rotation

#

this is a map that helps me map "front" "left" etc to minimize the amount of code I need to write when comparing different objects fake directions

#

Result:

scarlet creek
#

What does the period and delay in runnables do?

civic apex
#

delay is how much it takes for it to execute (first execution only) in ticks

#

period is the amount of ticks before it executes again

scarlet creek
civic apex
#

yes

scarlet creek
#

Ah ty

hoary lance
#

how do I fix this (ik it's just a warning but I get errors to console)

eternal night
#

getBoots may return null

#

store it in a variable and null check the value

hoary lance
#

ok

civic apex
civic apex
hoary lance
#

oh yes I watched one tutorial and they told me to do that

#

I forgor to add it

#

thx

civic apex
#

also you can put them in the same check

#

just append them with || (has to be doubled) and nullcheck first

shadow zinc
hoary lance
civic apex
#

but nullcheck first

#

if they have no boots on

#

it will throw nullpointerexception

hoary lance
#

ok

#

so same thing without the getitemmeta right?

civic apex
#

also i recommend you use guard clauses for these kinds of checks

civic apex
#

sorry

#

do getBoots().hasItemMeta()

#

better than nullchecking the meta

civic apex
#

@hoary lance

hoary lance
#

ok

#

is there a way to do it for boots?

#

like HasBoots

civic apex
#

if (player.getInventory.getBoots() != null && player.getInventory.getBoots().hasItemMeta())

civic apex
#

you'd still have to check for item meta

civic apex
#

and make it a guard clause

#

to reduce nesting

hoary lance
rocky basin
#

guys is there a seperate API to look up bedrock usernames and their validity?

civic apex
#

instead of doing if (item != null) {code;} do if (item == null) {return;} code;

#

ofc with proper identation and al

#

but that makes it so your code isnt nested inside an if loop

#

also return; might not make sense in your context

#

it might have to be continue; or break;

hoary lance
#

ok

civic apex
tardy delta
#

only 2nd

civic apex
#

yeah 2nd is guard clause

queen apex
#

Anyone knows how to disable dependencies logs?

civic apex
# civic apex

ofc if you want to do stuff after the if even if item is null use the upper option

hoary lance
quiet ice
#

Or more specifically: What dependency log are you referring to?

queen apex
civic apex
#

just use it when you only want to do something if the item isnt null

quiet ice
#

If you have no idea about the concept, do not use it

#

return can be evil if you are unexperienced

civic apex
#

yes

quiet ice
#

Especially if it is within a for loop

civic apex
#

you'd use break; or continue; there

civic apex
hoary lance
#

I get an error if I use continue

quiet ice
#

It always depends. And then there are instances where you'd need to break of an outer loop and all these circumstances

civic apex
#

no no no

civic apex
#

continue is to stop execution of a loop iteration early

#

and go on to the next loop iteration

civic apex
queen apex
quiet ice
#

It is perfectly fine to have code like

for (Object x : list1) {
    if (x instanceof InterestingObject) {
         InterestingObject couldBeInsterestingObject = (InterestingObject) x;
         if (couldBeInsterestingObject.isReallyInteresting()) {
             for (UninterestingObject z : couldBeInsterestingObject.getReferrals()) {
                 z.makeInteresting();
             }
         }
    }
}
quiet ice
# queen apex ?

I'd guess you have to configure their logger. At best referr to their documentation and the documentation of the logging framework at play and it's implementation

#

I myself have no use JDA

civic apex
#

its usually nicer to do

for (Object x : list1) {
    if (!(x instanceof InterestingObject)) continue;
    InterestingObject couldBeInsterestingObject = (InterestingObject) x;
    if (!couldBeInsterestingObject.isReallyInteresting()) continue;
    for (UninterestingObject z : couldBeInsterestingObject.getReferrals()) z.makeInteresting();
}
quiet ice
#

Only that it becomes tedious once you want to change it afterwards

quiet ice
#

One tiny change means that you gotta reevaluate all conditions

plain badger
#

instanceof usually shows bad design patterns

civic apex
#

i had a kind of big plugin some years ago

#

and it had like over 10 nested if loops

#

to just execute one line

#

it was hell to mantain

civic apex
#

i use it to check if CommandExecutor is a Player or to check an entity type

civic apex
#

wow thats a long class

plain badger
# civic apex why

it depends on the usage, in SpigotAPI its hard not to use instanceof but if you use instanceof on your own objects it usually shows bad design patterns, thought your example was smth you made

patent fox
#

can i create a plugin in vs code?

civic apex
#
  • guard clauses
civic apex
#

idk how its easy to mantain code that has like 40 spaces before it

patent fox
quiet ice
civic apex
#

you can create a plugin on a basic text editor

quiet ice
#

You can even create plugins in VIM if you really want that

civic apex
quiet ice
#

Although in that case Maven or Gradle is highly recommended

quiet ice
civic apex
#

vanilla nano

#

you can also create a plugin by writing bytecode directly

quiet ice
civic apex
quiet ice
#

A lot easier than having 200 continues and break

civic apex
#

you have the same amount of continue/break statements as nested ifs

#

but w/out the nesting

#

so you got everything vertically alligned

#

and you can see everything that makes the loop continue or break

#

much more easily

quiet ice
#
        for (ClassNode node : nodes) {
            if (node.superName != null && node.superName.equals("java/lang/Object") && node.interfaces.isEmpty()) {
                if (node.fields.size() == 1 && node.methods.size() == 1) {
                    MethodNode method = node.methods.get(0);
                    FieldNode field = node.fields.get(0);
                    if (method.name.equals("<clinit>") && method.desc.equals("()V")
                            && field.desc.equals("[I")
                            && (field.access & Opcodes.ACC_STATIC) != 0) {

vs

        for (ClassNode node : nodes) {
            if (node.superName == null || !node.superName.equals("java/lang/Object") || !node.interfaces.isEmpty()) {
                continue;
            }
            if (node.fields.size() != 1 || node.methods.size() != 1) {
                continue;
            }
            MethodNode method = node.methods.get(0);
            FieldNode field = node.fields.get(0);
            if (!method.name.equals("<clinit>") || !method.desc.equals("()V")) {
                 continue;
            }
            if (!field.desc.equals("[I") || (field.access & Opcodes.ACC_STATIC) == 0) {
                 continue;
            }

In this example latter might make more sense - but once you want to recycle the for loop to have multiple functions you cannot really do it - so you'll have multiple for loops

#

Another issue with latter is that most often you'll be negating everything a lot, which for the trained person isn't an issue I guess

civic apex
#

again, using guard clauses vs nesting is very context based

rough drift
#

How can I spawn a falling block with the exact gravity of a normal falling block, just reversed?

civic apex
#

if you know the loop will only do stuff if it goes through all guardclauses

#

then you should use htem

quiet ice
#

However if you use if (condition) continue;, then readability gets completely thrown out of the window

quiet ice
rough drift
#

yes

#

I got it working

#

just the speed is off

quiet ice
#

Gravity is kinda difficult to get right

civic apex
rough drift
quiet ice
rough drift
#

eyy i got it

charred blaze
#

How can I make glow on other colors with packets?
Without using team colors?
I think teams will break my tab

rough drift
#

the velocity should be 19.25/50

quiet ice
charred blaze
#

:///

#

PLEASE

civic apex
quiet ice
#

?jd.s

#

?jd-s FU

undone axleBOT
quiet ice
#

Protocol doesn't imply that it is possible that way too

charred blaze
#

i am noob at protocols

#

is there any ways?

quiet ice
#

no

charred blaze
#

so its impossible?

quiet ice
#

yes

charred blaze
#

;-;

quiet ice
#

unless I didn't read a memo or something

charred blaze
#

memo?

#

wdym

quiet ice
#

With that I meant a note or something of that sort

charred blaze
#

i dont get it

#

so its impossible to do it without team colors?

rough drift
#
World world = event.getEntity().getWorld();
Location loc = event.getEntity().getLocation();
Vector entityVec = loc.toVector();
List<SpawnData> datas = new ArrayList<>();

event.setCancelled(true);

int distance = 5;

for (int x = loc.getBlockX() - distance, maxX = loc.getBlockX() + distance; x < maxX; x++) {
    for (int y = loc.getBlockY() - distance, maxY = loc.getBlockY() + distance; y < maxY; y++) {
        for (int z = loc.getBlockZ() - distance, maxZ = loc.getBlockZ() + distance; z < maxZ; z++) {
            Location location = new Location(world, x, y, z);
            datas.add(new SpawnData(location, location.getBlock().getBlockData().clone()));
            location.getBlock().setType(Material.AIR);
        }
    }
}

for (SpawnData data : datas) {
    Vector blockVec = data.loc().toVector();
    Vector dir = blockVec.subtract(entityVec).normalize();
    FallingBlock fallingBlock = world.spawnFallingBlock(data.loc(), data.data());
    fallingBlock.setVelocity(dir);
}
```Am I dumb, or is there something wrong with this code (Most blocks just stay there)
quiet ice
#

Yes, UNLESS I made an error

charred blaze
eternal needle
#

Hi, can some one help me with this i have a inv that is named "Ban This Noob" and in that one i want so if i click emrald block i take money from player i did klikk on in "Sandtak". It does not happens anything if i click it now else that i take the block .It did work befor in 1.18 don't know when it did stop pls help and tag me

Error: https://paste.md-5.net/uhoqexupij.sql

Code: https://paste.md-5.net/vuluhofula.java

quiet ice
charred blaze
#

Hmmm

quiet ice
eternal needle
quiet ice
#

e.currentItem() is null (i.e. because AIR or whatever)

#

Likely caused by the player clicking outside the inventory

eternal needle
#

no i click on the iten

rough drift
#

all blocks are set to air

quiet ice
#

even then players can click outside the inv

rough drift
#

the thing is they just bump into other blocks and sit there

#

but they have no blocks to bump against

#

since they all got removed

quiet ice
#

So what exactly is the issue?

eternal needle
#

me?

rough drift
#

blocks get shot, blocks stay in place

quiet ice
#

but the falling blocks appear?

rough drift
#

yeah

#

for a brief moment

quiet ice
#

I do not know why that would happen tbh

rough drift
#

spawned a tnt underground

#

this is the result

quiet ice
#

So basically the falling blocks instantly rematerialise?

rough drift
#

nah, they fall straight back down

#

since their vel is stopped by the other falling blocks

rough drift
#

hold on

#

did a wopsie in that one

#

I'll show you my old res

quiet ice
rough drift
#

that's the result

#

they go up

#

then back down and become items

#

because they bump into other blocks

#

The ideal would be they all get thrown up

#

to the side

charred blaze
#

will my scoreboard or tab break ifi touch team colors for glow?

quiet ice
#

Why would your scoreboard break?

#

Ideally you are not using team colors there

charred blaze
#

wdym

#

Isn't glow color depending on team color?

quiet ice
#

why would you want to use team colors in your scoreboards and tab was my question

charred blaze
#

i didnt write scoreboard plugin for mine

quiet ice
#

That it is used for glow is evident and already set up

charred blaze
#

??

quiet ice
#

then chances are that it is not using team colors

charred blaze
quiet ice
#

tab and scoreboards allow using chat components

charred blaze
#

what is it depending on then?

quiet ice
#

,l jh

charred blaze
#

aaa

#

scoreboards and tabs are not using team colors? u mean? :D

quiet ice
#

YES

charred blaze
#

someone said it will break scoreboard

#

wait

charred blaze
#

I noticed that my display name is red and glow is also red

#

soo

#

And will my display name's color change if I change my team color?

tardy delta
#

logic flawed

charred blaze
#

xd?

rough drift
#

what's the fuse time of a tnt that got exploded by another tnt

quiet ice
#

How you could just use <colorcode><playername> and it'd be fine

keen spindle
#

hey guys, im trying to make an api inside my spigot plugin to connect to my website (made in js/html/css) to do some things releated to buycraft

#

whats the best to do that?

drowsy helm
#

if its a web server use http requests

keen spindle
#

i wanna make it REST

drowsy helm
#

yeah that is rest

keen spindle
#

cause kinda new in making apis in java

drowsy helm
#

I did a rest api a while ago using a lib called Javalin

#

It's super easy

keen spindle
#

it looks like express

#

thats great

drowsy helm
#

yeah that one

#

this is a proj i did a while ago with it, its not amazing code quality but you'll get the idea

keen spindle
#

ah ok ty

#

we can use this directly in the spigot plugin right

drowsy helm
#

yeah you just have to shade it

chrome beacon
dusk flicker
#

honestly

#

that looks very cool

keen spindle
dusk flicker
#

Bookmarking that website lol

keen spindle
chrome beacon
drowsy helm
#

it's basically keeping the dependency in your plugin jar

#

so it is in your runtime environment

keen spindle
chrome beacon
#

If you're on a modern version you can just use the library loader feature

#

What version are you making the plugin for?

keen spindle
#

for buycraft

keen spindle
chrome beacon
#

Then use the library loader

keen spindle
#

what about maven

chrome beacon
#
<dependency>
    <groupId>io.javalin</groupId>
    <artifactId>javalin</artifactId>
    <version>4.6.4</version>
    <scope>provided</scope>
</dependency>
#

That's all you need

#

then in your plugin.yml add:

libraries:
  - "io.javalin:javalin:4.6.4"
drowsy helm
#

damn didn't even know we could do that now

#

since when was that a thing Olivo?

chrome beacon
#

1.17 I believe

keen spindle
#

alright

#
public Javalin app = Javalin.create().start(7000);

    app.get("/giveKey", ctx -> {
        
    })

#

i took this from the docs

#

but its saying app.get is not resolved

#

nvm

#

i was just dumb

#

forgot to put it inside the function

drowsy helm
#

lol

keen spindle
#

so after i do that

#

i just call this class in the onEnable

#

and then i can fetch localhost:7000?

#

but wouldnt i need a domain

drowsy helm
#

yep

keen spindle
#

so how would i do it

drowsy helm
#

wait wdym you need a domain

keen spindle
#

like i need to fetch this api

drowsy helm
#

localhost:7000 will work fine

keen spindle
#

from my website

keen spindle
drowsy helm
#

if its local, yeah

keen spindle
#

wdym local

#

the website's hosted tho (and has a domain)

drowsy helm
#

its the same as any other ipv4 protocol

#

idk how your network is setup so i can't really tell you

keen spindle
#

so my server's hosted, and i want this plugin to be in there, and do stuff in the server for me

#

when the website sends a request to it

drowsy helm
#

and the website is on another machine?

keen spindle
#

no its hosted

#

like globally

#

on a vps

drowsy helm
#

on the same machine as the server?

keen spindle
#

the website's host and the server's host are different

#

so idk if the machine is the same

drowsy helm
#

yes it is different then

#

just port forward your rest api port and point the website to the server's public ip

keen spindle
#

how?

drowsy helm
#

again, without the information of your network setup I can't tell you

#

treat this port exactly the same as your would your server port

keen spindle
#

i never did that before lol

drowsy helm
#
minecraft server:
1.2.3.4:25565
api port:
1.2.3.4:7000
keen spindle
#

yes

#

so i need to fetch localhost:25565?

drowsy helm
#

the website will fetch machines public ip:7000

#

25565 is for the minecraft server

#

you would use localhost:7000 if the website and server were on the same machine

keen spindle
drowsy helm
#

you can

tardy delta
#

love it when im coding and i have no clue what im doin

drowsy helm
tardy delta
#

have no fking clue how to handle this problem

opal oasis
#

Is there a way i can replace Material arguments that include "_" to just ""? if so... how?

tardy delta
#

only errors

drowsy helm
#

wdym by material arguments

charred blaze
#

i did this:

                board = manager.getNewScoreboard();
                Team team = board.registerNewTeam("redTeam");
                team.setColor(ChatColor.RED);
                team.addEntry(p.getUniqueId().toString());
                p.setGlowing(true);```
and its still glowing white
tardy delta
#

dunno if material has a displayname in the enum

keen spindle
opal oasis
#

i am trying to make a /give command

drowsy helm
dusk flicker
charred blaze
dusk flicker
#

its a clientside issue

tardy delta
#

white boy

dusk flicker
#

some setting fixes it cant remember

charred blaze
#

umm?

charred blaze
dusk flicker
#

it's a clientsided issue

#

what that means; if you have that setting on

#

anything glowing will be entirely white

charred blaze
#

i dont remember i setted that

drowsy helm
#

yeah but it's not a spigot api issue thats for sure

dusk flicker
#

I can't remember the setting

#

just go mess with some

drowsy helm
#

you using optifine?

#

that could also be part of it

charred blaze
#

which is it

charred blaze
drowsy helm
#

emissive textures maybe?

#

if you try without optifine i guarantee you the issue will be gone

charred blaze
drowsy helm
#

lmao

charred blaze
#

problem solved: just dont play minecraft

keen spindle
#

lol im lost, how do i fetch the plugin's api from website now, cause my host doesnt give machine ip

tardy delta
#

two days of work ๐Ÿ’€

dusk flicker
#

i feel that Fourteen

#

lol

opal oasis
mellow pebble
#

if i make tempban is it enough to kick player on PlayerJoinEvent or should i do something else ?

tardy delta
#

๐Ÿฅบ

dusk flicker
#

i just disallow them to join in the prelogin event or whatever its called

charred blaze
dusk flicker
#

1.12.2

#

yikes

mellow pebble
charred blaze
drowsy helm
charred blaze
#

๐Ÿ’€

gaunt relic
#

@charred blaze I think the setting is Fast Render, I remember having the same issue when I had it on

charred blaze
#

no way

#

im getting 30 fps without it :D

#

lmao

gaunt relic
#

rip

drowsy helm
#

yeah optifine sucks with glowing effects

#

idek why

#

friends had the same problems while playing wynncraft

gaunt relic
charred blaze
#

aaaa

#

no its not because of fast render or optifine

#

i checked other colors on my server

#

it is working

gaunt relic
#

nice

quaint mantle
#
@EventHandler
public void onClick(InventoryClickEvent e){
   e.getCurrentItem()
}

in an InventoryClickEvent is getCurrentItem the item that was clicked on ?

charred blaze
charred blaze
#

what?

quaint mantle
charred blaze
#

not optifine

#

i think my code sucks instead

drowsy helm
#

any resourcepacks?

charred blaze
gaunt relic
charred blaze
drowsy helm
#

that just looks like a rendering issue

#

spigot can't do that

gaunt relic
#

try restarting Minecraft after you disable fast render

#

i forgot to say that

charred blaze
#

Bro it's working on another server, why are you blaming my settings

iron glade
#

Anyone knows how I can fix this? (Maven)

[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.250 s
[INFO] Finished at: 2022-09-03T16:09:13+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Malformed \uxxxx encoding.```
#

My pc crashed before while using maven

iron glade
#
[ERROR] Re-run Maven using the -X switch to enable full debug logging.```
gaunt relic
charred blaze
#

can anyone tell me why is this setting white glow?

                board = manager.getNewScoreboard();
                Team team = board.registerNewTeam("redTeam");
                team.setColor(ChatColor.RED);
                team.addEntry(p.getUniqueId().toString());
                p.setGlowing(true);```
drowsy helm
#

compiler probs shat itself on ยง

tardy delta
#

endless loop hmm yes

#

eating ram

drowsy helm
charred blaze
#

xD?

tardy delta
#

wrote some stupid algorithm

charred blaze
#

20 sec

drowsy helm
#

i was lying

charred blaze
#

:D

drowsy helm
#

of Fourteen does your interpreter work with order of operations?

tardy delta
#

yes

#

without was easier smh

drowsy helm
#

parenthesis aswell?

charred blaze
tardy delta
#

not yet

drowsy helm
#

that shit sounds complicated

tardy delta
#

dont wanna break my head again

#

mmh

chrome beacon
quaint mantle
#

Im using intelij somehow my cursor switched to a terminal insert mode, how can I put it back to normal ?

desert frigate
noble forge
vital sandal
#

Is it possible to change server port while it is running?

vocal cloud
#

If you could it would involve kicking every player off t he network I imagine.

sacred mountain
#

how do i check if a player feeds a mob

#

or animal

quaint mantle
#
[clans] loaded class net.milkbowl.vault.economy.Economy from Vault v1.7.3-b131 which is not a depend, softdepend or loadbefore of this plugin.
[Clans] disabled clans plugin due to no vault api

getting this error whiles trying to import vault

 @Override
 public void onEnable() {
        if(!setupEconomy()){
            getLogger().severe("disabled clans plugin due to no vault api");
            return;
 }

 private boolean setupEconomy() {
        if (getServer().getPluginManager().getPlugin("Vault") == null) {
            getLogger().severe("clans could not find vault plugin");
            return false;
        }
        RegisteredServiceProvider<Economy> rsp = getServer().getServicesManager().getRegistration(Economy.class);
        if (rsp == null) {
            return false;
        }
        econ = rsp.getProvider();
        return econ != null;
}
sacred mountain
#

playerinteractentityevent

#

playerinteractatentityevent

#

whats the differen

#

where is the second bracjet lmfao

vital sandal
sacred mountain
#

mightve just missed the end bracket ig

tardy delta
vocal cloud
quaint mantle
quaint mantle
sacred mountain
#

yes

#

depend:

  • Vault
quaint mantle
#

ah right ok

tardy delta
#

depend: [Vault] same thing

sacred mountain
#

that too

quaint mantle
#

so if i need more dependency I can use array ?

sacred mountain
#

if you wanna add more just
depend:

  • Vault
  • PlaceholderAPI
  • EssentialsX
  • Blah
quaint mantle
#

right

#

ok

noble forge
# sacred mountain whats the differen

PlayerInteractAtEntityEvent
Represents an event that is called when a player right clicks an entity that also contains the location where the entity was clicked.

#

PlayerInteractEntityEvent
Represents an event that is called when a player right clicks an entity.

charred blaze
quaint mantle
charred blaze
chrome beacon
#

It can mess things up yes

torpid sapphire
#

can i remove an item from all loot tables with the spigot api? or do i need a datapack for that
im trying to completely remove mending from the game

chrome beacon
#

working with teams can be quite annoying

fervent siren
#

idk why but on my server worldguard is bugging out ive denied pvp but people can still pvp even tho it says "Hey! Sorry, but you can't PvP here.

#

and ive disabled fall damage but people still take it

torpid sapphire
#

yep to what

drowsy helm
#

You can remove it with spigot

charred blaze
cedar laurel
#

Does the Spigot forum have an API?

drowsy helm
#

Forums is just xenforo. So if they have any public api then that

torpid sapphire
arctic moth
#

how would i check if a player has their swing fully charged

cedar laurel
arctic moth
#

and its not nms

#

lol

#

i just found so many useful methods in CraftPlayer though

drowsy helm
tardy delta
#

fixed my stackoverflow bug lol

drowsy helm
#

What was the issue

tardy delta
#

made a nice deadlock by linking nodes to eachother

drowsy helm
torpid sapphire
quaint mantle
drowsy helm
quaint mantle
#

someone solved it before

#

it no longer shows up

#

however it tells me that it can't reach vault api when I have vault plugin installed

dusk flicker
#

its just a notification really

drowsy helm
#

No the first error

torpid sapphire
#

i assume i would need a datapack but i cant find any info on how to actually modify the chest loot tables without mods

hushed spindle
#

does anyone know how Block#getDrops() works

quaint mantle
hushed spindle
#

when applied on a fully grown patch of potatoes or carrots, it returns a collection with two itemstacks
1 potato (as expected)
and 2-4 potatoes

drowsy helm
#

Uh do you have vault in your plugins folder lol

hushed spindle
#

its like it returns both itemstacks where if you were to break it with a hand as well as with a fortune III item