Jump to content

Scytale

Members
  • Posts

    11
  • Joined

  • Last visited

  • Days Won

    1

Scytale last won the day on July 6 2023

Scytale had the most liked content!

Scytale's Achievements

Tree Puncher

Tree Puncher (2/8)

1

Reputation

  1. I think I have a solution by which ... when the open container event is fired, I add a custom ContainerListener to the chest that overrides and handles the slotChanged.
  2. I am looking for some assistance in subscribing to the event of a player transferring items from a container to their inventory. I ask as I find that neither the EntityItemPickupEvent nor the ItemPickupEvent fire in this circumstance, only when picking up from the ground. Any help would be appreciated.
  3. Aside from the passive aggressive response, there was a tip buried there ... mathematical knowledge. For closure ... The heading between two entities is a rotation around the x and y axis - x for horizonal rotation and y for vertical. Thus simple trigonometry is used to calculate the angle of rotation between the x,y coordinates of the two entities.
  4. My experience to date, in this forum, has been some wonderful friendly people who were willing to help and provide some kind assistance.
  5. I am struggling to figure out how to calculate the heading for a projectile, i.e. in .shoot or setArrowHeading, between two entities. For example, if I have entities A and B, and I want a projectile to fire from A to B but want to ignore the facing, I had thought it would have been simple enough to do ... x = target.getX() - firer.getX() ... for x, y and z. This seems to fire it in weird and wonderful directions. After much Googling, it is still not clear to me what I should be passing into shoot for pX, pY and pZ. Any tips or suggestions would be really appreciated.
  6. In case anyone else finds this, the answer is ... String command = "some command"; CommandSourceStack commandSourceStack = serverPlayer.createCommandSourceStack().withSuppressedOutput().withPermission(4); CommandDispatcher<CommandSourceStack> commanddispatcher = serverPlayer.getServer().getCommands().getDispatcher(); ParseResults<CommandSourceStack> results = commanddispatcher.parse(command, commandSourceStack); int result = serverPlayer.getServer().getCommands().performCommand(results, command);
  7. I have a custom screen where I am displaying a number of icons, i.e. textures, using GUIComponent.blit and I want to do Tooltips where the player hovers over the icons. I have been successful in checking mouse x/y in the render class and displaying the tooltip My question is whether there is a way find that mouse is over a specific GUIComponent? Much appreciated.
  8. I wanted to be able to check if a player already has a recipe. I could not find though anyway to access the recipes already assigned to a player. Any advice as to where to get the set of recipes a player already has? Much appreciated,
  9. Dear all, I am struggling to correctly use performCommand and I was hoping for a little help. Firstly, yes I am checking the side (I read the Common Issues) and have before this an event that sends the code server side. Now when looking at many examples or threads they all pass a CommandSourceStack directly into performCommand as the first argument. Now I see that the first arg wants a ParseResults, not a CommandSourceStack. if (!serverPlayer.level.isClientSide() && serverPlayer.getServer() != null) { CommandSourceStack commandSourceStack = serverPlayer.createCommandSourceStack().withSuppressedOutput().withPermission(4); ParseResults<CommandSourceStack> results = new ParseResults<CommandSourceStack>(); serverPlayer.getServer().getCommands().performCommand(results, cmd); } My challenge is that I do not know how to build the ParseResults<CommandSourceStack> correctly so that it can be passed and read. I would be grateful for any suggestions (and exceptionally thankful for any lines of code) that would assist resolving this.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.